@cabloy/cli 3.0.9 → 3.0.11
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.
|
@@ -114,6 +114,7 @@ export declare class LocalHelper {
|
|
|
114
114
|
safeSplit(str: string, sep?: string): string[];
|
|
115
115
|
removeGitkeep(parentPath: string): Promise<void>;
|
|
116
116
|
combineModuleNameAndResource(moduleName: string, resourceName: string): string;
|
|
117
|
+
importDynamic(fileName: string): Promise<any>;
|
|
117
118
|
importDynamic<RESULT>(fileName: string, fn: (instance: any) => Promise<RESULT>): Promise<RESULT>;
|
|
118
119
|
requireDynamic(file: string): any;
|
|
119
120
|
private _requireDynamic_getFileTime;
|
package/dist/lib/local.helper.js
CHANGED
|
@@ -245,6 +245,8 @@ export class LocalHelper {
|
|
|
245
245
|
async importDynamic(fileName, fn) {
|
|
246
246
|
// load
|
|
247
247
|
const instance = await import(__rewriteRelativeImportExtension(this.pathToHref(fileName)));
|
|
248
|
+
if (!fn)
|
|
249
|
+
return instance;
|
|
248
250
|
return await fn(instance);
|
|
249
251
|
}
|
|
250
252
|
requireDynamic(file) {
|
|
@@ -41,6 +41,7 @@ export class LocalTemplate {
|
|
|
41
41
|
return path.join(path.dirname(modulePath), 'cli/templates', _path);
|
|
42
42
|
}
|
|
43
43
|
async renderBoilerplateAndSnippets({ targetDir, setName, snippetsPath, boilerplatePath, }) {
|
|
44
|
+
await this.helper.ensureDir(targetDir);
|
|
44
45
|
// first
|
|
45
46
|
if (snippetsPath) {
|
|
46
47
|
const snippetsDir = this.resolveTemplatePath(setName, snippetsPath);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cabloy/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.11",
|
|
5
5
|
"description": "@cabloy/cli",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
"semver": "^7.6.2",
|
|
44
44
|
"tmp": "^0.2.3",
|
|
45
45
|
"urllib": "^3.24.0",
|
|
46
|
-
"@cabloy/module-
|
|
47
|
-
"@cabloy/module-
|
|
48
|
-
"@cabloy/
|
|
49
|
-
"@cabloy/
|
|
46
|
+
"@cabloy/module-info": "^1.3.6",
|
|
47
|
+
"@cabloy/module-glob": "^5.2.1",
|
|
48
|
+
"@cabloy/utils": "^1.0.11",
|
|
49
|
+
"@cabloy/process-helper": "^2.0.4"
|
|
50
50
|
},
|
|
51
51
|
"gitHead": "2d40c063c115b230fdbc89f5a78b4412ebd0dfc9"
|
|
52
52
|
}
|