@tsed/cli-core 5.4.3 → 6.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/CliCore.js +5 -9
- package/lib/esm/decorators/command.js +0 -1
- package/lib/esm/decorators/index.js +0 -1
- package/lib/esm/decorators/on.js +0 -1
- package/lib/esm/decorators/onAdd.js +0 -1
- package/lib/esm/decorators/onExec.js +0 -1
- package/lib/esm/decorators/onPostInstall.js +0 -1
- package/lib/esm/decorators/onPrompt.js +0 -1
- package/lib/esm/domains/CliError.js +1 -4
- package/lib/esm/domains/CommandStoreKeys.js +0 -1
- package/lib/esm/index.js +8 -9
- package/lib/esm/interfaces/CliDefaultOptions.js +0 -1
- package/lib/esm/interfaces/CommandMetadata.js +0 -1
- package/lib/esm/interfaces/CommandParameters.js +1 -2
- package/lib/esm/interfaces/CommandProvider.js +0 -1
- package/lib/esm/interfaces/PackageJson.js +0 -1
- package/lib/esm/interfaces/ProjectPreferences.js +0 -1
- package/lib/esm/interfaces/Tasks.js +1 -2
- package/lib/esm/interfaces/index.js +5 -5
- package/lib/esm/packageManagers/PackageManagersModule.js +9 -11
- package/lib/esm/packageManagers/index.js +2 -3
- package/lib/esm/packageManagers/supports/BaseManager.js +4 -4
- package/lib/esm/packageManagers/supports/BunManager.js +6 -3
- package/lib/esm/packageManagers/supports/NpmManager.js +7 -4
- package/lib/esm/packageManagers/supports/PNpmManager.js +6 -3
- package/lib/esm/packageManagers/supports/YarnBerryManager.js +8 -6
- package/lib/esm/packageManagers/supports/YarnManager.js +6 -3
- package/lib/esm/services/CliConfiguration.js +0 -1
- package/lib/esm/services/CliDockerComposeYaml.js +2 -6
- package/lib/esm/services/CliExeca.js +7 -6
- package/lib/esm/services/CliFs.js +8 -11
- package/lib/esm/services/CliHooks.js +0 -2
- package/lib/esm/services/CliHttpClient.js +4 -7
- package/lib/esm/services/CliHttpLogClient.js +2 -6
- package/lib/esm/services/CliLoadFile.js +4 -5
- package/lib/esm/services/CliPackageJson.js +1 -1
- package/lib/esm/services/CliPlugins.js +3 -10
- package/lib/esm/services/CliProxyAgent.js +2 -6
- package/lib/esm/services/CliRunScript.js +0 -3
- package/lib/esm/services/CliService.js +10 -16
- package/lib/esm/services/CliYaml.js +0 -2
- package/lib/esm/services/NpmRegistryClient.js +1 -3
- package/lib/esm/services/ProjectPackageJson.js +7 -10
- package/lib/esm/services/Renderer.js +9 -11
- package/lib/esm/services/index.js +9 -10
- package/lib/esm/utils/coerce.js +0 -1
- package/lib/esm/utils/createInjector.js +0 -1
- package/lib/esm/utils/createTasksRunner.js +17 -39
- package/lib/esm/utils/getCommandMetadata.js +1 -2
- package/lib/esm/utils/getTemplateDirectory.js +2 -3
- package/lib/esm/utils/hbs/array.js +0 -3
- package/lib/esm/utils/hbs/collection.js +1 -3
- package/lib/esm/utils/hbs/comparison.js +0 -2
- package/lib/esm/utils/hbs/index.js +2 -3
- package/lib/esm/utils/hbs/object.js +3 -8
- package/lib/esm/utils/hbs/switch.js +0 -1
- package/lib/esm/utils/index.js +2 -3
- package/lib/esm/utils/isValidVersion.js +0 -1
- package/lib/esm/utils/loadPlugins.js +2 -4
- package/lib/esm/utils/logToCurl.js +0 -1
- package/lib/esm/utils/mapCommanderArgs.js +1 -2
- package/lib/esm/utils/mapCommanderOptions.js +0 -1
- package/lib/esm/utils/parseOption.js +1 -1
- package/lib/esm/utils/patchCommander.js +0 -2
- package/lib/esm/utils/renderer/insertAfter.js +0 -1
- package/lib/esm/utils/renderer/insertImport.js +0 -1
- package/lib/esm/utils/resolveConfiguration.js +0 -1
- package/lib/esm/utils/streamToObservable.js +0 -1
- package/lib/types/CliCore.d.ts +2 -2
- package/lib/types/decorators/command.d.ts +1 -1
- package/lib/types/decorators/index.d.ts +5 -5
- package/lib/types/domains/CliError.d.ts +1 -1
- package/lib/types/index.d.ts +8 -8
- package/lib/types/interfaces/CommandMetadata.d.ts +1 -1
- package/lib/types/interfaces/CommandProvider.d.ts +2 -2
- package/lib/types/interfaces/PackageJson.d.ts +2 -0
- package/lib/types/interfaces/Tasks.d.ts +2 -2
- package/lib/types/interfaces/index.d.ts +9 -9
- package/lib/types/packageManagers/PackageManagersModule.d.ts +4 -5
- package/lib/types/packageManagers/index.d.ts +5 -5
- package/lib/types/packageManagers/supports/BaseManager.d.ts +6 -8
- package/lib/types/packageManagers/supports/BunManager.d.ts +3 -3
- package/lib/types/packageManagers/supports/NpmManager.d.ts +1 -1
- package/lib/types/packageManagers/supports/PNpmManager.d.ts +1 -1
- package/lib/types/packageManagers/supports/YarnBerryManager.d.ts +4 -7
- package/lib/types/packageManagers/supports/YarnManager.d.ts +3 -3
- package/lib/types/services/CliDockerComposeYaml.d.ts +4 -4
- package/lib/types/services/CliExeca.d.ts +5 -22
- package/lib/types/services/CliFs.d.ts +5 -8
- package/lib/types/services/CliHttpClient.d.ts +3 -3
- package/lib/types/services/CliLoadFile.d.ts +3 -3
- package/lib/types/services/CliPackageJson.d.ts +1 -1
- package/lib/types/services/CliPlugins.d.ts +1 -1
- package/lib/types/services/CliProxyAgent.d.ts +2 -2
- package/lib/types/services/CliRunScript.d.ts +1 -1
- package/lib/types/services/CliService.d.ts +4 -4
- package/lib/types/services/CliYaml.d.ts +2 -2
- package/lib/types/services/NpmRegistryClient.d.ts +1 -1
- package/lib/types/services/ProjectPackageJson.d.ts +3 -3
- package/lib/types/services/Renderer.d.ts +2 -2
- package/lib/types/services/index.d.ts +15 -15
- package/lib/types/utils/createInjector.d.ts +1 -1
- package/lib/types/utils/createTasksRunner.d.ts +4 -4
- package/lib/types/utils/getCommandMetadata.d.ts +1 -1
- package/lib/types/utils/index.d.ts +10 -10
- package/lib/types/utils/mapCommanderArgs.d.ts +1 -1
- package/lib/types/utils/mapCommanderOptions.d.ts +2 -2
- package/lib/types/utils/streamToObservable.d.ts +1 -1
- package/package.json +57 -60
- package/vitest.config.mts +21 -0
- package/.eslintignore +0 -13
- package/.eslintrc.js +0 -1
- package/lib/cjs/CliCore.js +0 -112
- package/lib/cjs/CliCore.js.map +0 -1
- package/lib/cjs/decorators/command.js +0 -11
- package/lib/cjs/decorators/command.js.map +0 -1
- package/lib/cjs/decorators/index.js +0 -9
- package/lib/cjs/decorators/index.js.map +0 -1
- package/lib/cjs/decorators/on.js +0 -13
- package/lib/cjs/decorators/on.js.map +0 -1
- package/lib/cjs/decorators/onAdd.js +0 -10
- package/lib/cjs/decorators/onAdd.js.map +0 -1
- package/lib/cjs/decorators/onExec.js +0 -10
- package/lib/cjs/decorators/onExec.js.map +0 -1
- package/lib/cjs/decorators/onPostInstall.js +0 -10
- package/lib/cjs/decorators/onPostInstall.js.map +0 -1
- package/lib/cjs/decorators/onPrompt.js +0 -10
- package/lib/cjs/decorators/onPrompt.js.map +0 -1
- package/lib/cjs/domains/CliError.js +0 -16
- package/lib/cjs/domains/CliError.js.map +0 -1
- package/lib/cjs/domains/CommandStoreKeys.js +0 -12
- package/lib/cjs/domains/CommandStoreKeys.js.map +0 -1
- package/lib/cjs/index.js +0 -32
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/interfaces/CliDefaultOptions.js +0 -3
- package/lib/cjs/interfaces/CliDefaultOptions.js.map +0 -1
- package/lib/cjs/interfaces/CommandMetadata.js +0 -3
- package/lib/cjs/interfaces/CommandMetadata.js.map +0 -1
- package/lib/cjs/interfaces/CommandParameters.js +0 -3
- package/lib/cjs/interfaces/CommandParameters.js.map +0 -1
- package/lib/cjs/interfaces/CommandProvider.js +0 -3
- package/lib/cjs/interfaces/CommandProvider.js.map +0 -1
- package/lib/cjs/interfaces/PackageJson.js +0 -3
- package/lib/cjs/interfaces/PackageJson.js.map +0 -1
- package/lib/cjs/interfaces/ProjectPreferences.js +0 -11
- package/lib/cjs/interfaces/ProjectPreferences.js.map +0 -1
- package/lib/cjs/interfaces/Tasks.js +0 -3
- package/lib/cjs/interfaces/Tasks.js.map +0 -1
- package/lib/cjs/interfaces/index.js +0 -11
- package/lib/cjs/interfaces/index.js.map +0 -1
- package/lib/cjs/package.json +0 -3
- package/lib/cjs/packageManagers/PackageManagersModule.js +0 -136
- package/lib/cjs/packageManagers/PackageManagersModule.js.map +0 -1
- package/lib/cjs/packageManagers/index.js +0 -9
- package/lib/cjs/packageManagers/index.js.map +0 -1
- package/lib/cjs/packageManagers/supports/BaseManager.js +0 -33
- package/lib/cjs/packageManagers/supports/BaseManager.js.map +0 -1
- package/lib/cjs/packageManagers/supports/BunManager.js +0 -26
- package/lib/cjs/packageManagers/supports/BunManager.js.map +0 -1
- package/lib/cjs/packageManagers/supports/NpmManager.js +0 -26
- package/lib/cjs/packageManagers/supports/NpmManager.js.map +0 -1
- package/lib/cjs/packageManagers/supports/PNpmManager.js +0 -26
- package/lib/cjs/packageManagers/supports/PNpmManager.js.map +0 -1
- package/lib/cjs/packageManagers/supports/YarnBerryManager.js +0 -43
- package/lib/cjs/packageManagers/supports/YarnBerryManager.js.map +0 -1
- package/lib/cjs/packageManagers/supports/YarnManager.js +0 -26
- package/lib/cjs/packageManagers/supports/YarnManager.js.map +0 -1
- package/lib/cjs/services/CliConfiguration.js +0 -21
- package/lib/cjs/services/CliConfiguration.js.map +0 -1
- package/lib/cjs/services/CliDockerComposeYaml.js +0 -105
- package/lib/cjs/services/CliDockerComposeYaml.js.map +0 -1
- package/lib/cjs/services/CliExeca.js +0 -40
- package/lib/cjs/services/CliExeca.js.map +0 -1
- package/lib/cjs/services/CliFs.js +0 -74
- package/lib/cjs/services/CliFs.js.map +0 -1
- package/lib/cjs/services/CliHooks.js +0 -35
- package/lib/cjs/services/CliHooks.js.map +0 -1
- package/lib/cjs/services/CliHttpClient.js +0 -109
- package/lib/cjs/services/CliHttpClient.js.map +0 -1
- package/lib/cjs/services/CliHttpLogClient.js +0 -86
- package/lib/cjs/services/CliHttpLogClient.js.map +0 -1
- package/lib/cjs/services/CliLoadFile.js +0 -67
- package/lib/cjs/services/CliLoadFile.js.map +0 -1
- package/lib/cjs/services/CliPackageJson.js +0 -16
- package/lib/cjs/services/CliPackageJson.js.map +0 -1
- package/lib/cjs/services/CliPlugins.js +0 -93
- package/lib/cjs/services/CliPlugins.js.map +0 -1
- package/lib/cjs/services/CliProxyAgent.js +0 -98
- package/lib/cjs/services/CliProxyAgent.js.map +0 -1
- package/lib/cjs/services/CliRunScript.js +0 -32
- package/lib/cjs/services/CliRunScript.js.map +0 -1
- package/lib/cjs/services/CliService.js +0 -288
- package/lib/cjs/services/CliService.js.map +0 -1
- package/lib/cjs/services/CliYaml.js +0 -27
- package/lib/cjs/services/CliYaml.js.map +0 -1
- package/lib/cjs/services/NpmRegistryClient.js +0 -122
- package/lib/cjs/services/NpmRegistryClient.js.map +0 -1
- package/lib/cjs/services/ProjectPackageJson.js +0 -283
- package/lib/cjs/services/ProjectPackageJson.js.map +0 -1
- package/lib/cjs/services/Renderer.js +0 -178
- package/lib/cjs/services/Renderer.js.map +0 -1
- package/lib/cjs/services/index.js +0 -19
- package/lib/cjs/services/index.js.map +0 -1
- package/lib/cjs/utils/coerce.js +0 -20
- package/lib/cjs/utils/coerce.js.map +0 -1
- package/lib/cjs/utils/createInjector.js +0 -51
- package/lib/cjs/utils/createInjector.js.map +0 -1
- package/lib/cjs/utils/createTasksRunner.js +0 -68
- package/lib/cjs/utils/createTasksRunner.js.map +0 -1
- package/lib/cjs/utils/getCommandMetadata.js +0 -22
- package/lib/cjs/utils/getCommandMetadata.js.map +0 -1
- package/lib/cjs/utils/getTemplateDirectory.js +0 -14
- package/lib/cjs/utils/getTemplateDirectory.js.map +0 -1
- package/lib/cjs/utils/hbs/array.js +0 -522
- package/lib/cjs/utils/hbs/array.js.map +0 -1
- package/lib/cjs/utils/hbs/collection.js +0 -66
- package/lib/cjs/utils/hbs/collection.js.map +0 -1
- package/lib/cjs/utils/hbs/comparison.js +0 -437
- package/lib/cjs/utils/hbs/comparison.js.map +0 -1
- package/lib/cjs/utils/hbs/index.js +0 -15
- package/lib/cjs/utils/hbs/index.js.map +0 -1
- package/lib/cjs/utils/hbs/object.js +0 -245
- package/lib/cjs/utils/hbs/object.js.map +0 -1
- package/lib/cjs/utils/hbs/switch.js +0 -14
- package/lib/cjs/utils/hbs/switch.js.map +0 -1
- package/lib/cjs/utils/index.js +0 -14
- package/lib/cjs/utils/index.js.map +0 -1
- package/lib/cjs/utils/isValidVersion.js +0 -11
- package/lib/cjs/utils/isValidVersion.js.map +0 -1
- package/lib/cjs/utils/loadPlugins.js +0 -46
- package/lib/cjs/utils/loadPlugins.js.map +0 -1
- package/lib/cjs/utils/logToCurl.js +0 -19
- package/lib/cjs/utils/logToCurl.js.map +0 -1
- package/lib/cjs/utils/mapCommanderArgs.js +0 -40
- package/lib/cjs/utils/mapCommanderArgs.js.map +0 -1
- package/lib/cjs/utils/mapCommanderOptions.js +0 -16
- package/lib/cjs/utils/mapCommanderOptions.js.map +0 -1
- package/lib/cjs/utils/parseOption.js +0 -27
- package/lib/cjs/utils/parseOption.js.map +0 -1
- package/lib/cjs/utils/patchCommander.js +0 -58
- package/lib/cjs/utils/patchCommander.js.map +0 -1
- package/lib/cjs/utils/renderer/insertAfter.js +0 -17
- package/lib/cjs/utils/renderer/insertAfter.js.map +0 -1
- package/lib/cjs/utils/renderer/insertImport.js +0 -16
- package/lib/cjs/utils/renderer/insertImport.js.map +0 -1
- package/lib/cjs/utils/resolveConfiguration.js +0 -23
- package/lib/cjs/utils/resolveConfiguration.js.map +0 -1
- package/lib/cjs/utils/streamToObservable.js +0 -80
- package/lib/cjs/utils/streamToObservable.js.map +0 -1
- package/lib/esm/CliCore.js.map +0 -1
- package/lib/esm/decorators/command.js.map +0 -1
- package/lib/esm/decorators/index.js.map +0 -1
- package/lib/esm/decorators/on.js.map +0 -1
- package/lib/esm/decorators/onAdd.js.map +0 -1
- package/lib/esm/decorators/onExec.js.map +0 -1
- package/lib/esm/decorators/onPostInstall.js.map +0 -1
- package/lib/esm/decorators/onPrompt.js.map +0 -1
- package/lib/esm/domains/CliError.js.map +0 -1
- package/lib/esm/domains/CommandStoreKeys.js.map +0 -1
- package/lib/esm/index.js.map +0 -1
- package/lib/esm/interfaces/CliDefaultOptions.js.map +0 -1
- package/lib/esm/interfaces/CommandMetadata.js.map +0 -1
- package/lib/esm/interfaces/CommandParameters.js.map +0 -1
- package/lib/esm/interfaces/CommandProvider.js.map +0 -1
- package/lib/esm/interfaces/PackageJson.js.map +0 -1
- package/lib/esm/interfaces/ProjectPreferences.js.map +0 -1
- package/lib/esm/interfaces/Tasks.js.map +0 -1
- package/lib/esm/interfaces/index.js.map +0 -1
- package/lib/esm/package.json +0 -3
- package/lib/esm/packageManagers/PackageManagersModule.js.map +0 -1
- package/lib/esm/packageManagers/index.js.map +0 -1
- package/lib/esm/packageManagers/supports/BaseManager.js.map +0 -1
- package/lib/esm/packageManagers/supports/BunManager.js.map +0 -1
- package/lib/esm/packageManagers/supports/NpmManager.js.map +0 -1
- package/lib/esm/packageManagers/supports/PNpmManager.js.map +0 -1
- package/lib/esm/packageManagers/supports/YarnBerryManager.js.map +0 -1
- package/lib/esm/packageManagers/supports/YarnManager.js.map +0 -1
- package/lib/esm/services/CliConfiguration.js.map +0 -1
- package/lib/esm/services/CliDockerComposeYaml.js.map +0 -1
- package/lib/esm/services/CliExeca.js.map +0 -1
- package/lib/esm/services/CliFs.js.map +0 -1
- package/lib/esm/services/CliHooks.js.map +0 -1
- package/lib/esm/services/CliHttpClient.js.map +0 -1
- package/lib/esm/services/CliHttpLogClient.js.map +0 -1
- package/lib/esm/services/CliLoadFile.js.map +0 -1
- package/lib/esm/services/CliPackageJson.js.map +0 -1
- package/lib/esm/services/CliPlugins.js.map +0 -1
- package/lib/esm/services/CliProxyAgent.js.map +0 -1
- package/lib/esm/services/CliRunScript.js.map +0 -1
- package/lib/esm/services/CliService.js.map +0 -1
- package/lib/esm/services/CliYaml.js.map +0 -1
- package/lib/esm/services/NpmRegistryClient.js.map +0 -1
- package/lib/esm/services/ProjectPackageJson.js.map +0 -1
- package/lib/esm/services/Renderer.js.map +0 -1
- package/lib/esm/services/index.js.map +0 -1
- package/lib/esm/utils/coerce.js.map +0 -1
- package/lib/esm/utils/createInjector.js.map +0 -1
- package/lib/esm/utils/createTasksRunner.js.map +0 -1
- package/lib/esm/utils/getCommandMetadata.js.map +0 -1
- package/lib/esm/utils/getTemplateDirectory.js.map +0 -1
- package/lib/esm/utils/hbs/array.js.map +0 -1
- package/lib/esm/utils/hbs/collection.js.map +0 -1
- package/lib/esm/utils/hbs/comparison.js.map +0 -1
- package/lib/esm/utils/hbs/index.js.map +0 -1
- package/lib/esm/utils/hbs/object.js.map +0 -1
- package/lib/esm/utils/hbs/switch.js.map +0 -1
- package/lib/esm/utils/index.js.map +0 -1
- package/lib/esm/utils/isValidVersion.js.map +0 -1
- package/lib/esm/utils/loadPlugins.js.map +0 -1
- package/lib/esm/utils/logToCurl.js.map +0 -1
- package/lib/esm/utils/mapCommanderArgs.js.map +0 -1
- package/lib/esm/utils/mapCommanderOptions.js.map +0 -1
- package/lib/esm/utils/parseOption.js.map +0 -1
- package/lib/esm/utils/patchCommander.js.map +0 -1
- package/lib/esm/utils/renderer/insertAfter.js.map +0 -1
- package/lib/esm/utils/renderer/insertImport.js.map +0 -1
- package/lib/esm/utils/resolveConfiguration.js.map +0 -1
- package/lib/esm/utils/streamToObservable.js.map +0 -1
- package/lib/tsconfig.esm.tsbuildinfo +0 -1
- package/lib/tsconfig.tsbuildinfo +0 -1
- package/tsconfig.esm.json +0 -32
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import tunnel from "tunnel";
|
|
3
2
|
import { Configuration, Inject, Injectable, Value } from "@tsed/di";
|
|
4
|
-
import { CliExeca } from "./CliExeca.js";
|
|
5
3
|
import { camelCase } from "change-case";
|
|
4
|
+
import tunnel from "tunnel";
|
|
6
5
|
import { URL } from "url";
|
|
7
6
|
import { coerce } from "../utils/coerce.js";
|
|
7
|
+
import { CliExeca } from "./CliExeca.js";
|
|
8
8
|
import { ProjectPackageJson } from "./ProjectPackageJson.js";
|
|
9
9
|
let CliProxyAgent = class CliProxyAgent {
|
|
10
|
-
proxySettings;
|
|
11
|
-
projectPackageJson;
|
|
12
|
-
cliExeca;
|
|
13
10
|
hasProxy() {
|
|
14
11
|
return !!this.proxySettings.url;
|
|
15
12
|
}
|
|
@@ -92,4 +89,3 @@ CliProxyAgent = __decorate([
|
|
|
92
89
|
})
|
|
93
90
|
], CliProxyAgent);
|
|
94
91
|
export { CliProxyAgent };
|
|
95
|
-
//# sourceMappingURL=CliProxyAgent.js.map
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
3
2
|
// @ts-ignore
|
|
4
3
|
import runScript from "@npmcli/run-script";
|
|
5
4
|
import { Inject, Injectable } from "@tsed/di";
|
|
6
5
|
import { ProjectPackageJson } from "./ProjectPackageJson.js";
|
|
7
6
|
let CliRunScript = class CliRunScript {
|
|
8
|
-
projectPackageJson;
|
|
9
7
|
run(cmd, args, options = {}) {
|
|
10
8
|
return runScript({
|
|
11
9
|
event: "run",
|
|
@@ -26,4 +24,3 @@ CliRunScript = __decorate([
|
|
|
26
24
|
Injectable()
|
|
27
25
|
], CliRunScript);
|
|
28
26
|
export { CliRunScript };
|
|
29
|
-
//# sourceMappingURL=CliRunScript.js.map
|
|
@@ -1,31 +1,27 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
2
|
import { classOf } from "@tsed/core";
|
|
3
|
-
import { Constant, DIContext, getContext, Inject, Injectable, InjectorService, runInContext } from "@tsed/di";
|
|
3
|
+
import { Constant, DIContext, getContext, Inject, Injectable, InjectorService, Provider, runInContext } from "@tsed/di";
|
|
4
4
|
import { Argument, Command } from "commander";
|
|
5
5
|
import Inquirer from "inquirer";
|
|
6
|
+
// @ts-ignore
|
|
7
|
+
import inquirer_autocomplete_prompt from "inquirer-autocomplete-prompt";
|
|
6
8
|
import { v4 } from "uuid";
|
|
7
9
|
import { CommandStoreKeys } from "../domains/CommandStoreKeys.js";
|
|
10
|
+
import { PackageManagersModule } from "../packageManagers/index.js";
|
|
8
11
|
import { createSubTasks, createTasksRunner } from "../utils/createTasksRunner.js";
|
|
9
12
|
import { getCommandMetadata } from "../utils/getCommandMetadata.js";
|
|
10
13
|
import { mapCommanderArgs } from "../utils/mapCommanderArgs.js";
|
|
14
|
+
import { mapCommanderOptions } from "../utils/mapCommanderOptions.js";
|
|
11
15
|
import { parseOption } from "../utils/parseOption.js";
|
|
12
16
|
import { CliHooks } from "./CliHooks.js";
|
|
13
17
|
import { ProjectPackageJson } from "./ProjectPackageJson.js";
|
|
14
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
15
|
-
// @ts-ignore
|
|
16
|
-
import inquirer_autocomplete_prompt from "inquirer-autocomplete-prompt";
|
|
17
|
-
import { mapCommanderOptions } from "../utils/mapCommanderOptions.js";
|
|
18
|
-
import { PackageManagersModule } from "../packageManagers/index.js";
|
|
19
18
|
Inquirer.registerPrompt("autocomplete", inquirer_autocomplete_prompt);
|
|
20
19
|
let CliService = class CliService {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
projectPkg;
|
|
27
|
-
packageManagers;
|
|
28
|
-
commands = new Map();
|
|
20
|
+
constructor() {
|
|
21
|
+
this.program = new Command();
|
|
22
|
+
this.reinstallAfterRun = false;
|
|
23
|
+
this.commands = new Map();
|
|
24
|
+
}
|
|
29
25
|
/**
|
|
30
26
|
* Parse process.argv and runLifecycle action
|
|
31
27
|
* @param argv
|
|
@@ -225,7 +221,6 @@ let CliService = class CliService {
|
|
|
225
221
|
* @param allowUnknownOptions
|
|
226
222
|
*/
|
|
227
223
|
buildOption(subCommand, options, allowUnknownOptions) {
|
|
228
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
229
224
|
Object.entries(options).reduce((subCommand, [flags, { description, required, customParser, defaultValue, ...options }]) => {
|
|
230
225
|
const fn = (v) => {
|
|
231
226
|
return parseOption(v, options);
|
|
@@ -282,4 +277,3 @@ CliService = __decorate([
|
|
|
282
277
|
Injectable()
|
|
283
278
|
], CliService);
|
|
284
279
|
export { CliService };
|
|
285
|
-
//# sourceMappingURL=CliService.js.map
|
|
@@ -3,7 +3,6 @@ import { Inject, Injectable } from "@tsed/di";
|
|
|
3
3
|
import JsYaml from "js-yaml";
|
|
4
4
|
import { CliFs } from "./CliFs.js";
|
|
5
5
|
let CliYaml = class CliYaml {
|
|
6
|
-
fs;
|
|
7
6
|
async read(path) {
|
|
8
7
|
const content = await this.fs.readFile(path, { encoding: "utf8" });
|
|
9
8
|
return JsYaml.load(content);
|
|
@@ -21,4 +20,3 @@ CliYaml = __decorate([
|
|
|
21
20
|
Injectable()
|
|
22
21
|
], CliYaml);
|
|
23
22
|
export { CliYaml };
|
|
24
|
-
//# sourceMappingURL=CliYaml.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var NpmRegistryClient_1;
|
|
2
2
|
import { __decorate, __metadata } from "tslib";
|
|
3
3
|
import { Inject, Injectable } from "@tsed/di";
|
|
4
|
-
import url from "url";
|
|
5
4
|
import registry_url from "registry-url";
|
|
5
|
+
import url from "url";
|
|
6
6
|
import { CliHttpClient } from "./CliHttpClient.js";
|
|
7
7
|
const HOST = registry_url();
|
|
8
8
|
const REGEX_REGISTRY_ENFORCED_HTTPS = /^https?:\/\/([^\/]+\.)?(yarnpkg\.com|npmjs\.(org|com))(\/|$)/;
|
|
@@ -15,7 +15,6 @@ export function addSuffix(pattern, suffix) {
|
|
|
15
15
|
}
|
|
16
16
|
export const SCOPE_SEPARATOR = "%2f";
|
|
17
17
|
let NpmRegistryClient = NpmRegistryClient_1 = class NpmRegistryClient {
|
|
18
|
-
httpClient;
|
|
19
18
|
static escapeName(name) {
|
|
20
19
|
// scoped packages contain slashes and the npm registry expects them to be escaped
|
|
21
20
|
return name.replace("/", SCOPE_SEPARATOR);
|
|
@@ -115,4 +114,3 @@ NpmRegistryClient = NpmRegistryClient_1 = __decorate([
|
|
|
115
114
|
Injectable()
|
|
116
115
|
], NpmRegistryClient);
|
|
117
116
|
export { NpmRegistryClient };
|
|
118
|
-
//# sourceMappingURL=NpmRegistryClient.js.map
|
|
@@ -2,9 +2,9 @@ import { __decorate, __metadata, __param } from "tslib";
|
|
|
2
2
|
import { getValue, setValue } from "@tsed/core";
|
|
3
3
|
import { Configuration, Injectable } from "@tsed/di";
|
|
4
4
|
import { dirname, join } from "path";
|
|
5
|
-
import
|
|
6
|
-
import { CliFs } from "./CliFs.js";
|
|
5
|
+
import { readPackageUpSync } from "read-pkg-up";
|
|
7
6
|
import { isValidVersion } from "../utils/isValidVersion.js";
|
|
7
|
+
import { CliFs } from "./CliFs.js";
|
|
8
8
|
function sortKeys(obj) {
|
|
9
9
|
return Object.entries(obj)
|
|
10
10
|
.sort((k1, k2) => {
|
|
@@ -29,19 +29,16 @@ function mapPackages(deps) {
|
|
|
29
29
|
}, { valid: {}, invalid: {} });
|
|
30
30
|
}
|
|
31
31
|
let ProjectPackageJson = class ProjectPackageJson {
|
|
32
|
-
configuration;
|
|
33
|
-
fs;
|
|
34
|
-
rewrite = false;
|
|
35
|
-
reinstall = false;
|
|
36
|
-
GH_TOKEN;
|
|
37
|
-
raw;
|
|
38
32
|
constructor(configuration, fs) {
|
|
39
33
|
this.configuration = configuration;
|
|
40
34
|
this.fs = fs;
|
|
35
|
+
this.rewrite = false;
|
|
36
|
+
this.reinstall = false;
|
|
41
37
|
this.setRaw({
|
|
42
38
|
name: "",
|
|
43
39
|
version: "1.0.0",
|
|
44
40
|
description: "",
|
|
41
|
+
type: "module",
|
|
45
42
|
scripts: {},
|
|
46
43
|
dependencies: {},
|
|
47
44
|
devDependencies: {}
|
|
@@ -175,6 +172,7 @@ let ProjectPackageJson = class ProjectPackageJson {
|
|
|
175
172
|
this.raw = {
|
|
176
173
|
...originalPkg,
|
|
177
174
|
...this.raw,
|
|
175
|
+
type: "module",
|
|
178
176
|
scripts: {
|
|
179
177
|
...(originalPkg.scripts || {}),
|
|
180
178
|
...(this.raw.scripts || {})
|
|
@@ -243,7 +241,7 @@ let ProjectPackageJson = class ProjectPackageJson {
|
|
|
243
241
|
const pkgPath = join(String(cwd), "package.json");
|
|
244
242
|
const fileExists = this.fs.exists(pkgPath);
|
|
245
243
|
if (!disableReadUpPkg && !fileExists) {
|
|
246
|
-
const result =
|
|
244
|
+
const result = readPackageUpSync({
|
|
247
245
|
cwd
|
|
248
246
|
});
|
|
249
247
|
if (result && result.path) {
|
|
@@ -277,4 +275,3 @@ ProjectPackageJson = __decorate([
|
|
|
277
275
|
__metadata("design:paramtypes", [Object, CliFs])
|
|
278
276
|
], ProjectPackageJson);
|
|
279
277
|
export { ProjectPackageJson };
|
|
280
|
-
//# sourceMappingURL=ProjectPackageJson.js.map
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import "../utils/hbs/index.js";
|
|
2
3
|
import { isString } from "@tsed/core";
|
|
3
4
|
import { Configuration, Constant, Inject, Injectable } from "@tsed/di";
|
|
5
|
+
import { normalizePath } from "@tsed/normalize-path";
|
|
4
6
|
import Consolidate from "consolidate";
|
|
5
7
|
import fs from "fs-extra";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
+
import { globby } from "globby";
|
|
9
|
+
import handlebars from "handlebars";
|
|
8
10
|
import { basename, dirname, join, relative } from "path";
|
|
9
11
|
import { Observable } from "rxjs";
|
|
10
|
-
import { CliFs } from "./CliFs.js";
|
|
11
|
-
import "../utils/hbs/index.js";
|
|
12
|
-
import handlebars from "handlebars";
|
|
13
|
-
import { insertImport } from "../utils/renderer/insertImport.js";
|
|
14
12
|
import { insertAfter } from "../utils/renderer/insertAfter.js";
|
|
13
|
+
import { insertImport } from "../utils/renderer/insertImport.js";
|
|
14
|
+
import { CliFs } from "./CliFs.js";
|
|
15
15
|
export class Renderer {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
configuration;
|
|
16
|
+
constructor() {
|
|
17
|
+
this.cache = new Set();
|
|
18
|
+
}
|
|
20
19
|
async loadPartials(cwd) {
|
|
21
20
|
if (this.cache.has(cwd)) {
|
|
22
21
|
return;
|
|
@@ -171,4 +170,3 @@ ScriptsRendererService = __decorate([
|
|
|
171
170
|
Injectable()
|
|
172
171
|
], ScriptsRendererService);
|
|
173
172
|
export { ScriptsRendererService };
|
|
174
|
-
//# sourceMappingURL=Renderer.js.map
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
export * from "./CliConfiguration.js";
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
2
|
+
export * from "./CliDockerComposeYaml.js";
|
|
3
|
+
export * from "./CliExeca.js";
|
|
4
|
+
export * from "./CliFs.js";
|
|
4
5
|
export * from "./CliHttpClient.js";
|
|
6
|
+
export * from "./CliLoadFile.js";
|
|
7
|
+
export * from "./CliPackageJson.js";
|
|
5
8
|
export * from "./CliPlugins.js";
|
|
9
|
+
export * from "./CliProxyAgent.js";
|
|
6
10
|
export * from "./CliRunScript.js";
|
|
7
|
-
export * from "./
|
|
8
|
-
export * from "./ProjectPackageJson.js";
|
|
9
|
-
export * from "./Renderer.js";
|
|
10
|
-
export * from "./CliExeca.js";
|
|
11
|
-
export * from "./CliLoadFile.js";
|
|
11
|
+
export * from "./CliService.js";
|
|
12
12
|
export * from "./CliYaml.js";
|
|
13
|
-
export * from "./CliDockerComposeYaml.js";
|
|
14
13
|
export * from "./NpmRegistryClient.js";
|
|
15
|
-
export * from "./
|
|
16
|
-
|
|
14
|
+
export * from "./ProjectPackageJson.js";
|
|
15
|
+
export * from "./Renderer.js";
|
package/lib/esm/utils/coerce.js
CHANGED
|
@@ -1,62 +1,40 @@
|
|
|
1
1
|
// @ts-ignore
|
|
2
|
-
import { Listr, Logger } from "listr2";
|
|
3
2
|
import { isFunction } from "@tsed/core";
|
|
3
|
+
import { DefaultRenderer, Listr, ListrLogger, VerboseRenderer } from "listr2";
|
|
4
4
|
import { getLogger } from "./createInjector.js";
|
|
5
|
-
class CustomLogger extends
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
getLogger()?.info("[SUCCESS]", message);
|
|
14
|
-
}
|
|
15
|
-
data(message) {
|
|
16
|
-
getLogger()?.info("[DATA]", message);
|
|
17
|
-
}
|
|
18
|
-
start(message) {
|
|
19
|
-
getLogger()?.info("[START]", message);
|
|
20
|
-
}
|
|
21
|
-
title(message) {
|
|
22
|
-
getLogger()?.info("[TITLE]", message);
|
|
23
|
-
}
|
|
24
|
-
retry(message) {
|
|
25
|
-
getLogger()?.info("[RETRY]", message);
|
|
26
|
-
}
|
|
27
|
-
rollback(message) {
|
|
28
|
-
getLogger()?.info("[ROLLBACK]", message);
|
|
5
|
+
class CustomLogger extends ListrLogger {
|
|
6
|
+
log(level, message, options) {
|
|
7
|
+
if (["FAILED"].includes(level)) {
|
|
8
|
+
getLogger()?.error(`[${level}]`, message);
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
getLogger()?.info(`[${level}]`, message);
|
|
12
|
+
}
|
|
29
13
|
}
|
|
30
14
|
}
|
|
31
15
|
function getOptions({ bindLogger = true, ...ctx }) {
|
|
32
16
|
const useRawRenderer = !(!ctx.verbose && !process.env.CI);
|
|
33
|
-
const rendererOptions = useRawRenderer && bindLogger
|
|
34
|
-
? {
|
|
35
|
-
logger: CustomLogger
|
|
36
|
-
}
|
|
37
|
-
: {};
|
|
38
17
|
return {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
18
|
+
silentRendererCondition: process.env.NODE_ENV === "test",
|
|
19
|
+
renderer: useRawRenderer ? VerboseRenderer : DefaultRenderer,
|
|
20
|
+
rendererOptions: useRawRenderer && bindLogger
|
|
21
|
+
? {
|
|
22
|
+
logger: new CustomLogger()
|
|
23
|
+
}
|
|
24
|
+
: undefined
|
|
45
25
|
};
|
|
46
26
|
}
|
|
47
27
|
export function createTasks(tasks, ctx) {
|
|
48
28
|
return new Listr(tasks, getOptions(ctx));
|
|
49
29
|
}
|
|
50
30
|
export function createSubTasks(tasks, opts) {
|
|
51
|
-
opts = getOptions(opts);
|
|
52
31
|
return async (ctx, task) => {
|
|
53
32
|
if (isFunction(tasks)) {
|
|
54
33
|
tasks = await tasks(ctx, task);
|
|
55
34
|
}
|
|
56
|
-
return task.newListr(tasks, opts);
|
|
35
|
+
return task.newListr(tasks, getOptions(opts));
|
|
57
36
|
};
|
|
58
37
|
}
|
|
59
38
|
export function createTasksRunner(tasks, ctx) {
|
|
60
39
|
return createTasks(tasks, ctx).run(ctx);
|
|
61
40
|
}
|
|
62
|
-
//# sourceMappingURL=createTasksRunner.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Store } from "@tsed/core";
|
|
1
|
+
import { Store, Type } from "@tsed/core";
|
|
2
2
|
import { CommandStoreKeys } from "../domains/CommandStoreKeys.js";
|
|
3
3
|
export function getCommandMetadata(token) {
|
|
4
4
|
const { name, alias, args = {}, allowUnknownOption, description, options = {}, enableFeatures, disableReadUpPkg, bindLogger = true, ...opts } = Store.from(token)?.get(CommandStoreKeys.COMMAND);
|
|
@@ -15,4 +15,3 @@ export function getCommandMetadata(token) {
|
|
|
15
15
|
...opts
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
//# sourceMappingURL=getCommandMetadata.js.map
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import readPkgUp from "read-pkg-up";
|
|
2
1
|
import { dirname, join } from "path";
|
|
2
|
+
import { readPackageUpSync } from "read-pkg-up";
|
|
3
3
|
export function getTemplateDirectory(cwd) {
|
|
4
|
-
const { path } =
|
|
4
|
+
const { path } = readPackageUpSync({
|
|
5
5
|
cwd: join(cwd, "..", "..")
|
|
6
6
|
});
|
|
7
7
|
return join(dirname(path), "templates");
|
|
8
8
|
}
|
|
9
|
-
//# sourceMappingURL=getTemplateDirectory.js.map
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { getValue, isArray, isNumber, isObject, isString } from "@tsed/core";
|
|
2
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
3
2
|
// @ts-ignore
|
|
4
3
|
import createFrame from "create-frame";
|
|
5
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
6
4
|
// @ts-ignore
|
|
7
5
|
import util from "handlebars-utils";
|
|
8
6
|
export const helpers = {};
|
|
@@ -515,4 +513,3 @@ helpers.unique = function (array) {
|
|
|
515
513
|
return arr.indexOf(item) === index;
|
|
516
514
|
});
|
|
517
515
|
};
|
|
518
|
-
//# sourceMappingURL=array.js.map
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2
1
|
// @ts-ignore
|
|
3
2
|
import util from "handlebars-utils";
|
|
4
|
-
import { helpers as object } from "./object.js";
|
|
5
3
|
import { helpers as array } from "./array.js";
|
|
4
|
+
import { helpers as object } from "./object.js";
|
|
6
5
|
const forEach = array.forEach;
|
|
7
6
|
const forOwn = object.forOwn;
|
|
8
7
|
export const helpers = {};
|
|
@@ -59,4 +58,3 @@ helpers.iterate = function (collection, options) {
|
|
|
59
58
|
}
|
|
60
59
|
return options.inverse(this);
|
|
61
60
|
};
|
|
62
|
-
//# sourceMappingURL=collection.js.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { isNumber } from "@tsed/core";
|
|
2
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
3
2
|
// @ts-ignore
|
|
4
3
|
import util from "handlebars-utils";
|
|
5
4
|
export const helpers = {};
|
|
@@ -430,4 +429,3 @@ helpers.unlessLteq = function (a, b, options) {
|
|
|
430
429
|
}
|
|
431
430
|
return util.value(a > b, this, options);
|
|
432
431
|
};
|
|
433
|
-
//# sourceMappingURL=comparison.js.map
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import handlebars from "handlebars";
|
|
2
|
-
import { helpers as comparison } from "./comparison.js";
|
|
3
2
|
import { helpers as array } from "./array.js";
|
|
4
|
-
import { helpers as object } from "./object.js";
|
|
5
3
|
import { helpers as collection } from "./collection.js";
|
|
4
|
+
import { helpers as comparison } from "./comparison.js";
|
|
5
|
+
import { helpers as object } from "./object.js";
|
|
6
6
|
import { helpers as switchHelpers } from "./switch.js";
|
|
7
7
|
handlebars.registerHelper(array);
|
|
8
8
|
handlebars.registerHelper(object);
|
|
9
9
|
handlebars.registerHelper(collection);
|
|
10
10
|
handlebars.registerHelper(comparison);
|
|
11
11
|
handlebars.registerHelper(switchHelpers);
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { getValue, isNumber, isObject } from "@tsed/core";
|
|
2
|
-
import { helpers as array } from "./array.js";
|
|
3
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
4
|
-
// @ts-ignore
|
|
5
|
-
import util from "handlebars-utils";
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
7
2
|
// @ts-ignore
|
|
8
3
|
import createFrame from "create-frame";
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
import util from "handlebars-utils";
|
|
6
|
+
import { helpers as array } from "./array.js";
|
|
9
7
|
const hasOwn = Object.hasOwnProperty;
|
|
10
8
|
export const helpers = {};
|
|
11
9
|
/**
|
|
@@ -17,7 +15,6 @@ export const helpers = {};
|
|
|
17
15
|
* @api public
|
|
18
16
|
*/
|
|
19
17
|
helpers.extend = function ( /*objects*/) {
|
|
20
|
-
// eslint-disable-next-line prefer-rest-params
|
|
21
18
|
const args = [].slice.call(arguments);
|
|
22
19
|
let opts = {};
|
|
23
20
|
if (util.isOptions(args[args.length - 1])) {
|
|
@@ -191,7 +188,6 @@ helpers.JSONstringify = function (obj, indent) {
|
|
|
191
188
|
* @api public
|
|
192
189
|
*/
|
|
193
190
|
helpers.merge = function (...args1) {
|
|
194
|
-
// eslint-disable-next-line prefer-rest-params
|
|
195
191
|
const args = [].slice.call(args1);
|
|
196
192
|
let opts = {};
|
|
197
193
|
if (util.isOptions(args[args.length - 1])) {
|
|
@@ -238,4 +234,3 @@ helpers.pick = function (props, context, options) {
|
|
|
238
234
|
* deprecated in a future release
|
|
239
235
|
*/
|
|
240
236
|
helpers.stringify = helpers.JSONstringify;
|
|
241
|
-
//# sourceMappingURL=object.js.map
|
package/lib/esm/utils/index.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
export * from "./createInjector.js";
|
|
2
|
+
export * from "./createTasksRunner.js";
|
|
2
3
|
export * from "./getCommandMetadata.js";
|
|
4
|
+
export * from "./getTemplateDirectory.js";
|
|
3
5
|
export * from "./loadPlugins.js";
|
|
4
6
|
export * from "./logToCurl.js";
|
|
5
7
|
export * from "./mapCommanderArgs.js";
|
|
6
8
|
export * from "./mapCommanderOptions.js";
|
|
7
9
|
export * from "./parseOption.js";
|
|
8
|
-
export * from "./createTasksRunner.js";
|
|
9
10
|
export * from "./resolveConfiguration.js";
|
|
10
|
-
export * from "./getTemplateDirectory.js";
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { GlobalProviders } from "@tsed/di";
|
|
2
|
-
// @ts-ignore
|
|
3
|
-
import { figures } from "listr2";
|
|
1
|
+
import { GlobalProviders, InjectorService } from "@tsed/di";
|
|
4
2
|
import chalk from "chalk";
|
|
3
|
+
import figures from "figures";
|
|
5
4
|
import { CliFs } from "../services/CliFs.js";
|
|
6
5
|
import { ProjectPackageJson } from "../services/ProjectPackageJson.js";
|
|
7
6
|
const all = (promises) => Promise.all(promises);
|
|
@@ -38,4 +37,3 @@ export async function loadPlugins(injector) {
|
|
|
38
37
|
});
|
|
39
38
|
await all(promises);
|
|
40
39
|
}
|
|
41
|
-
//# sourceMappingURL=loadPlugins.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isClass,
|
|
1
|
+
import { isArray, isClass, Type } from "@tsed/core";
|
|
2
2
|
function mapValue(value, { type, itemType }) {
|
|
3
3
|
if (!value) {
|
|
4
4
|
return value;
|
|
@@ -33,4 +33,3 @@ export function mapCommanderArgs(args, commandArgs) {
|
|
|
33
33
|
};
|
|
34
34
|
}, {});
|
|
35
35
|
}
|
|
36
|
-
//# sourceMappingURL=mapCommanderArgs.js.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Type } from "@tsed/core";
|
|
1
2
|
export function parseOption(value, options) {
|
|
2
3
|
const { type, itemType, customParser } = options;
|
|
3
4
|
if (type) {
|
|
@@ -20,4 +21,3 @@ export function parseOption(value, options) {
|
|
|
20
21
|
}
|
|
21
22
|
return value;
|
|
22
23
|
}
|
|
23
|
-
//# sourceMappingURL=parseOption.js.map
|
|
@@ -20,7 +20,6 @@ for (const C of [Array, String, TypedArray]) {
|
|
|
20
20
|
}
|
|
21
21
|
const helpInformation = Command.prototype.helpInformation;
|
|
22
22
|
function colorizeSection(str, section) {
|
|
23
|
-
// eslint-disable-next-line prefer-const
|
|
24
23
|
let [before, after] = str.split(section);
|
|
25
24
|
after = after
|
|
26
25
|
.split("\n")
|
|
@@ -52,4 +51,3 @@ Command.prototype.helpInformation = function help() {
|
|
|
52
51
|
.replace(/\[(\w+)]/gi, `[${chalk.cyan("$1")}]`) +
|
|
53
52
|
"\n");
|
|
54
53
|
};
|
|
55
|
-
//# sourceMappingURL=patchCommander.js.map
|
package/lib/types/CliCore.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { InjectorService } from "@tsed/di";
|
|
2
1
|
import { Type } from "@tsed/core";
|
|
3
|
-
import {
|
|
2
|
+
import { InjectorService } from "@tsed/di";
|
|
3
|
+
import { CliService } from "./services/CliService.js";
|
|
4
4
|
export declare class CliCore {
|
|
5
5
|
readonly injector: InjectorService;
|
|
6
6
|
readonly cliService: CliService;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CommandParameters } from "../interfaces/CommandParameters";
|
|
1
|
+
import type { CommandParameters } from "../interfaces/CommandParameters.js";
|
|
2
2
|
export declare function Command(options: CommandParameters): ClassDecorator;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "./command";
|
|
2
|
-
export * from "./onAdd";
|
|
3
|
-
export * from "./onExec";
|
|
4
|
-
export * from "./onPostInstall";
|
|
5
|
-
export * from "./onPrompt";
|
|
1
|
+
export * from "./command.js";
|
|
2
|
+
export * from "./onAdd.js";
|
|
3
|
+
export * from "./onExec.js";
|
|
4
|
+
export * from "./onPostInstall.js";
|
|
5
|
+
export * from "./onPrompt.js";
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import "./utils/patchCommander.js";
|
|
1
2
|
import Inquirer from "inquirer";
|
|
3
|
+
export * from "./CliCore.js";
|
|
4
|
+
export * from "./decorators/index.js";
|
|
5
|
+
export * from "./interfaces/index.js";
|
|
6
|
+
export * from "./packageManagers/index.js";
|
|
7
|
+
export * from "./services/index.js";
|
|
8
|
+
export * from "./utils/index.js";
|
|
2
9
|
export * from "@tsed/core";
|
|
10
|
+
export * from "@tsed/di";
|
|
3
11
|
export * from "@tsed/logger";
|
|
4
12
|
export * from "@tsed/normalize-path";
|
|
5
|
-
export { Inject, registerProvider, Injectable, Constant, Value, Configuration, LocalsContainer, TokenProvider, InvokeOptions, Module, Opts, UseOpts, OverrideProvider, InjectorService, OnDestroy, OnInit, Container, DITest } from "@tsed/di";
|
|
6
|
-
export * from "./interfaces/index";
|
|
7
|
-
export * from "./decorators/index";
|
|
8
|
-
export * from "./services/index";
|
|
9
|
-
export * from "./packageManagers/index";
|
|
10
|
-
export * from "./utils/index";
|
|
11
|
-
export * from "./CliCore";
|
|
12
13
|
export { Inquirer };
|
|
13
|
-
import "./utils/patchCommander";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommandArg, CommandOptions, CommandParameters } from "./CommandParameters";
|
|
1
|
+
import type { CommandArg, CommandOptions, CommandParameters } from "./CommandParameters.js";
|
|
2
2
|
export interface CommandMetadata extends CommandParameters {
|
|
3
3
|
/**
|
|
4
4
|
* CommandProvider arguments
|