@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
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { importConfig } from '@equinor/fusion-imports';
|
|
2
|
+
/**
|
|
3
|
+
* Helper to define a portal schema function with type inference.
|
|
4
|
+
* @template T - The type of the portal schema.
|
|
5
|
+
* @param fn - The schema function to define.
|
|
6
|
+
* @returns The provided schema function.
|
|
7
|
+
*/
|
|
8
|
+
export const definePortalSchema = (fn) => fn;
|
|
9
|
+
/**
|
|
10
|
+
* Loads a portal schema from configuration files or schema functions.
|
|
11
|
+
*
|
|
12
|
+
* @template T - The type of the portal schema.
|
|
13
|
+
* @param env - The runtime environment used to resolve the schema.
|
|
14
|
+
* @param options - Optional configuration for file names and extensions.
|
|
15
|
+
* @returns An object containing the loaded schema, file path, and extension.
|
|
16
|
+
*
|
|
17
|
+
* This function attempts to import a schema configuration file or function based on the provided environment and options.
|
|
18
|
+
* It supports both direct schema objects and schema factory functions. The schema is resolved and validated before returning.
|
|
19
|
+
*/
|
|
20
|
+
export const loadPortalSchema = async (env, options) => {
|
|
21
|
+
// Determine possible schema file names based on environment and options
|
|
22
|
+
const suggestions = options?.file ?? [`portal.schema.${env.environment}`, 'portal.schema'];
|
|
23
|
+
// Attempt to import the schema configuration using the importConfig utility
|
|
24
|
+
const importResult = await importConfig(suggestions, {
|
|
25
|
+
baseDir: env.root,
|
|
26
|
+
extensions: options?.extensions,
|
|
27
|
+
script: {
|
|
28
|
+
// Custom resolver to handle both schema objects and schema factory functions
|
|
29
|
+
resolve: async (module) => {
|
|
30
|
+
// If the default export is a function, call it with the environment; otherwise, use the object directly
|
|
31
|
+
const result = typeof module.default === 'function'
|
|
32
|
+
? await Promise.resolve(module.default(env))
|
|
33
|
+
: module.default;
|
|
34
|
+
// Validate that a schema was returned
|
|
35
|
+
if (!result) {
|
|
36
|
+
throw new Error('Schema function did not return a valid schema');
|
|
37
|
+
}
|
|
38
|
+
return result;
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
// Return the loaded schema, along with the file path and extension for reference
|
|
43
|
+
return {
|
|
44
|
+
schema: importResult.config,
|
|
45
|
+
path: importResult.path,
|
|
46
|
+
extension: importResult.extension,
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=load-portal-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-portal-schema.js","sourceRoot":"","sources":["../../../../src/lib/portal/load-portal-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAsBvD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAyB,EAAqB,EAAE,EAAE,CAAC,EAAE,CAAC;AAExF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,EACnC,GAAe,EACf,OAGC,EACD,EAAE;IACF,wEAAwE;IACxE,MAAM,WAAW,GAAG,OAAO,EAAE,IAAI,IAAI,CAAC,iBAAiB,GAAG,CAAC,WAAW,EAAE,EAAE,eAAe,CAAC,CAAC;IAE3F,4EAA4E;IAC5E,MAAM,YAAY,GAAG,MAAM,YAAY,CAAC,WAAW,EAAE;QACnD,OAAO,EAAE,GAAG,CAAC,IAAI;QACjB,UAAU,EAAE,OAAO,EAAE,UAAU;QAC/B,MAAM,EAAE;YACN,6EAA6E;YAC7E,OAAO,EAAE,KAAK,EAAE,MAA0C,EAAc,EAAE;gBACxE,wGAAwG;gBACxG,MAAM,MAAM,GACV,OAAO,MAAM,CAAC,OAAO,KAAK,UAAU;oBAClC,CAAC,CAAC,MAAM,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;oBAC5C,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;gBACrB,sCAAsC;gBACtC,IAAI,CAAC,MAAM,EAAE,CAAC;oBACZ,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;gBACnE,CAAC;gBACD,OAAO,MAAW,CAAC;YACrB,CAAC;SACF;KACF,CAAC,CAAC;IACH,iFAAiF;IACjF,OAAO;QACL,MAAM,EAAE,YAAY,CAAC,MAAW;QAChC,IAAI,EAAE,YAAY,CAAC,IAAI;QACvB,SAAS,EAAE,YAAY,CAAC,SAAS;KAClC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PortalManifestSchema } from './portal-manifest.schema.js';
|
|
2
|
+
// Re-export relevant manifest utilities and types for external use
|
|
3
|
+
export { loadPortalManifest, } from './load-portal-manifest.js';
|
|
4
|
+
export { createPortalManifestFromPackage } from './create-portal-manifest.js';
|
|
5
|
+
// Helper to define a typed portal manifest function
|
|
6
|
+
export const definePortalManifest = (fn) => fn;
|
|
7
|
+
export { PortalManifestSchema, PortalManifestBuildSchema, } from './portal-manifest.schema.js';
|
|
8
|
+
/**
|
|
9
|
+
* Validates a portal manifest object against the PortalManifestSchema.
|
|
10
|
+
*
|
|
11
|
+
* @param manifest - The manifest object to validate.
|
|
12
|
+
* @returns The validated manifest object (typed) if valid.
|
|
13
|
+
* @throws ZodError if validation fails.
|
|
14
|
+
*
|
|
15
|
+
* Use this utility to ensure a manifest conforms to the expected schema before further processing.
|
|
16
|
+
*/
|
|
17
|
+
export function validatePortalManifest(manifest) {
|
|
18
|
+
// Throws if validation fails; returns typed manifest if valid
|
|
19
|
+
return PortalManifestSchema.parse(manifest);
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=portal-manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portal-manifest.js","sourceRoot":"","sources":["../../../../src/lib/portal/portal-manifest.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,mEAAmE;AACnE,OAAO,EACL,kBAAkB,GAGnB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC;AAE9E,oDAAoD;AACpD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAqC,EAAuB,EAAE,EAAE,CAClG,EAAE,CAAC;AAEL,OAAO,EACL,oBAAoB,EACpB,yBAAyB,GAG1B,MAAM,6BAA6B,CAAC;AAErC;;;;;;;;GAQG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAiB;IACtD,8DAA8D;IAC9D,OAAO,oBAAoB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,134 @@
|
|
|
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 const PortalManifestBuildSchema = z.object({
|
|
12
|
+
// Main entry point for the portal (required)
|
|
13
|
+
templateEntry: z
|
|
14
|
+
.string({
|
|
15
|
+
required_error: 'templateEntry is required in build section',
|
|
16
|
+
invalid_type_error: 'templateEntry must be a string',
|
|
17
|
+
})
|
|
18
|
+
.describe('Main entry point for the portal'),
|
|
19
|
+
// Schema file for portal validation (required)
|
|
20
|
+
schemaEntry: z
|
|
21
|
+
.string({
|
|
22
|
+
required_error: 'schemaEntry is required in build section',
|
|
23
|
+
invalid_type_error: 'schemaEntry must be a string',
|
|
24
|
+
})
|
|
25
|
+
.describe('Schema file for portal validation'),
|
|
26
|
+
// Asset path for dev/preview builds (optional)
|
|
27
|
+
assetPath: z
|
|
28
|
+
.string({
|
|
29
|
+
invalid_type_error: 'assetPath must be a string',
|
|
30
|
+
})
|
|
31
|
+
.optional()
|
|
32
|
+
.describe('Asset path for dev/preview builds'),
|
|
33
|
+
// GitHub repo URL or local git remote (optional)
|
|
34
|
+
githubRepo: z
|
|
35
|
+
.string({
|
|
36
|
+
invalid_type_error: 'githubRepo must be a string',
|
|
37
|
+
})
|
|
38
|
+
.optional()
|
|
39
|
+
.describe('GitHub repo URL or local git remote'),
|
|
40
|
+
// Version from package.json (required)
|
|
41
|
+
version: z
|
|
42
|
+
.string({
|
|
43
|
+
required_error: 'version is required in build section',
|
|
44
|
+
invalid_type_error: 'version must be a string',
|
|
45
|
+
})
|
|
46
|
+
.describe('Version from package.json'),
|
|
47
|
+
// Current build timestamp (ISO8601, required)
|
|
48
|
+
timestamp: z
|
|
49
|
+
.string({
|
|
50
|
+
required_error: 'timestamp is required in build section',
|
|
51
|
+
invalid_type_error: 'timestamp must be a string',
|
|
52
|
+
})
|
|
53
|
+
.describe('Current build timestamp (ISO8601)'),
|
|
54
|
+
// Current git commit SHA (required)
|
|
55
|
+
commitSha: z
|
|
56
|
+
.string({
|
|
57
|
+
required_error: 'commitSha is required in build section',
|
|
58
|
+
invalid_type_error: 'commitSha must be a string',
|
|
59
|
+
})
|
|
60
|
+
.describe('Current git commit SHA'),
|
|
61
|
+
// Optional build annotations (key-value pairs)
|
|
62
|
+
annotations: z
|
|
63
|
+
.record(z.string(), {
|
|
64
|
+
invalid_type_error: 'annotations must be a record of string values',
|
|
65
|
+
})
|
|
66
|
+
.optional()
|
|
67
|
+
.describe('Optional build annotations'),
|
|
68
|
+
// Optional project homepage
|
|
69
|
+
projectPage: z
|
|
70
|
+
.string({
|
|
71
|
+
invalid_type_error: 'projectPage must be a string',
|
|
72
|
+
})
|
|
73
|
+
.optional()
|
|
74
|
+
.describe('Optional project homepage'),
|
|
75
|
+
// List of allowed asset extensions (with leading dot, required)
|
|
76
|
+
allowedExtensions: z
|
|
77
|
+
.array(z.string({
|
|
78
|
+
invalid_type_error: 'Each allowed extension must be a string',
|
|
79
|
+
}), {
|
|
80
|
+
required_error: 'allowedExtensions is required in build section',
|
|
81
|
+
invalid_type_error: 'allowedExtensions must be an array of strings',
|
|
82
|
+
})
|
|
83
|
+
.describe('List of allowed asset extensions (with leading dot)'),
|
|
84
|
+
// Optional schema for the portal (record of unknown values)
|
|
85
|
+
schema: z
|
|
86
|
+
.record(z.unknown(), {
|
|
87
|
+
invalid_type_error: 'schema must be a record of unknown values',
|
|
88
|
+
})
|
|
89
|
+
.optional()
|
|
90
|
+
.describe('Optional schema for the portal'),
|
|
91
|
+
// Optional configuration for the portal (record of unknown values)
|
|
92
|
+
config: z
|
|
93
|
+
.record(z.unknown(), {
|
|
94
|
+
invalid_type_error: 'config must be a record of unknown values',
|
|
95
|
+
})
|
|
96
|
+
.optional()
|
|
97
|
+
.describe('Optional configuration for the portal'),
|
|
98
|
+
});
|
|
99
|
+
/**
|
|
100
|
+
* Zod schema for validating the PortalManifest object.
|
|
101
|
+
*
|
|
102
|
+
* This schema defines the structure and types for the portal manifest used in the Fusion Framework CLI.
|
|
103
|
+
* It ensures that the manifest adheres to expected types and provides sensible defaults for build metadata.
|
|
104
|
+
*
|
|
105
|
+
* @remarks
|
|
106
|
+
* - Maintainers: Update this schema if the portal manifest contract changes.
|
|
107
|
+
* - This schema is the canonical source for portal manifest validation and structure.
|
|
108
|
+
*/
|
|
109
|
+
export const PortalManifestSchema = z.object({
|
|
110
|
+
// Short app key (unscoped, derived from package name, required)
|
|
111
|
+
name: z
|
|
112
|
+
.string({
|
|
113
|
+
required_error: 'name is required in portal manifest',
|
|
114
|
+
invalid_type_error: 'name must be a string',
|
|
115
|
+
})
|
|
116
|
+
.describe('Short app key (unscoped, derived from package name)'),
|
|
117
|
+
// Full package name, may include scope (optional)
|
|
118
|
+
displayName: z
|
|
119
|
+
.string({
|
|
120
|
+
invalid_type_error: 'displayName must be a string',
|
|
121
|
+
})
|
|
122
|
+
.optional()
|
|
123
|
+
.describe('Full package name, may include scope'),
|
|
124
|
+
// Description of the portal (optional)
|
|
125
|
+
description: z
|
|
126
|
+
.string({
|
|
127
|
+
invalid_type_error: 'description must be a string',
|
|
128
|
+
})
|
|
129
|
+
.optional()
|
|
130
|
+
.describe('Description of the portal'),
|
|
131
|
+
// Build section (required, validated by PortalManifestBuildSchema)
|
|
132
|
+
build: PortalManifestBuildSchema,
|
|
133
|
+
});
|
|
134
|
+
//# sourceMappingURL=portal-manifest.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portal-manifest.schema.js","sourceRoot":"","sources":["../../../../src/lib/portal/portal-manifest.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,6CAA6C;IAC7C,aAAa,EAAE,CAAC;SACb,MAAM,CAAC;QACN,cAAc,EAAE,4CAA4C;QAC5D,kBAAkB,EAAE,gCAAgC;KACrD,CAAC;SACD,QAAQ,CAAC,iCAAiC,CAAC;IAC9C,+CAA+C;IAC/C,WAAW,EAAE,CAAC;SACX,MAAM,CAAC;QACN,cAAc,EAAE,0CAA0C;QAC1D,kBAAkB,EAAE,8BAA8B;KACnD,CAAC;SACD,QAAQ,CAAC,mCAAmC,CAAC;IAChD,+CAA+C;IAC/C,SAAS,EAAE,CAAC;SACT,MAAM,CAAC;QACN,kBAAkB,EAAE,4BAA4B;KACjD,CAAC;SACD,QAAQ,EAAE;SACV,QAAQ,CAAC,mCAAmC,CAAC;IAChD,iDAAiD;IACjD,UAAU,EAAE,CAAC;SACV,MAAM,CAAC;QACN,kBAAkB,EAAE,6BAA6B;KAClD,CAAC;SACD,QAAQ,EAAE;SACV,QAAQ,CAAC,qCAAqC,CAAC;IAClD,uCAAuC;IACvC,OAAO,EAAE,CAAC;SACP,MAAM,CAAC;QACN,cAAc,EAAE,sCAAsC;QACtD,kBAAkB,EAAE,0BAA0B;KAC/C,CAAC;SACD,QAAQ,CAAC,2BAA2B,CAAC;IACxC,8CAA8C;IAC9C,SAAS,EAAE,CAAC;SACT,MAAM,CAAC;QACN,cAAc,EAAE,wCAAwC;QACxD,kBAAkB,EAAE,4BAA4B;KACjD,CAAC;SACD,QAAQ,CAAC,mCAAmC,CAAC;IAChD,oCAAoC;IACpC,SAAS,EAAE,CAAC;SACT,MAAM,CAAC;QACN,cAAc,EAAE,wCAAwC;QACxD,kBAAkB,EAAE,4BAA4B;KACjD,CAAC;SACD,QAAQ,CAAC,wBAAwB,CAAC;IACrC,+CAA+C;IAC/C,WAAW,EAAE,CAAC;SACX,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE;QAClB,kBAAkB,EAAE,+CAA+C;KACpE,CAAC;SACD,QAAQ,EAAE;SACV,QAAQ,CAAC,4BAA4B,CAAC;IACzC,4BAA4B;IAC5B,WAAW,EAAE,CAAC;SACX,MAAM,CAAC;QACN,kBAAkB,EAAE,8BAA8B;KACnD,CAAC;SACD,QAAQ,EAAE;SACV,QAAQ,CAAC,2BAA2B,CAAC;IACxC,gEAAgE;IAChE,iBAAiB,EAAE,CAAC;SACjB,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;QACP,kBAAkB,EAAE,yCAAyC;KAC9D,CAAC,EACF;QACE,cAAc,EAAE,gDAAgD;QAChE,kBAAkB,EAAE,+CAA+C;KACpE,CACF;SACA,QAAQ,CAAC,qDAAqD,CAAC;IAClE,4DAA4D;IAC5D,MAAM,EAAE,CAAC;SACN,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,EAAE;QACnB,kBAAkB,EAAE,2CAA2C;KAChE,CAAC;SACD,QAAQ,EAAE;SACV,QAAQ,CAAC,gCAAgC,CAAC;IAC7C,mEAAmE;IACnE,MAAM,EAAE,CAAC;SACN,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,EAAE;QACnB,kBAAkB,EAAE,2CAA2C;KAChE,CAAC;SACD,QAAQ,EAAE;SACV,QAAQ,CAAC,uCAAuC,CAAC;CACrD,CAAC,CAAC;AAEH;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,gEAAgE;IAChE,IAAI,EAAE,CAAC;SACJ,MAAM,CAAC;QACN,cAAc,EAAE,qCAAqC;QACrD,kBAAkB,EAAE,uBAAuB;KAC5C,CAAC;SACD,QAAQ,CAAC,qDAAqD,CAAC;IAClE,kDAAkD;IAClD,WAAW,EAAE,CAAC;SACX,MAAM,CAAC;QACN,kBAAkB,EAAE,8BAA8B;KACnD,CAAC;SACD,QAAQ,EAAE;SACV,QAAQ,CAAC,sCAAsC,CAAC;IACnD,uCAAuC;IACvC,WAAW,EAAE,CAAC;SACX,MAAM,CAAC;QACN,kBAAkB,EAAE,8BAA8B;KACnD,CAAC;SACD,QAAQ,EAAE;SACV,QAAQ,CAAC,2BAA2B,CAAC;IACxC,mEAAmE;IACnE,KAAK,EAAE,yBAAyB;CACjC,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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 const ASSET_EXTENSIONS = [
|
|
11
|
+
// Images
|
|
12
|
+
...['png', 'jpg', 'jpeg', 'gif', 'svg', 'ico', 'webp'],
|
|
13
|
+
// Videos and audio
|
|
14
|
+
...['mp4', 'webm', 'mp3'],
|
|
15
|
+
// Fonts
|
|
16
|
+
...['woff2', 'woff', 'eot', 'ttf', 'otf'],
|
|
17
|
+
// Documents
|
|
18
|
+
...['pdf', 'md', 'txt'],
|
|
19
|
+
];
|
|
20
|
+
//# sourceMappingURL=static.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static.js","sourceRoot":"","sources":["../../../src/lib/static.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,SAAS;IACT,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC;IACtD,mBAAmB;IACnB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC;IACzB,QAAQ;IACR,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;IACzC,YAAY;IACZ,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC;CACf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/lib/
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/lib/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import assert, { AssertionError } from 'node:assert';
|
|
2
|
+
import { fileExists } from './file-exists.js';
|
|
3
|
+
/**
|
|
4
|
+
* Re-exports the core Node.js assert function and AssertionError class.
|
|
5
|
+
* Useful for consistent assertion handling throughout the codebase.
|
|
6
|
+
*/
|
|
7
|
+
export { assert, AssertionError };
|
|
8
|
+
/**
|
|
9
|
+
* Asserts that the provided value is a valid number (not NaN).
|
|
10
|
+
* Throws an AssertionError if the value is not a number.
|
|
11
|
+
*
|
|
12
|
+
* @param value - The value to check for being a number.
|
|
13
|
+
* @param message - Optional custom error message for assertion failure.
|
|
14
|
+
* @throws {AssertionError} If value is NaN.
|
|
15
|
+
*/
|
|
16
|
+
export function assertNumber(value, message) {
|
|
17
|
+
// Ensure the value is not NaN; this does not check for type 'number'.
|
|
18
|
+
assert(!Number.isNaN(value), new AssertionError({
|
|
19
|
+
message,
|
|
20
|
+
actual: value,
|
|
21
|
+
expected: '<number>',
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Asserts that a file exists at the given path.
|
|
26
|
+
* Throws an error if the file does not exist.
|
|
27
|
+
*
|
|
28
|
+
* @param value - The file path to check.
|
|
29
|
+
* @param message - Optional custom error message for assertion failure.
|
|
30
|
+
* @throws {AssertionError} If the file does not exist.
|
|
31
|
+
*/
|
|
32
|
+
export const assertFileExists = (value, message) => {
|
|
33
|
+
// Use fileExists utility to check for file presence.
|
|
34
|
+
assert(fileExists(value), message ?? `file ${String(value)} does not exist`);
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Asserts that the provided value is an object.
|
|
38
|
+
* Throws an error if the value is not an object.
|
|
39
|
+
*
|
|
40
|
+
* @param value - The value to check for being an object.
|
|
41
|
+
* @param message - Optional custom error message or Error instance.
|
|
42
|
+
* @throws {AssertionError} If value is not an object.
|
|
43
|
+
*/
|
|
44
|
+
export function assertObject(value, message) {
|
|
45
|
+
// typeof null is 'object', so this does not exclude null values.
|
|
46
|
+
assert(typeof value === 'object', message);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Asserts that a specific property exists and has a value on an object.
|
|
50
|
+
* Used internally for property value checks.
|
|
51
|
+
*
|
|
52
|
+
* @param value - The value of the property to check.
|
|
53
|
+
* @param prop - The property key being checked.
|
|
54
|
+
* @param message - Optional custom error message.
|
|
55
|
+
* @throws {AssertionError} If the property value is falsy.
|
|
56
|
+
*/
|
|
57
|
+
function assertObjectEntryValue(value, prop, message) {
|
|
58
|
+
// Checks for truthy value; falsy values (0, '', false) will fail.
|
|
59
|
+
assert(!!value, message ?? `missing value of property ${prop}`);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Asserts that an object contains the specified properties and that each property has a value.
|
|
63
|
+
* Allows for custom assertion logic and pre-message prefixing.
|
|
64
|
+
*
|
|
65
|
+
* @typeParam T - The object type to check.
|
|
66
|
+
* @typeParam P - The array of property keys to check on the object.
|
|
67
|
+
* @param value - The object to check.
|
|
68
|
+
* @param options - Optional settings for property keys, assertion function, and message prefix.
|
|
69
|
+
* @throws {AssertionError} If any property is missing or fails the assertion.
|
|
70
|
+
*/
|
|
71
|
+
export function assertObjectEntries(value, options) {
|
|
72
|
+
// Use preMessage to prefix all assertion messages for context.
|
|
73
|
+
const preMessage = options?.preMessage ?? '';
|
|
74
|
+
// Ensure the value is an object before checking properties.
|
|
75
|
+
assert(typeof value === 'object', `${preMessage} to be an <object>`);
|
|
76
|
+
// Use custom assertion if provided, otherwise default.
|
|
77
|
+
const assertion = options?.assertion ?? assertObjectEntryValue;
|
|
78
|
+
// Use provided property list or all keys of the object.
|
|
79
|
+
const props = options?.props ?? Object.keys(value);
|
|
80
|
+
for (const prop of props) {
|
|
81
|
+
// Check that the property exists on the object.
|
|
82
|
+
assert(prop in value, `${preMessage} to have property [${String(prop)}]`);
|
|
83
|
+
// Check that the property value passes the assertion.
|
|
84
|
+
assertion(value[prop], prop, `${preMessage} property [${String(prop)}] to have value`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=assert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assert.js","sourceRoot":"","sources":["../../../../src/lib/utils/assert.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;;GAGG;AACH,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC;AAElC;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,KAAc,EAAE,OAAgB;IAC3D,sEAAsE;IACtE,MAAM,CACJ,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EACpB,IAAI,cAAc,CAAC;QACjB,OAAO;QACP,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,UAAU;KACrB,CAAC,CACH,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAc,EAAE,OAAgB,EAAiB,EAAE;IAClF,qDAAqD;IACrD,MAAM,CAAC,UAAU,CAAC,KAAe,CAAC,EAAE,OAAO,IAAI,QAAQ,MAAM,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;AACzF,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,KAAa,EAAE,OAAwB;IAClE,iEAAiE;IACjE,MAAM,CAAC,OAAO,KAAK,KAAK,QAAQ,EAAE,OAAO,CAAC,CAAC;AAC7C,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,sBAAsB,CAAI,KAAc,EAAE,IAAO,EAAE,OAAgB;IAC1E,kEAAkE;IAClE,MAAM,CAAC,CAAC,CAAC,KAAK,EAAE,OAAO,IAAI,6BAA6B,IAAI,EAAE,CAAC,CAAC;AAClE,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,mBAAmB,CACjC,KAAQ,EACR,OAIC;IAED,+DAA+D;IAC/D,MAAM,UAAU,GAAG,OAAO,EAAE,UAAU,IAAI,EAAE,CAAC;IAC7C,4DAA4D;IAC5D,MAAM,CAAC,OAAO,KAAK,KAAK,QAAQ,EAAE,GAAG,UAAU,oBAAoB,CAAC,CAAC;IACrE,uDAAuD;IACvD,MAAM,SAAS,GAAqC,OAAO,EAAE,SAAS,IAAI,sBAAsB,CAAC;IACjG,wDAAwD;IACxD,MAAM,KAAK,GAAG,OAAO,EAAE,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACnD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,gDAAgD;QAChD,MAAM,CAAC,IAAI,IAAI,KAAK,EAAE,GAAG,UAAU,sBAAsB,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC1E,sDAAsD;QACtD,SAAS,CACP,KAAK,CAAC,IAAe,CAAC,EACtB,IAAoB,EACpB,GAAG,UAAU,cAAc,MAAM,CAAC,IAAI,CAAC,iBAAiB,CACzD,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expect.js","sourceRoot":"","sources":["../../../../src/lib/utils/expect.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,MAAM,CAAC,MAAM,MAAM,GAAG,CAAI,KAAQ,EAAE,EAAE;IACpC,OAAO;QACL,IAAI,EAAE,CAAC,QAAW,EAAE,OAAe,EAAoB,EAAE;YACvD,MAAM,CACJ,KAAK,KAAK,QAAQ,EAClB,KAAK,CAAC,OAAO,EAAE;gBACb,KAAK,EAAE;oBACL,QAAQ;oBACR,MAAM,EAAE,KAAK;oBACb,KAAK;iBACN;aACF,CAAC,CACH,CAAC;YACF,OAAO,IAAI,CAAC;QACd,CAAC;QACD,cAAc,EAAE,CAAC,QAAsB,EAAE,OAAe,EAAoB,EAAE;YAC5E,MAAM,MAAM,GAAG,OAAO,KAAK,CAAC;YAC5B,MAAM,CACJ,MAAM,KAAK,QAAQ,EACnB,KAAK,CAAC,OAAO,EAAE;gBACb,KAAK,EAAE;oBACL,QAAQ;oBACR,MAAM;oBACN,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK;iBACjD;aACF,CAAC,CACH,CAAC;YACF,OAAO,IAAI,CAAC;QACd,CAAC;KACF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -17,4 +17,4 @@ const trimLeadingDot = (ext) => ext.replace(/^\./, '');
|
|
|
17
17
|
*/
|
|
18
18
|
export const createExtensionFilterPattern = (exts) => new RegExp(`\\.(${exts.map(trimLeadingDot).join('|')})(\\?.*)?$`);
|
|
19
19
|
export default createExtensionFilterPattern;
|
|
20
|
-
//# sourceMappingURL=extension-filter
|
|
20
|
+
//# sourceMappingURL=extension-filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension-filter.js","sourceRoot":"","sources":["../../../../src/lib/utils/extension-filter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,cAAc,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAE/D;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,IAAc,EAAE,EAAE,CAC7D,IAAI,MAAM,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;AAEpE,eAAe,4BAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-exists.js","sourceRoot":"","sources":["../../../../src/lib/utils/file-exists.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAI1C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAAY,EAAE,OAAiB,EAAE,EAAE;IAChE,IAAI,CAAC;QACH,UAAU,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,OAAO,EAAE,MAAM,EAAE,CAAC;YACpB,MAAM,GAAG,CAAC;QACZ,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,EAAE,IAAY,EAAE,OAAiB,EAAoB,EAAE;IACpF,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,OAAO,EAAE,MAAM,EAAE,CAAC;YACpB,MAAM,GAAG,CAAC;QACZ,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { resolveEntryPoint } from './resolve-source-entry-point.js';
|
|
2
|
+
export { resolvePackage } 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';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAwB,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
export async function parseJsonFromRequest(req) {
|
|
9
9
|
return await new Promise((resolve, reject) => {
|
|
10
10
|
let data = '';
|
|
11
|
-
req.on('data', (chunk) =>
|
|
11
|
+
req.on('data', (chunk) => {
|
|
12
|
+
data += chunk.toString();
|
|
13
|
+
});
|
|
12
14
|
req.on('end', () => resolve(JSON.parse(data)));
|
|
13
15
|
req.on('error', reject);
|
|
14
16
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-json-request.js","sourceRoot":"","sources":["../../../../src/lib/utils/parse-json-request.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,GAAoB;IAC7D,OAAO,MAAM,IAAI,OAAO,CAA0B,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACpE,IAAI,IAAI,GAAG,EAAE,CAAC;QACd,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;YACvB,IAAI,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;QAC3B,CAAC,CAAC,CAAC;QACH,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC/C,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC;AAED,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import resolveGithubAnnotations from './resolve-github-annotations.js';
|
|
2
|
+
import resolveDevopsAnnotations from './resolve-devops-annotations.js';
|
|
3
|
+
/**
|
|
4
|
+
* Resolves CI/CD environment-specific annotation variables.
|
|
5
|
+
*
|
|
6
|
+
* This function determines the current CI/CD runtime environment (GitHub Actions, Azure DevOps, or other)
|
|
7
|
+
* and returns a set of annotation variables relevant to that environment. These annotations are typically
|
|
8
|
+
* used for reporting build, test, or deployment results in a way that is compatible with the CI/CD provider's UI.
|
|
9
|
+
*
|
|
10
|
+
* @returns {Record<string, string>} An object containing annotation variables for the detected environment.
|
|
11
|
+
* If no known environment is detected, returns an empty object.
|
|
12
|
+
*/
|
|
13
|
+
export const resolveAnnotations = () => {
|
|
14
|
+
// Check if running in GitHub Actions environment
|
|
15
|
+
// If so, delegate to the GitHub-specific annotation resolver
|
|
16
|
+
if (process.env.GITHUB_ACTIONS) {
|
|
17
|
+
return resolveGithubAnnotations();
|
|
18
|
+
}
|
|
19
|
+
// Check if running in Azure DevOps environment
|
|
20
|
+
// If so, delegate to the Azure DevOps-specific annotation resolver
|
|
21
|
+
if (process.env.SYSTEM_TEAMPROJECT) {
|
|
22
|
+
return resolveDevopsAnnotations();
|
|
23
|
+
}
|
|
24
|
+
// Fallback: No known CI/CD environment detected
|
|
25
|
+
// Return an empty object to indicate no annotations are available
|
|
26
|
+
return {};
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=resolve-annotations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-annotations.js","sourceRoot":"","sources":["../../../../src/lib/utils/resolve-annotations.ts"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,MAAM,iCAAiC,CAAC;AACvE,OAAO,wBAAwB,MAAM,iCAAiC,CAAC;AAEvE;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAA2B,EAAE;IAC7D,iDAAiD;IACjD,6DAA6D;IAC7D,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC;QAC/B,OAAO,wBAAwB,EAAE,CAAC;IACpC,CAAC;IACD,+CAA+C;IAC/C,mEAAmE;IACnE,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,CAAC;QACnC,OAAO,wBAAwB,EAAE,CAAC;IACpC,CAAC;IACD,gDAAgD;IAChD,kEAAkE;IAClE,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
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 const resolveAnnotations = () => {
|
|
30
|
+
// Extract Azure DevOps build and repository information from environment variables
|
|
31
|
+
const runId = process.env.BUILD_BUILDID || 'unknown'; // Unique build/run identifier
|
|
32
|
+
const repository = process.env.BUILD_REPOSITORY_NAME || 'unknown'; // Repository name
|
|
33
|
+
const project = process.env.SYSTEM_TEAMPROJECT || 'unknown'; // Project name
|
|
34
|
+
const orgUrl = process.env.SYSTEM_COLLECTIONURI || 'unknown'; // Organization URL
|
|
35
|
+
const actor = process.env.BUILD_REQUESTEDFOR || 'unknown'; // User who requested the build
|
|
36
|
+
const branch = process.env.BUILD_SOURCEBRANCH || 'unknown'; // Source branch name
|
|
37
|
+
const commitId = process.env.BUILD_SOURCEVERSION || 'unknown'; // Commit SHA
|
|
38
|
+
// Construct a direct URL to the build results if all required parts are available
|
|
39
|
+
let runUrl = 'unknown';
|
|
40
|
+
if (orgUrl !== 'unknown' && project !== 'unknown' && runId !== 'unknown') {
|
|
41
|
+
// Remove trailing slash from orgUrl if present, then build the run results URL
|
|
42
|
+
runUrl = `${orgUrl.replace(/\/$/, '')}${project}/_build/results?buildId=${runId}`;
|
|
43
|
+
}
|
|
44
|
+
// Aggregate all annotation variables into a single object for easy consumption
|
|
45
|
+
const annotations = {
|
|
46
|
+
runId,
|
|
47
|
+
repository,
|
|
48
|
+
project,
|
|
49
|
+
orgUrl,
|
|
50
|
+
actor,
|
|
51
|
+
branch,
|
|
52
|
+
commitId,
|
|
53
|
+
runUrl,
|
|
54
|
+
};
|
|
55
|
+
// Return the resolved annotation variables
|
|
56
|
+
return annotations;
|
|
57
|
+
};
|
|
58
|
+
export default resolveAnnotations;
|
|
59
|
+
//# sourceMappingURL=resolve-devops-annotations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-devops-annotations.js","sourceRoot":"","sources":["../../../../src/lib/utils/resolve-devops-annotations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAA2B,EAAE;IAC7D,mFAAmF;IACnF,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,SAAS,CAAC,CAAC,8BAA8B;IACpF,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,SAAS,CAAC,CAAC,kBAAkB;IACrF,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,SAAS,CAAC,CAAC,eAAe;IAC5E,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,SAAS,CAAC,CAAC,mBAAmB;IACjF,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,SAAS,CAAC,CAAC,+BAA+B;IAC1F,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,SAAS,CAAC,CAAC,qBAAqB;IACjF,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,SAAS,CAAC,CAAC,aAAa;IAE5E,kFAAkF;IAClF,IAAI,MAAM,GAAG,SAAS,CAAC;IACvB,IAAI,MAAM,KAAK,SAAS,IAAI,OAAO,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACzE,+EAA+E;QAC/E,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,OAAO,2BAA2B,KAAK,EAAE,CAAC;IACpF,CAAC;IAED,+EAA+E;IAC/E,MAAM,WAAW,GAA2B;QAC1C,KAAK;QACL,UAAU;QACV,OAAO;QACP,MAAM;QACN,KAAK;QACL,MAAM;QACN,QAAQ;QACR,MAAM;KACP,CAAC;IAEF,2CAA2C;IAC3C,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { execSync } from 'node:child_process';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves the Git commit SHA for a given reference.
|
|
4
|
+
*
|
|
5
|
+
* @param ref - The Git reference to resolve. Defaults to 'HEAD' if not provided.
|
|
6
|
+
* @returns The resolved Git commit SHA as a string, or `undefined` if the command fails.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* This function uses the `git rev-parse` command to determine the commit SHA.
|
|
10
|
+
* Ensure that the function is executed in a valid Git repository context.
|
|
11
|
+
*
|
|
12
|
+
* @throws Will throw an error if the `git` command fails or is not available.
|
|
13
|
+
*/
|
|
14
|
+
export const resolveGitCommitSha = (ref = 'HEAD') => {
|
|
15
|
+
try {
|
|
16
|
+
return execSync(`git rev-parse ${ref}`).toString().trim();
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
// most likely due to not being in a git repository or invalid ref
|
|
20
|
+
return undefined; // Return undefined if the command fails or ref is not valid
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=resolve-git-commit-sha.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-git-commit-sha.js","sourceRoot":"","sources":["../../../../src/lib/utils/resolve-git-commit-sha.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,GAAG,GAAG,MAAM,EAAsB,EAAE;IACtE,IAAI,CAAC;QACH,OAAO,QAAQ,CAAC,iBAAiB,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC;IAC5D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,kEAAkE;QAClE,OAAO,SAAS,CAAC,CAAC,4DAA4D;IAChF,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { execSync } from 'node:child_process';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves the URL of the Git remote named "origin" for the current repository.
|
|
4
|
+
*
|
|
5
|
+
* This function executes a shell command to retrieve the remote URL and converts
|
|
6
|
+
* SSH-style URLs (e.g., `git@github.com:user/repo.git`) to HTTPS-style URLs
|
|
7
|
+
* (e.g., `https://github.com/user/repo`). It also removes the `.git` suffix
|
|
8
|
+
* from the URL if present.
|
|
9
|
+
*
|
|
10
|
+
* @returns The resolved Git remote URL as a string, or `undefined` if the command
|
|
11
|
+
* fails or the remote "origin" is not configured.
|
|
12
|
+
*/
|
|
13
|
+
export const resolveGitRemoteUrl = () => {
|
|
14
|
+
try {
|
|
15
|
+
const origin = execSync('git remote get-url origin').toString().trim();
|
|
16
|
+
return origin.replace('git@github.com:', 'https://github.com/').replace(/\.git$/, '');
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
// most likely due to not being in a git repository or no remote named "origin"
|
|
20
|
+
return undefined; // Return undefined if the command fails or origin is not set
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
export default resolveGitRemoteUrl;
|
|
24
|
+
//# sourceMappingURL=resolve-git-remote-url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-git-remote-url.js","sourceRoot":"","sources":["../../../../src/lib/utils/resolve-git-remote-url.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAuB,EAAE;IAC1D,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,QAAQ,CAAC,2BAA2B,CAAC,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC;QACvE,OAAO,MAAM,CAAC,OAAO,CAAC,iBAAiB,EAAE,qBAAqB,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IACxF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,+EAA+E;QAC/E,OAAO,SAAS,CAAC,CAAC,6DAA6D;IACjF,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|