Skip to content

Commit

Permalink
chore: exclude private packages from version updates
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Nov 21, 2023
1 parent 8fddb19 commit fc772db
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 17 deletions.
4 changes: 2 additions & 2 deletions packages/dts-built-test/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "@vue/dts-built-test",
"private": true,
"version": "0.0.0",
"types": "dist/dts-built-test.d.ts",
"dependencies": {
"@vue/shared": "workspace:*",
"@vue/reactivity": "workspace:*",
"vue": "workspace:*"
},
"version": "3.3.8"
}
}
4 changes: 2 additions & 2 deletions packages/dts-test/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "dts-test",
"private": true,
"version": "0.0.0",
"dependencies": {
"vue": "workspace:*",
"@vue/dts-built-test": "workspace:*"
},
"version": "3.3.8"
}
}
4 changes: 2 additions & 2 deletions packages/runtime-test/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@vue/runtime-test",
"version": "3.3.8",
"description": "@vue/runtime-test",
"private": true,
"version": "0.0.0",
"description": "@vue/runtime-test",
"main": "index.js",
"module": "dist/runtime-test.esm-bundler.js",
"types": "dist/runtime-test.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions packages/sfc-playground/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@vue/sfc-playground",
"version": "3.3.8",
"type": "module",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
Expand Down
2 changes: 1 addition & 1 deletion packages/template-explorer/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@vue/template-explorer",
"version": "3.3.8",
"private": true,
"version": "0.0.0",
"buildOptions": {
"formats": [
"global"
Expand Down
18 changes: 10 additions & 8 deletions scripts/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,15 @@ const skipGit = args.skipGit || args.canary

const packages = fs
.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 => {
if (!pkgName) return
Expand Down Expand Up @@ -386,12 +394,6 @@ async function publishPackage(pkgName, version) {
if (skippedPackages.includes(pkgName)) {
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
if (args.tag) {
Expand Down Expand Up @@ -419,7 +421,7 @@ async function publishPackage(pkgName, version) {
...(skipGit ? ['--no-git-checks'] : [])
],
{
cwd: pkgRoot,
cwd: getPkgRoot(pkgName),
stdio: 'pipe'
}
)
Expand Down

0 comments on commit fc772db

Please sign in to comment.