diff --git a/README.md b/README.md index 99bc623..c785169 100644 --- a/README.md +++ b/README.md @@ -311,4 +311,4 @@ This project requires Node.js to be `v14.0.0` or higher, because we use new Java 1. Fork the project and create a new branch 2. Add the new framework SVG logo in `public/framework` 3. Install the ESLint plugin associated to the framework -4. In `frameworks.mjs`, add a new entry with SVG link and ESLint configuration +4. In `src/frameworks.mjs`, add a new entry with SVG link and ESLint configuration diff --git a/src/components/CodeHighlight/astroHighlightCode.js b/src/components/CodeHighlight/astroHighlightCode.js index b9475d5..532dee7 100644 --- a/src/components/CodeHighlight/astroHighlightCode.js +++ b/src/components/CodeHighlight/astroHighlightCode.js @@ -1,4 +1,4 @@ -import { getHighlighter } from '@components/CodeHighlight/Shiki.js'; +import { getHighlighter } from '@/components/CodeHighlight/Shiki.js'; export default async function astroHighlightCode({ code, lang = 'plaintext', theme = 'github-dark', wrap = false }) { /** Replace the shiki class name with a custom astro class name. */ diff --git a/src/components/CodeViewer.astro b/src/components/CodeViewer.astro index de36ba3..1a701d4 100644 --- a/src/components/CodeViewer.astro +++ b/src/components/CodeViewer.astro @@ -1,5 +1,5 @@ --- -import FileCode from '@components/FileCode.astro'; +import FileCode from '@/components/FileCode.astro'; const { path, editHref } = Astro.props --- diff --git a/src/components/FileCode.astro b/src/components/FileCode.astro index 90a2909..43fa29a 100644 --- a/src/components/FileCode.astro +++ b/src/components/FileCode.astro @@ -3,7 +3,7 @@ import fs from 'node:fs/promises'; import nodePath from 'node:path'; import { createFileMapCache } from 'micache'; -import astroHighlightCode from '@components/CodeHighlight/astroHighlightCode.js'; +import astroHighlightCode from '@/components/CodeHighlight/astroHighlightCode.js'; const { path, lang, theme = 'github-dark', wrap = false } = Astro.props; diff --git a/src/components/FrameworkLabel.astro b/src/components/FrameworkLabel.astro index 274f635..e922f2a 100644 --- a/src/components/FrameworkLabel.astro +++ b/src/components/FrameworkLabel.astro @@ -1,5 +1,5 @@ --- -import FRAMEWORKS from '@config/frameworks.mjs'; +import FRAMEWORKS from '@/frameworks.mjs'; const {id, size = 20} = Astro.props diff --git a/src/components/Section.astro b/src/components/Section.astro index ff3fab3..7e3e051 100644 --- a/src/components/Section.astro +++ b/src/components/Section.astro @@ -4,13 +4,13 @@ import kebabCase from 'lodash.kebabcase' import { Markdown } from 'astro/components' import nodePath from 'node:path' -import Title from '@components/Title.svelte' -import FrameworkLabel from '@components/FrameworkLabel.astro' -import FRAMEWORKS from '@config/frameworks.mjs' -import CodeViewer from '@components/CodeViewer.astro' -import createVue3REPL from '@utils/createVue3REPL.js' -import createSvelteREPL from '@utils/createSvelteREPL.js' -import createAlpineREPL from '@utils/createAlpineREPL.js' +import Title from '@/components/Title.svelte' +import FrameworkLabel from '@/components/FrameworkLabel.astro' +import FRAMEWORKS from '@/frameworks.mjs' +import CodeViewer from '@/components/CodeViewer.astro' +import createVue3REPL from '@/utils/createVue3REPL.js' +import createSvelteREPL from '@/utils/createSvelteREPL.js' +import createAlpineREPL from '@/utils/createAlpineREPL.js' const { path: sectionPath } = Astro.props diff --git a/src/components/Section/frameworkDisplay.js b/src/components/Section/frameworkDisplay.js index 88a6373..92cd2a7 100644 --- a/src/components/Section/frameworkDisplay.js +++ b/src/components/Section/frameworkDisplay.js @@ -1,4 +1,4 @@ -import FRAMEWORKS from '@config/frameworks.mjs'; +import FRAMEWORKS from '@/frameworks.mjs'; frameworkDisplayModule(); diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index 051c97d..1cfbf0f 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -1,8 +1,8 @@ --- -import FRAMEWORKS from '@config/frameworks.mjs'; -import BaseLayout from '@layouts/BaseLayout.svelte'; -import generateContentTree from '@utils/generateContentTree.js'; -import FrameworkLabel from '@components/FrameworkLabel.astro'; +import FRAMEWORKS from '@/frameworks.mjs'; +import BaseLayout from '@/layouts/BaseLayout.svelte'; +import generateContentTree from '@/utils/generateContentTree.js'; +import FrameworkLabel from '@/components/FrameworkLabel.astro'; const tree = await generateContentTree(); --- diff --git a/src/layouts/BaseLayout.svelte b/src/layouts/BaseLayout.svelte index ec15de9..0636f9c 100644 --- a/src/layouts/BaseLayout.svelte +++ b/src/layouts/BaseLayout.svelte @@ -1,5 +1,5 @@ diff --git a/src/pages/index.astro b/src/pages/index.astro index aedb9af..33705be 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -2,8 +2,8 @@ import fs from 'node:fs/promises'; import { packageDirectory } from 'pkg-dir'; -import Layout from '@layouts/BaseLayout.astro'; -import Section from '@components/Section.astro'; +import Layout from '@/layouts/BaseLayout.astro'; +import Section from '@/components/Section.astro'; const rootDir = await packageDirectory() const contentURL = `${rootDir}/content` diff --git a/src/utils/createFileMapCache.js b/src/utils/createFileMapCache.js index 8a6d95f..9cf99e5 100644 --- a/src/utils/createFileMapCache.js +++ b/src/utils/createFileMapCache.js @@ -1,7 +1,7 @@ import fs from 'node:fs/promises'; import crypto from 'crypto'; -import createFsCache from '@utils/createFsCache.js'; +import createFsCache from '@/utils/createFsCache.js'; async function md5(data) { return crypto.createHash('md5').update(data).digest('hex'); diff --git a/tsconfig.json b/tsconfig.json index 8598e67..cc3cfd5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,10 +14,7 @@ "module": "es2020", "lib": ["es2018", "dom"], "paths": { - "@components/*": ["src/components/*"], - "@utils/*": ["src/utils/*"], - "@layouts/*": ["src/layouts/*"], - "@config/*": ["src/*"] + "@/*": ["src/*"] } } }