@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.
- package/CHANGELOG.md +44 -0
- package/README.md +144 -17
- package/bin/cli.mjs +4 -1
- package/dist/esm/bin/app-build.js +34 -0
- package/dist/esm/bin/app-build.js.map +1 -0
- package/dist/esm/bin/app-check.js +63 -0
- package/dist/esm/bin/app-check.js.map +1 -0
- package/dist/esm/bin/app-config-publish.js +89 -0
- package/dist/esm/bin/app-config-publish.js.map +1 -0
- package/dist/esm/bin/app-config.js +48 -0
- package/dist/esm/bin/app-config.js.map +1 -0
- package/dist/esm/bin/app-dev.js +92 -0
- package/dist/esm/bin/app-dev.js.map +1 -0
- package/dist/esm/bin/app-manifest.js +38 -0
- package/dist/esm/bin/app-manifest.js.map +1 -0
- package/dist/esm/bin/app-pack.js +51 -0
- package/dist/esm/bin/app-pack.js.map +1 -0
- package/dist/esm/bin/app-tag.js +89 -0
- package/dist/esm/bin/app-tag.js.map +1 -0
- package/dist/esm/bin/app-upload.js +109 -0
- package/dist/esm/bin/app-upload.js.map +1 -0
- package/dist/esm/bin/helpers/load-bundle-metadata.js +32 -0
- package/dist/esm/bin/helpers/load-bundle-metadata.js.map +1 -0
- package/dist/esm/bin/helpers/load-vite-config.js +55 -0
- package/dist/esm/bin/helpers/load-vite-config.js.map +1 -0
- package/dist/esm/bin/helpers/resolve-app-config.js +46 -0
- package/dist/esm/bin/helpers/resolve-app-config.js.map +1 -0
- package/dist/esm/bin/helpers/resolve-app-manifest.js +55 -0
- package/dist/esm/bin/helpers/resolve-app-manifest.js.map +1 -0
- package/dist/esm/bin/helpers/resolve-portal-manifest.js +55 -0
- package/dist/esm/bin/helpers/resolve-portal-manifest.js.map +1 -0
- package/dist/esm/bin/helpers/resolve-project-package.js +32 -0
- package/dist/esm/bin/helpers/resolve-project-package.js.map +1 -0
- package/dist/esm/bin/index.js +10 -0
- package/dist/esm/bin/index.js.map +1 -0
- package/dist/esm/bin/pack.js +70 -0
- package/dist/esm/bin/pack.js.map +1 -0
- package/dist/esm/bin/portal-build.js +40 -0
- package/dist/esm/bin/portal-build.js.map +1 -0
- package/dist/esm/bin/portal-dev.js +69 -0
- package/dist/esm/bin/portal-dev.js.map +1 -0
- package/dist/esm/bin/portal-manifest.js +38 -0
- package/dist/esm/bin/portal-manifest.js.map +1 -0
- package/dist/esm/bin/portal-pack.js +60 -0
- package/dist/esm/bin/portal-pack.js.map +1 -0
- package/dist/esm/bin/portal-tag.js +96 -0
- package/dist/esm/bin/portal-tag.js.map +1 -0
- package/dist/esm/bin/portal-upload.js +99 -0
- package/dist/esm/bin/portal-upload.js.map +1 -0
- package/dist/esm/bin/utils/ConsoleLogger.js +112 -0
- package/dist/esm/bin/utils/ConsoleLogger.js.map +1 -0
- package/dist/esm/bin/utils/create-dev-server.js +167 -0
- package/dist/esm/bin/utils/create-dev-server.js.map +1 -0
- package/dist/esm/bin/utils/format.js +47 -0
- package/dist/esm/bin/utils/format.js.map +1 -0
- package/dist/esm/bin/utils/index.js +5 -0
- package/dist/esm/bin/utils/index.js.map +1 -0
- package/dist/esm/bin/utils/spinner.js +142 -0
- package/dist/esm/bin/utils/spinner.js.map +1 -0
- package/dist/esm/cli/commands/app/alias.js +42 -0
- package/dist/esm/cli/commands/app/alias.js.map +1 -0
- package/dist/esm/cli/commands/app/build.js +46 -0
- package/dist/esm/cli/commands/app/build.js.map +1 -0
- package/dist/esm/cli/commands/app/check.js +47 -0
- package/dist/esm/cli/commands/app/check.js.map +1 -0
- package/dist/esm/cli/commands/app/config.js +91 -0
- package/dist/esm/cli/commands/app/config.js.map +1 -0
- package/dist/esm/cli/commands/app/dev.js +61 -0
- package/dist/esm/cli/commands/app/dev.js.map +1 -0
- package/dist/esm/cli/commands/app/index.js +25 -0
- package/dist/esm/cli/commands/app/index.js.map +1 -0
- package/dist/esm/cli/commands/app/manifest.js +73 -0
- package/dist/esm/cli/commands/app/manifest.js.map +1 -0
- package/dist/esm/cli/commands/app/pack.js +64 -0
- package/dist/esm/cli/commands/app/pack.js.map +1 -0
- package/dist/esm/cli/commands/app/publish.js +119 -0
- package/dist/esm/cli/commands/app/publish.js.map +1 -0
- package/dist/esm/cli/commands/app/tag.js +101 -0
- package/dist/esm/cli/commands/app/tag.js.map +1 -0
- package/dist/esm/cli/commands/app/upload.js +80 -0
- package/dist/esm/cli/commands/app/upload.js.map +1 -0
- package/dist/esm/cli/commands/auth/index.js +10 -0
- package/dist/esm/cli/commands/auth/index.js.map +1 -0
- package/dist/esm/cli/commands/auth/login.js +68 -0
- package/dist/esm/cli/commands/auth/login.js.map +1 -0
- package/dist/esm/cli/commands/auth/logout.js +55 -0
- package/dist/esm/cli/commands/auth/logout.js.map +1 -0
- package/dist/esm/cli/commands/auth/token.js +74 -0
- package/dist/esm/cli/commands/auth/token.js.map +1 -0
- package/dist/esm/cli/commands/disco/index.js +6 -0
- package/dist/esm/cli/commands/disco/index.js.map +1 -0
- package/dist/esm/cli/commands/disco/resolve.js +61 -0
- package/dist/esm/cli/commands/disco/resolve.js.map +1 -0
- package/dist/esm/cli/commands/index.js +11 -0
- package/dist/esm/cli/commands/index.js.map +1 -0
- package/dist/esm/cli/commands/portal/build.js +22 -0
- package/dist/esm/cli/commands/portal/build.js.map +1 -0
- package/dist/esm/cli/commands/portal/dev.js +24 -0
- package/dist/esm/cli/commands/portal/dev.js.map +1 -0
- package/dist/esm/cli/commands/portal/index.js +21 -0
- package/dist/esm/cli/commands/portal/index.js.map +1 -0
- package/dist/esm/cli/commands/portal/manifest.js +45 -0
- package/dist/esm/cli/commands/portal/manifest.js.map +1 -0
- package/dist/esm/cli/commands/portal/pack.js +35 -0
- package/dist/esm/cli/commands/portal/pack.js.map +1 -0
- package/dist/esm/cli/commands/portal/publish.js +73 -0
- package/dist/esm/cli/commands/portal/publish.js.map +1 -0
- package/dist/esm/cli/commands/portal/schema.js +68 -0
- package/dist/esm/cli/commands/portal/schema.js.map +1 -0
- package/dist/esm/cli/commands/portal/tag.js +69 -0
- package/dist/esm/cli/commands/portal/tag.js.map +1 -0
- package/dist/esm/cli/commands/portal/upload.js +40 -0
- package/dist/esm/cli/commands/portal/upload.js.map +1 -0
- package/dist/esm/cli/main.js +52 -0
- package/dist/esm/cli/main.js.map +1 -0
- package/dist/esm/cli/options/auth.js +96 -0
- package/dist/esm/cli/options/auth.js.map +1 -0
- package/dist/esm/cli/options/env.js +30 -0
- package/dist/esm/cli/options/env.js.map +1 -0
- package/dist/esm/lib/app/app-config.js +12 -0
- package/dist/esm/lib/app/app-config.js.map +1 -0
- package/dist/esm/lib/app/app-manifest.js +15 -0
- package/dist/esm/lib/app/app-manifest.js.map +1 -0
- package/dist/{lib → esm/lib/app}/app-package.js +30 -10
- package/dist/esm/lib/app/app-package.js.map +1 -0
- package/dist/esm/lib/app/create-app-manifest.js +72 -0
- package/dist/esm/lib/app/create-app-manifest.js.map +1 -0
- package/dist/esm/lib/app/index.js +9 -0
- package/dist/esm/lib/app/index.js.map +1 -0
- package/dist/esm/lib/app/load-app-config.js +47 -0
- package/dist/esm/lib/app/load-app-config.js.map +1 -0
- package/dist/esm/lib/app/load-app-manifest.js +61 -0
- package/dist/esm/lib/app/load-app-manifest.js.map +1 -0
- package/dist/esm/lib/app/merge-app-config.js +21 -0
- package/dist/esm/lib/app/merge-app-config.js.map +1 -0
- package/dist/esm/lib/app/merge-app-manifest.js +31 -0
- package/dist/esm/lib/app/merge-app-manifest.js.map +1 -0
- package/dist/esm/lib/app/schemas.js +28 -0
- package/dist/esm/lib/app/schemas.js.map +1 -0
- package/dist/esm/lib/dev-server.js +3 -0
- package/dist/esm/lib/dev-server.js.map +1 -0
- package/dist/esm/lib/framework.node.js +104 -0
- package/dist/esm/lib/framework.node.js.map +1 -0
- package/dist/esm/lib/index.js +5 -0
- package/dist/esm/lib/index.js.map +1 -0
- package/dist/esm/lib/legacy.js +38 -0
- package/dist/esm/lib/legacy.js.map +1 -0
- package/dist/esm/lib/load-dev-server-config.js +43 -0
- package/dist/esm/lib/load-dev-server-config.js.map +1 -0
- package/dist/esm/lib/merge-dev-server-config.js +37 -0
- package/dist/esm/lib/merge-dev-server-config.js.map +1 -0
- package/dist/esm/lib/portal/create-portal-manifest.js +93 -0
- package/dist/esm/lib/portal/create-portal-manifest.js.map +1 -0
- package/dist/esm/lib/portal/index.js +3 -0
- package/dist/esm/lib/portal/index.js.map +1 -0
- package/dist/esm/lib/portal/load-portal-manifest.js +54 -0
- package/dist/esm/lib/portal/load-portal-manifest.js.map +1 -0
- package/dist/esm/lib/portal/load-portal-schema.js +49 -0
- package/dist/esm/lib/portal/load-portal-schema.js.map +1 -0
- package/dist/esm/lib/portal/portal-manifest.js +21 -0
- package/dist/esm/lib/portal/portal-manifest.js.map +1 -0
- package/dist/esm/lib/portal/portal-manifest.schema.js +134 -0
- package/dist/esm/lib/portal/portal-manifest.schema.js.map +1 -0
- package/dist/esm/lib/static.js +20 -0
- package/dist/esm/lib/static.js.map +1 -0
- package/dist/{lib/utils → esm/lib}/types.js.map +1 -1
- package/dist/esm/lib/utils/assert.js +87 -0
- package/dist/esm/lib/utils/assert.js.map +1 -0
- package/dist/esm/lib/utils/expect.js.map +1 -0
- package/dist/{lib/plugins/app-assets/extension-filter-pattern.js → esm/lib/utils/extension-filter.js} +1 -1
- package/dist/esm/lib/utils/extension-filter.js.map +1 -0
- package/dist/esm/lib/utils/file-exists.js.map +1 -0
- package/dist/esm/lib/utils/index.js +6 -0
- package/dist/esm/lib/utils/index.js.map +1 -0
- package/dist/{lib → esm/lib}/utils/parse-json-request.js +3 -1
- package/dist/esm/lib/utils/parse-json-request.js.map +1 -0
- package/dist/esm/lib/utils/resolve-annotations.js +28 -0
- package/dist/esm/lib/utils/resolve-annotations.js.map +1 -0
- package/dist/esm/lib/utils/resolve-devops-annotations.js +59 -0
- package/dist/esm/lib/utils/resolve-devops-annotations.js.map +1 -0
- package/dist/esm/lib/utils/resolve-git-commit-sha.js +23 -0
- package/dist/esm/lib/utils/resolve-git-commit-sha.js.map +1 -0
- package/dist/esm/lib/utils/resolve-git-remote-url.js +24 -0
- package/dist/esm/lib/utils/resolve-git-remote-url.js.map +1 -0
- package/dist/esm/lib/utils/resolve-github-annotations.js +127 -0
- package/dist/esm/lib/utils/resolve-github-annotations.js.map +1 -0
- package/dist/esm/lib/utils/resolve-package-repo.js +14 -0
- package/dist/esm/lib/utils/resolve-package-repo.js.map +1 -0
- package/dist/esm/lib/utils/resolve-package.js +18 -0
- package/dist/esm/lib/utils/resolve-package.js.map +1 -0
- package/dist/esm/lib/utils/resolve-source-entry-point.js +39 -0
- package/dist/esm/lib/utils/resolve-source-entry-point.js.map +1 -0
- package/dist/esm/lib/utils/types.js.map +1 -0
- package/dist/esm/lib/utils/write-file.js +25 -0
- package/dist/esm/lib/utils/write-file.js.map +1 -0
- package/dist/esm/version.js +3 -0
- package/dist/esm/version.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/bin/app-build.d.ts +52 -0
- package/dist/types/bin/app-check.d.ts +31 -0
- package/dist/types/bin/app-config-publish.d.ts +23 -0
- package/dist/types/bin/app-config.d.ts +52 -0
- package/dist/types/bin/app-dev.d.ts +45 -0
- package/dist/types/bin/app-manifest.d.ts +42 -0
- package/dist/types/bin/app-pack.d.ts +38 -0
- package/dist/types/bin/app-tag.d.ts +51 -0
- package/dist/types/bin/app-upload.d.ts +40 -0
- package/dist/types/bin/helpers/load-bundle-metadata.d.ts +15 -0
- package/dist/types/bin/helpers/load-vite-config.d.ts +12 -0
- package/dist/types/bin/helpers/resolve-app-config.d.ts +18 -0
- package/dist/types/bin/helpers/resolve-app-manifest.d.ts +17 -0
- package/dist/types/bin/helpers/resolve-portal-manifest.d.ts +27 -0
- package/dist/types/bin/helpers/resolve-project-package.d.ts +13 -0
- package/dist/types/bin/index.d.ts +9 -0
- package/dist/types/bin/pack.d.ts +36 -0
- package/dist/types/bin/portal-build.d.ts +54 -0
- package/dist/types/bin/portal-dev.d.ts +37 -0
- package/dist/types/bin/portal-manifest.d.ts +60 -0
- package/dist/types/bin/portal-pack.d.ts +54 -0
- package/dist/types/bin/portal-tag.d.ts +51 -0
- package/dist/types/bin/portal-upload.d.ts +37 -0
- package/dist/types/bin/utils/ConsoleLogger.d.ts +84 -0
- package/dist/types/bin/utils/create-dev-server.d.ts +49 -0
- package/dist/types/bin/utils/format.d.ts +27 -0
- package/dist/types/bin/utils/index.d.ts +3 -13
- package/dist/types/bin/utils/spinner.d.ts +75 -0
- package/dist/types/cli/commands/app/alias.d.ts +6 -0
- package/dist/types/cli/commands/app/build.d.ts +27 -0
- package/dist/types/cli/commands/app/check.d.ts +26 -0
- package/dist/types/cli/commands/app/config.d.ts +34 -0
- package/dist/types/cli/commands/app/dev.d.ts +29 -0
- package/dist/types/cli/commands/app/index.d.ts +3 -0
- package/dist/types/cli/commands/app/manifest.d.ts +30 -0
- package/dist/types/cli/commands/app/pack.d.ts +31 -0
- package/dist/types/cli/commands/app/publish.d.ts +31 -0
- package/dist/types/cli/commands/app/tag.d.ts +33 -0
- package/dist/types/cli/commands/app/upload.d.ts +29 -0
- package/dist/types/cli/commands/auth/index.d.ts +3 -0
- package/dist/types/cli/commands/auth/login.d.ts +2 -0
- package/dist/types/cli/commands/auth/logout.d.ts +12 -0
- package/dist/types/cli/commands/auth/token.d.ts +13 -0
- package/dist/types/cli/commands/disco/index.d.ts +2 -0
- package/dist/types/cli/commands/disco/resolve.d.ts +25 -0
- package/dist/types/cli/commands/portal/build.d.ts +2 -0
- package/dist/types/cli/commands/portal/dev.d.ts +2 -0
- package/dist/types/cli/commands/portal/index.d.ts +2 -0
- package/dist/types/cli/commands/portal/manifest.d.ts +2 -0
- package/dist/types/cli/commands/portal/pack.d.ts +2 -0
- package/dist/types/cli/commands/portal/publish.d.ts +2 -0
- package/dist/types/cli/commands/portal/schema.d.ts +2 -0
- package/dist/types/cli/commands/portal/tag.d.ts +2 -0
- package/dist/types/cli/commands/portal/upload.d.ts +2 -0
- package/dist/types/cli/main.d.ts +21 -0
- package/dist/types/cli/options/auth.d.ts +37 -0
- package/dist/types/cli/options/env.d.ts +19 -0
- package/dist/types/lib/app/app-config.d.ts +31 -0
- package/dist/types/lib/app/app-manifest.d.ts +39 -0
- package/dist/types/lib/{app-package.d.ts → app/app-package.d.ts} +27 -10
- package/dist/types/lib/app/create-app-manifest.d.ts +17 -0
- package/dist/types/lib/app/index.d.ts +8 -0
- package/dist/types/lib/app/load-app-config.d.ts +54 -0
- package/dist/types/lib/app/load-app-manifest.d.ts +57 -0
- package/dist/types/lib/app/merge-app-config.d.ts +13 -0
- package/dist/types/lib/app/merge-app-manifest.d.ts +25 -0
- package/dist/types/{schemas.d.ts → lib/app/schemas.d.ts} +10 -1
- package/dist/types/lib/dev-server.d.ts +2 -0
- package/dist/types/lib/framework.node.d.ts +77 -0
- package/dist/types/lib/index.d.ts +4 -3
- package/dist/types/lib/legacy.d.ts +24 -0
- package/dist/types/lib/load-dev-server-config.d.ts +40 -0
- package/dist/types/lib/merge-dev-server-config.d.ts +16 -0
- package/dist/types/lib/portal/create-portal-manifest.d.ts +22 -0
- package/dist/types/lib/portal/index.d.ts +2 -0
- package/dist/types/lib/portal/load-portal-manifest.d.ts +65 -0
- package/dist/types/lib/portal/load-portal-schema.d.ts +43 -0
- package/dist/types/lib/portal/portal-manifest.d.ts +16 -0
- package/dist/types/lib/portal/portal-manifest.schema.d.ts +154 -0
- package/dist/types/lib/static.d.ts +10 -0
- package/dist/types/lib/types.d.ts +34 -0
- package/dist/types/lib/utils/assert.d.ts +48 -0
- package/dist/types/lib/utils/index.d.ts +5 -0
- package/dist/types/lib/utils/resolve-annotations.d.ts +11 -0
- package/dist/types/lib/utils/resolve-devops-annotations.d.ts +30 -0
- package/dist/types/lib/utils/resolve-git-commit-sha.d.ts +13 -0
- package/dist/types/lib/utils/resolve-git-remote-url.d.ts +13 -0
- package/dist/types/lib/utils/resolve-github-annotations.d.ts +65 -0
- package/dist/types/lib/utils/resolve-package-repo.d.ts +9 -0
- package/dist/types/lib/utils/resolve-package.d.ts +15 -0
- package/dist/types/lib/utils/resolve-source-entry-point.d.ts +17 -0
- package/dist/types/lib/utils/types.d.ts +1 -1
- package/dist/types/lib/utils/write-file.d.ts +14 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +47 -68
- package/dist/bin/build-application.js +0 -55
- package/dist/bin/build-application.js.map +0 -1
- package/dist/bin/bundle-application.js +0 -41
- package/dist/bin/bundle-application.js.map +0 -1
- package/dist/bin/create-dev-serve.js +0 -127
- package/dist/bin/create-dev-serve.js.map +0 -1
- package/dist/bin/create-export-config.js +0 -40
- package/dist/bin/create-export-config.js.map +0 -1
- package/dist/bin/create-export-manifest.js +0 -67
- package/dist/bin/create-export-manifest.js.map +0 -1
- package/dist/bin/dev-portal/AppLoader.js +0 -80
- package/dist/bin/dev-portal/AppLoader.js.map +0 -1
- package/dist/bin/dev-portal/BookMarkSideSheet.js +0 -13
- package/dist/bin/dev-portal/BookMarkSideSheet.js.map +0 -1
- package/dist/bin/dev-portal/ContextSelector/ContextSelector.js +0 -40
- package/dist/bin/dev-portal/ContextSelector/ContextSelector.js.map +0 -1
- package/dist/bin/dev-portal/ContextSelector/index.js +0 -2
- package/dist/bin/dev-portal/ContextSelector/index.js.map +0 -1
- package/dist/bin/dev-portal/ContextSelector/useContextResolver.js +0 -216
- package/dist/bin/dev-portal/ContextSelector/useContextResolver.js.map +0 -1
- package/dist/bin/dev-portal/EquinorLoader.js +0 -14
- package/dist/bin/dev-portal/EquinorLoader.js.map +0 -1
- package/dist/bin/dev-portal/ErrorViewer.js +0 -7
- package/dist/bin/dev-portal/ErrorViewer.js.map +0 -1
- package/dist/bin/dev-portal/FusionLogo.js +0 -4
- package/dist/bin/dev-portal/FusionLogo.js.map +0 -1
- package/dist/bin/dev-portal/Header.Actions.js +0 -12
- package/dist/bin/dev-portal/Header.Actions.js.map +0 -1
- package/dist/bin/dev-portal/Header.js +0 -41
- package/dist/bin/dev-portal/Header.js.map +0 -1
- package/dist/bin/dev-portal/PersonSideSheet/index.js +0 -32
- package/dist/bin/dev-portal/PersonSideSheet/index.js.map +0 -1
- package/dist/bin/dev-portal/PersonSideSheet/sheets/FeatureSheetContent.js +0 -16
- package/dist/bin/dev-portal/PersonSideSheet/sheets/FeatureSheetContent.js.map +0 -1
- package/dist/bin/dev-portal/PersonSideSheet/sheets/FeatureTogglerApp.js +0 -15
- package/dist/bin/dev-portal/PersonSideSheet/sheets/FeatureTogglerApp.js.map +0 -1
- package/dist/bin/dev-portal/PersonSideSheet/sheets/FeatureTogglerPortal.js +0 -13
- package/dist/bin/dev-portal/PersonSideSheet/sheets/FeatureTogglerPortal.js.map +0 -1
- package/dist/bin/dev-portal/PersonSideSheet/sheets/LandingSheetContent.js +0 -19
- package/dist/bin/dev-portal/PersonSideSheet/sheets/LandingSheetContent.js.map +0 -1
- package/dist/bin/dev-portal/PersonSideSheet/sheets/Styled.js +0 -30
- package/dist/bin/dev-portal/PersonSideSheet/sheets/Styled.js.map +0 -1
- package/dist/bin/dev-portal/PersonSideSheet/sheets/index.js +0 -3
- package/dist/bin/dev-portal/PersonSideSheet/sheets/index.js.map +0 -1
- package/dist/bin/dev-portal/PersonSideSheet/sheets/types.js.map +0 -1
- package/dist/bin/dev-portal/Router.js +0 -59
- package/dist/bin/dev-portal/Router.js.map +0 -1
- package/dist/bin/dev-portal/config.js +0 -79
- package/dist/bin/dev-portal/config.js.map +0 -1
- package/dist/bin/dev-portal/main.js +0 -13
- package/dist/bin/dev-portal/main.js.map +0 -1
- package/dist/bin/dev-portal/resources/fallback-photo.svg.js +0 -3
- package/dist/bin/dev-portal/resources/fallback-photo.svg.js.map +0 -1
- package/dist/bin/dev-portal/useAppContextNavigation.js +0 -87
- package/dist/bin/dev-portal/useAppContextNavigation.js.map +0 -1
- package/dist/bin/main.app.js +0 -172
- package/dist/bin/main.app.js.map +0 -1
- package/dist/bin/main.js +0 -20
- package/dist/bin/main.js.map +0 -1
- package/dist/bin/public/assets/index-Cyqq53lr.js +0 -3686
- package/dist/bin/public/index.html +0 -37
- package/dist/bin/publish-application.js +0 -96
- package/dist/bin/publish-application.js.map +0 -1
- package/dist/bin/tag-application.js +0 -73
- package/dist/bin/tag-application.js.map +0 -1
- package/dist/bin/upload-application.js +0 -63
- package/dist/bin/upload-application.js.map +0 -1
- package/dist/bin/upload-export-config.js +0 -78
- package/dist/bin/upload-export-config.js.map +0 -1
- package/dist/bin/utils/execute-command.js +0 -14
- package/dist/bin/utils/execute-command.js.map +0 -1
- package/dist/bin/utils/format.js +0 -16
- package/dist/bin/utils/format.js.map +0 -1
- package/dist/bin/utils/getEndpointUrl.js +0 -40
- package/dist/bin/utils/getEndpointUrl.js.map +0 -1
- package/dist/bin/utils/index.js +0 -14
- package/dist/bin/utils/index.js.map +0 -1
- package/dist/bin/utils/isAppRegistered.js +0 -26
- package/dist/bin/utils/isAppRegistered.js.map +0 -1
- package/dist/bin/utils/load-app-config.js +0 -26
- package/dist/bin/utils/load-app-config.js.map +0 -1
- package/dist/bin/utils/load-manifest.js +0 -31
- package/dist/bin/utils/load-manifest.js.map +0 -1
- package/dist/bin/utils/load-package.js +0 -18
- package/dist/bin/utils/load-package.js.map +0 -1
- package/dist/bin/utils/load-vite-config.js +0 -45
- package/dist/bin/utils/load-vite-config.js.map +0 -1
- package/dist/bin/utils/proxy-request-logger.js +0 -33
- package/dist/bin/utils/proxy-request-logger.js.map +0 -1
- package/dist/bin/utils/publishAppConfig.js +0 -29
- package/dist/bin/utils/publishAppConfig.js.map +0 -1
- package/dist/bin/utils/requireToken.js +0 -9
- package/dist/bin/utils/requireToken.js.map +0 -1
- package/dist/bin/utils/spinner.js +0 -65
- package/dist/bin/utils/spinner.js.map +0 -1
- package/dist/bin/utils/tagAppBundle.js +0 -26
- package/dist/bin/utils/tagAppBundle.js.map +0 -1
- package/dist/bin/utils/uploadAppBundle.js +0 -45
- package/dist/bin/utils/uploadAppBundle.js.map +0 -1
- package/dist/lib/app-config.js +0 -32
- package/dist/lib/app-config.js.map +0 -1
- package/dist/lib/app-manifest.js +0 -142
- package/dist/lib/app-manifest.js.map +0 -1
- package/dist/lib/app-package.js.map +0 -1
- package/dist/lib/index.js +0 -4
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/plugins/app-assets/app-asset-plugin.js +0 -96
- package/dist/lib/plugins/app-assets/app-asset-plugin.js.map +0 -1
- package/dist/lib/plugins/app-assets/emit-asset.js +0 -46
- package/dist/lib/plugins/app-assets/emit-asset.js.map +0 -1
- package/dist/lib/plugins/app-assets/extension-filter-pattern.js.map +0 -1
- package/dist/lib/plugins/app-assets/index.js +0 -4
- package/dist/lib/plugins/app-assets/index.js.map +0 -1
- package/dist/lib/plugins/app-assets/read-asset-content.js +0 -34
- package/dist/lib/plugins/app-assets/read-asset-content.js.map +0 -1
- package/dist/lib/plugins/app-assets/resolve-asset-id.js +0 -54
- package/dist/lib/plugins/app-assets/resolve-asset-id.js.map +0 -1
- package/dist/lib/plugins/app-assets/static.js +0 -15
- package/dist/lib/plugins/app-assets/static.js.map +0 -1
- package/dist/lib/plugins/app-proxy/app-proxy-plugin.js +0 -125
- package/dist/lib/plugins/app-proxy/app-proxy-plugin.js.map +0 -1
- package/dist/lib/plugins/app-proxy/index.js +0 -2
- package/dist/lib/plugins/app-proxy/index.js.map +0 -1
- package/dist/lib/plugins/app-settings/index.js +0 -36
- package/dist/lib/plugins/app-settings/index.js.map +0 -1
- package/dist/lib/plugins/external-public/external-public-plugin.js +0 -101
- package/dist/lib/plugins/external-public/external-public-plugin.js.map +0 -1
- package/dist/lib/plugins/external-public/index.js +0 -2
- package/dist/lib/plugins/external-public/index.js.map +0 -1
- package/dist/lib/plugins/help-proxy/help-proxy-plugin.js +0 -78
- package/dist/lib/plugins/help-proxy/help-proxy-plugin.js.map +0 -1
- package/dist/lib/plugins/help-proxy/index.js +0 -2
- package/dist/lib/plugins/help-proxy/index.js.map +0 -1
- package/dist/lib/utils/assert.js +0 -28
- package/dist/lib/utils/assert.js.map +0 -1
- package/dist/lib/utils/config.js +0 -67
- package/dist/lib/utils/config.js.map +0 -1
- package/dist/lib/utils/expect.js.map +0 -1
- package/dist/lib/utils/file-exists.js.map +0 -1
- package/dist/lib/utils/parse-json-request.js.map +0 -1
- package/dist/lib/utils/ts-transpile.js +0 -45
- package/dist/lib/utils/ts-transpile.js.map +0 -1
- package/dist/lib/vite-config.js +0 -76
- package/dist/lib/vite-config.js.map +0 -1
- package/dist/lib/vite-logger.js +0 -21
- package/dist/lib/vite-logger.js.map +0 -1
- package/dist/schemas.js +0 -14
- package/dist/schemas.js.map +0 -1
- package/dist/types/bin/build-application.d.ts +0 -13
- package/dist/types/bin/bundle-application.d.ts +0 -4
- package/dist/types/bin/create-dev-serve.d.ts +0 -12
- package/dist/types/bin/create-export-config.d.ts +0 -13
- package/dist/types/bin/create-export-manifest.d.ts +0 -16
- package/dist/types/bin/dev-portal/AppLoader.d.ts +0 -11
- package/dist/types/bin/dev-portal/BookMarkSideSheet.d.ts +0 -6
- package/dist/types/bin/dev-portal/ContextSelector/ContextSelector.d.ts +0 -8
- package/dist/types/bin/dev-portal/ContextSelector/index.d.ts +0 -1
- package/dist/types/bin/dev-portal/ContextSelector/useContextResolver.d.ts +0 -15
- package/dist/types/bin/dev-portal/EquinorLoader.d.ts +0 -5
- package/dist/types/bin/dev-portal/ErrorViewer.d.ts +0 -4
- package/dist/types/bin/dev-portal/FusionLogo.d.ts +0 -6
- package/dist/types/bin/dev-portal/Header.Actions.d.ts +0 -7
- package/dist/types/bin/dev-portal/Header.d.ts +0 -2
- package/dist/types/bin/dev-portal/PersonSideSheet/index.d.ts +0 -11
- package/dist/types/bin/dev-portal/PersonSideSheet/sheets/FeatureSheetContent.d.ts +0 -6
- package/dist/types/bin/dev-portal/PersonSideSheet/sheets/FeatureTogglerApp.d.ts +0 -5
- package/dist/types/bin/dev-portal/PersonSideSheet/sheets/FeatureTogglerPortal.d.ts +0 -5
- package/dist/types/bin/dev-portal/PersonSideSheet/sheets/LandingSheetContent.d.ts +0 -5
- package/dist/types/bin/dev-portal/PersonSideSheet/sheets/Styled.d.ts +0 -6
- package/dist/types/bin/dev-portal/PersonSideSheet/sheets/index.d.ts +0 -2
- package/dist/types/bin/dev-portal/PersonSideSheet/sheets/types.d.ts +0 -5
- package/dist/types/bin/dev-portal/Router.d.ts +0 -1
- package/dist/types/bin/dev-portal/config.d.ts +0 -3
- package/dist/types/bin/dev-portal/main.d.ts +0 -1
- package/dist/types/bin/dev-portal/resources/fallback-photo.svg.d.ts +0 -2
- package/dist/types/bin/dev-portal/useAppContextNavigation.d.ts +0 -5
- package/dist/types/bin/main.d.ts +0 -1
- package/dist/types/bin/publish-application.d.ts +0 -6
- package/dist/types/bin/tag-application.d.ts +0 -12
- package/dist/types/bin/upload-application.d.ts +0 -6
- package/dist/types/bin/upload-export-config.d.ts +0 -10
- package/dist/types/bin/utils/execute-command.d.ts +0 -8
- package/dist/types/bin/utils/getEndpointUrl.d.ts +0 -10
- package/dist/types/bin/utils/isAppRegistered.d.ts +0 -5
- package/dist/types/bin/utils/load-app-config.d.ts +0 -10
- package/dist/types/bin/utils/load-manifest.d.ts +0 -10
- package/dist/types/bin/utils/load-package.d.ts +0 -5
- package/dist/types/bin/utils/load-vite-config.d.ts +0 -10
- package/dist/types/bin/utils/proxy-request-logger.d.ts +0 -15
- package/dist/types/bin/utils/publishAppConfig.d.ts +0 -9
- package/dist/types/bin/utils/requireToken.d.ts +0 -4
- package/dist/types/bin/utils/tagAppBundle.d.ts +0 -7
- package/dist/types/bin/utils/uploadAppBundle.d.ts +0 -7
- package/dist/types/lib/app-config.d.ts +0 -27
- package/dist/types/lib/app-manifest.d.ts +0 -52
- package/dist/types/lib/plugins/app-assets/app-asset-plugin.d.ts +0 -36
- package/dist/types/lib/plugins/app-assets/emit-asset.d.ts +0 -18
- package/dist/types/lib/plugins/app-assets/index.d.ts +0 -3
- package/dist/types/lib/plugins/app-assets/read-asset-content.d.ts +0 -14
- package/dist/types/lib/plugins/app-assets/resolve-asset-id.d.ts +0 -16
- package/dist/types/lib/plugins/app-assets/static.d.ts +0 -5
- package/dist/types/lib/plugins/app-proxy/app-proxy-plugin.d.ts +0 -89
- package/dist/types/lib/plugins/app-proxy/index.d.ts +0 -1
- package/dist/types/lib/plugins/app-settings/index.d.ts +0 -32
- package/dist/types/lib/plugins/external-public/external-public-plugin.d.ts +0 -30
- package/dist/types/lib/plugins/external-public/index.d.ts +0 -1
- package/dist/types/lib/plugins/help-proxy/help-proxy-plugin.d.ts +0 -42
- package/dist/types/lib/plugins/help-proxy/index.d.ts +0 -1
- package/dist/types/lib/utils/config.d.ts +0 -32
- package/dist/types/lib/utils/ts-transpile.d.ts +0 -2
- package/dist/types/lib/vite-config.d.ts +0 -17
- package/dist/types/lib/vite-logger.d.ts +0 -2
- package/dist/version.js +0 -3
- package/dist/version.js.map +0 -1
- /package/dist/{bin/dev-portal/PersonSideSheet/sheets → esm/lib}/types.js +0 -0
- /package/dist/{lib → esm/lib}/utils/expect.js +0 -0
- /package/dist/{lib → esm/lib}/utils/file-exists.js +0 -0
- /package/dist/{lib → esm/lib}/utils/types.js +0 -0
- /package/dist/types/{bin/main.app.d.ts → cli/commands/index.d.ts} +0 -0
- /package/dist/types/lib/{plugins/app-assets/extension-filter-pattern.d.ts → utils/extension-filter.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,49 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 11.0.0-next.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#3074](https://github.com/equinor/fusion-framework/pull/3074) [`6b034e5`](https://github.com/equinor/fusion-framework/commit/6b034e5459094cea0c0f2490335eef3092390a13) Thanks [@odinr](https://github.com/odinr)! - The CLI has been rewritten to use Fusion Framework internally to minimize dependencies and improve performance. This change allows the CLI to be more efficient and maintainable. It also means that the CLI is now a first-class citizen in the Fusion Framework ecosystem, providing a more consistent and integrated experience.
|
|
8
|
+
|
|
9
|
+
The dev portal has been moved out to a separate package `@equinor/fusion-framework-dev-server`. This separation allows for a more modular architecture, enabling developers to use the dev portal independently of the CLI. It also facilitates easier updates and maintenance of the dev portal without affecting the CLI functionality. It also allows for 3rd party developers to create their own dev portals using the Fusion Framework. Also, moving the dev portal to a separate package allows for better versioning and dependency management, ensuring that developers can always use the latest features and improvements without being tied to the CLI release cycle.
|
|
10
|
+
|
|
11
|
+
The dev portal can be configured using the `dev-server.config.js` file, which allows developers to customize the behavior and appearance of the dev portal. This configuration file provides flexibility in how the dev portal operates, enabling developers to tailor it to their specific needs and preferences. **this is currently not documented, but will be in the future**
|
|
12
|
+
|
|
13
|
+
Since the dev portal uses the plugin `@equinor/fusion-framework-vite-plugin-spa`, it is possible to specify a live portal to preview the application in the dev portal. This feature allows developers to see their changes in real-time, enhancing the development experience and speeding up the feedback loop. It is particularly useful for testing and debugging applications during development.
|
|
14
|
+
|
|
15
|
+
The dev portal also supports mocking API services, which allows developers to simulate backend services without needing a live server. This feature is particularly useful for testing and development, as it enables developers to work on the frontend independently of the backend, ensuring a smoother development process. **this is currently not documented, but will be in the future**
|
|
16
|
+
|
|
17
|
+
The dev portal is a key component of the Fusion Framework ecosystem, providing a user-friendly interface for developers to interact with their applications. It allows developers to easily manage and test their applications, providing a streamlined development experience.
|
|
18
|
+
|
|
19
|
+
The Dev Portal uses by default the `@equinor/fusion-framework-dev-portal` package, which is the official dev portal package provided by Fusion which is developer-friendly portal for developing and testing Fusion Framework applications. But it is possible to specify any package as a dev portal, allowing for customization of the development experience. This flexibility enables developers to create their own dev portals or use third-party solutions that better fit their needs.
|
|
20
|
+
|
|
21
|
+
The CLI now supports the `fusion-framework-cli auth login` command for authentication, which is a more secure and user-friendly way to manage access to Fusion Framework applications. This command simplifies the authentication process, making it easier for developers to log in and start working on their applications without needing to manually set environment variables or manage tokens. _`FUSION_TOKEN`_ is still supported for CI/CD and automation, but the CLI now provides a more streamlined and intuitive way to handle authentication.
|
|
22
|
+
|
|
23
|
+
The CLI has now been divided into three main groups:
|
|
24
|
+
|
|
25
|
+
- **bin**: This namespace contains executable functions that can be executed from node scripts, handy for automation and scripting or creating a custom CLI.
|
|
26
|
+
- **commands**: This namespace contains commands that can be executed from the CLI, providing a user-friendly interface for developers to interact with the Fusion Framework.
|
|
27
|
+
- **lib**: This namespace is reserved for consumers of the CLI, like defining configuration files, exposing interfaces, and other utilities that can be used in custom scripts or applications. This separation allows for better organization and modularity of the CLI codebase, making it easier to maintain and extend.
|
|
28
|
+
|
|
29
|
+
**BREAKING CHANGES:**
|
|
30
|
+
|
|
31
|
+
the `--service` flag has been removed since the CLI now uses the Fusion Framework internally, which does not require this flag, but uses service discovery to resolve endpoints automatically according to provided Fusion environment variables. This change simplifies the CLI usage and aligns it more closely with the Fusion Framework's architecture, allowing for a more seamless integration and improved developer experience.
|
|
32
|
+
|
|
33
|
+
All `app -build-???` has alias to correct commands, but been flagged as deprecated and will be removed in the next major version.
|
|
34
|
+
|
|
35
|
+
### Minor Changes
|
|
36
|
+
|
|
37
|
+
- [#3074](https://github.com/equinor/fusion-framework/pull/3074) [`6b034e5`](https://github.com/equinor/fusion-framework/commit/6b034e5459094cea0c0f2490335eef3092390a13) Thanks [@odinr](https://github.com/odinr)! - Added CLI, bin and lib functionality to the Fusion Framework CLI for portal development and management.
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- [#3074](https://github.com/equinor/fusion-framework/pull/3074) [`6b034e5`](https://github.com/equinor/fusion-framework/commit/6b034e5459094cea0c0f2490335eef3092390a13) Thanks [@odinr](https://github.com/odinr)! - update Vite to 6.3.5
|
|
42
|
+
|
|
43
|
+
- Updated dependencies [[`6b034e5`](https://github.com/equinor/fusion-framework/commit/6b034e5459094cea0c0f2490335eef3092390a13), [`6b034e5`](https://github.com/equinor/fusion-framework/commit/6b034e5459094cea0c0f2490335eef3092390a13), [`6b034e5`](https://github.com/equinor/fusion-framework/commit/6b034e5459094cea0c0f2490335eef3092390a13), [`6b034e5`](https://github.com/equinor/fusion-framework/commit/6b034e5459094cea0c0f2490335eef3092390a13)]:
|
|
44
|
+
- @equinor/fusion-framework-dev-server@1.0.0-next.0
|
|
45
|
+
- @equinor/fusion-framework-dev-portal@1.0.0-next.0
|
|
46
|
+
|
|
3
47
|
## 10.7.4
|
|
4
48
|
|
|
5
49
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,42 +1,169 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Fusion Framework CLI
|
|
3
|
+
description: >
|
|
4
|
+
Fusion Framework CLI is a powerful tool for developing, building, and publishing applications and portal templates within the Fusion Framework ecosystem. See the documentation for full guides, configuration, and advanced usage.
|
|
5
|
+
tags:
|
|
6
|
+
- fusion-framework
|
|
7
|
+
- cli
|
|
8
|
+
- app-development
|
|
9
|
+
- portal-development
|
|
10
|
+
- dev-server
|
|
11
|
+
- ci-cd
|
|
12
|
+
- authentication
|
|
13
|
+
- configuration
|
|
14
|
+
- manifest
|
|
15
|
+
- registry
|
|
16
|
+
- publishing
|
|
17
|
+
- service-discovery
|
|
18
|
+
- equinor
|
|
19
|
+
- documentation
|
|
20
|
+
- getting-started
|
|
21
|
+
keywords:
|
|
22
|
+
- fusion framework
|
|
23
|
+
- cli
|
|
24
|
+
- app development
|
|
25
|
+
- portal development
|
|
26
|
+
- dev server
|
|
27
|
+
- authentication
|
|
28
|
+
- ci/cd
|
|
29
|
+
- configuration
|
|
30
|
+
- manifest
|
|
31
|
+
- publishing
|
|
32
|
+
- registry
|
|
33
|
+
- service discovery
|
|
3
34
|
---
|
|
4
35
|
|
|
5
|
-
|
|
36
|
+
# Fusion Framework CLI
|
|
6
37
|
|
|
7
|
-
|
|
38
|
+
[](https://www.npmjs.com/package/@equinor/fusion-framework-cli)
|
|
39
|
+
[](./LICENSE)
|
|
8
40
|
|
|
9
|
-
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Table of Contents
|
|
44
|
+
|
|
45
|
+
- [Fusion Framework CLI](#fusion-framework-cli)
|
|
46
|
+
- [Table of Contents](#table-of-contents)
|
|
47
|
+
- [Overview](#overview)
|
|
48
|
+
- [Features \& Benefits](#features--benefits)
|
|
49
|
+
- [Getting Started](#getting-started)
|
|
50
|
+
- [1. Install the CLI](#1-install-the-cli)
|
|
51
|
+
- [2. Initialize or update your app's manifest and config files](#2-initialize-or-update-your-apps-manifest-and-config-files)
|
|
52
|
+
- [3. Start the development server](#3-start-the-development-server)
|
|
53
|
+
- [4. Log in to the Fusion Framework (if needed)](#4-log-in-to-the-fusion-framework-if-needed)
|
|
54
|
+
- [5. Build and publish your app](#5-build-and-publish-your-app)
|
|
55
|
+
- [6. Upload configuration](#6-upload-configuration)
|
|
56
|
+
- [Common Commands](#common-commands)
|
|
57
|
+
- [Example: package.json](#example-packagejson)
|
|
58
|
+
- [Troubleshooting](#troubleshooting)
|
|
59
|
+
- [Documentation](#documentation)
|
|
60
|
+
- [Contributing](#contributing)
|
|
61
|
+
- [Tooling Roadmap](#tooling-roadmap)
|
|
62
|
+
|
|
63
|
+
## Overview
|
|
64
|
+
|
|
65
|
+
Fusion Framework CLI is a command-line tool for developing, building, and publishing applications and portal templates within the Fusion Framework ecosystem. It streamlines workflows, automates common tasks, and supports modern CI/CD pipelines.
|
|
66
|
+
|
|
67
|
+
## Features & Benefits
|
|
68
|
+
|
|
69
|
+
- **Unified developer experience**: One tool for development, build, and deployment.
|
|
70
|
+
- **Rapid local development**: Hot reload and fast feedback.
|
|
71
|
+
- **Environment-specific configuration**: Manage manifests and configs per environment.
|
|
72
|
+
- **Integrated authentication**: Secure your apps locally and in CI/CD pipelines.
|
|
73
|
+
- **Service discovery**: Built-in support for Fusion services.
|
|
74
|
+
- **Extensible architecture**: Widgets, portals, and more coming soon.
|
|
75
|
+
- **Comprehensive documentation**: Migration guides, app/portal setup, and troubleshooting.
|
|
76
|
+
|
|
77
|
+
## Getting Started
|
|
78
|
+
|
|
79
|
+
### 1. Install the CLI
|
|
10
80
|
|
|
11
81
|
```sh
|
|
12
82
|
pnpm add -D @equinor/fusion-framework-cli
|
|
13
83
|
```
|
|
14
84
|
|
|
15
|
-
|
|
85
|
+
### 2. Initialize or update your app's manifest and config files
|
|
86
|
+
|
|
87
|
+
See [Developing Apps](./docs/application.md) for manual setup and configuration guidance.
|
|
88
|
+
|
|
89
|
+
### 3. Start the development server
|
|
90
|
+
|
|
91
|
+
```sh
|
|
92
|
+
pnpm fusion-framework-cli dev
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### 4. Log in to the Fusion Framework (if needed)
|
|
96
|
+
|
|
97
|
+
```sh
|
|
98
|
+
pnpm fusion-framework-cli auth login
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### 5. Build and publish your app
|
|
102
|
+
|
|
103
|
+
```sh
|
|
104
|
+
pnpm fusion-framework-cli publish --env <environment>
|
|
105
|
+
```
|
|
16
106
|
|
|
17
|
-
|
|
107
|
+
### 6. Upload configuration
|
|
18
108
|
|
|
19
109
|
```sh
|
|
20
|
-
fusion-framework-cli
|
|
110
|
+
pnpm fusion-framework-cli app config --upload --env <environment>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
> **Tip:** For CI/CD and automation, set the `FUSION_TOKEN` environment variable. See [Authentication](./docs/auth.md) for details.
|
|
114
|
+
|
|
115
|
+
## Common Commands
|
|
116
|
+
|
|
117
|
+
| Command | Description |
|
|
118
|
+
| -------------------------------------- | ------------------------------------ |
|
|
119
|
+
| `pnpm fusion-framework-cli dev` | Start local development server |
|
|
120
|
+
| `pnpm fusion-framework-cli auth login` | Authenticate with Fusion |
|
|
121
|
+
| `pnpm fusion-framework-cli app ...` | Working with Fusion applications |
|
|
122
|
+
| `pnpm fusion-framework-cli portal ...` | Working with Fusion portal templates |
|
|
123
|
+
|
|
124
|
+
## Example: package.json
|
|
125
|
+
|
|
126
|
+
A minimal example for a Fusion Framework app:
|
|
127
|
+
|
|
128
|
+
```json
|
|
129
|
+
{
|
|
130
|
+
"name": "@equinor/fusion-framework-app",
|
|
131
|
+
"version": "0.0.0",
|
|
132
|
+
"description": "Fusion Framework App",
|
|
133
|
+
"main": "dist/index.js",
|
|
134
|
+
"files": [
|
|
135
|
+
"path-to-some-file/foo.png"
|
|
136
|
+
]
|
|
137
|
+
}
|
|
21
138
|
```
|
|
22
139
|
|
|
23
|
-
|
|
140
|
+
> **Note:** The `main` field should point to the build output (e.g., `dist/index.js`).
|
|
141
|
+
|
|
142
|
+
## Troubleshooting
|
|
24
143
|
|
|
25
|
-
|
|
144
|
+
If you encounter errors like `libsecret-1.so.0: cannot open shared object file`, it means `libsecret` is missing. see the [libsecret installation guide](./docs/libsecret.md) for instructions on how to install it based on your operating system.
|
|
26
145
|
|
|
27
|
-
|
|
146
|
+
- **Command not found?** Ensure your `node_modules/.bin` is in your PATH or use `pnpm`/`npx`.
|
|
147
|
+
- **Authentication issues?** See [Authentication](./docs/auth.md) for troubleshooting tokens and login.
|
|
148
|
+
- **Build errors?** Check your app's manifest and config files for typos or missing fields.
|
|
149
|
+
- **Need help?** Open an issue or see the [docs folder](./docs/).
|
|
28
150
|
|
|
29
|
-
|
|
151
|
+
## Documentation
|
|
30
152
|
|
|
31
|
-
|
|
153
|
+
- [Migration Guide: v10 to v11](./docs/migration-v10-to-v11.md): Learn about breaking changes and how to upgrade.
|
|
154
|
+
- [Developing Apps](./docs/application.md): Step-by-step guide to building and configuring apps.
|
|
155
|
+
- [Developing Portals](./docs/portal.md): Guide to building, configuring, and publishing portal templates.
|
|
156
|
+
- [Authentication](./docs/auth.md): Setting up authentication for local and CI/CD environments.
|
|
157
|
+
- For more guides and advanced topics, see the [docs folder](./docs/).
|
|
32
158
|
|
|
33
|
-
|
|
34
|
-
- tooling for proxy configuration - 🚀 coming soon
|
|
159
|
+
## Contributing
|
|
35
160
|
|
|
36
|
-
|
|
161
|
+
We welcome contributions! See our [contributing guide](../../contributing/development.md) for details on how to get started, coding standards, and submitting pull requests.
|
|
37
162
|
|
|
38
|
-
Tooling
|
|
163
|
+
## Tooling Roadmap
|
|
164
|
+
|
|
165
|
+
- **Vitest integration** (coming soon)
|
|
166
|
+
---
|
|
39
167
|
|
|
40
|
-
|
|
168
|
+
For more information, visit the [docs folder](./docs/) or open an issue for support.
|
|
41
169
|
|
|
42
|
-
Tooling for developing portals - 🚀 coming
|
package/bin/cli.mjs
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
// This file is a placeholder to prevent initial install failure due to a missing package entry file.
|
|
3
|
+
// Importing './build/cli.js' before it exists is valid here, as the build step will generate it.
|
|
4
|
+
// See project documentation for details.
|
|
5
|
+
import('./build/cli.js');
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { build as viteBuild } from 'vite';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { loadViteConfig } from './helpers/load-vite-config.js';
|
|
4
|
+
import loadAppManifest from './app-manifest';
|
|
5
|
+
/**
|
|
6
|
+
* Builds an application using Vite.
|
|
7
|
+
*
|
|
8
|
+
* Loads the application manifest, applies Vite configuration, and runs the Vite build process.
|
|
9
|
+
*
|
|
10
|
+
* @param opt - Build options including environment, manifest path, and logger.
|
|
11
|
+
* @returns Output containing package info, manifest, and output directory.
|
|
12
|
+
* @throws Will throw if the build process fails.
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export const buildApplication = async (opt) => {
|
|
16
|
+
const { log } = opt ?? {};
|
|
17
|
+
log?.log(chalk.bold('Starting to build application'));
|
|
18
|
+
// Load application manifest, package info, and environment variables
|
|
19
|
+
const { manifest, pkg, env } = await loadAppManifest({ log, manifest: opt?.manifest });
|
|
20
|
+
log?.start('loading vite config...');
|
|
21
|
+
// Load local Vite configuration for the build
|
|
22
|
+
const viteConfig = await loadViteConfig(env, pkg);
|
|
23
|
+
log?.succeed('vite config applied');
|
|
24
|
+
log?.debug('vite config:', viteConfig);
|
|
25
|
+
log?.start('🤞🏻', 'building application...');
|
|
26
|
+
log?.startNativeConsoleCapture();
|
|
27
|
+
await viteBuild(viteConfig);
|
|
28
|
+
log?.stopNativeConsoleCapture();
|
|
29
|
+
log?.succeed('build completed 😘');
|
|
30
|
+
// Output directory for the built application
|
|
31
|
+
const outDir = viteConfig.build.outDir;
|
|
32
|
+
return { pkg, manifest, outDir };
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=app-build.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-build.js","sourceRoot":"","sources":["../../../src/bin/app-build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAE1C,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,eAAe,MAAM,gBAAgB,CAAC;AAwC7C;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,EACnC,GAA6B,EACI,EAAE;IACnC,MAAM,EAAE,GAAG,EAAE,GAAG,GAAG,IAAI,EAAE,CAAC;IAE1B,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC,CAAC;IAEtD,qEAAqE;IACrE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,MAAM,eAAe,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IAEvF,GAAG,EAAE,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACrC,8CAA8C;IAC9C,MAAM,UAAU,GAAG,MAAM,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAClD,GAAG,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACpC,GAAG,EAAE,KAAK,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;IAEvC,GAAG,EAAE,KAAK,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAC;IAC9C,GAAG,EAAE,yBAAyB,EAAE,CAAC;IACjC,MAAM,SAAS,CAAC,UAAU,CAAC,CAAC;IAC5B,GAAG,EAAE,wBAAwB,EAAE,CAAC;IAChC,GAAG,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAEnC,6CAA6C;IAC7C,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC;IAEvC,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AACnC,CAAC,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { initializeFramework, } from '../lib/framework.node.js';
|
|
2
|
+
import { resolveProjectPackage } from './helpers/resolve-project-package.js';
|
|
3
|
+
import { resolveAppManifest } from './helpers/resolve-app-manifest.js';
|
|
4
|
+
/**
|
|
5
|
+
* Checks if the application is registered in the app store.
|
|
6
|
+
*
|
|
7
|
+
* Resolves the app package and manifest, initializes the Fusion Framework, and queries the app store.
|
|
8
|
+
*
|
|
9
|
+
* @param options - Options for environment, authentication, and logging.
|
|
10
|
+
* @returns A promise that resolves when the check is complete.
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
export const checkApp = async (options) => {
|
|
14
|
+
const { log } = options;
|
|
15
|
+
// Resolve the application's package.json for metadata and dependencies
|
|
16
|
+
const pkg = await resolveProjectPackage(log);
|
|
17
|
+
// Resolve the application manifest for the build/production mode
|
|
18
|
+
// Manifest contains the appKey and other app metadata
|
|
19
|
+
const manifest = await resolveAppManifest({ command: 'build', mode: 'production' }, pkg, {
|
|
20
|
+
log,
|
|
21
|
+
});
|
|
22
|
+
log?.start('Initializing Fusion Framework...');
|
|
23
|
+
// Initialize the Fusion Framework with the provided environment and authentication
|
|
24
|
+
// If the auth object contains a token, use it; otherwise, use the provided auth config
|
|
25
|
+
const framework = await initializeFramework({
|
|
26
|
+
env: options.environment,
|
|
27
|
+
auth: 'token' in options.auth ? { token: options.auth.token } : options.auth,
|
|
28
|
+
});
|
|
29
|
+
log?.succeed('Initialized Fusion Framework');
|
|
30
|
+
// Create a client for the 'apps' service using service discovery
|
|
31
|
+
const appClient = await framework.serviceDiscovery.createClient('apps');
|
|
32
|
+
// Subscribe to outgoing requests for logging and debugging
|
|
33
|
+
appClient.request$.subscribe((request) => {
|
|
34
|
+
log?.info('🌎', 'Executing request to:', request.uri);
|
|
35
|
+
log?.debug('Request:', request);
|
|
36
|
+
});
|
|
37
|
+
try {
|
|
38
|
+
// Start the check for app registration in the app store
|
|
39
|
+
log?.start(`Checking if ${manifest.appKey} is registered in app store`);
|
|
40
|
+
// Send a HEAD request to check if the app is registered
|
|
41
|
+
const response = await appClient.fetch(`/apps/${manifest.appKey}`, {
|
|
42
|
+
method: 'HEAD',
|
|
43
|
+
});
|
|
44
|
+
// If the response is OK, the app is registered
|
|
45
|
+
if (response.ok) {
|
|
46
|
+
return log?.succeed('😃', `Application ${manifest.appKey} is registered in app store`);
|
|
47
|
+
}
|
|
48
|
+
// If the response is 404, the app is not registered
|
|
49
|
+
if (response.status === 404) {
|
|
50
|
+
return log?.fail('😞', `Application ${manifest.appKey} is not registered in app store`);
|
|
51
|
+
}
|
|
52
|
+
// Any other status is unexpected and should be handled as an error
|
|
53
|
+
throw new Error(`Unexpected response status: ${response.status}`);
|
|
54
|
+
}
|
|
55
|
+
catch (err) {
|
|
56
|
+
// Log and handle errors during the registration check
|
|
57
|
+
log?.fail('🙅♂️', 'Error checking application registration');
|
|
58
|
+
log?.error('Error checking application registration:', err);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
// Export as default for compatibility with import patterns
|
|
62
|
+
export default checkApp;
|
|
63
|
+
//# sourceMappingURL=app-check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-check.js","sourceRoot":"","sources":["../../../src/bin/app-check.ts"],"names":[],"mappings":"AAEA,OAAO,EAC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U,EAAE,OAAO,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC;QACH,wDAAwD;QACxD,GAAG,EAAE,KAAK,CAAC,eAAe,QAAQ,CAAC,MAAM,6BAA6B,CAAC,CAAC;QACxE,wDAAwD;QACxD,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,KAAK,CAAC,SAAS,QAAQ,CAAC,MAAM,EAAE,EAAE;YACjE,MAAM,EAAE,MAAM;SACf,CAAC,CAAC;QACH,+CAA+C;QAC/C,IAAI,QAAQ,CAAC,EAAE,EAAE,CAAC;YAChB,OAAO,GAAG,EAAE,OAAO,CAAC,IAAI,EAAE,eAAe,QAAQ,CAAC,MAAM,6BAA6B,CAAC,CAAC;QACzF,CAAC;QACD,oDAAoD;QACpD,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YAC5B,OAAO,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,eAAe,QAAQ,CAAC,MAAM,iCAAiC,CAAC,CAAC;QAC1F,CAAC;QACD,mEAAmE;QACnE,MAAM,IAAI,KAAK,CAAC,+BAA+B,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IACpE,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,sDAAsD;QACtD,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,yCAAyC,CAAC,CAAC;QAC9D,GAAG,EAAE,KAAK,CAAC,0CAA0C,EAAE,GAAG,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC,CAAC;AAEF,2DAA2D;AAC3D,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { HttpJsonResponseError } from '@equinor/fusion-framework-module-http/errors';
|
|
2
|
+
import { initializeFramework, } from '../lib/framework.node.js';
|
|
3
|
+
import { formatPath, chalk } from './utils';
|
|
4
|
+
import { generateApplicationConfig } from './app-config.js';
|
|
5
|
+
import { loadAppManifest } from './app-manifest.js';
|
|
6
|
+
/**
|
|
7
|
+
* Publishes the application configuration to the app store for a specific build version.
|
|
8
|
+
*
|
|
9
|
+
* This function generates the application config, loads the manifest, initializes the Fusion Framework,
|
|
10
|
+
* and sends the config to the app service. Handles and logs errors for common failure scenarios.
|
|
11
|
+
*
|
|
12
|
+
* @param options - Options for config, manifest, environment, authentication, and logging.
|
|
13
|
+
* @returns A promise that resolves when publishing is complete.
|
|
14
|
+
* @throws If the build version is missing or publishing fails.
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
export const publishAppConfig = async (options) => {
|
|
18
|
+
const { log } = options;
|
|
19
|
+
// Generate the application config using provided options and environment
|
|
20
|
+
const { config: appConfig } = await generateApplicationConfig({
|
|
21
|
+
log,
|
|
22
|
+
config: options.config,
|
|
23
|
+
env: { environment: options.environment },
|
|
24
|
+
});
|
|
25
|
+
// Load the application manifest for the specified environment
|
|
26
|
+
const { manifest: appManifest } = await loadAppManifest({
|
|
27
|
+
log,
|
|
28
|
+
manifest: options.manifest,
|
|
29
|
+
env: { environment: options.environment },
|
|
30
|
+
});
|
|
31
|
+
// Extract the build version from the manifest
|
|
32
|
+
const appVersion = appManifest.build?.version;
|
|
33
|
+
if (!appVersion) {
|
|
34
|
+
// Fail if no build version is found in the manifest
|
|
35
|
+
const error = new Error('No build version found in the manifest. Please make sure the manifest is valid.');
|
|
36
|
+
log?.fail('🤪', error.message);
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
39
|
+
log?.start('Initializing Fusion Framework...');
|
|
40
|
+
// Initialize the Fusion Framework with the provided environment and authentication
|
|
41
|
+
const framework = await initializeFramework({
|
|
42
|
+
env: options.environment,
|
|
43
|
+
auth: options.auth,
|
|
44
|
+
});
|
|
45
|
+
log?.succeed('Initialized Fusion Framework');
|
|
46
|
+
// Create a client for the 'apps' service
|
|
47
|
+
const appClient = await framework.serviceDiscovery.createClient('apps');
|
|
48
|
+
// Subscribe to outgoing requests for logging and debugging
|
|
49
|
+
appClient.request$.subscribe((request) => {
|
|
50
|
+
log?.debug('Request:', request);
|
|
51
|
+
log?.info('🌎', 'Executing request to:', formatPath(request.uri));
|
|
52
|
+
});
|
|
53
|
+
log?.start('Publishing application config');
|
|
54
|
+
log?.info('Using environment:', chalk.redBright(options.environment));
|
|
55
|
+
try {
|
|
56
|
+
// Send a PUT request to publish the app config for the specific build version
|
|
57
|
+
const response = await appClient.json(`/apps/${appManifest.appKey}/builds/${appVersion}/config`, {
|
|
58
|
+
method: 'PUT',
|
|
59
|
+
body: appConfig,
|
|
60
|
+
});
|
|
61
|
+
log?.debug('Response:', response);
|
|
62
|
+
log?.succeed('Published application config');
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
// Handle known HTTP errors with specific log messages
|
|
66
|
+
if (error instanceof HttpJsonResponseError) {
|
|
67
|
+
switch (error.response.status) {
|
|
68
|
+
case 410:
|
|
69
|
+
log?.fail('🤬', `App ${appManifest.appKey} is deleted from apps-service. Please check the app key and try again.`);
|
|
70
|
+
break;
|
|
71
|
+
case 404:
|
|
72
|
+
log?.fail('🤬', `App ${appManifest.appKey} not found. Please check the app key and try again.`);
|
|
73
|
+
break;
|
|
74
|
+
case 403:
|
|
75
|
+
case 401:
|
|
76
|
+
log?.fail('🤬', 'You are not authorized to publish application config. Please check your permissions.');
|
|
77
|
+
break;
|
|
78
|
+
default:
|
|
79
|
+
log?.fail('🤬', 'Failed to publish application config.', `Status code: ${error.response.status}`, `Message: ${error.response.statusText}`);
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
// Rethrow error for upstream handling
|
|
84
|
+
throw error;
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
// Export as default for compatibility with import patterns
|
|
88
|
+
export default publishAppConfig;
|
|
89
|
+
//# sourceMappingURL=app-config-publish.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-config-publish.js","sourceRoot":"","sources":["../../../src/bin/app-config-publish.ts"],"names":[],"mappings":"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AAM,wEAAwE,CAClG,CAAC;oBACF,MAAM;gBACR,KAAK,GAAG;oBACN,GAAG,EAAE,IAAI,CACP,IAAI,EACJ,OAAO,WAAW,CAAC,MAAM,qDAAqD,CAC/E,CAAC;oBACF,MAAM;gBACR,KAAK,GAAG,CAAC;gBACT,KAAK,GAAG;oBACN,GAAG,EAAE,IAAI,CACP,IAAI,EACJ,sFAAsF,CACvF,CAAC;oBACF,MAAM;gBACR;oBACE,GAAG,EAAE,IAAI,CACP,IAAI,EACJ,uCAAuC,EACvC,gBAAgB,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,EACvC,YAAY,KAAK,CAAC,QAAQ,CAAC,UAAU,EAAE,CACxC,CAAC;oBACF,MAAM;YACV,CAAC;QACH,CAAC;QACD,sCAAsC;QACtC,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAEF,2DAA2D;AAC3D,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { writeFile } from '../lib/utils';
|
|
2
|
+
import { formatPath } from './utils';
|
|
3
|
+
import { resolveProjectPackage } from './helpers/resolve-project-package.js';
|
|
4
|
+
import { resolveAppConfig } from './helpers/resolve-app-config.js';
|
|
5
|
+
/**
|
|
6
|
+
* Generates the application configuration object for the current project.
|
|
7
|
+
*
|
|
8
|
+
* This function resolves the app package, sets up the runtime environment, resolves the app config,
|
|
9
|
+
* and optionally writes the config to a file if an output path is provided. Logging is supported for
|
|
10
|
+
* debugging and progress tracking.
|
|
11
|
+
*
|
|
12
|
+
* @param options - Optional settings for logger, environment overrides, config path, and output file.
|
|
13
|
+
* @returns An object containing the generated config and the resolved package info.
|
|
14
|
+
* @throws If writing the config to file fails.
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
export const generateApplicationConfig = async (options) => {
|
|
18
|
+
const { log } = options ?? {};
|
|
19
|
+
// Resolve the application's package.json for root and metadata
|
|
20
|
+
const pkg = await resolveProjectPackage(log);
|
|
21
|
+
// Setup the runtime environment for config resolution
|
|
22
|
+
const env = {
|
|
23
|
+
command: 'build',
|
|
24
|
+
mode: process.env.NODE_ENV ?? 'production',
|
|
25
|
+
root: pkg.root,
|
|
26
|
+
...options?.env, // Allow overrides from options
|
|
27
|
+
};
|
|
28
|
+
// Resolve the application config using the environment and config path
|
|
29
|
+
const config = await resolveAppConfig(env, { log, config: options?.config });
|
|
30
|
+
log?.debug('config:', config);
|
|
31
|
+
// If an output path is provided, write the config to file
|
|
32
|
+
if (options?.output) {
|
|
33
|
+
log?.start('writing config to file');
|
|
34
|
+
try {
|
|
35
|
+
// Write the config as pretty-printed JSON
|
|
36
|
+
await writeFile(options.output, JSON.stringify(config, null, 2));
|
|
37
|
+
log?.succeed('config written successfully', formatPath(options.output, { relative: true }));
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
// Log and rethrow errors encountered during file write
|
|
41
|
+
log?.fail('failed to write config');
|
|
42
|
+
throw error;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
// Return the generated config and resolved package info for further use
|
|
46
|
+
return { config, pkg };
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=app-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-config.js","sourceRoot":"","sources":["../../../src/bin/app-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAsB,MAAM,SAAS,CAAC;AAEzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AA8BnE;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,KAAK,EAAE,OAA0C,EAAE,EAAE;IAC5F,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IAC9B,+DAA+D;IAC/D,MAAM,GAAG,GAAG,MAAM,qBAAqB,CAAC,GAAG,CAAC,CAAC;IAE7C,sDAAsD;IACtD,MAAM,GAAG,GAAe;QACtB,OAAO,EAAE,OAAO;QAChB,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,YAAY;QAC1C,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,GAAG,OAAO,EAAE,GAAG,EAAE,+BAA+B;KACjD,CAAC;IAEF,uEAAuE;IACvE,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,GAAG,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IAC7E,GAAG,EAAE,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAE9B,0DAA0D;IAC1D,IAAI,OAAO,EAAE,MAAM,EAAE,CAAC;QACpB,GAAG,EAAE,KAAK,CAAC,wBAAwB,CAAC,CAAC;QACrC,IAAI,CAAC;YACH,0CAA0C;YAC1C,MAAM,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YACjE,GAAG,EAAE,OAAO,CAAC,6BAA6B,EAAE,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC9F,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,uDAAuD;YACvD,GAAG,EAAE,IAAI,CAAC,wBAAwB,CAAC,CAAC;YACpC,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;IAED,wEAAwE;IACxE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;AACzB,CAAC,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { fileURLToPath } from 'node:url';
|
|
2
|
+
import { fileExistsSync } from '../lib/utils/file-exists.js';
|
|
3
|
+
import { resolveAppConfig } from './helpers/resolve-app-config.js';
|
|
4
|
+
import { resolveProjectPackage } from './helpers/resolve-project-package.js';
|
|
5
|
+
import { resolveAppManifest } from './helpers/resolve-app-manifest.js';
|
|
6
|
+
import { createDevServer } from './utils/create-dev-server.js';
|
|
7
|
+
/**
|
|
8
|
+
* Starts the application development server for local development.
|
|
9
|
+
*
|
|
10
|
+
* This function resolves the app package, manifest, and config, sets up the runtime environment,
|
|
11
|
+
* and launches a development server using the resolved configuration. It also attempts to resolve
|
|
12
|
+
* the portal entry point if available, and provides detailed logging for each step.
|
|
13
|
+
*
|
|
14
|
+
* @param options - Settings for environment, manifest path, config path, and logger.
|
|
15
|
+
* @returns A promise that resolves when the dev server has started.
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
export const startAppDevServer = async (options) => {
|
|
19
|
+
const { log } = options ?? {};
|
|
20
|
+
// The portalId is currently hardcoded, but could be made configurable in the future
|
|
21
|
+
const portalId = '@equinor/fusion-framework-dev-portal';
|
|
22
|
+
// Resolve the application's package.json for root and metadata
|
|
23
|
+
const pkg = await resolveProjectPackage(log);
|
|
24
|
+
// Setup the runtime environment for the dev server
|
|
25
|
+
const env = {
|
|
26
|
+
root: pkg.root,
|
|
27
|
+
environment: 'local', // Always use 'local' for dev server
|
|
28
|
+
...options?.env, // Allow overrides from options
|
|
29
|
+
mode: 'development', // Force development mode
|
|
30
|
+
command: 'serve', // Command is always 'serve' for dev
|
|
31
|
+
};
|
|
32
|
+
// Resolve the application manifest using the environment and manifest path
|
|
33
|
+
const appManifest = await resolveAppManifest(env, pkg, {
|
|
34
|
+
log,
|
|
35
|
+
manifestPath: options?.manifest,
|
|
36
|
+
});
|
|
37
|
+
// Resolve the application config using the environment and config path
|
|
38
|
+
const appConfig = await resolveAppConfig(env, { log, config: options?.config });
|
|
39
|
+
// Attempt to resolve the portal entry point if the portal is local
|
|
40
|
+
let portalEntryPoint;
|
|
41
|
+
const portalFilePath = fileURLToPath(import.meta.resolve(portalId));
|
|
42
|
+
if (fileExistsSync(portalFilePath)) {
|
|
43
|
+
// If the portal file exists locally, set the entry point for the dev server
|
|
44
|
+
portalEntryPoint = `/@fs${portalFilePath}`;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
// Otherwise, log that the portal is external and skip entry point resolution
|
|
48
|
+
log?.info(`Portal ${portalId} is external, skipping entry point resolution`);
|
|
49
|
+
}
|
|
50
|
+
log?.start('Starting app development server...');
|
|
51
|
+
// Create the dev server configuration, including portal and app settings
|
|
52
|
+
const devServer = await createDevServer(env, {
|
|
53
|
+
template: {
|
|
54
|
+
portal: {
|
|
55
|
+
id: portalId,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
// If a local portal entry point is found, add it to the config
|
|
59
|
+
...(portalEntryPoint
|
|
60
|
+
? {
|
|
61
|
+
portal: {
|
|
62
|
+
manifest: {
|
|
63
|
+
id: portalId,
|
|
64
|
+
build: {
|
|
65
|
+
entrypoint: portalEntryPoint,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
// @todo - replace with real portal config when available
|
|
69
|
+
config: {},
|
|
70
|
+
},
|
|
71
|
+
}
|
|
72
|
+
: {}),
|
|
73
|
+
app: {
|
|
74
|
+
manifest: appManifest,
|
|
75
|
+
config: appConfig,
|
|
76
|
+
},
|
|
77
|
+
server: {
|
|
78
|
+
port: options?.port || 3000, // Default to port 3000 if not specified
|
|
79
|
+
host: 'localhost', // Use localhost for local development
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
await devServer.listen();
|
|
83
|
+
log?.succeed('App development server started successfully');
|
|
84
|
+
// print the server URL for user convenience with `apps/<appKey>`
|
|
85
|
+
const protocol = devServer.config.server.https ? 'https' : 'http';
|
|
86
|
+
const host = devServer.config.server.host || 'localhost';
|
|
87
|
+
const port = devServer.config.server.port || 5173;
|
|
88
|
+
log?.info(`App development server is running at: ${protocol}://${host}:${port}/apps/${appManifest.appKey}`);
|
|
89
|
+
// Return the dev server instance for further use or testing
|
|
90
|
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AG,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;IAClE,MAAM,IAAI,GAAG,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,IAAI,WAAW,CAAC;IACzD,MAAM,IAAI,GAAG,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC;IAClD,GAAG,EAAE,IAAI,CACP,yCAAyC,QAAQ,MAAM,IAAI,IAAI,IAAI,SAAS,WAAW,CAAC,MAAM,EAAE,CACjG,CAAC;IACF,4DAA4D;IAC5D,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { resolveAppManifest } from './helpers/resolve-app-manifest.js';
|
|
2
|
+
import { resolveProjectPackage } from './helpers/resolve-project-package.js';
|
|
3
|
+
/**
|
|
4
|
+
* Loads and resolves the application manifest based on the provided options.
|
|
5
|
+
*
|
|
6
|
+
* This function resolves the app package, sets up the runtime environment, and loads the manifest.
|
|
7
|
+
* Logging is supported for debugging and progress tracking. Returns the manifest, package, and environment.
|
|
8
|
+
*
|
|
9
|
+
* @param options - The options for resolving the application manifest.
|
|
10
|
+
* @returns An object containing the resolved manifest, package, and runtime environment.
|
|
11
|
+
* @throws Will throw an error if resolving the application package or manifest fails.
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export const loadAppManifest = async (options) => {
|
|
15
|
+
const { log } = options ?? {};
|
|
16
|
+
// Resolve the application's package.json for root and metadata
|
|
17
|
+
const pkg = await resolveProjectPackage(log);
|
|
18
|
+
log?.debug('package', pkg);
|
|
19
|
+
// Setup the runtime environment for manifest resolution
|
|
20
|
+
const env = {
|
|
21
|
+
command: 'build',
|
|
22
|
+
mode: process.env.NODE_ENV ?? 'production',
|
|
23
|
+
root: pkg.root,
|
|
24
|
+
...options?.env, // Allow overrides from options
|
|
25
|
+
};
|
|
26
|
+
log?.debug('env:', env);
|
|
27
|
+
// Resolve the application manifest using the environment and manifest path
|
|
28
|
+
const manifest = await resolveAppManifest(env, pkg, {
|
|
29
|
+
log,
|
|
30
|
+
manifestPath: options?.manifest,
|
|
31
|
+
});
|
|
32
|
+
log?.debug('manifest:', manifest);
|
|
33
|
+
// Return the resolved manifest, package, and environment for further use
|
|
34
|
+
return { manifest, pkg, env };
|
|
35
|
+
};
|
|
36
|
+
// Export as default for compatibility with import patterns
|
|
37
|
+
export default loadAppManifest;
|
|
38
|
+
//# sourceMappingURL=app-manifest.js.map
|