@equinor/fusion-framework-vite-plugin-spa 1.1.4 → 1.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,47 @@
1
1
  # @equinor/fusion-framework-vite-plugin-spa
2
2
 
3
+ ## 1.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#3579](https://github.com/equinor/fusion-framework/pull/3579) [`b6a64d9`](https://github.com/equinor/fusion-framework/commit/b6a64d94bad7248c06b3aa7d65d7d698052437c7) Thanks [@Noggling](https://github.com/Noggling)! - Add peer dependencies to SPA Vite plugin
8
+
9
+ Added peer dependencies to ensure proper dependency resolution for the SPA Vite plugin. This change declares the Fusion Framework modules that the plugin expects to be available in the consuming application:
10
+
11
+ - `@equinor/fusion-framework-module`
12
+ - `@equinor/fusion-framework-module-http`
13
+ - `@equinor/fusion-framework-module-msal`
14
+ - `@equinor/fusion-framework-module-service-discovery`
15
+ - `@equinor/fusion-framework-module-telemetry`
16
+
17
+ This ensures that consumers are aware of the required dependencies and helps prevent runtime errors due to missing modules.
18
+
19
+ ## 1.2.0
20
+
21
+ ### Minor Changes
22
+
23
+ - [#3547](https://github.com/equinor/fusion-framework/pull/3547) [`99a3c26`](https://github.com/equinor/fusion-framework/commit/99a3c26275c2089c3708124f5819ce383d8dc3dc) Thanks [@odinr](https://github.com/odinr)! - Enhanced SPA plugin with portal proxy support for testing apps in real portal environments ([Issue #3546](https://github.com/equinor/fusion-framework/issues/3546)).
24
+
25
+ - Added `proxy` option to portal configuration to enable `/portal-proxy` routing
26
+ - Added `FUSION_SPA_PORTAL_PROXY` environment variable support
27
+ - Updated TypeScript types to include portal proxy configuration
28
+ - Updated documentation with portal proxy usage examples
29
+
30
+ This feature enables developers to load real portal implementations instead of the default developer portal, supporting configuration of portal ID and version tags for targeted testing scenarios.
31
+
32
+ **Migration:**
33
+ No migration required - the `proxy` option defaults to `false`, maintaining existing behavior.
34
+
35
+ **Example usage:**
36
+
37
+ ```ts
38
+ portal: {
39
+ id: 'my-portal',
40
+ tag: 'latest',
41
+ proxy: true, // Routes through /portal-proxy/
42
+ }
43
+ ```
44
+
3
45
  ## 1.1.4
4
46
 
5
47
  ### Patch Changes
package/README.md CHANGED
@@ -116,6 +116,7 @@ fusionSpaPlugin({
116
116
  // 2. An ID from the Fusion Portal Service
117
117
  // 3. Any other configured portal ID
118
118
  tag: 'latest', // (Optional) Version tag (defaults to 'latest')
119
+ proxy: false, // (Optional) Whether to proxy portal requests through /portal-proxy (defaults to false)
119
120
  },
120
121
 
121
122
  // Service Discovery configuration
@@ -145,6 +146,36 @@ fusionSpaPlugin({
145
146
  })
146
147
  });
