diff --git a/package.json b/package.json index 904dd46..384ab60 100644 --- a/package.json +++ b/package.json @@ -76,13 +76,13 @@ "@types/node": "^22.10.1", "@types/prompts": "^2.4.9", "@types/semver": "^7.5.8", + "args-tokenizer": "^0.2.0", "eslint": "^9.16.0", "esno": "^4.8.0", "log-symbols": "^7.0.0", "npm-check": "^6.0.1", "picocolors": "^1.1.1", "rimraf": "^6.0.1", - "shell-quote": "^1.8.2", "tsup": "^8.3.5", "typescript": "^5.7.2", "vitest": "^2.1.8" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 86b7394..89b3278 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -51,6 +51,9 @@ importers: '@types/semver': specifier: ^7.5.8 version: 7.5.8 + args-tokenizer: + specifier: ^0.2.0 + version: 0.2.0 eslint: specifier: ^9.16.0 version: 9.16.0(jiti@2.4.1) @@ -69,9 +72,6 @@ importers: rimraf: specifier: ^6.0.1 version: 6.0.1 - shell-quote: - specifier: ^1.8.2 - version: 1.8.2 tsup: specifier: ^8.3.5 version: 8.3.5(jiti@2.4.1)(postcss@8.4.35)(tsx@4.19.1)(typescript@5.7.2) @@ -1082,6 +1082,9 @@ packages: argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} + args-tokenizer@0.2.0: + resolution: {integrity: sha512-R4HL7zpFdNpaNnqvtkHhFwzQhEFWhmYz4dC6W0CEzjxu4OBjobsrpOoBiiW5UINlzVQuU0inVPRSXRRT9bKV2Q==} + array-differ@3.0.0: resolution: {integrity: sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==} engines: {node: '>=8'} @@ -2875,10 +2878,6 @@ packages: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} - shell-quote@1.8.2: - resolution: {integrity: sha512-AzqKpGKjrj7EM6rKVQEPpB288oCfnrEIuyoT9cyF4nmGa7V8Zk6f7RRqYisX8X9m+Q7bd632aZW4ky7EhbQztA==} - engines: {node: '>= 0.4'} - siginfo@2.0.0: resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} @@ -4185,6 +4184,8 @@ snapshots: argparse@2.0.1: {} + args-tokenizer@0.2.0: {} + array-differ@3.0.0: {} array-union@2.1.0: {} @@ -6305,8 +6306,6 @@ snapshots: shebang-regex@3.0.0: {} - shell-quote@1.8.2: {} - siginfo@2.0.0: {} signal-exit@3.0.6: {} diff --git a/src/version-bump.ts b/src/version-bump.ts index 5300d93..17004c1 100644 --- a/src/version-bump.ts +++ b/src/version-bump.ts @@ -4,8 +4,7 @@ import process from 'node:process' import symbols from 'log-symbols' import c from 'picocolors' import prompts from 'prompts' -// @ts-expect-error missing types -import parseCommand from 'shell-quote/parse' +import { tokenizeArgs } from 'args-tokenizer'; import { x } from 'tinyexec' import { getCurrentVersion } from './get-current-version' import { getNewVersion } from './get-new-version' @@ -78,7 +77,7 @@ export async function versionBump(arg: (VersionBumpOptions) | string = {}): Prom await operation.options.execute(operation) } else { - const [command, ...args] = parseCommand(operation.options.execute) + const [command, ...args] = tokenizeArgs(operation.options.execute) console.log(symbols.info, 'Executing script', command, ...args) await x(command, args, { nodeOptions: {