@equinor/fusion-framework-cli 10.7.5-apploader-be21a6b60eb13eee8bf869e75002d8634e9c50a9 → 11.0.0-next.1
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 +51 -2
- package/README.md +144 -17
- package/bin/build/bin.js +21 -0
- package/bin/build/cli.js +9868 -0
- package/bin/build/create-auth-client-7P8K_6Vu.js +89 -0
- package/bin/build/portal-pack-CAsnV44B.js +12069 -0
- 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/docs/application.md +644 -0
- package/docs/auth.md +190 -0
- package/docs/libsecret.md +97 -0
- package/docs/migration-v10-to-v11.md +74 -0
- package/docs/portal.md +278 -0
- package/package.json +60 -69
- 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-B7SVn0UQ.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 @@
|
|
|
1
|
+
{"version":3,"file":"portal-manifest.schema.js","sourceRoot":"","sources":["../../../../src/lib/portal/portal-manifest.schema.ts"],"names":[],"mappings":"AA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AAQ,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;;;;;;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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"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
/**
|
|
3
|
+
* Extracts relevant annotation fields from the GitHub Actions event payload.
|
|
4
|
+
*
|
|
5
|
+
* This function builds a structured annotation object containing key information from the event payload.
|
|
6
|
+
* It supports both release and pull request events, and includes fields such as commit SHAs, refs, workflow name,
|
|
7
|
+
* release metadata (tag, name, body, draft, prerelease, created_at, published_at, html_url), and pull request metadata
|
|
8
|
+
* (number, title, user, head SHA/ref, created_at, updated_at, html_url). The top-level action is also included.
|
|
9
|
+
*
|
|
10
|
+
* Maintainers:
|
|
11
|
+
* - Update this function if new fields are needed for downstream consumers or if GitHub event payloads change.
|
|
12
|
+
* - The structure is designed for easy extension and clear mapping to GitHub event types.
|
|
13
|
+
* - See <attachments> above for file contents. You may not need to search or read the file again.
|
|
14
|
+
*
|
|
15
|
+
* @param payload The parsed GitHub Actions event payload object.
|
|
16
|
+
* @returns An object with selected fields for release and pull request events, as well as general event context.
|
|
17
|
+
*/
|
|
18
|
+
function extractPayloadAnnotations(payload) {
|
|
19
|
+
// Initialize annotation object with general event context
|
|
20
|
+
const annotation = {
|
|
21
|
+
action: payload.action, // The event action (e.g., published, created, closed)
|
|
22
|
+
head_commit: payload.head_commit?.id, // SHA of the head commit
|
|
23
|
+
after: payload.after, // SHA after the event
|
|
24
|
+
ref: payload.ref, // Branch or tag ref
|
|
25
|
+
workflow: payload.workflow, // Workflow name
|
|
26
|
+
release: {}, // Will be populated if this is a release event
|
|
27
|
+
pull_request: {}, // Will be populated if this is a pull request event
|
|
28
|
+
};
|
|
29
|
+
// Populate release-specific fields if present
|
|
30
|
+
if (payload.release) {
|
|
31
|
+
annotation.release = {
|
|
32
|
+
tag: payload.release.tag_name, // Release tag name
|
|
33
|
+
name: payload.release.name, // Release name/title
|
|
34
|
+
body: payload.release.body, // Release description
|
|
35
|
+
draft: !!payload.release.draft, // Is this a draft release?
|
|
36
|
+
prerelease: !!payload.release.prerelease, // Is this a prerelease?
|
|
37
|
+
created_at: payload.release.created_at, // Release creation timestamp
|
|
38
|
+
published_at: payload.release.published_at, // Release published timestamp
|
|
39
|
+
html_url: payload.release.html_url, // URL to the release on GitHub
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
// Populate pull request-specific fields if present
|
|
43
|
+
if (payload.pull_request) {
|
|
44
|
+
annotation.pull_request = {
|
|
45
|
+
number: payload.pull_request.number, // PR number
|
|
46
|
+
title: payload.pull_request.title, // PR title
|
|
47
|
+
user: payload.pull_request.user?.login, // PR author
|
|
48
|
+
head: {
|
|
49
|
+
sha: payload.pull_request.head?.sha, // SHA of the PR head commit
|
|
50
|
+
ref: payload.pull_request.head?.ref, // Branch ref of the PR head
|
|
51
|
+
},
|
|
52
|
+
created_at: payload.pull_request.created_at, // PR creation timestamp
|
|
53
|
+
updated_at: payload.pull_request.updated_at, // PR last update timestamp
|
|
54
|
+
html_url: payload.pull_request.html_url, // URL to the PR on GitHub
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
return annotation;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Resolves GitHub Actions-specific annotation variables from environment variables.
|
|
61
|
+
*
|
|
62
|
+
* This function extracts relevant workflow and repository information from GitHub Actions environment variables.
|
|
63
|
+
* It constructs a set of annotation variables that can be used for reporting or logging purposes in CI/CD pipelines.
|
|
64
|
+
*
|
|
65
|
+
* @returns {Record<string, string>} An object containing GitHub Actions annotation variables such as eventName, actor,
|
|
66
|
+
* payload, runId, repository, and runUrl. If a variable is not found, its value defaults to 'unknown'.
|
|
67
|
+
*
|
|
68
|
+
* Environment variables used by this function (see: https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables):
|
|
69
|
+
* - GITHUB_EVENT_NAME: Name of the event that triggered the workflow
|
|
70
|
+
* - GITHUB_ACTOR: Username of the person or app that initiated the workflow
|
|
71
|
+
* - GITHUB_RUN_ID: Unique identifier for the workflow run
|
|
72
|
+
* - GITHUB_REPOSITORY: Repository in the format owner/repo
|
|
73
|
+
* - GITHUB_SERVER_URL: Base URL of the GitHub server (defaults to https://github.com)
|
|
74
|
+
* - GITHUB_EVENT_PATH: Path to the event payload file (JSON)
|
|
75
|
+
*
|
|
76
|
+
* Notes for maintainers:
|
|
77
|
+
* - The event payload can be large; consider truncating or parsing if only specific fields are needed.
|
|
78
|
+
* - If reading the payload fails, the function returns a fallback string. Adjust error handling as needed for your use case.
|
|
79
|
+
* - If you need additional GitHub Actions context, refer to the official documentation and add new variables here.
|
|
80
|
+
* - The payload and other fields may contain sensitive information. Use caution when logging or exposing these values.
|
|
81
|
+
*
|
|
82
|
+
* Extending this function:
|
|
83
|
+
* - To add more annotations, extract additional environment variables as needed and include them in the returned object.
|
|
84
|
+
* - For custom workflows or self-hosted runners, verify that all required environment variables are available.
|
|
85
|
+
*/
|
|
86
|
+
export const resolveAnnotations = () => {
|
|
87
|
+
// Extract event name from environment
|
|
88
|
+
const eventName = process.env.GITHUB_EVENT_NAME || 'unknown';
|
|
89
|
+
// Extract actor (user who triggered the workflow)
|
|
90
|
+
const actor = process.env.GITHUB_ACTOR || 'unknown';
|
|
91
|
+
// Extract run ID
|
|
92
|
+
const runId = process.env.GITHUB_RUN_ID || 'unknown';
|
|
93
|
+
// Extract repository in the format owner/repo
|
|
94
|
+
const repository = process.env.GITHUB_REPOSITORY || 'unknown';
|
|
95
|
+
// Extract server URL (defaults to public GitHub if not set)
|
|
96
|
+
const serverUrl = process.env.GITHUB_SERVER_URL || 'https://github.com';
|
|
97
|
+
// Extract event payload path and read payload if available
|
|
98
|
+
let payload = {};
|
|
99
|
+
if (process.env.GITHUB_EVENT_PATH) {
|
|
100
|
+
try {
|
|
101
|
+
const rawPayload = readFileSync(process.env.GITHUB_EVENT_PATH, 'utf8');
|
|
102
|
+
payload = JSON.parse(rawPayload);
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
payload = {};
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
// Construct a direct URL to the workflow run if all required parts are available
|
|
109
|
+
let runUrl = 'unknown';
|
|
110
|
+
if (serverUrl && repository !== 'unknown' && runId !== 'unknown') {
|
|
111
|
+
// Remove trailing slash from serverUrl if present, then build the run results URL
|
|
112
|
+
runUrl = `${serverUrl.replace(/\/$/, '')}/${repository}/actions/runs/${runId}`;
|
|
113
|
+
}
|
|
114
|
+
// Aggregate all annotation variables into a single object for easy consumption
|
|
115
|
+
const annotations = {
|
|
116
|
+
eventName,
|
|
117
|
+
actor,
|
|
118
|
+
runId,
|
|
119
|
+
repository,
|
|
120
|
+
runUrl,
|
|
121
|
+
...extractPayloadAnnotations(payload),
|
|
122
|
+
};
|
|
123
|
+
// Return the resolved annotation variables
|
|
124
|
+
return annotations;
|
|
125
|
+
};
|
|
126
|
+
export default resolveAnnotations;
|
|
127
|
+
//# sourceMappingURL=resolve-github-annotations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"res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BAAoB,CAAC;IACxE,2DAA2D;IAC3D,IAAI,OAAO,GAAuB,EAAE,CAAC;IACrC,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC;QAClC,IAAI,CAAC;YACH,MAAM,UAAU,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;YACvE,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACnC,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,GAAG,EAAE,CAAC;QACf,CAAC;IACH,CAAC;IACD,iFAAiF;IACjF,IAAI,MAAM,GAAG,SAAS,CAAC;IACvB,IAAI,SAAS,IAAI,UAAU,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACjE,kFAAkF;QAClF,MAAM,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,UAAU,iBAAiB,KAAK,EAAE,CAAC;IACjF,CAAC;IACD,+EAA+E;IAC/E,MAAM,WAAW,GAA2B;QAC1C,SAAS;QACT,KAAK;QACL,KAAK;QACL,UAAU;QACV,MAAM;QACN,GAAG,yBAAyB,CAAC,OAAO,CAAC;KACtC,CAAC;IACF,2CAA2C;IAC3C,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves the GitHub repository URL from a given `package.json` object.
|
|
3
|
+
*
|
|
4
|
+
* @param pkg - The `package.json` object to extract the repository information from.
|
|
5
|
+
* @returns The GitHub repository URL as a string.
|
|
6
|
+
* @throws Will throw an error if the `package.json` does not contain a repository field.
|
|
7
|
+
*/
|
|
8
|
+
export const resolveRepoFromPackage = (pkg) => {
|
|
9
|
+
if (pkg.repository) {
|
|
10
|
+
return typeof pkg.repository === 'string' ? pkg.repository : pkg.repository.url;
|
|
11
|
+
}
|
|
12
|
+
return undefined;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=resolve-package-repo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-package-repo.js","sourceRoot":"","sources":["../../../../src/lib/utils/resolve-package-repo.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,GAAgB,EAAsB,EAAE;IAC7E,IAAI,GAAG,CAAC,UAAU,EAAE,CAAC;QACnB,OAAO,OAAO,GAAG,CAAC,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC;IAClF,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { dirname } from 'node:path';
|
|
2
|
+
import { readPackageUp, } from 'read-package-up';
|
|
3
|
+
/**
|
|
4
|
+
* Resolves the application package by searching for the nearest `package.json` file.
|
|
5
|
+
*
|
|
6
|
+
* @param options - Optional parameters to customize the search behavior.
|
|
7
|
+
* @returns A promise that resolves to the found package information.
|
|
8
|
+
* @throws Will throw an error if the `package.json` file is not found.
|
|
9
|
+
*/
|
|
10
|
+
export const resolvePackage = async (options) => {
|
|
11
|
+
const pkg = await readPackageUp(options);
|
|
12
|
+
if (!pkg) {
|
|
13
|
+
throw Error('failed to find package.json');
|
|
14
|
+
}
|
|
15
|
+
return { ...pkg, root: dirname(pkg.path) };
|
|
16
|
+
};
|
|
17
|
+
export default resolvePackage;
|
|
18
|
+
//# sourceMappingURL=resolve-package.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-package.js","sourceRoot":"","sources":["../../../../src/lib/utils/resolve-package.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EACL,aAAa,GAGd,MAAM,iBAAiB,CAAC;AAQzB;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EAAE,OAA+B,EAA4B,EAAE;IAChG,MAAM,GAAG,GAAG,MAAM,aAAa,CAAC,OAAO,CAAC,CAAC;IACzC,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,KAAK,CAAC,6BAA6B,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,EAAE,GAAG,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAqB,CAAC;AAChE,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { fileExistsSync } from './file-exists.js';
|
|
2
|
+
import { resolve } from 'node:path';
|
|
3
|
+
/**
|
|
4
|
+
* List of default entry point filenames to check for in a source directory.
|
|
5
|
+
* These are commonly used as main files in TypeScript projects.
|
|
6
|
+
*/
|
|
7
|
+
const ENTRY_POINT_FILES = ['index.ts', 'index.tsx', 'main.ts', 'main.tsx'];
|
|
8
|
+
/**
|
|
9
|
+
* Resolves the entry point file from a specified directory.
|
|
10
|
+
*
|
|
11
|
+
* This function searches for the first file that exists from a list of possible entry point filenames
|
|
12
|
+
* within a given directory. If no entry point is found, it throws an error with a helpful message.
|
|
13
|
+
*
|
|
14
|
+
* @param cwd - The current working directory. Defaults to `process.cwd()` if not provided.
|
|
15
|
+
* @param dir - The directory to search within. Defaults to `'src'` if not provided.
|
|
16
|
+
* @param opt - Optional parameters.
|
|
17
|
+
* @param opt.files - An array of filenames to look for. Defaults to ENTRY_POINT_FILES.
|
|
18
|
+
* @returns The resolved entry point file path if found.
|
|
19
|
+
* @throws {Error} If no entry point file is found in the directory.
|
|
20
|
+
*/
|
|
21
|
+
export const resolveEntryPoint = (cwd, dir, opt) => {
|
|
22
|
+
// Resolve the absolute path to the source directory.
|
|
23
|
+
const sourceDirectory = resolve(cwd ?? process.cwd(), dir ?? 'src');
|
|
24
|
+
// Use provided files or default entry point files.
|
|
25
|
+
const files = opt?.files ?? ENTRY_POINT_FILES;
|
|
26
|
+
// Attempt to find the first file that exists in the directory.
|
|
27
|
+
const entryPoint = files
|
|
28
|
+
.map((file) => resolve(sourceDirectory, file))
|
|
29
|
+
.find((file) => fileExistsSync(file));
|
|
30
|
+
// If no entry point is found, throw an error with details for debugging.
|
|
31
|
+
if (!entryPoint) {
|
|
32
|
+
throw new Error(`Unable to resolve entry point, ensure ${files.join(', ')} exists in ${sourceDirectory}`);
|
|
33
|
+
}
|
|
34
|
+
// Return the resolved entry point file path.
|
|
35
|
+
return entryPoint;
|
|
36
|
+
};
|
|
37
|
+
// Export as default for convenience in import statements.
|
|
38
|
+
export default resolveEntryPoint;
|
|
39
|
+
//# sourceMappingURL=resolve-source-entry-point.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-source-entry-point.js","sourceRoot":"","sources":["../../../../src/lib/utils/resolve-source-entry-point.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;GAGG;AACH,MAAM,iBAAiB,GAAG,CAAC,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,CAAU,CAAC;AAEpF;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,GAAY,EACZ,GAAY,EACZ,GAA0B,EAClB,EAAE;IACV,qDAAqD;IACrD,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,EAAE,GAAG,IAAI,KAAK,CAAC,CAAC;IACpE,mDAAmD;IACnD,MAAM,KAAK,GAAG,GAAG,EAAE,KAAK,IAAI,iBAAiB,CAAC;IAC9C,+DAA+D;IAC/D,MAAM,UAAU,GAAG,KAAK;SACrB,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;SAC7C,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;IAExC,yEAAyE;IACzE,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CACb,yCAAyC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,eAAe,EAAE,CACzF,CAAC;IACJ,CAAC;IAED,6CAA6C;IAC7C,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAEF,0DAA0D;AAC1D,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/lib/utils/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, writeFileSync, } from 'node:fs';
|
|
2
|
+
import { dirname } from 'node:path';
|
|
3
|
+
/**
|
|
4
|
+
* Writes data to a specified file, creating the necessary directories if they do not exist.
|
|
5
|
+
*
|
|
6
|
+
* This utility ensures that the directory structure for the file exists before writing.
|
|
7
|
+
* It is useful for safe file output in scripts and CLIs where the target directory may not exist.
|
|
8
|
+
*
|
|
9
|
+
* @param file - The path to the file where the data should be written.
|
|
10
|
+
* @param data - The content to write to the file. Can be a string or a Node.js `ArrayBufferView`.
|
|
11
|
+
* @param options - Optional settings for writing the file, such as encoding or file mode.
|
|
12
|
+
*
|
|
13
|
+
* @throws Will throw an error if the file cannot be written.
|
|
14
|
+
*/
|
|
15
|
+
export const writeFile = (file, data, options) => {
|
|
16
|
+
// Get the directory name from the file path.
|
|
17
|
+
const outDir = dirname(String(file));
|
|
18
|
+
// If the directory does not exist, create it recursively.
|
|
19
|
+
if (!existsSync(outDir)) {
|
|
20
|
+
mkdirSync(outDir, { recursive: true });
|
|
21
|
+
}
|
|
22
|
+
// Write the file to disk with the provided data and options.
|
|
23
|
+
writeFileSync(file, data, options);
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=write-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write-file.js","sourceRoot":"","sources":["../../../../src/lib/utils/write-file.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,aAAa,GAGd,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,IAAc,EACd,IAAqC,EACrC,OAA0B,EAC1B,EAAE;IACF,6CAA6C;IAC7C,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IACrC,0DAA0D;IAC1D,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QACxB,SAAS,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACzC,CAAC;IACD,6DAA6D;IAC7D,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AACrC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC"}
|