Forráskód Böngészése

workflow: move private packages to separate directory

Evan You 1 éve
szülő
commit
6a5b2098e1
80 módosított fájl, 187 hozzáadás és 97 törlés
  1. 2 2
      .github/contributing.md
  2. 2 2
      .github/renovate.json5
  3. 9 2
      eslint.config.js
  4. 3 3
      package.json
  5. 1 1
      packages-private/dts-built-test/README.md
  6. 1 1
      packages-private/dts-built-test/package.json
  7. 0 0
      packages-private/dts-built-test/src/index.ts
  8. 0 0
      packages-private/dts-built-test/tsconfig.json
  9. 1 1
      packages-private/dts-test/README.md
  10. 0 0
      packages-private/dts-test/appDirective.test-d.ts
  11. 0 0
      packages-private/dts-test/appUse.test-d.ts
  12. 1 1
      packages-private/dts-test/built.test-d.ts
  13. 0 0
      packages-private/dts-test/compiler.test-d.ts
  14. 0 0
      packages-private/dts-test/component.test-d.ts
  15. 0 0
      packages-private/dts-test/componentInstance.test-d.tsx
  16. 0 0
      packages-private/dts-test/componentTypeExtensions.test-d.tsx
  17. 0 0
      packages-private/dts-test/defineComponent.test-d.tsx
  18. 0 0
      packages-private/dts-test/defineCustomElement.test-d.ts
  19. 0 0
      packages-private/dts-test/directives.test-d.ts
  20. 0 0
      packages-private/dts-test/extractProps.test-d.ts
  21. 0 0
      packages-private/dts-test/functionalComponent.test-d.tsx
  22. 0 0
      packages-private/dts-test/h.test-d.ts
  23. 0 0
      packages-private/dts-test/inject.test-d.ts
  24. 1 1
      packages-private/dts-test/package.json
  25. 0 0
      packages-private/dts-test/reactivity.test-d.ts
  26. 0 0
      packages-private/dts-test/ref.test-d.ts
  27. 0 0
      packages-private/dts-test/setupHelpers.test-d.ts
  28. 0 0
      packages-private/dts-test/tsconfig.test.json
  29. 0 0
      packages-private/dts-test/tsx.test-d.tsx
  30. 0 0
      packages-private/dts-test/utils.d.ts
  31. 0 0
      packages-private/dts-test/watch.test-d.ts
  32. 0 0
      packages-private/sfc-playground/README.md
  33. 0 0
      packages-private/sfc-playground/index.html
  34. 1 1
      packages-private/sfc-playground/package.json
  35. 0 0
      packages-private/sfc-playground/public/logo.svg
  36. 0 0
      packages-private/sfc-playground/src/App.vue
  37. 1 1
      packages-private/sfc-playground/src/Header.vue
  38. 0 0
      packages-private/sfc-playground/src/VersionSelect.vue
  39. 0 0
      packages-private/sfc-playground/src/download/download.ts
  40. 0 0
      packages-private/sfc-playground/src/download/template/README.md
  41. 0 0
      packages-private/sfc-playground/src/download/template/index.html
  42. 0 0
      packages-private/sfc-playground/src/download/template/main.js
  43. 0 0
      packages-private/sfc-playground/src/download/template/package.json
  44. 0 0
      packages-private/sfc-playground/src/download/template/vite.config.js
  45. 0 0
      packages-private/sfc-playground/src/icons/Copy.vue
  46. 0 0
      packages-private/sfc-playground/src/icons/Download.vue
  47. 0 0
      packages-private/sfc-playground/src/icons/GitHub.vue
  48. 0 0
      packages-private/sfc-playground/src/icons/Moon.vue
  49. 0 0
      packages-private/sfc-playground/src/icons/Reload.vue
  50. 0 0
      packages-private/sfc-playground/src/icons/Share.vue
  51. 0 0
      packages-private/sfc-playground/src/icons/Sun.vue
  52. 0 0
      packages-private/sfc-playground/src/main.ts
  53. 0 0
      packages-private/sfc-playground/src/vue-dev-proxy-prod.ts
  54. 0 0
      packages-private/sfc-playground/src/vue-dev-proxy.ts
  55. 0 0
      packages-private/sfc-playground/src/vue-server-renderer-dev-proxy.ts
  56. 0 0
      packages-private/sfc-playground/vercel.json
  57. 6 6
      packages-private/sfc-playground/vite.config.ts
  58. 0 0
      packages-private/template-explorer/README.md
  59. 0 0
      packages-private/template-explorer/_redirects
  60. 0 0
      packages-private/template-explorer/index.html
  61. 0 0
      packages-private/template-explorer/local.html
  62. 0 0
      packages-private/template-explorer/package.json
  63. 0 0
      packages-private/template-explorer/src/index.ts
  64. 0 0
      packages-private/template-explorer/src/options.ts
  65. 0 0
      packages-private/template-explorer/src/theme.ts
  66. 0 0
      packages-private/template-explorer/style.css
  67. 15 0
      packages-private/vite-debug/App.vue
  68. 1 0
      packages-private/vite-debug/README.md
  69. 2 0
      packages-private/vite-debug/index.html
  70. 6 0
      packages-private/vite-debug/main.ts
  71. 15 0
      packages-private/vite-debug/package.json
  72. 7 0
      packages-private/vite-debug/tsconfig.json
  73. 6 0
      packages-private/vite-debug/vite.config.ts
  74. 67 52
      pnpm-lock.yaml
  75. 2 0
      pnpm-workspace.yaml
  76. 6 1
      rollup.config.js
  77. 11 6
      scripts/build.js
  78. 16 13
      scripts/utils.js
  79. 3 2
      tsconfig.json
  80. 1 1
      vitest.config.ts

