chore: release vapor package
This commit is contained in:
parent
aaf3d00f45
commit
62072841fb
|
@ -125,7 +125,9 @@ function createConfig(format, output, plugins = []) {
|
||||||
const isCJSBuild = format === 'cjs'
|
const isCJSBuild = format === 'cjs'
|
||||||
const isGlobalBuild = /global/.test(format)
|
const isGlobalBuild = /global/.test(format)
|
||||||
const isCompatPackage =
|
const isCompatPackage =
|
||||||
pkg.name === '@vue/compat' || pkg.name === '@vue/compat-canary'
|
pkg.name === '@vue/compat' ||
|
||||||
|
pkg.name === '@vue/compat-canary' ||
|
||||||
|
pkg.name === '@vue-vapor/compat'
|
||||||
const isCompatBuild = !!packageOptions.compat
|
const isCompatBuild = !!packageOptions.compat
|
||||||
const isBrowserBuild =
|
const isBrowserBuild =
|
||||||
(isGlobalBuild || isBrowserESMBuild || isBundlerESMBuild) &&
|
(isGlobalBuild || isBrowserESMBuild || isBundlerESMBuild) &&
|
||||||
|
@ -315,7 +317,8 @@ function createConfig(format, output, plugins = []) {
|
||||||
let cjsIgnores = []
|
let cjsIgnores = []
|
||||||
if (
|
if (
|
||||||
pkg.name === '@vue/compiler-sfc' ||
|
pkg.name === '@vue/compiler-sfc' ||
|
||||||
pkg.name === '@vue/compiler-sfc-canary'
|
pkg.name === '@vue/compiler-sfc-canary' ||
|
||||||
|
pkg.name === '@vue-vapor/compiler-sfc'
|
||||||
) {
|
) {
|
||||||
cjsIgnores = [
|
cjsIgnores = [
|
||||||
...Object.keys(consolidatePkg.devDependencies),
|
...Object.keys(consolidatePkg.devDependencies),
|
||||||
|
|
|
@ -38,6 +38,7 @@ const isDryRun = args.dry
|
||||||
let skipTests = args.skipTests
|
let skipTests = args.skipTests
|
||||||
const skipBuild = args.skipBuild
|
const skipBuild = args.skipBuild
|
||||||
const isCanary = args.canary
|
const isCanary = args.canary
|
||||||
|
const isVapor = args.vapor
|
||||||
const skipPrompts = args.skipPrompts || args.canary
|
const skipPrompts = args.skipPrompts || args.canary
|
||||||
const skipGit = args.skipGit || args.canary
|
const skipGit = args.skipGit || args.canary
|
||||||
|
|
||||||
|
@ -56,7 +57,11 @@ const packages = fs
|
||||||
const isCorePackage = (/** @type {string} */ pkgName) => {
|
const isCorePackage = (/** @type {string} */ pkgName) => {
|
||||||
if (!pkgName) return
|
if (!pkgName) return
|
||||||
|
|
||||||
if (pkgName === 'vue' || pkgName === '@vue/compat') {
|
if (
|
||||||
|
pkgName === 'vue' ||
|
||||||
|
pkgName === '@vue/compat' ||
|
||||||
|
pkgName === '@vue/vapor'
|
||||||
|
) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,6 +83,18 @@ const renamePackageToCanary = (/** @type {string} */ pkgName) => {
|
||||||
return pkgName
|
return pkgName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const renamePackageToVapor = (/** @type {string} */ pkgName) => {
|
||||||
|
if (pkgName === 'vue') {
|
||||||
|
return '@vue-vapor/vue'
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isCorePackage(pkgName)) {
|
||||||
|
return pkgName.replace(/^@vue\//, '@vue-vapor/')
|
||||||
|
}
|
||||||
|
|
||||||
|
return pkgName
|
||||||
|
}
|
||||||
|
|
||||||
const keepThePackageName = (/** @type {string} */ pkgName) => pkgName
|
const keepThePackageName = (/** @type {string} */ pkgName) => pkgName
|
||||||
|
|
||||||
/** @type {string[]} */
|
/** @type {string[]} */
|
||||||
|
@ -119,7 +136,7 @@ async function main() {
|
||||||
|
|
||||||
let targetVersion = args._[0]
|
let targetVersion = args._[0]
|
||||||
|
|
||||||
if (isCanary) {
|
if (isCanary || isVapor) {
|
||||||
// The canary version string format is `3.yyyyMMdd.0` (or `3.yyyyMMdd.0-minor.0` for minor)
|
// The canary version string format is `3.yyyyMMdd.0` (or `3.yyyyMMdd.0-minor.0` for minor)
|
||||||
// Use UTC date so that it's consistent across CI and maintainers' machines
|
// Use UTC date so that it's consistent across CI and maintainers' machines
|
||||||
const date = new Date()
|
const date = new Date()
|
||||||
|
@ -139,7 +156,9 @@ async function main() {
|
||||||
// check the registry to avoid version collision
|
// check the registry to avoid version collision
|
||||||
// in case we need to publish more than one canary versions in a day
|
// in case we need to publish more than one canary versions in a day
|
||||||
try {
|
try {
|
||||||
const pkgName = renamePackageToCanary('vue')
|
const pkgName = isCanary
|
||||||
|
? renamePackageToCanary('vue')
|
||||||
|
: renamePackageToVapor('vue')
|
||||||
const { stdout } = await run(
|
const { stdout } = await run(
|
||||||
'pnpm',
|
'pnpm',
|
||||||
['view', `${pkgName}@~${canaryVersion}`, 'version', '--json'],
|
['view', `${pkgName}@~${canaryVersion}`, 'version', '--json'],
|
||||||
|
@ -202,8 +221,8 @@ async function main() {
|
||||||
|
|
||||||
if (skipPrompts) {
|
if (skipPrompts) {
|
||||||
step(
|
step(
|
||||||
isCanary
|
isCanary || isVapor
|
||||||
? `Releasing canary version v${targetVersion}...`
|
? `Releasing ${isCanary ? 'canary' : 'vapor'} version v${targetVersion}...`
|
||||||
: `Releasing v${targetVersion}...`,
|
: `Releasing v${targetVersion}...`,
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
@ -251,7 +270,11 @@ async function main() {
|
||||||
step('\nUpdating cross dependencies...')
|
step('\nUpdating cross dependencies...')
|
||||||
updateVersions(
|
updateVersions(
|
||||||
targetVersion,
|
targetVersion,
|
||||||
isCanary ? renamePackageToCanary : keepThePackageName,
|
isCanary
|
||||||
|
? renamePackageToCanary
|
||||||
|
: isVapor
|
||||||
|
? renamePackageToVapor
|
||||||
|
: keepThePackageName,
|
||||||
)
|
)
|
||||||
versionUpdated = true
|
versionUpdated = true
|
||||||
|
|
||||||
|
@ -284,7 +307,7 @@ async function main() {
|
||||||
|
|
||||||
// update pnpm-lock.yaml
|
// update pnpm-lock.yaml
|
||||||
// skipped during canary release because the package names changed and installing with `workspace:*` would fail
|
// skipped during canary release because the package names changed and installing with `workspace:*` would fail
|
||||||
if (!isCanary) {
|
if (!isCanary && !isVapor) {
|
||||||
step('\nUpdating lockfile...')
|
step('\nUpdating lockfile...')
|
||||||
await run(`pnpm`, ['install', '--prefer-offline'])
|
await run(`pnpm`, ['install', '--prefer-offline'])
|
||||||
}
|
}
|
||||||
|
@ -364,7 +387,7 @@ async function isInSyncWithRemote() {
|
||||||
try {
|
try {
|
||||||
const branch = await getBranch()
|
const branch = await getBranch()
|
||||||
const res = await fetch(
|
const res = await fetch(
|
||||||
`https://api.github.com/repos/vuejs/core/commits/${branch}?per_page=1`,
|
`https://api.github.com/repos/vuejs/core-vapor/commits/${branch}?per_page=1`,
|
||||||
)
|
)
|
||||||
const data = await res.json()
|
const data = await res.json()
|
||||||
if (data.sha === (await getSha())) {
|
if (data.sha === (await getSha())) {
|
||||||
|
@ -420,7 +443,7 @@ function updatePackage(pkgRoot, version, getNewPackageName) {
|
||||||
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'))
|
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'))
|
||||||
pkg.name = getNewPackageName(pkg.name)
|
pkg.name = getNewPackageName(pkg.name)
|
||||||
pkg.version = version
|
pkg.version = version
|
||||||
if (isCanary) {
|
if (isCanary || isVapor) {
|
||||||
updateDeps(pkg, 'dependencies', version, getNewPackageName)
|
updateDeps(pkg, 'dependencies', version, getNewPackageName)
|
||||||
updateDeps(pkg, 'peerDependencies', version, getNewPackageName)
|
updateDeps(pkg, 'peerDependencies', version, getNewPackageName)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue