feat: change alias path

This commit is contained in:
Mathieu Schimmerling
2022-05-12 02:47:50 +02:00
parent 69a64f146b
commit 8faa654a40
12 changed files with 22 additions and 25 deletions

View File

@@ -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

View File

@@ -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. */

View File

@@ -1,5 +1,5 @@
---
import FileCode from '@components/FileCode.astro';
import FileCode from '@/components/FileCode.astro';
const { path, editHref } = Astro.props
---

View File

@@ -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;

View File

@@ -1,5 +1,5 @@
---
import FRAMEWORKS from '@config/frameworks.mjs';
import FRAMEWORKS from '@/frameworks.mjs';
const {id, size = 20} = Astro.props

View File

@@ -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

View File

@@ -1,4 +1,4 @@
import FRAMEWORKS from '@config/frameworks.mjs';
import FRAMEWORKS from '@/frameworks.mjs';
frameworkDisplayModule();

View File

@@ -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();
---

View File

@@ -1,5 +1,5 @@
<script>
import FRAMEWORKS from '@config/frameworks.mjs';
import FRAMEWORKS from '@/frameworks.mjs';
export let tree = [];
</script>

View File

@@ -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`

View File

@@ -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');

View File

@@ -14,10 +14,7 @@
"module": "es2020",
"lib": ["es2018", "dom"],
"paths": {
"@components/*": ["src/components/*"],
"@utils/*": ["src/utils/*"],
"@layouts/*": ["src/layouts/*"],
"@config/*": ["src/*"]
"@/*": ["src/*"]
}
}
}