phecda-module 1.0.4-alpha.9 → 1.0.4-beta.13
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.
- package/.turbo/turbo-build.log +6 -6
- package/CHANGELOG.md +34 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/index.mjs +4 -4
- package/package.json +2 -2
- package/src/core.ts +5 -5
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
WARN Issue while reading "/home/runner/work/phecda/phecda/.npmrc". Failed to replace env in config: ${NPM_TOKEN}
|
|
2
2
|
|
|
3
|
-
> phecda-module@1.0.4-
|
|
3
|
+
> phecda-module@1.0.4-beta.13 build /home/runner/work/phecda/phecda/packages/module
|
|
4
4
|
> tsup
|
|
5
5
|
|
|
6
6
|
[34mCLI[39m Building entry: src/index.ts, src/vite.ts
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
[34mESM[39m Build start
|
|
13
13
|
[32mCJS[39m [1mdist/index.js [22m[32m3.14 KB[39m
|
|
14
14
|
[32mCJS[39m [1mdist/vite.js [22m[32m1.42 KB[39m
|
|
15
|
-
[32mCJS[39m ⚡️ Build success in
|
|
16
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m1.
|
|
15
|
+
[32mCJS[39m ⚡️ Build success in 48ms
|
|
16
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m1.89 KB[39m
|
|
17
17
|
[32mESM[39m [1mdist/vite.mjs [22m[32m519.00 B[39m
|
|
18
|
-
[32mESM[39m ⚡️ Build success in
|
|
18
|
+
[32mESM[39m ⚡️ Build success in 48ms
|
|
19
19
|
[34mDTS[39m Build start
|
|
20
|
-
[32mDTS[39m ⚡️ Build success in
|
|
21
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
|
20
|
+
[32mDTS[39m ⚡️ Build success in 2306ms
|
|
21
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m191.00 B[39m
|
|
22
22
|
[32mDTS[39m [1mdist/vite.d.ts [22m[32m210.00 B[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# phecda-module
|
|
2
2
|
|
|
3
|
+
## 1.0.4-beta.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [d1f7041]
|
|
8
|
+
- Updated dependencies [5a477d0]
|
|
9
|
+
- Updated dependencies [aefd80c]
|
|
10
|
+
- phecda-core@3.0.0-beta.13
|
|
11
|
+
|
|
12
|
+
## 1.0.4-alpha.12
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [671fbc9]
|
|
17
|
+
- Updated dependencies [671fbc9]
|
|
18
|
+
- phecda-core@3.0.0-alpha.12
|
|
19
|
+
|
|
20
|
+
## 1.0.4-alpha.11
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- Updated dependencies [c6427b1]
|
|
25
|
+
- Updated dependencies [7b0d6fa]
|
|
26
|
+
- Updated dependencies [4621244]
|
|
27
|
+
- Updated dependencies [dbb599a]
|
|
28
|
+
- phecda-core@3.0.0-alpha.11
|
|
29
|
+
|
|
30
|
+
## 1.0.4-alpha.10
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- Updated dependencies [e254263]
|
|
35
|
+
- phecda-core@3.0.0-alpha.10
|
|
36
|
+
|
|
3
37
|
## 1.0.4-alpha.9
|
|
4
38
|
|
|
5
39
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -39,7 +39,7 @@ __name(Factory, "Factory");
|
|
|
39
39
|
if (__DEV__) {
|
|
40
40
|
window.__PHECDA_MODULE_UPDATE__ = (target) => {
|
|
41
41
|
target = Object.values(target)[0];
|
|
42
|
-
const tag =
|
|
42
|
+
const tag = (0, import_phecda_core.getTag)(target);
|
|
43
43
|
const module2 = moduleMap.get(tag);
|
|
44
44
|
module2.destroy?.();
|
|
45
45
|
moduleMap.delete(tag);
|
|
@@ -49,11 +49,11 @@ if (__DEV__) {
|
|
|
49
49
|
async function buildNestModule(Module) {
|
|
50
50
|
const paramtypes = getParamtypes(Module);
|
|
51
51
|
let instance;
|
|
52
|
-
const tag =
|
|
52
|
+
const tag = (0, import_phecda_core.getTag)(Module);
|
|
53
53
|
if (moduleMap.has(tag)) {
|
|
54
54
|
instance = moduleMap.get(tag);
|
|
55
55
|
if (!instance)
|
|
56
|
-
throw new Error(`exist Circular-Dependency or Multiple modules with the same name/tag [tag] ${tag}--[module] ${Module}`);
|
|
56
|
+
throw new Error(`exist Circular-Dependency or Multiple modules with the same name/tag [tag] ${String(tag)}--[module] ${Module}`);
|
|
57
57
|
return instance;
|
|
58
58
|
}
|
|
59
59
|
moduleMap.set(tag, void 0);
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
3
|
|
|
4
4
|
// src/core.ts
|
|
5
|
-
import { invokeHandler } from "phecda-core";
|
|
5
|
+
import { getTag, invokeHandler } from "phecda-core";
|
|
6
6
|
import "reflect-metadata";
|
|
7
7
|
var moduleMap = /* @__PURE__ */ new Map();
|
|
8
8
|
async function Factory(Modules) {
|
|
@@ -13,7 +13,7 @@ __name(Factory, "Factory");
|
|
|
13
13
|
if (__DEV__) {
|
|
14
14
|
window.__PHECDA_MODULE_UPDATE__ = (target) => {
|
|
15
15
|
target = Object.values(target)[0];
|
|
16
|
-
const tag = target
|
|
16
|
+
const tag = getTag(target);
|
|
17
17
|
const module = moduleMap.get(tag);
|
|
18
18
|
module.destroy?.();
|
|
19
19
|
moduleMap.delete(tag);
|
|
@@ -23,11 +23,11 @@ if (__DEV__) {
|
|
|
23
23
|
async function buildNestModule(Module) {
|
|
24
24
|
const paramtypes = getParamtypes(Module);
|
|
25
25
|
let instance;
|
|
26
|
-
const tag = Module
|
|
26
|
+
const tag = getTag(Module);
|
|
27
27
|
if (moduleMap.has(tag)) {
|
|
28
28
|
instance = moduleMap.get(tag);
|
|
29
29
|
if (!instance)
|
|
30
|
-
throw new Error(`exist Circular-Dependency or Multiple modules with the same name/tag [tag] ${tag}--[module] ${Module}`);
|
|
30
|
+
throw new Error(`exist Circular-Dependency or Multiple modules with the same name/tag [tag] ${String(tag)}--[module] ${Module}`);
|
|
31
31
|
return instance;
|
|
32
32
|
}
|
|
33
33
|
moduleMap.set(tag, void 0);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "phecda-module",
|
|
3
|
-
"version": "1.0.4-
|
|
3
|
+
"version": "1.0.4-beta.13",
|
|
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",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"license": "ISC",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"reflect-metadata": "^0.1.13",
|
|
30
|
-
"phecda-core": "3.0.0-
|
|
30
|
+
"phecda-core": "3.0.0-beta.13"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"tsup": "^6.5.0"
|
package/src/core.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Construct } from 'phecda-core'
|
|
2
|
-
import { invokeHandler } from 'phecda-core'
|
|
2
|
+
import { getTag, invokeHandler } from 'phecda-core'
|
|
3
3
|
import 'reflect-metadata'
|
|
4
4
|
|
|
5
|
-
export const moduleMap = new Map<
|
|
5
|
+
export const moduleMap = new Map<PropertyKey, InstanceType<Construct>>()
|
|
6
6
|
|
|
7
7
|
export async function Factory(Modules: (new (...args: any) => any)[]) {
|
|
8
8
|
for (const Module of Modules)
|
|
@@ -13,7 +13,7 @@ if (__DEV__) {
|
|
|
13
13
|
// @ts-expect-error work for hmr
|
|
14
14
|
window.__PHECDA_MODULE_UPDATE__ = (target) => {
|
|
15
15
|
target = Object.values(target)[0]
|
|
16
|
-
const tag = target
|
|
16
|
+
const tag = getTag(target)
|
|
17
17
|
const module = moduleMap.get(tag)
|
|
18
18
|
module.destroy?.()
|
|
19
19
|
moduleMap.delete(tag)
|
|
@@ -25,12 +25,12 @@ async function buildNestModule(Module: Construct) {
|
|
|
25
25
|
const paramtypes = getParamtypes(Module) as Construct[]
|
|
26
26
|
|
|
27
27
|
let instance: InstanceType<Construct>
|
|
28
|
-
const tag = Module
|
|
28
|
+
const tag = getTag(Module)
|
|
29
29
|
|
|
30
30
|
if (moduleMap.has(tag)) {
|
|
31
31
|
instance = moduleMap.get(tag)
|
|
32
32
|
if (!instance)
|
|
33
|
-
throw new Error(`exist Circular-Dependency or Multiple modules with the same name/tag [tag] ${tag}--[module] ${Module}`)
|
|
33
|
+
throw new Error(`exist Circular-Dependency or Multiple modules with the same name/tag [tag] ${String(tag)}--[module] ${Module}`)
|
|
34
34
|
|
|
35
35
|
return instance
|
|
36
36
|
}
|