@tsed/cli-core 6.0.0-alpha.9 → 6.0.0-beta.2
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 +7 -12
- 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 +0 -1
- package/lib/esm/domains/CommandStoreKeys.js +0 -1
- package/lib/esm/index.js +0 -1
- package/lib/esm/interfaces/CliDefaultOptions.js +0 -1
- package/lib/esm/interfaces/CommandMetadata.js +0 -1
- package/lib/esm/interfaces/CommandParameters.js +0 -1
- 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 +0 -1
- package/lib/esm/interfaces/index.js +0 -1
- package/lib/esm/packageManagers/PackageManagersModule.js +3 -4
- package/lib/esm/packageManagers/index.js +0 -1
- package/lib/esm/packageManagers/supports/BaseManager.js +1 -5
- package/lib/esm/packageManagers/supports/BunManager.js +0 -1
- package/lib/esm/packageManagers/supports/NpmManager.js +0 -1
- package/lib/esm/packageManagers/supports/PNpmManager.js +0 -1
- package/lib/esm/packageManagers/supports/YarnBerryManager.js +0 -1
- package/lib/esm/packageManagers/supports/YarnManager.js +0 -1
- package/lib/esm/services/CliConfiguration.js +0 -1
- package/lib/esm/services/CliDockerComposeYaml.js +7 -15
- package/lib/esm/services/CliExeca.js +0 -1
- package/lib/esm/services/CliFs.js +0 -1
- package/lib/esm/services/CliHooks.js +5 -9
- package/lib/esm/services/CliHttpClient.js +6 -7
- package/lib/esm/services/CliHttpLogClient.js +2 -6
- package/lib/esm/services/CliLoadFile.js +3 -10
- package/lib/esm/services/CliPackageJson.js +4 -2
- package/lib/esm/services/CliPlugins.js +10 -30
- package/lib/esm/services/CliProxyAgent.js +11 -19
- package/lib/esm/services/CliRunScript.js +3 -8
- package/lib/esm/services/CliService.js +30 -49
- package/lib/esm/services/CliYaml.js +5 -7
- package/lib/esm/services/NpmRegistryClient.js +5 -7
- package/lib/esm/services/ProjectPackageJson.js +23 -24
- package/lib/esm/services/Renderer.js +5 -15
- package/lib/esm/services/index.js +0 -1
- package/lib/esm/utils/coerce.js +0 -1
- package/lib/esm/utils/createInjector.js +11 -12
- package/lib/esm/utils/createTasksRunner.js +1 -2
- package/lib/esm/utils/getCommandMetadata.js +1 -2
- package/lib/esm/utils/getTemplateDirectory.js +0 -1
- package/lib/esm/utils/hbs/array.js +0 -1
- package/lib/esm/utils/hbs/collection.js +0 -1
- package/lib/esm/utils/hbs/comparison.js +0 -1
- package/lib/esm/utils/hbs/index.js +0 -1
- package/lib/esm/utils/hbs/object.js +0 -1
- package/lib/esm/utils/hbs/switch.js +0 -1
- package/lib/esm/utils/index.js +0 -1
- package/lib/esm/utils/isValidVersion.js +0 -1
- package/lib/esm/utils/loadPlugins.js +16 -16
- package/lib/esm/utils/logToCurl.js +0 -1
- package/lib/esm/utils/mapCommanderArgs.js +0 -1
- package/lib/esm/utils/mapCommanderOptions.js +4 -2
- package/lib/esm/utils/parseOption.js +0 -1
- package/lib/esm/utils/patchCommander.js +0 -1
- 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/packageManagers/PackageManagersModule.d.ts +1 -1
- package/lib/types/services/CliExeca.d.ts +6 -5
- package/lib/types/services/CliHooks.d.ts +0 -2
- package/lib/types/services/CliPackageJson.d.ts +2 -1
- package/lib/types/services/CliPlugins.d.ts +2 -2
- package/lib/types/services/CliProxyAgent.d.ts +4 -3
- package/lib/types/services/CliRunScript.d.ts +0 -2
- package/lib/types/services/CliService.d.ts +4 -5
- package/lib/types/services/ProjectPackageJson.d.ts +2 -4
- package/lib/types/services/Renderer.d.ts +3 -4
- package/lib/types/utils/getCommandMetadata.d.ts +2 -2
- package/lib/types/utils/loadPlugins.d.ts +1 -2
- package/lib/types/utils/mapCommanderOptions.d.ts +1 -1
- package/package.json +10 -11
- 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/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/esm/CliCore.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var CliCore_1;
|
|
2
|
-
import { __decorate
|
|
2
|
+
import { __decorate } from "tslib";
|
|
3
3
|
import { Type } from "@tsed/core";
|
|
4
|
-
import {
|
|
4
|
+
import { inject, InjectorService, Module } from "@tsed/di";
|
|
5
5
|
import chalk from "chalk";
|
|
6
6
|
import { Command } from "commander";
|
|
7
7
|
import { join, resolve } from "path";
|
|
@@ -19,6 +19,10 @@ function isHelpManual(argv) {
|
|
|
19
19
|
return argv.includes("-h") || argv.includes("--help");
|
|
20
20
|
}
|
|
21
21
|
let CliCore = CliCore_1 = class CliCore {
|
|
22
|
+
constructor() {
|
|
23
|
+
this.injector = inject(InjectorService);
|
|
24
|
+
this.cliService = inject(CliService);
|
|
25
|
+
}
|
|
22
26
|
static checkNodeVersion(wanted, id) {
|
|
23
27
|
if (!semver.satisfies(process.version, wanted)) {
|
|
24
28
|
console.log(chalk.red("You are using Node " +
|
|
@@ -35,7 +39,7 @@ let CliCore = CliCore_1 = class CliCore {
|
|
|
35
39
|
static async create(settings, module = CliCore_1) {
|
|
36
40
|
settings = resolveConfiguration(settings);
|
|
37
41
|
const injector = this.createInjector(settings);
|
|
38
|
-
settings.plugins && (await loadPlugins(
|
|
42
|
+
settings.plugins && (await loadPlugins());
|
|
39
43
|
await this.loadInjector(injector, module);
|
|
40
44
|
await injector.emit("$onReady");
|
|
41
45
|
return injector.get(CliCore_1);
|
|
@@ -89,18 +93,9 @@ let CliCore = CliCore_1 = class CliCore {
|
|
|
89
93
|
return this;
|
|
90
94
|
}
|
|
91
95
|
};
|
|
92
|
-
__decorate([
|
|
93
|
-
Inject(),
|
|
94
|
-
__metadata("design:type", InjectorService)
|
|
95
|
-
], CliCore.prototype, "injector", void 0);
|
|
96
|
-
__decorate([
|
|
97
|
-
Inject(),
|
|
98
|
-
__metadata("design:type", CliService)
|
|
99
|
-
], CliCore.prototype, "cliService", void 0);
|
|
100
96
|
CliCore = CliCore_1 = __decorate([
|
|
101
97
|
Module({
|
|
102
98
|
imports: [CliPackageJson, ProjectPackageJson, CliService, CliConfiguration]
|
|
103
99
|
})
|
|
104
100
|
], CliCore);
|
|
105
101
|
export { CliCore };
|
|
106
|
-
//# sourceMappingURL=CliCore.js.map
|
package/lib/esm/decorators/on.js
CHANGED
package/lib/esm/index.js
CHANGED
|
@@ -68,17 +68,17 @@ let PackageManagersModule = class PackageManagersModule {
|
|
|
68
68
|
{
|
|
69
69
|
title: `Installing dependencies using ${packageManager.name}`,
|
|
70
70
|
skip: () => !this.projectPackageJson.reinstall,
|
|
71
|
-
task: () => packageManager.install(options).pipe(errorPipe())
|
|
71
|
+
task: () => packageManager.install(options) // .pipe(errorPipe())
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
74
|
title: `Add dependencies using ${packageManager.name}`,
|
|
75
75
|
skip: () => !deps.length,
|
|
76
|
-
task: () => packageManager.add(deps, options)
|
|
76
|
+
task: () => packageManager.add(deps, options) //.pipe(errorPipe())
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
title: `Add devDependencies using ${packageManager.name}`,
|
|
80
80
|
skip: () => !devDeps.length,
|
|
81
|
-
task: () => packageManager.addDev(devDeps, options)
|
|
81
|
+
task: () => packageManager.addDev(devDeps, options) //.pipe(errorPipe())
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
84
|
title: "Refresh",
|
|
@@ -129,4 +129,3 @@ PackageManagersModule = __decorate([
|
|
|
129
129
|
__metadata("design:paramtypes", [Array])
|
|
130
130
|
], PackageManagersModule);
|
|
131
131
|
export { PackageManagersModule };
|
|
132
|
-
//# sourceMappingURL=PackageManagersModule.js.map
|
|
@@ -20,14 +20,10 @@ export class BaseManager {
|
|
|
20
20
|
return this.run("run", [script], options);
|
|
21
21
|
}
|
|
22
22
|
run(cmd, args, options) {
|
|
23
|
-
return this.cliExeca.run(this.cmd, [cmd, options.verbose && this.verboseOpt, ...args].filter(Boolean),
|
|
24
|
-
...options,
|
|
25
|
-
verbose: options.verbose ? "full" : undefined
|
|
26
|
-
});
|
|
23
|
+
return this.cliExeca.run(this.cmd, [cmd, options.verbose && this.verboseOpt, ...args].filter(Boolean), options);
|
|
27
24
|
}
|
|
28
25
|
}
|
|
29
26
|
__decorate([
|
|
30
27
|
Inject(CliExeca),
|
|
31
28
|
__metadata("design:type", CliExeca)
|
|
32
29
|
], BaseManager.prototype, "cliExeca", void 0);
|
|
33
|
-
//# sourceMappingURL=BaseManager.js.map
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import { __decorate
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
2
|
import { setValue } from "@tsed/core";
|
|
3
|
-
import {
|
|
3
|
+
import { inject, Injectable } from "@tsed/di";
|
|
4
4
|
import { snakeCase } from "change-case";
|
|
5
5
|
import { join } from "path";
|
|
6
6
|
import { CliFs } from "./CliFs.js";
|
|
7
7
|
import { CliYaml } from "./CliYaml.js";
|
|
8
8
|
import { ProjectPackageJson } from "./ProjectPackageJson.js";
|
|
9
9
|
let CliDockerComposeYaml = class CliDockerComposeYaml {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.cliYaml = inject(CliYaml);
|
|
12
|
+
this.fs = inject(CliFs);
|
|
13
|
+
this.projectPackageJson = inject(ProjectPackageJson);
|
|
14
|
+
}
|
|
10
15
|
read() {
|
|
11
16
|
const path = "docker-compose.yml";
|
|
12
17
|
const file = !this.fs.exists(path) ? this.fs.findUpFile(this.projectPackageJson.dir, path) : path;
|
|
@@ -80,20 +85,7 @@ let CliDockerComposeYaml = class CliDockerComposeYaml {
|
|
|
80
85
|
}
|
|
81
86
|
}
|
|
82
87
|
};
|
|
83
|
-
__decorate([
|
|
84
|
-
Inject(),
|
|
85
|
-
__metadata("design:type", CliYaml)
|
|
86
|
-
], CliDockerComposeYaml.prototype, "cliYaml", void 0);
|
|
87
|
-
__decorate([
|
|
88
|
-
Inject(),
|
|
89
|
-
__metadata("design:type", CliFs)
|
|
90
|
-
], CliDockerComposeYaml.prototype, "fs", void 0);
|
|
91
|
-
__decorate([
|
|
92
|
-
Inject(),
|
|
93
|
-
__metadata("design:type", ProjectPackageJson)
|
|
94
|
-
], CliDockerComposeYaml.prototype, "projectPackageJson", void 0);
|
|
95
88
|
CliDockerComposeYaml = __decorate([
|
|
96
89
|
Injectable()
|
|
97
90
|
], CliDockerComposeYaml);
|
|
98
91
|
export { CliDockerComposeYaml };
|
|
99
|
-
//# sourceMappingURL=CliDockerComposeYaml.js.map
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { __decorate
|
|
2
|
-
import {
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { Injectable, injector } from "@tsed/di";
|
|
3
3
|
let CliHooks = class CliHooks {
|
|
4
4
|
async emit(hookName, cmd, ...args) {
|
|
5
|
-
const
|
|
5
|
+
const inj = injector();
|
|
6
|
+
const providers = inj.getProviders();
|
|
6
7
|
let results = [];
|
|
7
8
|
for (const provider of providers) {
|
|
8
9
|
if (provider.useClass) {
|
|
9
|
-
const instance =
|
|
10
|
+
const instance = inj.get(provider.token);
|
|
10
11
|
if (provider.store.has(hookName)) {
|
|
11
12
|
const props = provider.store.get(hookName)[cmd];
|
|
12
13
|
if (props) {
|
|
@@ -20,12 +21,7 @@ let CliHooks = class CliHooks {
|
|
|
20
21
|
return results.filter((o) => o !== undefined);
|
|
21
22
|
}
|
|
22
23
|
};
|
|
23
|
-
__decorate([
|
|
24
|
-
Inject(),
|
|
25
|
-
__metadata("design:type", InjectorService)
|
|
26
|
-
], CliHooks.prototype, "injector", void 0);
|
|
27
24
|
CliHooks = __decorate([
|
|
28
25
|
Injectable()
|
|
29
26
|
], CliHooks);
|
|
30
27
|
export { CliHooks };
|
|
31
|
-
//# sourceMappingURL=CliHooks.js.map
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
var CliHttpClient_1;
|
|
2
|
-
import { __decorate
|
|
2
|
+
import { __decorate } from "tslib";
|
|
3
3
|
import { cleanObject } from "@tsed/core";
|
|
4
|
-
import {
|
|
4
|
+
import { inject, Injectable } from "@tsed/di";
|
|
5
5
|
import axios, {} from "axios";
|
|
6
6
|
import { stringify } from "querystring";
|
|
7
7
|
import { URL } from "url";
|
|
8
8
|
import { CliHttpLogClient } from "./CliHttpLogClient.js";
|
|
9
9
|
import { CliProxyAgent } from "./CliProxyAgent.js";
|
|
10
10
|
let CliHttpClient = CliHttpClient_1 = class CliHttpClient extends CliHttpLogClient {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.cliProxyAgent = inject(CliProxyAgent);
|
|
14
|
+
}
|
|
11
15
|
static getParamsSerializer(params) {
|
|
12
16
|
return stringify(cleanObject(params));
|
|
13
17
|
}
|
|
@@ -93,12 +97,7 @@ let CliHttpClient = CliHttpClient_1 = class CliHttpClient extends CliHttpLogClie
|
|
|
93
97
|
return withHeaders ? { data, headers: result?.headers } : data;
|
|
94
98
|
}
|
|
95
99
|
};
|
|
96
|
-
__decorate([
|
|
97
|
-
Inject(),
|
|
98
|
-
__metadata("design:type", CliProxyAgent)
|
|
99
|
-
], CliHttpClient.prototype, "cliProxyAgent", void 0);
|
|
100
100
|
CliHttpClient = CliHttpClient_1 = __decorate([
|
|
101
101
|
Injectable()
|
|
102
102
|
], CliHttpClient);
|
|
103
103
|
export { CliHttpClient };
|
|
104
|
-
//# sourceMappingURL=CliHttpClient.js.map
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { __decorate, __metadata, __param } from "tslib";
|
|
2
2
|
import { getValue } from "@tsed/core";
|
|
3
|
-
import {
|
|
3
|
+
import { inject, Opts } from "@tsed/di";
|
|
4
4
|
import { Logger } from "@tsed/logger";
|
|
5
5
|
import querystring from "querystring";
|
|
6
6
|
import { logToCurl } from "../utils/logToCurl.js";
|
|
7
7
|
let CliHttpLogClient = class CliHttpLogClient {
|
|
8
8
|
// @ts-ignore
|
|
9
9
|
constructor(options = {}) {
|
|
10
|
+
this.logger = inject(Logger);
|
|
10
11
|
this.callee = options.callee || "http";
|
|
11
12
|
}
|
|
12
13
|
onSuccess(options) {
|
|
@@ -68,13 +69,8 @@ let CliHttpLogClient = class CliHttpLogClient {
|
|
|
68
69
|
};
|
|
69
70
|
}
|
|
70
71
|
};
|
|
71
|
-
__decorate([
|
|
72
|
-
Inject(),
|
|
73
|
-
__metadata("design:type", Logger)
|
|
74
|
-
], CliHttpLogClient.prototype, "logger", void 0);
|
|
75
72
|
CliHttpLogClient = __decorate([
|
|
76
73
|
__param(0, Opts),
|
|
77
74
|
__metadata("design:paramtypes", [Object])
|
|
78
75
|
], CliHttpLogClient);
|
|
79
76
|
export { CliHttpLogClient };
|
|
80
|
-
//# sourceMappingURL=CliHttpLogClient.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import {
|
|
2
|
+
import { inject, Injectable } from "@tsed/di";
|
|
3
3
|
import { default as Ajv } from "ajv";
|
|
4
4
|
import { extname } from "path";
|
|
5
5
|
import { CliFs } from "./CliFs.js";
|
|
@@ -8,6 +8,8 @@ let CliLoadFile = class CliLoadFile {
|
|
|
8
8
|
// @ts-ignore
|
|
9
9
|
#ajv;
|
|
10
10
|
constructor() {
|
|
11
|
+
this.cliYaml = inject(CliYaml);
|
|
12
|
+
this.cliFs = inject(CliFs);
|
|
11
13
|
const options = {
|
|
12
14
|
verbose: false,
|
|
13
15
|
coerceTypes: true,
|
|
@@ -48,17 +50,8 @@ let CliLoadFile = class CliLoadFile {
|
|
|
48
50
|
return config;
|
|
49
51
|
}
|
|
50
52
|
};
|
|
51
|
-
__decorate([
|
|
52
|
-
Inject(),
|
|
53
|
-
__metadata("design:type", CliYaml)
|
|
54
|
-
], CliLoadFile.prototype, "cliYaml", void 0);
|
|
55
|
-
__decorate([
|
|
56
|
-
Inject(),
|
|
57
|
-
__metadata("design:type", CliFs)
|
|
58
|
-
], CliLoadFile.prototype, "cliFs", void 0);
|
|
59
53
|
CliLoadFile = __decorate([
|
|
60
54
|
Injectable(),
|
|
61
55
|
__metadata("design:paramtypes", [])
|
|
62
56
|
], CliLoadFile);
|
|
63
57
|
export { CliLoadFile };
|
|
64
|
-
//# sourceMappingURL=CliLoadFile.js.map
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { Configuration, Inject, registerProvider } from "@tsed/di";
|
|
1
|
+
import { Configuration, Inject, inject, registerProvider } from "@tsed/di";
|
|
2
2
|
import {} from "../interfaces/PackageJson.js";
|
|
3
3
|
export function CliPackageJson() {
|
|
4
4
|
return Inject(CliPackageJson);
|
|
5
5
|
}
|
|
6
|
+
export function cliPackageJson() {
|
|
7
|
+
return inject(CliPackageJson);
|
|
8
|
+
}
|
|
6
9
|
registerProvider({
|
|
7
10
|
provide: CliPackageJson,
|
|
8
11
|
deps: [Configuration],
|
|
@@ -10,4 +13,3 @@ registerProvider({
|
|
|
10
13
|
return configuration.pkg || {};
|
|
11
14
|
}
|
|
12
15
|
});
|
|
13
|
-
//# sourceMappingURL=CliPackageJson.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { __decorate
|
|
2
|
-
import {
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { constant, inject, Injectable } from "@tsed/di";
|
|
3
3
|
import chalk from "chalk";
|
|
4
4
|
import { CommandStoreKeys } from "../domains/CommandStoreKeys.js";
|
|
5
5
|
import { PackageManagersModule } from "../packageManagers/PackageManagersModule.js";
|
|
@@ -16,13 +16,18 @@ function mapPlugins({ package: { name, description = "", ...otherProps } }) {
|
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
let CliPlugins = class CliPlugins {
|
|
19
|
+
constructor() {
|
|
20
|
+
this.name = constant("name", "");
|
|
21
|
+
this.loadPlugins = loadPlugins;
|
|
22
|
+
this.npmRegistryClient = inject(NpmRegistryClient);
|
|
23
|
+
this.cliHooks = inject(CliHooks);
|
|
24
|
+
this.packageJson = inject(ProjectPackageJson);
|
|
25
|
+
this.packageManagers = inject(PackageManagersModule);
|
|
26
|
+
}
|
|
19
27
|
async searchPlugins(keyword = "", options = {}) {
|
|
20
28
|
const result = await this.npmRegistryClient.search(this.getKeyword(keyword), options);
|
|
21
29
|
return result.filter(({ package: { name } }) => this.isPlugin(name)).map(mapPlugins);
|
|
22
30
|
}
|
|
23
|
-
loadPlugins() {
|
|
24
|
-
return loadPlugins(this.injector);
|
|
25
|
-
}
|
|
26
31
|
addPluginsDependencies(ctx) {
|
|
27
32
|
const plugins = Object.keys(this.packageJson.devDependencies).filter((name) => this.isPlugin(name));
|
|
28
33
|
const tasks = plugins.map((plugin) => {
|
|
@@ -53,32 +58,7 @@ let CliPlugins = class CliPlugins {
|
|
|
53
58
|
return name.startsWith(`@${this.name}/cli-plugin`) || name.includes(`${this.name}-cli-plugin`);
|
|
54
59
|
}
|
|
55
60
|
};
|
|
56
|
-
__decorate([
|
|
57
|
-
Constant("name"),
|
|
58
|
-
__metadata("design:type", String)
|
|
59
|
-
], CliPlugins.prototype, "name", void 0);
|
|
60
|
-
__decorate([
|
|
61
|
-
Inject(NpmRegistryClient),
|
|
62
|
-
__metadata("design:type", NpmRegistryClient)
|
|
63
|
-
], CliPlugins.prototype, "npmRegistryClient", void 0);
|
|
64
|
-
__decorate([
|
|
65
|
-
Inject(InjectorService),
|
|
66
|
-
__metadata("design:type", InjectorService)
|
|
67
|
-
], CliPlugins.prototype, "injector", void 0);
|
|
68
|
-
__decorate([
|
|
69
|
-
Inject(CliHooks),
|
|
70
|
-
__metadata("design:type", CliHooks)
|
|
71
|
-
], CliPlugins.prototype, "cliHooks", void 0);
|
|
72
|
-
__decorate([
|
|
73
|
-
Inject(ProjectPackageJson),
|
|
74
|
-
__metadata("design:type", ProjectPackageJson)
|
|
75
|
-
], CliPlugins.prototype, "packageJson", void 0);
|
|
76
|
-
__decorate([
|
|
77
|
-
Inject(PackageManagersModule),
|
|
78
|
-
__metadata("design:type", PackageManagersModule)
|
|
79
|
-
], CliPlugins.prototype, "packageManagers", void 0);
|
|
80
61
|
CliPlugins = __decorate([
|
|
81
62
|
Injectable()
|
|
82
63
|
], CliPlugins);
|
|
83
64
|
export { CliPlugins };
|
|
84
|
-
//# sourceMappingURL=CliPlugins.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { __decorate
|
|
2
|
-
import { Configuration, Inject, Injectable,
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { Configuration, Inject, inject, Injectable, refValue } from "@tsed/di";
|
|
3
3
|
import { camelCase } from "change-case";
|
|
4
4
|
import tunnel from "tunnel";
|
|
5
5
|
import { URL } from "url";
|
|
@@ -7,13 +7,18 @@ import { coerce } from "../utils/coerce.js";
|
|
|
7
7
|
import { CliExeca } from "./CliExeca.js";
|
|
8
8
|
import { ProjectPackageJson } from "./ProjectPackageJson.js";
|
|
9
9
|
let CliProxyAgent = class CliProxyAgent {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.proxySettings = refValue("proxy", {});
|
|
12
|
+
this.projectPackageJson = Inject(ProjectPackageJson);
|
|
13
|
+
this.cliExeca = inject(CliExeca);
|
|
14
|
+
}
|
|
10
15
|
hasProxy() {
|
|
11
|
-
return !!this.proxySettings.url;
|
|
16
|
+
return !!this.proxySettings.value.url;
|
|
12
17
|
}
|
|
13
18
|
get(type) {
|
|
14
19
|
if (this.hasProxy()) {
|
|
15
|
-
const { strictSsl = true } = this.proxySettings;
|
|
16
|
-
const url = new URL(this.proxySettings.url);
|
|
20
|
+
const { strictSsl = true } = this.proxySettings.value;
|
|
21
|
+
const url = new URL(this.proxySettings.value.url);
|
|
17
22
|
const protocol = url.protocol.replace(":", "");
|
|
18
23
|
const options = {
|
|
19
24
|
proxy: {
|
|
@@ -60,25 +65,13 @@ let CliProxyAgent = class CliProxyAgent {
|
|
|
60
65
|
const [proxy, httpProxy, httpsProxy, strictSsl] = result.map(coerce);
|
|
61
66
|
const url = httpsProxy || httpProxy || proxy;
|
|
62
67
|
if (url) {
|
|
63
|
-
this.proxySettings = {
|
|
68
|
+
this.proxySettings.value = {
|
|
64
69
|
url,
|
|
65
70
|
strictSsl: coerce(strictSsl) !== false
|
|
66
71
|
};
|
|
67
72
|
}
|
|
68
73
|
}
|
|
69
74
|
};
|
|
70
|
-
__decorate([
|
|
71
|
-
Value("proxy", {}),
|
|
72
|
-
__metadata("design:type", Object)
|
|
73
|
-
], CliProxyAgent.prototype, "proxySettings", void 0);
|
|
74
|
-
__decorate([
|
|
75
|
-
Inject(),
|
|
76
|
-
__metadata("design:type", ProjectPackageJson)
|
|
77
|
-
], CliProxyAgent.prototype, "projectPackageJson", void 0);
|
|
78
|
-
__decorate([
|
|
79
|
-
Inject(),
|
|
80
|
-
__metadata("design:type", CliExeca)
|
|
81
|
-
], CliProxyAgent.prototype, "cliExeca", void 0);
|
|
82
75
|
CliProxyAgent = __decorate([
|
|
83
76
|
Injectable(),
|
|
84
77
|
Configuration({
|
|
@@ -89,4 +82,3 @@ CliProxyAgent = __decorate([
|
|
|
89
82
|
})
|
|
90
83
|
], CliProxyAgent);
|
|
91
84
|
export { CliProxyAgent };
|
|
92
|
-
//# sourceMappingURL=CliProxyAgent.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { __decorate
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
2
|
// @ts-ignore
|
|
3
3
|
import runScript from "@npmcli/run-script";
|
|
4
|
-
import {
|
|
4
|
+
import { inject, Injectable } from "@tsed/di";
|
|
5
5
|
import { ProjectPackageJson } from "./ProjectPackageJson.js";
|
|
6
6
|
let CliRunScript = class CliRunScript {
|
|
7
7
|
run(cmd, args, options = {}) {
|
|
@@ -9,19 +9,14 @@ let CliRunScript = class CliRunScript {
|
|
|
9
9
|
event: "run",
|
|
10
10
|
...options,
|
|
11
11
|
cmd: `${cmd} ${args.join(" ")}`,
|
|
12
|
-
path: options.cwd ||
|
|
12
|
+
path: options.cwd || inject(ProjectPackageJson).dir,
|
|
13
13
|
env: options.env || {},
|
|
14
14
|
stdio: options.stdio || "inherit",
|
|
15
15
|
banner: false
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
|
-
__decorate([
|
|
20
|
-
Inject(),
|
|
21
|
-
__metadata("design:type", ProjectPackageJson)
|
|
22
|
-
], CliRunScript.prototype, "projectPackageJson", void 0);
|
|
23
19
|
CliRunScript = __decorate([
|
|
24
20
|
Injectable()
|
|
25
21
|
], CliRunScript);
|
|
26
22
|
export { CliRunScript };
|
|
27
|
-
//# sourceMappingURL=CliRunScript.js.map
|