@equinor/fusion-framework-cli 15.2.0 → 15.2.2
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 -0
- package/bin/build/bin.mjs +1 -1
- package/bin/build/cli.mjs +3 -3
- 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} +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-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/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 +13 -13
- 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/{app-pack.d.ts → bundle-app.d.ts} +0 -0
- /package/dist/types/bin/{portal-pack.d.ts → bundle-portal.d.ts} +0 -0
- /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/{app-manifest.d.ts → load-app-manifest.d.ts} +0 -0
- /package/dist/types/bin/{portal-manifest.d.ts → load-portal-manifest.d.ts} +0 -0
- /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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import AdmZip from 'adm-zip';
|
|
2
|
-
import type { FusionFramework } from './
|
|
2
|
+
import type { FusionFramework } from './fusion-env.js';
|
|
3
3
|
import type { ConsoleLogger } from './utils/ConsoleLogger.js';
|
|
4
4
|
/**
|
|
5
5
|
* Options for uploading a portal bundle to the portal service.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Spinner } from './
|
|
1
|
+
import { Spinner } from './Spinner.js';
|
|
2
2
|
/**
|
|
3
3
|
* ConsoleLogger is a utility class for logging progress, status, and debug information in CLI applications.
|
|
4
4
|
* It uses a spinner for visual feedback and supports debug mode for verbose output.
|
|
@@ -17,11 +17,15 @@ export declare class Spinner {
|
|
|
17
17
|
#private;
|
|
18
18
|
/**
|
|
19
19
|
* Get the underlying ora instance for advanced usage.
|
|
20
|
+
*
|
|
21
|
+
* @returns The underlying ora spinner instance.
|
|
20
22
|
*/
|
|
21
23
|
get ora(): Ora;
|
|
22
24
|
/**
|
|
23
25
|
* Attach or detach spinner to native console output.
|
|
24
26
|
* When enabled, console.log/info are redirected to spinner.info.
|
|
27
|
+
*
|
|
28
|
+
* @param value - `true` to redirect console output to the spinner, `false` to restore it.
|
|
25
29
|
*/
|
|
26
30
|
set attachConsole(value: boolean);
|
|
27
31
|
/**
|
|
@@ -38,10 +42,14 @@ export declare class Spinner {
|
|
|
38
42
|
static Clone(spinner?: Spinner): Spinner;
|
|
39
43
|
/**
|
|
40
44
|
* Get the current global spinner instance.
|
|
45
|
+
*
|
|
46
|
+
* @returns The current global Spinner instance.
|
|
41
47
|
*/
|
|
42
48
|
static get Current(): Spinner;
|
|
43
49
|
/**
|
|
44
50
|
* Set the current global spinner instance.
|
|
51
|
+
*
|
|
52
|
+
* @param spinner - The Spinner instance to set as the global instance.
|
|
45
53
|
*/
|
|
46
54
|
static set Current(spinner: Spinner);
|
|
47
55
|
/**
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Docs URLs referenced in CLI authentication/authorization error messages. */
|
|
2
|
+
export declare const AUTH_ERROR_DOCS: {
|
|
3
|
+
/** Docs URL for CLI authentication reference. */
|
|
4
|
+
AUTH_DOCS_URL: string;
|
|
5
|
+
/** Docs URL for CLI application publishing reference. */
|
|
6
|
+
APP_DOCS_URL: string;
|
|
7
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { AppManifest } from '@equinor/fusion-framework-module-app';
|
|
2
|
+
import type { ApiAppConfig } from '@equinor/fusion-framework-module-app/schemas.js';
|
|
3
|
+
import { type DevServerOptions, type FusionTemplateEnv } from '@equinor/fusion-framework-dev-server';
|
|
4
|
+
/**
|
|
5
|
+
* PortalManifest describes the minimal structure required for a portal manifest.
|
|
6
|
+
* Used for dev server portal routing and config.
|
|
7
|
+
*/
|
|
8
|
+
type PortalManifest = {
|
|
9
|
+
name: string;
|
|
10
|
+
build: {
|
|
11
|
+
templateEntry: string;
|
|
12
|
+
assetPath?: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* PortalConfig is a placeholder for portal-specific configuration.
|
|
17
|
+
* Replace 'any' with a more specific type as needed.
|
|
18
|
+
*/
|
|
19
|
+
type PortalConfig = Record<string, unknown>;
|
|
20
|
+
/**
|
|
21
|
+
* Options for creating a dev server configuration.
|
|
22
|
+
*
|
|
23
|
+
* @property template - Optional template environment overrides.
|
|
24
|
+
* @property portal - Optional portal manifest and config.
|
|
25
|
+
* @property app - Optional app manifest and config.
|
|
26
|
+
* @property server - Optional server options for the dev server.
|
|
27
|
+
*/
|
|
28
|
+
export type CreateDevServerOptions = {
|
|
29
|
+
template?: Partial<FusionTemplateEnv>;
|
|
30
|
+
portal?: {
|
|
31
|
+
manifest: PortalManifest;
|
|
32
|
+
config?: PortalConfig;
|
|
33
|
+
};
|
|
34
|
+
app?: {
|
|
35
|
+
manifest: AppManifest;
|
|
36
|
+
config?: ApiAppConfig;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Creates the full dev server configuration for Fusion CLI.
|
|
41
|
+
* Applies app and portal routing as needed.
|
|
42
|
+
*
|
|
43
|
+
* @param options - Options for dev server config, including app/portal manifests and overrides.
|
|
44
|
+
* @returns The complete dev server options object.
|
|
45
|
+
*/
|
|
46
|
+
export declare const createDevServerConfig: (options: CreateDevServerOptions) => DevServerOptions;
|
|
47
|
+
export {};
|
|
@@ -1,53 +1,8 @@
|
|
|
1
|
-
import type { AppManifest } from '@equinor/fusion-framework-module-app';
|
|
2
|
-
import type { ApiAppConfig } from '@equinor/fusion-framework-module-app/schemas.js';
|
|
3
1
|
import { type RuntimeEnv } from '@equinor/fusion-framework-cli/lib';
|
|
4
|
-
import { type UserConfig
|
|
2
|
+
import { type UserConfig } from '@equinor/fusion-framework-dev-server';
|
|
5
3
|
import type { ConsoleLogger } from './ConsoleLogger.js';
|
|
6
|
-
|
|
7
|
-
* PortalManifest describes the minimal structure required for a portal manifest.
|
|
8
|
-
* Used for dev server portal routing and config.
|
|
9
|
-
*/
|
|
10
|
-
type PortalManifest = {
|
|
11
|
-
name: string;
|
|
12
|
-
build: {
|
|
13
|
-
templateEntry: string;
|
|
14
|
-
assetPath?: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* PortalConfig is a placeholder for portal-specific configuration.
|
|
19
|
-
* Replace 'any' with a more specific type as needed.
|
|
20
|
-
*/
|
|
21
|
-
type PortalConfig = Record<string, unknown>;
|
|
22
|
-
/**
|
|
23
|
-
* Options for creating a dev server configuration.
|
|
24
|
-
*
|
|
25
|
-
* @property template - Optional template environment overrides.
|
|
26
|
-
* @property portal - Optional portal manifest and config.
|
|
27
|
-
* @property app - Optional app manifest and config.
|
|
28
|
-
* @property server - Optional server options for the dev server.
|
|
29
|
-
*/
|
|
30
|
-
export type CreateDevServerOptions = {
|
|
31
|
-
template?: Partial<FusionTemplateEnv>;
|
|
32
|
-
portal?: {
|
|
33
|
-
manifest: PortalManifest;
|
|
34
|
-
config?: PortalConfig;
|
|
35
|
-
};
|
|
36
|
-
app?: {
|
|
37
|
-
manifest: AppManifest;
|
|
38
|
-
config?: ApiAppConfig;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Creates the full dev server configuration for Fusion CLI.
|
|
43
|
-
* Applies app and portal routing as needed.
|
|
44
|
-
*
|
|
45
|
-
* @param options - Options for dev server config, including app/portal manifests and overrides.
|
|
46
|
-
* @returns The complete dev server options object.
|
|
47
|
-
*/
|
|
48
|
-
export declare const createDevServerConfig: (options: CreateDevServerOptions) => DevServerOptions;
|
|
4
|
+
import { type CreateDevServerOptions } from './create-dev-server-config.js';
|
|
49
5
|
export declare const createDevServer: (env: RuntimeEnv, options: CreateDevServerOptions, args?: {
|
|
50
6
|
overrides?: UserConfig;
|
|
51
7
|
log?: ConsoleLogger | null;
|
|
52
8
|
}) => Promise<import("node_modules/vite/dist/node/index.js").ViteDevServer>;
|
|
53
|
-
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds a hint line when the `FUSION_TOKEN` env var is set, warning that
|
|
3
|
+
* the CLI is using it instead of an interactive login session.
|
|
4
|
+
*
|
|
5
|
+
* @returns A styled hint string, or `undefined` if `FUSION_TOKEN` is not set.
|
|
6
|
+
*/
|
|
7
|
+
export declare function envTokenHint(): string | undefined;
|
|
@@ -18,20 +18,3 @@
|
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
20
|
export declare function formatAuthError(status: number, context: string): string | undefined;
|
|
21
|
-
/**
|
|
22
|
-
* Detects whether an error is (or wraps) an authentication/authorization failure.
|
|
23
|
-
*
|
|
24
|
-
* Checks for:
|
|
25
|
-
* - `SilentTokenAcquisitionError` (MSAL token refresh failure)
|
|
26
|
-
* - HTTP response errors with 401/403 status (including `HttpJsonResponseError`
|
|
27
|
-
* from the JSON selector when a service returns an auth error page)
|
|
28
|
-
* - Errors whose cause chain contains one of the above
|
|
29
|
-
*
|
|
30
|
-
* Returns `undefined` when the error is not auth-related, so callers can
|
|
31
|
-
* fall through to generic error handling.
|
|
32
|
-
*
|
|
33
|
-
* @param error - The caught error value.
|
|
34
|
-
* @param context - A short description of the failed operation (e.g. `"check registration for my-app"`).
|
|
35
|
-
* @returns A formatted error string, or `undefined` if the error is not an auth failure.
|
|
36
|
-
*/
|
|
37
|
-
export declare function formatTokenAcquisitionError(error: unknown, context: string): string | undefined;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formats a byte size value or file path into a human-readable string for CLI output.
|
|
3
|
+
*
|
|
4
|
+
* If the input is a string, it is treated as a file path and the file size is used.
|
|
5
|
+
* If the input is a number, it is formatted directly.
|
|
6
|
+
*
|
|
7
|
+
* @param input - File path (string) or byte size (number).
|
|
8
|
+
* @returns A formatted string representing the byte size, styled with chalk.yellowBright.
|
|
9
|
+
*
|
|
10
|
+
* @throws If the input is a string and the file does not exist.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* formatByteSize(1024); // '1 kB'
|
|
14
|
+
* formatByteSize('/path/to/file.zip'); // '2.3 MB'
|
|
15
|
+
*/
|
|
16
|
+
export declare const formatByteSize: (input: string | number) => string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formats a file path for CLI output, with optional relative path and styling.
|
|
3
|
+
*
|
|
4
|
+
* @param path - The file path to format.
|
|
5
|
+
* @param opt - Optional formatting options.
|
|
6
|
+
* @param opt.relative - If true, formats as a relative path from cwd or opt.cwd.
|
|
7
|
+
* @param opt.cwd - The base directory for relative path calculation. Defaults to process.cwd().
|
|
8
|
+
* @returns The formatted file path, styled with chalk.blueBright.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* formatPath('/foo/bar/baz.txt', { relative: true });
|
|
12
|
+
*/
|
|
13
|
+
export declare const formatPath: (path: string, opt?: {
|
|
14
|
+
relative?: boolean;
|
|
15
|
+
cwd?: string;
|
|
16
|
+
}) => string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detects whether an error is (or wraps) an authentication/authorization failure.
|
|
3
|
+
*
|
|
4
|
+
* Checks for:
|
|
5
|
+
* - `SilentTokenAcquisitionError` (MSAL token refresh failure)
|
|
6
|
+
* - HTTP response errors with 401/403 status (including `HttpJsonResponseError`
|
|
7
|
+
* from the JSON selector when a service returns an auth error page)
|
|
8
|
+
* - Errors whose cause chain contains one of the above
|
|
9
|
+
*
|
|
10
|
+
* Returns `undefined` when the error is not auth-related, so callers can
|
|
11
|
+
* fall through to generic error handling.
|
|
12
|
+
*
|
|
13
|
+
* @param error - The caught error value.
|
|
14
|
+
* @param context - A short description of the failed operation (e.g. `"check registration for my-app"`).
|
|
15
|
+
* @returns A formatted error string, or `undefined` if the error is not an auth failure.
|
|
16
|
+
*/
|
|
17
|
+
export declare function formatTokenAcquisitionError(error: unknown, context: string): string | undefined;
|
|
@@ -7,9 +7,13 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
*/
|
|
10
|
-
export { formatPath
|
|
11
|
-
export {
|
|
10
|
+
export { formatPath } from './format-path.js';
|
|
11
|
+
export { formatByteSize } from './format-byte-size.js';
|
|
12
|
+
export { default as chalk } from 'chalk';
|
|
13
|
+
export { Spinner } from './Spinner.js';
|
|
12
14
|
export { ConsoleLogger } from './ConsoleLogger.js';
|
|
13
|
-
export { createDevServerConfig,
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
15
|
+
export { createDevServerConfig, type CreateDevServerOptions, } from './create-dev-server-config.js';
|
|
16
|
+
export { createDevServer } from './create-dev-server.js';
|
|
17
|
+
export { defaultHeaders } from './default-headers.js';
|
|
18
|
+
export { formatAuthError } from './format-auth-error.js';
|
|
19
|
+
export { formatTokenAcquisitionError } from './format-token-acquisition-error.js';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { DevServerOptions } from '@equinor/fusion-framework-dev-server';
|
|
2
|
+
/**
|
|
3
|
+
* Normalizes dev server configuration details for consistent logging.
|
|
4
|
+
* Extracts relevant configuration fields into a standardized object format.
|
|
5
|
+
*
|
|
6
|
+
* @param config - The dev server configuration to normalize
|
|
7
|
+
* @returns Normalized configuration object for logging
|
|
8
|
+
*/
|
|
9
|
+
export declare const normalizeDevServerConfig: (config: DevServerOptions) => {
|
|
10
|
+
portal: {
|
|
11
|
+
id: string;
|
|
12
|
+
tag?: string;
|
|
13
|
+
proxy?: boolean;
|
|
14
|
+
} | undefined;
|
|
15
|
+
msal: {
|
|
16
|
+
tenantId: string;
|
|
17
|
+
clientId: string;
|
|
18
|
+
redirectUri: string;
|
|
19
|
+
requiresAuth: string;
|
|
20
|
+
} | undefined;
|
|
21
|
+
proxy: import("@equinor/fusion-framework-vite-plugin-spa").ResourceConfiguration[] | undefined;
|
|
22
|
+
serviceDiscoveryUrl: string;
|
|
23
|
+
routes: import("@equinor/fusion-framework-vite-plugin-api-service").ApiRoute[] | undefined;
|
|
24
|
+
};
|
|
@@ -7,6 +7,7 @@ import type { ConsoleLogger } from '@equinor/fusion-framework-cli/bin';
|
|
|
7
7
|
* @param clean - If true, automatically clean the directory without prompting
|
|
8
8
|
* @param baseDir - Base directory for path validation (defaults to process.cwd())
|
|
9
9
|
* @returns Promise resolving to true if should continue, false if should abort
|
|
10
|
+
* @throws AssertionError if `targetDir` is not a string.
|
|
10
11
|
*/
|
|
11
12
|
export declare function checkTargetDirectory(targetDir: string, logger: ConsoleLogger, clean?: boolean, baseDir?: string): Promise<boolean>;
|
|
12
13
|
export default checkTargetDirectory;
|
|
@@ -11,8 +11,3 @@ export declare const createEnvOption: (options: {
|
|
|
11
11
|
default?: FusionEnv;
|
|
12
12
|
allowDev: boolean;
|
|
13
13
|
}) => import("node_modules/commander/typings/index.js").Option;
|
|
14
|
-
/**
|
|
15
|
-
* Default environment option that allows the development environment.
|
|
16
|
-
*/
|
|
17
|
-
export declare const envOption: import("node_modules/commander/typings/index.js").Option;
|
|
18
|
-
export default envOption;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Option for specifying the Azure AD application client ID.
|
|
3
|
+
* Defaults to the Fusion CLI client if not provided.
|
|
4
|
+
*/
|
|
5
|
+
export declare const clientOption: import("node_modules/commander/typings/index.js").Option;
|
|
6
|
+
/**
|
|
7
|
+
* Option for specifying Azure audience scopes.
|
|
8
|
+
* Defaults to Fusion API scope with /.default.
|
|
9
|
+
*/
|
|
10
|
+
export declare const scopeOption: import("node_modules/commander/typings/index.js").Option;
|
|
11
|
+
/**
|
|
12
|
+
* Option for specifying the Azure Active Directory tenant ID.
|
|
13
|
+
* Defaults to Equinor's Fusion tenant if not provided.
|
|
14
|
+
*/
|
|
15
|
+
export declare const tenantOption: import("node_modules/commander/typings/index.js").Option;
|
|
16
|
+
/**
|
|
17
|
+
* Option for providing an Azure AD access token directly.
|
|
18
|
+
* If set, tenant and client options are ignored.
|
|
19
|
+
*/
|
|
20
|
+
export declare const tokenOption: import("node_modules/commander/typings/index.js").Option;
|
|
@@ -1,24 +1,4 @@
|
|
|
1
1
|
import { type Command } from 'commander';
|
|
2
|
-
/**
|
|
3
|
-
* Option for specifying the Azure Active Directory tenant ID.
|
|
4
|
-
* Defaults to Equinor's Fusion tenant if not provided.
|
|
5
|
-
*/
|
|
6
|
-
export declare const tenantOption: import("node_modules/commander/typings/index.js").Option;
|
|
7
|
-
/**
|
|
8
|
-
* Option for specifying the Azure AD application client ID.
|
|
9
|
-
* Defaults to the Fusion CLI client if not provided.
|
|
10
|
-
*/
|
|
11
|
-
export declare const clientOption: import("node_modules/commander/typings/index.js").Option;
|
|
12
|
-
/**
|
|
13
|
-
* Option for providing an Azure AD access token directly.
|
|
14
|
-
* If set, tenant and client options are ignored.
|
|
15
|
-
*/
|
|
16
|
-
export declare const tokenOption: import("node_modules/commander/typings/index.js").Option;
|
|
17
|
-
/**
|
|
18
|
-
* Option for specifying Azure audience scopes.
|
|
19
|
-
* Defaults to Fusion API scope with /.default.
|
|
20
|
-
*/
|
|
21
|
-
export declare const scopeOption: import("node_modules/commander/typings/index.js").Option;
|
|
22
2
|
/**
|
|
23
3
|
* Enhances a given command with authentication-related options.
|
|
24
4
|
*
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Command } from 'commander';
|
|
2
|
+
/**
|
|
3
|
+
* Attempts to load and register plugins from configuration files
|
|
4
|
+
* Searches for fusion-cli.config.ts files using find-up from current directory and CLI package directory
|
|
5
|
+
* @param program - The Commander program instance to register commands with
|
|
6
|
+
* @returns Promise that resolves when plugin loading is complete
|
|
7
|
+
* @throws Error if a configured plugin package cannot be resolved.
|
|
8
|
+
*/
|
|
9
|
+
export declare function loadPlugins(program: Command): Promise<void>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type z from 'zod';
|
|
2
2
|
import type { RuntimeEnv } from '@equinor/fusion-framework-cli/lib';
|
|
3
|
-
import type { ApiAppConfig, ApiAppConfigSchema } from './
|
|
4
|
-
export type { ApiAppConfig as AppConfig } from './
|
|
3
|
+
import type { ApiAppConfig, ApiAppConfigSchema } from './api-app-config-schema.js';
|
|
4
|
+
export type { ApiAppConfig as AppConfig } from './api-app-config-schema.js';
|
|
5
5
|
export { mergeAppConfig } from './merge-app-config.js';
|
|
6
6
|
/**
|
|
7
7
|
* A function type that defines the structure for configuring an application.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { PackageJson } from 'read-package-up';
|
|
2
|
+
import type { AppManifest } from '@equinor/fusion-framework-module-app';
|
|
3
|
+
/**
|
|
4
|
+
* Extended type for application package.json, optionally including a manifest.
|
|
5
|
+
*/
|
|
6
|
+
export type AppPackageJson = PackageJson & {
|
|
7
|
+
manifest?: AppManifest;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Function type for defining a package, supporting both sync and async returns.
|
|
11
|
+
*/
|
|
12
|
+
type DefinePackageFn = () => AppPackageJson | Promise<AppPackageJson>;
|
|
13
|
+
/**
|
|
14
|
+
* Defines the application package using the provided object.
|
|
15
|
+
*
|
|
16
|
+
* @param obj - The object representing the application package.
|
|
17
|
+
* @returns The same object, typed as AppPackageJson.
|
|
18
|
+
*/
|
|
19
|
+
export declare function defineAppPackage(obj: AppPackageJson): AppPackageJson;
|
|
20
|
+
/**
|
|
21
|
+
* Defines the application package using a function.
|
|
22
|
+
*
|
|
23
|
+
* @param fn - The function returning the application package.
|
|
24
|
+
*/
|
|
25
|
+
export declare function defineAppPackage(fn: DefinePackageFn): void;
|
|
26
|
+
export {};
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
|
-
export { defineAppManifest, type AppManifestFn, type AppManifest, } from './app-manifest.js';
|
|
9
|
+
export { defineAppManifest, type AppManifestFn, type AppManifest, } from './define-app-manifest.js';
|
|
10
10
|
export type { RouteSchemaEntry } from '@equinor/fusion-framework-module-app';
|
|
11
|
-
export { createAppManifestFromPackage } from './create-app-manifest.js';
|
|
12
|
-
export { mergeAppManifests } from './merge-app-
|
|
11
|
+
export { createAppManifestFromPackage } from './create-app-manifest-from-package.js';
|
|
12
|
+
export { mergeAppManifests } from './merge-app-manifests.js';
|
|
13
13
|
export { loadAppManifest, type AppManifestExport } from './load-app-manifest.js';
|
|
14
14
|
export { mergeAppConfig } from './merge-app-config.js';
|
|
15
|
-
export { defineAppConfig, type AppConfigFn, type AppConfig } from './app-config.js';
|
|
15
|
+
export { defineAppConfig, type AppConfigFn, type AppConfig } from './define-app-config.js';
|
|
16
16
|
export { loadAppConfig, type AppConfigExport } from './load-app-config.js';
|
|
17
|
-
export { ApiAppConfigSchema, type ApiAppConfig } from './
|
|
17
|
+
export { ApiAppConfigSchema, type ApiAppConfig } from './api-app-config-schema.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ImportConfigResult } from '@equinor/fusion-imports';
|
|
2
|
-
import { type ApiAppConfig } from './
|
|
2
|
+
import { type ApiAppConfig } from './api-app-config-schema.js';
|
|
3
3
|
import type { RuntimeEnv } from '../types.js';
|
|
4
|
-
import type { AppConfigFn } from './app-config.js';
|
|
4
|
+
import type { AppConfigFn } from './define-app-config.js';
|
|
5
5
|
/**
|
|
6
6
|
* Represents the configuration export for an application.
|
|
7
7
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AppManifest } from '@equinor/fusion-framework-module-app';
|
|
2
2
|
import type { RuntimeEnv } from '../types.js';
|
|
3
|
-
import type { AppManifestFn } from './app-manifest.js';
|
|
3
|
+
import type { AppManifestFn } from './define-app-manifest.js';
|
|
4
4
|
/**
|
|
5
5
|
* Represents the export type for an application manifest, which can either be
|
|
6
6
|
* a static `AppManifest` object or a function (`AppManifestFn`) that generates
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PackageJson } from 'read-package-up';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves the application key from the given package.json object.
|
|
4
|
+
*
|
|
5
|
+
* This function strips any leading '@' or scope from the package name, returning a normalized key.
|
|
6
|
+
*
|
|
7
|
+
* @param packageJson - An object containing the 'name' property from the package.json.
|
|
8
|
+
* @returns The resolved application key, which is the package name with any leading '@' or scope removed.
|
|
9
|
+
* @throws Will throw an error if the 'name' property is not present in the packageJson.
|
|
10
|
+
*/
|
|
11
|
+
export declare const resolveAppKey: (packageJson: Pick<PackageJson, 'name'>) => string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defineAppConfig as _defineConfig } from './app/define-app-config.js';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated
|
|
4
|
+
* Will be removed in the next major version.
|
|
5
|
+
* Please use `defineAppConfig` from `@equinor/fusion-framework-cli/app` instead.
|
|
6
|
+
*
|
|
7
|
+
* Transitional wrapper for legacy defineAppConfig. This function exists only to prevent immediate breaking changes
|
|
8
|
+
* and should be removed as soon as possible. Consumers should migrate to the new API without delay.
|
|
9
|
+
*
|
|
10
|
+
* @param args - Arguments passed to the new defineAppConfig function.
|
|
11
|
+
*/
|
|
12
|
+
export declare const defineAppConfig: (...args: Parameters<typeof _defineConfig>) => import("./app/define-app-config.js").AppConfigFn;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defineAppManifest as _defineManifest } from './app/define-app-manifest.js';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated
|
|
4
|
+
* Will be removed in the next major version.
|
|
5
|
+
* Please use `defineAppManifest` from `@equinor/fusion-framework-cli/app` instead.
|
|
6
|
+
*
|
|
7
|
+
* Transitional wrapper for legacy defineAppManifest. This function exists only to prevent immediate breaking changes
|
|
8
|
+
* and should be removed as soon as possible. Consumers should migrate to the new API without delay.
|
|
9
|
+
*
|
|
10
|
+
* @param args - Arguments passed to the new defineAppManifest function.
|
|
11
|
+
*/
|
|
12
|
+
export declare const defineAppManifest: (...args: Parameters<typeof _defineManifest>) => import("./app/define-app-manifest.js").AppManifestFn<import("node_modules/@equinor/fusion-framework-module-app/src/types.js").AppManifest>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { DevServerOptions } from '@equinor/fusion-framework-dev-server';
|
|
2
|
+
import type { RecursivePartial, RuntimeEnv } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Type definition for a function that generates or modifies DevServerOptions.
|
|
5
|
+
* @param env - The runtime environment configuration.
|
|
6
|
+
* @param args - An object containing the base DevServerOptions.
|
|
7
|
+
* @returns A DevServerOptions object or a Promise resolving to one, or undefined.
|
|
8
|
+
*/
|
|
9
|
+
export type DevServerConfigFn = (env: RuntimeEnv, args: {
|
|
10
|
+
base: DevServerOptions;
|
|
11
|
+
}) => Promise<RecursivePartial<DevServerOptions> | undefined> | RecursivePartial<DevServerOptions> | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Type definition for a dev server config export, which can be either a DevServerOptions object or a function.
|
|
14
|
+
*/
|
|
15
|
+
export type DevServerConfigExport = DevServerOptions | DevServerConfigFn;
|
|
16
|
+
/**
|
|
17
|
+
* Helper to define a dev server config function with proper typing.
|
|
18
|
+
* @param fn - The configuration function to be used as the dev server config.
|
|
19
|
+
* @returns The same function, typed as DevServerConfigFn.
|
|
20
|
+
*/
|
|
21
|
+
export declare const defineDevServerConfig: (fn: DevServerConfigFn) => DevServerConfigFn;
|
|
@@ -7,5 +7,6 @@
|
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
9
|
export { processServices } from '@equinor/fusion-framework-dev-server';
|
|
10
|
-
export {
|
|
10
|
+
export { defineDevServerConfig, type DevServerConfigFn, type DevServerConfigExport, } from './define-dev-server-config.js';
|
|
11
|
+
export { loadDevServerConfig } from './load-dev-server-config.js';
|
|
11
12
|
export { mergeDevServerConfig } from './merge-dev-server-config.js';
|
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export type { RuntimeEnv } from './types.js';
|
|
10
10
|
export { resolvePackage, type ResolvedPackage } from './utils/resolve-package.js';
|
|
11
|
-
export { resolveEntryPoint } from './utils/resolve-
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
11
|
+
export { resolveEntryPoint } from './utils/resolve-entry-point.js';
|
|
12
|
+
export { defineDevServerConfig, type DevServerConfigExport, type DevServerConfigFn, } from './define-dev-server-config.js';
|
|
13
|
+
export { loadDevServerConfig } from './load-dev-server-config.js';
|
|
14
|
+
export { defineFusionCli, type FusionCliConfig, type FusionCliConfigFn, type FusionCliConfigExport, } from './define-fusion-cli.js';
|
|
15
|
+
export { defineAppConfig } from './define-app-config.js';
|
|
16
|
+
export { defineAppManifest } from './define-app-manifest.js';
|
|
@@ -1,25 +1,6 @@
|
|
|
1
1
|
import { type ImportConfigResult } from '@equinor/fusion-imports';
|
|
2
|
-
import type {
|
|
2
|
+
import type { RuntimeEnv } from './types.js';
|
|
3
3
|
import type { DevServerOptions } from '@equinor/fusion-framework-dev-server';
|
|
4
|
-
/**
|
|
5
|
-
* Type definition for a function that generates or modifies DevServerOptions.
|
|
6
|
-
* @param env - The runtime environment configuration.
|
|
7
|
-
* @param args - An object containing the base DevServerOptions.
|
|
8
|
-
* @returns A DevServerOptions object or a Promise resolving to one, or undefined.
|
|
9
|
-
*/
|
|
10
|
-
export type DevServerConfigFn = (env: RuntimeEnv, args: {
|
|
11
|
-
base: DevServerOptions;
|
|
12
|
-
}) => Promise<RecursivePartial<DevServerOptions> | undefined> | RecursivePartial<DevServerOptions> | undefined;
|
|
13
|
-
/**
|
|
14
|
-
* Type definition for a dev server config export, which can be either a DevServerOptions object or a function.
|
|
15
|
-
*/
|
|
16
|
-
export type DevServerConfigExport = DevServerOptions | DevServerConfigFn;
|
|
17
|
-
/**
|
|
18
|
-
* Helper to define a dev server config function with proper typing.
|
|
19
|
-
* @param fn - The configuration function to be used as the dev server config.
|
|
20
|
-
* @returns The same function, typed as DevServerConfigFn.
|
|
21
|
-
*/
|
|
22
|
-
export declare const defineDevServerConfig: (fn: DevServerConfigFn) => DevServerConfigFn;
|
|
23
4
|
/**
|
|
24
5
|
* Loads the dev server configuration from a file or function.
|
|
25
6
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PackageJson } from 'type-fest';
|
|
2
2
|
import type { RuntimeEnv } from '@equinor/fusion-framework-cli/lib';
|
|
3
|
-
import type { PortalManifest } from './portal-manifest.js';
|
|
3
|
+
import type { PortalManifest } from './define-portal-manifest.js';
|
|
4
4
|
/**
|
|
5
5
|
* Creates a `PortalManifest` object from the provided `package.json` data and runtime environment.
|
|
6
6
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PortalManifestFn } from './load-portal-manifest.js';
|
|
2
|
-
import type { PortalManifestSchemaType } from './portal-manifest
|
|
2
|
+
import type { PortalManifestSchemaType } from './portal-manifest-schema.js';
|
|
3
3
|
export { loadPortalManifest, type PortalManifestExport, type PortalManifestFn, } from './load-portal-manifest.js';
|
|
4
|
-
export { createPortalManifestFromPackage } from './create-portal-manifest.js';
|
|
4
|
+
export { createPortalManifestFromPackage } from './create-portal-manifest-from-package.js';
|
|
5
5
|
/**
|
|
6
6
|
* Utility to define a portal manifest function with proper typing.
|
|
7
7
|
*
|
|
@@ -23,14 +23,6 @@ export { createPortalManifestFromPackage } from './create-portal-manifest.js';
|
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
25
|
export declare const definePortalManifest: <T extends PortalManifestSchemaType>(fn: PortalManifestFn<T>) => PortalManifestFn<T>;
|
|
26
|
-
export { PortalManifestSchema,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
*
|
|
30
|
-
* @param manifest - The manifest object to validate.
|
|
31
|
-
* @returns The validated manifest object (typed) if valid.
|
|
32
|
-
* @throws ZodError if validation fails.
|
|
33
|
-
*
|
|
34
|
-
* Use this utility to ensure a manifest conforms to the expected schema before further processing.
|
|
35
|
-
*/
|
|
36
|
-
export declare function validatePortalManifest(manifest: unknown): PortalManifestSchemaType;
|
|
26
|
+
export { PortalManifestSchema, PortalManifestSchemaType as PortalManifest, } from './portal-manifest-schema.js';
|
|
27
|
+
export { PortalManifestBuildSchema, type PortalManifestBuildSchemaType as PortalManifestBuild, } from './portal-manifest-build-schema.js';
|
|
28
|
+
export { validatePortalManifest } from './validate-portal-manifest.js';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { RuntimeEnv } from '@equinor/fusion-framework-cli/lib';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a generic portal schema as a record of key-value pairs.
|
|
4
|
+
*/
|
|
5
|
+
export type PortalSchema = Record<string, unknown>;
|
|
6
|
+
/**
|
|
7
|
+
* A function that returns a portal schema, possibly asynchronously, based on the provided runtime environment.
|
|
8
|
+
* @template T - The type of the portal schema.
|
|
9
|
+
* @param env - The runtime environment used to generate the schema.
|
|
10
|
+
* @returns The portal schema or a promise resolving to the schema.
|
|
11
|
+
*/
|
|
12
|
+
export type PortalSchemaFn<T extends PortalSchema> = (env: RuntimeEnv) => T | Promise<T> | T;
|
|
13
|
+
/**
|
|
14
|
+
* Represents either a portal schema object or a function that returns a portal schema.
|
|
15
|
+
* @template T - The type of the portal schema.
|
|
16
|
+
*/
|
|
17
|
+
export type PortalSchemaExport<T extends PortalSchema> = T | PortalSchemaFn<T>;
|
|
18
|
+
/**
|
|
19
|
+
* Helper to define a portal schema function with type inference.
|
|
20
|
+
* @template T - The type of the portal schema.
|
|
21
|
+
* @param fn - The schema function to define.
|
|
22
|
+
* @returns The provided schema function.
|
|
23
|
+
*/
|
|
24
|
+
export declare const definePortalSchema: <T extends PortalSchema>(fn: PortalSchemaFn<T>) => PortalSchemaFn<T>;
|