phecda-module 1.0.4 → 1.0.6

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,22 +1,23 @@
1
-  WARN  Issue while reading "/home/runner/work/phecda/phecda/.npmrc". Failed to replace env in config: ${NPM_TOKEN}
2
1
 
3
- > phecda-module@1.0.4 build /home/runner/work/phecda/phecda/packages/module
2
+ > phecda-module@1.0.6 build /home/runner/work/phecda/phecda/packages/module
4
3
  > tsup
5
4
 
6
5
  CLI Building entry: src/index.ts, src/vite.ts
7
- CLI Using tsconfig: ../../tsconfig.json
8
- CLI tsup v6.5.0
6
+ CLI Using tsconfig: tsconfig.json
7
+ CLI tsup v8.1.0
9
8
  CLI Using tsup config: /home/runner/work/phecda/phecda/packages/module/tsup.config.ts
10
9
  CLI Target: esnext
11
10
  CJS Build start
12
11
  ESM Build start
13
- CJS dist/index.js 3.14 KB
14
- CJS dist/vite.js 1.42 KB
15
- CJS ⚡️ Build success in 93ms
16
- ESM dist/index.mjs 1.89 KB
12
+ CJS dist/index.js 3.16 KB
13
+ CJS dist/vite.js 1.34 KB
14
+ CJS ⚡️ Build success in 98ms
15
+ ESM dist/index.mjs 1.87 KB
17
16
  ESM dist/vite.mjs 519.00 B
18
- ESM ⚡️ Build success in 94ms
17
+ ESM ⚡️ Build success in 99ms
19
18
  DTS Build start
20
- DTS ⚡️ Build success in 3121ms
21
- DTS dist/index.d.ts 191.00 B
22
- DTS dist/vite.d.ts 210.00 B
19
+ DTS ⚡️ Build success in 4624ms
20
+ DTS dist/index.d.ts 191.00 B
21
+ DTS dist/vite.d.ts 210.00 B
22
+ DTS dist/index.d.mts 191.00 B
23
+ DTS dist/vite.d.mts 210.00 B
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # phecda-module
2
2
 
3
+ ## 1.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [a55a92f]
8
+ - phecda-core@3.0.2
9
+
10
+ ## 1.0.5
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [c18997a]
15
+ - phecda-core@3.0.1
16
+
3
17
  ## 1.0.4
4
18
 
5
19
  ### Patch Changes
@@ -0,0 +1,6 @@
1
+ export * from 'phecda-core';
2
+
3
+ declare const moduleMap: Map<PropertyKey, any>;
4
+ declare function Factory(Modules: (new (...args: any) => any)[]): Promise<void>;
5
+
6
+ export { Factory, moduleMap };
package/dist/index.js CHANGED
@@ -32,8 +32,7 @@ var import_phecda_core = require("phecda-core");
32
32
  var import_reflect_metadata = require("reflect-metadata");
33
33
  var moduleMap = /* @__PURE__ */ new Map();
34
34
  async function Factory(Modules) {
35
- for (const Module of Modules)
36
- await buildNestModule(Module);
35
+ for (const Module of Modules) await buildNestModule(Module);
37
36
  }
38
37
  __name(Factory, "Factory");
