@@ -4,39 +4,39 @@ import fs from 'node:fs'
44import spawn from 'cross-spawn'
55// import { deleteAsync } from 'del'
66import { cyan } from 'kolorist'
7- import open from 'open'
7+ // import open from 'open'
88import prompts from 'prompts'
99import * as semver from 'semver'
1010
1111const docsPath = [ './README.md' , './docs/README.zh-CN.md' ]
1212
1313async function release ( ) {
14- console . log ( cyan ( 'Fetching origin...' ) )
14+ console . log ( cyan ( '\nFetching origin...' ) )
1515 if ( spawn . sync ( 'git' , [ 'pull' ] , { stdio : 'inherit' } ) . status === 1 ) {
1616 return
1717 }
1818
19- console . log ( cyan ( 'Linting staged...' ) )
19+ console . log ( cyan ( '\nLinting staged...' ) )
2020 if ( spawn . sync ( 'npx' , [ 'lint-staged' ] , { stdio : 'inherit' } ) . status === 1 ) {
2121 return
2222 }
2323
24- console . log ( cyan ( 'Unit testing...' ) )
24+ console . log ( cyan ( '\nUnit testing...' ) )
2525 if ( spawn . sync ( 'pnpm' , [ 'test' ] , { stdio : 'inherit' } ) . status === 1 ) {
2626 return
2727 }
2828
29- console . log ( cyan ( 'Building ...' ) )
29+ console . log ( cyan ( '\nBuilding ...' ) )
3030 if ( spawn . sync ( 'pnpm' , [ 'build' ] , { stdio : 'inherit' } ) . status === 1 ) {
3131 return
3232 }
3333
34- console . log ( cyan ( 'Publinting ...' ) )
34+ console . log ( cyan ( '\nPublinting ...' ) )
3535 if ( spawn . sync ( 'npx' , [ 'publint' ] , { stdio : 'inherit' } ) . status === 1 ) {
3636 return
3737 }
3838
39- console . log ( cyan ( 'Checking exports...' ) )
39+ console . log ( cyan ( '\nChecking exports...' ) )
4040 if ( spawn . sync ( 'pnpm' , [ 'check-exports' ] , { stdio : 'inherit' } ) . status === 1 ) {
4141 return
4242 }
@@ -126,7 +126,7 @@ async function release() {
126126 fs . writeFileSync ( './jsr.json' , JSON . stringify ( jsrConfig , null , 2 ) )
127127 fs . writeFileSync ( './package.json' , JSON . stringify ( npmConfig , null , 2 ) )
128128
129- console . log ( cyan ( 'Committing ...' ) )
129+ console . log ( cyan ( '\nCommitting ...' ) )
130130 if ( spawn . sync ( 'git' , [ 'add' , '-A' ] , { stdio : 'inherit' } ) . status === 1 ) {
131131 return
132132 }
@@ -139,30 +139,31 @@ async function release() {
139139 return
140140 }
141141
142- console . log ( cyan ( 'Pushing ...' ) )
142+ console . log ( cyan ( '\nPushing ...' ) )
143143 if ( spawn . sync ( 'git' , [ 'push' ] , { stdio : 'inherit' } ) . status === 1 ) {
144144 return
145145 }
146146 if ( spawn . sync ( 'git' , [ 'tag' , `v${ targetVersion } ` ] , { stdio : 'inherit' } ) . status === 1 ) {
147147 return
148148 }
149149 if ( spawn . sync ( 'git' , [ 'push' , 'origin' , `refs/tags/v${ targetVersion } ` ] , { stdio : 'inherit' } ) . status === 1 ) {
150- return
150+ // return
151151 }
152152
153- console . log ( cyan ( 'Publishing to jsr...' ) )
153+ /* console.log(cyan('\nPublishing to jsr...'))
154154 if (spawn.sync('npx', ['jsr', 'publish'], { stdio: 'inherit' }).status === 1) {
155155 return
156- }
156+ } */
157157
158- console . log ( cyan ( 'Publishing to npm...' ) )
158+ // Automatic provenance generation not supported outside of GitHub Actions
159+ /* console.log(cyan('\nPublishing to npm...'))
159160 if (spawn.sync('npm', ['publish', '--registry=https://registry.npmjs.org', '--provenance'], { stdio: 'inherit' }).status === 1) {
160161 return
161- }
162+ } */
162163
163- console . log ( cyan ( 'Updating npmmirror...' ) )
164+ /* console.log(cyan('\nUpdating npmmirror...'))
164165 spawn.sync('cnpm', ['sync'], { stdio: 'inherit' })
165- open ( `https://npmmirror.com/sync/${ name } ` )
166+ open(`https://npmmirror.com/sync/${name}`) */
166167}
167168
168169try {
0 commit comments