@tsed/cli-core 7.0.0-alpha.1 → 7.0.0-alpha.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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { classOf } from "@tsed/core";
|
|
2
|
-
import { configuration, constant, destroyInjector, DIContext, getContext, inject, injectable, injector, logger, Provider, runInContext } from "@tsed/di";
|
|
2
|
+
import { configuration, constant, context, destroyInjector, DIContext, getContext, inject, injectable, injector, logger, Provider, runInContext } from "@tsed/di";
|
|
3
3
|
import { $asyncAlter, $asyncEmit } from "@tsed/hooks";
|
|
4
4
|
import { pascalCase } from "change-case";
|
|
5
5
|
import { Argument, Command } from "commander";
|
|
@@ -134,7 +134,17 @@ export class CliService {
|
|
|
134
134
|
...(await instance.$exec(data)),
|
|
135
135
|
...(await this.hooks.emit(CommandStoreKeys.EXEC_HOOKS, cmdName, data)),
|
|
136
136
|
...(await $asyncAlter(`$alter${pascalCase(cmdName)}Tasks`, [], [data]))
|
|
137
|
-
]
|
|
137
|
+
].map((opts) => {
|
|
138
|
+
return {
|
|
139
|
+
...opts,
|
|
140
|
+
task: async (arg, task) => {
|
|
141
|
+
context().set("currentTask", task);
|
|
142
|
+
const result = await opts.task(arg, task);
|
|
143
|
+
context().delete("currentTask");
|
|
144
|
+
return result;
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
});
|
|
138
148
|
}
|
|
139
149
|
async getPostInstallTasks(cmdName, data) {
|
|
140
150
|
const provider = this.commands.get(cmdName);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/cli-core",
|
|
3
3
|
"description": "Build your CLI with TypeScript and Decorators",
|
|
4
|
-
"version": "7.0.0-alpha.
|
|
4
|
+
"version": "7.0.0-alpha.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/esm/index.js",
|
|
7
7
|
"source": "./src/index.ts",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"uuid": "^10.0.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@tsed/typescript": "7.0.0-alpha.
|
|
67
|
+
"@tsed/typescript": "7.0.0-alpha.2",
|
|
68
68
|
"@types/commander": "2.12.2",
|
|
69
69
|
"@types/figures": "3.0.1",
|
|
70
70
|
"@types/fs-extra": "^11.0.4",
|