Skip to content

Commit

Permalink
chore: fix @lion/ajax issue
Browse files Browse the repository at this point in the history
  • Loading branch information
okadurin committed Nov 7, 2023
1 parent 9a5ae49 commit ac7d91f
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 0 additions & 2 deletions src/pages/[top]/[...slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -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';
---

<MainLayout title={entry.slug}>
Expand All @@ -53,6 +52,5 @@ const getScopedCustomElementRegistryFilePath = () => '/docs/_assets/scoped-custo
{blogData.tags}
{blogData.author}
<Content />
<script src={getScopedCustomElementRegistryFilePath()}"></script>
<script type="module" src={getPathMdjsStroriesFile(entry)} mdjs-setup></script>
</MainLayout>
3 changes: 0 additions & 3 deletions src/pages/components/[component].astro
Original file line number Diff line number Diff line change
Expand Up @@ -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';
---

<MainLayout title={entry.slug}>
Expand All @@ -56,7 +54,6 @@ const getScopedCustomElementRegistryFilePath = () => '/docs/_assets/scoped-custo
<content.Content />
))
}
<script src={getScopedCustomElementRegistryFilePath()}"></script>
<script type="module" src={getPathMdjsStroriesFile(componentEntries[0])} mdjs-setup></script>
</ComponentLayout>
</MainLayout>
Expand Down
3 changes: 3 additions & 0 deletions src/utils/remark-plugings/copyMdjsStories/copyMdjsStories.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ac7d91f

Please sign in to comment.