@module-federation/nextjs-mf 8.8.55 → 8.8.57

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 (143) hide show
  1. package/dist/LICENSE +21 -0
  2. package/dist/_virtual/_rolldown/runtime.js +29 -0
  3. package/dist/_virtual/_rolldown/runtime.mjs +8 -0
  4. package/dist/client/UrlNode.js +89 -147
  5. package/dist/client/UrlNode.js.map +1 -1
  6. package/dist/client/UrlNode.mjs +91 -0
  7. package/dist/client/UrlNode.mjs.map +1 -0
  8. package/dist/src/federation-noop.d.mts +1 -0
  9. package/dist/src/federation-noop.d.ts +1 -0
  10. package/dist/src/federation-noop.js +17 -0
  11. package/dist/src/federation-noop.js.map +1 -1
  12. package/dist/src/federation-noop.mjs +23 -0
  13. package/dist/src/federation-noop.mjs.map +1 -0
  14. package/dist/src/index.d.mts +2 -0
  15. package/dist/src/index.d.ts +2 -3
  16. package/dist/src/index.js +13 -11
  17. package/dist/src/index.js.map +1 -1
  18. package/dist/src/index.mjs +8 -0
  19. package/dist/src/index.mjs.map +1 -0
  20. package/dist/src/internal.js +140 -243
  21. package/dist/src/internal.js.map +1 -1
  22. package/dist/src/internal.mjs +152 -0
  23. package/dist/src/internal.mjs.map +1 -0
  24. package/dist/src/loaders/fixImageLoader.d.mts +27 -0
  25. package/dist/src/loaders/fixImageLoader.d.ts +8 -3
  26. package/dist/src/loaders/fixImageLoader.js +91 -103
  27. package/dist/src/loaders/fixImageLoader.js.map +1 -1
  28. package/dist/src/loaders/fixImageLoader.mjs +101 -0
  29. package/dist/src/loaders/fixImageLoader.mjs.map +1 -0
  30. package/dist/src/loaders/fixUrlLoader.d.mts +16 -0
  31. package/dist/src/loaders/fixUrlLoader.d.ts +5 -2
  32. package/dist/src/loaders/fixUrlLoader.js +17 -19
  33. package/dist/src/loaders/fixUrlLoader.js.map +1 -1
  34. package/dist/src/loaders/fixUrlLoader.mjs +19 -0
  35. package/dist/src/loaders/fixUrlLoader.mjs.map +1 -0
  36. package/dist/src/loaders/helpers.js +72 -124
  37. package/dist/src/loaders/helpers.js.map +1 -1
  38. package/dist/src/loaders/helpers.mjs +79 -0
  39. package/dist/src/loaders/helpers.mjs.map +1 -0
  40. package/dist/src/loaders/nextPageMapLoader.d.mts +29 -0
  41. package/dist/src/loaders/nextPageMapLoader.d.ts +10 -5
  42. package/dist/src/loaders/nextPageMapLoader.js +126 -144
  43. package/dist/src/loaders/nextPageMapLoader.js.map +1 -1
  44. package/dist/src/loaders/nextPageMapLoader.mjs +143 -0
  45. package/dist/src/loaders/nextPageMapLoader.mjs.map +1 -0
  46. package/dist/src/logger.js +7 -7
  47. package/dist/src/logger.js.map +1 -1
  48. package/dist/src/logger.mjs +8 -0
  49. package/dist/src/logger.mjs.map +1 -0
  50. package/dist/src/plugins/CopyFederationPlugin.js +64 -71
  51. package/dist/src/plugins/CopyFederationPlugin.js.map +1 -1
  52. package/dist/src/plugins/CopyFederationPlugin.mjs +65 -0
  53. package/dist/src/plugins/CopyFederationPlugin.mjs.map +1 -0
  54. package/dist/src/plugins/NextFederationPlugin/apply-client-plugins.js +36 -53
  55. package/dist/src/plugins/NextFederationPlugin/apply-client-plugins.js.map +1 -1
  56. package/dist/src/plugins/NextFederationPlugin/apply-client-plugins.mjs +40 -0
  57. package/dist/src/plugins/NextFederationPlugin/apply-client-plugins.mjs.map +1 -0
  58. package/dist/src/plugins/NextFederationPlugin/apply-server-plugins.js +103 -121
  59. package/dist/src/plugins/NextFederationPlugin/apply-server-plugins.js.map +1 -1
  60. package/dist/src/plugins/NextFederationPlugin/apply-server-plugins.mjs +111 -0
  61. package/dist/src/plugins/NextFederationPlugin/apply-server-plugins.mjs.map +1 -0
  62. package/dist/src/plugins/NextFederationPlugin/index.d.mts +31 -0
  63. package/dist/src/plugins/NextFederationPlugin/index.d.ts +27 -23
  64. package/dist/src/plugins/NextFederationPlugin/index.js +147 -181
  65. package/dist/src/plugins/NextFederationPlugin/index.js.map +1 -1
  66. package/dist/src/plugins/NextFederationPlugin/index.mjs +150 -0
  67. package/dist/src/plugins/NextFederationPlugin/index.mjs.map +1 -0
  68. package/dist/src/plugins/NextFederationPlugin/next-fragments.d.mts +18 -0
  69. package/dist/src/plugins/NextFederationPlugin/next-fragments.d.ts +16 -18
  70. package/dist/src/plugins/NextFederationPlugin/next-fragments.js +62 -92
  71. package/dist/src/plugins/NextFederationPlugin/next-fragments.js.map +1 -1
  72. package/dist/src/plugins/NextFederationPlugin/next-fragments.mjs +68 -0
  73. package/dist/src/plugins/NextFederationPlugin/next-fragments.mjs.map +1 -0
  74. package/dist/src/plugins/NextFederationPlugin/set-options.js +17 -19
  75. package/dist/src/plugins/NextFederationPlugin/set-options.js.map +1 -1
  76. package/dist/src/plugins/NextFederationPlugin/set-options.mjs +19 -0
  77. package/dist/src/plugins/NextFederationPlugin/set-options.mjs.map +1 -0
  78. package/dist/src/plugins/NextFederationPlugin/validate-options.js +30 -38
  79. package/dist/src/plugins/NextFederationPlugin/validate-options.js.map +1 -1
  80. package/dist/src/plugins/NextFederationPlugin/validate-options.mjs +35 -0
  81. package/dist/src/plugins/NextFederationPlugin/validate-options.mjs.map +1 -0
  82. package/dist/src/plugins/container/InvertedContainerPlugin.js +22 -25
  83. package/dist/src/plugins/container/InvertedContainerPlugin.js.map +1 -1
  84. package/dist/src/plugins/container/InvertedContainerPlugin.mjs +23 -0
  85. package/dist/src/plugins/container/InvertedContainerPlugin.mjs.map +1 -0
  86. package/dist/src/plugins/container/InvertedContainerRuntimeModule.js +55 -67
  87. package/dist/src/plugins/container/InvertedContainerRuntimeModule.js.map +1 -1
  88. package/dist/src/plugins/container/InvertedContainerRuntimeModule.mjs +57 -0
  89. package/dist/src/plugins/container/InvertedContainerRuntimeModule.mjs.map +1 -0
  90. package/dist/src/plugins/container/runtimePlugin.d.mts +7 -0
  91. package/dist/src/plugins/container/runtimePlugin.d.ts +6 -2
  92. package/dist/src/plugins/container/runtimePlugin.js +167 -0
  93. package/dist/src/plugins/container/runtimePlugin.js.map +1 -1
  94. package/dist/src/plugins/container/runtimePlugin.mjs +166 -0
  95. package/dist/src/plugins/container/runtimePlugin.mjs.map +1 -0
  96. package/dist/utils/flushedChunks.d.mts +29 -0
  97. package/dist/utils/flushedChunks.d.ts +12 -5
  98. package/dist/utils/flushedChunks.js +32 -72
  99. package/dist/utils/flushedChunks.js.map +1 -1
  100. package/dist/utils/flushedChunks.mjs +35 -0
  101. package/dist/utils/flushedChunks.mjs.map +1 -0
  102. package/dist/utils/index.d.mts +14 -0
  103. package/dist/utils/index.d.ts +8 -14
  104. package/dist/utils/index.js +27 -62
  105. package/dist/utils/index.js.map +1 -1
  106. package/dist/utils/index.mjs +22 -0
  107. package/dist/utils/index.mjs.map +1 -0
  108. package/package.json +29 -9
  109. package/dist/client/UrlNode.d.ts +0 -17
  110. package/dist/node.d.ts +0 -1
  111. package/dist/node.js +0 -18
  112. package/dist/node.js.map +0 -1
  113. package/dist/package.json +0 -80
  114. package/dist/src/federation-noop.cjs +0 -15
  115. package/dist/src/internal.d.ts +0 -50
  116. package/dist/src/loaders/helpers.d.ts +0 -17
  117. package/dist/src/logger.d.ts +0 -2
  118. package/dist/src/plugins/AddRuntimeRequirementToPromiseExternalPlugin.d.ts +0 -5
  119. package/dist/src/plugins/AddRuntimeRequirementToPromiseExternalPlugin.js +0 -19
  120. package/dist/src/plugins/AddRuntimeRequirementToPromiseExternalPlugin.js.map +0 -1
  121. package/dist/src/plugins/CopyFederationPlugin.d.ts +0 -20
  122. package/dist/src/plugins/NextFederationPlugin/apply-client-plugins.d.ts +0 -23
  123. package/dist/src/plugins/NextFederationPlugin/apply-server-plugins.d.ts +0 -36
  124. package/dist/src/plugins/NextFederationPlugin/regex-equal.d.ts +0 -14
  125. package/dist/src/plugins/NextFederationPlugin/regex-equal.js +0 -25
  126. package/dist/src/plugins/NextFederationPlugin/regex-equal.js.map +0 -1
  127. package/dist/src/plugins/NextFederationPlugin/remove-unnecessary-shared-keys.d.ts +0 -8
  128. package/dist/src/plugins/NextFederationPlugin/remove-unnecessary-shared-keys.js +0 -34
  129. package/dist/src/plugins/NextFederationPlugin/remove-unnecessary-shared-keys.js.map +0 -1
  130. package/dist/src/plugins/NextFederationPlugin/set-options.d.ts +0 -16
  131. package/dist/src/plugins/NextFederationPlugin/validate-options.d.ts +0 -25
  132. package/dist/src/plugins/container/InvertedContainerPlugin.d.ts +0 -5
  133. package/dist/src/plugins/container/InvertedContainerRuntimeModule.d.ts +0 -11
  134. package/dist/src/plugins/container/RemoveEagerModulesFromRuntimePlugin.d.ts +0 -39
  135. package/dist/src/plugins/container/RemoveEagerModulesFromRuntimePlugin.js +0 -78
  136. package/dist/src/plugins/container/RemoveEagerModulesFromRuntimePlugin.js.map +0 -1
  137. package/dist/src/plugins/container/runtimePlugin.cjs +0 -219
  138. package/dist/src/plugins/container/types.d.ts +0 -2
  139. package/dist/src/plugins/container/types.js +0 -3
  140. package/dist/src/plugins/container/types.js.map +0 -1
  141. package/dist/src/types.d.ts +0 -28
  142. package/dist/src/types.js +0 -3
  143. package/dist/src/types.js.map +0 -1
