@equinor/fusion-framework-cli 10.7.4 → 11.0.0-next.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.
Files changed (513) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +144 -17
  3. package/bin/cli.mjs +4 -1
  4. package/dist/esm/bin/app-build.js +34 -0
  5. package/dist/esm/bin/app-build.js.map +1 -0
  6. package/dist/esm/bin/app-check.js +63 -0
  7. package/dist/esm/bin/app-check.js.map +1 -0
  8. package/dist/esm/bin/app-config-publish.js +89 -0
  9. package/dist/esm/bin/app-config-publish.js.map +1 -0
  10. package/dist/esm/bin/app-config.js +48 -0
  11. package/dist/esm/bin/app-config.js.map +1 -0
  12. package/dist/esm/bin/app-dev.js +92 -0
  13. package/dist/esm/bin/app-dev.js.map +1 -0
  14. package/dist/esm/bin/app-manifest.js +38 -0
  15. package/dist/esm/bin/app-manifest.js.map +1 -0
  16. package/dist/esm/bin/app-pack.js +51 -0
  17. package/dist/esm/bin/app-pack.js.map +1 -0
  18. package/dist/esm/bin/app-tag.js +89 -0
  19. package/dist/esm/bin/app-tag.js.map +1 -0
  20. package/dist/esm/bin/app-upload.js +109 -0
  21. package/dist/esm/bin/app-upload.js.map +1 -0
  22. package/dist/esm/bin/helpers/load-bundle-metadata.js +32 -0
  23. package/dist/esm/bin/helpers/load-bundle-metadata.js.map +1 -0
  24. package/dist/esm/bin/helpers/load-vite-config.js +55 -0
  25. package/dist/esm/bin/helpers/load-vite-config.js.map +1 -0
  26. package/dist/esm/bin/helpers/resolve-app-config.js +46 -0
  27. package/dist/esm/bin/helpers/resolve-app-config.js.map +1 -0
  28. package/dist/esm/bin/helpers/resolve-app-manifest.js +55 -0
  29. package/dist/esm/bin/helpers/resolve-app-manifest.js.map +1 -0
  30. package/dist/esm/bin/helpers/resolve-portal-manifest.js +55 -0
  31. package/dist/esm/bin/helpers/resolve-portal-manifest.js.map +1 -0
  32. package/dist/esm/bin/helpers/resolve-project-package.js +32 -0
  33. package/dist/esm/bin/helpers/resolve-project-package.js.map +1 -0
  34. package/dist/esm/bin/index.js +10 -0
  35. package/dist/esm/bin/index.js.map +1 -0
  36. package/dist/esm/bin/pack.js +70 -0
  37. package/dist/esm/bin/pack.js.map +1 -0
  38. package/dist/esm/bin/portal-build.js +40 -0
  39. package/dist/esm/bin/portal-build.js.map +1 -0
  40. package/dist/esm/bin/portal-dev.js +69 -0
  41. package/dist/esm/bin/portal-dev.js.map +1 -0
  42. package/dist/esm/bin/portal-manifest.js +38 -0
  43. package/dist/esm/bin/portal-manifest.js.map +1 -0
  44. package/dist/esm/bin/portal-pack.js +60 -0
  45. package/dist/esm/bin/portal-pack.js.map +1 -0
  46. package/dist/esm/bin/portal-tag.js +96 -0
  47. package/dist/esm/bin/portal-tag.js.map +1 -0
  48. package/dist/esm/bin/portal-upload.js +99 -0
  49. package/dist/esm/bin/portal-upload.js.map +1 -0
  50. package/dist/esm/bin/utils/ConsoleLogger.js +112 -0
  51. package/dist/esm/bin/utils/ConsoleLogger.js.map +1 -0
  52. package/dist/esm/bin/utils/create-dev-server.js +167 -0
  53. package/dist/esm/bin/utils/create-dev-server.js.map +1 -0
  54. package/dist/esm/bin/utils/format.js +47 -0
  55. package/dist/esm/bin/utils/format.js.map +1 -0
  56. package/dist/esm/bin/utils/index.js +5 -0
  57. package/dist/esm/bin/utils/index.js.map +1 -0
  58. package/dist/esm/bin/utils/spinner.js +142 -0
  59. package/dist/esm/bin/utils/spinner.js.map +1 -0
  60. package/dist/esm/cli/commands/app/alias.js +42 -0
  61. package/dist/esm/cli/commands/app/alias.js.map +1 -0
  62. package/dist/esm/cli/commands/app/build.js +46 -0
  63. package/dist/esm/cli/commands/app/build.js.map +1 -0
  64. package/dist/esm/cli/commands/app/check.js +47 -0
  65. package/dist/esm/cli/commands/app/check.js.map +1 -0
  66. package/dist/esm/cli/commands/app/config.js +91 -0
  67. package/dist/esm/cli/commands/app/config.js.map +1 -0
  68. package/dist/esm/cli/commands/app/dev.js +61 -0
  69. package/dist/esm/cli/commands/app/dev.js.map +1 -0
  70. package/dist/esm/cli/commands/app/index.js +25 -0
  71. package/dist/esm/cli/commands/app/index.js.map +1 -0
  72. package/dist/esm/cli/commands/app/manifest.js +73 -0
  73. package/dist/esm/cli/commands/app/manifest.js.map +1 -0
  74. package/dist/esm/cli/commands/app/pack.js +64 -0
  75. package/dist/esm/cli/commands/app/pack.js.map +1 -0
  76. package/dist/esm/cli/commands/app/publish.js +119 -0
  77. package/dist/esm/cli/commands/app/publish.js.map +1 -0
  78. package/dist/esm/cli/commands/app/tag.js +101 -0
  79. package/dist/esm/cli/commands/app/tag.js.map +1 -0
  80. package/dist/esm/cli/commands/app/upload.js +80 -0
  81. package/dist/esm/cli/commands/app/upload.js.map +1 -0
  82. package/dist/esm/cli/commands/auth/index.js +10 -0
  83. package/dist/esm/cli/commands/auth/index.js.map +1 -0
  84. package/dist/esm/cli/commands/auth/login.js +68 -0
  85. package/dist/esm/cli/commands/auth/login.js.map +1 -0
  86. package/dist/esm/cli/commands/auth/logout.js +55 -0
  87. package/dist/esm/cli/commands/auth/logout.js.map +1 -0
  88. package/dist/esm/cli/commands/auth/token.js +74 -0
  89. package/dist/esm/cli/commands/auth/token.js.map +1 -0
  90. package/dist/esm/cli/commands/disco/index.js +6 -0
  91. package/dist/esm/cli/commands/disco/index.js.map +1 -0
  92. package/dist/esm/cli/commands/disco/resolve.js +61 -0
  93. package/dist/esm/cli/commands/disco/resolve.js.map +1 -0
  94. package/dist/esm/cli/commands/index.js +11 -0
  95. package/dist/esm/cli/commands/index.js.map +1 -0
  96. package/dist/esm/cli/commands/portal/build.js +22 -0
  97. package/dist/esm/cli/commands/portal/build.js.map +1 -0
  98. package/dist/esm/cli/commands/portal/dev.js +24 -0
  99. package/dist/esm/cli/commands/portal/dev.js.map +1 -0
  100. package/dist/esm/cli/commands/portal/index.js +21 -0
  101. package/dist/esm/cli/commands/portal/index.js.map +1 -0
  102. package/dist/esm/cli/commands/portal/manifest.js +45 -0
  103. package/dist/esm/cli/commands/portal/manifest.js.map +1 -0
  104. package/dist/esm/cli/commands/portal/pack.js +35 -0
  105. package/dist/esm/cli/commands/portal/pack.js.map +1 -0
  106. package/dist/esm/cli/commands/portal/publish.js +73 -0
  107. package/dist/esm/cli/commands/portal/publish.js.map +1 -0
  108. package/dist/esm/cli/commands/portal/schema.js +68 -0
  109. package/dist/esm/cli/commands/portal/schema.js.map +1 -0
  110. package/dist/esm/cli/commands/portal/tag.js +69 -0
  111. package/dist/esm/cli/commands/portal/tag.js.map +1 -0
  112. package/dist/esm/cli/commands/portal/upload.js +40 -0
  113. package/dist/esm/cli/commands/portal/upload.js.map +1 -0
  114. package/dist/esm/cli/main.js +52 -0
  115. package/dist/esm/cli/main.js.map +1 -0
  116. package/dist/esm/cli/options/auth.js +96 -0
  117. package/dist/esm/cli/options/auth.js.map +1 -0
  118. package/dist/esm/cli/options/env.js +30 -0
  119. package/dist/esm/cli/options/env.js.map +1 -0
  120. package/dist/esm/lib/app/app-config.js +12 -0
  121. package/dist/esm/lib/app/app-config.js.map +1 -0
  122. package/dist/esm/lib/app/app-manifest.js +15 -0
  123. package/dist/esm/lib/app/app-manifest.js.map +1 -0
  124. package/dist/{lib → esm/lib/app}/app-package.js +30 -10
  125. package/dist/esm/lib/app/app-package.js.map +1 -0
  126. package/dist/esm/lib/app/create-app-manifest.js +72 -0
  127. package/dist/esm/lib/app/create-app-manifest.js.map +1 -0
  128. package/dist/esm/lib/app/index.js +9 -0
  129. package/dist/esm/lib/app/index.js.map +1 -0
  130. package/dist/esm/lib/app/load-app-config.js +47 -0
  131. package/dist/esm/lib/app/load-app-config.js.map +1 -0
  132. package/dist/esm/lib/app/load-app-manifest.js +61 -0
  133. package/dist/esm/lib/app/load-app-manifest.js.map +1 -0
  134. package/dist/esm/lib/app/merge-app-config.js +21 -0
  135. package/dist/esm/lib/app/merge-app-config.js.map +1 -0
  136. package/dist/esm/lib/app/merge-app-manifest.js +31 -0
  137. package/dist/esm/lib/app/merge-app-manifest.js.map +1 -0
  138. package/dist/esm/lib/app/schemas.js +28 -0
  139. package/dist/esm/lib/app/schemas.js.map +1 -0
  140. package/dist/esm/lib/dev-server.js +3 -0
  141. package/dist/esm/lib/dev-server.js.map +1 -0
  142. package/dist/esm/lib/framework.node.js +104 -0
  143. package/dist/esm/lib/framework.node.js.map +1 -0
  144. package/dist/esm/lib/index.js +5 -0
  145. package/dist/esm/lib/index.js.map +1 -0
  146. package/dist/esm/lib/legacy.js +38 -0
  147. package/dist/esm/lib/legacy.js.map +1 -0
  148. package/dist/esm/lib/load-dev-server-config.js +43 -0
  149. package/dist/esm/lib/load-dev-server-config.js.map +1 -0
  150. package/dist/esm/lib/merge-dev-server-config.js +37 -0
  151. package/dist/esm/lib/merge-dev-server-config.js.map +1 -0
  152. package/dist/esm/lib/portal/create-portal-manifest.js +93 -0
  153. package/dist/esm/lib/portal/create-portal-manifest.js.map +1 -0
  154. package/dist/esm/lib/portal/index.js +3 -0
  155. package/dist/esm/lib/portal/index.js.map +1 -0
  156. package/dist/esm/lib/portal/load-portal-manifest.js +54 -0
  157. package/dist/esm/lib/portal/load-portal-manifest.js.map +1 -0
  158. package/dist/esm/lib/portal/load-portal-schema.js +49 -0
  159. package/dist/esm/lib/portal/load-portal-schema.js.map +1 -0
  160. package/dist/esm/lib/portal/portal-manifest.js +21 -0
  161. package/dist/esm/lib/portal/portal-manifest.js.map +1 -0
  162. package/dist/esm/lib/portal/portal-manifest.schema.js +134 -0
  163. package/dist/esm/lib/portal/portal-manifest.schema.js.map +1 -0
  164. package/dist/esm/lib/static.js +20 -0
  165. package/dist/esm/lib/static.js.map +1 -0
  166. package/dist/{lib/utils → esm/lib}/types.js.map +1 -1
  167. package/dist/esm/lib/utils/assert.js +87 -0
  168. package/dist/esm/lib/utils/assert.js.map +1 -0
  169. package/dist/esm/lib/utils/expect.js.map +1 -0
  170. package/dist/{lib/plugins/app-assets/extension-filter-pattern.js → esm/lib/utils/extension-filter.js} +1 -1
  171. package/dist/esm/lib/utils/extension-filter.js.map +1 -0
  172. package/dist/esm/lib/utils/file-exists.js.map +1 -0
  173. package/dist/esm/lib/utils/index.js +6 -0
  174. package/dist/esm/lib/utils/index.js.map +1 -0
  175. package/dist/{lib → esm/lib}/utils/parse-json-request.js +3 -1
  176. package/dist/esm/lib/utils/parse-json-request.js.map +1 -0
  177. package/dist/esm/lib/utils/resolve-annotations.js +28 -0
  178. package/dist/esm/lib/utils/resolve-annotations.js.map +1 -0
  179. package/dist/esm/lib/utils/resolve-devops-annotations.js +59 -0
  180. package/dist/esm/lib/utils/resolve-devops-annotations.js.map +1 -0
  181. package/dist/esm/lib/utils/resolve-git-commit-sha.js +23 -0
  182. package/dist/esm/lib/utils/resolve-git-commit-sha.js.map +1 -0
  183. package/dist/esm/lib/utils/resolve-git-remote-url.js +24 -0
  184. package/dist/esm/lib/utils/resolve-git-remote-url.js.map +1 -0
  185. package/dist/esm/lib/utils/resolve-github-annotations.js +127 -0
  186. package/dist/esm/lib/utils/resolve-github-annotations.js.map +1 -0
  187. package/dist/esm/lib/utils/resolve-package-repo.js +14 -0
  188. package/dist/esm/lib/utils/resolve-package-repo.js.map +1 -0
  189. package/dist/esm/lib/utils/resolve-package.js +18 -0
  190. package/dist/esm/lib/utils/resolve-package.js.map +1 -0
  191. package/dist/esm/lib/utils/resolve-source-entry-point.js +39 -0
  192. package/dist/esm/lib/utils/resolve-source-entry-point.js.map +1 -0
  193. package/dist/esm/lib/utils/types.js.map +1 -0
  194. package/dist/esm/lib/utils/write-file.js +25 -0
  195. package/dist/esm/lib/utils/write-file.js.map +1 -0
  196. package/dist/esm/version.js +3 -0
  197. package/dist/esm/version.js.map +1 -0
  198. package/dist/tsconfig.tsbuildinfo +1 -0
  199. package/dist/types/bin/app-build.d.ts +52 -0
  200. package/dist/types/bin/app-check.d.ts +31 -0
  201. package/dist/types/bin/app-config-publish.d.ts +23 -0
  202. package/dist/types/bin/app-config.d.ts +52 -0
  203. package/dist/types/bin/app-dev.d.ts +45 -0
  204. package/dist/types/bin/app-manifest.d.ts +42 -0
  205. package/dist/types/bin/app-pack.d.ts +38 -0
  206. package/dist/types/bin/app-tag.d.ts +51 -0
  207. package/dist/types/bin/app-upload.d.ts +40 -0
  208. package/dist/types/bin/helpers/load-bundle-metadata.d.ts +15 -0
  209. package/dist/types/bin/helpers/load-vite-config.d.ts +12 -0
  210. package/dist/types/bin/helpers/resolve-app-config.d.ts +18 -0
  211. package/dist/types/bin/helpers/resolve-app-manifest.d.ts +17 -0
  212. package/dist/types/bin/helpers/resolve-portal-manifest.d.ts +27 -0
  213. package/dist/types/bin/helpers/resolve-project-package.d.ts +13 -0
  214. package/dist/types/bin/index.d.ts +9 -0
  215. package/dist/types/bin/pack.d.ts +36 -0
  216. package/dist/types/bin/portal-build.d.ts +54 -0
  217. package/dist/types/bin/portal-dev.d.ts +37 -0
  218. package/dist/types/bin/portal-manifest.d.ts +60 -0
  219. package/dist/types/bin/portal-pack.d.ts +54 -0
  220. package/dist/types/bin/portal-tag.d.ts +51 -0
  221. package/dist/types/bin/portal-upload.d.ts +37 -0
  222. package/dist/types/bin/utils/ConsoleLogger.d.ts +84 -0
  223. package/dist/types/bin/utils/create-dev-server.d.ts +49 -0
  224. package/dist/types/bin/utils/format.d.ts +27 -0
  225. package/dist/types/bin/utils/index.d.ts +3 -13
  226. package/dist/types/bin/utils/spinner.d.ts +75 -0
  227. package/dist/types/cli/commands/app/alias.d.ts +6 -0
  228. package/dist/types/cli/commands/app/build.d.ts +27 -0
  229. package/dist/types/cli/commands/app/check.d.ts +26 -0
  230. package/dist/types/cli/commands/app/config.d.ts +34 -0
  231. package/dist/types/cli/commands/app/dev.d.ts +29 -0
  232. package/dist/types/cli/commands/app/index.d.ts +3 -0
  233. package/dist/types/cli/commands/app/manifest.d.ts +30 -0
  234. package/dist/types/cli/commands/app/pack.d.ts +31 -0
  235. package/dist/types/cli/commands/app/publish.d.ts +31 -0
  236. package/dist/types/cli/commands/app/tag.d.ts +33 -0
  237. package/dist/types/cli/commands/app/upload.d.ts +29 -0
  238. package/dist/types/cli/commands/auth/index.d.ts +3 -0
  239. package/dist/types/cli/commands/auth/login.d.ts +2 -0
  240. package/dist/types/cli/commands/auth/logout.d.ts +12 -0
  241. package/dist/types/cli/commands/auth/token.d.ts +13 -0
  242. package/dist/types/cli/commands/disco/index.d.ts +2 -0
  243. package/dist/types/cli/commands/disco/resolve.d.ts +25 -0
  244. package/dist/types/cli/commands/portal/build.d.ts +2 -0
  245. package/dist/types/cli/commands/portal/dev.d.ts +2 -0
  246. package/dist/types/cli/commands/portal/index.d.ts +2 -0
  247. package/dist/types/cli/commands/portal/manifest.d.ts +2 -0
  248. package/dist/types/cli/commands/portal/pack.d.ts +2 -0
  249. package/dist/types/cli/commands/portal/publish.d.ts +2 -0
  250. package/dist/types/cli/commands/portal/schema.d.ts +2 -0
  251. package/dist/types/cli/commands/portal/tag.d.ts +2 -0
  252. package/dist/types/cli/commands/portal/upload.d.ts +2 -0
  253. package/dist/types/cli/main.d.ts +21 -0
  254. package/dist/types/cli/options/auth.d.ts +37 -0
  255. package/dist/types/cli/options/env.d.ts +19 -0
  256. package/dist/types/lib/app/app-config.d.ts +31 -0
  257. package/dist/types/lib/app/app-manifest.d.ts +39 -0
  258. package/dist/types/lib/{app-package.d.ts → app/app-package.d.ts} +27 -10
  259. package/dist/types/lib/app/create-app-manifest.d.ts +17 -0
  260. package/dist/types/lib/app/index.d.ts +8 -0
  261. package/dist/types/lib/app/load-app-config.d.ts +54 -0
  262. package/dist/types/lib/app/load-app-manifest.d.ts +57 -0
  263. package/dist/types/lib/app/merge-app-config.d.ts +13 -0
  264. package/dist/types/lib/app/merge-app-manifest.d.ts +25 -0
  265. package/dist/types/{schemas.d.ts → lib/app/schemas.d.ts} +10 -1
  266. package/dist/types/lib/dev-server.d.ts +2 -0
  267. package/dist/types/lib/framework.node.d.ts +77 -0
  268. package/dist/types/lib/index.d.ts +4 -3
  269. package/dist/types/lib/legacy.d.ts +24 -0
  270. package/dist/types/lib/load-dev-server-config.d.ts +40 -0
  271. package/dist/types/lib/merge-dev-server-config.d.ts +16 -0
  272. package/dist/types/lib/portal/create-portal-manifest.d.ts +22 -0
  273. package/dist/types/lib/portal/index.d.ts +2 -0
  274. package/dist/types/lib/portal/load-portal-manifest.d.ts +65 -0
  275. package/dist/types/lib/portal/load-portal-schema.d.ts +43 -0
  276. package/dist/types/lib/portal/portal-manifest.d.ts +16 -0
  277. package/dist/types/lib/portal/portal-manifest.schema.d.ts +154 -0
  278. package/dist/types/lib/static.d.ts +10 -0
  279. package/dist/types/lib/types.d.ts +34 -0
  280. package/dist/types/lib/utils/assert.d.ts +48 -0
  281. package/dist/types/lib/utils/index.d.ts +5 -0
  282. package/dist/types/lib/utils/resolve-annotations.d.ts +11 -0
  283. package/dist/types/lib/utils/resolve-devops-annotations.d.ts +30 -0
  284. package/dist/types/lib/utils/resolve-git-commit-sha.d.ts +13 -0
  285. package/dist/types/lib/utils/resolve-git-remote-url.d.ts +13 -0
  286. package/dist/types/lib/utils/resolve-github-annotations.d.ts +65 -0
  287. package/dist/types/lib/utils/resolve-package-repo.d.ts +9 -0
  288. package/dist/types/lib/utils/resolve-package.d.ts +15 -0
  289. package/dist/types/lib/utils/resolve-source-entry-point.d.ts +17 -0
  290. package/dist/types/lib/utils/types.d.ts +1 -1
  291. package/dist/types/lib/utils/write-file.d.ts +14 -0
  292. package/dist/types/version.d.ts +1 -1
  293. package/package.json +47 -68
  294. package/dist/bin/build-application.js +0 -55
  295. package/dist/bin/build-application.js.map +0 -1
  296. package/dist/bin/bundle-application.js +0 -41
  297. package/dist/bin/bundle-application.js.map +0 -1
  298. package/dist/bin/create-dev-serve.js +0 -127
  299. package/dist/bin/create-dev-serve.js.map +0 -1
  300. package/dist/bin/create-export-config.js +0 -40
  301. package/dist/bin/create-export-config.js.map +0 -1
  302. package/dist/bin/create-export-manifest.js +0 -67
  303. package/dist/bin/create-export-manifest.js.map +0 -1
  304. package/dist/bin/dev-portal/AppLoader.js +0 -80
  305. package/dist/bin/dev-portal/AppLoader.js.map +0 -1
  306. package/dist/bin/dev-portal/BookMarkSideSheet.js +0 -13
  307. package/dist/bin/dev-portal/BookMarkSideSheet.js.map +0 -1
  308. package/dist/bin/dev-portal/ContextSelector/ContextSelector.js +0 -40
  309. package/dist/bin/dev-portal/ContextSelector/ContextSelector.js.map +0 -1
  310. package/dist/bin/dev-portal/ContextSelector/index.js +0 -2
  311. package/dist/bin/dev-portal/ContextSelector/index.js.map +0 -1
  312. package/dist/bin/dev-portal/ContextSelector/useContextResolver.js +0 -216
  313. package/dist/bin/dev-portal/ContextSelector/useContextResolver.js.map +0 -1
  314. package/dist/bin/dev-portal/EquinorLoader.js +0 -14
  315. package/dist/bin/dev-portal/EquinorLoader.js.map +0 -1
  316. package/dist/bin/dev-portal/ErrorViewer.js +0 -7
  317. package/dist/bin/dev-portal/ErrorViewer.js.map +0 -1
  318. package/dist/bin/dev-portal/FusionLogo.js +0 -4
  319. package/dist/bin/dev-portal/FusionLogo.js.map +0 -1
  320. package/dist/bin/dev-portal/Header.Actions.js +0 -12
  321. package/dist/bin/dev-portal/Header.Actions.js.map +0 -1
  322. package/dist/bin/dev-portal/Header.js +0 -41
  323. package/dist/bin/dev-portal/Header.js.map +0 -1
  324. package/dist/bin/dev-portal/PersonSideSheet/index.js +0 -32
  325. package/dist/bin/dev-portal/PersonSideSheet/index.js.map +0 -1
  326. package/dist/bin/dev-portal/PersonSideSheet/sheets/FeatureSheetContent.js +0 -16
  327. package/dist/bin/dev-portal/PersonSideSheet/sheets/FeatureSheetContent.js.map +0 -1
  328. package/dist/bin/dev-portal/PersonSideSheet/sheets/FeatureTogglerApp.js +0 -15
  329. package/dist/bin/dev-portal/PersonSideSheet/sheets/FeatureTogglerApp.js.map +0 -1
  330. package/dist/bin/dev-portal/PersonSideSheet/sheets/FeatureTogglerPortal.js +0 -13
  331. package/dist/bin/dev-portal/PersonSideSheet/sheets/FeatureTogglerPortal.js.map +0 -1
  332. package/dist/bin/dev-portal/PersonSideSheet/sheets/LandingSheetContent.js +0 -19
  333. package/dist/bin/dev-portal/PersonSideSheet/sheets/LandingSheetContent.js.map +0 -1
  334. package/dist/bin/dev-portal/PersonSideSheet/sheets/Styled.js +0 -30
  335. package/dist/bin/dev-portal/PersonSideSheet/sheets/Styled.js.map +0 -1
  336. package/dist/bin/dev-portal/PersonSideSheet/sheets/index.js +0 -3
  337. package/dist/bin/dev-portal/PersonSideSheet/sheets/index.js.map +0 -1
  338. package/dist/bin/dev-portal/PersonSideSheet/sheets/types.js.map +0 -1
  339. package/dist/bin/dev-portal/Router.js +0 -59
  340. package/dist/bin/dev-portal/Router.js.map +0 -1
  341. package/dist/bin/dev-portal/config.js +0 -79
  342. package/dist/bin/dev-portal/config.js.map +0 -1
  343. package/dist/bin/dev-portal/main.js +0 -13
  344. package/dist/bin/dev-portal/main.js.map +0 -1
  345. package/dist/bin/dev-portal/resources/fallback-photo.svg.js +0 -3
  346. package/dist/bin/dev-portal/resources/fallback-photo.svg.js.map +0 -1
  347. package/dist/bin/dev-portal/useAppContextNavigation.js +0 -87
  348. package/dist/bin/dev-portal/useAppContextNavigation.js.map +0 -1
  349. package/dist/bin/main.app.js +0 -172
  350. package/dist/bin/main.app.js.map +0 -1
  351. package/dist/bin/main.js +0 -20
  352. package/dist/bin/main.js.map +0 -1
  353. package/dist/bin/public/assets/index-Cyqq53lr.js +0 -3686
  354. package/dist/bin/public/index.html +0 -37
  355. package/dist/bin/publish-application.js +0 -96
  356. package/dist/bin/publish-application.js.map +0 -1
  357. package/dist/bin/tag-application.js +0 -73
  358. package/dist/bin/tag-application.js.map +0 -1
  359. package/dist/bin/upload-application.js +0 -63
  360. package/dist/bin/upload-application.js.map +0 -1
  361. package/dist/bin/upload-export-config.js +0 -78
  362. package/dist/bin/upload-export-config.js.map +0 -1
  363. package/dist/bin/utils/execute-command.js +0 -14
  364. package/dist/bin/utils/execute-command.js.map +0 -1
  365. package/dist/bin/utils/format.js +0 -16
  366. package/dist/bin/utils/format.js.map +0 -1
  367. package/dist/bin/utils/getEndpointUrl.js +0 -40
  368. package/dist/bin/utils/getEndpointUrl.js.map +0 -1
  369. package/dist/bin/utils/index.js +0 -14
  370. package/dist/bin/utils/index.js.map +0 -1
  371. package/dist/bin/utils/isAppRegistered.js +0 -26
  372. package/dist/bin/utils/isAppRegistered.js.map +0 -1
  373. package/dist/bin/utils/load-app-config.js +0 -26
  374. package/dist/bin/utils/load-app-config.js.map +0 -1
  375. package/dist/bin/utils/load-manifest.js +0 -31
  376. package/dist/bin/utils/load-manifest.js.map +0 -1
  377. package/dist/bin/utils/load-package.js +0 -18
  378. package/dist/bin/utils/load-package.js.map +0 -1
  379. package/dist/bin/utils/load-vite-config.js +0 -45
  380. package/dist/bin/utils/load-vite-config.js.map +0 -1
  381. package/dist/bin/utils/proxy-request-logger.js +0 -33
  382. package/dist/bin/utils/proxy-request-logger.js.map +0 -1
  383. package/dist/bin/utils/publishAppConfig.js +0 -29
  384. package/dist/bin/utils/publishAppConfig.js.map +0 -1
  385. package/dist/bin/utils/requireToken.js +0 -9
  386. package/dist/bin/utils/requireToken.js.map +0 -1
  387. package/dist/bin/utils/spinner.js +0 -65
  388. package/dist/bin/utils/spinner.js.map +0 -1
  389. package/dist/bin/utils/tagAppBundle.js +0 -26
  390. package/dist/bin/utils/tagAppBundle.js.map +0 -1
  391. package/dist/bin/utils/uploadAppBundle.js +0 -45
  392. package/dist/bin/utils/uploadAppBundle.js.map +0 -1
  393. package/dist/lib/app-config.js +0 -32
  394. package/dist/lib/app-config.js.map +0 -1
  395. package/dist/lib/app-manifest.js +0 -142
  396. package/dist/lib/app-manifest.js.map +0 -1
  397. package/dist/lib/app-package.js.map +0 -1
  398. package/dist/lib/index.js +0 -4
  399. package/dist/lib/index.js.map +0 -1
  400. package/dist/lib/plugins/app-assets/app-asset-plugin.js +0 -96
  401. package/dist/lib/plugins/app-assets/app-asset-plugin.js.map +0 -1
  402. package/dist/lib/plugins/app-assets/emit-asset.js +0 -46
  403. package/dist/lib/plugins/app-assets/emit-asset.js.map +0 -1
  404. package/dist/lib/plugins/app-assets/extension-filter-pattern.js.map +0 -1
  405. package/dist/lib/plugins/app-assets/index.js +0 -4
  406. package/dist/lib/plugins/app-assets/index.js.map +0 -1
  407. package/dist/lib/plugins/app-assets/read-asset-content.js +0 -34
  408. package/dist/lib/plugins/app-assets/read-asset-content.js.map +0 -1
  409. package/dist/lib/plugins/app-assets/resolve-asset-id.js +0 -54
  410. package/dist/lib/plugins/app-assets/resolve-asset-id.js.map +0 -1
  411. package/dist/lib/plugins/app-assets/static.js +0 -15
  412. package/dist/lib/plugins/app-assets/static.js.map +0 -1
  413. package/dist/lib/plugins/app-proxy/app-proxy-plugin.js +0 -125
  414. package/dist/lib/plugins/app-proxy/app-proxy-plugin.js.map +0 -1
  415. package/dist/lib/plugins/app-proxy/index.js +0 -2
  416. package/dist/lib/plugins/app-proxy/index.js.map +0 -1
  417. package/dist/lib/plugins/app-settings/index.js +0 -36
  418. package/dist/lib/plugins/app-settings/index.js.map +0 -1
  419. package/dist/lib/plugins/external-public/external-public-plugin.js +0 -101
  420. package/dist/lib/plugins/external-public/external-public-plugin.js.map +0 -1
  421. package/dist/lib/plugins/external-public/index.js +0 -2
  422. package/dist/lib/plugins/external-public/index.js.map +0 -1
  423. package/dist/lib/plugins/help-proxy/help-proxy-plugin.js +0 -78
  424. package/dist/lib/plugins/help-proxy/help-proxy-plugin.js.map +0 -1
  425. package/dist/lib/plugins/help-proxy/index.js +0 -2
  426. package/dist/lib/plugins/help-proxy/index.js.map +0 -1
  427. package/dist/lib/utils/assert.js +0 -28
  428. package/dist/lib/utils/assert.js.map +0 -1
  429. package/dist/lib/utils/config.js +0 -67
  430. package/dist/lib/utils/config.js.map +0 -1
  431. package/dist/lib/utils/expect.js.map +0 -1
  432. package/dist/lib/utils/file-exists.js.map +0 -1
  433. package/dist/lib/utils/parse-json-request.js.map +0 -1
  434. package/dist/lib/utils/ts-transpile.js +0 -45
  435. package/dist/lib/utils/ts-transpile.js.map +0 -1
  436. package/dist/lib/vite-config.js +0 -76
  437. package/dist/lib/vite-config.js.map +0 -1
  438. package/dist/lib/vite-logger.js +0 -21
  439. package/dist/lib/vite-logger.js.map +0 -1
  440. package/dist/schemas.js +0 -14
  441. package/dist/schemas.js.map +0 -1
  442. package/dist/types/bin/build-application.d.ts +0 -13
  443. package/dist/types/bin/bundle-application.d.ts +0 -4
  444. package/dist/types/bin/create-dev-serve.d.ts +0 -12
  445. package/dist/types/bin/create-export-config.d.ts +0 -13
  446. package/dist/types/bin/create-export-manifest.d.ts +0 -16
  447. package/dist/types/bin/dev-portal/AppLoader.d.ts +0 -11
  448. package/dist/types/bin/dev-portal/BookMarkSideSheet.d.ts +0 -6
  449. package/dist/types/bin/dev-portal/ContextSelector/ContextSelector.d.ts +0 -8
  450. package/dist/types/bin/dev-portal/ContextSelector/index.d.ts +0 -1
  451. package/dist/types/bin/dev-portal/ContextSelector/useContextResolver.d.ts +0 -15
  452. package/dist/types/bin/dev-portal/EquinorLoader.d.ts +0 -5
  453. package/dist/types/bin/dev-portal/ErrorViewer.d.ts +0 -4
  454. package/dist/types/bin/dev-portal/FusionLogo.d.ts +0 -6
  455. package/dist/types/bin/dev-portal/Header.Actions.d.ts +0 -7
  456. package/dist/types/bin/dev-portal/Header.d.ts +0 -2
  457. package/dist/types/bin/dev-portal/PersonSideSheet/index.d.ts +0 -11
  458. package/dist/types/bin/dev-portal/PersonSideSheet/sheets/FeatureSheetContent.d.ts +0 -6
  459. package/dist/types/bin/dev-portal/PersonSideSheet/sheets/FeatureTogglerApp.d.ts +0 -5
  460. package/dist/types/bin/dev-portal/PersonSideSheet/sheets/FeatureTogglerPortal.d.ts +0 -5
  461. package/dist/types/bin/dev-portal/PersonSideSheet/sheets/LandingSheetContent.d.ts +0 -5
  462. package/dist/types/bin/dev-portal/PersonSideSheet/sheets/Styled.d.ts +0 -6
  463. package/dist/types/bin/dev-portal/PersonSideSheet/sheets/index.d.ts +0 -2
  464. package/dist/types/bin/dev-portal/PersonSideSheet/sheets/types.d.ts +0 -5
  465. package/dist/types/bin/dev-portal/Router.d.ts +0 -1
  466. package/dist/types/bin/dev-portal/config.d.ts +0 -3
  467. package/dist/types/bin/dev-portal/main.d.ts +0 -1
  468. package/dist/types/bin/dev-portal/resources/fallback-photo.svg.d.ts +0 -2
  469. package/dist/types/bin/dev-portal/useAppContextNavigation.d.ts +0 -5
  470. package/dist/types/bin/main.d.ts +0 -1
  471. package/dist/types/bin/publish-application.d.ts +0 -6
  472. package/dist/types/bin/tag-application.d.ts +0 -12
  473. package/dist/types/bin/upload-application.d.ts +0 -6
  474. package/dist/types/bin/upload-export-config.d.ts +0 -10
  475. package/dist/types/bin/utils/execute-command.d.ts +0 -8
  476. package/dist/types/bin/utils/getEndpointUrl.d.ts +0 -10
  477. package/dist/types/bin/utils/isAppRegistered.d.ts +0 -5
  478. package/dist/types/bin/utils/load-app-config.d.ts +0 -10
  479. package/dist/types/bin/utils/load-manifest.d.ts +0 -10
  480. package/dist/types/bin/utils/load-package.d.ts +0 -5
  481. package/dist/types/bin/utils/load-vite-config.d.ts +0 -10
  482. package/dist/types/bin/utils/proxy-request-logger.d.ts +0 -15
  483. package/dist/types/bin/utils/publishAppConfig.d.ts +0 -9
  484. package/dist/types/bin/utils/requireToken.d.ts +0 -4
  485. package/dist/types/bin/utils/tagAppBundle.d.ts +0 -7
  486. package/dist/types/bin/utils/uploadAppBundle.d.ts +0 -7
  487. package/dist/types/lib/app-config.d.ts +0 -27
  488. package/dist/types/lib/app-manifest.d.ts +0 -52
  489. package/dist/types/lib/plugins/app-assets/app-asset-plugin.d.ts +0 -36
  490. package/dist/types/lib/plugins/app-assets/emit-asset.d.ts +0 -18
  491. package/dist/types/lib/plugins/app-assets/index.d.ts +0 -3
  492. package/dist/types/lib/plugins/app-assets/read-asset-content.d.ts +0 -14
  493. package/dist/types/lib/plugins/app-assets/resolve-asset-id.d.ts +0 -16
  494. package/dist/types/lib/plugins/app-assets/static.d.ts +0 -5
  495. package/dist/types/lib/plugins/app-proxy/app-proxy-plugin.d.ts +0 -89
  496. package/dist/types/lib/plugins/app-proxy/index.d.ts +0 -1
  497. package/dist/types/lib/plugins/app-settings/index.d.ts +0 -32
  498. package/dist/types/lib/plugins/external-public/external-public-plugin.d.ts +0 -30
  499. package/dist/types/lib/plugins/external-public/index.d.ts +0 -1
  500. package/dist/types/lib/plugins/help-proxy/help-proxy-plugin.d.ts +0 -42
  501. package/dist/types/lib/plugins/help-proxy/index.d.ts +0 -1
  502. package/dist/types/lib/utils/config.d.ts +0 -32
  503. package/dist/types/lib/utils/ts-transpile.d.ts +0 -2
  504. package/dist/types/lib/vite-config.d.ts +0 -17
  505. package/dist/types/lib/vite-logger.d.ts +0 -2
  506. package/dist/version.js +0 -3
  507. package/dist/version.js.map +0 -1
  508. /package/dist/{bin/dev-portal/PersonSideSheet/sheets → esm/lib}/types.js +0 -0
  509. /package/dist/{lib → esm/lib}/utils/expect.js +0 -0
  510. /package/dist/{lib → esm/lib}/utils/file-exists.js +0 -0
  511. /package/dist/{lib → esm/lib}/utils/types.js +0 -0
  512. /package/dist/types/{bin/main.app.d.ts → cli/commands/index.d.ts} +0 -0
  513. /package/dist/types/lib/{plugins/app-assets/extension-filter-pattern.d.ts → utils/extension-filter.d.ts} +0 -0