+ 2 - 2
.github/contributing.md

@@ -236,7 +236,7 @@ Tests that test against source code are grouped under `nr test-unit`, while test
 
 ### `nr test-dts`
 
-Runs `nr build-dts` first, then verify the type tests in `packages/dts-test` are working correctly against the actual built type declarations.
+Runs `nr build-dts` first, then verify the type tests in `packages-private/dts-test` are working correctly against the actual built type declarations.
 
 ## Project Structure
 
@@ -335,7 +335,7 @@ Test coverage is continuously deployed at https://coverage.vuejs.org. PRs that i
 
 ### Testing Type Definition Correctness
 
-Type tests are located in the `packages/dts-test` directory. To run the dts tests, run `nr test-dts`. Note that the type test requires all relevant `*.d.ts` files to be built first (and the script does it for you). Once the `d.ts` files are built and up-to-date, the tests can be re-run by running `nr test-dts-only`.
+Type tests are located in the `packages-private/dts-test` directory. To run the dts tests, run `nr test-dts`. Note that the type test requires all relevant `*.d.ts` files to be built first (and the script does it for you). Once the `d.ts` files are built and up-to-date, the tests can be re-run by running `nr test-dts-only`.
 
 ## Financial Contribution
 

+ 2 - 2
.github/renovate.json5

