@@ -4,39 +4,39 @@ import fs from 'node:fs'
4
4
import spawn from 'cross-spawn'
5
5
// import { deleteAsync } from 'del'
6
6
import { cyan } from 'kolorist'
7
- import open from 'open'
7
+ // import open from 'open'
8
8
import prompts from 'prompts'
9
9
import * as semver from 'semver'
10
10
11
11
const docsPath = [ './README.md' , './docs/README.zh-CN.md' ]
12
12
13
13
async function release ( ) {
14
- console . log ( cyan ( 'Fetching origin...' ) )
14
+ console . log ( cyan ( '\nFetching origin...' ) )
15
15
if ( spawn . sync ( 'git' , [ 'pull' ] , { stdio : 'inherit' } ) . status === 1 ) {
16
16
return
17
17
}
18
18
19
- console . log ( cyan ( 'Linting staged...' ) )
19
+ console . log ( cyan ( '\nLinting staged...' ) )
20
20
if ( spawn . sync ( 'npx' , [ 'lint-staged' ] , { stdio : 'inherit' } ) . status === 1 ) {
21
21
return
22
22
}
23
23
24
- console . log ( cyan ( 'Unit testing...' ) )
24
+ console . log ( cyan ( '\nUnit testing...' ) )
25
25
if ( spawn . sync ( 'pnpm' , [ 'test' ] , { stdio : 'inherit' } ) . status === 1 ) {
26
26
return
27
27
}
28
28
29
- console . log ( cyan ( 'Building ...' ) )
29
+ console . log ( cyan ( '\nBuilding ...' ) )
30
30
if ( spawn . sync ( 'pnpm' , [ 'build' ] , { stdio : 'inherit' } ) . status === 1 ) {
31
31
return
32
32
}
33
33
34
- console . log ( cyan ( 'Publinting ...' ) )
34
+ console . log ( cyan ( '\nPublinting ...' ) )
35
35
if ( spawn . sync ( 'npx' , [ 'publint' ] , { stdio : 'inherit' } ) . status === 1 ) {
36
36
return
37
37
}
38
38
39
- console . log ( cyan ( 'Checking exports...' ) )
39
+ console . log ( cyan ( '\nChecking exports...' ) )
40
40
if ( spawn . sync ( 'pnpm' , [ 'check-exports' ] , { stdio : 'inherit' } ) . status === 1 ) {
41
41
return
42
42
}
@@ -126,7 +126,7 @@ async function release() {
126
126
fs . writeFileSync ( './jsr.json' , JSON . stringify ( jsrConfig , null , 2 ) )
127
127
fs . writeFileSync ( './package.json' , JSON . stringify ( npmConfig , null , 2 ) )
128
128
129
- console . log ( cyan ( 'Committing ...' ) )
129
+ console . log ( cyan ( '\nCommitting ...' ) )
130
130
if ( spawn . sync ( 'git' , [ 'add' , '-A' ] , { stdio : 'inherit' } ) . status === 1 ) {
131
131
return
132
132
}
@@ -139,30 +139,31 @@ async function release() {
139
139
return
140
140
}
141
141
142
- console . log ( cyan ( 'Pushing ...' ) )
142
+ console . log ( cyan ( '\nPushing ...' ) )
143
143
if ( spawn . sync ( 'git' , [ 'push' ] , { stdio : 'inherit' } ) . status === 1 ) {
144
144
return
145
145
}
146
146
if ( spawn . sync ( 'git' , [ 'tag' , `v${ targetVersion } ` ] , { stdio : 'inherit' } ) . status === 1 ) {
147
147
return
148
148
}
149
149
if ( spawn . sync ( 'git' , [ 'push' , 'origin' , `refs/tags/v${ targetVersion } ` ] , { stdio : 'inherit' } ) . status === 1 ) {
150
- return
150
+ // return
151
151
}
152
152
153
- console . log ( cyan ( 'Publishing to jsr...' ) )
153
+ /* console.log(cyan('\nPublishing to jsr...'))
154
154
if (spawn.sync('npx', ['jsr', 'publish'], { stdio: 'inherit' }).status === 1) {
155
155
return
156
- }
156
+ } */
157
157
158
- console . log ( cyan ( 'Publishing to npm...' ) )
158
+ // Automatic provenance generation not supported outside of GitHub Actions
159
+ /* console.log(cyan('\nPublishing to npm...'))
159
160
if (spawn.sync('npm', ['publish', '--registry=https://registry.npmjs.org', '--provenance'], { stdio: 'inherit' }).status === 1) {
160
161
return
161
- }
162
+ } */
162
163
163
- console . log ( cyan ( 'Updating npmmirror...' ) )
164
+ /* console.log(cyan('\nUpdating npmmirror...'))
164
165
spawn.sync('cnpm', ['sync'], { stdio: 'inherit' })
165
- open ( `https://npmmirror.com/sync/${ name } ` )
166
+ open(`https://npmmirror.com/sync/${name}`) */
166
167
}
167
168
168
169
try {
0 commit comments