@@ -1,6 +1,9 @@
1
1
  import { z } from 'zod';
2
2
  /**
3
- * Api config object
3
+ * Zod schema for validating the API application configuration object.
4
+ *
5
+ * This schema defines the structure and types for the app config used in the Fusion Framework CLI.
6
+ * It ensures that the configuration adheres to expected types and provides sensible defaults.
4
7
  */
5
8
  export declare const ApiAppConfigSchema: z.ZodObject<{
6
9
  environment: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
@@ -27,4 +30,10 @@ export declare const ApiAppConfigSchema: z.ZodObject<{
27
30
  scopes?: string[] | undefined;
28
31
  }> | undefined;
29
32
  }>;
33
+ /**
34
+ * Type representing the validated API application configuration.
35
+ *
36
+ * This type is inferred from the Zod schema and should be used throughout the CLI
37
+ * to ensure type safety and consistency with the schema.
38
+ */
30
39
  export type ApiAppConfig = z.infer<typeof ApiAppConfigSchema>;
@@ -0,0 +1,2 @@
1
+ export { loadDevServerConfig, defineDevServerConfig, type DevServerConfigFn, type DevServerConfigExport, } from './load-dev-server-config.js';
2
+ export { mergeDevServerConfig } from './merge-dev-server-config.js';
@@ -0,0 +1,77 @@
1
+ import { type ModulesInstance } from '@equinor/fusion-framework-module';
2
+ import { type MsalNodeModule } from '@equinor/fusion-framework-module-msal-node';
3
+ import { type HttpModule } from '@equinor/fusion-framework-module-http';
4
+ import { type ServiceDiscoveryModule } from '@equinor/fusion-framework-module-service-discovery';
5
+ type Modules = [MsalNodeModule, HttpModule, ServiceDiscoveryModule];
6
+ /**
7
+ * Type representing the initialized Fusion Framework instance.
8
+ * This is a composition of the modules defined in the Modules tuple.
9
+ */
10
+ export type FusionFramework = ModulesInstance<Modules>;
11
+ /**
12
+ * Enum for supported Fusion environments.
13
+ * Used to select the correct environment for service discovery and authentication.
14
+ */
15
+ export declare enum FusionEnv {
16
+ ContinuesIntegration = "ci",
17
+ QualityAssurance = "fqa",
18
+ Training = "tr",
19
+ Production = "fprd",
20
+ Development = "dev"
21
+ }
22
+ /**
23
+ * Resolves the default environment based on CI status and dev allowance.
24
+ *
25
+ * @param allowDev - If true, allows development environment when not in CI.
26
+ * @returns The resolved Fusion environment.
27
+ */
28
+ export declare const resolveDefaultEnv: (allowDev: boolean) => FusionEnv.ContinuesIntegration | FusionEnv.Development;
29
+ /**
30
+ * Auth option for direct token usage.
31
+ */
32
+ interface AuthTokenOptions {
33
+ token: string;
34
+ }
35
+ /**
36
+ * Auth option for silent authentication (non-interactive).
37
+ */
38
+ interface AuthSilentOptions {
39
+ clientId: string;
40
+ tenantId: string;
41
+ interactive?: false;
42
+ }
43
+ /**
44
+ * Auth option for interactive authentication, including server config.
45
+ */
46
+ interface AuthInteractiveOptions extends Omit<AuthSilentOptions, 'interactive'> {
47
+ interactive: true;
48
+ server: {
49
+ port: number;
50
+ onOpen?: (url: string) => void;
51
+ };
52
+ }
53
+ /**
54
+ * Settings for initializing the Fusion Framework.
55
+ * Includes environment, authentication, and service discovery options.
56
+ */
57
+ export type FusionFrameworkSettings = {
58
+ env?: (typeof FusionEnv)[keyof typeof FusionEnv];
59
+ auth: AuthTokenOptions | AuthSilentOptions | AuthInteractiveOptions;
60
+ serviceDiscovery?: {
61
+ url?: string;
62
+ scope?: string[];
63
+ };
64
+ };
65
+ /**
66
+ * Initializes the Fusion Framework with the provided settings.
67
+ *
68
+ * This function configures HTTP, service discovery, and authentication modules
69
+ * based on the supplied configuration. It supports multiple authentication modes
70
+ * and allows customization of service discovery endpoints and scopes.
71
+ *
72
+ * @param config - The settings for framework initialization.
73
+ * @returns A promise resolving to the initialized Fusion Framework instance.
74
+ * @throws Will throw if required authentication parameters are missing.
75
+ */
76
+ export declare const initializeFramework: (config: FusionFrameworkSettings) => Promise<FusionFramework>;
77
+ export {};
@@ -1,3 +1,4 @@
1
- export { mergeManifests, defineAppManifest, type AppManifestFn } from './app-manifest.js';
2
- export { defineAppConfig, type AppConfigFn, type AppConfigExport } from './app-config.js';
3
- export { defineAppPackage, resolveAppKey, resolveEntryPoint, type AppPackageJson, type ResolvedAppPackage, } from './app-package.js';
1
+ export type { RuntimeEnv } from './types.js';
2
+ export type { ResolvedPackage } from './utils/resolve-package.js';
3
+ export { initializeFramework, type FusionFramework } from './framework.node.js';
4
+ export { defineAppConfig, defineAppManifest } from './legacy.js';
@@ -0,0 +1,24 @@
1
+ import { defineAppConfig as _defineConfig } from './app/app-config.js';
2
+ import { defineAppManifest as _defineManifest } from './app/app-manifest.js';
3
+ /**
4
+ * @deprecated
5
+ * Will be removed in the next major version.
6
+ * Please use `defineAppConfig` from `@equinor/fusion-framework-cli/app` instead.
7
+ *
8
+ * Transitional wrapper for legacy defineAppConfig. This function exists only to prevent immediate breaking changes
9
+ * and should be removed as soon as possible. Consumers should migrate to the new API without delay.
10
+ *
11
+ * @param args - Arguments passed to the new defineAppConfig function.
12
+ */
13
+ export declare const defineAppConfig: (...args: Parameters<typeof _defineConfig>) => import("./app/app-config.js").AppConfigFn;
14
+ /**
15
+ * @deprecated
16
+ * Will be removed in the next major version.
17
+ * Please use `defineAppManifest` from `@equinor/fusion-framework-cli/app` instead.
18
+ *
19
+ * Transitional wrapper for legacy defineAppManifest. This function exists only to prevent immediate breaking changes
20
+ * and should be removed as soon as possible. Consumers should migrate to the new API without delay.
21
+ *
22
+ * @param args - Arguments passed to the new defineAppManifest function.
23
+ */
24
+ export declare const defineAppManifest: (...args: Parameters<typeof _defineManifest>) => import("./app/app-manifest.js").AppManifestFn<import("@equinor/fusion-framework-module-app").AppManifest>;
@@ -0,0 +1,40 @@
1
+ import { type ImportConfigResult } from '@equinor/fusion-imports';
2
+ import type { RuntimeEnv } from './types.js';
3
+ import type { DevServerOptions } from '@equinor/fusion-framework-dev-server';
4
+ /**
5
+ * Type definition for a function that generates or modifies DevServerOptions.
6
+ * @param env - The runtime environment configuration.
7
+ * @param args - An object containing the base DevServerOptions.
8
+ * @returns A DevServerOptions object or a Promise resolving to one, or undefined.
9
+ */
10
+ export type DevServerConfigFn = (env: RuntimeEnv, args: {
11
+ base: DevServerOptions;
12
+ }) => Promise<DevServerOptions | undefined> | DevServerOptions | undefined;
13
+ /**
14
+ * Type definition for a dev server config export, which can be either a DevServerOptions object or a function.
15
+ */
16
+ export type DevServerConfigExport = DevServerOptions | DevServerConfigFn;
17
+ /**
18
+ * Helper to define a dev server config function with proper typing.
19
+ * @param fn - The configuration function to be used as the dev server config.
20
+ * @returns The same function, typed as DevServerConfigFn.
21
+ */
22
+ export declare const defineDevServerConfig: (fn: DevServerConfigFn) => DevServerConfigFn;
23
+ /**
24
+ * Loads the dev server configuration from a file or function.
25
+ *
26
+ * @param env - The runtime environment configuration.
27
+ * @param base - The base DevServerOptions to use as defaults.
28
+ * @param options - Optional settings for file name and extensions.
29
+ * @returns A promise resolving to the imported config result.
30
+ *
31
+ * This function uses importConfig to dynamically load the configuration file.
32
+ * If the config export is a function, it is invoked with the environment and a cloned base config.
33
+ * If the config export is an object, it is merged with the base config.
34
+ *
35
+ * Inline comments are provided for maintainability and clarity.
36
+ */
37
+ export declare const loadDevServerConfig: (env: RuntimeEnv, base: DevServerOptions, options?: {
38
+ file?: string;
39
+ extensions?: string[];
40
+ }) => Promise<ImportConfigResult<DevServerOptions>>;
@@ -0,0 +1,16 @@
1
+ import type { DevServerOptions } from '@equinor/fusion-framework-dev-server';
2
+ import type { RecursivePartial } from './utils/types';
3
+ /**
4
+ * Merges a base development server configuration with an overrides object.
5
+ *
6
+ * Uses lodash.mergeWith to deeply merge properties, with custom logic for arrays.
7
+ * Arrays in the overrides object will replace arrays in the base config.
8
+ *
9
+ * @param base - The base development server configuration.
10
+ * @param overrides - A partial configuration object containing properties to override in the base configuration.
11
+ * @returns The merged development server configuration.
12
+ *
13
+ * Inline comments are provided for maintainability and clarity.
14
+ */
15
+ export declare const mergeDevServerConfig: (base: DevServerOptions, overrides: RecursivePartial<DevServerOptions>) => DevServerOptions;
16
+ export default mergeDevServerConfig;
@@ -0,0 +1,22 @@
1
+ import type { PackageJson } from 'type-fest';
2
+ import type { RuntimeEnv } from '../types';
3
+ import type { PortalManifest } from './portal-manifest.js';
4
+ /**
5
+ * Creates a `PortalManifest` object from the provided `package.json` data and runtime environment.
6
+ *
7
+ * This function validates the input package information, determines the appropriate entry point,
8
+ * extracts metadata such as the app key, version, and repository information, and constructs a manifest
9
+ * object suitable for use in portal deployment and development workflows.
10
+ *
11
+ * @param env - The runtime environment, containing information such as the current command (e.g., 'build', 'dev').
12
+ * @param packageJson - The parsed `package.json` object for the portal package, expected to include at least `name` and `version`.
13
+ * @returns A fully constructed `PortalManifest` object containing metadata, build information, and asset configuration.
14
+ *
15
+ * @throws Will throw an error if `packageJson` is not a valid object or is missing required fields.
16
+ *
17
+ * @remarks
18
+ * - Maintainers: This function is the canonical way to generate a portal manifest from package metadata.
19
+ * - The manifest structure is tightly coupled to the portal build and deployment pipeline.
20
+ * - If you add new fields to the manifest, update this function and its documentation accordingly.
21
+ */
22
+ export declare const createPortalManifestFromPackage: (env: RuntimeEnv, packageJson: PackageJson) => PortalManifest;
@@ -0,0 +1,2 @@
1
+ export { createPortalManifestFromPackage, definePortalManifest, loadPortalManifest, validatePortalManifest, type PortalManifest, type PortalManifestExport, type PortalManifestFn, } from './portal-manifest.js';
2
+ export { loadPortalSchema, definePortalSchema, type PortalSchema, type PortalSchemaExport, type PortalSchemaFn, } from './load-portal-schema.js';
@@ -0,0 +1,65 @@
1
+ import type { RuntimeEnv } from '../types';
2
+ import type { PortalManifest } from './portal-manifest.js';
3
+ /**
4
+ * A function type for generating or modifying a portal manifest based on the runtime environment and provided arguments.
5
+ *
6
+ * @template T - A type extending a partial `PortalManifest`.
7
+ * @param env - The current runtime environment.
8
+ * @param args - An object containing a `base` property, which is a partial portal manifest of type `T`.
9
+ * @returns The resulting portal manifest of type `T`, a promise resolving to `T` or `void`, or `void`.
10
+ */
11
+ export type PortalManifestFn<T extends Partial<PortalManifest>> = (env: RuntimeEnv, args: {
12
+ base: T;
13
+ }) => T | Promise<T | void> | T | void;
14
+ /**
15
+ * Represents a value that can either be a partial portal manifest object or a function returning such an object.
16
+ *
17
+ * @typeParam T - A type extending `Partial<PortalManifest>`, representing the shape of the portal manifest.
18
+ *
19
+ * This type is useful for scenarios where a portal manifest can be provided directly as an object,
20
+ * or as a function (possibly asynchronous or parameterized) that returns the manifest object.
21
+ */
22
+ export type PortalManifestExport<T extends Partial<PortalManifest>> = T | PortalManifestFn<T>;
23
+ /**
24
+ * Represents the result of loading a portal manifest file.
25
+ *
26
+ * @template T - A type extending `Partial<PortalManifest>`, representing the manifest's shape.
27
+ * @property manifest - The loaded manifest object.
28
+ * @property path - The file system path to the manifest file.
29
+ * @property extension - The file extension of the manifest file.
30
+ */
31
+ type LoadAppManifestResult<T extends Partial<PortalManifest>> = {
32
+ manifest: T;
33
+ path: string;
34
+ extension: string;
35
+ };
36
+ /**
37
+ * Options for loading a portal manifest configuration file.
38
+ *
39
+ * @template T - The type of the portal manifest, extending Partial<PortalManifest>.
40
+ * @property base - An optional base manifest object to merge with the loaded configuration.
41
+ * @property file - A string or array of strings specifying possible manifest file names to load.
42
+ * @property extensions - An array of file extensions to consider when resolving the manifest file.
43
+ */
44
+ export type LoadPortalManifestOptions<T extends Partial<PortalManifest>> = {
45
+ base?: T;
46
+ file?: string | string[];
47
+ extensions?: string[];
48
+ };
49
+ /**
50
+ * Loads a portal manifest configuration file, merging it with optional base values and supporting multiple file extensions.
51
+ *
52
+ * @template T - The type of the portal manifest, extending Partial<PortalManifest>. Defaults to PortalManifest.
53
+ * @param env - The runtime environment containing configuration such as the root directory and environment name.
54
+ * @param options - Optional settings for loading the manifest.
55
+ * @returns A promise that resolves to a `LoadAppManifestResult<T>` containing the loaded manifest, the file path, and the file extension.
56
+ *
57
+ * This function is the main entry point for loading portal manifest files. It supports merging with a base manifest, custom file name suggestions, and extension filtering.
58
+ *
59
+ * Example usage:
60
+ * ```ts
61
+ * const result = await loadPortalManifest(env, { base: {}, file: 'custom.manifest' });
62
+ * ```
63
+ */
64
+ export declare const loadPortalManifest: <T extends Partial<PortalManifest> = PortalManifest>(env: RuntimeEnv, options?: LoadPortalManifestOptions<T>) => Promise<LoadAppManifestResult<T>>;
65
+ export {};
@@ -0,0 +1,43 @@
1
+ import type { RuntimeEnv } from '../types';
2
+ /**
3
+ * Represents a generic portal schema as a record of key-value pairs.
4
+ */
5
+ export type PortalSchema = Record<string, unknown>;
6
+ /**
7
+ * A function that returns a portal schema, possibly asynchronously, based on the provided runtime environment.
8
+ * @template T - The type of the portal schema.
9
+ * @param env - The runtime environment used to generate the schema.
10
+ * @returns The portal schema or a promise resolving to the schema.
11
+ */
12
+ export type PortalSchemaFn<T extends PortalSchema> = (env: RuntimeEnv) => T | Promise<T> | T;
13
+ /**
14
+ * Represents either a portal schema object or a function that returns a portal schema.
15
+ * @template T - The type of the portal schema.
16
+ */
17
+ export type PortalSchemaExport<T extends PortalSchema> = T | PortalSchemaFn<T>;
18
+ /**
19
+ * Helper to define a portal schema function with type inference.
20
+ * @template T - The type of the portal schema.
21
+ * @param fn - The schema function to define.
22
+ * @returns The provided schema function.
23
+ */
24
+ export declare const definePortalSchema: <T extends PortalSchema>(fn: PortalSchemaFn<T>) => PortalSchemaFn<T>;
25
+ /**
26
+ * Loads a portal schema from configuration files or schema functions.
27
+ *
28
+ * @template T - The type of the portal schema.
29
+ * @param env - The runtime environment used to resolve the schema.
30
+ * @param options - Optional configuration for file names and extensions.
31
+ * @returns An object containing the loaded schema, file path, and extension.
32
+ *
33
+ * This function attempts to import a schema configuration file or function based on the provided environment and options.
34
+ * It supports both direct schema objects and schema factory functions. The schema is resolved and validated before returning.
35
+ */
36
+ export declare const loadPortalSchema: <T extends PortalSchema>(env: RuntimeEnv, options?: {
37
+ file?: string | string[];
38
+ extensions?: string[];
39
+ }) => Promise<{
40
+ schema: T;
41
+ path: string;
42
+ extension: string;
43
+ }>;
@@ -0,0 +1,16 @@
1
+ import type { PortalManifestFn } from './load-portal-manifest.js';
2
+ import type { PortalManifestSchemaType } from './portal-manifest.schema.js';
3
+ export { loadPortalManifest, type PortalManifestExport, type PortalManifestFn, } from './load-portal-manifest.js';
4
+ export { createPortalManifestFromPackage } from './create-portal-manifest.js';
5
+ export declare const definePortalManifest: <T extends PortalManifestSchemaType>(fn: PortalManifestFn<T>) => PortalManifestFn<T>;
6
+ export { PortalManifestSchema, PortalManifestBuildSchema, PortalManifestSchemaType as PortalManifest, type PortalManifestBuildSchemaType as PortalManifestBuild, } from './portal-manifest.schema.js';
7
+ /**
8
+ * Validates a portal manifest object against the PortalManifestSchema.
9
+ *
10
+ * @param manifest - The manifest object to validate.
11
+ * @returns The validated manifest object (typed) if valid.
12
+ * @throws ZodError if validation fails.
13
+ *
14
+ * Use this utility to ensure a manifest conforms to the expected schema before further processing.
15
+ */
16
+ export declare function validatePortalManifest(manifest: unknown): PortalManifestSchemaType;
@@ -0,0 +1,154 @@
1
+ /**
2
+ * Zod schema for validating the build section of the PortalManifest object.
3
+ *
4
+ * This schema defines the structure and types for the build metadata used in the portal manifest.
5
+ *
6
+ * @remarks
7
+ * - Maintainers: Update this schema if the build contract changes.
8
+ * - This schema is the canonical source for portal build validation and structure.
9
+ */
10
+ import { z } from 'zod';
11
+ export declare const PortalManifestBuildSchema: z.ZodObject<{
12
+ templateEntry: z.ZodString;
13
+ schemaEntry: z.ZodString;
14
+ assetPath: z.ZodOptional<z.ZodString>;
15
+ githubRepo: z.ZodOptional<z.ZodString>;
16
+ version: z.ZodString;
17
+ timestamp: z.ZodString;
18
+ commitSha: z.ZodString;
19
+ annotations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
20
+ projectPage: z.ZodOptional<z.ZodString>;
21
+ allowedExtensions: z.ZodArray<z.ZodString, "many">;
22
+ schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
23
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
24
+ }, "strip", z.ZodTypeAny, {
25
+ version: string;
26
+ timestamp: string;
27
+ commitSha: string;
28
+ allowedExtensions: string[];
29
+ templateEntry: string;
30
+ schemaEntry: string;
31
+ config?: Record<string, unknown> | undefined;
32
+ githubRepo?: string | undefined;
33
+ projectPage?: string | undefined;
34
+ assetPath?: string | undefined;
35
+ annotations?: Record<string, string> | undefined;
36
+ schema?: Record<string, unknown> | undefined;
37
+ }, {
38
+ version: string;
39
+ timestamp: string;
40
+ commitSha: string;
41
+ allowedExtensions: string[];
42
+ templateEntry: string;
43
+ schemaEntry: string;
44
+ config?: Record<string, unknown> | undefined;
45
+ githubRepo?: string | undefined;
46
+ projectPage?: string | undefined;
47
+ assetPath?: string | undefined;
48
+ annotations?: Record<string, string> | undefined;
49
+ schema?: Record<string, unknown> | undefined;
50
+ }>;
51
+ /**
52
+ * Zod schema for validating the PortalManifest object.
53
+ *
54
+ * This schema defines the structure and types for the portal manifest used in the Fusion Framework CLI.
55
+ * It ensures that the manifest adheres to expected types and provides sensible defaults for build metadata.
56
+ *
57
+ * @remarks
58
+ * - Maintainers: Update this schema if the portal manifest contract changes.
59
+ * - This schema is the canonical source for portal manifest validation and structure.
60
+ */
61
+ export declare const PortalManifestSchema: z.ZodObject<{
62
+ name: z.ZodString;
63
+ displayName: z.ZodOptional<z.ZodString>;
64
+ description: z.ZodOptional<z.ZodString>;
65
+ build: z.ZodObject<{
66
+ templateEntry: z.ZodString;
67
+ schemaEntry: z.ZodString;
68
+ assetPath: z.ZodOptional<z.ZodString>;
69
+ githubRepo: z.ZodOptional<z.ZodString>;
70
+ version: z.ZodString;
71
+ timestamp: z.ZodString;
72
+ commitSha: z.ZodString;
73
+ annotations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
74
+ projectPage: z.ZodOptional<z.ZodString>;
75
+ allowedExtensions: z.ZodArray<z.ZodString, "many">;
76
+ schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
77
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
78
+ }, "strip", z.ZodTypeAny, {
79
+ version: string;
80
+ timestamp: string;
81
+ commitSha: string;
82
+ allowedExtensions: string[];
83
+ templateEntry: string;
84
+ schemaEntry: string;
85
+ config?: Record<string, unknown> | undefined;
86
+ githubRepo?: string | undefined;
87
+ projectPage?: string | undefined;
88
+ assetPath?: string | undefined;
89
+ annotations?: Record<string, string> | undefined;
90
+ schema?: Record<string, unknown> | undefined;
91
+ }, {
92
+ version: string;
93
+ timestamp: string;
94
+ commitSha: string;
95
+ allowedExtensions: string[];
96
+ templateEntry: string;
97
+ schemaEntry: string;
98
+ config?: Record<string, unknown> | undefined;
99
+ githubRepo?: string | undefined;
100
+ projectPage?: string | undefined;
101
+ assetPath?: string | undefined;
102
+ annotations?: Record<string, string> | undefined;
103
+ schema?: Record<string, unknown> | undefined;
104
+ }>;
105
+ }, "strip", z.ZodTypeAny, {
106
+ build: {
107
+ version: string;
108
+ timestamp: string;
109
+ commitSha: string;
110
+ allowedExtensions: string[];
111
+ templateEntry: string;
112
+ schemaEntry: string;
113
+ config?: Record<string, unknown> | undefined;
114
+ githubRepo?: string | undefined;
115
+ projectPage?: string | undefined;
116
+ assetPath?: string | undefined;
117
+ annotations?: Record<string, string> | undefined;
118
+ schema?: Record<string, unknown> | undefined;
119
+ };
120
+ name: string;
121
+ displayName?: string | undefined;
122
+ description?: string | undefined;
123
+ }, {
124
+ build: {
125
+ version: string;
126
+ timestamp: string;
127
+ commitSha: string;
128
+ allowedExtensions: string[];
129
+ templateEntry: string;
130
+ schemaEntry: string;
131
+ config?: Record<string, unknown> | undefined;
132
+ githubRepo?: string | undefined;
133
+ projectPage?: string | undefined;
134
+ assetPath?: string | undefined;
135
+ annotations?: Record<string, string> | undefined;
136
+ schema?: Record<string, unknown> | undefined;
137
+ };
138
+ name: string;
139
+ displayName?: string | undefined;
140
+ description?: string | undefined;
141
+ }>;
142
+ /**
143
+ * Type representing the validated PortalManifest configuration.
144
+ *
145
+ * This type is inferred from the Zod schema and should be used throughout the CLI
146
+ * to ensure type safety and consistency with the schema.
147
+ */
148
+ export type PortalManifestSchemaType = z.infer<typeof PortalManifestSchema>;
149
+ /**
150
+ * Type representing the validated build section of the PortalManifest.
151
+ *
152
+ * This type is inferred from the build Zod schema and should be used for build-specific logic.
153
+ */
154
+ export type PortalManifestBuildSchemaType = z.infer<typeof PortalManifestBuildSchema>;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * A constant array of supported asset file extensions categorized by type.
3
+ *
4
+ * The extensions are grouped as follows:
5
+ * - **Images**: `png`, `jpg`, `jpeg`, `gif`, `svg`, `ico`, `webp`
6
+ * - **Videos and audio**: `mp4`, `webm`, `mp3`
7
+ * - **Fonts**: `woff2`, `woff`, `eot`, `ttf`, `otf`
8
+ * - **Documents**: `pdf`, `md`, `txt`
9
+ */
10
+ export declare const ASSET_EXTENSIONS: readonly ["png", "jpg", "jpeg", "gif", "svg", "ico", "webp", "mp4", "webm", "mp3", "woff2", "woff", "eot", "ttf", "otf", "pdf", "md", "txt"];
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Represents the runtime environment configuration for CLI commands.
3
+ *
4
+ * This type is used to pass environment and context information to CLI utilities and configuration loaders.
5
+ *
6
+ * @property command - The CLI command being executed (e.g., 'serve' or 'build').
7
+ * @property mode - The CLI mode (e.g., development, production, etc.).
8
+ * @property root - The root directory of the package (optional).
9
+ * @property isPreview - Indicates if the CLI is running in preview mode (optional).
10
+ * @property environment - The runtime environment, such as 'local' or 'ci' (optional, can be null).
11
+ */
12
+ export type RuntimeEnv = {
13
+ /**
14
+ * The CLI command being executed. Used to determine the operation mode for downstream logic.
15
+ * Example: 'serve' or 'build'.
16
+ */
17
+ command: 'serve' | 'build';
18
+ /**
19
+ * The CLI mode, typically used to distinguish between environments like development or production.
20
+ */
21
+ mode: string;
22
+ /**
23
+ * The root directory of the package. Used as a base path for resolving files and configs.
24
+ */
25
+ root?: string;
26
+ /**
27
+ * Indicates if the CLI is running in preview mode. Useful for toggling preview-specific logic.
28
+ */
29
+ isPreview?: boolean;
30
+ /**
31
+ * The runtime environment, such as 'local' or 'ci'. Allows for environment-specific configuration.
32
+ */
33
+ environment?: string | null;
34
+ };
@@ -1,8 +1,56 @@
1
1
  import assert, { AssertionError } from 'node:assert';