@@ -17,8 +17,8 @@
     {
       groupName: 'playground',
       matchFileNames: [
-        'packages/sfc-playground/package.json',
-        'packages/template-explorer/package.json',
+        'packages-private/sfc-playground/package.json',
+        'packages-private/template-explorer/package.json',
       ],
     },
     {

+ 9 - 2
eslint.config.js

@@ -76,7 +76,11 @@ export default tseslint.config(
 
   // tests, no restrictions (runs in Node / Vitest with jsdom)
   {
-    files: ['**/__tests__/**', 'packages/dts-test/**'],
+    files: [
+      '**/__tests__/**',
+      'packages-private/dts-test/**',
+      'packages-private/dts-build-test/**',
+    ],
     plugins: { vitest },
     languageOptions: {
       globals: {
@@ -119,7 +123,10 @@ export default tseslint.config(
 
   // Private package, browser only + no syntax restrictions
   {
-    files: ['packages/template-explorer/**', 'packages/sfc-playground/**'],
+    files: [
+      'packages-private/template-explorer/**',
+      'packages-private/sfc-playground/**',
+    ],
     rules: {
       'no-restricted-globals': ['error', ...NodeGlobals],
       'no-restricted-syntax': ['error', banConstEnum],

+ 3 - 3
package.json

@@ -20,7 +20,7 @@
     "test-unit": "vitest -c vitest.unit.config.ts",
     "test-e2e": "node scripts/build.js vue -f global -d && vitest -c vitest.e2e.config.ts",
     "test-dts": "run-s build-dts test-dts-only",
-    "test-dts-only": "tsc -p packages/dts-built-test/tsconfig.json && tsc -p ./packages/dts-test/tsconfig.test.json",
+    "test-dts-only": "tsc -p packages-private/dts-built-test/tsconfig.json && tsc -p ./packages-private/dts-test/tsconfig.test.json",
     "test-coverage": "vitest -c vitest.unit.config.ts --coverage",
     "test-bench": "vitest bench",
     "release": "node scripts/release.js",
@@ -29,7 +29,7 @@
     "dev-compiler": "run-p \"dev template-explorer\" serve",
     "dev-sfc": "run-s dev-sfc-prepare dev-sfc-run",
     "dev-sfc-prepare": "node scripts/pre-dev-sfc.js || npm run build-all-cjs",
-    "dev-sfc-serve": "vite packages/sfc-playground --host",
+    "dev-sfc-serve": "vite packages-private/sfc-playground --host",
     "dev-sfc-run": "run-p \"dev compiler-sfc -f esm-browser\" \"dev vue -if esm-bundler-runtime\" \"dev vue -ipf esm-browser-runtime\" \"dev server-renderer -if esm-bundler\" dev-sfc-serve",
     "serve": "serve",
     "open": "open http://localhost:3000/packages/template-explorer/local.html",
@@ -38,7 +38,7 @@
     "build-runtime-esm": "node scripts/build.js runtime reactivity shared -af esm-bundler && node scripts/build.js vue -f esm-bundler-runtime && node scripts/build.js vue -f esm-browser-runtime",
     "build-browser-esm": "node scripts/build.js runtime reactivity shared -af esm-bundler && node scripts/build.js vue -f esm-bundler && node scripts/build.js vue -f esm-browser",
     "build-ssr-esm": "node scripts/build.js compiler-sfc server-renderer -f esm-browser",
-    "build-sfc-playground-self": "cd packages/sfc-playground && npm run build",
+    "build-sfc-playground-self": "cd packages-private/sfc-playground && npm run build",
     "preinstall": "npx only-allow pnpm",
     "postinstall": "simple-git-hooks"
   },

+ 1 - 1
packages/dts-built-test/README.md → packages-private/dts-built-test/README.md

@@ -2,4 +2,4 @@
 
 This package is private and for testing only. It is used to verify edge cases for external libraries that build their types using Vue core types - e.g. Vuetify as in [#8376](https://github.com/vuejs/core/issues/8376).
 
-When running the `build-dts` task, this package's types are built alongside other packages. Then, during `test-dts-only` it is imported and used in [`packages/dts-test/built.test-d.ts`](https://github.com/vuejs/core/blob/main/packages/dts-test/built.test-d.ts) to verify that the built types work correctly.
+When running the `build-dts` task, this package's types are built alongside other packages. Then, during `test-dts-only` it is imported and used in [`packages-private/dts-test/built.test-d.ts`](https://github.com/vuejs/core/blob/main/packages-private/dts-test/built.test-d.ts) to verify that the built types work correctly.

+ 1 - 1
packages/dts-built-test/package.json → packages-private/dts-built-test/package.json

@@ -1,5 +1,5 @@
 {
-  "name": "@vue/dts-built-test",
+  "name": "dts-built-test",
   "private": true,
   "version": "0.0.0",
   "types": "dist/index.d.ts",

+ 0 - 0
packages/dts-built-test/src/index.ts → packages-private/dts-built-test/src/index.ts


+ 0 - 0
packages/dts-built-test/tsconfig.json → packages-private/dts-built-test/tsconfig.json


+ 1 - 1
packages/dts-test/README.md → packages-private/dts-test/README.md

@@ -4,4 +4,4 @@ Tests TypeScript types to ensure the types remain as expected.
 
 - This directory is included in the root `tsconfig.json`, where package imports are aliased to `src` directories, so in IDEs and the `pnpm check` script the types are validated against source code.
 
-- When running `tsc` with `packages/dts-test/tsconfig.test.json`, packages are resolved using normal `node` resolution, so the types are validated against actual **built** types. This requires the types to be built first via `pnpm build-dts`.
+- When running `tsc` with `packages-private/dts-test/tsconfig.test.json`, packages are resolved using normal `node` resolution, so the types are validated against actual **built** types. This requires the types to be built first via `pnpm build-dts`.

+ 0 - 0
packages/dts-test/appDirective.test-d.ts → packages-private/dts-test/appDirective.test-d.ts


+ 0 - 0
packages/dts-test/appUse.test-d.ts → packages-private/dts-test/appUse.test-d.ts


+ 1 - 1
packages/dts-test/built.test-d.ts → packages-private/dts-test/built.test-d.ts

@@ -1,4 +1,4 @@
-import { CustomPropsNotErased } from '@vue/dts-built-test'
+import { CustomPropsNotErased } from 'dts-built-test/src/index'
 import { describe, expectType } from './utils'
 
 declare module 'vue' {

+ 0 - 0
packages/dts-test/compiler.test-d.ts → packages-private/dts-test/compiler.test-d.ts


+ 0 - 0
packages/dts-test/component.test-d.ts → packages-private/dts-test/component.test-d.ts


+ 0 - 0
packages/dts-test/componentInstance.test-d.tsx → packages-private/dts-test/componentInstance.test-d.tsx


+ 0 - 0
packages/dts-test/componentTypeExtensions.test-d.tsx → packages-private/dts-test/componentTypeExtensions.test-d.tsx


+ 0 - 0
packages/dts-test/defineComponent.test-d.tsx → packages-private/dts-test/defineComponent.test-d.tsx


+ 0 - 0
packages/dts-test/defineCustomElement.test-d.ts → packages-private/dts-test/defineCustomElement.test-d.ts


+ 0 - 0
packages/dts-test/directives.test-d.ts → packages-private/dts-test/directives.test-d.ts


+ 0 - 0
packages/dts-test/extractProps.test-d.ts → packages-private/dts-test/extractProps.test-d.ts


+ 0 - 0
packages/dts-test/functionalComponent.test-d.tsx → packages-private/dts-test/functionalComponent.test-d.tsx


+ 0 - 0
packages/dts-test/h.test-d.ts → packages-private/dts-test/h.test-d.ts


+ 0 - 0
packages/dts-test/inject.test-d.ts → packages-private/dts-test/inject.test-d.ts


+ 1 - 1
packages/dts-test/package.json → packages-private/dts-test/package.json

@@ -4,6 +4,6 @@
   "version": "0.0.0",
   "dependencies": {
     "vue": "workspace:*",
-    "@vue/dts-built-test": "workspace:*"
+    "dts-built-test": "workspace:*"
   }
 }

+ 0 - 0
packages/dts-test/reactivity.test-d.ts → packages-private/dts-test/reactivity.test-d.ts


+ 0 - 0
packages/dts-test/ref.test-d.ts → packages-private/dts-test/ref.test-d.ts


+ 0 - 0
packages/dts-test/setupHelpers.test-d.ts → packages-private/dts-test/setupHelpers.test-d.ts


+ 0 - 0
packages/dts-test/tsconfig.test.json → packages-private/dts-test/tsconfig.test.json


+ 0 - 0
packages/dts-test/tsx.test-d.tsx → packages-private/dts-test/tsx.test-d.tsx


+ 0 - 0
packages/dts-test/utils.d.ts → packages-private/dts-test/utils.d.ts


+ 0 - 0
packages/dts-test/watch.test-d.ts → packages-private/dts-test/watch.test-d.ts


+ 0 - 0
packages/sfc-playground/README.md → packages-private/sfc-playground/README.md


+ 0 - 0
packages/sfc-playground/index.html → packages-private/sfc-playground/index.html


+ 1 - 1
packages/sfc-playground/package.json → packages-private/sfc-playground/package.json

@@ -9,7 +9,7 @@
     "serve": "vite preview"
   },
   "devDependencies": {
-    "@vitejs/plugin-vue": "^5.1.2",
+    "@vitejs/plugin-vue": "catalog:",
     "vite": "catalog:"
   },
   "dependencies": {

+ 0 - 0
packages/sfc-playground/public/logo.svg → packages-private/sfc-playground/public/logo.svg


+ 0 - 0
packages/sfc-playground/src/App.vue → packages-private/sfc-playground/src/App.vue


+ 1 - 1
packages/sfc-playground/src/Header.vue → packages-private/sfc-playground/src/Header.vue

@@ -125,7 +125,7 @@ function toggleDark() {
         <Download />
       </button>
       <a
-        href="https://github.com/vuejs/core/tree/main/packages/sfc-playground"
+        href="https://github.com/vuejs/core/tree/main/packages-private/sfc-playground"
         target="_blank"
         title="View on GitHub"
         class="github"

+ 0 - 0
packages/sfc-playground/src/VersionSelect.vue → packages-private/sfc-playground/src/VersionSelect.vue


+ 0 - 0
packages/sfc-playground/src/download/download.ts → packages-private/sfc-playground/src/download/download.ts


+ 0 - 0
packages/sfc-playground/src/download/template/README.md → packages-private/sfc-playground/src/download/template/README.md


+ 0 - 0
packages/sfc-playground/src/download/template/index.html → packages-private/sfc-playground/src/download/template/index.html


+ 0 - 0
packages/sfc-playground/src/download/template/main.js → packages-private/sfc-playground/src/download/template/main.js


+ 0 - 0
packages/sfc-playground/src/download/template/package.json → packages-private/sfc-playground/src/download/template/package.json


+ 0 - 0
packages/sfc-playground/src/download/template/vite.config.js → packages-private/sfc-playground/src/download/template/vite.config.js


+ 0 - 0
packages/sfc-playground/src/icons/Copy.vue → packages-private/sfc-playground/src/icons/Copy.vue


+ 0 - 0
packages/sfc-playground/src/icons/Download.vue → packages-private/sfc-playground/src/icons/Download.vue


+ 0 - 0
packages/sfc-playground/src/icons/GitHub.vue → packages-private/sfc-playground/src/icons/GitHub.vue


+ 0 - 0
packages/sfc-playground/src/icons/Moon.vue → packages-private/sfc-playground/src/icons/Moon.vue


+ 0 - 0
packages/sfc-playground/src/icons/Reload.vue → packages-private/sfc-playground/src/icons/Reload.vue


+ 0 - 0
packages/sfc-playground/src/icons/Share.vue → packages-private/sfc-playground/src/icons/Share.vue


+ 0 - 0
packages/sfc-playground/src/icons/Sun.vue → packages-private/sfc-playground/src/icons/Sun.vue


+ 0 - 0
packages/sfc-playground/src/main.ts → packages-private/sfc-playground/src/main.ts


+ 0 - 0
packages/sfc-playground/src/vue-dev-proxy-prod.ts → packages-private/sfc-playground/src/vue-dev-proxy-prod.ts


+ 0 - 0
packages/sfc-playground/src/vue-dev-proxy.ts → packages-private/sfc-playground/src/vue-dev-proxy.ts


+ 0 - 0
packages/sfc-playground/src/vue-server-renderer-dev-proxy.ts → packages-private/sfc-playground/src/vue-server-renderer-dev-proxy.ts


+ 0 - 0
packages/sfc-playground/vercel.json → packages-private/sfc-playground/vercel.json


+ 6 - 6
packages/sfc-playground/vite.config.ts → packages-private/sfc-playground/vite.config.ts

@@ -34,7 +34,7 @@ function copyVuePlugin(): Plugin {
     name: 'copy-vue',
     generateBundle() {
       const copyFile = (file: string) => {
-        const filePath = path.resolve(__dirname, file)
+        const filePath = path.resolve(__dirname, '../../packages', file)
         const basename = path.basename(file)
         if (!fs.existsSync(filePath)) {
           throw new Error(
@@ -49,11 +49,11 @@ function copyVuePlugin(): Plugin {
         })
       }
 
-      copyFile(`../vue/dist/vue.esm-browser.js`)
-      copyFile(`../vue/dist/vue.esm-browser.prod.js`)
-      copyFile(`../vue/dist/vue.runtime.esm-browser.js`)
-      copyFile(`../vue/dist/vue.runtime.esm-browser.prod.js`)
-      copyFile(`../server-renderer/dist/server-renderer.esm-browser.js`)
+      copyFile(`vue/dist/vue.esm-browser.js`)
+      copyFile(`vue/dist/vue.esm-browser.prod.js`)
+      copyFile(`vue/dist/vue.runtime.esm-browser.js`)
+      copyFile(`vue/dist/vue.runtime.esm-browser.prod.js`)
+      copyFile(`server-renderer/dist/server-renderer.esm-browser.js`)
     },
   }
 }

+ 0 - 0
packages/template-explorer/README.md → packages-private/template-explorer/README.md


+ 0 - 0
packages/template-explorer/_redirects → packages-private/template-explorer/_redirects


+ 0 - 0
packages/template-explorer/index.html → packages-private/template-explorer/index.html


+ 0 - 0
packages/template-explorer/local.html → packages-private/template-explorer/local.html


+ 0 - 0
packages/template-explorer/package.json → packages-private/template-explorer/package.json


+ 0 - 0
packages/template-explorer/src/index.ts → packages-private/template-explorer/src/index.ts


+ 0 - 0
packages/template-explorer/src/options.ts → packages-private/template-explorer/src/options.ts


+ 0 - 0
packages/template-explorer/src/theme.ts → packages-private/template-explorer/src/theme.ts


+ 0 - 0
packages/template-explorer/style.css → packages-private/template-explorer/style.css


+ 15 - 0
packages-private/vite-debug/App.vue

@@ -0,0 +1,15 @@
+<script setup>
+import { ref } from 'vue'
+
+const count = ref(0)
+</script>
+
+<template>
+  <button @click="count++">{{ count }}</button>
+</template>
+
+<style>
+button {
+  color: red;
+}
+</style>

+ 1 - 0
packages-private/vite-debug/README.md

@@ -0,0 +1 @@
+This package is used for debugging issues that are related to `@vitejs/plugin-vue`, or can only be reproduced in a Vite-based setup. It aims to be as close to production as possible so Vue packages are resolved to the dist files instead of source.

+ 2 - 0
packages-private/vite-debug/index.html

@@ -0,0 +1,2 @@
+<script type="module" src="./main.ts"></script>
+<div id="app"></div>

+ 6 - 0
packages-private/vite-debug/main.ts

@@ -0,0 +1,6 @@
+import { createApp } from 'vue'
+import App from './App.vue'
+
+const app = createApp(App)
+
+app.mount('#app')

+ 15 - 0
packages-private/vite-debug/package.json

@@ -0,0 +1,15 @@
+{
+  "name": "vite-debug",
+  "private": true,
+  "type": "module",
+  "scripts": {
+    "dev": "vite",
+    "build": "vite build",
+    "serve": "vite preview"
+  },
+  "devDependencies": {
+    "@vitejs/plugin-vue": "catalog:",
+    "vite": "catalog:",
+    "vue": "workspace:*"
+  }
+}

+ 7 - 0
packages-private/vite-debug/tsconfig.json

@@ -0,0 +1,7 @@
+{
+  "compilerOptions": {
+    "module": "esnext",
+    "moduleResolution": "bundler"
+  },
+  "include": ["./*"]
+}

+ 6 - 0
packages-private/vite-debug/vite.config.ts

@@ -0,0 +1,6 @@
+import { defineConfig } from 'vite'
+import vue from '@vitejs/plugin-vue'
+
+export default defineConfig({
+  plugins: [vue()],
+})

+ 67 - 52
pnpm-lock.yaml

@@ -12,6 +12,9 @@ catalogs:
     '@babel/types':
       specifier: ^7.25.2
       version: 7.25.2
+    '@vitejs/plugin-vue':
+      specifier: ^5.1.2
+      version: 5.1.2
     estree-walker:
       specifier: ^2.0.2
       version: 2.0.2
@@ -180,6 +183,70 @@ importers:
         specifier: ^2.0.0
         version: 2.0.5(@types/node@20.14.14)(jsdom@24.1.1)(sass@1.77.8)
 
+  packages-private/dts-built-test:
+    dependencies:
+      '@vue/reactivity':
+        specifier: workspace:*
+        version: link:../../packages/reactivity
+      '@vue/shared':
+        specifier: workspace:*
+        version: link:../../packages/shared
+      vue:
+        specifier: workspace:*
+        version: link:../../packages/vue
+
+  packages-private/dts-test:
+    dependencies:
+      dts-built-test:
+        specifier: workspace:*
+        version: link:../dts-built-test
+      vue:
+        specifier: workspace:*
+        version: link:../../packages/vue
+
+  packages-private/sfc-playground:
+    dependencies:
+      '@vue/repl':
+        specifier: ^4.3.1
+        version: 4.3.1
+      file-saver:
+        specifier: ^2.0.5
+        version: 2.0.5
+      jszip:
+        specifier: ^3.10.1
+        version: 3.10.1
+      vue:
+        specifier: workspace:*
+        version: link:../../packages/vue
+    devDependencies:
+      '@vitejs/plugin-vue':
+        specifier: 'catalog:'
+        version: 5.1.2(vite@5.4.0(@types/node@20.14.14)(sass@1.77.8))(vue@packages+vue)
+      vite:
+        specifier: 'catalog:'
+        version: 5.4.0(@types/node@20.14.14)(sass@1.77.8)
+
+  packages-private/template-explorer:
+    dependencies:
+      monaco-editor:
+        specifier: ^0.50.0
+        version: 0.50.0
+      source-map-js:
+        specifier: ^1.2.0
+        version: 1.2.0
+
+  packages-private/vite-debug:
+    devDependencies:
+      '@vitejs/plugin-vue':
+        specifier: 'catalog:'
+        version: 5.1.2(vite@5.4.0(@types/node@20.14.14)(sass@1.77.8))(vue@packages+vue)
+      vite:
+        specifier: 'catalog:'
+        version: 5.4.0(@types/node@20.14.14)(sass@1.77.8)
+      vue:
+        specifier: workspace:*
+        version: link:../../packages/vue
+
   packages/compiler-core:
     dependencies:
       '@babel/parser':
@@ -281,27 +348,6 @@ importers:
         specifier: workspace:*
         version: link:../shared
 
-  packages/dts-built-test:
-    dependencies:
-      '@vue/reactivity':
-        specifier: workspace:*
-        version: link:../reactivity
-      '@vue/shared':
-        specifier: workspace:*
-        version: link:../shared
-      vue:
-        specifier: workspace:*
-        version: link:../vue
-
-  packages/dts-test:
-    dependencies:
-      '@vue/dts-built-test':
-        specifier: workspace:*
-        version: link:../dts-built-test
-      vue:
-        specifier: workspace:*
-        version: link:../vue
-
   packages/reactivity:
     dependencies:
       '@vue/shared':
@@ -357,39 +403,8 @@ importers:
         specifier: workspace:*
         version: link:../vue
 
-  packages/sfc-playground:
-    dependencies:
-      '@vue/repl':
-        specifier: ^4.3.1
-        version: 4.3.1
-      file-saver:
-        specifier: ^2.0.5
-        version: 2.0.5
-      jszip:
-        specifier: ^3.10.1
-        version: 3.10.1
-      vue:
-        specifier: workspace:*
-        version: link:../vue
-    devDependencies:
-      '@vitejs/plugin-vue':
-        specifier: ^5.1.2
-        version: 5.1.2(vite@5.4.0(@types/node@20.14.14)(sass@1.77.8))(vue@packages+vue)
-      vite:
-        specifier: 'catalog:'
-        version: 5.4.0(@types/node@20.14.14)(sass@1.77.8)
-
   packages/shared: {}
 
-  packages/template-explorer:
-    dependencies:
-      monaco-editor:
-        specifier: ^0.50.0
-        version: 0.50.0
-      source-map-js:
-        specifier: ^1.2.0
-        version: 1.2.0
-
   packages/vue:
     dependencies:
       '@vue/compiler-dom':

+ 2 - 0
pnpm-workspace.yaml

@@ -1,5 +1,6 @@
 packages:
   - 'packages/*'
+  - 'packages-private/*'
 
 catalog:
   '@babel/parser': ^7.25.3
@@ -8,3 +9,4 @@ catalog:
   'magic-string': ^0.30.11
   'source-map-js': ^1.2.0
   'vite': ^5.4.0
+  '@vitejs/plugin-vue': ^5.1.2

+ 6 - 1
rollup.config.js

@@ -2,6 +2,7 @@
 import assert from 'node:assert/strict'
 import { createRequire } from 'node:module'
 import { fileURLToPath } from 'node:url'
+import fs from 'node:fs'
 import path from 'node:path'
 import replace from '@rollup/plugin-replace'
 import json from '@rollup/plugin-json'
@@ -33,7 +34,11 @@ const __dirname = fileURLToPath(new URL('.', import.meta.url))
 const masterVersion = require('./package.json').version
 const consolidatePkg = require('@vue/consolidate/package.json')
 
-const packagesDir = path.resolve(__dirname, 'packages')
+const privatePackages = fs.readdirSync('packages-private')
+const pkgBase = privatePackages.includes(process.env.TARGET)
+  ? `packages-private`
+  : `packages`
+const packagesDir = path.resolve(__dirname, pkgBase)
 const packageDir = path.resolve(packagesDir, process.env.TARGET)
 
 const resolve = (/** @type {string} */ p) => path.resolve(packageDir, p)

+ 11 - 6
scripts/build.js

@@ -16,7 +16,7 @@ nr build core --formats cjs
 ```
 */
 
-import fs from 'node:fs/promises'
+import fs from 'node:fs'
 import { parseArgs } from 'node:util'
 import { existsSync, readFileSync } from 'node:fs'
 import path from 'node:path'
@@ -84,7 +84,7 @@ const sizeDir = path.resolve('temp/size')
 run()
 
 async function run() {
-  if (writeSize) await fs.mkdir(sizeDir, { recursive: true })
+  if (writeSize) fs.mkdirSync(sizeDir, { recursive: true })
   const removeCache = scanEnums()
   try {
     const resolvedTargets = targets.length
@@ -151,13 +151,18 @@ async function runParallel(maxConcurrency, source, iteratorFn) {
   return Promise.all(ret)
 }
 
+const privatePackages = fs.readdirSync('packages-private')
+
 /**
  * Builds the target.
  * @param {string} target - The target to build.
  * @returns {Promise<void>} - A promise representing the build process.
  */
 async function build(target) {
-  const pkgDir = path.resolve(`packages/${target}`)
+  const pkgBase = privatePackages.includes(target)
+    ? `packages-private`
+    : `packages`
+  const pkgDir = path.resolve(`${pkgBase}/${target}`)
   const pkg = JSON.parse(readFileSync(`${pkgDir}/package.json`, 'utf-8'))
 
   // if this is a full build (no specific targets), ignore private packages
@@ -167,7 +172,7 @@ async function build(target) {
 
   // if building a specific format, do not remove dist.
   if (!formats && existsSync(`${pkgDir}/dist`)) {
-    await fs.rm(`${pkgDir}/dist`, { recursive: true })
+    fs.rmSync(`${pkgDir}/dist`, { recursive: true })
   }
 
   const env =
@@ -232,7 +237,7 @@ async function checkFileSize(filePath) {
   if (!existsSync(filePath)) {
     return
   }
-  const file = await fs.readFile(filePath)
+  const file = fs.readFileSync(filePath)
   const fileName = path.basename(filePath)
 
   const gzipped = gzipSync(file)
@@ -247,7 +252,7 @@ async function checkFileSize(filePath) {
   )
 
   if (writeSize)
-    await fs.writeFile(
+    fs.writeFileSync(
       path.resolve(sizeDir, `${fileName}.json`),
       JSON.stringify({
         file: fileName,

+ 16 - 13
scripts/utils.js

@@ -6,19 +6,22 @@ import { spawn } from 'node:child_process'
 
 const require = createRequire(import.meta.url)
 
-export const targets = fs.readdirSync('packages').filter(f => {
-  if (
-    !fs.statSync(`packages/${f}`).isDirectory() ||
-    !fs.existsSync(`packages/${f}/package.json`)
-  ) {
-    return false
-  }
-  const pkg = require(`../packages/${f}/package.json`)
-  if (pkg.private && !pkg.buildOptions) {
-    return false
-  }
-  return true
-})
+export const targets = fs
+  .readdirSync('packages')
+  .filter(f => {
+    if (
+      !fs.statSync(`packages/${f}`).isDirectory() ||
+      !fs.existsSync(`packages/${f}/package.json`)
+    ) {
+      return false
+    }
+    const pkg = require(`../packages/${f}/package.json`)
+    if (pkg.private && !pkg.buildOptions) {
+      return false
+    }
+    return true
+  })
+  .concat('template-explorer')
 
 /**
  *

+ 3 - 2
tsconfig.json

@@ -32,12 +32,13 @@
   "include": [
     "packages/global.d.ts",
     "packages/*/src",
+    "packages-private/*/src",
     "packages/runtime-dom/types/jsx.d.ts",
     "packages/*/__tests__",
-    "packages/dts-test",
+    "packages-private/dts-test",
     "packages/vue/jsx-runtime",
     "scripts/*",
     "rollup.*.js"
   ],
-  "exclude": ["packages/sfc-playground/src/vue-dev-proxy*"]
+  "exclude": ["packages-private/sfc-playground/src/vue-dev-proxy*"]
 }

+ 1 - 1
vitest.config.ts

@@ -40,7 +40,7 @@ export default defineConfig({
         'packages/runtime-dom/src/components/Transition*',
         // mostly entries
         'packages/vue-compat/**',
-        'packages/sfc-playground/**',
+        'packages-private/**',
         'scripts/**',
       ],
     },