package/dist/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.
@@ -0,0 +1,29 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) {
13
+ __defProp(to, key, {
14
+ get: ((k) => from[k]).bind(null, key),
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ }
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
25
+ }) : target, mod));
26
+
27
+ //#endregion
28
+
29
+ exports.__toESM = __toESM;
@@ -0,0 +1,8 @@
1
+ import { createRequire } from "node:module";
2
+
3
+ //#region \0rolldown/runtime.js
4
+ var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
5
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
6
+
7
+ //#endregion
8
+ export { __commonJSMin, __require };
@@ -1,150 +1,92 @@
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 */
1
+
2
+ //#region client/UrlNode.ts
6
3
  /**
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
- }
4
+ * This class provides a logic of sorting dynamic routes in NextJS.
5
+ *
6
+ * It was copied from
7
+ * @see https://github.com/vercel/next.js/blob/canary/packages/next/shared/lib/router/utils/sorted-routes.ts
8
+ */
9
+ var UrlNode = class UrlNode {
10
+ constructor() {
11
+ this.placeholder = true;
12
+ this.children = /* @__PURE__ */ new Map();
13
+ this.slugName = null;
14
+ this.restSlugName = null;
15
+ this.optionalRestSlugName = null;
16
+ }
17
+ insert(urlPath) {
18
+ this._insert(urlPath.split("/").filter(Boolean), [], false);
19
+ }
20
+ smoosh() {
21
+ return this._smoosh();
22
+ }
23
+ _smoosh(prefix = "/") {
24
+ const childrenPaths = [...this.children.keys()].sort();
25
+ if (this.slugName !== null) childrenPaths.splice(childrenPaths.indexOf("[]"), 1);
26
+ if (this.restSlugName !== null) childrenPaths.splice(childrenPaths.indexOf("[...]"), 1);
27
+ if (this.optionalRestSlugName !== null) childrenPaths.splice(childrenPaths.indexOf("[[...]]"), 1);
28
+ const routes = childrenPaths.map((c) => this.children.get(c)._smoosh(`${prefix}${c}/`)).reduce((prev, curr) => [...prev, ...curr], []);
29
+ if (this.slugName !== null) routes.push(...this.children.get("[]")._smoosh(`${prefix}[${this.slugName}]/`));
30
+ if (!this.placeholder) {
31
+ const r = prefix === "/" ? "/" : prefix.slice(0, -1);
32
+ if (this.optionalRestSlugName != null) throw new Error(`You cannot define a route with the same specificity as a optional catch-all route ("${r}" and "${r}[[...${this.optionalRestSlugName}]]").`);
33
+ routes.unshift(r);
34
+ }
35
+ if (this.restSlugName !== null) routes.push(...this.children.get("[...]")._smoosh(`${prefix}[...${this.restSlugName}]/`));
36
+ if (this.optionalRestSlugName !== null) routes.push(...this.children.get("[[...]]")._smoosh(`${prefix}[[...${this.optionalRestSlugName}]]/`));
37
+ return routes;
38
+ }
39
+ _insert(urlPaths, slugNames, isCatchAll) {
40
+ if (urlPaths.length === 0) {
41
+ this.placeholder = false;
42
+ return;
43
+ }
44
+ if (isCatchAll) throw new Error(`Catch-all must be the last part of the URL.`);
45
+ let nextSegment = urlPaths[0];
46
+ if (nextSegment.startsWith("[") && nextSegment.endsWith("]")) {
47
+ let segmentName = nextSegment.slice(1, -1);
48
+ let isOptional = false;
49
+ if (segmentName.startsWith("[") && segmentName.endsWith("]")) {
50
+ segmentName = segmentName.slice(1, -1);
51
+ isOptional = true;
52
+ }
53
+ if (segmentName.startsWith("...")) {
54
+ segmentName = segmentName.substring(3);
55
+ isCatchAll = true;
56
+ }
57
+ if (segmentName.startsWith("[") || segmentName.endsWith("]")) throw new Error(`Segment names may not start or end with extra brackets ('${segmentName}').`);
58
+ if (segmentName.startsWith(".")) throw new Error(`Segment names may not start with erroneous periods ('${segmentName}').`);
59
+ const handleSlug = function handleSlug(previousSlug, nextSlug) {
60
+ if (previousSlug !== null && previousSlug !== nextSlug) throw new Error(`You cannot use different slug names for the same dynamic path ('${previousSlug}' !== '${nextSlug}').`);
61
+ slugNames.forEach((slug) => {
62
+ if (slug === nextSlug) throw new Error(`You cannot have the same slug name "${nextSlug}" repeat within a single dynamic path`);
63
+ if (slug.replace(/\W/g, "") === nextSegment.replace(/\W/g, "")) throw new Error(`You cannot have the slug names "${slug}" and "${nextSlug}" differ only by non-word symbols within a single dynamic path`);
64
+ });
65
+ slugNames.push(nextSlug);
66
+ };
67
+ if (isCatchAll) if (isOptional) {
68
+ if (this.restSlugName != null) throw new Error(`You cannot use both an required and optional catch-all route at the same level ("[...${this.restSlugName}]" and "${urlPaths[0]}" ).`);
69
+ handleSlug(this.optionalRestSlugName, segmentName);
70
+ this.optionalRestSlugName = segmentName;
71
+ nextSegment = "[[...]]";
72
+ } else {
73
+ if (this.optionalRestSlugName != null) throw new Error(`You cannot use both an optional and required catch-all route at the same level ("[[...${this.optionalRestSlugName}]]" and "${urlPaths[0]}").`);
74
+ handleSlug(this.restSlugName, segmentName);
75
+ this.restSlugName = segmentName;
76
+ nextSegment = "[...]";
77
+ }
78
+ else {
79
+ if (isOptional) throw new Error(`Optional route parameters are not yet supported ("${urlPaths[0]}").`);
80
+ handleSlug(this.slugName, segmentName);
81
+ this.slugName = segmentName;
82
+ nextSegment = "[]";
83
+ }
84
+ }
85
+ if (!this.children.has(nextSegment)) this.children.set(nextSegment, new UrlNode());
86
+ this.children.get(nextSegment)._insert(urlPaths.slice(1), slugNames, isCatchAll);
87
+ }
88
+ };
89
+
90
+ //#endregion
149
91
  exports.UrlNode = UrlNode;
