File tree Expand file tree Collapse file tree 3 files changed +44
-1
lines changed Expand file tree Collapse file tree 3 files changed +44
-1
lines changed Original file line number Diff line number Diff line change 2929 - name : Setup node.js
3030 uses : actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
3131 with :
32- node-version : 20
32+ node-version : 24
3333 cache : pnpm
3434
3535 - name : Update npm
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env node
2+
3+ /**
4+ * Check if a package is private
5+ * Usage: node scripts/private.ts <package-path>
6+ * Returns: "true" if package is private, "false" otherwise
7+ */
8+
9+ import path from 'node:path'
10+ import { pathToFileURL } from 'node:url'
11+
12+ async function isPrivatePackage ( packagePath : string ) : Promise < boolean > {
13+ try {
14+ const packageJsonPath = path . resolve ( packagePath , 'package.json' )
15+ const packageJsonUrl = pathToFileURL ( packageJsonPath ) . href
16+ const packageJson = (
17+ ( await import ( packageJsonUrl , { with : { type : 'json' } } ) ) as { default : { private ?: true } }
18+ ) . default
19+ return packageJson . private === true
20+ } catch {
21+ // If package.json doesn't exist or can't be parsed, treat as non-private
22+ return false
23+ }
24+ }
25+
26+ const packagePath = process . argv [ 2 ]
27+
28+ if ( ! packagePath ) {
29+ console . error ( 'Error: Package path is required' )
30+ console . error ( 'Usage: node scripts/private.ts <package-path>' )
31+ process . exit ( 1 )
32+ }
33+
34+ const isPrivate = await isPrivatePackage ( packagePath )
35+ console . log ( isPrivate )
Original file line number Diff line number Diff line change @@ -10,6 +10,14 @@ TAG="alpha"
1010# Release packages for npm registry
1111for PKG in packages/* ; do
1212 if [[ -d $PKG ]]; then
13+ # Check if package is private
14+ PRIVATE=$( pnpx tsx scripts/private.ts " $PKG " )
15+
16+ if [[ " $PRIVATE " == " true" ]]; then
17+ echo " ⏭️ Skipping $PKG (private package)"
18+ continue
19+ fi
20+
1321 pushd $PKG
1422 echo " ⚡ Publishing $PKG with tag $TAG "
1523 pnpm publish --access public --no-git-checks --tag $TAG
You can’t perform that action at this time.
0 commit comments