39
38
  if (__DEV__) {
@@ -52,15 +51,13 @@ async function buildNestModule(Module) {
52
51
  const tag = (0, import_phecda_core.getTag)(Module);
53
52
  if (moduleMap.has(tag)) {
54
53
  instance = moduleMap.get(tag);
55
- if (!instance)
56
- throw new Error(`exist Circular-Dependency or Multiple modules with the same name/tag [tag] ${String(tag)}--[module] ${Module}`);
54
+ if (!instance) throw new Error(`exist Circular-Dependency or Multiple modules with the same name/tag [tag] ${String(tag)}--[module] ${Module}`);
57
55
  return instance;
58
56
  }
59
57
  moduleMap.set(tag, void 0);
60
58
  if (paramtypes) {
61
59
  const paramtypesInstances = [];
62
- for (const i in paramtypes)
63
- paramtypesInstances[i] = await buildNestModule(paramtypes[i]);
60
+ for (const i in paramtypes) paramtypesInstances[i] = await buildNestModule(paramtypes[i]);
64
61
  instance = new Module(...paramtypesInstances);
65
62
  } else {
66
63
  instance = new Module();
@@ -92,5 +89,6 @@ __reExport(src_exports, require("phecda-core"), module.exports);
92
89
  // Annotate the CommonJS export names for ESM import in node:
93
90
  0 && (module.exports = {
94
91
  Factory,
95
- moduleMap
92
+ moduleMap,
93
+ ...require("phecda-core")
96
94
  });
package/dist/index.mjs CHANGED
@@ -6,8 +6,7 @@ import { getTag, invokeHandler } from "phecda-core";
6
6
  import "reflect-metadata";
7
7
  var moduleMap = /* @__PURE__ */ new Map();
8
8
  async function Factory(Modules) {
9
- for (const Module of Modules)
10
- await buildNestModule(Module);
9
+ for (const Module of Modules) await buildNestModule(Module);
11
10
  }
12
11
  __name(Factory, "Factory");
13
12
  if (__DEV__) {
@@ -26,15 +25,13 @@ async function buildNestModule(Module) {
26
25
  const tag = getTag(Module);
27
26
  if (moduleMap.has(tag)) {
28
27
  instance = moduleMap.get(tag);
29
- if (!instance)
30
- throw new Error(`exist Circular-Dependency or Multiple modules with the same name/tag [tag] ${String(tag)}--[module] ${Module}`);
28
+ if (!instance) throw new Error(`exist Circular-Dependency or Multiple modules with the same name/tag [tag] ${String(tag)}--[module] ${Module}`);
31
29
  return instance;
32
30
  }
33
31
  moduleMap.set(tag, void 0);
34
32
  if (paramtypes) {
35
33
  const paramtypesInstances = [];
36
- for (const i in paramtypes)
37
- paramtypesInstances[i] = await buildNestModule(paramtypes[i]);
34
+ for (const i in paramtypes) paramtypesInstances[i] = await buildNestModule(paramtypes[i]);
38
35
  instance = new Module(...paramtypesInstances);
39
36
  } else {
40
37
  instance = new Module();
@@ -0,0 +1,8 @@
1
+ declare function export_default(reg?: RegExp): {
2
+ name: string;
3
+ enforce: string;
4
+ apply: string;
5
+ transform(code: string, id: string): string | undefined;
6
+ };
7
+
8
+ export { export_default as default };
package/dist/vite.js CHANGED
@@ -39,5 +39,3 @@ if (import.meta.hot)
39
39
  };
40
40
  }
41
41
  __name(vite_default, "default");
42
- // Annotate the CommonJS export names for ESM import in node:
43
- 0 && (module.exports = {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phecda-module",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "provide DI and HMR for modules by reflect-metadata and vite",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -22,15 +22,21 @@
22
22
  ]
23
23
  }
24
24
  },
25
- "keywords": [],
26
- "author": "",
27
- "license": "ISC",
25
+ "keywords": [
26
+ "phecda",
27
+ "hmr",
28
+ "web",
29
+ "vite"
30
+ ],
31
+ "author": "fgsreally",
32
+ "repository": "https://github.com/fgsreally/phecda/tree/main/packages/module",
33
+ "license": "MIT",
28
34
  "dependencies": {
29
35
  "reflect-metadata": "^0.1.13",
30
- "phecda-core": "3.0.0"
36
+ "phecda-core": "3.0.2"
31
37
  },
32
38
  "devDependencies": {
33
- "tsup": "^6.5.0"
39
+ "tsup": "^8.1.0"
34
40
  },
35
41
  "scripts": {
36
42
  "dev": "tsup --watch",
package/src/env.d.ts ADDED
@@ -0,0 +1,3 @@
1
+
2
+ declare var __DEV__: boolean
3
+ declare var __PS_HMR__:((files:string[])=>void)[]
package/tsconfig.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "compilerOptions": {
3
+ "baseUrl": ".",
4
+ "outDir": "dist",
5
+ "sourceMap": false,
6
+ "target": "esnext",
7
+ "useDefineForClassFields": false,
8
+ "module": "esnext",
9
+ "moduleResolution": "node",
10
+ "allowJs": false,
11
+ "strict": true,
12
+ "noUnusedLocals": true,
13
+ "resolveJsonModule": true,
14
+ "esModuleInterop": true,
15
+ "removeComments": false,
16
+ "strictPropertyInitialization": false,
17
+ "experimentalDecorators": true,
18
+ "emitDecoratorMetadata": true,
19
+ "jsx": "preserve",
20
+ "lib": [
21
+ "esnext",
22
+ "dom"
23
+ ],
24
+ "types": [
25
+ "node"
26
+ ]
27
+ }
28
+ }
@@ -1,12 +0,0 @@
1
- // tsup.config.ts
2
- var tsup = {
3
- entry: ["src/index.ts", "src/vite.ts"],
4
- format: ["cjs", "esm"],
5
- dts: true,
6
- splitting: false,
7
- shims: false
8
- };
9
- export {
10
- tsup
11
- };
12
- //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidHN1cC5jb25maWcudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9faW5qZWN0ZWRfZmlsZW5hbWVfXyA9IFwiRDpcXFxcTXlQcm9qZWN0XFxcXDIwMjRcXFxcMVxcXFxwaGVjZGFcXFxccGFja2FnZXNcXFxcbW9kdWxlXFxcXHRzdXAuY29uZmlnLnRzXCI7Y29uc3QgX19pbmplY3RlZF9kaXJuYW1lX18gPSBcIkQ6XFxcXE15UHJvamVjdFxcXFwyMDI0XFxcXDFcXFxccGhlY2RhXFxcXHBhY2thZ2VzXFxcXG1vZHVsZVwiO2NvbnN0IF9faW5qZWN0ZWRfaW1wb3J0X21ldGFfdXJsX18gPSBcImZpbGU6Ly8vRDovTXlQcm9qZWN0LzIwMjQvMS9waGVjZGEvcGFja2FnZXMvbW9kdWxlL3RzdXAuY29uZmlnLnRzXCI7aW1wb3J0IHR5cGUgeyBPcHRpb25zIH0gZnJvbSAndHN1cCdcclxuXHJcbmV4cG9ydCBjb25zdCB0c3VwOiBPcHRpb25zID0ge1xyXG4gIGVudHJ5OiBbJ3NyYy9pbmRleC50cycsICdzcmMvdml0ZS50cyddLFxyXG4gIGZvcm1hdDogWydjanMnLCAnZXNtJ10sXHJcbiAgZHRzOiB0cnVlLFxyXG4gIHNwbGl0dGluZzogZmFsc2UsXHJcbiAgc2hpbXM6IGZhbHNlLFxyXG59XHJcbiJdLAogICJtYXBwaW5ncyI6ICI7QUFFTyxJQUFNLE9BQWdCO0FBQUEsRUFDM0IsT0FBTyxDQUFDLGdCQUFnQixhQUFhO0FBQUEsRUFDckMsUUFBUSxDQUFDLE9BQU8sS0FBSztBQUFBLEVBQ3JCLEtBQUs7QUFBQSxFQUNMLFdBQVc7QUFBQSxFQUNYLE9BQU87QUFDVDsiLAogICJuYW1lcyI6IFtdCn0K