@equinor/fusion-framework-vite-plugin-spa 1.1.4 → 1.2.0

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.
@@ -15,5 +15,5 @@
15
15
  * @constant
16
16
  * @type {string}
17
17
  */
18
- export declare const html = "\n <!DOCTYPE html>\n <html>\n <head>\n <title>%FUSION_SPA_TITLE%</title>\n <meta name=\"mode\" content=\"%MODE%\">\n <meta name=\"fusion-spa-plugin-version\" content=\"1.1.4\">\n <link rel=\"stylesheet\" href=\"https://cdn.eds.equinor.com/font/equinor-font.css\" />\n <script type=\"module\" src=\"%FUSION_SPA_BOOTSTRAP%\"></script>\n <script>\n // suppress console error for custom elements already defined. \n // WebComponents should be added by the portal, but not removed from application\n const _customElementsDefine = window.customElements.define;\n window.customElements.define = (name, cl, conf) => {\n if (!customElements.get(name)) {\n _customElementsDefine.call(window.customElements, name, cl, conf);\n }\n };\n </script>\n <style>\n html, body {\n margin: 0;\n padding: 0;\n height: 100%;\n font-family: 'EquinorFont', sans-serif;\n }\n </style>\n </head>\n <body></body>\n </html>\n";
18
+ export declare const html = "\n <!DOCTYPE html>\n <html>\n <head>\n <title>%FUSION_SPA_TITLE%</title>\n <meta name=\"mode\" content=\"%MODE%\">\n <meta name=\"fusion-spa-plugin-version\" content=\"1.2.0\">\n <link rel=\"stylesheet\" href=\"https://cdn.eds.equinor.com/font/equinor-font.css\" />\n <script type=\"module\" src=\"%FUSION_SPA_BOOTSTRAP%\"></script>\n <script>\n // suppress console error for custom elements already defined. \n // WebComponents should be added by the portal, but not removed from application\n const _customElementsDefine = window.customElements.define;\n window.customElements.define = (name, cl, conf) => {\n if (!customElements.get(name)) {\n _customElementsDefine.call(window.customElements, name, cl, conf);\n }\n };\n </script>\n <style>\n html, body {\n margin: 0;\n padding: 0;\n height: 100%;\n font-family: 'EquinorFont', sans-serif;\n }\n </style>\n </head>\n <body></body>\n </html>\n";
19
19
  export default html;
@@ -20,6 +20,7 @@ export type FusionTemplateEnv = {
20
20
  portal: {
21
21
  id: string;
22
22
  tag?: string;
23
+ proxy?: boolean;
23
24
  };
24
25
  /** Service discovery configuration */
25
26
  serviceDiscovery: {
@@ -1 +1 @@
1
- export declare const version = "1.1.4";
1
+ export declare const version = "1.2.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/fusion-framework-vite-plugin-spa",
3
- "version": "1.1.4",
3
+ "version": "1.2.0",
4
4
  "description": "Vite plugin for SPA development",
5
5
  "type": "module",
6
6
  "types": "dist/types/index.d.ts",
@@ -48,8 +48,8 @@
48
48
  "typescript": "^5.8.2",
49
49
  "vite": "^7.1.9",
50
50
  "@equinor/fusion-framework-module": "5.0.3",
51
- "@equinor/fusion-framework-module-http": "7.0.2",
52
51
  "@equinor/fusion-framework-module-msal": "5.0.1",
52
+ "@equinor/fusion-framework-module-http": "7.0.2",
53
53
  "@equinor/fusion-framework-module-telemetry": "4.2.0",
54
54
  "@equinor/fusion-framework-module-service-discovery": "9.0.2"
55
55
  },
@@ -130,6 +130,7 @@ enableTelemetry(configurator, {
130
130
  // fetch the portal manifest - this is used to load the portal template
131
131
  const portalId = import.meta.env.FUSION_SPA_PORTAL_ID;
132
132
  const portalTag = import.meta.env.FUSION_SPA_PORTAL_TAG ?? 'latest';
133
+ const portalProxy = import.meta.env.FUSION_SPA_PORTAL_PROXY ?? false;
133
134
  const portal_manifest = await measurement
134
135
  .clone()
135
136
  .resolve(portalClient.json<PortalManifest>(`/portals/${portalId}@${portalTag}`), {
@@ -164,7 +165,11 @@ enableTelemetry(configurator, {
164
165
  document.body.innerHTML = '';
165
166
  document.body.appendChild(el);
166
167
 
167
- const portalEntryPoint = [portal_manifest.build.assetPath, portal_manifest.build.templateEntry]
168
+ const portalEntryPoint = [
169
+ portalProxy ? '/portal-proxy' : '',
170
+ portal_manifest.build.assetPath,
171
+ portal_manifest.build.templateEntry,
172
+ ]
168
173
  .filter(Boolean)
169
174
  .join('/');
170
175
 
package/src/types.ts CHANGED
@@ -25,6 +25,7 @@ export type FusionTemplateEnv = {
25
25
  portal: {
26
26
  id: string;
27
27
  tag?: string;
28
+ proxy?: boolean;
28
29
  };
29
30
 
30
31
  /** Service discovery configuration */
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '1.1.4';
2
+ export const version = '1.2.0';