@constatic/base 0.0.1-beta.10 → 0.0.1-beta.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.
@@ -12,8 +12,5 @@ export interface BootstrapOptions extends CustomClientOptions {
12
12
  }
13
13
  export declare function bootstrap(options: BootstrapOptions): Promise<{
14
14
  client: Client<boolean>;
15
- imports: {
16
- module: any;
17
- filepath: string;
18
- }[];
15
+ imports: import("./modules.js").ModuleImported[];
19
16
  }>;
package/dist/modules.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- export declare function loadModules(meta: ImportMeta, modules?: string[]): Promise<{
1
+ export interface ModuleImported {
2
2
  module: any;
3
3
  filepath: string;
4
- }[]>;
4
+ }
5
+ export declare function loadModules(meta: ImportMeta, modules?: string[]): Promise<ModuleImported[]>;
package/dist/modules.js CHANGED
@@ -1,14 +1,17 @@
1
1
  // src/modules.ts
2
2
  import { glob } from "node:fs/promises";
3
- import path from "node:path";
3
+ import { join } from "node:path";
4
4
  async function loadModules(meta, modules = []) {
5
- const exclude = modules.filter((path2) => path2.charAt(0) == "!").map((path2) => path2.slice(1));
5
+ const exclude = modules.filter((path) => path.charAt(0) == "!").map((path) => path.slice(1));
6
6
  const filepaths = await Array.fromAsync(glob(modules, { cwd: meta.dirname, exclude }));
7
- const promises = filepaths.map((filepath) => import(path.join(meta.dirname, filepath)).then((imported) => ({
8
- module: imported,
9
- filepath
10
- })));
11
- return Promise.all(promises);
7
+ const loadModules2 = [];
8
+ for (const path of filepaths) {
9
+ await import(join(meta.dirname, path)).then((imported) => loadModules2.push({
10
+ module: imported,
11
+ filepath: path
12
+ }));
13
+ }
14
+ return loadModules2;
12
15
  }
13
16
  export {
14
17
  loadModules
package/dist/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/version.ts
2
- var version = "0.0.1-beta.10";
2
+ var version = "0.0.1-beta.11";
3
3
  export {
4
4
  version
5
5
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constatic/base",
3
- "version": "0.0.1-beta.10",
3
+ "version": "0.0.1-beta.11",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "type": "module",