Skip to content

Commit 3b6e8ab

Browse files
committed
add and make --dts-path the canonical alias for --type-declaration-path
deprecate `--type-declaration`, `--dts`, and `--gen-types`
1 parent 5bbe536 commit 3b6e8ab

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/bin/hsm.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,16 @@ ${colourN(`--hackmud-path`)}=${colourB(`<path>`)} option or ${colourN(`HSM_HACKM
265265
} else if (!infos.length)
266266
logError(`Could not find any scripts to push`)
267267
} else {
268-
const typeDeclarationPathOption =
269-
popOption(`type-declaration-path`, `type-declaration`, `dts`, `gen-types`)
268+
const dtsPathOption =
269+
popOption(`dts-path`, `type-declaration-path`, `type-declaration`, `dts`, `gen-types`)
270+
271+
if (dtsPathOption && dtsPathOption.name != `emit-dts` && dtsPathOption.name != `gen-dts`) {
272+
console.warn(colourF(`\
273+
Warning: ${colourN(dtsPathOption.name)} is being deprecated and will be removed in the
274+
next minor release of HSM
275+
You should switch to using its alias ${colourN(`--dts-path`)}\n`
276+
))
277+
}
270278

271279
complainAboutUnrecognisedOptions()
272280

@@ -275,7 +283,7 @@ ${colourN(`--hackmud-path`)}=${colourB(`<path>`)} option or ${colourN(`HSM_HACKM
275283
watch(sourcePath, hackmudPath, {
276284
scripts,
277285
onPush: info => logInfo(info, hackmudPath),
278-
typeDeclarationPath: typeDeclarationPathOption?.value.toString(),
286+
typeDeclarationPath: dtsPathOption?.value.toString(),
279287
minify: noMinifyOption && !noMinifyOption.value,
280288
mangleNames: mangleNamesOption?.value,
281289
onReady: () => log(`Watching`),
@@ -421,7 +429,7 @@ ${colourN(`--mangle-names`)}
421429
${colourN(`--force-quine-cheats`)}
422430
${forceQuineCheatsOptionDescription}
423431
${hackmudPathOption}
424-
${commands[0] == `push` ? `` : `${colourN(`--type-declaration-path`)}=${colourB(`<path>`)}
432+
${commands[0] == `push` ? `` : `${colourN(`--dts-path`)}=${colourB(`<path>`)}
425433
Path to generate a type declaration file for the scripts
426434
`}\
427435

0 commit comments

Comments
 (0)