150
92
  //# sourceMappingURL=UrlNode.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UrlNode.js","sourceRoot":"","sources":["../../client/UrlNode.ts"],"names":[],"mappings":";;;AAAA,6CAA6C;AAC7C,6DAA6D;AAC7D;;;;;GAKG;AACH,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\n/* eslint-disable @typescript-eslint/no-non-null-assertion */\n/**\n * This class provides a logic of sorting dynamic routes in NextJS.\n *\n * It was copied from\n * @see https://github.com/vercel/next.js/blob/canary/packages/next/shared/lib/router/utils/sorted-routes.ts\n */\nexport class UrlNode {\n placeholder = true;\n children: Map<string, UrlNode> = new Map();\n slugName: string | null = null;\n restSlugName: string | null = null;\n optionalRestSlugName: string | null = null;\n\n insert(urlPath: string): void {\n this._insert(urlPath.split('/').filter(Boolean), [], false);\n }\n\n smoosh(): string[] {\n return this._smoosh();\n }\n\n private _smoosh(prefix = '/'): string[] {\n const childrenPaths = [...this.children.keys()].sort();\n if (this.slugName !== null) {\n childrenPaths.splice(childrenPaths.indexOf('[]'), 1);\n }\n if (this.restSlugName !== null) {\n childrenPaths.splice(childrenPaths.indexOf('[...]'), 1);\n }\n if (this.optionalRestSlugName !== null) {\n childrenPaths.splice(childrenPaths.indexOf('[[...]]'), 1);\n }\n\n const routes = childrenPaths\n .map((c) => this.children.get(c)!._smoosh(`${prefix}${c}/`))\n .reduce((prev, curr) => [...prev, ...curr], []);\n\n if (this.slugName !== null) {\n routes.push(\n ...this.children.get('[]')!._smoosh(`${prefix}[${this.slugName}]/`),\n );\n }\n\n if (!this.placeholder) {\n const r = prefix === '/' ? '/' : prefix.slice(0, -1);\n if (this.optionalRestSlugName != null) {\n throw new Error(\n `You cannot define a route with the same specificity as a optional catch-all route (\"${r}\" and \"${r}[[...${this.optionalRestSlugName}]]\").`,\n );\n }\n\n routes.unshift(r);\n }\n\n if (this.restSlugName !== null) {\n routes.push(\n ...this.children\n .get('[...]')!\n ._smoosh(`${prefix}[...${this.restSlugName}]/`),\n );\n }\n\n if (this.optionalRestSlugName !== null) {\n routes.push(\n ...this.children\n .get('[[...]]')!\n ._smoosh(`${prefix}[[...${this.optionalRestSlugName}]]/`),\n );\n }\n\n return routes;\n }\n\n private _insert(\n urlPaths: string[],\n slugNames: string[],\n isCatchAll: boolean,\n ): void {\n if (urlPaths.length === 0) {\n this.placeholder = false;\n return;\n }\n\n if (isCatchAll) {\n throw new Error(`Catch-all must be the last part of the URL.`);\n }\n\n // The next segment in the urlPaths list\n let nextSegment = urlPaths[0];\n\n // Check if the segment matches `[something]`\n if (nextSegment.startsWith('[') && nextSegment.endsWith(']')) {\n // Strip `[` and `]`, leaving only `something`\n let segmentName = nextSegment.slice(1, -1);\n\n let isOptional = false;\n if (segmentName.startsWith('[') && segmentName.endsWith(']')) {\n // Strip optional `[` and `]`, leaving only `something`\n segmentName = segmentName.slice(1, -1);\n isOptional = true;\n }\n\n if (segmentName.startsWith('...')) {\n // Strip `...`, leaving only `something`\n segmentName = segmentName.substring(3);\n isCatchAll = true;\n }\n\n if (segmentName.startsWith('[') || segmentName.endsWith(']')) {\n throw new Error(\n `Segment names may not start or end with extra brackets ('${segmentName}').`,\n );\n }\n\n if (segmentName.startsWith('.')) {\n throw new Error(\n `Segment names may not start with erroneous periods ('${segmentName}').`,\n );\n }\n\n const handleSlug = function handleSlug(\n previousSlug: string | null,\n nextSlug: string,\n ) {\n if (previousSlug !== null && previousSlug !== nextSlug) {\n throw new Error(\n `You cannot use different slug names for the same dynamic path ('${previousSlug}' !== '${nextSlug}').`,\n );\n }\n\n slugNames.forEach((slug) => {\n if (slug === nextSlug) {\n throw new Error(\n `You cannot have the same slug name \"${nextSlug}\" repeat within a single dynamic path`,\n );\n }\n\n if (slug.replace(/\\W/g, '') === nextSegment.replace(/\\W/g, '')) {\n throw new Error(\n `You cannot have the slug names \"${slug}\" and \"${nextSlug}\" differ only by non-word symbols within a single dynamic path`,\n );\n }\n });\n\n slugNames.push(nextSlug);\n };\n\n if (isCatchAll) {\n if (isOptional) {\n if (this.restSlugName != null) {\n throw new Error(\n `You cannot use both an required and optional catch-all route at the same level (\"[...${this.restSlugName}]\" and \"${urlPaths[0]}\" ).`,\n );\n }\n\n handleSlug(this.optionalRestSlugName, segmentName);\n // slugName is kept as it can only be one particular slugName\n this.optionalRestSlugName = segmentName;\n // nextSegment is overwritten to [[...]] so that it can later be sorted specifically\n nextSegment = '[[...]]';\n } else {\n if (this.optionalRestSlugName != null) {\n throw new Error(\n `You cannot use both an optional and required catch-all route at the same level (\"[[...${this.optionalRestSlugName}]]\" and \"${urlPaths[0]}\").`,\n );\n }\n\n handleSlug(this.restSlugName, segmentName);\n // slugName is kept as it can only be one particular slugName\n this.restSlugName = segmentName;\n // nextSegment is overwritten to [...] so that it can later be sorted specifically\n nextSegment = '[...]';\n }\n } else {\n if (isOptional) {\n throw new Error(\n `Optional route parameters are not yet supported (\"${urlPaths[0]}\").`,\n );\n }\n handleSlug(this.slugName, segmentName);\n // slugName is kept as it can only be one particular slugName\n this.slugName = segmentName;\n // nextSegment is overwritten to [] so that it can later be sorted specifically\n nextSegment = '[]';\n }\n }\n\n // If this UrlNode doesn't have the nextSegment yet we create a new child UrlNode\n if (!this.children.has(nextSegment)) {\n this.children.set(nextSegment, new UrlNode());\n }\n\n this.children\n .get(nextSegment)!\n ._insert(urlPaths.slice(1), slugNames, isCatchAll);\n }\n}\n"],"mappings":";;;;;;;;AAQA,IAAa,UAAb,MAAa,QAAQ;;qBACL;kCACmB,IAAI,KAAK;kBAChB;sBACI;8BACQ;;CAEtC,OAAO,SAAuB;AAC5B,OAAK,QAAQ,QAAQ,MAAM,IAAI,CAAC,OAAO,QAAQ,EAAE,EAAE,EAAE,MAAM;;CAG7D,SAAmB;AACjB,SAAO,KAAK,SAAS;;CAGvB,AAAQ,QAAQ,SAAS,KAAe;EACtC,MAAM,gBAAgB,CAAC,GAAG,KAAK,SAAS,MAAM,CAAC,CAAC,MAAM;AACtD,MAAI,KAAK,aAAa,KACpB,eAAc,OAAO,cAAc,QAAQ,KAAK,EAAE,EAAE;AAEtD,MAAI,KAAK,iBAAiB,KACxB,eAAc,OAAO,cAAc,QAAQ,QAAQ,EAAE,EAAE;AAEzD,MAAI,KAAK,yBAAyB,KAChC,eAAc,OAAO,cAAc,QAAQ,UAAU,EAAE,EAAE;EAG3D,MAAM,SA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WAAW"}
