@equinor/fusion-framework-cli 10.0.0-beta-8c92234668d5f4b20de0650ff947f3afeb7c335c → 10.0.0-next-9f6eec8c5a4cb3dd430fc6bee227442a3dc28bb8

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 (175) hide show
  1. package/CHANGELOG.md +399 -6
  2. package/README.md +31 -9
  3. package/dist/bin/build-application.js +22 -1
  4. package/dist/bin/build-application.js.map +1 -1
  5. package/dist/bin/bundle-application.js +8 -11
  6. package/dist/bin/bundle-application.js.map +1 -1
  7. package/dist/bin/create-dev-serve.js +89 -117
  8. package/dist/bin/create-dev-serve.js.map +1 -1
  9. package/dist/bin/create-export-config.js +54 -12
  10. package/dist/bin/create-export-config.js.map +1 -1
  11. package/dist/bin/create-export-manifest.js +44 -36
  12. package/dist/bin/create-export-manifest.js.map +1 -1
  13. package/dist/bin/dev-portal/AppLoader.js +23 -0
  14. package/dist/bin/dev-portal/AppLoader.js.map +1 -1
  15. package/dist/bin/dev-portal/ContextSelector/ContextSelector.js +17 -2
  16. package/dist/bin/dev-portal/ContextSelector/ContextSelector.js.map +1 -1
  17. package/dist/bin/dev-portal/ContextSelector/useContextResolver.js +35 -1
  18. package/dist/bin/dev-portal/ContextSelector/useContextResolver.js.map +1 -1
  19. package/dist/bin/dev-portal/Header.js +1 -0
  20. package/dist/bin/dev-portal/Header.js.map +1 -1
  21. package/dist/bin/dev-portal/PersonSideSheet/index.js +4 -0
  22. package/dist/bin/dev-portal/PersonSideSheet/index.js.map +1 -1
  23. package/dist/bin/dev-portal/PersonSideSheet/sheets/FeatureSheetContent.js +4 -0
  24. package/dist/bin/dev-portal/PersonSideSheet/sheets/FeatureSheetContent.js.map +1 -1
  25. package/dist/bin/dev-portal/PersonSideSheet/sheets/FeatureTogglerApp.js +3 -0
  26. package/dist/bin/dev-portal/PersonSideSheet/sheets/FeatureTogglerApp.js.map +1 -1
  27. package/dist/bin/dev-portal/PersonSideSheet/sheets/FeatureTogglerPortal.js +3 -0
  28. package/dist/bin/dev-portal/PersonSideSheet/sheets/FeatureTogglerPortal.js.map +1 -1
  29. package/dist/bin/dev-portal/PersonSideSheet/sheets/LandingSheetContent.js +3 -0
  30. package/dist/bin/dev-portal/PersonSideSheet/sheets/LandingSheetContent.js.map +1 -1
  31. package/dist/bin/dev-portal/Router.js +3 -0
  32. package/dist/bin/dev-portal/Router.js.map +1 -1
  33. package/dist/bin/dev-portal/config.js +7 -2
  34. package/dist/bin/dev-portal/config.js.map +1 -1
  35. package/dist/bin/dev-portal/useAppContextNavigation.js +27 -6
  36. package/dist/bin/dev-portal/useAppContextNavigation.js.map +1 -1
  37. package/dist/bin/main.app.js +32 -19
  38. package/dist/bin/main.app.js.map +1 -1
  39. package/dist/bin/main.js +3 -0
  40. package/dist/bin/main.js.map +1 -1
  41. package/dist/bin/public/assets/index-CwGBhRCD.js +5235 -0
  42. package/dist/bin/public/index.html +1 -1
  43. package/dist/bin/publish-application.js +75 -20
  44. package/dist/bin/publish-application.js.map +1 -1
  45. package/dist/bin/tag-application.js +52 -16
  46. package/dist/bin/tag-application.js.map +1 -1
  47. package/dist/bin/upload-application.js +47 -14
  48. package/dist/bin/upload-application.js.map +1 -1
  49. package/dist/bin/utils/{execute-commant.js → execute-command.js} +5 -2
  50. package/dist/bin/utils/execute-command.js.map +1 -0
  51. package/dist/bin/utils/format.js +1 -1
  52. package/dist/bin/utils/format.js.map +1 -1
  53. package/dist/bin/utils/getEndpointUrl.js +49 -0
  54. package/dist/bin/utils/getEndpointUrl.js.map +1 -0
  55. package/dist/bin/utils/index.js +14 -0
  56. package/dist/bin/utils/index.js.map +1 -0
  57. package/dist/bin/utils/isAppRegistered.js +32 -0
  58. package/dist/bin/utils/isAppRegistered.js.map +1 -0
  59. package/dist/bin/utils/load-app-config.js +1 -0
  60. package/dist/bin/utils/load-app-config.js.map +1 -1
  61. package/dist/bin/utils/load-manifest.js +9 -4
  62. package/dist/bin/utils/load-manifest.js.map +1 -1
  63. package/dist/bin/utils/proxy-request-logger.js +34 -0
  64. package/dist/bin/utils/proxy-request-logger.js.map +1 -0
  65. package/dist/bin/utils/publishAppConfig.js +36 -0
  66. package/dist/bin/utils/publishAppConfig.js.map +1 -0
  67. package/dist/bin/utils/requireToken.js +10 -0
  68. package/dist/bin/utils/requireToken.js.map +1 -0
  69. package/dist/bin/utils/spinner.js +10 -0
  70. package/dist/bin/utils/spinner.js.map +1 -1
  71. package/dist/bin/utils/tagAppBundle.js +35 -0
  72. package/dist/bin/utils/tagAppBundle.js.map +1 -0
  73. package/dist/bin/utils/uploadAppBundle.js +54 -0
  74. package/dist/bin/utils/uploadAppBundle.js.map +1 -0
  75. package/dist/lib/app-config.js +3 -1
  76. package/dist/lib/app-config.js.map +1 -1
  77. package/dist/lib/app-manifest.js +97 -15
  78. package/dist/lib/app-manifest.js.map +1 -1
  79. package/dist/lib/app-package.js +52 -5
  80. package/dist/lib/app-package.js.map +1 -1
  81. package/dist/lib/plugins/app-assets/app-asset-plugin.js +102 -0
  82. package/dist/lib/plugins/app-assets/app-asset-plugin.js.map +1 -0
  83. package/dist/lib/plugins/app-assets/emit-asset.js +41 -0
  84. package/dist/lib/plugins/app-assets/emit-asset.js.map +1 -0
  85. package/dist/lib/plugins/app-assets/extension-filter-pattern.js +20 -0
  86. package/dist/lib/plugins/app-assets/extension-filter-pattern.js.map +1 -0
  87. package/dist/lib/plugins/app-assets/index.js +4 -0
  88. package/dist/lib/plugins/app-assets/index.js.map +1 -0
  89. package/dist/lib/plugins/app-assets/read-asset-content.js +34 -0
  90. package/dist/lib/plugins/app-assets/read-asset-content.js.map +1 -0
  91. package/dist/lib/plugins/app-assets/resolve-asset-id.js +63 -0
  92. package/dist/lib/plugins/app-assets/resolve-asset-id.js.map +1 -0
  93. package/dist/lib/plugins/app-assets/static.js +15 -0
  94. package/dist/lib/plugins/app-assets/static.js.map +1 -0
  95. package/dist/lib/plugins/app-proxy/app-proxy-plugin.js +127 -0
  96. package/dist/lib/plugins/app-proxy/app-proxy-plugin.js.map +1 -0
  97. package/dist/lib/plugins/app-proxy/index.js +2 -0
  98. package/dist/lib/plugins/app-proxy/index.js.map +1 -0
  99. package/dist/lib/plugins/external-public/external-public-plugin.js +103 -0
  100. package/dist/lib/plugins/external-public/external-public-plugin.js.map +1 -0
  101. package/dist/lib/plugins/external-public/index.js +2 -0
  102. package/dist/lib/plugins/external-public/index.js.map +1 -0
  103. package/dist/lib/utils/assert.js +2 -1
  104. package/dist/lib/utils/assert.js.map +1 -1
  105. package/dist/lib/utils/config.js +5 -0
  106. package/dist/lib/utils/config.js.map +1 -1
  107. package/dist/lib/vite-config.js +4 -4
  108. package/dist/lib/vite-config.js.map +1 -1
  109. package/dist/lib/vite-logger.js +2 -0
  110. package/dist/lib/vite-logger.js.map +1 -1
  111. package/dist/types/bin/build-application.d.ts +4 -3
  112. package/dist/types/bin/create-dev-serve.d.ts +1 -1
  113. package/dist/types/bin/create-export-config.d.ts +3 -3
  114. package/dist/types/bin/create-export-manifest.d.ts +6 -9
  115. package/dist/types/bin/dev-portal/AppLoader.d.ts +7 -0
  116. package/dist/types/bin/dev-portal/ContextSelector/ContextSelector.d.ts +5 -0
  117. package/dist/types/bin/dev-portal/ContextSelector/useContextResolver.d.ts +6 -0
  118. package/dist/types/bin/dev-portal/FusionLogo.d.ts +0 -1
  119. package/dist/types/bin/dev-portal/PersonSideSheet/index.d.ts +4 -0
  120. package/dist/types/bin/dev-portal/PersonSideSheet/sheets/FeatureSheetContent.d.ts +4 -0
  121. package/dist/types/bin/dev-portal/PersonSideSheet/sheets/FeatureTogglerApp.d.ts +3 -0
  122. package/dist/types/bin/dev-portal/PersonSideSheet/sheets/FeatureTogglerPortal.d.ts +3 -0
  123. package/dist/types/bin/dev-portal/PersonSideSheet/sheets/LandingSheetContent.d.ts +3 -0
  124. package/dist/types/bin/dev-portal/PersonSideSheet/sheets/Styled.d.ts +4 -5
  125. package/dist/types/bin/dev-portal/useAppContextNavigation.d.ts +4 -0
  126. package/dist/types/bin/publish-application.d.ts +1 -1
  127. package/dist/types/bin/tag-application.d.ts +1 -1
  128. package/dist/types/bin/upload-application.d.ts +1 -1
  129. package/dist/types/bin/utils/execute-command.d.ts +8 -0
  130. package/dist/types/bin/utils/format.d.ts +0 -2
  131. package/dist/types/bin/utils/getEndpointUrl.d.ts +10 -0
  132. package/dist/types/bin/utils/index.d.ts +14 -0
  133. package/dist/types/bin/utils/isAppRegistered.d.ts +7 -0
  134. package/dist/types/bin/utils/load-app-config.d.ts +1 -1
  135. package/dist/types/bin/utils/load-manifest.d.ts +3 -2
  136. package/dist/types/bin/utils/proxy-request-logger.d.ts +15 -0
  137. package/dist/types/bin/utils/publishAppConfig.d.ts +9 -0
  138. package/dist/types/bin/utils/requireToken.d.ts +4 -0
  139. package/dist/types/bin/utils/spinner.d.ts +1 -0
  140. package/dist/types/bin/utils/tagAppBundle.d.ts +7 -0
  141. package/dist/types/bin/utils/uploadAppBundle.d.ts +7 -0
  142. package/dist/types/lib/app-config.d.ts +1 -1
  143. package/dist/types/lib/app-manifest.d.ts +30 -2
  144. package/dist/types/lib/app-package.d.ts +34 -3
  145. package/dist/types/lib/plugins/app-assets/app-asset-plugin.d.ts +36 -0
  146. package/dist/types/lib/plugins/app-assets/emit-asset.d.ts +18 -0
  147. package/dist/types/lib/plugins/app-assets/extension-filter-pattern.d.ts +14 -0
  148. package/dist/types/lib/plugins/app-assets/index.d.ts +3 -0
  149. package/dist/types/lib/plugins/app-assets/read-asset-content.d.ts +14 -0
  150. package/dist/types/lib/plugins/app-assets/resolve-asset-id.d.ts +16 -0
  151. package/dist/types/lib/plugins/app-assets/static.d.ts +5 -0
  152. package/dist/types/lib/plugins/app-proxy/app-proxy-plugin.d.ts +70 -0
  153. package/dist/types/lib/plugins/app-proxy/index.d.ts +1 -0
  154. package/dist/types/lib/plugins/external-public/external-public-plugin.d.ts +30 -0
  155. package/dist/types/lib/plugins/external-public/index.d.ts +1 -0
  156. package/dist/types/lib/utils/assert.d.ts +2 -2
  157. package/dist/types/lib/utils/config.d.ts +7 -1
  158. package/dist/types/lib/utils/expect.d.ts +1 -1
  159. package/dist/types/lib/vite-config.d.ts +1 -1
  160. package/dist/types/version.d.ts +1 -1
  161. package/dist/version.js +2 -1
  162. package/dist/version.js.map +1 -1
  163. package/package.json +49 -35
  164. package/dist/bin/dev-proxy.js +0 -89
  165. package/dist/bin/dev-proxy.js.map +0 -1
  166. package/dist/bin/public/assets/index-DGTu1kLV.js +0 -3482
  167. package/dist/bin/utils/app-api.js +0 -169
  168. package/dist/bin/utils/app-api.js.map +0 -1
  169. package/dist/bin/utils/execute-commant.js.map +0 -1
  170. package/dist/index.js +0 -12
  171. package/dist/index.js.map +0 -1
  172. package/dist/types/bin/dev-proxy.d.ts +0 -26
  173. package/dist/types/bin/utils/app-api.d.ts +0 -8
  174. package/dist/types/bin/utils/execute-commant.d.ts +0 -8
  175. package/dist/types/index.d.ts +0 -4
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Removes the leading dot from a file extension string.
3
+ * `.` are a RegExp special character, so it needs to be escaped.
4
+ */
5
+ const trimLeadingDot = (ext) => ext.replace(/^\./, '');
6
+ /**
7
+ * Creates a regular expression pattern to filter files based on their extensions.
8
+ *
9
+ * @param exts - An array of file extensions to include in the pattern.
10
+ * @returns A RegExp object that matches files with the specified extensions.
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * const pattern = createExtensionFilterPattern(['.js', '.ts']);
15
+ * console.log(pattern); // Output: /\.(js|ts)(\?.*)?$/
16
+ * ```
17
+ */
18
+ export const createExtensionFilterPattern = (exts) => new RegExp(`\\.(${exts.map(trimLeadingDot).join('|')})(\\?.*)?$`);
19
+ export default createExtensionFilterPattern;
20
+ //# sourceMappingURL=extension-filter-pattern.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extension-filter-pattern.js","sourceRoot":"","sources":["../../../../src/lib/plugins/app-assets/extension-filter-pattern.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,cAAc,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAE/D;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,IAAc,EAAE,EAAE,CAC3D,IAAI,MAAM,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;AAEtE,eAAe,4BAA4B,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { default, AppAssetExportPlugin } from './app-asset-plugin.js';
2
+ export { createExtensionFilterPattern } from './extension-filter-pattern.js';
3
+ export { ASSET_EXTENSIONS as StandardIncludeAssetExtensions } from './static.js';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/plugins/app-assets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAE7E,OAAO,EAAE,gBAAgB,IAAI,8BAA8B,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { existsSync, readFileSync } from 'node:fs';
2
+ /**
3
+ * Cache for the content of assets.
4
+ */
5
+ const assetsContentMap = new Map();
6
+ /**
7
+ * Reads the content of an asset synchronously.
8
+ *
9
+ * @param id - The identifier of the asset, which can include a query string.
10
+ * @returns The content of the asset as a Buffer if it exists, otherwise null.
11
+ *
12
+ * @remarks
13
+ * - If the asset content is already cached, it returns the cached content.
14
+ * - The function extracts the filename from the identifier by removing any query string.
15
+ * - If the file exists, it reads the content, caches it, and then returns it.
16
+ * - If the file does not exist, it logs a warning and returns null.
17
+ */
18
+ export const readAssetContentSync = (id) => {
19
+ // check if the asset is already loaded
20
+ if (assetsContentMap.has(id)) {
21
+ return assetsContentMap.get(id);
22
+ }
23
+ // extract the filename without query
24
+ const [pureId] = id.split('?');
25
+ // if the file exists, read, cache and return content
26
+ if (existsSync(pureId)) {
27
+ const content = readFileSync(pureId);
28
+ assetsContentMap.set(id, content);
29
+ return content;
30
+ }
31
+ return null;
32
+ };
33
+ export default readAssetContentSync;
34
+ //# sourceMappingURL=read-asset-content.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-asset-content.js","sourceRoot":"","sources":["../../../../src/lib/plugins/app-assets/read-asset-content.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEnD;;GAEG;AACH,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAkB,CAAC;AAEnD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,EAAU,EAAiB,EAAE;IAC9D,uCAAuC;IACvC,IAAI,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;QAC3B,OAAO,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAE,CAAC;IACrC,CAAC;IAED,qCAAqC;IACrC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAE/B,qDAAqD;IACrD,IAAI,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QACrB,MAAM,OAAO,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;QACrC,gBAAgB,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QAClC,OAAO,OAAO,CAAC;IACnB,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,63 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import fs from 'node:fs';
11
+ import path from 'node:path';
12
+ import { PLUGIN_NAME } from './static.js';
13
+ /**
14
+ * Try to resolve the assets directly based on the ID and importer.
15
+ */
16
+ const localResolve = (id, importer) => {
17
+ if (path.isAbsolute(id)) {
18
+ return { id, external: 'absolute', resolvedBy: PLUGIN_NAME };
19
+ }
20
+ else if (id.startsWith('.')) {
21
+ return {
22
+ id: path.resolve(path.dirname(importer), id),
23
+ external: 'relative',
24
+ resolvedBy: PLUGIN_NAME,
25
+ };
26
+ }
27
+ return null;
28
+ };
29
+ /**
30
+ * Resolves the asset ID based on the provided context, ID, importer, and options.
31
+ *
32
+ * @param context - The plugin context used for resolving the ID.
33
+ * @param id - The asset ID to resolve.
34
+ * @param importer - The path of the module that is importing the asset.
35
+ * @param options - Optional resolution options.
36
+ * @returns A promise that resolves to a `PartialResolvedId` object or `null`.
37
+ *
38
+ * The function handles three cases:
39
+ * 1. If the ID is an absolute path, it returns an object with the ID, marked as external and resolved by the plugin.
40
+ * 2. If the ID is a relative path, it resolves the path relative to the importer and returns an object with the resolved ID, marked as external and resolved by the plugin.
41
+ * 3. For all other cases, it delegates the resolution to the context's resolve method.
42
+ */
43
+ export const resolveAssetId = (context, id, importer, options) => __awaiter(void 0, void 0, void 0, function* () {
44
+ const resolve = localResolve(id, importer);
45
+ /**
46
+ * Check if the asset can be resolved locally.
47
+ * If the asset is found, return the resolved asset.
48
+ *
49
+ * @remarks
50
+ * The Id alone might not be enough to resolve the asset.
51
+ * Rollup only gives the ID as the import from the source.
52
+ *
53
+ * For example, if the import is `import svgData from './assets/image.svg';`,
54
+ * the actual file is `./assets/image.svg.js`.
55
+ *
56
+ * In this we try to as the context to resolve the ID.
57
+ */
58
+ if (resolve && fs.existsSync(resolve.id)) {
59
+ return resolve;
60
+ }
61
+ return yield context.resolve(id, importer, options);
62
+ });
63
+ //# sourceMappingURL=resolve-asset-id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-asset-id.js","sourceRoot":"","sources":["../../../../src/lib/plugins/app-assets/resolve-asset-id.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAI7B,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C;;GAEG;AACH,MAAM,YAAY,GAAG,CAAC,EAAU,EAAE,QAAgB,EAA4B,EAAE;IAC5E,IAAI,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE,CAAC;QACtB,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;IACjE,CAAC;SAAM,IAAI,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAC5B,OAAO;YACH,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YAC5C,QAAQ,EAAE,UAAU;YACpB,UAAU,EAAE,WAAW;SAC1B,CAAC;IACN,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAC1B,OAAsB,EACtB,EAAU,EACV,QAAgB,EAChB,OAAiD,EAChB,EAAE;IACnC,MAAM,OAAO,GAAG,YAAY,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;IAC3C;;;;;;;;;;;;OAYG;IACH,IAAI,OAAO,IAAI,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC;QACvC,OAAO,OAAO,CAAC;IACnB,CAAC;IACD,OAAO,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AACxD,CAAC,CAAA,CAAC"}
@@ -0,0 +1,15 @@
1
+ export const PLUGIN_NAME = 'vite:fusion:app-assets';
2
+ /**
3
+ * General asset extensions.
4
+ */
5
+ export const ASSET_EXTENSIONS = [
6
+ // Images
7
+ ...['png', 'jpg', 'jpeg', 'gif', 'svg', 'ico', 'webp'],
8
+ // Videos and audio
9
+ ...['mp4', 'webm', 'mp3'],
10
+ // Fonts
11
+ ...['woff2', 'woff', 'eot', 'ttf', 'otf'],
12
+ // Documents
13
+ ...['pdf', 'md', 'txt'],
14
+ ];
15
+ //# sourceMappingURL=static.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static.js","sourceRoot":"","sources":["../../../../src/lib/plugins/app-assets/static.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,wBAAwB,CAAC;AAEpD;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,SAAS;IACT,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC;IACtD,mBAAmB;IACnB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC;IACzB,QAAQ;IACR,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;IACzC,YAAY;IACZ,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC;CAC1B,CAAC"}
@@ -0,0 +1,127 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ /**
11
+ * Preserve token for executing proxy assets
12
+ *
13
+ * @remarks
14
+ * This assumes the client will execute a api call using bearer token before
15
+ * acquiring a asset. By default the Framework will execute a rest call to load
16
+ * application manifest for resolving build assets to import.
17
+ *
18
+ * @remarks
19
+ * This is a quick and dirty method to authorize requests without bearer token
20
+ * like browser `import`.
21
+ * The correct way would be to have a auth controller within the dev-server,
22
+ * but since the token is only exposed to the plugin and the cli is a tool for local
23
+ * development, this should be sufficient.
24
+ */
25
+ let __APP_API_TOKEN__ = '';
26
+ /**
27
+ * The `appProxyPlugin` function creates a Vite plugin that configures a proxy for API and bundle requests
28
+ * to the Fusion apps backend. It also serves the app manifest, config, and local bundles if an app is provided.
29
+ *
30
+ * @param {AppProxyPluginOptions} options - The options for configuring the app proxy plugin.
31
+ *
32
+ * @returns {Plugin} - The configured Vite plugin.
33
+ *
34
+ * @example
35
+ * ```typescript
36
+ * const plugin = appProxyPlugin({
37
+ * proxy: {
38
+ * path: '/app-proxy',
39
+ * target: 'https://fusion-s-apps-ci.azurewebsites.net/',
40
+ * onProxyReq: (proxyReq, req, res) => {
41
+ * proxyReq.on('response', (res) => { console.log(res.statusCode) });
42
+ * },
43
+ * },
44
+ * app: {
45
+ * key: 'my-app',
46
+ * version: '1.0.0',
47
+ * generateConfig: async () => ({}),
48
+ * generateManifest: async () => ({}),
49
+ * },
50
+ * });
51
+ *
52
+ * // api calls
53
+ * fetch('/app-proxy/apps/my-app/builds/1.0.0/config'); // will generate app config by provided function
54
+ * fetch('/app-proxy/apps/my-app/builds/0.0.9/config'); // will proxy to the target, since version does not match
55
+ * fetch('/app-proxy/apps/other-app/builds/1.0.0/config'); // will proxy to the target, since app key does not match
56
+ *
57
+ * // asset calls
58
+ * fetch('/app-proxy/bundles/my-app/builds/1.0.0/index.js'); // will generate bundle by provided function
59
+ * fetch('/app-proxy/bundles/my-app/builds/0.0.9/index.js'); // will proxy to the target, since version does not match
60
+ * ```
61
+ *
62
+ */
63
+ export const appProxyPlugin = (options) => {
64
+ const { proxy: { onProxyReq = () => void 0, path: proxyPath, target }, } = options;
65
+ return {
66
+ name: 'fusion:app-proxy',
67
+ apply: 'serve',
68
+ config(config) {
69
+ var _a;
70
+ (_a = config.server) !== null && _a !== void 0 ? _a : (config.server = {});
71
+ config.server.proxy = {
72
+ // proxy all api calls to the fusion apps backend
73
+ [proxyPath]: {
74
+ target,
75
+ changeOrigin: true,
76
+ secure: false,
77
+ rewrite: (path) => path.replace(proxyPath, ''),
78
+ configure: (proxy) => {
79
+ proxy.on('proxyReq', (proxyReq) => {
80
+ const token = proxyReq.getHeader('authorization');
81
+ if (typeof token === 'string') {
82
+ // preserve token for executing proxy assets
83
+ __APP_API_TOKEN__ = token;
84
+ }
85
+ else if (__APP_API_TOKEN__) {
86
+ // apply token to proxy request
87
+ proxyReq.setHeader('authorization', __APP_API_TOKEN__);
88
+ }
89
+ });
90
+ proxy.on('proxyReq', onProxyReq);
91
+ },
92
+ },
93
+ };
94
+ },
95
+ configureServer(server) {
96
+ const { app } = options;
97
+ // disable local assets if no app configuration provided
98
+ if (!app)
99
+ return;
100
+ // serve app manifest if request matches the current app
101
+ // todo this should have version
102
+ const manifestPath = `${proxyPath}/apps/${app.key}`;
103
+ server.middlewares.use(manifestPath, (_req, res) => __awaiter(this, void 0, void 0, function* () {
104
+ res.setHeader('content-type', 'application/json');
105
+ res.end(JSON.stringify(yield app.generateManifest()));
106
+ }));
107
+ // serve app config if request matches the current app and version
108
+ const configPath = `${proxyPath}/apps/${app.key}/builds/${app.version}/config`;
109
+ server.middlewares.use(configPath, (_req, res) => __awaiter(this, void 0, void 0, function* () {
110
+ res.setHeader('content-type', 'application/json');
111
+ res.end(JSON.stringify(yield app.generateConfig()));
112
+ }));
113
+ // serve local bundles if request matches the current app and version
114
+ const bundlePath = `${proxyPath}/bundles/apps/${app.key}/${app.version}`;
115
+ server.middlewares.use((req, _res, next) => __awaiter(this, void 0, void 0, function* () {
116
+ var _a;
117
+ if ((_a = req.url) === null || _a === void 0 ? void 0 : _a.match(bundlePath)) {
118
+ // remove proxy path from url
119
+ req.url = req.url.replace(bundlePath, '');
120
+ }
121
+ next();
122
+ }));
123
+ },
124
+ };
125
+ };
126
+ export default appProxyPlugin;
127
+ //# sourceMappingURL=app-proxy-plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-proxy-plugin.js","sourceRoot":"","sources":["../../../../src/lib/plugins/app-proxy/app-proxy-plugin.ts"],"names":[],"mappings":";;;;;;;;;AAKA;;;;;;;;;;;;;;GAcG;AACH,IAAI,iBAAiB,GAAG,EAAE,CAAC;AA+B3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAA8B,EAAU,EAAE;IACrE,MAAM,EACF,KAAK,EAAE,EAAE,UAAU,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAChE,GAAG,OAAO,CAAC;IACZ,OAAO;QACH,IAAI,EAAE,kBAAkB;QACxB,KAAK,EAAE,OAAO;QACd,MAAM,CAAC,MAAM;;YACT,MAAA,MAAM,CAAC,MAAM,oCAAb,MAAM,CAAC,MAAM,GAAK,EAAE,EAAC;YACrB,MAAM,CAAC,MAAM,CAAC,KAAK,GAAG;gBAClB,iDAAiD;gBACjD,CAAC,SAAS,CAAC,EAAE;oBACT,MAAM;oBACN,YAAY,EAAE,IAAI;oBAClB,MAAM,EAAE,KAAK;oBACb,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC;oBAC9C,SAAS,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IAAI,EAAE,GAAG,EAAE,EAAE;gBACnD,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;gBAClD,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;YACxD,CAAC,CAAA,CAAC,CAAC;YAEH,qEAAqE;YACrE,MAAM,UAAU,GAAG,GAAG,SAAS,iBAAiB,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC;YACzE,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAO,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;;gBAC7C,IAAI,MAAA,GAAG,CAAC,GAAG,0CAAE,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;oBAC7B,6BAA6B;oBAC7B,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;gBAC/C,CAAC;gBACD,IAAI,EAAE,CAAC;YACX,CAAC,CAAA,CAAC,CAAC;QACP,CAAC;KACJ,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default, appProxyPlugin } from './app-proxy-plugin.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/plugins/app-proxy/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAA8B,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,103 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { join } from 'node:path';
11
+ import { readFileSync, existsSync } from 'node:fs';
12
+ import mime from 'mime';
13
+ import { createFilter } from 'vite';
14
+ /**
15
+ * Creates a plugin that serves an external public directory.
16
+ *
17
+ * This plugin is useful when you want to serve a static site from a different directory than the one where the Vite server is running.
18
+ * Vite`s built in `mode: 'spa'` will only look for the `index.html` file in the configured `root` directory,
19
+ * so this plugin is necessary to serve the `index.html` file from a different directory.
20
+ *
21
+ * @param path - The path to the external public directory.
22
+ * @param options - Optional filter patterns to include or exclude specific assets.
23
+ * @param options.include - A filter pattern to include specific assets.
24
+ * @param options.exclude - A filter pattern to exclude specific assets.
25
+ * @returns A Vite plugin object.
26
+ *
27
+ * The plugin:
28
+ * - Sets the `path` configuration to the provided path.
29
+ * - Adds a middleware to the server that serves static assets from the specified path.
30
+ * - Adds a middleware to the server that serves the `index.html` file from the specified path.
31
+ *
32
+ * The middleware:
33
+ * - Checks if the request is for a static asset and serves it from the specified path.
34
+ * - Reads the `index.html` file from the specified path.
35
+ * - Transforms the HTML using the server's `transformIndexHtml` method.
36
+ * - Responds with the transformed HTML, setting appropriate headers.
37
+ */
38
+ export const externalPublicPlugin = (path, options) => {
39
+ let viteConfig;
40
+ const assetFilter = createFilter(options === null || options === void 0 ? void 0 : options.include, options === null || options === void 0 ? void 0 : options.exclude);
41
+ return {
42
+ name: 'fusion:external-public',
43
+ apply: 'serve',
44
+ configResolved(config) {
45
+ viteConfig = config;
46
+ },
47
+ configureServer(server) {
48
+ // serve the static assets from the provided path
49
+ server.middlewares.use((req, res, next) => __awaiter(this, void 0, void 0, function* () {
50
+ var _a;
51
+ const [urlPath] = req.url.split('?');
52
+ const assetPath = join(path, urlPath);
53
+ if (!assetFilter(assetPath) ||
54
+ (
55
+ // skip if the request is for index.html
56
+ (_a = req.url) === null || _a === void 0 ? void 0 : _a.match('index.html')) ||
57
+ // skip if request is for a source file
58
+ existsSync(join(viteConfig.root, urlPath)) ||
59
+ // skip if asset is in publicDir
60
+ existsSync(join(viteConfig.publicDir, urlPath)) ||
61
+ // skip if asset does not exist
62
+ !existsSync(assetPath)) {
63
+ return next();
64
+ }
65
+ try {
66
+ const content = readFileSync(assetPath);
67
+ const contentType = mime.getType(assetPath) || 'application/octet-stream';
68
+ res.writeHead(200, Object.assign({ 'content-type': contentType, 'content-length': Buffer.byteLength(content), 'cache-control': 'no-cache' }, server.config.server.headers));
69
+ res.end(content);
70
+ }
71
+ catch (e) {
72
+ next(e);
73
+ }
74
+ }));
75
+ // intercept requests to serve the index.html file
76
+ server.middlewares.use((req, res, next) => __awaiter(this, void 0, void 0, function* () {
77
+ var _a;
78
+ if (
79
+ // Only accept GET or HEAD
80
+ (req.method !== 'GET' && req.method !== 'HEAD') ||
81
+ // Only accept text/html
82
+ !((_a = req.headers.accept) === null || _a === void 0 ? void 0 : _a.includes('text/html'))) {
83
+ return next();
84
+ }
85
+ try {
86
+ // load the raw html from provided path
87
+ const htmlRaw = readFileSync(join(path, 'index.html'), 'utf-8');
88
+ // transform the html, this is where vite plugin hooks are applied
89
+ const html = yield server.transformIndexHtml(req.url, htmlRaw, req.originalUrl);
90
+ // apply content headers and configured additional headers
91
+ res.writeHead(200, Object.assign({ 'content-type': 'text/html', 'content-length': Buffer.byteLength(html), 'cache-control': 'no-cache' }, server.config.server.headers));
92
+ // send the transformed html and end the response
93
+ res.end(html);
94
+ }
95
+ catch (e) {
96
+ next(e);
97
+ }
98
+ }));
99
+ },
100
+ };
101
+ };
102
+ export default externalPublicPlugin;
103
+ //# sourceMappingURL=external-public-plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"external-public-plugin.js","sourceRoot":"","sources":["../../../../src/lib/plugins/external-public/external-public-plugin.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EA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,CAClB,CAAC;oBAEF,0DAA0D;oBAC1D,GAAG,CAAC,SAAS,CAAC,GAAG,kBACb,cAAc,EAAE,WAAW,EAC3B,gBAAgB,EAAE,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,EACzC,eAAe,EAAE,UAAU,IACxB,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,EACjC,CAAC;oBAEH,iDAAiD;oBACjD,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBAClB,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACT,IAAI,CAAC,CAAC,CAAC,CAAC;gBACZ,CAAC;YACL,CAAC,CAAA,CAAC,CAAC;QACP,CAAC;KACJ,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default, externalPublicPlugin } from './external-public-plugin.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/plugins/external-public/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC"}
@@ -13,7 +13,8 @@ export function assertObject(value, message) {
13
13
  function assertObjectEntryValue(value, prop, message) {
14
14
  assert(!!value, message !== null && message !== void 0 ? message : `missing value of property ${prop}`);
15
15
  }
16
- export function assertObjectEntries(value, options) {
16
+ export function assertObjectEntries(// extends Record<string, unknown> = unknown>(
17
+ value, options) {
17
18
  var _a, _b, _c;
18
19
  const preMessage = (_a = options === null || options === void 0 ? void 0 : options.preMessage) !== null && _a !== void 0 ? _a : '';
19
20
  assert(typeof value === 'object', `${preMessage} to be an <object>`);
@@ -1 +1 @@
1
- {"version":3,"file":"assert.js","sourceRoot":"","sources":["../../../src/lib/utils/assert.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAAE,M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,CAAC,CAAC;IACnD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACvB,MAAM,CAAC,IAAI,IAAI,KAAK,EAAE,GAAG,UAAU,sBAAsB,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC1E,SAAS,CACL,KAAK,CAAC,IAAe,CAAC,EACtB,IAAoB,EACpB,GAAG,UAAU,cAAc,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAC3D,CAAC;IACN,CAAC;AACL,CAAC"}
@@ -27,6 +27,9 @@ import { pathToFileURL } from 'node:url';
27
27
  import { transpile } from './ts-transpile.js';
28
28
  import { fileExists } from './file-exists.js';
29
29
  export const supportedExt = ['.ts', '.mjs', '.js', '.json'];
30
+ /**
31
+ * @param filename name if config file without extension
32
+ */
30
33
  export const findConfigs = (filename, options) => __awaiter(void 0, void 0, void 0, function* () {
31
34
  const _a = options !== null && options !== void 0 ? options : {}, { extensions } = _a, findOptions = __rest(_a, ["extensions"]);
32
35
  extensions && assertConfigFileType(extensions);
@@ -68,6 +71,8 @@ export const loadConfig = (file) => __awaiter(void 0, void 0, void 0, function*
68
71
  case '.json': {
69
72
  return () => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield readFile(file, 'utf-8')); });
70
73
  }
74
+ default:
75
+ throw Error('unsupported file type');
71
76
  }
72
77
  });
73
78
  export function initiateConfig(config, ...args) {
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/lib/utils/config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,cAAc,EAAW,MAAM,SAAS,CAAC;AAElD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,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AAC;AAC1C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAc,IAAY,EAAkC,EAAE;IACpF,MAAM,CAAC,MAAM,UAAU,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,yBAAyB,IAAI,EAAE,CAAC,CAAC;IAClF,QAAQ,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;QAC1B,KAAK,KAAK,CAAC,CAAC,CAAC;YACT,OAAO,UAAU,CAAC,MAAM,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7C,CAAC;QACD,KAAK,MAAM,CAAC;QACZ,KAAK,KAAK,CAAC,CAAC,CAAC;YACT,MAAM,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;YACnE,OAAO,OAAO,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;QAChE,CAAC;QACD,KAAK,OAAO,CAAC,CAAC,CAAC;YACX,OAAO,GAAS,EAAE,kDAAC,OAAA,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAA,GAAA,CAAC;QACjE,CAAC;QACD;YACI,MAAM,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC7C,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,UAAU,cAAc,CAC1B,MAAe,EACf,GAAG,IAAyB;IAE5B,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,GAAI,IAA2B,CAAC,CAAC,CAAC;AACpE,CAAC;AAED,eAAe,UAAU,CAAC"}
@@ -12,6 +12,7 @@ import { defineConfig, mergeConfig } from 'vite';
12
12
  import { createViteLogger } from './vite-logger.js';
13
13
  import { AssertionError, assertObject } from './utils/assert.js';
14
14
  import { loadConfig, resolveConfig, initiateConfig, } from './utils/config.js';
15
+ // Plugins
15
16
  import viteEnv from 'vite-plugin-environment';
16
17
  import tsconfigPaths from 'vite-tsconfig-paths';
17
18
  import { fileExistsSync } from './utils/file-exists.js';
@@ -31,9 +32,10 @@ export const resolveViteConfig = (options) => __awaiter(void 0, void 0, void 0,
31
32
  return resolveConfig(configFilename, { find: options });
32
33
  });
33
34
  export const createAppViteConfig = (env, options) => __awaiter(void 0, void 0, void 0, function* () {
35
+ var _a;
34
36
  const resolved = yield resolveViteConfig(options);
35
37
  if (resolved) {
36
- const config = yield initiateConfig(resolved.config, env);
38
+ const config = (_a = (yield initiateConfig(resolved.config, env))) !== null && _a !== void 0 ? _a : {};
37
39
  return { config, path: resolved.path };
38
40
  }
39
41
  else if (options === null || options === void 0 ? void 0 : options.file) {
@@ -64,10 +66,8 @@ export const createViteConfig = (env, overrides) => __awaiter(void 0, void 0, vo
64
66
  FUSION_LOG_LEVEL: ((_a = process.env.FUSION_LOG_LEVEL) !== null && _a !== void 0 ? _a : env.mode === 'development') ? '3' : '1',
65
67
  }),
66
68
  ],
69
+ mode: env.mode,
67
70
  root,
68
- server: {
69
- middlewareMode: true,
70
- },
71
71
  appType: 'custom',
72
72
  build: {
73
73
  lib: {
@@ -1 +1 @@
1
- {"version":3,"file":"vite-config.js","sourceRoot":"","sources":["../../src/lib/vite-config.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,QAAQ,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAsC,MAAM,MAAM,CAAC;AAErF,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjE,OAAO,EACH,UAAU,EACV,aAAa,EAIb,cAAc,GACjB,MAAM,mBAAmB,CAAC;AAI3B,OAAO,OAAO,MAAM,yBAAyB,CAAC;AAC9C,OAAO,aAAa,MAAM,qBAAqB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,YAAY,EAAE,gBAAgB,EAAE;KACnC,CAAC,CAAC;IACH,OAAO,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC;AAC7E,CAAC,CAAA,CAAC"}
@@ -3,12 +3,14 @@ export const createViteLogger = () => {
3
3
  const logger = _createLogger();
4
4
  const originalLogger = Object.assign({}, logger);
5
5
  logger.error = (msg, opt) => {
6
+ // TODO find a way to make these assets external
6
7
  if (msg.match(/^Pre-transform error: Failed to load url \/assets/)) {
7
8
  return;
8
9
  }
9
10
  originalLogger.error(msg, opt);
10
11
  };
11
12
  logger.warn = (msg, options) => {
13
+ /** import of app file from framework */
12
14
  if (msg.includes('import(manifest.entry)') &&
13
15
  msg.includes('dynamic-import-vars#limitations'))
14
16
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"vite-logger.js","sourceRoot":"","sources":["../../src/lib/vite-logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,aAAa,EAAE,MAAM,MAAM,CAAC;AAErD,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACjC,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAC/B,MAAM,cAAc,qBAAQ,MAAM,CAAE,CAAC;IAErC,MAAM,CAAC,KAAK,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QAExB,IAAI,GAAG,CAAC,KAAK,CAAC,mDAAmD,CAAC,EAAE,CAAC;YACjE,OAAO;QACX,CAAC;QACD,cAAc,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACnC,CAAC,CAAC;IACF,MAAM,CAAC,IAAI,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE;QAE3B,IACI,GAAG,CAAC,QAAQ,CAAC,wBAAwB,CAAC;YACtC,GAAG,CAAC,QAAQ,CAAC,iCAAiC,CAAC;YAE/C,OAAO;QAEX,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC,CAAC;IACF,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"vite-logger.js","sourceRoot":"","sources":["../../src/lib/vite-logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,aAAa,EAAE,MAAM,MAAM,CAAC;AAErD,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACjC,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAC/B,MAAM,cAAc,qBAAQ,MAAM,CAAE,CAAC;IAErC,MAAM,CAAC,KAAK,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACxB,gDAAgD;QAChD,IAAI,GAAG,CAAC,KAAK,CAAC,mDAAmD,CAAC,EAAE,CAAC;YACjE,OAAO;QACX,CAAC;QACD,cAAc,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACnC,CAAC,CAAC;IACF,MAAM,CAAC,IAAI,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE;QAC3B,wCAAwC;QACxC,IACI,GAAG,CAAC,QAAQ,CAAC,wBAAwB,CAAC;YACtC,GAAG,CAAC,QAAQ,CAAC,iCAAiC,CAAC;YAE/C,OAAO;QAEX,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC,CAAC;IACF,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -5,8 +5,9 @@ export declare const buildApplication: (options: {
5
5
  vite?: string;
6
6
  };
7
7
  outDir: string;
8
- library?: 'react';
8
+ library?: "react";
9
9
  }) => Promise<{
10
- viteConfig: Record<string, any> | import("vite").UserConfig;
11
- viteBuild: import("rollup").RollupWatcher | import("rollup").RollupOutput | import("rollup").RollupOutput[];
10
+ viteConfig: import("vite").UserConfig | Record<string, any>;
11
+ viteBuild: import("rollup").RollupOutput | import("rollup").RollupOutput[] | import("rollup").RollupWatcher;
12
+ pkg: import("../lib/app-package.js").ResolvedAppPackage;
12
13
  }>;
@@ -7,5 +7,5 @@ export declare const createDevServer: (options: {
7
7
  };
8
8
  devPortalPath: string;
9
9
  port?: number;
10
- library?: 'react';
10
+ library?: "react";
11
11
  }) => Promise<void>;
@@ -1,11 +1,11 @@
1
- import { type FusionEnv } from './utils/app-api.js';
1
+ import type { FusionEnv } from './utils/index.js';
2
2
  import { ConfigExecuterEnv } from '../lib/utils/config.js';
3
3
  export declare const createExportConfig: (options: {
4
- command?: ConfigExecuterEnv['command'];
4
+ command?: ConfigExecuterEnv["command"];
5
5
  configFile?: string;
6
6
  publish?: string;
7
7
  outputFile?: string;
8
8
  env: FusionEnv;
9
9
  service: string;
10
- }) => Promise<import("@equinor/fusion-framework-module-app").AppConfig | undefined>;
10
+ }) => Promise<import("@equinor/fusion-framework-module-app").AppConfig>;
11
11
  export default createExportConfig;
@@ -5,15 +5,12 @@ export declare const normalizeVersion: (version: string) => {
5
5
  minor: number;
6
6
  patch: number;
7
7
  };
8
- type AppManifestExport = AppManifest & {
9
- entryPoint: string;
10
- commitSha?: string;
11
- githubRepo?: string;
12
- timestamp?: string;
13
- };
14
- export declare const createExportManifest: (options?: {
8
+ type CreateManifestOptions = {
15
9
  command?: ConfigExecuterEnv['command'];
16
10
  configFile?: string;
17
11
  outputFile?: string;
18
- }) => Promise<AppManifestExport>;
19
- export default createExportManifest;
12
+ onlyBuild?: boolean;
13
+ };
14
+ export declare const createAppManifest: (options?: CreateManifestOptions) => Promise<AppManifest>;
15
+ export declare const createBuildManifest: (options?: CreateManifestOptions) => Promise<import("@equinor/fusion-framework-module-app").AppBuildManifest | null | undefined>;
16
+ export {};
@@ -1,3 +1,10 @@
1
+ /**
2
+ * React Functional Component for handling current application
3
+ *
4
+ * this component will set the current app by provided appKey.
5
+ * when the appKey changes, this component will try to initialize the referred application
6
+ * and render it.
7
+ */
1
8
  export declare const AppLoader: (props: {
2
9
  readonly appKey: string;
3
10
  }) => import("react/jsx-runtime").JSX.Element;