147
148
  ```
149
+
150
+ ### Portal Proxy
151
+
152
+ The portal proxy feature allows you to route portal entry point requests through a `/portal-proxy` path prefix. When enabled, the plugin will attempt to load portal code from URLs prefixed with `/portal-proxy/`, which can be useful when working with proxy servers or development environments that need to intercept and route portal requests.
153
+
154
+ **Behavior:**
155
+
156
+ - `proxy: true` → Portal loads from `/portal-proxy/{assetPath}/{templateEntry}` (allows proxy interception)
157
+ - `proxy: false` → Portal loads from `{assetPath}/{templateEntry}` (direct loading)
158
+
159
+ **Configuration Options:**
160
+
161
+ - `proxy`: When set to `true`, portal entry points will be prefixed with `/portal-proxy`
162
+
163
+ **When to Use Portal Proxy:**
164
+
165
+ - Development environments where portal assets need to be served through a proxy
166
+ - Deployment scenarios requiring portal routing through specific paths
167
+ - When working with the API Service Plugin for advanced portal loading
168
+
169
+ **Example:**
170
+
171
+ ```ts
172
+ portal: {
173
+ id: 'my-portal',
174
+ tag: 'latest',
175
+ proxy: true, // Portal will be loaded from /portal-proxy/{assetPath}/{templateEntry}
176
+ }
177
+ ```
178
+
148
179
  See [@equinor/fusion-framework-vite-plugin-api-service](https://github.com/equinor/fusion-framework/tree/main/packages/vite-plugins/api-service) for advanced API proxying.
149
180
 
150
181
  ### Service Discovery
@@ -330,6 +361,8 @@ import.meta.env.FUSION_SPA_SERVICE_WORKER_RESOURCES
330
361
  # Application basics
331
362
  FUSION_SPA_TITLE=My App
332
363
  FUSION_SPA_PORTAL_ID=my-portal # Can be a package name, Fusion Portal Service ID, or any configured portal ID
364
+ FUSION_SPA_PORTAL_TAG=latest # (Optional) Version tag (defaults to 'latest')
365
+ FUSION_SPA_PORTAL_PROXY=false # (Optional) Whether to proxy portal requests through /portal-proxy (defaults to false)
333
366
 
334
367
  # Service Discovery configuration
335
368
  FUSION_SPA_SERVICE_DISCOVERY_URL=https://my-server.com/service-discovery
@@ -84,6 +84,7 @@ enableTelemetry(configurator, {
84
84
  // fetch the portal manifest - this is used to load the portal template
85
85
  const portalId = import.meta.env.FUSION_SPA_PORTAL_ID;
86
86
  const portalTag = import.meta.env.FUSION_SPA_PORTAL_TAG ?? 'latest';
87
+ const portalProxy = import.meta.env.FUSION_SPA_PORTAL_PROXY ?? false;
87
88
  const portal_manifest = await measurement
88
89
  .clone()
89
90
  .resolve(portalClient.json(`/portals/${portalId}@${portalTag}`), {
@@ -115,7 +116,11 @@ enableTelemetry(configurator, {
115
116
  const el = document.createElement('div');
116
117
  document.body.innerHTML = '';
117
118
  document.body.appendChild(el);
118
- const portalEntryPoint = [portal_manifest.build.assetPath, portal_manifest.build.templateEntry]
119
+ const portalEntryPoint = [
120
+ portalProxy ? '/portal-proxy' : '',
121
+ portal_manifest.build.assetPath,
122
+ portal_manifest.build.templateEntry,
123
+ ]
119
124
  .filter(Boolean)
120
125
  .join('/');
121
126
  // @todo: should test if the entrypoint is external or internal
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../../src/html/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvE,OAAO,EAAE,mBAAmB,EAAmB,MAAM,uCAAuC,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAmB,MAAM,uCAAuC,CAAC;AACpF,OAAO,EACL,s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OAAO,CAAC;SACf,IAAI,CAAC,GAAG,CAAC,CAAC;IAEb,+DAA+D;IAC/D,gCAAgC;IAChC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,WAAW;SACjC,KAAK,EAAE;SACP,OAAO,CACN,iBAAiB,CAAoD,gBAAgB,CAAC,EACtF;QACE,IAAI,EAAE;YACJ,IAAI,EAAE,iCAAiC;YACvC,KAAK,EAAE,cAAc,CAAC,KAAK;YAC3B,UAAU,EAAE;gBACV,QAAQ;gBACR,SAAS;gBACT,UAAU,EAAE,gBAAgB;aAC7B;SACF;KACF,CACF,CAAC;IAEJ,uEAAuE;IACvE,MAAM,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC,CAAC;AACxE,CAAC,CAAC,EAAE,CAAC"}
@@ -1,3 +1,3 @@
1
1
  // Generated by genversion.
2
- export const version = '1.1.4';
2
+ export const version = '1.2.1';
3
3
  //# sourceMappingURL=version.js.map
@@ -19962,7 +19962,7 @@ const configureHttpClient = (name, args) => ({
19962
19962
  var MsalModuleVersion;
19963
19963
  (function (MsalModuleVersion) {
19964
19964
  MsalModuleVersion["V2"] = "v2";
19965
- MsalModuleVersion["Latest"] = "5.0.1";
19965
+ MsalModuleVersion["Latest"] = "5.1.0";
19966
19966
  })(MsalModuleVersion || (MsalModuleVersion = {}));
19967
19967
 
19968
19968
  const VersionSchema = z.string().transform((x) => String(semver.coerce(x)));
@@ -38198,84 +38198,6 @@ class ConsoleLogger extends Logger {
38198
38198
  };
38199
38199
  }
38200
38200
 
38201
- var VersionMessageType;
38202
- (function (VersionMessageType) {
38203
- VersionMessageType["MajorIncompatibility"] = "major-incompatibility";
38204
- VersionMessageType["MinorMismatch"] = "minor-mismatch";
38205
- VersionMessageType["PatchDifference"] = "patch-difference";
38206
- VersionMessageType["InvalidVersion"] = "invalid-version";
38207
- VersionMessageType["InvalidLatestVersion"] = "invalid-latest-version";
38208
- VersionMessageType["IncompatibleVersion"] = "incompatible-version";
38209
- })(VersionMessageType || (VersionMessageType = {}));
38210
-
38211
- /**
38212
- * Creates a human-readable version message based on the version message type.
38213
- *
38214
- * This function generates descriptive error messages for different version compatibility
38215
- * scenarios, helping developers understand version-related issues.
38216
- *
38217
- * @param type - The type of version message to create
38218
- * @param requestedVersion - The version that was requested by the user
38219
- * @param latestVersion - The latest available version in the system
38220
- * @returns A formatted, human-readable version message string
38221
- *
38222
- * @example
38223
- * ```typescript
38224
- * const message = createVersionMessage(
38225
- * VersionMessageType.MajorIncompatibility,
38226
- * '3.0.0',
38227
- * '2.1.0'
38228
- * );
38229
- * // Returns: "Requested major version 3.0.0 is greater than the latest major version 2.1.0"
38230
- * ```
38231
- *
38232
- * @example
38233
- * ```typescript
38234
- * const message = createVersionMessage(
38235
- * VersionMessageType.MinorMismatch,
38236
- * '2.1.0',
38237
- * '2.2.0'
38238
- * );
38239
- * // Returns: "Minor version mismatch, requested 2.1.0, latest 2.2.0"
38240
- * ```
38241
- */
38242
- const createVersionMessage = (type, requestedVersion, latestVersion) => {
38243
- // Convert versions to strings for consistent formatting
38244
- const requestedVersionString = String(requestedVersion);
38245
- const latestVersionString = String(latestVersion);
38246
- switch (type) {
38247
- case VersionMessageType.MajorIncompatibility:
38248
- return `Requested major version ${requestedVersionString} is greater than the latest major version ${latestVersionString}`;
38249
- case VersionMessageType.InvalidVersion:
38250
- return `Invalid version ${requestedVersionString}`;
38251
- case VersionMessageType.InvalidLatestVersion:
38252
- return `Failed to parse latest version "${latestVersionString}" - this indicates the version.ts file was not generated correctly. Check for import errors in the build process.`;
38253
- case VersionMessageType.MinorMismatch:
38254
- return `Minor version mismatch, requested ${requestedVersionString}, latest ${latestVersionString}`;
38255
- case VersionMessageType.PatchDifference:
38256
- return `Patch version difference, requested ${requestedVersionString}, latest ${latestVersionString}`;
38257
- case VersionMessageType.IncompatibleVersion:
38258
- return `Incompatible version, requested ${requestedVersionString}, latest ${latestVersionString}`;
38259
- default:
38260
- return createVersionMessage(VersionMessageType.IncompatibleVersion, requestedVersion, latestVersion);
38261
- }
38262
- };
38263
-
38264
- /**
38265
- * Creates a VersionError instance with a formatted message.
38266
- *
38267
- * This is a helper function that creates a VersionError with a human-readable
38268
- * message based on the error type and version information.
38269
- *
38270
- * @param type - The type of version error
38271
- * @param requestedVersion - The version that was requested
38272
- * @param latestVersion - The latest available version
38273
- * @param options - Additional error options including the error type
38274
- * @returns A new VersionError instance with formatted message
38275
- */
38276
- const createVersionError = (type, requestedVersion, latestVersion, options) => {
38277
- return new VersionError(createVersionMessage(type, requestedVersion, latestVersion), requestedVersion, latestVersion, { ...options, type });
38278
- };
38279
38201
  /**
38280
38202
  * Error class for version-related issues in the MSAL module.
38281
38203
  *
@@ -38311,14 +38233,8 @@ class VersionError extends Error {
38311
38233
  requestedVersion;
38312
38234
  /** The latest available version in the system */
38313
38235
  latestVersion;
38314
- /** The specific type of version error that occurred */
38315
- type;
38316
38236
  /** The error name for instanceof checks */
38317
38237
  static Name = 'VersionError';
38318
- /** Reference to the VersionMessageType enum for convenience */
38319
- static Type = VersionMessageType;
38320
- /** Factory method for creating VersionError instances with formatted messages */
38321
- static create = createVersionError;
38322
38238
  /**
38323
38239
  * Creates a new VersionError instance.
38324
38240
  *
@@ -38333,7 +38249,6 @@ class VersionError extends Error {
38333
38249
  // Store versions as strings
38334
38250
  this.requestedVersion = String(requestedVersion);
38335
38251
  this.latestVersion = String(latestVersion);
38336
- this.type = options?.type;
38337
38252
  }
38338
38253
  }
38339
38254
 
@@ -38382,35 +38297,41 @@ function resolveVersion(version) {
38382
38297
  // Parse the requested version, defaulting to latest if not provided
38383
38298
  const versionString = version || MsalModuleVersion.Latest;
38384
38299
  // Parse versions using coerce for backward compatibility
38385
- const wantedVersion = semver.coerce(versionString);
38386
38300
  const latestVersion = semver.coerce(MsalModuleVersion.Latest);
38387
- // Validate that the requested version is a valid semver
38388
- if (!wantedVersion) {
38389
- throw VersionError.create(VersionError.Type.InvalidVersion, versionString, MsalModuleVersion.Latest);
38390
- }
38391
38301
  // This should never happen! Indicates version.ts was not generated correctly
38392
38302
  // This is a critical build-time issue that needs immediate attention
38393
38303
  if (!latestVersion) {
38394
- throw VersionError.create(VersionError.Type.InvalidLatestVersion, versionString, MsalModuleVersion.Latest);
38304
+ throw new VersionError(`Failed to parse latest version "${MsalModuleVersion.Latest}" - this indicates the version.ts file was not generated correctly. Check for import errors in the build process.`, versionString, MsalModuleVersion.Latest);
38395
38305
  }
38396
- // Major version incompatibility check - this is a hard error
38397
- // Users cannot request a major version that doesn't exist yet
38398
- if (wantedVersion.major > latestVersion.major) {
38399
- throw VersionError.create(VersionError.Type.MajorIncompatibility, String(wantedVersion), String(latestVersion));
38306
+ let wantedVersion = semver.coerce(versionString);
38307
+ // Validate that the requested version is a valid semver
38308
+ if (!wantedVersion) {
38309
+ const missingVersionWarning = new VersionError(`Failed to parse requested version "${versionString}"`, versionString, MsalModuleVersion.Latest);
38310
+ warnings.push(missingVersionWarning.message);
38311
+ wantedVersion = latestVersion;
38312
+ }
38313
+ if (wantedVersion.major < latestVersion.major) {
38314
+ const majorBehindVersionWarning = new VersionError(`Requested major version ${wantedVersion.major} is behind the latest major version ${latestVersion.major}`, wantedVersion, latestVersion);
38315
+ warnings.push(majorBehindVersionWarning.message);
38400
38316
  }
38401
38317
  // Minor version mismatch - add warning but don't throw
38402
38318
  // This helps developers stay aware of version differences without breaking functionality
38403
38319
  if (wantedVersion.major === latestVersion.major && wantedVersion.minor !== latestVersion.minor) {
38404
- const minorMismatchWarning = VersionError.create(VersionError.Type.MinorMismatch, String(wantedVersion), String(latestVersion));
38320
+ const minorMismatchWarning = new VersionError(`Requested minor version ${wantedVersion.minor} is different from the latest minor version ${latestVersion.minor}`, wantedVersion, latestVersion);
38405
38321
  warnings.push(minorMismatchWarning.message);
38406
38322
  }
38407
38323
  // Find the corresponding enum version for the requested major version
38408
38324
  // This is used for module configuration and feature detection
38409
- const enumVersion = Object.values(MsalModuleVersion).find((x) => semver.coerce(x)?.major === wantedVersion.major);
38410
- // If no matching enum version is found, this indicates a major version
38411
- // that doesn't have a corresponding enum value defined
38325
+ let enumVersion = Object.values(MsalModuleVersion).find((x) => semver.coerce(x)?.major === wantedVersion.major);
38326
+ // If no matching enum version is found, fall back to the latest available
38327
+ // This allows forward compatibility with future versions
38412
38328
  if (!enumVersion) {
38413
- throw VersionError.create(VersionError.Type.MajorIncompatibility, String(wantedVersion), String(latestVersion));
38329
+ enumVersion = MsalModuleVersion.Latest;
38330
+ // Only warn if this is a future version (higher than latest)
38331
+ if (wantedVersion.major > latestVersion.major) {
38332
+ const fallbackWarning = new VersionError(`Requested major version ${wantedVersion.major} is greater than the latest major version ${latestVersion.major}. Falling back to latest version.`, wantedVersion, latestVersion);
38333
+ warnings.push(fallbackWarning.message);
38334
+ }
38414
38335
  }
38415
38336
  // Return comprehensive version resolution result
38416
38337
  return {
@@ -38429,12 +38350,8 @@ class AuthProvider {
38429
38350
  get version() {
38430
38351
  return new SemanticVersion(MsalModuleVersion.Latest);
38431
38352
  }
38432
- /** @deprecated */
38433
- get defaultClient() {
38434
- return this.getClient();
38435
- }
38436
38353
  get defaultAccount() {
38437
- return this.defaultClient.account;
38354
+ return this.client.account;
38438
38355
  }
38439
38356
  /** @deprecated */
38440
38357
  get defaultConfig() {
@@ -38444,8 +38361,7 @@ class AuthProvider {
38444
38361
  this._config = _config;
38445
38362
  this.#client = this.createClient();
38446
38363
  }
38447
- /** @deprecated */
38448
- getClient() {
38364
+ get client() {
38449
38365
  return this.#client;
38450
38366
  }
38451
38367
  /** @deprecated */
@@ -38458,10 +38374,9 @@ class AuthProvider {
38458
38374
  async handleRedirect() {
38459
38375
  const { redirectUri } = this.defaultConfig || {};
38460
38376
  if (window.location.pathname === redirectUri) {
38461
- const client = this.defaultClient;
38462
- const logger = client.getLogger();
38463
- const { requestOrigin } = client;
38464
- await client.handleRedirectPromise();
38377
+ const logger = this.client.getLogger();
38378
+ const { requestOrigin } = this.client;
38379
+ await this.client.handleRedirectPromise();
38465
38380
  if (requestOrigin === redirectUri) {
38466
38381
  logger.warning(`detected callback loop from url ${redirectUri}, redirecting to root`);
38467
38382
  window.location.replace('/');
@@ -38473,7 +38388,7 @@ class AuthProvider {
38473
38388
  return null;
38474
38389
  }
38475
38390
  acquireToken(req) {
38476
- return this.defaultClient.acquireToken(req);
38391
+ return this.client.acquireToken(req);
38477
38392
  }
38478
38393
  async acquireAccessToken(req) {
38479
38394
  const token = await this.acquireToken(req);
@@ -38481,14 +38396,14 @@ class AuthProvider {
38481
38396
  }
38482
38397
  async login(options) {
38483
38398
  // skip login if already logged in and has valid claims
38484
- if (options?.onlyIfRequired && this.defaultClient.hasValidClaims) {
38399
+ if (options?.onlyIfRequired && this.client.hasValidClaims) {
38485
38400
  return;
38486
38401
  }
38487
- await this.defaultClient.login();
38402
+ await this.client.login();
38488
38403
  }
38489
38404
  async logout(options) {
38490
38405
  // TODO - might have an option for popup or redirect
38491
- await this.defaultClient.logoutRedirect({
38406
+ await this.client.logoutRedirect({
38492
38407
  postLogoutRedirectUri: options?.redirectUri,
38493
38408
  account: this.defaultAccount,
38494
38409
  });
@@ -38510,6 +38425,12 @@ class AuthProvider {
38510
38425
  switch (prop) {
38511
38426
  case 'version':
38512
38427
  return target.version;
38428
+ case 'client':
38429
+ return target.client;
38430
+ // @ts-expect-error - this is deprecated since version 5.0.1
38431
+ case 'defaultClient':
38432
+ console.warn('defaultClient is deprecated, use client instead');
38433
+ return target.client;
38513
38434
  case 'defaultAccount':
38514
38435
  return target.defaultAccount;
38515
38436
  case 'defaultConfig':
@@ -45382,7 +45303,7 @@ async function registerServiceWorker(framework) {
45382
45303
  }
45383
45304
 
45384
45305
  // Generated by genversion.
45385
- const version = '1.1.4';
45306
+ const version = '1.2.1';
45386
45307
 
45387
45308
  // Allow dynamic import without vite
45388
45309
  const importWithoutVite = (path) => import(/* @vite-ignore */ path);
@@ -45462,6 +45383,7 @@ enableTelemetry(configurator, {
45462
45383
  // fetch the portal manifest - this is used to load the portal template
45463
45384
  const portalId = import.meta.env.FUSION_SPA_PORTAL_ID;
45464
45385
  const portalTag = import.meta.env.FUSION_SPA_PORTAL_TAG ?? 'latest';
45386
+ const portalProxy = import.meta.env.FUSION_SPA_PORTAL_PROXY ?? false;
45465
45387
  const portal_manifest = await measurement
45466
45388
  .clone()
45467
45389
  .resolve(portalClient.json(`/portals/${portalId}@${portalTag}`), {
@@ -45493,7 +45415,11 @@ enableTelemetry(configurator, {
45493
45415
  const el = document.createElement('div');
45494
45416
  document.body.innerHTML = '';
45495
45417
  document.body.appendChild(el);
45496
- const portalEntryPoint = [portal_manifest.build.assetPath, portal_manifest.build.templateEntry]
45418
+ const portalEntryPoint = [
45419
+ portalProxy ? '/portal-proxy' : '',
45420
+ portal_manifest.build.assetPath,
45421
+ portal_manifest.build.templateEntry,
45422
+ ]
45497
45423
  .filter(Boolean)
45498
45424
  .join('/');
45499
45425
  // @todo: should test if the entrypoint is external or internal