@@ -0,0 +1,91 @@
1
+ //#region client/UrlNode.ts
2
+ /**
3
+ * This class provides a logic of sorting dynamic routes in NextJS.
4
+ *
5
+ * It was copied from
6
+ * @see https://github.com/vercel/next.js/blob/canary/packages/next/shared/lib/router/utils/sorted-routes.ts
7
+ */
8
+ var UrlNode = class UrlNode {
9
+ constructor() {
10
+ this.placeholder = true;
11
+ this.children = /* @__PURE__ */ new Map();
12
+ this.slugName = null;
13
+ this.restSlugName = null;
14
+ this.optionalRestSlugName = null;
15
+ }
16
+ insert(urlPath) {
17
+ this._insert(urlPath.split("/").filter(Boolean), [], false);
18
+ }
19
+ smoosh() {
20
+ return this._smoosh();
21
+ }
22
+ _smoosh(prefix = "/") {
23
+ const childrenPaths = [...this.children.keys()].sort();
24
+ if (this.slugName !== null) childrenPaths.splice(childrenPaths.indexOf("[]"), 1);
25
+ if (this.restSlugName !== null) childrenPaths.splice(childrenPaths.indexOf("[...]"), 1);
26
+ if (this.optionalRestSlugName !== null) childrenPaths.splice(childrenPaths.indexOf("[[...]]"), 1);
27
+ const routes = childrenPaths.map((c) => this.children.get(c)._smoosh(`${prefix}${c}/`)).reduce((prev, curr) => [...prev, ...curr], []);
28
+ if (this.slugName !== null) routes.push(...this.children.get("[]")._smoosh(`${prefix}[${this.slugName}]/`));
29
+ if (!this.placeholder) {
30
+ const r = prefix === "/" ? "/" : prefix.slice(0, -1);
31
+ if (this.optionalRestSlugName != null) throw new Error(`You cannot define a route with the same specificity as a optional catch-all route ("${r}" and "${r}[[...${this.optionalRestSlugName}]]").`);
32
+ routes.unshift(r);
33
+ }
34
+ if (this.restSlugName !== null) routes.push(...this.children.get("[...]")._smoosh(`${prefix}[...${this.restSlugName}]/`));
35
+ if (this.optionalRestSlugName !== null) routes.push(...this.children.get("[[...]]")._smoosh(`${prefix}[[...${this.optionalRestSlugName}]]/`));
36
+ return routes;
37
+ }
38
+ _insert(urlPaths, slugNames, isCatchAll) {
39
+ if (urlPaths.length === 0) {
40
+ this.placeholder = false;
41
+ return;
42
+ }
43
+ if (isCatchAll) throw new Error(`Catch-all must be the last part of the URL.`);
44
+ let nextSegment = urlPaths[0];
45
+ if (nextSegment.startsWith("[") && nextSegment.endsWith("]")) {
46
+ let segmentName = nextSegment.slice(1, -1);
47
+ let isOptional = false;
48
+ if (segmentName.startsWith("[") && segmentName.endsWith("]")) {
49
+ segmentName = segmentName.slice(1, -1);
50
+ isOptional = true;
51
+ }
52
+ if (segmentName.startsWith("...")) {
53
+ segmentName = segmentName.substring(3);
54
+ isCatchAll = true;
55
+ }
56
+ if (segmentName.startsWith("[") || segmentName.endsWith("]")) throw new Error(`Segment names may not start or end with extra brackets ('${segmentName}').`);
57
+ if (segmentName.startsWith(".")) throw new Error(`Segment names may not start with erroneous periods ('${segmentName}').`);
58
+ const handleSlug = function handleSlug(previousSlug, nextSlug) {
59
+ if (previousSlug !== null && previousSlug !== nextSlug) throw new Error(`You cannot use different slug names for the same dynamic path ('${previousSlug}' !== '${nextSlug}').`);
60
+ slugNames.forEach((slug) => {
61
+ if (slug === nextSlug) throw new Error(`You cannot have the same slug name "${nextSlug}" repeat within a single dynamic path`);
62
+ if (slug.replace(/\W/g, "") === nextSegment.replace(/\W/g, "")) throw new Error(`You cannot have the slug names "${slug}" and "${nextSlug}" differ only by non-word symbols within a single dynamic path`);
63
+ });
64
+ slugNames.push(nextSlug);
65
+ };
66
+ if (isCatchAll) if (isOptional) {
67
+ if (this.restSlugName != null) throw new Error(`You cannot use both an required and optional catch-all route at the same level ("[...${this.restSlugName}]" and "${urlPaths[0]}" ).`);
68
+ handleSlug(this.optionalRestSlugName, segmentName);
69
+ this.optionalRestSlugName = segmentName;
70
+ nextSegment = "[[...]]";
71
+ } else {
72
+ if (this.optionalRestSlugName != null) throw new Error(`You cannot use both an optional and required catch-all route at the same level ("[[...${this.optionalRestSlugName}]]" and "${urlPaths[0]}").`);
73
+ handleSlug(this.restSlugName, segmentName);
74
+ this.restSlugName = segmentName;
75
+ nextSegment = "[...]";
76
+ }
77
+ else {
78
+ if (isOptional) throw new Error(`Optional route parameters are not yet supported ("${urlPaths[0]}").`);
79
+ handleSlug(this.slugName, segmentName);
80
+ this.slugName = segmentName;
81
+ nextSegment = "[]";
82
+ }
83
+ }
84
+ if (!this.children.has(nextSegment)) this.children.set(nextSegment, new UrlNode());
85
+ this.children.get(nextSegment)._insert(urlPaths.slice(1), slugNames, isCatchAll);
86
+ }
87
+ };
88
+
89
+ //#endregion
90
+ export { UrlNode };
91
+ //# sourceMappingURL=UrlNode.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UrlNode.mjs","names":[],"sources":["../../client/UrlNode.ts"],"sourcesContent":["// TODO: fix the no-non-null assertion errors\n/* eslint-disable @typescript-eslint/no-non-null-assertion */\n/**\n * This class provides a logic of sorting dynamic routes in NextJS.\n *\n * It was copied from\n * @see https://github.com/vercel/next.js/blob/canary/packages/next/shared/lib/router/utils/sorted-routes.ts\n */\nexport class UrlNode {\n placeholder = true;\n children: Map<string, UrlNode> = new Map();\n slugName: string | null = null;\n restSlugName: string | null = null;\n optionalRestSlugName: string | null = null;\n\n insert(urlPath: string): void {\n this._insert(urlPath.split('/').filter(Boolean), [], false);\n }\n\n smoosh(): string[] {\n return this._smoosh();\n }\n\n private _smoosh(prefix = '/'): string[] {\n const childrenPaths = [...this.children.keys()].sort();\n if (this.slugName !== null) {\n childrenPaths.splice(childrenPaths.indexOf('[]'), 1);\n }\n if (this.restSlugName !== null) {\n childrenPaths.splice(childrenPaths.indexOf('[...]'), 1);\n }\n if (this.optionalRestSlugName !== null) {\n childrenPaths.splice(childrenPaths.indexOf('[[...]]'), 1);\n }\n\n const routes = childrenPaths\n .map((c) => this.children.get(c)!._smoosh(`${prefix}${c}/`))\n .reduce((prev, curr) => [...prev, ...curr], []);\n\n if (this.slugName !== null) {\n routes.push(\n ...this.children.get('[]')!._smoosh(`${prefix}[${this.slugName}]/`),\n );\n }\n\n if (!this.placeholder) {\n const r = prefix === '/' ? '/' : prefix.slice(0, -1);\n if (this.optionalRestSlugName != null) {\n throw new Error(\n `You cannot define a route with the same specificity as a optional catch-all route (\"${r}\" and \"${r}[[...${this.optionalRestSlugName}]]\").`,\n );\n }\n\n routes.unshift(r);\n }\n\n if (this.restSlugName !== null) {\n routes.push(\n ...this.children\n .get('[...]')!\n ._smoosh(`${prefix}[...${this.restSlugName}]/`),\n );\n }\n\n if (this.optionalRestSlugName !== null) {\n routes.push(\n ...this.children\n .get('[[...]]')!\n ._smoosh(`${prefix}[[...${this.optionalRestSlugName}]]/`),\n );\n }\n\n return routes;\n }\n\n private _insert(\n urlPaths: string[],\n slugNames: string[],\n isCatchAll: boolean,\n ): void {\n if (urlPaths.length === 0) {\n this.placeholder = false;\n return;\n }\n\n if (isCatchAll) {\n throw new Error(`Catch-all must be the last part of the URL.`);\n }\n\n // The next segment in the urlPaths list\n let nextSegment = urlPaths[0];\n\n // Check if the segment matches `[something]`\n if (nextSegment.startsWith('[') && nextSegment.endsWith(']')) {\n // Strip `[` and `]`, leaving only `something`\n let segmentName = nextSegment.slice(1, -1);\n\n let isOptional = false;\n if (segmentName.startsWith('[') && segmentName.endsWith(']')) {\n // Strip optional `[` and `]`, leaving only `something`\n segmentName = segmentName.slice(1, -1);\n isOptional = true;\n }\n\n if (segmentName.startsWith('...')) {\n // Strip `...`, leaving only `something`\n segmentName = segmentName.substring(3);\n isCatchAll = true;\n }\n\n if (segmentName.startsWith('[') || segmentName.endsWith(']')) {\n throw new Error(\n `Segment names may not start or end with extra brackets ('${segmentName}').`,\n );\n }\n\n if (segmentName.startsWith('.')) {\n throw new Error(\n `Segment names may not start with erroneous periods ('${segmentName}').`,\n );\n }\n\n const handleSlug = function handleSlug(\n previousSlug: string | null,\n nextSlug: string,\n ) {\n if (previousSlug !== null && previousSlug !== nextSlug) {\n throw new Error(\n `You cannot use different slug names for the same dynamic path ('${previousSlug}' !== '${nextSlug}').`,\n );\n }\n\n slugNames.forEach((slug) => {\n if (slug === nextSlug) {\n throw new Error(\n `You cannot have the same slug name \"${nextSlug}\" repeat within a single dynamic path`,\n );\n }\n\n if (slug.replace(/\\W/g, '') === nextSegment.replace(/\\W/g, '')) {\n throw new Error(\n `You cannot have the slug names \"${slug}\" and \"${nextSlug}\" differ only by non-word symbols within a single dynamic path`,\n );\n }\n });\n\n slugNames.push(nextSlug);\n };\n\n if (isCatchAll) {\n if (isOptional) {\n if (this.restSlugName != null) {\n throw new Error(\n `You cannot use both an required and optional catch-all route at the same level (\"[...${this.restSlugName}]\" and \"${urlPaths[0]}\" ).`,\n );\n }\n\n handleSlug(this.optionalRestSlugName, segmentName);\n // slugName is kept as it can only be one particular slugName\n this.optionalRestSlugName = segmentName;\n // nextSegment is overwritten to [[...]] so that it can later be sorted specifically\n nextSegment = '[[...]]';\n } else {\n if (this.optionalRestSlugName != null) {\n throw new Error(\n `You cannot use both an optional and required catch-all route at the same level (\"[[...${this.optionalRestSlugName}]]\" and \"${urlPaths[0]}\").`,\n );\n }\n\n handleSlug(this.restSlugName, segmentName);\n // slugName is kept as it can only be one particular slugName\n this.restSlugName = segmentName;\n // nextSegment is overwritten to [...] so that it can later be sorted specifically\n nextSegment = '[...]';\n }\n } else {\n if (isOptional) {\n throw new Error(\n `Optional route parameters are not yet supported (\"${urlPaths[0]}\").`,\n );\n }\n handleSlug(this.slugName, segmentName);\n // slugName is kept as it can only be one particular slugName\n this.slugName = segmentName;\n // nextSegment is overwritten to [] so that it can later be sorted specifically\n nextSegment = '[]';\n }\n }\n\n // If this UrlNode doesn't have the nextSegment yet we create a new child UrlNode\n if (!this.children.has(nextSegment)) {\n this.children.set(nextSegment, new UrlNode());\n }\n\n this.children\n .get(nextSegment)!\n ._insert(urlPaths.slice(1), slugNames, isCatchAll);\n }\n}\n"],"mappings":";;;;;;;AAQA,IAAa,UAAb,MAAa,QAAQ;;qBACL;kCACmB,IAAI,KAAK;kBAChB;sBACI;8BACQ;;CAEtC,OAAO,SAAuB;AAC5B,OAAK,QAAQ,QAAQ,MA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BAAwB,KAC/B,OAAM,IAAI,MACR,yFAAyF,KAAK,qBAAqB,WAAW,SAAS,GAAG,KAC3I;AAGH,eAAW,KAAK,cAAc,YAAY;AAE1C,SAAK,eAAe;AAEpB,kBAAc;;QAEX;AACL,QAAI,WACF,OAAM,IAAI,MACR,qDAAqD,SAAS,GAAG,KAClE;AAEH,eAAW,KAAK,UAAU,YAAY;AAEtC,SAAK,WAAW;AAEhB,kBAAc;;;AAKlB,MAAI,CAAC,KAAK,SAAS,IAAI,YAAY,CACjC,MAAK,SAAS,IAAI,aAAa,IAAI,SAAS,CAAC;AAG/C,OAAK,SACF,IAAI,YAAY,CAChB,QAAQ,SAAS,MAAM,EAAE,EAAE,WAAW,WAAW"}
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,17 @@
1
+
2
+ //#region src/federation-noop.ts
3
+ require("next/head");
4
+ require("next/router");
5
+ require("next/link");
6
+ require("next/script");
7
+ require("next/image");
8
+ require("next/dynamic");
9
+ require("next/error");
10
+ require("next/amp");
11
+ require("styled-jsx");
12
+ require("styled-jsx/style");
13
+ require("next/image");
14
+ require("react/jsx-runtime");
15
+
16
+ //#endregion
17
+ //# sourceMappingURL=federation-noop.js.map
@@ -1 +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"}
1
+ {"version":3,"file":"federation-noop.js","names":[],"sources":["../../src/federation-noop.ts"],"sourcesContent":["require('next/head');\nrequire('next/router');\nrequire('next/link');\nrequire('next/script');\nrequire('next/image');\nrequire('next/dynamic');\nrequire('next/error');\nrequire('next/amp');\nrequire('styled-jsx');\nrequire('styled-jsx/style');\nrequire('next/image');\n// require('react/jsx-dev-runtime');\nrequire('react/jsx-runtime');\n"],"mappings":";;AAAA,QAAQ,YAAY;AACpB,QAAQ,cAAc;AACtB,QAAQ,YAAY;AACpB,QAAQ,cAAc;AACtB,QAAQ,aAAa;AACrB,QAAQ,eAAe;AACvB,QAAQ,aAAa;AACrB,QAAQ,WAAW;AACnB,QAAQ,aAAa;AACrB,QAAQ,mBAAmB;AAC3B,QAAQ,aAAa;AAErB,QAAQ,oBAAoB"}
@@ -0,0 +1,23 @@
1
+ import { __commonJSMin, __require } from "../_virtual/_rolldown/runtime.mjs";
2
+
3
+ //#region src/federation-noop.ts
4
+ var require_federation_noop = /* @__PURE__ */ __commonJSMin((() => {
5
+ __require("next/head");
6
+ __require("next/router");
7
+ __require("next/link");
8
+ __require("next/script");
9
+ __require("next/image");
10
+ __require("next/dynamic");
11
+ __require("next/error");
12
+ __require("next/amp");
13
+ __require("styled-jsx");
14
+ __require("styled-jsx/style");
15
+ __require("next/image");
16
+ __require("react/jsx-runtime");
17
+ }));
18
+
19
+ //#endregion
20
+ export default require_federation_noop();
21
+
22
+ export { };
23
+ //# sourceMappingURL=federation-noop.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"federation-noop.mjs","names":[],"sources":["../../src/federation-noop.ts"],"sourcesContent":["require('next/head');\nrequire('next/router');\nrequire('next/link');\nrequire('next/script');\nrequire('next/image');\nrequire('next/dynamic');\nrequire('next/error');\nrequire('next/amp');\nrequire('styled-jsx');\nrequire('styled-jsx/style');\nrequire('next/image');\n// require('react/jsx-dev-runtime');\nrequire('react/jsx-runtime');\n"],"mappings":";;;;AAAA,WAAQ,YAAY;AACpB,WAAQ,cAAc;AACtB,WAAQ,YAAY;AACpB,WAAQ,cAAc;AACtB,WAAQ,aAAa;AACrB,WAAQ,eAAe;AACvB,WAAQ,aAAa;AACrB,WAAQ,WAAW;AACnB,WAAQ,aAAa;AACrB,WAAQ,mBAAmB;AAC3B,WAAQ,aAAa;AAErB,WAAQ,oBAAoB"}
@@ -0,0 +1,2 @@
1
+ import { NextFederationPlugin } from "./plugins/NextFederationPlugin/index.mjs";
2
+ export { NextFederationPlugin, NextFederationPlugin as default };
@@ -1,3 +1,2 @@
1
- import NextFederationPlugin from './plugins/NextFederationPlugin';
2
- export { NextFederationPlugin };
3
- export default NextFederationPlugin;
1
+ import { NextFederationPlugin } from "./plugins/NextFederationPlugin/index.js";
2
+ export { NextFederationPlugin, NextFederationPlugin as default };
package/dist/src/index.js CHANGED
@@ -1,12 +1,14 @@
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;
1
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
+ const require_index = require('./plugins/NextFederationPlugin/index.js');
3
+
4
+ //#region src/index.ts
5
+ var src_default = require_index.default;
6
+ if (typeof module !== "undefined" && typeof module.exports !== "undefined") {
7
+ module.exports = require_index.default;
8
+ module.exports.NextFederationPlugin = require_index.default;
9
+ }
10
+
11
+ //#endregion
12
+ exports.NextFederationPlugin = require_index;
13
+ exports.default = src_default;
12
14
  //# sourceMappingURL=index.js.map
