@module-federation/nextjs-mf 0.0.0-docs-remove-invalid-lark-link-20251205062649

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.
Files changed (88) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +5 -0
  3. package/dist/client/UrlNode.d.ts +17 -0
  4. package/dist/client/UrlNode.js +150 -0
  5. package/dist/client/UrlNode.js.map +1 -0
  6. package/dist/node.d.ts +1 -0
  7. package/dist/node.js +18 -0
  8. package/dist/node.js.map +1 -0
  9. package/dist/package.json +71 -0
  10. package/dist/src/federation-noop.cjs +15 -0
  11. package/dist/src/federation-noop.d.ts +0 -0
  12. package/dist/src/federation-noop.js.map +1 -0
  13. package/dist/src/index.d.ts +3 -0
  14. package/dist/src/index.js +12 -0
  15. package/dist/src/index.js.map +1 -0
  16. package/dist/src/internal.d.ts +50 -0
  17. package/dist/src/internal.js +255 -0
  18. package/dist/src/internal.js.map +1 -0
  19. package/dist/src/loaders/fixImageLoader.d.ts +22 -0
  20. package/dist/src/loaders/fixImageLoader.js +116 -0
  21. package/dist/src/loaders/fixImageLoader.js.map +1 -0
  22. package/dist/src/loaders/fixUrlLoader.d.ts +13 -0
  23. package/dist/src/loaders/fixUrlLoader.js +24 -0
  24. package/dist/src/loaders/fixUrlLoader.js.map +1 -0
  25. package/dist/src/loaders/helpers.d.ts +17 -0
  26. package/dist/src/loaders/helpers.js +134 -0
  27. package/dist/src/loaders/helpers.js.map +1 -0
  28. package/dist/src/loaders/nextPageMapLoader.d.ts +24 -0
  29. package/dist/src/loaders/nextPageMapLoader.js +166 -0
  30. package/dist/src/loaders/nextPageMapLoader.js.map +1 -0
  31. package/dist/src/logger.d.ts +2 -0
  32. package/dist/src/logger.js +9 -0
  33. package/dist/src/logger.js.map +1 -0
  34. package/dist/src/plugins/AddRuntimeRequirementToPromiseExternalPlugin.d.ts +5 -0
  35. package/dist/src/plugins/AddRuntimeRequirementToPromiseExternalPlugin.js +19 -0
  36. package/dist/src/plugins/AddRuntimeRequirementToPromiseExternalPlugin.js.map +1 -0
  37. package/dist/src/plugins/CopyFederationPlugin.d.ts +20 -0
  38. package/dist/src/plugins/CopyFederationPlugin.js +74 -0
  39. package/dist/src/plugins/CopyFederationPlugin.js.map +1 -0
  40. package/dist/src/plugins/NextFederationPlugin/apply-client-plugins.d.ts +23 -0
  41. package/dist/src/plugins/NextFederationPlugin/apply-client-plugins.js +58 -0
  42. package/dist/src/plugins/NextFederationPlugin/apply-client-plugins.js.map +1 -0
  43. package/dist/src/plugins/NextFederationPlugin/apply-server-plugins.d.ts +36 -0
  44. package/dist/src/plugins/NextFederationPlugin/apply-server-plugins.js +135 -0
  45. package/dist/src/plugins/NextFederationPlugin/apply-server-plugins.js.map +1 -0
  46. package/dist/src/plugins/NextFederationPlugin/index.d.ts +27 -0
  47. package/dist/src/plugins/NextFederationPlugin/index.js +186 -0
  48. package/dist/src/plugins/NextFederationPlugin/index.js.map +1 -0
  49. package/dist/src/plugins/NextFederationPlugin/next-fragments.d.ts +20 -0
  50. package/dist/src/plugins/NextFederationPlugin/next-fragments.js +100 -0
  51. package/dist/src/plugins/NextFederationPlugin/next-fragments.js.map +1 -0
  52. package/dist/src/plugins/NextFederationPlugin/regex-equal.d.ts +14 -0
  53. package/dist/src/plugins/NextFederationPlugin/regex-equal.js +25 -0
  54. package/dist/src/plugins/NextFederationPlugin/regex-equal.js.map +1 -0
  55. package/dist/src/plugins/NextFederationPlugin/remove-unnecessary-shared-keys.d.ts +8 -0
  56. package/dist/src/plugins/NextFederationPlugin/remove-unnecessary-shared-keys.js +34 -0
  57. package/dist/src/plugins/NextFederationPlugin/remove-unnecessary-shared-keys.js.map +1 -0
  58. package/dist/src/plugins/NextFederationPlugin/set-options.d.ts +16 -0
  59. package/dist/src/plugins/NextFederationPlugin/set-options.js +22 -0
  60. package/dist/src/plugins/NextFederationPlugin/set-options.js.map +1 -0
  61. package/dist/src/plugins/NextFederationPlugin/validate-options.d.ts +25 -0
  62. package/dist/src/plugins/NextFederationPlugin/validate-options.js +45 -0
  63. package/dist/src/plugins/NextFederationPlugin/validate-options.js.map +1 -0
  64. package/dist/src/plugins/container/InvertedContainerPlugin.d.ts +5 -0
  65. package/dist/src/plugins/container/InvertedContainerPlugin.js +28 -0
  66. package/dist/src/plugins/container/InvertedContainerPlugin.js.map +1 -0
  67. package/dist/src/plugins/container/InvertedContainerRuntimeModule.d.ts +11 -0
  68. package/dist/src/plugins/container/InvertedContainerRuntimeModule.js +69 -0
  69. package/dist/src/plugins/container/InvertedContainerRuntimeModule.js.map +1 -0
  70. package/dist/src/plugins/container/RemoveEagerModulesFromRuntimePlugin.d.ts +39 -0
  71. package/dist/src/plugins/container/RemoveEagerModulesFromRuntimePlugin.js +78 -0
  72. package/dist/src/plugins/container/RemoveEagerModulesFromRuntimePlugin.js.map +1 -0
  73. package/dist/src/plugins/container/runtimePlugin.cjs +216 -0
  74. package/dist/src/plugins/container/runtimePlugin.d.ts +2 -0
  75. package/dist/src/plugins/container/runtimePlugin.js.map +1 -0
  76. package/dist/src/plugins/container/types.d.ts +2 -0
  77. package/dist/src/plugins/container/types.js +3 -0
  78. package/dist/src/plugins/container/types.js.map +1 -0
  79. package/dist/src/types.d.ts +28 -0
  80. package/dist/src/types.js +3 -0
  81. package/dist/src/types.js.map +1 -0
  82. package/dist/utils/flushedChunks.d.ts +22 -0
  83. package/dist/utils/flushedChunks.js +77 -0
  84. package/dist/utils/flushedChunks.js.map +1 -0
  85. package/dist/utils/index.d.ts +20 -0
  86. package/dist/utils/index.js +66 -0
  87. package/dist/utils/index.js.map +1 -0
  88. package/package.json +71 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023-present zhanghang(2heal1)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # Next.js Support is in maintenance mode