2
+ /**
3
+ * Re-exports the core Node.js assert function and AssertionError class.
4
+ * Useful for consistent assertion handling throughout the codebase.
5
+ */
2
6
  export { assert, AssertionError };
7
+ /**
8
+ * Asserts that the provided value is a valid number (not NaN).
9
+ * Throws an AssertionError if the value is not a number.
10
+ *
11
+ * @param value - The value to check for being a number.
12
+ * @param message - Optional custom error message for assertion failure.
13
+ * @throws {AssertionError} If value is NaN.
14
+ */
3
15
  export declare function assertNumber(value: unknown, message?: string): asserts value;
16
+ /**
17
+ * Asserts that a file exists at the given path.
18
+ * Throws an error if the file does not exist.
19
+ *
20
+ * @param value - The file path to check.
21
+ * @param message - Optional custom error message for assertion failure.
22
+ * @throws {AssertionError} If the file does not exist.
23
+ */
24
+ export declare const assertFileExists: (value: unknown, message?: string) => asserts value;
25
+ /**
26
+ * Asserts that the provided value is an object.
27
+ * Throws an error if the value is not an object.
28
+ *
29
+ * @param value - The value to check for being an object.
30
+ * @param message - Optional custom error message or Error instance.
31
+ * @throws {AssertionError} If value is not an object.
32
+ */
4
33
  export declare function assertObject(value: object, message?: string | Error): asserts value;
