|
|
|
@ -8,7 +8,7 @@ import * as prompts from '@clack/prompts'
|
|
|
|
import { spawn } from 'cross-spawn'
|
|
|
|
import { spawn } from 'cross-spawn'
|
|
|
|
import semver from 'semver'
|
|
|
|
import semver from 'semver'
|
|
|
|
|
|
|
|
|
|
|
|
import { version as currentVersion } from '../package.json' with { type: 'json' }
|
|
|
|
import pkg from '../package.json' with { type: 'json' }
|
|
|
|
|
|
|
|
|
|
|
|
const { inc: _inc, valid } = semver
|
|
|
|
const { inc: _inc, valid } = semver
|
|
|
|
|
|
|
|
|
|
|
|
@ -17,7 +17,7 @@ const versionIncrements = ['patch', 'minor', 'major'] as const
|
|
|
|
const tags = ['latest', 'next'] as const
|
|
|
|
const tags = ['latest', 'next'] as const
|
|
|
|
|
|
|
|
|
|
|
|
const dir = fileURLToPath(new URL('.', import.meta.url))
|
|
|
|
const dir = fileURLToPath(new URL('.', import.meta.url))
|
|
|
|
const inc = (i: semver.ReleaseType) => _inc(currentVersion, i)
|
|
|
|
const inc = (i: semver.ReleaseType) => _inc(pkg.version, i)
|
|
|
|
const run = async (bin: string, args: string[], opts: SpawnOptions = {}) => {
|
|
|
|
const run = async (bin: string, args: string[], opts: SpawnOptions = {}) => {
|
|
|
|
const child = spawn(bin, args, { stdio: 'inherit', ...opts })
|
|
|
|
const child = spawn(bin, args, { stdio: 'inherit', ...opts })
|
|
|
|
const [code, signal] = (await once(child, 'close')) as [
|
|
|
|
const [code, signal] = (await once(child, 'close')) as [
|
|
|
|
@ -50,7 +50,7 @@ async function main() {
|
|
|
|
if (release === 3) {
|
|
|
|
if (release === 3) {
|
|
|
|
const customVersion = await prompts.text({
|
|
|
|
const customVersion = await prompts.text({
|
|
|
|
message: 'Input custom version',
|
|
|
|
message: 'Input custom version',
|
|
|
|
initialValue: currentVersion
|
|
|
|
initialValue: pkg.version
|
|
|
|
})
|
|
|
|
})
|
|
|
|
if (prompts.isCancel(customVersion)) return cancel()
|
|
|
|
if (prompts.isCancel(customVersion)) return cancel()
|
|
|
|
targetVersion = customVersion
|
|
|
|
targetVersion = customVersion
|
|
|
|
|