diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index 87256eee..00000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,19 +0,0 @@ -// const process = require('node:process') -// process.env.ESLINT_TSCONFIG = 'tsconfig.json' - -module.exports = { - extends: '@antfu', - - rules: { - 'vue/one-component-per-file': 'off', - 'vue/no-reserved-component-names': 'off', - 'vue/no-useless-v-bind': 'off', - 'symbol-description': 'off', - 'no-console': 'warn', - 'no-tabs': 'off', - 'no-invalid-character': 'off', - 'import/first': 'off', - '@stylistic/js/no-tabs': 'off', - 'n/prefer-global/process': 'off', - }, -} diff --git a/.github/PULL_REQUEST_TEMPLATE.md.md b/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from .github/PULL_REQUEST_TEMPLATE.md.md rename to .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml new file mode 100644 index 00000000..c166aea9 --- /dev/null +++ b/.github/actions/setup/action.yml @@ -0,0 +1,16 @@ +name: Setup +description: Installs Node, Enables Corepack and caches pnpm. + +runs: + using: composite + + steps: + - name: Enable corepack + run: corepack enable + shell: bash + + - name: Setup node & pnpm + uses: actions/setup-node@v4 + with: + node-version: lts/* + cache: pnpm diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 9d347542..0988b89e 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -18,7 +18,6 @@ on: # When a labeled 'πŸš€request-deploy' pull request from forked repo, it will be deploy to Cloudflare Pages - labeled # Allows you to run this workflow manually from the Actions tab - # eslint-disable-next-line yml/no-empty-mapping-value workflow_dispatch: permissions: @@ -49,32 +48,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - # Run a build step here - - name: Setup Node.js environment - uses: actions/setup-node@v2 - with: - node-version: 18 - - - uses: pnpm/action-setup@v2 - name: Install pnpm - with: - version: 8 - run_install: false - - - name: Get pnpm store directory - shell: bash - run: | - echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - - - uses: actions/cache@v3 - name: Setup pnpm cache - with: - path: ${{ env.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- + - name: Setup (Install Node & pnpm) + uses: ./.github/actions/setup - name: Install dependencies run: pnpm i --frozen-lockfile diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 7b1d6468..2ffab6ba 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -14,14 +14,13 @@ jobs: release: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/setup-node@v3 - with: - node-version: 18.x + - name: Setup (Install Node & pnpm) + uses: ./.github/actions/setup - - run: npx changelogithub + - run: pnpm dlx changelogithub env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f1a7f7de..7ed6dfa6 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -19,31 +19,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - - name: Setup Node.js environment - uses: actions/setup-node@v2 - with: - node-version: 16 - - - uses: pnpm/action-setup@v2 - name: Install pnpm - with: - version: 8 - run_install: false - - - name: Get pnpm store directory - shell: bash - run: | - echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - - - uses: actions/cache@v3 - name: Setup pnpm cache - with: - path: ${{ env.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- + - name: Setup (Install Node & pnpm) + uses: ./.github/actions/setup - name: Install dependencies run: pnpm i --frozen-lockfile diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 4771846f..64db0b2e 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,7 +1,6 @@ { "recommendations": [ "Vue.volar", - "Vue.vscode-typescript-vue-plugin", "dbaeumer.vscode-eslint" ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 4c691c48..e1a2d038 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,11 +1,27 @@ { + "vue.server.hybridMode": true, + "vue.server.includeLanguages": [ + "vue", + "markdown" + ], "prettier.enable": false, "editor.formatOnSave": false, "editor.codeActionsOnSave": { "source.fixAll.eslint": "explicit", "source.organizeImports": "never" }, - + "eslint.rules.customizations": [ + { "rule": "style/*", "severity": "off" }, + { "rule": "format/*", "severity": "off" }, + { "rule": "*-indent", "severity": "off" }, + { "rule": "*-spacing", "severity": "off" }, + { "rule": "*-spaces", "severity": "off" }, + { "rule": "*-order", "severity": "off" }, + { "rule": "*-dangle", "severity": "off" }, + { "rule": "*-newline", "severity": "off" }, + { "rule": "*quotes", "severity": "off" }, + { "rule": "*semi", "severity": "off" } + ], "eslint.validate": [ "javascript", "javascriptreact", diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 31bf7db9..8970fe1c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,7 +19,7 @@ This repository is structured as follows: ``` apps └── www - β”œβ”€β”€ src + β”œβ”€β”€ src β”‚ └── content └── registry β”œβ”€β”€ default @@ -32,12 +32,12 @@ packages └── cli ``` -| Path | Description | -| --------------------- | ---------------------------------------- | -| `apps/www/app` | The Next.js application for the website. | -| `apps/www/content` | The content for the website. | -| `apps/www/registry` | The registry for the components. | -| `packages/cli` | The `shadcn-vue` package. | +| Path | Description | +| ----------------------------| -------------------------------------------| +| `apps/www/.vitepress` | The Vitepress application for the website. | +| `apps/www/src/content` | The content for the website. | +| `apps/www/src/lib/registry` | The registry for the components. | +| `packages/cli` | The `shadcn-vue` package. | ## Development @@ -79,22 +79,24 @@ The documentation for this project is located in the `www` workspace. You can ru pnpm dev ``` -Documentation is written using [md](https://vitepress.dev/guide/markdown). You can find the documentation files in the `apps/www/content/docs` directory. +Documentation is written using [md](https://vitepress.dev/guide/markdown). You can find the documentation files in the `apps/www/src/content` directory. ## Components -We use a registry system for developing components. You can find the source code for the components under `apps/www/registry`. The components are organized by styles. +We use a registry system for developing components. You can find the source code for the components under `apps/www/src/lib/registry`. The components are organized by styles. ```bash apps └── www - └── registry - β”œβ”€β”€ default - β”‚ β”œβ”€β”€ example - β”‚ └── ui - └── new-york - β”œβ”€β”€ example - └── ui + └── src + └── lib + └── registry + β”œβ”€β”€ default + β”‚ β”œβ”€β”€ example + β”‚ └── ui + └── new-york + β”œβ”€β”€ example + └── ui ``` When adding or modifying components, please ensure that: @@ -130,13 +132,10 @@ the following categories: e.g. `feat(components): add new prop to the avatar component` - If you are interested in the detailed specification you can visit https://www.conventionalcommits.org/ or check out the [Angular Commit Message Guidelines](https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#-commit-message-guidelines). - - ## Requests for new components If you have a request for a new component, please open a discussion on GitHub. We'll be happy to help you out. @@ -155,4 +154,4 @@ Tests are written using [Vitest](https://vitest.dev). You can run all the tests pnpm test ``` -Please ensure that the tests are passing when submitting a pull request. If you're adding new features, please include tests. \ No newline at end of file +Please ensure that the tests are passing when submitting a pull request. If you're adding new features, please include tests. diff --git a/apps/www/.vitepress/config.mts b/apps/www/.vitepress/config.mts index b6cf67bd..7399caab 100644 --- a/apps/www/.vitepress/config.mts +++ b/apps/www/.vitepress/config.mts @@ -3,16 +3,12 @@ import { defineConfig } from 'vitepress' import Icons from 'unplugin-icons/vite' import tailwind from 'tailwindcss' import autoprefixer from 'autoprefixer' -import { createCssVariablesTheme } from 'shiki' +import { transformerMetaWordHighlight } from '@shikijs/transformers' +import { cssVariables } from './theme/config/shiki' -// import { transformerMetaWordHighlight, transformerNotationWordHighlight } from '@shikijs/transformers' import { siteConfig } from './theme/config/site' import ComponentPreviewPlugin from './theme/plugins/previewer' - -const cssVariables = createCssVariablesTheme({ - variablePrefix: '--shiki-', - variableDefaults: {}, -}) +import CodeWrapperPlugin from './theme/plugins/codewrapper' // https://vitepress.dev/reference/site-config export default defineConfig({ @@ -60,11 +56,11 @@ export default defineConfig({ markdown: { theme: cssVariables, codeTransformers: [ - // transformerMetaWordHighlight(), - // transformerNotationWordHighlight(), + transformerMetaWordHighlight(), ], config(md) { md.use(ComponentPreviewPlugin) + md.use(CodeWrapperPlugin) }, }, rewrites: { @@ -74,13 +70,13 @@ export default defineConfig({ css: { postcss: { plugins: [ - tailwind(), + tailwind() as any, autoprefixer(), ], }, }, plugins: [ - Icons({ compiler: 'vue3', autoInstall: true }), + Icons({ compiler: 'vue3', autoInstall: true }) as any, ], resolve: { alias: { diff --git a/apps/www/.vitepress/theme/components/APITable.vue b/apps/www/.vitepress/theme/components/APITable.vue new file mode 100644 index 00000000..c128797d --- /dev/null +++ b/apps/www/.vitepress/theme/components/APITable.vue @@ -0,0 +1,26 @@ + + + diff --git a/apps/www/.vitepress/theme/components/Announcement.vue b/apps/www/.vitepress/theme/components/Announcement.vue new file mode 100644 index 00000000..bcf63a66 --- /dev/null +++ b/apps/www/.vitepress/theme/components/Announcement.vue @@ -0,0 +1,19 @@ + + + diff --git a/apps/www/.vitepress/theme/components/BlockCopyButton.vue b/apps/www/.vitepress/theme/components/BlockCopyButton.vue new file mode 100644 index 00000000..d56e82ca --- /dev/null +++ b/apps/www/.vitepress/theme/components/BlockCopyButton.vue @@ -0,0 +1,38 @@ + + + diff --git a/apps/www/.vitepress/theme/components/BlockPage.vue b/apps/www/.vitepress/theme/components/BlockPage.vue new file mode 100644 index 00000000..83c757f0 --- /dev/null +++ b/apps/www/.vitepress/theme/components/BlockPage.vue @@ -0,0 +1,12 @@ + + + diff --git a/apps/www/.vitepress/theme/components/BlockPreview.vue b/apps/www/.vitepress/theme/components/BlockPreview.vue new file mode 100644 index 00000000..65b33573 --- /dev/null +++ b/apps/www/.vitepress/theme/components/BlockPreview.vue @@ -0,0 +1,245 @@ + + +