diff --git a/.changeset/README.md b/.changeset/README.md deleted file mode 100644 index e5b6d8d6a..000000000 --- a/.changeset/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Changesets - -Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works -with multi-package repos, or single-package repos to help you version and publish your code. You can -find the full documentation for it [in our repository](https://github.com/changesets/changesets) - -We have a quick list of common questions to get you started engaging with this project in -[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) diff --git a/.changeset/config.json b/.changeset/config.json deleted file mode 100644 index f44e90321..000000000 --- a/.changeset/config.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json", - "changelog": ["@changesets/changelog-github", { "repo": "vue-macros/vue-macros" }], - "commit": false, - "fixed": [], - "linked": [], - "access": "public", - "baseBranch": "main", - "updateInternalDependencies": "patch", - "ignore": ["playground*", "docs"] -} diff --git a/.github/renovate.json b/.github/renovate.json new file mode 100644 index 000000000..a20977966 --- /dev/null +++ b/.github/renovate.json @@ -0,0 +1,24 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["github>sxzz/renovate-config"], + "packageRules": [ + { + "matchPackageNames": ["vue"], + "matchUpdateTypes": ["major"], + "enabled": false + }, + { + "matchPackageNames": ["typescript"], + "matchUpdateTypes": ["major", "minor"], + "enabled": false + }, + { + "groupName": "volarjs", + "groupSlug": "volar-related", + "matchPackageNames": ["vue-tsc", "@vue/language-core", "@volar{/,}**"], + "rangeStrategy": "replace", + "matchDepTypes": ["peerDependencies", "devDependencies", "dependencies"] + } + ], + "ignoreDeps": [] +} diff --git a/.github/renovate.json5 b/.github/renovate.json5 deleted file mode 100644 index 43d707397..000000000 --- a/.github/renovate.json5 +++ /dev/null @@ -1,15 +0,0 @@ -{ - $schema: 'https://docs.renovatebot.com/renovate-schema.json', - extends: ['github>sxzz/renovate-config'], - packageRules: [ - { - groupName: 'volarjs', - groupSlug: 'volar-related', - matchPackagePrefixes: ['@volar'], - matchPackageNames: ['vue-tsc', '@vue/language-core'], - rangeStrategy: 'replace', - matchDepTypes: ['peerDependencies', 'devDependencies', 'dependencies'], - }, - ], - ignoreDeps: ['vue', 'vue2', 'typescript'], -} diff --git a/.github/workflows/release-commit.yml b/.github/workflows/release-commit.yml new file mode 100644 index 000000000..a7ca29a9a --- /dev/null +++ b/.github/workflows/release-commit.yml @@ -0,0 +1,10 @@ +name: Publish Any Commit +on: [push, pull_request] + +jobs: + release: + if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository + uses: sxzz/workflows/.github/workflows/release-commit.yml@v1 + with: + packages: "'./packages/*'" + compact: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ec58b1cc9..fa8455d2b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,51 +2,17 @@ name: Release on: push: - branches: - - main - - beta - -concurrency: ${{ github.workflow }}-${{ github.ref }} + tags: + - 'v*' + workflow_dispatch: {} jobs: release: - name: Release - runs-on: ubuntu-latest + uses: sxzz/workflows/.github/workflows/release.yml@v1 + with: + publish: true + build: pnpm build + permissions: - id-token: write - actions: write - pull-requests: write - statuses: write contents: write - issues: write - security-events: write - pages: read - - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - uses: pnpm/action-setup@v2 - - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: lts/* - cache: pnpm - - - name: Install Dependencies - run: pnpm i --frozen-lockfile - - - name: Create Release Pull Request or Publish to npm - id: changesets - uses: changesets/action@v1 - with: - commit: 'chore: bump versions' - title: 'chore: bump versions' - publish: pnpm run publish - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} - NPM_CONFIG_PROVENANCE: true + id-token: write diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 71e45b15f..a6ae88a95 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -4,6 +4,8 @@ on: push: branches: - main + - next + - vue-ecosystem-ci pull_request: branches: @@ -15,68 +17,69 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 + - name: Install pnpm + uses: pnpm/action-setup@v4.1.0 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: lts/* cache: pnpm - - name: Setup - run: pnpm i -g @antfu/ni - - name: Install - run: nci + run: pnpm i - - name: Build - run: nr build - env: - TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} - TURBO_TEAM: sxzz + - name: ESLint + run: pnpm run lint - - name: Lint - run: nr lint + - name: Format Check + run: pnpm run format:check - - name: Type Check - run: nr typecheck + - name: Monorepo Check + run: pnpm run mono:check + + - name: CSpell Check + run: pnpm run cspell:check test: strategy: matrix: os: [ubuntu-latest, windows-latest] - node-version: [16, 18] + node-version: [20, 22, 24] fail-fast: false runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 + - name: Install pnpm + uses: pnpm/action-setup@v4.1.0 - name: Set node ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} cache: pnpm - - name: Setup - run: pnpm i -g @antfu/ni - - name: Install - run: nci + run: pnpm i - name: Build - run: nr build - env: - TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} - TURBO_TEAM: sxzz + run: pnpm run build + + - name: Type Check + run: pnpm run typecheck + if: ${{ matrix.os == 'ubuntu-latest' }} + + - name: Publint + run: pnpm run publint + if: ${{ matrix.os == 'ubuntu-latest' }} - name: Unit Test - run: nr test + run: pnpm run test - name: Build Playground run: pnpm run --filter "./playground/*" --parallel build diff --git a/.gitignore b/.gitignore index a2ddafb13..ee347f20a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ node_modules dist coverage -.turbo .idea dev-dist docs/.vitepress/cache @@ -11,3 +10,4 @@ docs/.vitepress/cache .DS_Store .pnpm-debug.log* .eslintcache +*.bundled* diff --git a/.node-version b/.node-version new file mode 100644 index 000000000..b009dfb9d --- /dev/null +++ b/.node-version @@ -0,0 +1 @@ +lts/* diff --git a/.nvmrc b/.nvmrc deleted file mode 100644 index 3f430af82..000000000 --- a/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -v18 diff --git a/.tazerc.json b/.tazerc.json new file mode 100644 index 000000000..cdf95f8cb --- /dev/null +++ b/.tazerc.json @@ -0,0 +1,13 @@ +{ + "mode": "latest", + "write": true, + "install": true, + "update": true, + "recursive": true, + "includeLocked": true, + "interactive": true, + "packageMode": { + "@vue/language-core": "minor", + "vue-tsc": "minor" + } +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 821d15cb7..26ffc16c6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,28 +1,18 @@ { - "cSpell.words": [ - "attributify", - "esbuild", - "sxzz", - "tsup", - "unocss", - "unplugin", - "vitest", - "vmodel", - "vueuse" - ], - "unocss.root": [ - "./docs", - "./playground/vue3", - "./packages/devtools/src/client" - ], "explorer.fileNesting.patterns": { - "index.ts": "rollup.ts, vite.ts, webpack.ts, esbuild.ts", - "macros.d.ts": "macros*.d.ts, vue2-macros*.d.ts" + "index.ts": "rollup.ts, vite.ts, webpack.ts, esbuild.ts, rspack.ts, rolldown.ts", + "macros.d.ts": "macros*.d.ts" }, - "files.exclude": { - "**/.turbo": true - }, - "eslint.experimental.useFlatConfig": true, - - "vue.server.reverseConfigFilePriority": true + "exportall.config.folderListener": [ + "/packages/api/src/vue", + "/packages/api/src/ts", + "/packages/config/src" + ], + "exportall.config.semis": false, + "search.exclude": { + "**/coverage": true, + "**/dist": true, + "**/node_modules": true, + "docs/.vitepress/cache": true + } } diff --git a/FUNDING.json b/FUNDING.json new file mode 100644 index 000000000..a82941ff5 --- /dev/null +++ b/FUNDING.json @@ -0,0 +1,7 @@ +{ + "drips": { + "ethereum": { + "ownedBy": "0x86930E4c4EF9d62d44e3363E4D23e759BCDEEAa0" + } + } +} diff --git a/README.md b/README.md index 3cb8121b2..25732dd72 100644 --- a/README.md +++ b/README.md @@ -7,28 +7,33 @@

Explore more macros and syntax sugar to Vue.

- - NPM version + + NPM version

-

- 📜 Documentation -

- ## Features - ✨ Explore more macros and syntax sugar to Vue. - 💚 Supports both Vue 2.7 and Vue 3 out-of-the-box. - 🦾 Full TypeScript / Volar support. -- ⚡️ Supports Vite, Nuxt, Webpack, Vue CLI, Rollup 3, esbuild and more, powered by [unplugin](https://github.com/unjs/unplugin). +- ⚡️ Supports most bundlers powered by [unplugin](https://github.com/unjs/unplugin). + - Vite, Nuxt + - Webpack, Rspack, Vue CLI + - Rollup + - esbuild + - and more... ## Installation ```bash -npm i -D unplugin-vue-macros +npm i -D vue-macros ``` +## Usage + +[📜 Documentation](https://vue-macros.dev/) + ## Sponsors

@@ -50,6 +55,7 @@ npm i -D unplugin-vue-macros ## Related Libraries - [vue-functional-ref](https://github.com/sxzz/vue-functional-ref) - Functional-style refs for Vue. +- [Vue Vine](https://vue-vine.dev/) - Another style of writing Vue components. ## License diff --git a/cspell.json b/cspell.json new file mode 100644 index 000000000..14db3e05b --- /dev/null +++ b/cspell.json @@ -0,0 +1,71 @@ +/* eslint jsonc/sort-array-values: ['error', { pathPattern: '.*', order: { type: 'asc' } }] */ + +{ + "version": "0.2", + "ignorePaths": [ + "**/CHANGELOG.md", + "**/dist", + "**/node_modules", + "**/package.json", + "**/pnpm-lock.yaml", + "**/pnpm-workspace.yaml", + "**/tsconfig.json", + "*.snap", + "*.svg" + ], + "languageSettings": [ + { + "languageId": "*", + "locale": "*", + "ignoreRegExpList": ["/import\\s.*/"], + "dictionaries": [], + "dictionaryDefinitions": [] + } + ], + "words": [ + "alexzhang", + "astro", + "attributify", + "codegen", + "codespaces", + "esbuild", + "foobaz", + "interface", + "llmstxt", + "monoman", + "mousemove", + "neverthrow", + "nolebase", + "nuxt", + "onwarn", + "pluginutils", + "publint", + "quansync", + "quasis", + "quux", + "quuz", + "rolldown", + "rollup", + "rsbuild", + "rspack", + "shiki", + "strs", + "stylex", + "stylexjs", + "sxzz", + "tada", + "tsdown", + "twoslash", + "unconfig", + "undefinedable", + "unenv", + "unocss", + "unplugin", + "vite", + "vitesse", + "vmodel", + "vnode", + "vueuse", + "zhiyuanzmj" + ] +} diff --git a/docs/.vitepress/components/HomePage.vue b/docs/.vitepress/components/HomePage.vue index 59c72892b..ca3170be6 100644 --- a/docs/.vitepress/components/HomePage.vue +++ b/docs/.vitepress/components/HomePage.vue @@ -1,27 +1,63 @@