File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed
Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change 3434 "version:patch" : " npm version patch" ,
3535 "version:minor" : " npm version minor" ,
3636 "version:major" : " npm version major" ,
37- "publish:npm" : " npm run build && cd out && npm publish"
37+ "publish:npm" : " npm run build && cd out && npm publish" ,
38+ "publish:tag" : " node ../../scripts/publish-tag.js ."
3839 },
3940 "license" : " MIT" ,
4041 "repository" : {
Original file line number Diff line number Diff line change 1+ const { execSync } = require ( 'child_process' ) ;
2+ const path = require ( 'path' ) ;
3+ const fs = require ( 'fs' ) ;
4+
5+ // Determine which package to tag based on current directory or argument
6+ const packagePath = process . argv [ 2 ] || process . cwd ( ) ;
7+ const pkgJsonPath = path . join ( packagePath , 'package.json' ) ;
8+
9+ if ( ! fs . existsSync ( pkgJsonPath ) ) {
10+ console . error ( 'package.json not found at:' , pkgJsonPath ) ;
11+ process . exit ( 1 ) ;
12+ }
13+
14+ const { version } = JSON . parse ( fs . readFileSync ( pkgJsonPath , 'utf8' ) ) ;
15+
16+ // Always use "core-v" prefix for core package
17+ const tag = `core-v${ version } ` ;
18+
19+ try {
20+ execSync ( `git tag ${ tag } ` , { stdio : 'inherit' } ) ;
21+ execSync ( 'git push --tags' , { stdio : 'inherit' } ) ;
22+ console . log ( `✓ Tagged and pushed ${ tag } ` ) ;
23+ } catch ( error ) {
24+ console . error ( 'Failed to tag and push' ) ;
25+ process . exit ( 1 ) ;
26+ }
You can’t perform that action at this time.
0 commit comments