@cabloy/cli 3.0.10 → 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;
@@ -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) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cabloy/cli",
3
3
  "type": "module",
4
- "version": "3.0.10",
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-glob": "^5.2.1",
47
46
  "@cabloy/module-info": "^1.3.6",
48
- "@cabloy/process-helper": "^2.0.4",
49
- "@cabloy/utils": "^1.0.11"
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
  }