@granite-js/plugin-micro-frontend 0.1.17 → 0.1.19
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/CHANGELOG.md +16 -0
- package/dist/runtime/index.cjs +21 -11
- package/dist/runtime/index.d.cts +1 -1
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.js +21 -11
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @granite-js/plugin-micro-frontend
|
|
2
2
|
|
|
3
|
+
## 0.1.19
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [e9a3daf]
|
|
8
|
+
- @granite-js/plugin-core@0.1.19
|
|
9
|
+
- @granite-js/utils@0.1.19
|
|
10
|
+
|
|
11
|
+
## 0.1.18
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 58e4df9: define \_\_esModule flag safety
|
|
16
|
+
- @granite-js/plugin-core@0.1.18
|
|
17
|
+
- @granite-js/utils@0.1.18
|
|
18
|
+
|
|
3
19
|
## 0.1.17
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/runtime/index.cjs
CHANGED
|
@@ -17,16 +17,6 @@ function createContainer(name, config) {
|
|
|
17
17
|
return container;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
//#endregion
|
|
21
|
-
//#region src/runtime/registerShared.ts
|
|
22
|
-
function registerShared(libName, module$1) {
|
|
23
|
-
if (global.__MICRO_FRONTEND__.__SHARED__[libName]) throw new Error(`'${libName}' already registered as a shared module`);
|
|
24
|
-
global.__MICRO_FRONTEND__.__SHARED__[libName] = {
|
|
25
|
-
get: () => Object.assign(module$1, { __esModule: true }),
|
|
26
|
-
loaded: true
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
|
|
30
20
|
//#endregion
|
|
31
21
|
//#region src/runtime/utils.ts
|
|
32
22
|
function getContainer(instanceName) {
|
|
@@ -54,6 +44,26 @@ function importRemoteModule(remoteRequestPath) {
|
|
|
54
44
|
if (module$1 == null) throw new Error(`Could not resolve '${modulePath}' in ${remoteName} container`);
|
|
55
45
|
return module$1;
|
|
56
46
|
}
|
|
47
|
+
function toESM(module$1) {
|
|
48
|
+
if (module$1.__esModule) return module$1;
|
|
49
|
+
return Object.defineProperties(module$1, {
|
|
50
|
+
__esModule: { value: true },
|
|
51
|
+
...module$1.default == null ? { default: {
|
|
52
|
+
value: module$1,
|
|
53
|
+
enumerable: true
|
|
54
|
+
} } : null
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region src/runtime/registerShared.ts
|
|
60
|
+
function registerShared(libName, module$1) {
|
|
61
|
+
if (global.__MICRO_FRONTEND__.__SHARED__[libName]) throw new Error(`'${libName}' already registered as a shared module`);
|
|
62
|
+
global.__MICRO_FRONTEND__.__SHARED__[libName] = {
|
|
63
|
+
get: () => toESM(module$1),
|
|
64
|
+
loaded: true
|
|
65
|
+
};
|
|
66
|
+
}
|
|
57
67
|
|
|
58
68
|
//#endregion
|
|
59
69
|
//#region src/runtime/exposeModule.ts
|
|
@@ -61,7 +71,7 @@ function exposeModule(container, exposeName, module$1) {
|
|
|
61
71
|
const normalizedExposeName = normalizePath(exposeName);
|
|
62
72
|
if (container.exposeMap[normalizedExposeName]) throw new Error(`'${exposeName}' is already exposed in ${container.name} container`);
|
|
63
73
|
Object.defineProperty(container.exposeMap, normalizedExposeName, {
|
|
64
|
-
get: () =>
|
|
74
|
+
get: () => toESM(module$1),
|
|
65
75
|
enumerable: true
|
|
66
76
|
});
|
|
67
77
|
}
|
package/dist/runtime/index.d.cts
CHANGED
|
@@ -57,7 +57,7 @@ declare function createContainer(name: string, config: {
|
|
|
57
57
|
|
|
58
58
|
//#endregion
|
|
59
59
|
//#region src/runtime/registerShared.d.ts
|
|
60
|
-
declare function registerShared(libName: string, module:
|
|
60
|
+
declare function registerShared(libName: string, module: Module): void;
|
|
61
61
|
|
|
62
62
|
//#endregion
|
|
63
63
|
//#region src/runtime/exposeModule.d.ts
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -57,7 +57,7 @@ declare function createContainer(name: string, config: {
|
|
|
57
57
|
|
|
58
58
|
//#endregion
|
|
59
59
|
//#region src/runtime/registerShared.d.ts
|
|
60
|
-
declare function registerShared(libName: string, module:
|
|
60
|
+
declare function registerShared(libName: string, module: Module): void;
|
|
61
61
|
|
|
62
62
|
//#endregion
|
|
63
63
|
//#region src/runtime/exposeModule.d.ts
|
package/dist/runtime/index.js
CHANGED
|
@@ -16,16 +16,6 @@ function createContainer(name, config) {
|
|
|
16
16
|
return container;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
//#endregion
|
|
20
|
-
//#region src/runtime/registerShared.ts
|
|
21
|
-
function registerShared(libName, module) {
|
|
22
|
-
if (global.__MICRO_FRONTEND__.__SHARED__[libName]) throw new Error(`'${libName}' already registered as a shared module`);
|
|
23
|
-
global.__MICRO_FRONTEND__.__SHARED__[libName] = {
|
|
24
|
-
get: () => Object.assign(module, { __esModule: true }),
|
|
25
|
-
loaded: true
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
19
|
//#endregion
|
|
30
20
|
//#region src/runtime/utils.ts
|
|
31
21
|
function getContainer(instanceName) {
|
|
@@ -53,6 +43,26 @@ function importRemoteModule(remoteRequestPath) {
|
|
|
53
43
|
if (module == null) throw new Error(`Could not resolve '${modulePath}' in ${remoteName} container`);
|
|
54
44
|
return module;
|
|
55
45
|
}
|
|
46
|
+
function toESM(module) {
|
|
47
|
+
if (module.__esModule) return module;
|
|
48
|
+
return Object.defineProperties(module, {
|
|
49
|
+
__esModule: { value: true },
|
|
50
|
+
...module.default == null ? { default: {
|
|
51
|
+
value: module,
|
|
52
|
+
enumerable: true
|
|
53
|
+
} } : null
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/runtime/registerShared.ts
|
|
59
|
+
function registerShared(libName, module) {
|
|
60
|
+
if (global.__MICRO_FRONTEND__.__SHARED__[libName]) throw new Error(`'${libName}' already registered as a shared module`);
|
|
61
|
+
global.__MICRO_FRONTEND__.__SHARED__[libName] = {
|
|
62
|
+
get: () => toESM(module),
|
|
63
|
+
loaded: true
|
|
64
|
+
};
|
|
65
|
+
}
|
|
56
66
|
|
|
57
67
|
//#endregion
|
|
58
68
|
//#region src/runtime/exposeModule.ts
|
|
@@ -60,7 +70,7 @@ function exposeModule(container, exposeName, module) {
|
|
|
60
70
|
const normalizedExposeName = normalizePath(exposeName);
|
|
61
71
|
if (container.exposeMap[normalizedExposeName]) throw new Error(`'${exposeName}' is already exposed in ${container.name} container`);
|
|
62
72
|
Object.defineProperty(container.exposeMap, normalizedExposeName, {
|
|
63
|
-
get: () =>
|
|
73
|
+
get: () => toESM(module),
|
|
64
74
|
enumerable: true
|
|
65
75
|
});
|
|
66
76
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@granite-js/plugin-micro-frontend",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.19",
|
|
5
5
|
"description": "Plugin for micro frontend",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"prepack": "yarn build",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"vitest": "^3.2.4"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@granite-js/plugin-core": "0.1.
|
|
48
|
-
"@granite-js/utils": "0.1.
|
|
47
|
+
"@granite-js/plugin-core": "0.1.19",
|
|
48
|
+
"@granite-js/utils": "0.1.19",
|
|
49
49
|
"es-toolkit": "^1.39.8",
|
|
50
50
|
"picocolors": "^1.1.1"
|
|
51
51
|
},
|