@@ -1 +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"}
1
+ {"version":3,"file":"index.js","names":["NextFederationPlugin"],"sources":["../../src/index.ts"],"sourcesContent":["import NextFederationPlugin from './plugins/NextFederationPlugin';\n\nexport { NextFederationPlugin };\nexport default NextFederationPlugin;\n\nif (\n process.env.IS_ESM_BUILD !== 'true' &&\n typeof module !== 'undefined' &&\n typeof module.exports !== 'undefined'\n) {\n module.exports = NextFederationPlugin;\n module.exports.NextFederationPlugin = NextFederationPlugin;\n}\n"],"mappings":";;;;AAGA,kBAAeA;AAEf,IAEE,OAAO,WAAW,eAClB,OAAO,OAAO,YAAY,aAC1B;AACA,QAAO,UAAUA;AACjB,QAAO,QAAQ,uBAAuBA"}
@@ -0,0 +1,8 @@
1
+ import NextFederationPlugin from "./plugins/NextFederationPlugin/index.mjs";
2
+
3
+ //#region src/index.ts
4
+ var src_default = NextFederationPlugin;
5
+
6
+ //#endregion
7
+ export { NextFederationPlugin, src_default as default };
8
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["import NextFederationPlugin from './plugins/NextFederationPlugin';\n\nexport { NextFederationPlugin };\nexport default NextFederationPlugin;\n\nif (\n process.env.IS_ESM_BUILD !== 'true' &&\n typeof module !== 'undefined' &&\n typeof module.exports !== 'undefined'\n) {\n module.exports = NextFederationPlugin;\n module.exports.NextFederationPlugin = NextFederationPlugin;\n}\n"],"mappings":";;;AAGA,kBAAe"}