@vercel/microfrontends 0.12.0 → 0.12.1

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/dist/bin/cli.cjs CHANGED
@@ -29,7 +29,7 @@ var import_commander = require("commander");
29
29
  // package.json
30
30
  var package_default = {
31
31
  name: "@vercel/microfrontends",
32
- version: "0.12.0",
32
+ version: "0.12.1",
33
33
  private: false,
34
34
  description: "Defines configuration and utilities for micro-frontend development",
35
35
  repository: {
@@ -123,28 +123,69 @@ var package_default = {
123
123
  },
124
124
  typesVersions: {
125
125
  "*": {
126
- validation: ["./dist/validation.d.ts"],
127
- config: ["./dist/config.d.ts"],
128
- "config/client": ["./dist/config/client.d.ts"],
129
- "config/edge": ["./dist/config/edge.d.ts"],
130
- overrides: ["./dist/overrides.d.ts"],
131
- "next/config": ["./dist/next/config.d.ts"],
132
- "next/middleware": ["./dist/next/middleware.d.ts"],
133
- "next/endpoints": ["./dist/next/endpoints.d.ts"],
134
- "next/testing": ["./dist/next/testing.d.ts"],
135
- "v2/config": ["./dist/v2/config.d.ts"],
136
- "v2/microfrontends": ["./dist/v2/microfrontends.d.ts"],
137
- "v2/overrides": ["./dist/v2/overrides.d.ts"],
138
- "v2/microfrontends/server": ["./dist/v2/microfrontends/server.d.ts"],
139
- "v2/schema": ["./dist/v2/schema.d.ts"],
140
- "v2/next/config": ["./dist/v2/next/config.d.ts"],
141
- "v2/next/middleware": ["./dist/v2/next/middleware.d.ts"],
142
- "v2/next/endpoints": ["./dist/v2/next/endpoints.d.ts"],
143
- "next/client": ["./dist/next/client.d.ts"],
144
- "v2/next/client": ["./dist/v2/next/client.d.ts"]
126
+ validation: [
127
+ "./dist/validation.d.ts"
128
+ ],
129
+ config: [
130
+ "./dist/config.d.ts"
131
+ ],
132
+ "config/client": [
133
+ "./dist/config/client.d.ts"
134
+ ],
135
+ "config/edge": [
136
+ "./dist/config/edge.d.ts"
137
+ ],
138
+ overrides: [
139
+ "./dist/overrides.d.ts"
140
+ ],
141
+ "next/config": [
142
+ "./dist/next/config.d.ts"
143
+ ],
144
+ "next/middleware": [
145
+ "./dist/next/middleware.d.ts"
146
+ ],
147
+ "next/endpoints": [
148
+ "./dist/next/endpoints.d.ts"
149
+ ],
150
+ "next/testing": [
151
+ "./dist/next/testing.d.ts"
152
+ ],
153
+ "v2/config": [
154
+ "./dist/v2/config.d.ts"
155
+ ],
156
+ "v2/microfrontends": [
157
+ "./dist/v2/microfrontends.d.ts"
158
+ ],
159
+ "v2/overrides": [
160
+ "./dist/v2/overrides.d.ts"
161
+ ],
162
+ "v2/microfrontends/server": [
163
+ "./dist/v2/microfrontends/server.d.ts"
164
+ ],
165
+ "v2/schema": [
166
+ "./dist/v2/schema.d.ts"
167
+ ],
168
+ "v2/next/config": [
169
+ "./dist/v2/next/config.d.ts"
170
+ ],
171
+ "v2/next/middleware": [
172
+ "./dist/v2/next/middleware.d.ts"
173
+ ],
174
+ "v2/next/endpoints": [
175
+ "./dist/v2/next/endpoints.d.ts"
176
+ ],
177
+ "next/client": [
178
+ "./dist/next/client.d.ts"
179
+ ],
180
+ "v2/next/client": [
181
+ "./dist/v2/next/client.d.ts"
182
+ ]
145
183
  }
146
184
  },
147
- files: ["dist", "schema"],
185
+ files: [
186
+ "dist",
187
+ "schema"
188
+ ],
148
189
  scripts: {
149
190
  build: "tsup",
150
191
  postbuild: "pnpm generate:exports",
@@ -1718,6 +1759,9 @@ var DefaultApplication = class extends Application2 {
1718
1759
  this.default = true;
1719
1760
  this.production = new Host2(app.production);
1720
1761
  }
1762
+ getAssetPrefix() {
1763
+ return "";
1764
+ }
1721
1765
  };
1722
1766
  var ChildApplication = class extends Application2 {
1723
1767
  constructor(name, {
@@ -2841,13 +2885,14 @@ var LocalProxy = class {
2841
2885
  proxyPort
2842
2886
  }) {
2843
2887
  let configV2;
2888
+ let configV2Err;
2844
2889
  try {
2845
2890
  configV2 = MicrofrontendsServer.fromMainConfigFile({
2846
2891
  filePath
2847
2892
  });
2848
2893
  } catch (error) {
2849
2894
  if ((0, import_types2.isNativeError)(error)) {
2850
- mfeDebug(`unable to parse v2 version: ${error.toString()}`);
2895
+ configV2Err = error;
2851
2896
  }
2852
2897
  }
2853
2898
  if (configV2) {
@@ -2856,8 +2901,15 @@ var LocalProxy = class {
2856
2901
  }
2857
2902
  throw new Error("Got child config after parsing main config");
2858
2903
  }
2859
- const configV1 = MicrofrontendConfig.fromFile({ filePath });
2860
- return new LocalProxy(configV1, { localApps, proxyPort });
2904
+ try {
2905
+ const configV1 = MicrofrontendConfig.fromFile({ filePath });
2906
+ return new LocalProxy(configV1, { localApps, proxyPort });
2907
+ } catch (error) {
2908
+ if (configV2Err) {
2909
+ throw configV2Err;
2910
+ }
2911
+ throw error;
2912
+ }
2861
2913
  }
2862
2914
  getDefaultHost(config) {
2863
2915
  let defaultApp;
@@ -86,6 +86,7 @@ declare class DefaultApplication extends Application {
86
86
  app: DefaultApplication$1;
87
87
  overrides?: ApplicationOverrideConfig;
88
88
  });
89
+ getAssetPrefix(): string;
89
90
  }
90
91
  declare class ChildApplication extends Application {
91
92
  readonly default = false;
@@ -1367,9 +1367,9 @@ ${line}
1367
1367
  `);
1368
1368
  }
1369
1369
  }
1370
- function getDomainForCurrentEnvironment(zone) {
1370
+ function getDomainForCurrentEnvironment(zone, opts = {}) {
1371
1371
  var _a;
1372
- if ((_a = zone.overrides) == null ? void 0 : _a.environment) {
1372
+ if (!opts.ignoreOverride && ((_a = zone.overrides) == null ? void 0 : _a.environment)) {
1373
1373
  return zone.overrides.environment.toString();
1374
1374
  }
1375
1375
  const zoneName = zone.name;