diff --git a/README.md b/README.md index d54581ec21..cfdb119c8d 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ They provide an unopinionated, white-label layer that can be extended to your ow - Add `packages/*` back to workspaces in `package.json` - Make the rollup config copy the files from `packages/ui` into `/public` - Uninstall `@lion/ui` as a dependency + - Uninstall `@lion/ajax` as a dependency - Fix FOUC (flash of unstyled text) when navigating to the component page. F.e. visit the [button page](http://localhost:4322/components/button) and notice that the example components are not loaded right away. Hence the page is "blinking" when rendering - Fix the browser console error on [collapsible page](http://localhost:4322/components/collapsible): @@ -99,13 +100,6 @@ They provide an unopinionated, white-label layer that can be extended to your ow Uncaught (in promise) ReferenceError: withDropdownConfig is not defined ``` -- Navigate to [ajax/overview](http://localhost:4322/fundamentals/tools/ajax/overview), [ajax/use-cases](http://localhost:4322/fundamentals/tools/ajax/use-cases). There are errors in the build console: - - ``` - Failed to parse Markdown file "/Users/ai09al/ing/lion/src/content/docs/fundamentals/tools/ajax/overview.md": - Cannot find module '@lion/ajax' - ``` - ## How to install ```bash diff --git a/package-lock.json b/package-lock.json index 026b976021..b5332a2a16 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ ], "dependencies": { "@astrojs/lit": "^3.0.2", + "@lion/ajax": "^1.2.3", "@lion/ui": "0.4.1", "@mdjs/core": "^0.20.0", "astro": "^3.3.1", @@ -3436,6 +3437,11 @@ "@lion/core": "^0.22.0" } }, + "node_modules/@lion/ajax": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@lion/ajax/-/ajax-1.2.3.tgz", + "integrity": "sha512-FzwCZQwXQgVLrQM5yYYHmJb8MH42iID+fZF/KhN7/WdMVOkN1WLXU2L1KKH+e5Md2YZ/p8yBIL+ksfUPtri+jw==" + }, "node_modules/@lion/core": { "version": "0.22.0", "resolved": "https://registry.npmjs.org/@lion/core/-/core-0.22.0.tgz", diff --git a/package.json b/package.json index be8848d968..a0877e8b69 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ ], "dependencies": { "@astrojs/lit": "^3.0.2", + "@lion/ajax": "^1.2.3", "@lion/ui": "0.4.1", "@mdjs/core": "^0.20.0", "astro": "^3.3.1", diff --git a/src/pages/[top]/[...slug].astro b/src/pages/[top]/[...slug].astro index 10b2567e66..d1d4faf454 100644 --- a/src/pages/[top]/[...slug].astro +++ b/src/pages/[top]/[...slug].astro @@ -43,7 +43,6 @@ const getPathMdjsStroriesFile = (entry) => { const mdjsStroriesFileDirectory = path.dirname(entry.slug); return `/public/docs/${mdjsStroriesFileDirectory}/__mdjs-stories.js`; } -const getScopedCustomElementRegistryFilePath = () => '/docs/_assets/scoped-custom-element-registry.min.js'; --- @@ -53,6 +52,5 @@ const getScopedCustomElementRegistryFilePath = () => '/docs/_assets/scoped-custo {blogData.tags} {blogData.author} - diff --git a/src/pages/components/[component].astro b/src/pages/components/[component].astro index 1f25126be9..c6769aa30a 100644 --- a/src/pages/components/[component].astro +++ b/src/pages/components/[component].astro @@ -44,8 +44,6 @@ const getPathMdjsStroriesFile = (entry) => { const mdjsStroriesFileDirectory = path.dirname(entry.slug); return `/public/docs/${mdjsStroriesFileDirectory}/__mdjs-stories.js`; } - -const getScopedCustomElementRegistryFilePath = () => '/docs/_assets/scoped-custom-element-registry.min.js'; --- @@ -56,7 +54,6 @@ const getScopedCustomElementRegistryFilePath = () => '/docs/_assets/scoped-custo )) } - diff --git a/src/utils/remark-plugings/copyMdjsStories/copyMdjsStories.js b/src/utils/remark-plugings/copyMdjsStories/copyMdjsStories.js index 7f91be9d0b..7d885b8c90 100644 --- a/src/utils/remark-plugings/copyMdjsStories/copyMdjsStories.js +++ b/src/utils/remark-plugings/copyMdjsStories/copyMdjsStories.js @@ -78,6 +78,9 @@ function copyMdjsStories() { const exportCmd = `export * from './${currentMarkdownFileMdJsStoryName}' \n`; + if (commonMdjsStoriesContent === '') { + commonMdjsStoriesContent = `import '/public/docs/_assets/scoped-custom-element-registry.min.js'\n`; + } if (commonMdjsStoriesContent.indexOf(exportCmd) === -1) { await fs.promises.writeFile( commonMdjsStoriesFileName,