2
+
3
+ Read about it [here](https://github.com/module-federation/core/issues/3153)
4
+
5
+ Plugin Documentation: [here](https://module-federation.io/practice/frameworks/next/index.html)
@@ -0,0 +1,17 @@
1
+ /**
2
+ * This class provides a logic of sorting dynamic routes in NextJS.
3
+ *
4
+ * It was copied from
5
+ * @see https://github.com/vercel/next.js/blob/canary/packages/next/shared/lib/router/utils/sorted-routes.ts
6
+ */
7
+ export declare class UrlNode {
8
+ placeholder: boolean;
9
+ children: Map<string, UrlNode>;
10
+ slugName: string | null;
11
+ restSlugName: string | null;
12
+ optionalRestSlugName: string | null;
13
+ insert(urlPath: string): void;
14
+ smoosh(): string[];
15
+ private _smoosh;
16
+ private _insert;
17
+ }
@@ -0,0 +1,150 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UrlNode = void 0;
4
+ // TODO: fix the no-non-null assertion errors
5
+ /* eslint-disable @typescript-eslint/no-non-null-assertion */
6
+ /**
7
+ * This class provides a logic of sorting dynamic routes in NextJS.
8
+ *
9
+ * It was copied from
10
+ * @see https://github.com/vercel/next.js/blob/canary/packages/next/shared/lib/router/utils/sorted-routes.ts
11
+ */
12
+ class UrlNode {
13
+ constructor() {
14
+ this.placeholder = true;
15
+ this.children = new Map();
16
+ this.slugName = null;
17
+ this.restSlugName = null;
18
+ this.optionalRestSlugName = null;
19
+ }
20
+ insert(urlPath) {
21
+ this._insert(urlPath.split('/').filter(Boolean), [], false);
22
+ }
23
+ smoosh() {
24
+ return this._smoosh();
25
+ }
26
+ _smoosh(prefix = '/') {
27
+ const childrenPaths = [...this.children.keys()].sort();
28
+ if (this.slugName !== null) {
29
+ childrenPaths.splice(childrenPaths.indexOf('[]'), 1);
30
+ }
31
+ if (this.restSlugName !== null) {
32
+ childrenPaths.splice(childrenPaths.indexOf('[...]'), 1);
33
+ }
34
+ if (this.optionalRestSlugName !== null) {
35
+ childrenPaths.splice(childrenPaths.indexOf('[[...]]'), 1);
36
+ }
37
+ const routes = childrenPaths
38
+ .map((c) => this.children.get(c)._smoosh(`${prefix}${c}/`))
39
+ .reduce((prev, curr) => [...prev, ...curr], []);
40
+ if (this.slugName !== null) {
41
+ routes.push(...this.children.get('[]')._smoosh(`${prefix}[${this.slugName}]/`));
42
+ }
43
+ if (!this.placeholder) {
44
+ const r = prefix === '/' ? '/' : prefix.slice(0, -1);
45
+ if (this.optionalRestSlugName != null) {
46
+ throw new Error(`You cannot define a route with the same specificity as a optional catch-all route ("${r}" and "${r}[[...${this.optionalRestSlugName}]]").`);
47
+ }
48
+ routes.unshift(r);
49
+ }
50
+ if (this.restSlugName !== null) {
51
+ routes.push(...this.children
52
+ .get('[...]')
53
+ ._smoosh(`${prefix}[...${this.restSlugName}]/`));
54
+ }
55
+ if (this.optionalRestSlugName !== null) {
56
+ routes.push(...this.children
57
+ .get('[[...]]')
58
+ ._smoosh(`${prefix}[[...${this.optionalRestSlugName}]]/`));
59
+ }
60
+ return routes;
61
+ }
62
+ _insert(urlPaths, slugNames, isCatchAll) {
63
+ if (urlPaths.length === 0) {
64
+ this.placeholder = false;
65
+ return;
66
+ }
67
+ if (isCatchAll) {
68
+ throw new Error(`Catch-all must be the last part of the URL.`);
69
+ }
70
+ // The next segment in the urlPaths list
71
+ let nextSegment = urlPaths[0];
72
+ // Check if the segment matches `[something]`
73
+ if (nextSegment.startsWith('[') && nextSegment.endsWith(']')) {
74
+ // Strip `[` and `]`, leaving only `something`
75
+ let segmentName = nextSegment.slice(1, -1);
76
+ let isOptional = false;
77
+ if (segmentName.startsWith('[') && segmentName.endsWith(']')) {
78
+ // Strip optional `[` and `]`, leaving only `something`
79
+ segmentName = segmentName.slice(1, -1);
80
+ isOptional = true;
81
+ }
82
+ if (segmentName.startsWith('...')) {
83
+ // Strip `...`, leaving only `something`
84
+ segmentName = segmentName.substring(3);
85
+ isCatchAll = true;
86
+ }
87
+ if (segmentName.startsWith('[') || segmentName.endsWith(']')) {
88
+ throw new Error(`Segment names may not start or end with extra brackets ('${segmentName}').`);
89
+ }
90
+ if (segmentName.startsWith('.')) {
91
+ throw new Error(`Segment names may not start with erroneous periods ('${segmentName}').`);
92
+ }
93
+ const handleSlug = function handleSlug(previousSlug, nextSlug) {
94
+ if (previousSlug !== null && previousSlug !== nextSlug) {
95
+ throw new Error(`You cannot use different slug names for the same dynamic path ('${previousSlug}' !== '${nextSlug}').`);
96
+ }
97
+ slugNames.forEach((slug) => {
98
+ if (slug === nextSlug) {
99
+ throw new Error(`You cannot have the same slug name "${nextSlug}" repeat within a single dynamic path`);
100
+ }
101
+ if (slug.replace(/\W/g, '') === nextSegment.replace(/\W/g, '')) {
102
+ throw new Error(`You cannot have the slug names "${slug}" and "${nextSlug}" differ only by non-word symbols within a single dynamic path`);
103
+ }
104
+ });
105
+ slugNames.push(nextSlug);
106
+ };
107
+ if (isCatchAll) {
108
+ if (isOptional) {
109
+ if (this.restSlugName != null) {
110
+ throw new Error(`You cannot use both an required and optional catch-all route at the same level ("[...${this.restSlugName}]" and "${urlPaths[0]}" ).`);
111
+ }
112
+ handleSlug(this.optionalRestSlugName, segmentName);
113
+ // slugName is kept as it can only be one particular slugName
114
+ this.optionalRestSlugName = segmentName;
115
+ // nextSegment is overwritten to [[...]] so that it can later be sorted specifically
116
+ nextSegment = '[[...]]';
117
+ }
118
+ else {
119
+ if (this.optionalRestSlugName != null) {
120
+ throw new Error(`You cannot use both an optional and required catch-all route at the same level ("[[...${this.optionalRestSlugName}]]" and "${urlPaths[0]}").`);
121
+ }
122
+ handleSlug(this.restSlugName, segmentName);
123
+ // slugName is kept as it can only be one particular slugName
124
+ this.restSlugName = segmentName;
125
+ // nextSegment is overwritten to [...] so that it can later be sorted specifically
126
+ nextSegment = '[...]';
127
+ }
128
+ }
129
+ else {
130
+ if (isOptional) {
131
+ throw new Error(`Optional route parameters are not yet supported ("${urlPaths[0]}").`);
132
+ }
133
+ handleSlug(this.slugName, segmentName);
134
+ // slugName is kept as it can only be one particular slugName
135
+ this.slugName = segmentName;
136
+ // nextSegment is overwritten to [] so that it can later be sorted specifically
137
+ nextSegment = '[]';
138
+ }
139
+ }
140
+ // If this UrlNode doesn't have the nextSegment yet we create a new child UrlNode
141
+ if (!this.children.has(nextSegment)) {
142
+ this.children.set(nextSegment, new UrlNode());
143
+ }
144
+ this.children
145
+ .get(nextSegment)
146
+ ._insert(urlPaths.slice(1), slugNames, isCatchAll);
147
+ }
148
+ }
149
+ exports.UrlNode = UrlNode;
150
+ //# sourceMappingURL=UrlNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UrlNode.js","sourceRoot":"","sources":["../../client/UrlNode.ts"],"names":[],"mappings":";;;AAAA,6CAA6C;AAC7C,6DAA6D;AAC7D;;;;;GAKG;AACH,MAAa,OAAO;IAApB;QACE,gBAAW,GAAG,IAAI,CAAC;QACnB,aAAQ,GAAyB,IAAI,GAAG,EAAE,CAAC;QAC3C,aAAQ,GAAkB,IAAI,CAAC;QAC/B,iBAAY,GAAkB,IAAI,CAAC;QACnC,yBAAoB,GAAkB,IAAI,CAAC;IAyL7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,CAAC,CAAC,CAAC,KAAK,CAC/I,CAAC;oBACJ,CAAC;oBAED,UAAU,CAAC,IAAI,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;oBAC3C,6DAA6D;oBAC7D,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;oBAChC,kFAAkF;oBAClF,WAAW,GAAG,OAAO,CAAC;gBACxB,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,IAAI,UAAU,EAAE,CAAC;oBACf,MAAM,IAAI,KAAK,CACb,qDAAqD,QAAQ,CAAC,CAAC,CAAC,KAAK,CACtE,CAAC;gBACJ,CAAC;gBACD,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;gBACvC,6DAA6D;gBAC7D,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC;gBAC5B,+EAA+E;gBAC/E,WAAW,GAAG,IAAI,CAAC;YACrB,CAAC;QACH,CAAC;QAED,iFAAiF;QACjF,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;YACpC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,OAAO,EAAE,CAAC,CAAC;QAChD,CAAC;QAED,IAAI,CAAC,QAAQ;aACV,GAAG,CAAC,WAAW,CAAE;aACjB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;IACvD,CAAC;CACF;AA9LD,0BA8LC"}
package/dist/node.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from '@module-federation/node';
package/dist/node.js ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("@module-federation/node"), exports);
18
+ //# sourceMappingURL=node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.js","sourceRoot":"","sources":["../node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC"}
@@ -0,0 +1,71 @@
1
+ {
2
+ "name": "@module-federation/nextjs-mf",
3
+ "version": "0.0.0-docs-remove-invalid-lark-link-20251205062649",
4
+ "license": "MIT",
5
+ "main": "dist/src/index.js",
6
+ "types": "dist/src/index.d.ts",
7
+ "type": "commonjs",
8
+ "description": "Module Federation helper for NextJS",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/module-federation/core.git",
12
+ "directory": "packages/nextjs-mf"
13
+ },
14
+ "author": "Zack Jackson <zackary.l.jackson@gmail.com>",
15
+ "contributors": [
16
+ "Pavel Chertorogov, nodkz <pavel.chertorogov@gmail.com> (www.ps.kz)"
17
+ ],
18
+ "files": [
19
+ "dist/",
20
+ "README.md"
21
+ ],
22
+ "scripts": {
23
+ "postinstall": "echo \"Deprecation Notice: We intend to deprecate 'nextjs-mf'. Please see https://github.com/module-federation/core/issues/3153 for more details.\""
24
+ },
25
+ "exports": {
26
+ ".": "./dist/src/index.js",
27
+ "./utils": "./dist/utils/index.js",
28
+ "./*": "./*"
29
+ },
30
+ "typesVersions": {
31
+ "*": {
32
+ ".": [
33
+ "./dist/src/index.d.ts"
34
+ ],
35
+ "utils": [
36
+ "./dist/utils/index.d.ts"
37
+ ]
38
+ }
39
+ },
40
+ "publishConfig": {
41
+ "access": "public"
42
+ },
43
+ "dependencies": {
44
+ "fast-glob": "^3.2.11",
45
+ "@module-federation/runtime": "workspace:*",
46
+ "@module-federation/sdk": "workspace:*",
47
+ "@module-federation/enhanced": "workspace:*",
48
+ "@module-federation/node": "workspace:*",
49
+ "@module-federation/webpack-bundler-runtime": "workspace:*"
50
+ },
51
+ "devDependencies": {
52
+ "@types/btoa": "^1.2.5",
53
+ "@types/react": "^18.3.1",
54
+ "@types/react-dom": "^18.3.1"
55
+ },
56
+ "peerDependencies": {
57
+ "webpack": "^5.40.0",
58
+ "next": "^12 || ^13 || ^14 || ^15",
59
+ "react": "^17 || ^18 || ^19",
60
+ "react-dom": "^17 || ^18 || ^19",
61
+ "styled-jsx": "*"
62
+ },
63
+ "peerDependenciesMeta": {
64
+ "webpack": {
65
+ "optional": true
66
+ },
67
+ "styled-jsx": {
68
+ "optional": true
69
+ }
70
+ }
71
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ require('next/head');
3
+ require('next/router');
4
+ require('next/link');
5
+ require('next/script');
6
+ require('next/image');
7
+ require('next/dynamic');
8
+ require('next/error');
9
+ require('next/amp');
10
+ require('styled-jsx');
11
+ require('styled-jsx/style');
12
+ require('next/image');
13
+ // require('react/jsx-dev-runtime');
14
+ require('react/jsx-runtime');
15
+ //# sourceMappingURL=federation-noop.js.map
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"federation-noop.js","sourceRoot":"","sources":["../../src/federation-noop.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,WAAW,CAAC,CAAC;AACrB,OAAO,CAAC,aAAa,CAAC,CAAC;AACvB,OAAO,CAAC,WAAW,CAAC,CAAC;AACrB,OAAO,CAAC,aAAa,CAAC,CAAC;AACvB,OAAO,CAAC,YAAY,CAAC,CAAC;AACtB,OAAO,CAAC,cAAc,CAAC,CAAC;AACxB,OAAO,CAAC,YAAY,CAAC,CAAC;AACtB,OAAO,CAAC,UAAU,CAAC,CAAC;AACpB,OAAO,CAAC,YAAY,CAAC,CAAC;AACtB,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAC5B,OAAO,CAAC,YAAY,CAAC,CAAC;AACtB,oCAAoC;AACpC,OAAO,CAAC,mBAAmB,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import NextFederationPlugin from './plugins/NextFederationPlugin';
2
+ export { NextFederationPlugin };
3
+ export default NextFederationPlugin;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.NextFederationPlugin = void 0;
7
+ const NextFederationPlugin_1 = __importDefault(require("./plugins/NextFederationPlugin"));
8
+ exports.NextFederationPlugin = NextFederationPlugin_1.default;
9
+ exports.default = NextFederationPlugin_1.default;
10
+ module.exports = NextFederationPlugin_1.default;
11
+ module.exports.NextFederationPlugin = NextFederationPlugin_1.default;
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,0FAAkE;AAEzD,+BAFF,8BAAoB,CAEE;AAC7B,kBAAe,8BAAoB,CAAC;AAEpC,MAAM,CAAC,OAAO,GAAG,8BAAoB,CAAC;AACtC,MAAM,CAAC,OAAO,CAAC,oBAAoB,GAAG,8BAAoB,CAAC"}
@@ -0,0 +1,50 @@
1
+ import type { moduleFederationPlugin } from '@module-federation/sdk';
2
+ /**
3
+ * @typedef SharedObject
4
+ * @type {object}
5
+ * @property {object} [key] - The key representing the shared object's package name.
6
+ * @property {boolean} key.singleton - Whether the shared object should be a singleton.
7
+ * @property {boolean} key.requiredVersion - Whether a specific version of the shared object is required.
8
+ * @property {boolean} key.eager - Whether the shared object should be eagerly loaded.
9
+ * @property {boolean} key.import - Whether the shared object should be imported or not.
10
+ * @property {string} key.layer - The webpack layer this shared module belongs to.
11
+ * @property {string|string[]} key.issuerLayer - The webpack layer that can import this shared module.
12
+ */
13
+ export declare const DEFAULT_SHARE_SCOPE: moduleFederationPlugin.SharedObject;
14
+ /**
15
+ * Defines a default share scope for the browser environment.
16
+ * This function takes the DEFAULT_SHARE_SCOPE and sets eager to undefined and import to undefined for all entries.
17
+ * For 'react', 'react-dom', 'next/router', and 'next/link', it sets eager to true.
18
+ * The module hoisting system relocates these modules into the right runtime and out of the remote.
19
+ *
20
+ * @type {SharedObject}
21
+ * @returns {SharedObject} - The modified share scope for the browser environment.
22
+ */
23
+ export declare const DEFAULT_SHARE_SCOPE_BROWSER: moduleFederationPlugin.SharedObject;
24
+ /**
25
+ * Parses the remotes object and checks if they are using a custom promise template or not.
26
+ * If it's a custom promise template, the remote syntax is parsed to get the module name and version number.
27
+ * If the remote value is using the standard remote syntax, a delegated module is created.
28
+ *
29
+ * @param {Record<string, any>} remotes - The remotes object to be parsed.
30
+ * @returns {Record<string, string>} - The parsed remotes object with either the original value,
31
+ * the value for internal or promise delegate module reference, or the created delegated module.
32
+ */
33
+ export declare const parseRemotes: (remotes: Record<string, any>) => Record<string, string>;
34
+ /**
35
+ * Extracts the delegate modules from the provided remotes object.
36
+ * This function iterates over the remotes object and checks if each remote value is an internal delegate module reference.
37
+ * If it is, the function adds it to the returned object.
38
+ *
39
+ * @param {Record<string, any>} remotes - The remotes object containing delegate module references.
40
+ * @returns {Record<string, string>} - An object containing only the delegate modules from the remotes object.
41
+ */
42
+ export declare const getDelegates: (remotes: Record<string, any>) => Record<string, string>;
43
+ /**
44
+ * Transforms an array of Error objects into a single string. Each error message is formatted using the 'formatError' function.
45
+ * The resulting error messages are then joined together, separated by newline characters.
46
+ *
47
+ * @param {Error[]} err - An array of Error objects that need to be formatted and combined.
48
+ * @returns {string} - A single string containing all the formatted error messages, separated by newline characters.
49
+ */
50
+ export declare const toDisplayErrors: (err: Error[]) => string;
@@ -0,0 +1,255 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toDisplayErrors = exports.getDelegates = exports.parseRemotes = exports.DEFAULT_SHARE_SCOPE_BROWSER = exports.DEFAULT_SHARE_SCOPE = void 0;
4
+ const WEBPACK_LAYERS_NAMES = {
5
+ /**
6
+ * The layer for the shared code between the client and server bundles.
7
+ */
8
+ shared: 'shared',
9
+ /**
10
+ * The layer for server-only runtime and picking up `react-server` export conditions.
11
+ * Including app router RSC pages and app router custom routes and metadata routes.
12
+ */
13
+ reactServerComponents: 'rsc',
14
+ /**
15
+ * Server Side Rendering layer for app (ssr).
16
+ */
17
+ serverSideRendering: 'ssr',
18
+ /**
19
+ * The browser client bundle layer for actions.
20
+ */
21
+ actionBrowser: 'action-browser',
22
+ /**
23
+ * The layer for the API routes.
24
+ */
25
+ api: 'api',
26
+ /**
27
+ * The layer for the middleware code.
28
+ */
29
+ middleware: 'middleware',
30
+ /**
31
+ * The layer for the instrumentation hooks.
32
+ */
33
+ instrument: 'instrument',
34
+ /**
35
+ * The layer for assets on the edge.
36
+ */
37
+ edgeAsset: 'edge-asset',
38
+ /**
39
+ * The browser client bundle layer for App directory.
40
+ */
41
+ appPagesBrowser: 'app-pages-browser',
42
+ };
43
+ const createSharedConfig = (name, layers, options = {}) => {
44
+ return layers.reduce((acc, layer) => {
45
+ const key = layer ? `${name}-${layer}` : name;
46
+ acc[key] = {
47
+ singleton: true,
48
+ requiredVersion: false,
49
+ import: layer ? undefined : (options.import ?? false),
50
+ shareKey: options.request ?? name,
51
+ request: options.request ?? name,
52
+ layer,
53
+ issuerLayer: layer,
54
+ };
55
+ return acc;
56
+ }, {});
57
+ };
58
+ const defaultLayers = [
59
+ WEBPACK_LAYERS_NAMES.reactServerComponents,
60
+ WEBPACK_LAYERS_NAMES.serverSideRendering,
61
+ undefined,
62
+ ];
63
+ const navigationLayers = [
64
+ WEBPACK_LAYERS_NAMES.reactServerComponents,
65
+ WEBPACK_LAYERS_NAMES.serverSideRendering,
66
+ ];
67
+ const reactShares = createSharedConfig('react', defaultLayers);
68
+ const reactDomShares = createSharedConfig('react', defaultLayers, {
69
+ request: 'react-dom',
70
+ });
71
+ const jsxRuntimeShares = createSharedConfig('react/', navigationLayers, {
72
+ request: 'react/',
73
+ import: undefined,
74
+ });
75
+ const nextNavigationShares = createSharedConfig('next-navigation', navigationLayers, { request: 'next/navigation' });
76
+ /**
77
+ * @typedef SharedObject
78
+ * @type {object}
79
+ * @property {object} [key] - The key representing the shared object's package name.
80
+ * @property {boolean} key.singleton - Whether the shared object should be a singleton.
81
+ * @property {boolean} key.requiredVersion - Whether a specific version of the shared object is required.
82
+ * @property {boolean} key.eager - Whether the shared object should be eagerly loaded.
83
+ * @property {boolean} key.import - Whether the shared object should be imported or not.
84
+ * @property {string} key.layer - The webpack layer this shared module belongs to.
85
+ * @property {string|string[]} key.issuerLayer - The webpack layer that can import this shared module.
86
+ */
87
+ exports.DEFAULT_SHARE_SCOPE = {
88
+ // ...reactShares,
89
+ // ...reactDomShares,
90
+ // ...nextNavigationShares,
91
+ // ...jsxRuntimeShares,
92
+ 'next/dynamic': {
93
+ requiredVersion: undefined,
94
+ singleton: true,
95
+ import: undefined,
96
+ },
97
+ 'next/head': {
98
+ requiredVersion: undefined,
99
+ singleton: true,
100
+ import: undefined,
101
+ },
102
+ 'next/link': {
103
+ requiredVersion: undefined,
104
+ singleton: true,
105
+ import: undefined,
106
+ },
107
+ 'next/router': {
108
+ requiredVersion: false,
109
+ singleton: true,
110
+ import: undefined,
111
+ },
112
+ 'next/image': {
113
+ requiredVersion: undefined,
114
+ singleton: true,
115
+ import: undefined,
116
+ },
117
+ 'next/script': {
118
+ requiredVersion: undefined,
119
+ singleton: true,
120
+ import: undefined,
121
+ },
122
+ react: {
123
+ singleton: true,
124
+ requiredVersion: false,
125
+ import: false,
126
+ },
127
+ 'react/': {
128
+ singleton: true,
129
+ requiredVersion: false,
130
+ import: false,
131
+ },
132
+ 'react-dom/': {
133
+ singleton: true,
134
+ requiredVersion: false,
135
+ import: false,
136
+ },
137
+ 'react-dom': {
138
+ singleton: true,
139
+ requiredVersion: false,
140
+ import: false,
141
+ },
142
+ 'react/jsx-dev-runtime': {
143
+ singleton: true,
144
+ requiredVersion: false,
145
+ },
146
+ 'react/jsx-runtime': {
147
+ singleton: true,
148
+ requiredVersion: false,
149
+ },
150
+ 'styled-jsx': {
151
+ singleton: true,
152
+ import: undefined,
153
+ version: require('styled-jsx/package.json').version,
154
+ requiredVersion: '^' + require('styled-jsx/package.json').version,
155
+ },
156
+ 'styled-jsx/style': {
157
+ singleton: true,
158
+ import: false,
159
+ version: require('styled-jsx/package.json').version,
160
+ requiredVersion: '^' + require('styled-jsx/package.json').version,
161
+ },
162
+ 'styled-jsx/css': {
163
+ singleton: true,
164
+ import: undefined,
165
+ version: require('styled-jsx/package.json').version,
166
+ requiredVersion: '^' + require('styled-jsx/package.json').version,
167
+ },
168
+ };
169
+ /**
170
+ * Defines a default share scope for the browser environment.
171
+ * This function takes the DEFAULT_SHARE_SCOPE and sets eager to undefined and import to undefined for all entries.
172
+ * For 'react', 'react-dom', 'next/router', and 'next/link', it sets eager to true.
173
+ * The module hoisting system relocates these modules into the right runtime and out of the remote.
174
+ *
175
+ * @type {SharedObject}
176
+ * @returns {SharedObject} - The modified share scope for the browser environment.
177
+ */
178
+ exports.DEFAULT_SHARE_SCOPE_BROWSER = Object.entries(exports.DEFAULT_SHARE_SCOPE).reduce((acc, item) => {
179
+ const [key, value] = item;
180
+ // Set eager and import to undefined for all entries, except for the ones specified above
181
+ acc[key] = { ...value, import: undefined };
182
+ return acc;
183
+ }, {});
184
+ /**
185
+ * Checks if the remote value is an internal or promise delegate module reference.
186
+ *
187
+ * @param {string} value - The remote value to check.
188
+ * @returns {boolean} - True if the value is an internal or promise delegate module reference, false otherwise.
189
+ */
190
+ const isInternalOrPromise = (value) => ['internal ', 'promise '].some((prefix) => value.startsWith(prefix));
191
+ /**
192
+ * Parses the remotes object and checks if they are using a custom promise template or not.
193
+ * If it's a custom promise template, the remote syntax is parsed to get the module name and version number.
194
+ * If the remote value is using the standard remote syntax, a delegated module is created.
195
+ *
196
+ * @param {Record<string, any>} remotes - The remotes object to be parsed.
197
+ * @returns {Record<string, string>} - The parsed remotes object with either the original value,
198
+ * the value for internal or promise delegate module reference, or the created delegated module.
199
+ */
200
+ const parseRemotes = (remotes) => {
201
+ return Object.entries(remotes).reduce((acc, [key, value]) => {
202
+ if (isInternalOrPromise(value)) {
203
+ // If the value is an internal or promise delegate module reference, keep the original value
204
+ return { ...acc, [key]: value };
205
+ }
206
+ return { ...acc, [key]: value };
207
+ }, {});
208
+ };
209
+ exports.parseRemotes = parseRemotes;
210
+ /**
211
+ * Checks if the remote value is an internal delegate module reference.
212
+ * An internal delegate module reference starts with the string 'internal '.
213
+ *
214
+ * @param {string} value - The remote value to check.
215
+ * @returns {boolean} - Returns true if the value is an internal delegate module reference, otherwise returns false.
216
+ */
217
+ const isInternalDelegate = (value) => {
218
+ return value.startsWith('internal ');
219
+ };
220
+ /**
221
+ * Extracts the delegate modules from the provided remotes object.
222
+ * This function iterates over the remotes object and checks if each remote value is an internal delegate module reference.
223
+ * If it is, the function adds it to the returned object.
224
+ *
225
+ * @param {Record<string, any>} remotes - The remotes object containing delegate module references.
226
+ * @returns {Record<string, string>} - An object containing only the delegate modules from the remotes object.
227
+ */
228
+ const getDelegates = (remotes) => Object.entries(remotes).reduce((acc, [key, value]) => isInternalDelegate(value) ? { ...acc, [key]: value } : acc, {});
229
+ exports.getDelegates = getDelegates;
230
+ /**
231
+ * Takes an error object and formats it into a displayable string.
232
+ * If the error object contains a stack trace, it is appended to the error message.
233
+ *
234
+ * @param {Error} error - The error object to be formatted.
235
+ * @returns {string} - The formatted error message string. If a stack trace is present in the error object, it is appended to the error message.
236
+ */
237
+ const formatError = (error) => {
238
+ let { message } = error;
239
+ if (error.stack) {
240
+ message += `\n${error.stack}`;
241
+ }
242
+ return message;
243
+ };
244
+ /**
245
+ * Transforms an array of Error objects into a single string. Each error message is formatted using the 'formatError' function.
246
+ * The resulting error messages are then joined together, separated by newline characters.
247
+ *
248
+ * @param {Error[]} err - An array of Error objects that need to be formatted and combined.
249
+ * @returns {string} - A single string containing all the formatted error messages, separated by newline characters.
250
+ */
251
+ const toDisplayErrors = (err) => {
252
+ return err.map(formatError).join('\n');
253
+ };
254
+ exports.toDisplayErrors = toDisplayErrors;
255
+ //# sourceMappingURL=internal.js.map