@@ -36,9 +36,6 @@ const { values: args, positionals } = parseArgs({
36
36
tag : {
37
37
type : 'string' ,
38
38
} ,
39
- canary : {
40
- type : 'boolean' ,
41
- } ,
42
39
skipBuild : {
43
40
type : 'boolean' ,
44
41
} ,
@@ -69,9 +66,8 @@ const isDryRun = args.dry
69
66
/** @type {boolean | undefined } */
70
67
let skipTests = args . skipTests
71
68
const skipBuild = args . skipBuild
72
- const isCanary = args . canary
73
- const skipPrompts = args . skipPrompts || args . canary
74
- const skipGit = args . skipGit || args . canary
69
+ const skipPrompts = args . skipPrompts
70
+ const skipGit = args . skipGit
75
71
76
72
const packages = fs
77
73
. readdirSync ( path . resolve ( __dirname , '../packages' ) )
@@ -98,18 +94,6 @@ const isCorePackage = (/** @type {string} */ pkgName) => {
98
94
)
99
95
}
100
96
101
- const renamePackageToCanary = ( /** @type {string } */ pkgName ) => {
102
- if ( pkgName === 'vue' ) {
103
- return '@vue/canary'
104
- }
105
-
106
- if ( isCorePackage ( pkgName ) ) {
107
- return `${ pkgName } -canary`
108
- }
109
-
110
- return pkgName
111
- }
112
-
113
97
const keepThePackageName = ( /** @type {string } */ pkgName ) => pkgName
114
98
115
99
/** @type {string[] } */
@@ -151,57 +135,6 @@ async function main() {
151
135
152
136
let targetVersion = positionals [ 0 ]
153
137
154
- if ( isCanary ) {
155
- // The canary version string format is `3.yyyyMMdd.0` (or `3.yyyyMMdd.0-minor.0` for minor)
156
- // Use UTC date so that it's consistent across CI and maintainers' machines
157
- const date = new Date ( )
158
- const yyyy = date . getUTCFullYear ( )
159
- const MM = ( date . getUTCMonth ( ) + 1 ) . toString ( ) . padStart ( 2 , '0' )
160
- const dd = date . getUTCDate ( ) . toString ( ) . padStart ( 2 , '0' )
161
-
162
- const major = semver . major ( currentVersion )
163
- const datestamp = `${ yyyy } ${ MM } ${ dd } `
164
- let canaryVersion
165
-
166
- canaryVersion = `${ major } .${ datestamp } .0`
167
- if ( args . tag && args . tag !== 'latest' ) {
168
- canaryVersion = `${ major } .${ datestamp } .0-${ args . tag } .0`
169
- }
170
-
171
- // check the registry to avoid version collision
172
- // in case we need to publish more than one canary versions in a day
173
- try {
174
- const pkgName = renamePackageToCanary ( 'vue' )
175
- const { stdout } = await run (
176
- 'pnpm' ,
177
- [ 'view' , `${ pkgName } @~${ canaryVersion } ` , 'version' , '--json' ] ,
178
- { stdio : 'pipe' } ,
179
- )
180
- let versions = JSON . parse ( /** @type {string } */ ( stdout ) )
181
- versions = Array . isArray ( versions ) ? versions : [ versions ]
182
- const latestSameDayPatch = /** @type {string } */ (
183
- semver . maxSatisfying ( versions , `~${ canaryVersion } ` )
184
- )
185
-
186
- canaryVersion = /** @type {string } */ (
187
- semver . inc ( latestSameDayPatch , 'patch' )
188
- )
189
- if ( args . tag && args . tag !== 'latest' ) {
190
- canaryVersion = /** @type {string } */ (
191
- semver . inc ( latestSameDayPatch , 'prerelease' , args . tag )
192
- )
193
- }
194
- } catch ( /** @type {any } */ e ) {
195
- if ( / E 4 0 4 / . test ( e . message ) ) {
196
- // the first patch version on that day
197
- } else {
198
- throw e
199
- }
200
- }
201
-
202
- targetVersion = canaryVersion
203
- }
204
-
205
138
if ( ! targetVersion ) {
206
139
// no explicit version, offer suggestions
207
140
/** @type {{ release: string } } */
@@ -239,11 +172,7 @@ async function main() {
239
172
}
240
173
241
174
if ( skipPrompts ) {
242
- step (
243
- isCanary
244
- ? `Releasing canary version v${ targetVersion } ...`
245
- : `Releasing v${ targetVersion } ...` ,
246
- )
175
+ step ( `Releasing v${ targetVersion } ...` )
247
176
} else {
248
177
/** @type {{ yes: boolean } } */
249
178
const { yes : confirmRelease } = await prompt ( {
@@ -261,10 +190,7 @@ async function main() {
261
190
262
191
// update all package versions and inter-dependencies
263
192
step ( '\nUpdating cross dependencies...' )
264
- updateVersions (
265
- targetVersion ,
266
- isCanary ? renamePackageToCanary : keepThePackageName ,
267
- )
193
+ updateVersions ( targetVersion , keepThePackageName )
268
194
versionUpdated = true
269
195
270
196
// generate changelog
@@ -285,11 +211,8 @@ async function main() {
285
211
}
286
212
287
213
// update pnpm-lock.yaml
288
- // skipped during canary release because the package names changed and installing with `workspace:*` would fail
289
- if ( ! isCanary ) {
290
- step ( '\nUpdating lockfile...' )
291
- await run ( `pnpm` , [ 'install' , '--prefer-offline' ] )
292
- }
214
+ step ( '\nUpdating lockfile...' )
215
+ await run ( `pnpm` , [ 'install' , '--prefer-offline' ] )
293
216
294
217
if ( ! skipGit ) {
295
218
const { stdout } = await run ( 'git' , [ 'diff' ] , { stdio : 'pipe' } )
@@ -457,34 +380,9 @@ function updatePackage(pkgRoot, version, getNewPackageName) {
457
380
const pkg = JSON . parse ( fs . readFileSync ( pkgPath , 'utf-8' ) )
458
381
pkg . name = getNewPackageName ( pkg . name )
459
382
pkg . version = version
460
- if ( isCanary ) {
461
- updateDeps ( pkg , 'dependencies' , version , getNewPackageName )
462
- updateDeps ( pkg , 'peerDependencies' , version , getNewPackageName )
463
- }
464
383
fs . writeFileSync ( pkgPath , JSON . stringify ( pkg , null , 2 ) + '\n' )
465
384
}
466
385
467
- /**
468
- * @param {Package } pkg
469
- * @param {'dependencies' | 'peerDependencies' } depType
470
- * @param {string } version
471
- * @param {(pkgName: string) => string } getNewPackageName
472
- */
473
- function updateDeps ( pkg , depType , version , getNewPackageName ) {
474
- const deps = pkg [ depType ]
475
- if ( ! deps ) return
476
- Object . keys ( deps ) . forEach ( dep => {
477
- if ( isCorePackage ( dep ) ) {
478
- const newName = getNewPackageName ( dep )
479
- const newVersion = newName === dep ? version : `npm:${ newName } @${ version } `
480
- console . log (
481
- pico . yellow ( `${ pkg . name } -> ${ depType } -> ${ dep } @${ newVersion } ` ) ,
482
- )
483
- deps [ dep ] = newVersion
484
- }
485
- } )
486
- }
487
-
488
386
async function buildPackages ( ) {
489
387
step ( '\nBuilding all packages...' )
490
388
if ( ! skipBuild ) {
@@ -509,9 +407,8 @@ async function publishPackages(version) {
509
407
additionalPublishFlags . push ( '--no-git-checks' )
510
408
}
511
409
// add provenance metadata when releasing from CI
512
- // canary release commits are not pushed therefore we don't need to add provenance
513
- // also skip provenance if not publishing to actual npm
514
- if ( process . env . CI && ! isCanary && ! args . registry ) {
410
+ // skip provenance if not publishing to actual npm
411
+ if ( process . env . CI && ! args . registry ) {
515
412
additionalPublishFlags . push ( '--provenance' )
516
413
}
517
414
0 commit comments