@equinor/fusion-framework-cli 15.1.8 → 15.2.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 +58 -0
- package/bin/build/bin.mjs +1 -1
- package/bin/build/cli.mjs +2 -2
- package/dist/esm/lib/app/{schemas.js → api-app-config-schema.js} +1 -1
- package/dist/esm/lib/app/api-app-config-schema.js.map +1 -0
- package/dist/esm/lib/app/{create-app-manifest.js → create-app-manifest-from-package.js} +10 -8
- package/dist/esm/lib/app/create-app-manifest-from-package.js.map +1 -0
- package/dist/esm/lib/app/{app-config.js → define-app-config.js} +1 -1
- package/dist/esm/lib/app/define-app-config.js.map +1 -0
- package/dist/esm/lib/app/{app-manifest.js → define-app-manifest.js} +1 -1
- package/dist/esm/lib/app/define-app-manifest.js.map +1 -0
- package/dist/esm/lib/app/define-app-package.js +11 -0
- package/dist/esm/lib/app/define-app-package.js.map +1 -0
- package/dist/esm/lib/app/index.js +5 -5
- package/dist/esm/lib/app/index.js.map +1 -1
- package/dist/esm/lib/app/load-app-config.js +1 -1
- package/dist/esm/lib/app/load-app-config.js.map +1 -1
- package/dist/esm/lib/app/load-app-manifest.js +1 -1
- package/dist/esm/lib/app/load-app-manifest.js.map +1 -1
- package/dist/esm/lib/app/merge-app-config.js +1 -0
- package/dist/esm/lib/app/merge-app-config.js.map +1 -1
- package/dist/esm/lib/app/{merge-app-manifest.js → merge-app-manifests.js} +2 -2
- package/dist/esm/lib/app/merge-app-manifests.js.map +1 -0
- package/dist/esm/lib/app/resolve-app-key.js +17 -0
- package/dist/esm/lib/app/resolve-app-key.js.map +1 -0
- package/dist/esm/lib/define-app-config.js +20 -0
- package/dist/esm/lib/define-app-config.js.map +1 -0
- package/dist/esm/lib/define-app-manifest.js +20 -0
- package/dist/esm/lib/define-app-manifest.js.map +1 -0
- package/dist/esm/lib/define-dev-server-config.js +7 -0
- package/dist/esm/lib/define-dev-server-config.js.map +1 -0
- package/dist/esm/lib/{fusion-cli-config.js → define-fusion-cli.js} +1 -1
- package/dist/esm/lib/define-fusion-cli.js.map +1 -0
- package/dist/esm/lib/dev-server.js +2 -1
- package/dist/esm/lib/dev-server.js.map +1 -1
- package/dist/esm/lib/index.js +7 -5
- package/dist/esm/lib/index.js.map +1 -1
- package/dist/esm/lib/load-dev-server-config.js +2 -7
- package/dist/esm/lib/load-dev-server-config.js.map +1 -1
- package/dist/esm/lib/merge-dev-server-config.js +4 -0
- package/dist/esm/lib/merge-dev-server-config.js.map +1 -1
- package/dist/esm/lib/portal/{create-portal-manifest.js → create-portal-manifest-from-package.js} +11 -6
- package/dist/esm/lib/portal/create-portal-manifest-from-package.js.map +1 -0
- package/dist/esm/lib/portal/{portal-config.js → define-portal-config.js} +1 -1
- package/dist/esm/lib/portal/define-portal-config.js.map +1 -0
- package/dist/esm/lib/portal/{portal-manifest.js → define-portal-manifest.js} +5 -17
- package/dist/esm/lib/portal/define-portal-manifest.js.map +1 -0
- package/dist/esm/lib/portal/define-portal-schema.js +8 -0
- package/dist/esm/lib/portal/define-portal-schema.js.map +1 -0
- package/dist/esm/lib/portal/index.js +4 -3
- package/dist/esm/lib/portal/index.js.map +1 -1
- package/dist/esm/lib/portal/load-portal-manifest.js +7 -2
- package/dist/esm/lib/portal/load-portal-manifest.js.map +1 -1
- package/dist/esm/lib/portal/load-portal-schema.js +0 -7
- package/dist/esm/lib/portal/load-portal-schema.js.map +1 -1
- package/dist/esm/lib/portal/{portal-manifest.schema.js → portal-manifest-build-schema.js} +5 -30
- package/dist/esm/lib/portal/portal-manifest-build-schema.js.map +1 -0
- package/dist/esm/lib/portal/portal-manifest-schema.js +31 -0
- package/dist/esm/lib/portal/portal-manifest-schema.js.map +1 -0
- package/dist/esm/lib/portal/validate-portal-manifest.js +15 -0
- package/dist/esm/lib/portal/validate-portal-manifest.js.map +1 -0
- package/dist/esm/lib/static.js +3 -1
- package/dist/esm/lib/static.js.map +1 -1
- package/dist/esm/lib/utils/assert-object.js +25 -0
- package/dist/esm/lib/utils/assert-object.js.map +1 -0
- package/dist/esm/lib/utils/assert.js +1 -135
- package/dist/esm/lib/utils/assert.js.map +1 -1
- package/dist/esm/lib/utils/{extension-filter.js → create-extension-filter-pattern.js} +6 -2
- package/dist/esm/lib/utils/create-extension-filter-pattern.js.map +1 -0
- package/dist/esm/lib/utils/fetch-latest-version.js +26 -0
- package/dist/esm/lib/utils/fetch-latest-version.js.map +1 -0
- package/dist/esm/lib/utils/fetch-package-info.js +65 -0
- package/dist/esm/lib/utils/fetch-package-info.js.map +1 -0
- package/dist/esm/lib/utils/file-exists-sync.js +29 -0
- package/dist/esm/lib/utils/file-exists-sync.js.map +1 -0
- package/dist/esm/lib/utils/file-exists.js +2 -27
- package/dist/esm/lib/utils/file-exists.js.map +1 -1
- package/dist/esm/lib/utils/{snapshot.js → generate-snapshot-version.js} +2 -1
- package/dist/esm/lib/utils/generate-snapshot-version.js.map +1 -0
- package/dist/esm/lib/utils/index.js +4 -3
- package/dist/esm/lib/utils/index.js.map +1 -1
- package/dist/esm/lib/utils/is-git-dir.js +1 -0
- package/dist/esm/lib/utils/is-git-dir.js.map +1 -1
- package/dist/esm/lib/utils/{parse-json-request.js → parse-json-from-request.js} +1 -1
- package/dist/esm/lib/utils/parse-json-from-request.js.map +1 -0
- package/dist/esm/lib/utils/resolve-annotations.js +3 -0
- package/dist/esm/lib/utils/resolve-annotations.js.map +1 -1
- package/dist/esm/lib/utils/resolve-devops-annotations.js +1 -0
- package/dist/esm/lib/utils/resolve-devops-annotations.js.map +1 -1
- package/dist/esm/lib/utils/{resolve-source-entry-point.js → resolve-entry-point.js} +3 -2
- package/dist/esm/lib/utils/resolve-entry-point.js.map +1 -0
- package/dist/esm/lib/utils/resolve-git-commit-sha.js +1 -1
- package/dist/esm/lib/utils/resolve-git-commit-sha.js.map +1 -1
- package/dist/esm/lib/utils/resolve-git-remote-url.js +1 -1
- package/dist/esm/lib/utils/resolve-git-remote-url.js.map +1 -1
- package/dist/esm/lib/utils/resolve-github-annotations.js +4 -0
- package/dist/esm/lib/utils/resolve-github-annotations.js.map +1 -1
- package/dist/esm/lib/utils/resolve-package.js +1 -0
- package/dist/esm/lib/utils/resolve-package.js.map +1 -1
- package/dist/esm/lib/utils/{resolve-package-repo.js → resolve-repo-from-package.js} +2 -1
- package/dist/esm/lib/utils/resolve-repo-from-package.js.map +1 -0
- package/dist/esm/lib/utils/safe-rm-sync.js +20 -0
- package/dist/esm/lib/utils/safe-rm-sync.js.map +1 -0
- package/dist/esm/lib/utils/{path-security.js → validate-safe-path.js} +3 -19
- package/dist/esm/lib/utils/validate-safe-path.js.map +1 -0
- package/dist/esm/version.js +1 -1
- package/dist/types/bin/{portal-build.d.ts → build-portal.d.ts} +6 -6
- package/dist/types/bin/{app-pack.d.ts → bundle-app.d.ts} +1 -1
- package/dist/types/bin/{app-check.d.ts → check-app.d.ts} +2 -1
- package/dist/types/bin/configure-framework.d.ts +58 -0
- package/dist/types/bin/fusion-env.d.ts +24 -0
- package/dist/types/bin/{portal-config.d.ts → generate-portal-config.d.ts} +1 -1
- package/dist/types/bin/helpers/ProjectTemplate.d.ts +7 -1
- package/dist/types/bin/helpers/ProjectTemplateRepository.d.ts +15 -0
- package/dist/types/bin/helpers/install-package-dependencies.d.ts +1 -0
- package/dist/types/bin/helpers/parse-templates-manifest.d.ts +20 -0
- package/dist/types/bin/helpers/resolve-app-from-artifact.d.ts +1 -1
- package/dist/types/bin/helpers/{project-templates.schema.d.ts → template.schemas.d.ts} +7 -26
- package/dist/types/bin/index.d.ts +23 -20
- package/dist/types/bin/initialize-framework.d.ts +39 -0
- package/dist/types/bin/{app-manifest.d.ts → load-app-manifest.d.ts} +1 -1
- package/dist/types/bin/{app-config-publish.d.ts → publish-app-config.d.ts} +2 -2
- package/dist/types/bin/{portal-config-publish.d.ts → publish-portal-config.d.ts} +2 -1
- package/dist/types/bin/resolve-default-env.d.ts +8 -0
- package/dist/types/bin/{portal-tag.d.ts → tag-portal.d.ts} +1 -1
- package/dist/types/bin/{app-upload.d.ts → upload-application.d.ts} +1 -1
- package/dist/types/bin/{portal-upload.d.ts → upload-portal-bundle.d.ts} +1 -1
- package/dist/types/bin/utils/ConsoleLogger.d.ts +1 -1
- package/dist/types/bin/utils/{spinner.d.ts → Spinner.d.ts} +8 -0
- package/dist/types/bin/utils/auth-error-docs.d.ts +7 -0
- package/dist/types/bin/utils/create-dev-server-config.d.ts +47 -0
- package/dist/types/bin/utils/create-dev-server.d.ts +2 -47
- package/dist/types/bin/utils/env-token-hint.d.ts +7 -0
- package/dist/types/bin/utils/format-auth-error.d.ts +0 -17
- package/dist/types/bin/utils/format-byte-size.d.ts +16 -0
- package/dist/types/bin/utils/format-path.d.ts +16 -0
- package/dist/types/bin/utils/format-token-acquisition-error.d.ts +17 -0
- package/dist/types/bin/utils/index.d.ts +9 -5
- package/dist/types/bin/utils/normalize-dev-server-config.d.ts +24 -0
- package/dist/types/cli/commands/app/default-archive.d.ts +4 -0
- package/dist/types/cli/commands/app/{pack.d.ts → pack.command.d.ts} +0 -1
- package/dist/types/cli/commands/create/_helpers/check-target-directory.d.ts +1 -0
- package/dist/types/cli/commands/index.d.ts +2 -2
- package/dist/types/cli/options/{env.d.ts → create-env-option.d.ts} +0 -5
- package/dist/types/cli/options/options.d.ts +20 -0
- package/dist/types/cli/options/{auth.d.ts → with-auth-options.d.ts} +0 -20
- package/dist/types/cli/plugins/load-plugins.d.ts +9 -0
- package/dist/types/lib/app/{app-config.d.ts → define-app-config.d.ts} +2 -2
- package/dist/types/lib/app/define-app-package.d.ts +26 -0
- package/dist/types/lib/app/index.d.ts +5 -5
- package/dist/types/lib/app/load-app-config.d.ts +2 -2
- package/dist/types/lib/app/load-app-manifest.d.ts +1 -1
- package/dist/types/lib/app/resolve-app-key.d.ts +11 -0
- package/dist/types/lib/define-app-config.d.ts +12 -0
- package/dist/types/lib/define-app-manifest.d.ts +12 -0
- package/dist/types/lib/define-dev-server-config.d.ts +21 -0
- package/dist/types/lib/dev-server.d.ts +2 -1
- package/dist/types/lib/index.d.ts +6 -4
- package/dist/types/lib/load-dev-server-config.d.ts +1 -20
- package/dist/types/lib/portal/{create-portal-manifest.d.ts → create-portal-manifest-from-package.d.ts} +1 -1
- package/dist/types/lib/portal/{portal-manifest.d.ts → define-portal-manifest.d.ts} +5 -13
- package/dist/types/lib/portal/define-portal-schema.d.ts +24 -0
- package/dist/types/lib/portal/index.d.ts +4 -3
- package/dist/types/lib/portal/load-portal-config.d.ts +1 -1
- package/dist/types/lib/portal/load-portal-manifest.d.ts +1 -1
- package/dist/types/lib/portal/load-portal-schema.d.ts +1 -23
- package/dist/types/lib/portal/portal-manifest-build-schema.d.ts +32 -0
- package/dist/types/lib/portal/{portal-manifest.schema.d.ts → portal-manifest-schema.d.ts} +0 -31
- package/dist/types/lib/portal/validate-portal-manifest.d.ts +11 -0
- package/dist/types/lib/static.d.ts +0 -9
- package/dist/types/lib/utils/assert-object.d.ts +20 -0
- package/dist/types/lib/utils/assert.d.ts +1 -100
- package/dist/types/lib/utils/fetch-latest-version.d.ts +20 -0
- package/dist/types/lib/utils/{package-info.d.ts → fetch-package-info.d.ts} +0 -45
- package/dist/types/lib/utils/file-exists-sync.d.ts +21 -0
- package/dist/types/lib/utils/file-exists.d.ts +0 -15
- package/dist/types/lib/utils/index.d.ts +4 -3
- package/dist/types/lib/utils/safe-rm-sync.d.ts +15 -0
- package/dist/types/lib/utils/{path-security.d.ts → validate-safe-path.d.ts} +0 -15
- package/dist/types/version.d.ts +1 -1
- package/package.json +12 -12
- package/dist/esm/lib/app/app-config.js.map +0 -1
- package/dist/esm/lib/app/app-manifest.js.map +0 -1
- package/dist/esm/lib/app/app-package.js +0 -92
- package/dist/esm/lib/app/app-package.js.map +0 -1
- package/dist/esm/lib/app/create-app-manifest.js.map +0 -1
- package/dist/esm/lib/app/merge-app-manifest.js.map +0 -1
- package/dist/esm/lib/app/schemas.js.map +0 -1
- package/dist/esm/lib/fusion-cli-config.js.map +0 -1
- package/dist/esm/lib/legacy.js +0 -38
- package/dist/esm/lib/legacy.js.map +0 -1
- package/dist/esm/lib/portal/create-portal-manifest.js.map +0 -1
- package/dist/esm/lib/portal/portal-config.js.map +0 -1
- package/dist/esm/lib/portal/portal-manifest.js.map +0 -1
- package/dist/esm/lib/portal/portal-manifest.schema.js.map +0 -1
- package/dist/esm/lib/utils/extension-filter.js.map +0 -1
- package/dist/esm/lib/utils/package-info.js +0 -135
- package/dist/esm/lib/utils/package-info.js.map +0 -1
- package/dist/esm/lib/utils/parse-json-request.js.map +0 -1
- package/dist/esm/lib/utils/path-security.js.map +0 -1
- package/dist/esm/lib/utils/resolve-package-repo.js.map +0 -1
- package/dist/esm/lib/utils/resolve-source-entry-point.js.map +0 -1
- package/dist/esm/lib/utils/snapshot.js.map +0 -1
- package/dist/types/bin/framework.node.d.ts +0 -123
- package/dist/types/bin/utils/format.d.ts +0 -35
- package/dist/types/cli/plugins/loader.d.ts +0 -2
- package/dist/types/lib/app/app-package.d.ts +0 -76
- package/dist/types/lib/legacy.d.ts +0 -24
- package/dist/types/bin/{app-build.d.ts → build-application.d.ts} +0 -0
- package/dist/types/bin/{portal-pack.d.ts → bundle-portal.d.ts} +5 -5
- package/dist/types/bin/{app-config.d.ts → generate-application-config.d.ts} +0 -0
- package/dist/types/bin/helpers/{load-bundle-metadata.d.ts → load-metadata.d.ts} +0 -0
- package/dist/types/bin/{portal-manifest.d.ts → load-portal-manifest.d.ts} +5 -5
- /package/dist/types/bin/{app-serve.d.ts → serve-application.d.ts} +0 -0
- /package/dist/types/bin/{portal-serve.d.ts → serve-portal.d.ts} +0 -0
- /package/dist/types/bin/{app-dev.d.ts → start-app-dev-server.d.ts} +0 -0
- /package/dist/types/bin/{portal-dev.d.ts → start-portal-dev-server.d.ts} +0 -0
- /package/dist/types/bin/{app-tag.d.ts → tag-application.d.ts} +0 -0
- /package/dist/types/bin/utils/{defaultHeaders.d.ts → default-headers.d.ts} +0 -0
- /package/dist/types/cli/commands/app/{build.d.ts → build.command.d.ts} +0 -0
- /package/dist/types/cli/commands/app/{check.d.ts → check.command.d.ts} +0 -0
- /package/dist/types/cli/commands/app/{config.d.ts → config.command.d.ts} +0 -0
- /package/dist/types/cli/commands/app/{dev.d.ts → dev.command.d.ts} +0 -0
- /package/dist/types/cli/commands/app/{manifest.d.ts → manifest.command.d.ts} +0 -0
- /package/dist/types/cli/commands/app/{publish.d.ts → publish.command.d.ts} +0 -0
- /package/dist/types/cli/commands/app/{serve.d.ts → serve.command.d.ts} +0 -0
- /package/dist/types/cli/commands/app/{tag.d.ts → tag.command.d.ts} +0 -0
- /package/dist/types/cli/commands/app/{upload.d.ts → upload.command.d.ts} +0 -0
- /package/dist/types/cli/commands/auth/{login.d.ts → login.command.d.ts} +0 -0
- /package/dist/types/cli/commands/auth/{logout.d.ts → logout.command.d.ts} +0 -0
- /package/dist/types/cli/commands/auth/{token.d.ts → token.command.d.ts} +0 -0
- /package/dist/types/cli/commands/create/_helpers/{resolve-workspace-dependencies.d.ts → resolve-package-json-workspace-dependencies.d.ts} +0 -0
- /package/dist/types/cli/commands/create/{app.d.ts → create-app-command.d.ts} +0 -0
- /package/dist/types/cli/commands/portal/{build.d.ts → build.command.d.ts} +0 -0
- /package/dist/types/cli/commands/portal/{config.d.ts → config.command.d.ts} +0 -0
- /package/dist/types/cli/commands/portal/{dev.d.ts → dev.command.d.ts} +0 -0
- /package/dist/types/cli/commands/portal/{manifest.d.ts → manifest.command.d.ts} +0 -0
- /package/dist/types/cli/commands/portal/{pack.d.ts → pack.command.d.ts} +0 -0
- /package/dist/types/cli/commands/portal/{publish.d.ts → publish.command.d.ts} +0 -0
- /package/dist/types/cli/commands/portal/{schema.d.ts → schema.command.d.ts} +0 -0
- /package/dist/types/cli/commands/portal/{serve.d.ts → serve.command.d.ts} +0 -0
- /package/dist/types/cli/commands/portal/{tag.d.ts → tag.command.d.ts} +0 -0
- /package/dist/types/cli/commands/portal/{upload.d.ts → upload.command.d.ts} +0 -0
- /package/dist/types/lib/app/{schemas.d.ts → api-app-config-schema.d.ts} +0 -0
- /package/dist/types/lib/app/{create-app-manifest.d.ts → create-app-manifest-from-package.d.ts} +0 -0
- /package/dist/types/lib/app/{app-manifest.d.ts → define-app-manifest.d.ts} +0 -0
- /package/dist/types/lib/app/{merge-app-manifest.d.ts → merge-app-manifests.d.ts} +0 -0
- /package/dist/types/lib/{fusion-cli-config.d.ts → define-fusion-cli.d.ts} +0 -0
- /package/dist/types/lib/portal/{portal-config.d.ts → define-portal-config.d.ts} +0 -0
- /package/dist/types/lib/utils/{extension-filter.d.ts → create-extension-filter-pattern.d.ts} +0 -0
- /package/dist/types/lib/utils/{snapshot.d.ts → generate-snapshot-version.d.ts} +0 -0
- /package/dist/types/lib/utils/{parse-json-request.d.ts → parse-json-from-request.d.ts} +0 -0
- /package/dist/types/lib/utils/{resolve-source-entry-point.d.ts → resolve-entry-point.d.ts} +0 -0
- /package/dist/types/lib/utils/{resolve-package-repo.d.ts → resolve-repo-from-package.d.ts} +0 -0
|
@@ -39,6 +39,7 @@ export const resolveDevopsAnnotations = () => {
|
|
|
39
39
|
const reason = process.env.BUILD_REASON || 'unknown'; // Reason for the build
|
|
40
40
|
// Construct a direct URL to the build results if all required parts are available
|
|
41
41
|
let runUrl = 'unknown';
|
|
42
|
+
// Only construct a results URL when all required pieces are known
|
|
42
43
|
if (orgUrl !== 'unknown' && project !== 'unknown' && runId !== 'unknown') {
|
|
43
44
|
// Remove trailing slash from orgUrl if present, then build the run results URL
|
|
44
45
|
runUrl = `${orgUrl.replace(/\/$/, '')}${project}/_build/results?buildId=${runId}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-devops-annotations.js","sourceRoot":"","sources":["../../../../src/lib/utils/resolve-devops-annotations.ts"],"names":[],"mappings":"AA0BA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAsB,EAAE;IAC9D,mFAAmF;IACnF,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,SAAS,CAAC,CAAC,8BAA8B;IACpF,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,SAAS,CAAC;IACnE,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;IAC5E,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,SAAS,CAAC,CAAC,uBAAuB;IAE7E,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,GAAsB;QACrC,KAAK;QACL,YAAY;QACZ,UAAU;QACV,OAAO;QACP,MAAM;QACN,KAAK;QACL,MAAM;QACN,QAAQ;QACR,MAAM;QACN,MAAM;KACP,CAAC;IAEF,2CAA2C;IAC3C,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"resolve-devops-annotations.js","sourceRoot":"","sources":["../../../../src/lib/utils/resolve-devops-annotations.ts"],"names":[],"mappings":"AA0BA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAsB,EAAE;IAC9D,mFAAmF;IACnF,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,SAAS,CAAC,CAAC,8BAA8B;IACpF,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,SAAS,CAAC;IACnE,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;IAC5E,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,SAAS,CAAC,CAAC,uBAAuB;IAE7E,kFAAkF;IAClF,IAAI,MAAM,GAAG,SAAS,CAAC;IACvB,kEAAkE;IAClE,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,GAAsB;QACrC,KAAK;QACL,YAAY;QACZ,UAAU;QACV,OAAO;QACP,MAAM;QACN,KAAK;QACL,MAAM;QACN,QAAQ;QACR,MAAM;QACN,MAAM;KACP,CAAC;IAEF,2CAA2C;IAC3C,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fileExistsSync } from './file-exists.js';
|
|
1
|
+
import { fileExistsSync } from './file-exists-sync.js';
|
|
2
2
|
import { resolve } from 'node:path';
|
|
3
3
|
/**
|
|
4
4
|
* List of default entry point filenames to check for in a source directory.
|
|
@@ -24,6 +24,7 @@ export const resolveEntryPoint = (cwd, dir, opt) => {
|
|
|
24
24
|
// Use provided files or default entry point files.
|
|
25
25
|
const files = opt?.files ?? ENTRY_POINT_FILES;
|
|
26
26
|
// Attempt to find the first file that exists in the directory.
|
|
27
|
+
// Resolve every candidate filename against the source directory first
|
|
27
28
|
const entryPoint = files
|
|
28
29
|
.map((file) => resolve(sourceDirectory, file))
|
|
29
30
|
.find((file) => fileExistsSync(file));
|
|
@@ -36,4 +37,4 @@ export const resolveEntryPoint = (cwd, dir, opt) => {
|
|
|
36
37
|
};
|
|
37
38
|
// Export as default for convenience in import statements.
|
|
38
39
|
export default resolveEntryPoint;
|
|
39
|
-
//# sourceMappingURL=resolve-
|
|
40
|
+
//# sourceMappingURL=resolve-entry-point.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-entry-point.js","sourceRoot":"","sources":["../../../../src/lib/utils/resolve-entry-point.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,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,sEAAsE;IACtE,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"}
|
|
@@ -15,7 +15,7 @@ export const resolveGitCommitSha = (ref = 'HEAD') => {
|
|
|
15
15
|
try {
|
|
16
16
|
return execSync(`git rev-parse ${ref}`).toString().trim();
|
|
17
17
|
}
|
|
18
|
-
catch (
|
|
18
|
+
catch (_error) {
|
|
19
19
|
// most likely due to not being in a git repository or invalid ref
|
|
20
20
|
return undefined; // Return undefined if the command fails or ref is not valid
|
|
21
21
|
}
|
|
@@ -1 +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,
|
|
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,MAAM,EAAE,CAAC;QAChB,kEAAkE;QAClE,OAAO,SAAS,CAAC,CAAC,4DAA4D;IAChF,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -15,7 +15,7 @@ export const resolveGitRemoteUrl = () => {
|
|
|
15
15
|
const origin = execSync('git remote get-url origin').toString().trim();
|
|
16
16
|
return origin.replace('git@github.com:', 'https://github.com/').replace(/\.git$/, '');
|
|
17
17
|
}
|
|
18
|
-
catch (
|
|
18
|
+
catch (_error) {
|
|
19
19
|
// most likely due to not being in a git repository or no remote named "origin"
|
|
20
20
|
return undefined; // Return undefined if the command fails or origin is not set
|
|
21
21
|
}
|
|
@@ -1 +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,
|
|
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,MAAM,EAAE,CAAC;QAChB,+EAA+E;QAC/E,OAAO,SAAS,CAAC,CAAC,6DAA6D;IACjF,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -42,6 +42,7 @@ export const resolveGithubAnnotations = () => {
|
|
|
42
42
|
const serverUrl = process.env.GITHUB_SERVER_URL || 'https://github.com';
|
|
43
43
|
// Construct a direct URL to the workflow run if all required parts are available
|
|
44
44
|
let runUrl = 'unknown';
|
|
45
|
+
// Only build the URL when we have enough context to make it meaningful
|
|
45
46
|
if (serverUrl && repository !== 'unknown' && runId !== 'unknown') {
|
|
46
47
|
// Remove trailing slash from serverUrl if present, then build the run results URL
|
|
47
48
|
runUrl = `${serverUrl.replace(/\/$/, '')}/${repository}/actions/runs/${runId}`;
|
|
@@ -58,9 +59,12 @@ export const resolveGithubAnnotations = () => {
|
|
|
58
59
|
if (process.env.GITHUB_EVENT_PATH) {
|
|
59
60
|
try {
|
|
60
61
|
const rawPayload = readFileSync(process.env.GITHUB_EVENT_PATH, 'utf8');
|
|
62
|
+
// Layer the parsed event payload fields onto the base annotations
|
|
61
63
|
Object.assign(annotations, JSON.parse(rawPayload));
|
|
62
64
|
}
|
|
63
65
|
catch {
|
|
66
|
+
// A malformed or unreadable event payload should not crash annotation resolution —
|
|
67
|
+
// log and fall back to the base annotations collected above.
|
|
64
68
|
console.error('Failed to parse GitHub event payload');
|
|
65
69
|
}
|
|
66
70
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-github-annotations.js","sourceRoot":"","sources":["../../../../src/lib/utils/resolve-github-annotations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAwGvC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAsB,EAAE;IAC9D,sCAAsC;IACtC,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,SAAS,CAAC;IAC7D,kDAAkD;IAClD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,SAAS,CAAC;IACpD,iBAAiB;IACjB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,SAAS,CAAC;IACrD,8CAA8C;IAC9C,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,SAAS,CAAC;IAE9D,wBAAwB;IACxB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,SAAS,CAAC;IAE1D,4DAA4D;IAC5D,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,oBAAoB,CAAC;IAExE,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,GAAsB;QACrC,SAAS;QACT,KAAK;QACL,KAAK;QACL,MAAM;QACN,QAAQ;KACT,CAAC;IAEF,qCAAqC;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,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;QACrD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IACD,2CAA2C;IAC3C,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"resolve-github-annotations.js","sourceRoot":"","sources":["../../../../src/lib/utils/resolve-github-annotations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAwGvC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAsB,EAAE;IAC9D,sCAAsC;IACtC,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,SAAS,CAAC;IAC7D,kDAAkD;IAClD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,SAAS,CAAC;IACpD,iBAAiB;IACjB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,SAAS,CAAC;IACrD,8CAA8C;IAC9C,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,SAAS,CAAC;IAE9D,wBAAwB;IACxB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,SAAS,CAAC;IAE1D,4DAA4D;IAC5D,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,oBAAoB,CAAC;IAExE,iFAAiF;IACjF,IAAI,MAAM,GAAG,SAAS,CAAC;IACvB,uEAAuE;IACvE,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,GAAsB;QACrC,SAAS;QACT,KAAK;QACL,KAAK;QACL,MAAM;QACN,QAAQ;KACT,CAAC;IAEF,qCAAqC;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,kEAAkE;YAClE,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;QACrD,CAAC;QAAC,MAAM,CAAC;YACP,mFAAmF;YACnF,6DAA6D;YAC7D,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IACD,2CAA2C;IAC3C,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
|
|
@@ -10,6 +10,7 @@ import normalizePackageData from 'normalize-package-data'; // Correct import for
|
|
|
10
10
|
*/
|
|
11
11
|
export const resolvePackage = async (options) => {
|
|
12
12
|
const pkg = await readPackageUp({ ...options, normalize: false });
|
|
13
|
+
// No package.json means there's nothing valid to resolve
|
|
13
14
|
if (!pkg) {
|
|
14
15
|
throw new Error('failed to find package.json');
|
|
15
16
|
}
|
|
@@ -1 +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;AAEzB,OAAO,oBAAoB,MAAM,wBAAwB,CAAC,CAAC,4CAA4C;AAQvG;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EAAE,OAA+B,EAA4B,EAAE;IAChG,MAAM,GAAG,GAAG,MAAM,aAAa,CAAC,EAAE,GAAG,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;IAClE,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACjD,CAAC;IACD,6EAA6E;IAC7E,MAAM,qBAAqB,GAAG,EAAE,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;IACrD,oBAAoB,CAAC,qBAAqB,CAAC,CAAC;IAC5C,MAAM,WAAW,GAAG,EAAE,GAAG,qBAAqB,EAAE,OAAO,EAAE,GAAG,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;IACnF,OAAO;QACL,WAAW;QACX,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;KACL,CAAC;AACvB,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
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;AAEzB,OAAO,oBAAoB,MAAM,wBAAwB,CAAC,CAAC,4CAA4C;AAQvG;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EAAE,OAA+B,EAA4B,EAAE;IAChG,MAAM,GAAG,GAAG,MAAM,aAAa,CAAC,EAAE,GAAG,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;IAClE,yDAAyD;IACzD,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACjD,CAAC;IACD,6EAA6E;IAC7E,MAAM,qBAAqB,GAAG,EAAE,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;IACrD,oBAAoB,CAAC,qBAAqB,CAAC,CAAC;IAC5C,MAAM,WAAW,GAAG,EAAE,GAAG,qBAAqB,EAAE,OAAO,EAAE,GAAG,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;IACnF,OAAO;QACL,WAAW;QACX,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;KACL,CAAC;AACvB,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -6,9 +6,10 @@
|
|
|
6
6
|
* @throws Will throw an error if the `package.json` does not contain a repository field.
|
|
7
7
|
*/
|
|
8
8
|
export const resolveRepoFromPackage = (pkg) => {
|
|
9
|
+
// repository may be a plain URL string or an object with a `url` field
|
|
9
10
|
if (pkg.repository) {
|
|
10
11
|
return typeof pkg.repository === 'string' ? pkg.repository : pkg.repository.url;
|
|
11
12
|
}
|
|
12
13
|
return undefined;
|
|
13
14
|
};
|
|
14
|
-
//# sourceMappingURL=resolve-package
|
|
15
|
+
//# sourceMappingURL=resolve-repo-from-package.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-repo-from-package.js","sourceRoot":"","sources":["../../../../src/lib/utils/resolve-repo-from-package.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,GAAgB,EAAsB,EAAE;IAC7E,uEAAuE;IACvE,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,20 @@
|
|
|
1
|
+
import { rmSync } from 'node:fs';
|
|
2
|
+
import { validateSafePath } from './validate-safe-path.js';
|
|
3
|
+
/**
|
|
4
|
+
* Safely removes a directory with path traversal protection.
|
|
5
|
+
*
|
|
6
|
+
* This function validates the target path before performing the removal
|
|
7
|
+
* operation to prevent accidental deletion of unintended directories.
|
|
8
|
+
*
|
|
9
|
+
* @param targetPath - The path to remove
|
|
10
|
+
* @param options - rmSync options
|
|
11
|
+
* @param baseDir - Optional base directory constraint
|
|
12
|
+
* @throws {Error} If path validation fails or removal operation fails
|
|
13
|
+
*/
|
|
14
|
+
export function safeRmSync(targetPath, options, baseDir) {
|
|
15
|
+
// Validate the path before removal
|
|
16
|
+
const safePath = validateSafePath(targetPath, baseDir);
|
|
17
|
+
// Perform the removal operation
|
|
18
|
+
rmSync(safePath, options);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=safe-rm-sync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safe-rm-sync.js","sourceRoot":"","sources":["../../../../src/lib/utils/safe-rm-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;;;;;;;;;GAUG;AACH,MAAM,UAAU,UAAU,CACxB,UAAkB,EAClB,OAA+C,EAC/C,OAAgB;IAEhB,mCAAmC;IACnC,MAAM,QAAQ,GAAG,gBAAgB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAEvD,gCAAgC;IAChC,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { resolve } from 'node:path';
|
|
2
|
-
import { rmSync } from 'node:fs';
|
|
3
2
|
import isPathInside from 'is-path-inside';
|
|
4
3
|
/**
|
|
5
4
|
* Validates that a target path is safe for file system operations.
|
|
@@ -22,6 +21,7 @@ import isPathInside from 'is-path-inside';
|
|
|
22
21
|
* ```
|
|
23
22
|
*/
|
|
24
23
|
export function validateSafePath(targetPath, baseDir) {
|
|
24
|
+
// Reject blank/whitespace-only input before attempting to resolve it
|
|
25
25
|
if (typeof targetPath !== 'string' || targetPath.trim() === '') {
|
|
26
26
|
throw new Error('Target path must be a non-empty string');
|
|
27
27
|
}
|
|
@@ -30,27 +30,11 @@ export function validateSafePath(targetPath, baseDir) {
|
|
|
30
30
|
// If baseDir is provided, ensure target path is within it using the established library
|
|
31
31
|
if (baseDir) {
|
|
32
32
|
const resolvedBaseDir = resolve(baseDir);
|
|
33
|
+
// Reject any path that escapes the configured base directory
|
|
33
34
|
if (!isPathInside(resolvedPath, resolvedBaseDir)) {
|
|
34
35
|
throw new Error('The target path must be within the specified base directory. Please specify a relative path or ensure the absolute path is within the base directory.');
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
return resolvedPath;
|
|
38
39
|
}
|
|
39
|
-
|
|
40
|
-
* Safely removes a directory with path traversal protection.
|
|
41
|
-
*
|
|
42
|
-
* This function validates the target path before performing the removal
|
|
43
|
-
* operation to prevent accidental deletion of unintended directories.
|
|
44
|
-
*
|
|
45
|
-
* @param targetPath - The path to remove
|
|
46
|
-
* @param options - rmSync options
|
|
47
|
-
* @param baseDir - Optional base directory constraint
|
|
48
|
-
* @throws {Error} If path validation fails or removal operation fails
|
|
49
|
-
*/
|
|
50
|
-
export function safeRmSync(targetPath, options, baseDir) {
|
|
51
|
-
// Validate the path before removal
|
|
52
|
-
const safePath = validateSafePath(targetPath, baseDir);
|
|
53
|
-
// Perform the removal operation
|
|
54
|
-
rmSync(safePath, options);
|
|
55
|
-
}
|
|
56
|
-
//# sourceMappingURL=path-security.js.map
|
|
40
|
+
//# sourceMappingURL=validate-safe-path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-safe-path.js","sourceRoot":"","sources":["../../../../src/lib/utils/validate-safe-path.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,gBAAgB,CAAC,UAAkB,EAAE,OAAgB;IACnE,qEAAqE;IACrE,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QAC/D,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC5D,CAAC;IAED,+CAA+C;IAC/C,MAAM,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAEzC,wFAAwF;IACxF,IAAI,OAAO,EAAE,CAAC;QACZ,MAAM,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;QAEzC,6DAA6D;QAC7D,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,eAAe,CAAC,EAAE,CAAC;YACjD,MAAM,IAAI,KAAK,CACb,uJAAuJ,CACxJ,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC"}
|
package/dist/esm/version.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { FusionEnv } from './fusion-env.js';
|
|
2
2
|
import { type ConsoleLogger } from './utils/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Options for building a portal application using Vite.
|
|
@@ -32,24 +32,24 @@ export declare const buildPortal: (opt?: BuildApplicationOptions) => Promise<{
|
|
|
32
32
|
pkg: import("../lib/index.js").ResolvedPackage;
|
|
33
33
|
manifest: {
|
|
34
34
|
name: string;
|
|
35
|
+
displayName?: string | undefined;
|
|
36
|
+
description?: string | undefined;
|
|
35
37
|
build: {
|
|
36
38
|
templateEntry: string;
|
|
37
39
|
schemaEntry: string;
|
|
40
|
+
assetPath?: string | undefined;
|
|
41
|
+
githubRepo?: string | undefined;
|
|
38
42
|
version: string;
|
|
39
43
|
timestamp: string;
|
|
40
44
|
commitSha: string;
|
|
41
45
|
annotations: {
|
|
42
46
|
[k: string]: string | null | undefined;
|
|
43
47
|
} | undefined;
|
|
44
|
-
allowedExtensions: string[];
|
|
45
|
-
assetPath?: string | undefined;
|
|
46
|
-
githubRepo?: string | undefined;
|
|
47
48
|
projectPage?: string | undefined;
|
|
49
|
+
allowedExtensions: string[];
|
|
48
50
|
schema?: Record<string, unknown> | undefined;
|
|
49
51
|
config?: Record<string, unknown> | undefined;
|
|
50
52
|
};
|
|
51
|
-
displayName?: string | undefined;
|
|
52
|
-
description?: string | undefined;
|
|
53
53
|
};
|
|
54
54
|
outDir: any;
|
|
55
55
|
}>;
|
|
@@ -42,5 +42,5 @@ export type BundleAppOptions = {
|
|
|
42
42
|
*/
|
|
43
43
|
export declare const bundleApp: (options: BundleAppOptions) => Promise<{
|
|
44
44
|
archive: import("node_modules/adm-zip/types.js");
|
|
45
|
-
manifest: import("node_modules/@equinor/fusion-framework-module-app/
|
|
45
|
+
manifest: import("node_modules/@equinor/fusion-framework-module-app/src/types.js").AppManifest;
|
|
46
46
|
}>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { FusionEnv } from './fusion-env.js';
|
|
2
|
+
import type { FusionFrameworkSettings } from './configure-framework.js';
|
|
2
3
|
import { type ConsoleLogger } from './utils/index.js';
|
|
3
4
|
/**
|
|
4
5
|
* Options for checking application registration in the app store.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ModulesConfigurator } from '@equinor/fusion-framework-module';
|
|
2
|
+
import { FusionEnv, type Modules } from './fusion-env.js';
|
|
3
|
+
/**
|
|
4
|
+
* Auth option for direct token usage.
|
|
5
|
+
*/
|
|
6
|
+
interface AuthTokenOptions {
|
|
7
|
+
token: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Auth option for silent authentication (non-interactive).
|
|
11
|
+
*/
|
|
12
|
+
interface AuthSilentOptions {
|
|
13
|
+
clientId: string;
|
|
14
|
+
tenantId: string;
|
|
15
|
+
interactive?: false;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Auth option for interactive authentication, including server config.
|
|
19
|
+
*/
|
|
20
|
+
interface AuthInteractiveOptions extends Omit<AuthSilentOptions, 'interactive'> {
|
|
21
|
+
interactive: true;
|
|
22
|
+
server: {
|
|
23
|
+
port: number;
|
|
24
|
+
onOpen?: (url: string) => void;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Auth option for Azure Identity's DefaultAzureCredential.
|
|
29
|
+
* No configuration needed — credentials are resolved from the environment.
|
|
30
|
+
*/
|
|
31
|
+
interface AuthDefaultCredentialOptions {
|
|
32
|
+
defaultCredential: true;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Settings for initializing the Fusion Framework.
|
|
36
|
+
* Includes environment, authentication, and service discovery options.
|
|
37
|
+
*/
|
|
38
|
+
export type FusionFrameworkSettings = {
|
|
39
|
+
env?: (typeof FusionEnv)[keyof typeof FusionEnv];
|
|
40
|
+
auth: AuthTokenOptions | AuthSilentOptions | AuthInteractiveOptions | AuthDefaultCredentialOptions;
|
|
41
|
+
serviceDiscovery?: {
|
|
42
|
+
url?: string;
|
|
43
|
+
scope?: string[];
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Configures the Fusion Framework with the provided settings and returns a configurator.
|
|
48
|
+
*
|
|
49
|
+
* This function creates and configures a module configurator with HTTP, service discovery,
|
|
50
|
+
* and authentication modules based on the supplied configuration. The returned configurator
|
|
51
|
+
* can be further customized before initialization.
|
|
52
|
+
*
|
|
53
|
+
* @param config - The settings for framework configuration.
|
|
54
|
+
* @returns A configured module configurator ready for initialization.
|
|
55
|
+
* @throws Will throw if required authentication parameters are missing.
|
|
56
|
+
*/
|
|
57
|
+
export declare const configureFramework: (config: FusionFrameworkSettings) => ModulesConfigurator<Modules>;
|
|
58
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ModulesInstance, AnyModule } from '@equinor/fusion-framework-module';
|
|
2
|
+
import type { AzureIdentityModule } from '@equinor/fusion-framework-module-azure-identity';
|
|
3
|
+
import type { HttpModule } from '@equinor/fusion-framework-module-http';
|
|
4
|
+
import type { ServiceDiscoveryModule } from '@equinor/fusion-framework-module-service-discovery';
|
|
5
|
+
export type Modules = [AzureIdentityModule, HttpModule, ServiceDiscoveryModule];
|
|
6
|
+
/**
|
|
7
|
+
* Type representing the initialized Fusion Framework instance.
|
|
8
|
+
* This is a composition of the modules defined in the Modules tuple.
|
|
9
|
+
*/
|
|
10
|
+
export type FusionFramework<TExtra extends Array<AnyModule> = []> = ModulesInstance<[
|
|
11
|
+
...Modules,
|
|
12
|
+
...TExtra
|
|
13
|
+
]>;
|
|
14
|
+
/**
|
|
15
|
+
* Enum for supported Fusion environments.
|
|
16
|
+
* Used to select the correct environment for service discovery and authentication.
|
|
17
|
+
*/
|
|
18
|
+
export declare enum FusionEnv {
|
|
19
|
+
ContinuesIntegration = "ci",
|
|
20
|
+
QualityAssurance = "fqa",
|
|
21
|
+
Training = "tr",
|
|
22
|
+
Production = "fprd",
|
|
23
|
+
Development = "dev"
|
|
24
|
+
}
|
|
@@ -40,7 +40,7 @@ interface GeneratePortalConfigOptions {
|
|
|
40
40
|
* @public
|
|
41
41
|
*/
|
|
42
42
|
export declare const generatePortalConfig: (options?: GeneratePortalConfigOptions) => Promise<{
|
|
43
|
-
config: import("../lib/portal/portal-config.js").PortalConfig;
|
|
43
|
+
config: import("../lib/portal/define-portal-config.js").PortalConfig;
|
|
44
44
|
pkg: import("@equinor/fusion-framework-cli/lib").ResolvedPackage;
|
|
45
45
|
}>;
|
|
46
46
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ConsoleLogger } from '@equinor/fusion-framework-cli/bin';
|
|
2
|
-
import type { TemplateResource, TemplateItem } from './
|
|
2
|
+
import type { TemplateResource, TemplateItem } from './template.schemas.js';
|
|
3
3
|
/**
|
|
4
4
|
* Represents a template for creating Fusion Framework applications.
|
|
5
5
|
*
|
|
@@ -19,16 +19,22 @@ export declare class ProjectTemplate {
|
|
|
19
19
|
/**
|
|
20
20
|
* The name of the template as defined in the manifest.
|
|
21
21
|
* Used for template identification and selection.
|
|
22
|
+
*
|
|
23
|
+
* @returns The template name.
|
|
22
24
|
*/
|
|
23
25
|
get name(): string;
|
|
24
26
|
/**
|
|
25
27
|
* The description of the template as defined in the manifest.
|
|
26
28
|
* Provides human-readable information about what the template creates.
|
|
29
|
+
*
|
|
30
|
+
* @returns The template description.
|
|
27
31
|
*/
|
|
28
32
|
get description(): string;
|
|
29
33
|
/**
|
|
30
34
|
* The resources included in this template.
|
|
31
35
|
* Each resource defines a file or directory to be copied to the target.
|
|
36
|
+
*
|
|
37
|
+
* @returns The list of template resources.
|
|
32
38
|
*/
|
|
33
39
|
get resources(): TemplateResource[];
|
|
34
40
|
/**
|
|
@@ -107,7 +107,22 @@ export declare class ProjectTemplateRepository {
|
|
|
107
107
|
* @returns Promise resolving to true if cleanup was performed, false if failed
|
|
108
108
|
*/
|
|
109
109
|
cleanup(): Promise<boolean>;
|
|
110
|
+
/**
|
|
111
|
+
* Clones the repository into the configured base directory using a single branch.
|
|
112
|
+
*
|
|
113
|
+
* @throws Error if the clone operation fails.
|
|
114
|
+
*/
|
|
110
115
|
_cloneRepo(): Promise<void>;
|
|
116
|
+
/**
|
|
117
|
+
* Fetches and checks out the configured branch, pulling and hard-resetting
|
|
118
|
+
* if the local branch is behind its remote counterpart.
|
|
119
|
+
*
|
|
120
|
+
* @throws Error if fetching or checking out the branch fails.
|
|
121
|
+
*/
|
|
111
122
|
_checkoutBranch(): Promise<void>;
|
|
123
|
+
/**
|
|
124
|
+
* Registers stdout/stderr output handlers on the underlying git client so
|
|
125
|
+
* repository operations are logged via the configured logger.
|
|
126
|
+
*/
|
|
112
127
|
_setupOutputHandler(): void;
|
|
113
128
|
}
|
|
@@ -6,6 +6,7 @@ import type { ConsoleLogger } from '@equinor/fusion-framework-cli/bin';
|
|
|
6
6
|
* @param packageManager - Package manager to use ('npm' or 'pnpm')
|
|
7
7
|
* @param logger - Logger instance for output
|
|
8
8
|
* @returns Promise resolving to the package manager name used
|
|
9
|
+
* @throws AssertionError if `packageManager` is not `npm` or `pnpm`; rethrows install failures.
|
|
9
10
|
*/
|
|
10
11
|
export declare function installPackageDependencies(targetDir: string, packageManager: string, logger?: ConsoleLogger): Promise<string>;
|
|
11
12
|
export default installPackageDependencies;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type TemplatesManifest } from './template.schemas.js';
|
|
2
|
+
/**
|
|
3
|
+
* Validates and parses a template manifest JSON string.
|
|
4
|
+
*
|
|
5
|
+
* This function takes a JSON string containing template definitions and validates
|
|
6
|
+
* it against the TemplatesManifestSchema. It provides detailed error messages
|
|
7
|
+
* for both JSON parsing errors and schema validation failures.
|
|
8
|
+
*
|
|
9
|
+
* @param jsonString - The JSON string to validate and parse
|
|
10
|
+
* @returns Parsed and validated template manifest object
|
|
11
|
+
* @throws {Error} If JSON parsing fails or schema validation fails
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const manifestJson = readFileSync('templates.json', 'utf8');
|
|
16
|
+
* const manifest = parseTemplatesManifest(manifestJson);
|
|
17
|
+
* console.log(`Found ${manifest.templates.length} templates`);
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function parseTemplatesManifest(jsonString: string): TemplatesManifest;
|
|
@@ -8,6 +8,10 @@ export declare const TemplateResourceFileSchema: z.ZodObject<{
|
|
|
8
8
|
path: z.ZodString;
|
|
9
9
|
target: z.ZodOptional<z.ZodString>;
|
|
10
10
|
}, z.core.$strip>;
|
|
11
|
+
/**
|
|
12
|
+
* Type definitions derived from schemas
|
|
13
|
+
*/
|
|
14
|
+
export type TemplateResourceFile = z.infer<typeof TemplateResourceFileSchema>;
|
|
11
15
|
/**
|
|
12
16
|
* Zod schema for template resource directories.
|
|
13
17
|
* Defines the structure for directories in a project template.
|
|
@@ -18,6 +22,7 @@ export declare const TemplateResourceDirSchema: z.ZodObject<{
|
|
|
18
22
|
target: z.ZodOptional<z.ZodString>;
|
|
19
23
|
recursive: z.ZodOptional<z.ZodBoolean>;
|
|
20
24
|
}, z.core.$strip>;
|
|
25
|
+
export type TemplateResourceDir = z.infer<typeof TemplateResourceDirSchema>;
|
|
21
26
|
/**
|
|
22
27
|
* Union schema for all template resource types.
|
|
23
28
|
* Supports both file and directory resources with discriminated union.
|
|
@@ -32,6 +37,7 @@ export declare const TemplateResourceSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
|
|
|
32
37
|
target: z.ZodOptional<z.ZodString>;
|
|
33
38
|
recursive: z.ZodOptional<z.ZodBoolean>;
|
|
34
39
|
}, z.core.$strip>], "type">;
|
|
40
|
+
export type TemplateResource = z.infer<typeof TemplateResourceSchema>;
|
|
35
41
|
/**
|
|
36
42
|
* Zod schema for a single template item.
|
|
37
43
|
* Defines the structure of individual project templates.
|
|
@@ -50,6 +56,7 @@ export declare const TemplateItemSchema: z.ZodObject<{
|
|
|
50
56
|
recursive: z.ZodOptional<z.ZodBoolean>;
|
|
51
57
|
}, z.core.$strip>], "type">>;
|
|
52
58
|
}, z.core.$strip>;
|
|
59
|
+
export type TemplateItem = z.infer<typeof TemplateItemSchema>;
|
|
53
60
|
/**
|
|
54
61
|
* Zod schema for the complete templates manifest.
|
|
55
62
|
* Defines the structure of the templates.json file.
|
|
@@ -80,30 +87,4 @@ export declare const TemplatesManifestSchema: z.ZodObject<{
|
|
|
80
87
|
recursive: z.ZodOptional<z.ZodBoolean>;
|
|
81
88
|
}, z.core.$strip>], "type">>>;
|
|
82
89
|
}, z.core.$strip>;
|
|
83
|
-
/**
|
|
84
|
-
* Type definitions derived from schemas
|
|
85
|
-
*/
|
|
86
|
-
export type TemplateResourceFile = z.infer<typeof TemplateResourceFileSchema>;
|
|
87
|
-
export type TemplateResourceDir = z.infer<typeof TemplateResourceDirSchema>;
|
|
88
|
-
export type TemplateResource = z.infer<typeof TemplateResourceSchema>;
|
|
89
|
-
export type TemplateItem = z.infer<typeof TemplateItemSchema>;
|
|
90
90
|
export type TemplatesManifest = z.infer<typeof TemplatesManifestSchema>;
|
|
91
|
-
/**
|
|
92
|
-
* Validates and parses a template manifest JSON string.
|
|
93
|
-
*
|
|
94
|
-
* This function takes a JSON string containing template definitions and validates
|
|
95
|
-
* it against the TemplatesManifestSchema. It provides detailed error messages
|
|
96
|
-
* for both JSON parsing errors and schema validation failures.
|
|
97
|
-
*
|
|
98
|
-
* @param jsonString - The JSON string to validate and parse
|
|
99
|
-
* @returns Parsed and validated template manifest object
|
|
100
|
-
* @throws {Error} If JSON parsing fails or schema validation fails
|
|
101
|
-
*
|
|
102
|
-
* @example
|
|
103
|
-
* ```typescript
|
|
104
|
-
* const manifestJson = readFileSync('templates.json', 'utf8');
|
|
105
|
-
* const manifest = parseTemplatesManifest(manifestJson);
|
|
106
|
-
* console.log(`Found ${manifest.templates.length} templates`);
|
|
107
|
-
* ```
|
|
108
|
-
*/
|
|
109
|
-
export declare function parseTemplatesManifest(jsonString: string): TemplatesManifest;
|
|
@@ -8,25 +8,28 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @packageDocumentation
|
|
10
10
|
*/
|
|
11
|
-
export { buildApplication } from './
|
|
12
|
-
export { bundleApp } from './app
|
|
13
|
-
export { generateApplicationConfig } from './
|
|
14
|
-
export { publishAppConfig } from './app-config
|
|
15
|
-
export { startAppDevServer } from './app-dev.js';
|
|
16
|
-
export { serveApplication, type ServeApplicationOptions } from './
|
|
17
|
-
export { checkApp } from './app
|
|
18
|
-
export { loadAppManifest } from './app-manifest.js';
|
|
19
|
-
export { uploadApplication } from './
|
|
20
|
-
export { tagApplication } from './
|
|
21
|
-
export { startPortalDevServer } from './portal-dev.js';
|
|
22
|
-
export { servePortal, type ServePortalOptions } from './portal
|
|
23
|
-
export { buildPortal } from './portal
|
|
24
|
-
export { bundlePortal } from './portal
|
|
25
|
-
export { loadPortalManifest } from './portal-manifest.js';
|
|
26
|
-
export { generatePortalConfig } from './portal-config.js';
|
|
27
|
-
export { publishPortalConfig } from './portal-config
|
|
28
|
-
export { uploadPortalBundle, type UploadPortalOptions } from './portal-
|
|
29
|
-
export { tagPortal } from './portal
|
|
11
|
+
export { buildApplication } from './build-application.js';
|
|
12
|
+
export { bundleApp } from './bundle-app.js';
|
|
13
|
+
export { generateApplicationConfig } from './generate-application-config.js';
|
|
14
|
+
export { publishAppConfig } from './publish-app-config.js';
|
|
15
|
+
export { startAppDevServer } from './start-app-dev-server.js';
|
|
16
|
+
export { serveApplication, type ServeApplicationOptions } from './serve-application.js';
|
|
17
|
+
export { checkApp } from './check-app.js';
|
|
18
|
+
export { loadAppManifest } from './load-app-manifest.js';
|
|
19
|
+
export { uploadApplication } from './upload-application.js';
|
|
20
|
+
export { tagApplication } from './tag-application.js';
|
|
21
|
+
export { startPortalDevServer } from './start-portal-dev-server.js';
|
|
22
|
+
export { servePortal, type ServePortalOptions } from './serve-portal.js';
|
|
23
|
+
export { buildPortal } from './build-portal.js';
|
|
24
|
+
export { bundlePortal } from './bundle-portal.js';
|
|
25
|
+
export { loadPortalManifest } from './load-portal-manifest.js';
|
|
26
|
+
export { generatePortalConfig } from './generate-portal-config.js';
|
|
27
|
+
export { publishPortalConfig } from './publish-portal-config.js';
|
|
28
|
+
export { uploadPortalBundle, type UploadPortalOptions } from './upload-portal-bundle.js';
|
|
29
|
+
export { tagPortal } from './tag-portal.js';
|
|
30
30
|
export { pack } from './pack.js';
|
|
31
31
|
export { ConsoleLogger } from './utils/ConsoleLogger.js';
|
|
32
|
-
export {
|
|
32
|
+
export { type FusionFramework, FusionEnv, } from './fusion-env.js';
|
|
33
|
+
export { configureFramework, type FusionFrameworkSettings } from './configure-framework.js';
|
|
34
|
+
export { resolveDefaultEnv } from './resolve-default-env.js';
|
|
35
|
+
export { initializeFramework } from './initialize-framework.js';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ModulesConfigurator, AnyModule } from '@equinor/fusion-framework-module';
|
|
2
|
+
import { type FusionFrameworkSettings } from './configure-framework.js';
|
|
3
|
+
import type { FusionFramework, Modules } from './fusion-env.js';
|
|
4
|
+
/**
|
|
5
|
+
* Initializes the Fusion Framework with the provided settings.
|
|
6
|
+
*
|
|
7
|
+
* This function configures HTTP, service discovery, and authentication modules
|
|
8
|
+
* based on the supplied configuration. It supports multiple authentication modes
|
|
9
|
+
* and allows customization of service discovery endpoints and scopes.
|
|
10
|
+
*
|
|
11
|
+
* When no `configure` callback is provided (or `TExtra` defaults to `[]`) the
|
|
12
|
+
* return type is {@link FusionFramework}. Pass a typed `configure` callback to
|
|
13
|
+
* extend the instance with additional modules:
|
|
14
|
+
*
|
|
15
|
+
* @template TExtra - Tuple of additional module types added via `configure`.
|
|
16
|
+
* Defaults to `[]`, which means the return type is exactly {@link FusionFramework}.
|
|
17
|
+
*
|
|
18
|
+
* @param config - The settings for framework initialization.
|
|
19
|
+
* @param configure - Optional callback to add or further configure modules.
|
|
20
|
+
* Receives a configurator already set up with the base {@link Modules}.
|
|
21
|
+
* @returns A promise resolving to the initialized Fusion Framework instance,
|
|
22
|
+
* typed as `ModulesInstance<[...Modules, ...TExtra]>`.
|
|
23
|
+
* @throws Will throw if required authentication parameters are missing.
|
|
24
|
+
*
|
|
25
|
+
* @example Basic usage (returns FusionFramework)
|
|
26
|
+
* ```typescript
|
|
27
|
+
* const framework = await initializeFramework({ env, auth });
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @example With extra modules
|
|
31
|
+
* ```typescript
|
|
32
|
+
* const framework = await initializeFramework<[AiModule]>(
|
|
33
|
+
* { env, auth },
|
|
34
|
+
* (configurator) => enableAI(configurator),
|
|
35
|
+
* );
|
|
36
|
+
* framework.ai.useModel('gpt-4.1');
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare const initializeFramework: <TExtra extends Array<AnyModule> = []>(config: FusionFrameworkSettings, configure?: (configurator: ModulesConfigurator<[...Modules, ...TExtra]>) => void) => Promise<FusionFramework<TExtra>>;
|
|
@@ -44,7 +44,7 @@ export type ResolveAppManifestOptions = {
|
|
|
44
44
|
* @public
|
|
45
45
|
*/
|
|
46
46
|
export declare const loadAppManifest: (options: ResolveAppManifestOptions) => Promise<{
|
|
47
|
-
manifest: import("node_modules/@equinor/fusion-framework-module-app/
|
|
47
|
+
manifest: import("node_modules/@equinor/fusion-framework-module-app/src/types.js").AppManifest;
|
|
48
48
|
pkg: import("@equinor/fusion-framework-cli/lib").ResolvedPackage;
|
|
49
49
|
env: RuntimeEnv;
|
|
50
50
|
}>;
|