Просмотр исходного кода

chore: exclude private packages from version updates

Evan You 2 лет назад
Родитель
Сommit
fc772dbf73

+ 2 - 2
packages/dts-built-test/package.json

@@ -1,11 +1,11 @@
 {
 {
   "name": "@vue/dts-built-test",
   "name": "@vue/dts-built-test",
   "private": true,
   "private": true,
+  "version": "0.0.0",
   "types": "dist/dts-built-test.d.ts",
   "types": "dist/dts-built-test.d.ts",
   "dependencies": {
   "dependencies": {
     "@vue/shared": "workspace:*",
     "@vue/shared": "workspace:*",
     "@vue/reactivity": "workspace:*",
     "@vue/reactivity": "workspace:*",
     "vue": "workspace:*"
     "vue": "workspace:*"
-  },
-  "version": "3.3.8"
+  }
 }
 }

+ 2 - 2
packages/dts-test/package.json

@@ -1,9 +1,9 @@
 {
 {
   "name": "dts-test",
   "name": "dts-test",
   "private": true,
   "private": true,
+  "version": "0.0.0",
   "dependencies": {
   "dependencies": {
     "vue": "workspace:*",
     "vue": "workspace:*",
     "@vue/dts-built-test": "workspace:*"
     "@vue/dts-built-test": "workspace:*"
-  },
-  "version": "3.3.8"
+  }
 }
 }

+ 2 - 2
packages/runtime-test/package.json

@@ -1,8 +1,8 @@
 {
 {
   "name": "@vue/runtime-test",
   "name": "@vue/runtime-test",
-  "version": "3.3.8",
-  "description": "@vue/runtime-test",
   "private": true,
   "private": true,
+  "version": "0.0.0",
+  "description": "@vue/runtime-test",
   "main": "index.js",
   "main": "index.js",
   "module": "dist/runtime-test.esm-bundler.js",
   "module": "dist/runtime-test.esm-bundler.js",
   "types": "dist/runtime-test.d.ts",
   "types": "dist/runtime-test.d.ts",

+ 2 - 2
packages/sfc-playground/package.json

@@ -1,8 +1,8 @@
 {
 {
   "name": "@vue/sfc-playground",
   "name": "@vue/sfc-playground",
-  "version": "3.3.8",
-  "type": "module",
   "private": true,
   "private": true,
+  "version": "0.0.0",
+  "type": "module",
   "scripts": {
   "scripts": {
     "dev": "vite",
     "dev": "vite",
     "build": "vite build",
     "build": "vite build",

+ 1 - 1
packages/template-explorer/package.json

@@ -1,7 +1,7 @@
 {
 {
   "name": "@vue/template-explorer",
   "name": "@vue/template-explorer",
-  "version": "3.3.8",
   "private": true,
   "private": true,
+  "version": "0.0.0",
   "buildOptions": {
   "buildOptions": {
     "formats": [
     "formats": [
       "global"
       "global"

+ 10 - 8
scripts/release.js

@@ -33,7 +33,15 @@ const skipGit = args.skipGit || args.canary
 
 
 const packages = fs
 const packages = fs
   .readdirSync(path.resolve(__dirname, '../packages'))
   .readdirSync(path.resolve(__dirname, '../packages'))
-  .filter(p => !p.endsWith('.ts') && !p.startsWith('.'))
+  .filter(p => {
+    const pkgRoot = path.resolve(__dirname, '../packages', p)
+    if (fs.statSync(pkgRoot).isDirectory()) {
+      const pkg = JSON.parse(
+        fs.readFileSync(path.resolve(pkgRoot, 'package.json'), 'utf-8')
+      )
+      return !pkg.private
+    }
+  })
 
 
 const isCorePackage = pkgName => {
 const isCorePackage = pkgName => {
   if (!pkgName) return
   if (!pkgName) return
@@ -386,12 +394,6 @@ async function publishPackage(pkgName, version) {
   if (skippedPackages.includes(pkgName)) {
   if (skippedPackages.includes(pkgName)) {
     return
     return
   }
   }
-  const pkgRoot = getPkgRoot(pkgName)
-  const pkgPath = path.resolve(pkgRoot, 'package.json')
-  const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'))
-  if (pkg.private) {
-    return
-  }
 
 
   let releaseTag = null
   let releaseTag = null
   if (args.tag) {
   if (args.tag) {
@@ -419,7 +421,7 @@ async function publishPackage(pkgName, version) {
         ...(skipGit ? ['--no-git-checks'] : [])
         ...(skipGit ? ['--no-git-checks'] : [])
       ],
       ],
       {
       {
-        cwd: pkgRoot,
+        cwd: getPkgRoot(pkgName),
         stdio: 'pipe'
         stdio: 'pipe'
       }
       }
     )
     )