@tsed/cli-core 7.0.0-beta.8 → 7.0.0-beta.9
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.
|
@@ -51,7 +51,9 @@ export class CliFs extends RealFileSystemHost {
|
|
|
51
51
|
return this.raw.ensureDirSync(path, options);
|
|
52
52
|
}
|
|
53
53
|
findUpFile(root, file) {
|
|
54
|
-
return [join(root, file), join(root, "..", file), join(root, "..", "..", file), join(root, "..", "..", "..", file)].find((path) =>
|
|
54
|
+
return [join(root, file), join(root, "..", file), join(root, "..", "..", file), join(root, "..", "..", "..", file)].find((path) => {
|
|
55
|
+
return this.fileExistsSync(path) || this.raw.existsSync(path);
|
|
56
|
+
});
|
|
55
57
|
}
|
|
56
58
|
async importModule(mod, root = process.cwd()) {
|
|
57
59
|
try {
|
|
@@ -19,7 +19,6 @@ export class CliPlugins {
|
|
|
19
19
|
this.name = constant("name", "");
|
|
20
20
|
this.loadPlugins = loadPlugins;
|
|
21
21
|
this.npmRegistryClient = inject(NpmRegistryClient);
|
|
22
|
-
this.cliHooks = inject(CliHooks);
|
|
23
22
|
this.packageJson = inject(ProjectPackageJson);
|
|
24
23
|
this.packageManagers = inject(PackageManagersModule);
|
|
25
24
|
}
|
|
@@ -7,7 +7,6 @@ const all = (promises) => Promise.all(promises);
|
|
|
7
7
|
export async function loadPlugins() {
|
|
8
8
|
const $inj = injector();
|
|
9
9
|
const name = $inj.settings.get("name");
|
|
10
|
-
const rootDir = $inj.settings.get("project.rootDir");
|
|
11
10
|
const projectPackageJson = $inj.invoke(ProjectPackageJson);
|
|
12
11
|
const fs = $inj.invoke(CliFs);
|
|
13
12
|
const promises = Object.keys(projectPackageJson.allDependencies)
|
|
@@ -16,33 +15,12 @@ export async function loadPlugins() {
|
|
|
16
15
|
try {
|
|
17
16
|
if ($inj.settings.get("loaded")) {
|
|
18
17
|
logger().info("Try to load ", mod);
|
|
19
|
-
await lazyInject(() => fs.importModule(mod,
|
|
18
|
+
await lazyInject(() => fs.importModule(mod, projectPackageJson.cwd));
|
|
20
19
|
}
|
|
21
|
-
// if (!$inj.has(plugin)) {
|
|
22
|
-
// const provider = GlobalProviders.get(plugin)?.clone();
|
|
23
|
-
//
|
|
24
|
-
// if (provider?.imports.length) {
|
|
25
|
-
// await all(
|
|
26
|
-
// provider.imports.map(async (token: any) => {
|
|
27
|
-
// $inj.add(token, GlobalProviders.get(token)?.clone());
|
|
28
|
-
//
|
|
29
|
-
// if ($inj.settings.get("loaded")) {
|
|
30
|
-
// await $inj.invoke(token);
|
|
31
|
-
// }
|
|
32
|
-
// })
|
|
33
|
-
// );
|
|
34
|
-
// }
|
|
35
|
-
//
|
|
36
|
-
// $inj.add(plugin, provider);
|
|
37
|
-
//
|
|
38
|
-
// if ($inj.settings.get("loaded")) {
|
|
39
|
-
// await $inj.invoke(plugin);
|
|
40
|
-
// }
|
|
41
|
-
// }
|
|
42
20
|
logger().info(chalk.green(figures.tick), mod, "module loaded");
|
|
43
21
|
}
|
|
44
22
|
catch (er) {
|
|
45
|
-
logger().warn(chalk.red(figures.cross), "Fail to load plugin", mod);
|
|
23
|
+
logger().warn(chalk.red(figures.cross), "Fail to load plugin", mod, er.message);
|
|
46
24
|
}
|
|
47
25
|
});
|
|
48
26
|
await all(promises);
|
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-beta.
|
|
4
|
+
"version": "7.0.0-beta.9",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/esm/index.js",
|
|
7
7
|
"source": "./src/index.ts",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"uuid": "^10.0.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@tsed/typescript": "7.0.0-beta.
|
|
68
|
+
"@tsed/typescript": "7.0.0-beta.9",
|
|
69
69
|
"@types/commander": "2.12.2",
|
|
70
70
|
"@types/figures": "3.0.1",
|
|
71
71
|
"@types/fs-extra": "^11.0.4",
|