34
+ /**
35
+ * Asserts that a specific property exists and has a value on an object.
36
+ * Used internally for property value checks.
37
+ *
38
+ * @param value - The value of the property to check.
39
+ * @param prop - The property key being checked.
40
+ * @param message - Optional custom error message.
41
+ * @throws {AssertionError} If the property value is falsy.
42
+ */
5
43
  declare function assertObjectEntryValue<P>(value: unknown, prop: P, message?: string): asserts value;
44
+ /**
45
+ * Asserts that an object contains the specified properties and that each property has a value.
46
+ * Allows for custom assertion logic and pre-message prefixing.
47
+ *
48
+ * @typeParam T - The object type to check.
49
+ * @typeParam P - The array of property keys to check on the object.
50
+ * @param value - The object to check.
51
+ * @param options - Optional settings for property keys, assertion function, and message prefix.
52
+ * @throws {AssertionError} If any property is missing or fails the assertion.
53
+ */
6
54
  export declare function assertObjectEntries<T extends object, P extends Array<keyof T>>(value: T, options?: {
7
55
  props?: P;
8
56
  assertion?: typeof assertObjectEntryValue;
@@ -0,0 +1,5 @@
1
+ export { resolveEntryPoint } from './resolve-source-entry-point.js';
2
+ export { resolvePackage, type ResolvedPackage } from './resolve-package.js';
3
+ export { fileExists, fileExistsSync } from './file-exists.js';
4
+ export { writeFile } from './write-file.js';
5
+ export { resolveAnnotations } from './resolve-annotations.js';
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Resolves CI/CD environment-specific annotation variables.
3
+ *
4
+ * This function determines the current CI/CD runtime environment (GitHub Actions, Azure DevOps, or other)
5
+ * and returns a set of annotation variables relevant to that environment. These annotations are typically
6
+ * used for reporting build, test, or deployment results in a way that is compatible with the CI/CD provider's UI.
7
+ *
8
+ * @returns {Record<string, string>} An object containing annotation variables for the detected environment.
9
+ * If no known environment is detected, returns an empty object.
10
+ */
11
+ export declare const resolveAnnotations: () => Record<string, string>;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Resolves Azure DevOps-specific annotation variables from environment variables.
3
+ *
4
+ * This function extracts relevant build and repository information from Azure DevOps environment variables.
5
+ * It constructs a set of annotation variables that can be used for reporting or logging purposes in CI/CD pipelines.
6
+ *
7
+ * @returns {Record<string, string>} An object containing Azure DevOps annotation variables such as runId, repository,
8
+ * project, orgUrl, actor, branch, commitId, and runUrl. If a variable is not found, its value defaults to 'unknown'.
9
+ *
10
+ * Environment variables used by this function (see: https://learn.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-pipelines&tabs=yaml):
11
+ * - BUILD_BUILDID: Unique build/run identifier
12
+ * - BUILD_REPOSITORY_NAME: Repository name
13
+ * - SYSTEM_TEAMPROJECT: Project name
14
+ * - SYSTEM_COLLECTIONURI: Organization URL
15
+ * - BUILD_REQUESTEDFOR: User who requested the build
16
+ * - BUILD_SOURCEBRANCH: Source branch name
17
+ * - BUILD_SOURCEVERSION: Commit SHA
18
+ *
19
+ * Notes for maintainers:
20
+ * - If any environment variable is missing, its value defaults to 'unknown'.
21
+ * - The runUrl is constructed only if orgUrl, project, and runId are available; otherwise, it is set to 'unknown'.
22
+ * - If you need additional Azure DevOps context, refer to the official documentation and add new variables here.
23
+ * - Some variables may contain sensitive information. Use caution when logging or exposing these values.
24
+ *
25
+ * Extending this function:
26
+ * - To add more annotations, extract additional environment variables as needed and include them in the returned object.
27
+ * - For custom pipelines or self-hosted agents, verify that all required environment variables are available.
28
+ */
29
+ export declare const resolveAnnotations: () => Record<string, string>;
30
+ export default resolveAnnotations;