@equinor/fusion-framework-cli 13.0.1 → 13.1.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 +67 -0
- package/README.md +25 -0
- package/bin/build/bin.mjs +1 -1
- package/bin/build/cli.mjs +3 -3
- package/dist/esm/lib/app/create-app-manifest.js +5 -2
- package/dist/esm/lib/app/create-app-manifest.js.map +1 -1
- package/dist/esm/lib/utils/index.js +1 -0
- package/dist/esm/lib/utils/index.js.map +1 -1
- package/dist/esm/lib/utils/snapshot.js +40 -0
- package/dist/esm/lib/utils/snapshot.js.map +1 -0
- package/dist/esm/version.js +1 -1
- package/dist/types/bin/app-build.d.ts +5 -1
- package/dist/types/bin/app-manifest.d.ts +10 -1
- package/dist/types/bin/app-pack.d.ts +11 -3
- package/dist/types/bin/app-tag.d.ts +3 -16
- package/dist/types/bin/helpers/resolve-app-manifest.d.ts +1 -0
- package/dist/types/bin/index.d.ts +1 -1
- package/dist/types/cli/commands/app/pack.d.ts +6 -0
- package/dist/types/cli/commands/app/publish.d.ts +7 -1
- package/dist/types/cli/commands/app/tag.d.ts +2 -1
- package/dist/types/cli/commands/portal/publish.d.ts +2 -1
- package/dist/types/cli/commands/portal/tag.d.ts +1 -1
- package/dist/types/lib/app/create-app-manifest.d.ts +3 -1
- package/dist/types/lib/utils/index.d.ts +1 -0
- package/dist/types/lib/utils/snapshot.d.ts +26 -0
- package/dist/types/version.d.ts +1 -1
- package/docs/ai-commands.md +2 -2
- package/docs/dev-server-config.md +10 -0
- package/package.json +17 -15
|
@@ -5,6 +5,7 @@ import { resolveGitRemoteUrl } from '../utils/resolve-git-remote-url.js';
|
|
|
5
5
|
import { resolveGitCommitSha } from '../utils/resolve-git-commit-sha.js';
|
|
6
6
|
import { resolveAnnotations } from '../utils/resolve-annotations.js';
|
|
7
7
|
import { ASSET_EXTENSIONS } from '../static.js';
|
|
8
|
+
import { generateSnapshotVersion } from '../utils/snapshot.js';
|
|
8
9
|
/**
|
|
9
10
|
* Resolves the entry point for the application based on the environment and package.json.
|
|
10
11
|
*
|
|
@@ -35,7 +36,7 @@ const resolveAppEntryPoint = (env, packageJson) => {
|
|
|
35
36
|
* @throws If required fields are missing in packageJson.
|
|
36
37
|
* @public
|
|
37
38
|
*/
|
|
38
|
-
export const createAppManifestFromPackage = (env, packageJson) => {
|
|
39
|
+
export const createAppManifestFromPackage = (env, packageJson, options) => {
|
|
39
40
|
// Validate input objects
|
|
40
41
|
assertObject(packageJson, 'expected packageJson');
|
|
41
42
|
assert(packageJson.name, 'expected [name] in packageJson');
|
|
@@ -45,7 +46,9 @@ export const createAppManifestFromPackage = (env, packageJson) => {
|
|
|
45
46
|
// Extract appKey from package name by removing the scope and leading @
|
|
46
47
|
// This ensures a normalized, unique key for the app
|
|
47
48
|
const appKey = packageJson.name.replace(/^@|\w.*\//gm, '');
|
|
48
|
-
const version =
|
|
49
|
+
const version = options?.snapshot
|
|
50
|
+
? generateSnapshotVersion(packageJson.version, options.snapshot)
|
|
51
|
+
: packageJson.version;
|
|
49
52
|
const assetPath = env.command === 'build' ? undefined : `/bundles/apps/${appKey}@${version}`;
|
|
50
53
|
// Try to resolve the GitHub repo from package or git config
|
|
51
54
|
const githubRepo = resolveRepoFromPackage(packageJson) ?? resolveGitRemoteUrl();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-app-manifest.js","sourceRoot":"","sources":["../../../../src/lib/app/create-app-manifest.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE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B,CAAC,CAAC"}
|
|
@@ -4,4 +4,5 @@ export { resolvePackage } from './resolve-package.js';
|
|
|
4
4
|
export { fileExists, fileExistsSync } from './file-exists.js';
|
|
5
5
|
export { writeFile } from './write-file.js';
|
|
6
6
|
export { resolveAnnotations } from './resolve-annotations.js';
|
|
7
|
+
export { generateSnapshotVersion } from './snapshot.js';
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAwB,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAwB,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { coerce } from 'semver';
|
|
2
|
+
/**
|
|
3
|
+
* Generates a snapshot version from a semantic version, coercing pre-release suffixes when present.
|
|
4
|
+
*
|
|
5
|
+
* This function accepts standard semantic versions and versions with pre-release suffixes (e.g.,
|
|
6
|
+
* `1.2.3-beta.1`). It uses {@link coerce} to normalize the input to the base `major.minor.patch`
|
|
7
|
+
* version before appending a timestamp-based snapshot suffix. Snapshot version formats:
|
|
8
|
+
* - With no identifier: {version}-snapshot.{unix_timestamp}
|
|
9
|
+
* - With identifier: {version}-{identifier}.{unix_timestamp}
|
|
10
|
+
*
|
|
11
|
+
* @param version - The semantic version to convert (pre-release suffixes are accepted and stripped)
|
|
12
|
+
* @param identifier - Optional snapshot identifier; if omitted or boolean, defaults to `snapshot`
|
|
13
|
+
* @returns The generated snapshot version string
|
|
14
|
+
* @throws {Error} If the version cannot be coerced into a valid semantic version
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* // With default identifier
|
|
19
|
+
* generateSnapshotVersion('1.2.3'); // Returns: "1.2.3-snapshot.1737545600"
|
|
20
|
+
*
|
|
21
|
+
* // With custom identifier
|
|
22
|
+
* generateSnapshotVersion('1.2.3', 'pr-123'); // Returns: "1.2.3-pr-123.1737545600"
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
export function generateSnapshotVersion(version, identifier) {
|
|
28
|
+
// Coerce the version to strip any pre-release suffix and get the base version
|
|
29
|
+
const baseVersion = coerce(version)?.version;
|
|
30
|
+
if (!baseVersion) {
|
|
31
|
+
throw new Error(`Invalid semantic version: "${version}". Expected format: major.minor.patch`);
|
|
32
|
+
}
|
|
33
|
+
// Generate the unix timestamp for uniqueness
|
|
34
|
+
const unixTimestamp = Math.floor(Date.now() / 1000);
|
|
35
|
+
// Determine the suffix format based on whether an identifier was provided
|
|
36
|
+
const suffix = typeof identifier === 'string' ? `${identifier}.${unixTimestamp}` : `snapshot.${unixTimestamp}`;
|
|
37
|
+
// Return the formatted snapshot version
|
|
38
|
+
return `${baseVersion}-${suffix}`;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=snapshot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot.js","sourceRoot":"","sources":["../../../../src/lib/utils/snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAe,EAAE,UAA6B;IACpF,8EAA8E;IAC9E,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAE7C,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,8BAA8B,OAAO,uCAAuC,CAAC,CAAC;IAChG,CAAC;IAED,6CAA6C;IAC7C,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;IAEpD,0EAA0E;IAC1E,MAAM,MAAM,GACV,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,UAAU,IAAI,aAAa,EAAE,CAAC,CAAC,CAAC,YAAY,aAAa,EAAE,CAAC;IAElG,wCAAwC;IACxC,OAAO,GAAG,WAAW,IAAI,MAAM,EAAE,CAAC;AACpC,CAAC"}
|
package/dist/esm/version.js
CHANGED
|
@@ -19,6 +19,10 @@ export type BuildApplicationOptions = {
|
|
|
19
19
|
* Logger instance for build output. If null, disables logging.
|
|
20
20
|
*/
|
|
21
21
|
log?: ConsoleLogger | null;
|
|
22
|
+
/**
|
|
23
|
+
* Optional snapshot version used in the build.
|
|
24
|
+
*/
|
|
25
|
+
snapshot?: boolean | string;
|
|
22
26
|
};
|
|
23
27
|
/**
|
|
24
28
|
* Output of the application build process.
|
|
@@ -43,7 +47,7 @@ type ApplicationBuildOutput = {
|
|
|
43
47
|
*
|
|
44
48
|
* Loads the application manifest, applies Vite configuration, and runs the Vite build process.
|
|
45
49
|
*
|
|
46
|
-
* @param opt - Build options including environment, manifest path, and
|
|
50
|
+
* @param opt - Build options including environment, manifest path, logger, and optional snapshot version.
|
|
47
51
|
* @returns Output containing package info, manifest, and output directory.
|
|
48
52
|
* @throws Will throw if the build process fails.
|
|
49
53
|
* @public
|
|
@@ -5,7 +5,8 @@ import type { ConsoleLogger } from './utils/index.js';
|
|
|
5
5
|
*
|
|
6
6
|
* This type defines the shape of the options object accepted by
|
|
7
7
|
* {@link loadAppManifest}. It allows for optional logging, environment overrides,
|
|
8
|
-
*
|
|
8
|
+
* a custom manifest file path, and an optional snapshot version to override the
|
|
9
|
+
* package.json version.
|
|
9
10
|
*
|
|
10
11
|
* @public
|
|
11
12
|
*/
|
|
@@ -22,11 +23,19 @@ export type ResolveAppManifestOptions = {
|
|
|
22
23
|
* Partial runtime environment overrides (optional).
|
|
23
24
|
*/
|
|
24
25
|
env?: Partial<RuntimeEnv>;
|
|
26
|
+
/**
|
|
27
|
+
* Optional snapshot version to use instead of package.json version.
|
|
28
|
+
* If provided, this version will be used in the manifest build metadata
|
|
29
|
+
* without modifying package.json.
|
|
30
|
+
*/
|
|
31
|
+
snapshot?: boolean | string;
|
|
25
32
|
};
|
|
26
33
|
/**
|
|
27
34
|
* Loads and resolves the application manifest based on the provided options.
|
|
28
35
|
*
|
|
29
36
|
* This function resolves the app package, sets up the runtime environment, and loads the manifest.
|
|
37
|
+
* If a snapshot version is provided, it will be used in the manifest build metadata instead of
|
|
38
|
+
* the package.json version, without modifying package.json.
|
|
30
39
|
* Logging is supported for debugging and progress tracking. Returns the manifest, package, and environment.
|
|
31
40
|
*
|
|
32
41
|
* @param options - The options for resolving the application manifest.
|
|
@@ -3,7 +3,8 @@ import type { ConsoleLogger } from './utils/ConsoleLogger.js';
|
|
|
3
3
|
* Options for bundling the application into an archive.
|
|
4
4
|
*
|
|
5
5
|
* This type defines the shape of the options object accepted by
|
|
6
|
-
* {@link bundleApp}. It allows for optional logging, manifest path,
|
|
6
|
+
* {@link bundleApp}. It allows for optional logging, manifest path, archive name,
|
|
7
|
+
* and an optional snapshot version to override the package.json version.
|
|
7
8
|
*
|
|
8
9
|
* @public
|
|
9
10
|
*/
|
|
@@ -20,14 +21,21 @@ export type BundleAppOptions = {
|
|
|
20
21
|
* Name or path of the output archive file (optional).
|
|
21
22
|
*/
|
|
22
23
|
archive?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Optional snapshot version to use instead of package.json version.
|
|
26
|
+
* If provided, this version will be used in the manifest build metadata
|
|
27
|
+
* without modifying package.json.
|
|
28
|
+
*/
|
|
29
|
+
snapshot?: boolean | string;
|
|
23
30
|
};
|
|
24
31
|
/**
|
|
25
32
|
* Bundles the application into an archive for distribution or deployment.
|
|
26
33
|
*
|
|
27
34
|
* This function builds the application, validates the manifest, and creates an archive containing
|
|
28
|
-
* the app manifest and metadata.
|
|
35
|
+
* the app manifest and metadata. If a snapshot version is provided, it will be used in the bundle
|
|
36
|
+
* metadata without modifying package.json. Handles errors and logs progress for maintainability and debugging.
|
|
29
37
|
*
|
|
30
|
-
* @param options - Options for logger, manifest path, and
|
|
38
|
+
* @param options - Options for logger, manifest path, archive name, and optional snapshot version.
|
|
31
39
|
* @returns An object containing the archive path and the application manifest.
|
|
32
40
|
* @throws If the manifest build config is missing or packaging fails.
|
|
33
41
|
* @public
|
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
import type { FusionFramework } from '@equinor/fusion-framework-cli/bin';
|
|
2
2
|
import { type ConsoleLogger } from './utils/index.js';
|
|
3
|
-
/**
|
|
4
|
-
* Allowed tags for application versions in the app service.
|
|
5
|
-
*
|
|
6
|
-
* - `latest`: Marks the most recent stable version of the application.
|
|
7
|
-
* - `preview`: Marks a pre-release or preview version for testing or review.
|
|
8
|
-
*
|
|
9
|
-
* Used by {@link tagApplication} to validate and apply version tags.
|
|
10
|
-
*
|
|
11
|
-
* @public
|
|
12
|
-
*/
|
|
13
|
-
export declare enum AllowedTags {
|
|
14
|
-
Latest = "latest",
|
|
15
|
-
Preview = "preview"
|
|
16
|
-
}
|
|
17
3
|
/**
|
|
18
4
|
* Options for tagging an application version in the app service.
|
|
19
5
|
*
|
|
@@ -30,14 +16,15 @@ export declare enum AllowedTags {
|
|
|
30
16
|
* @public
|
|
31
17
|
*/
|
|
32
18
|
export type TagApplicationOptions = {
|
|
33
|
-
tag:
|
|
19
|
+
tag: string;
|
|
34
20
|
appKey: string;
|
|
35
21
|
version: string;
|
|
36
22
|
framework: FusionFramework;
|
|
37
23
|
log?: ConsoleLogger | null;
|
|
38
24
|
};
|
|
39
25
|
/**
|
|
40
|
-
* Tags an application version in the app service with a specified tag (e.g., 'latest'
|
|
26
|
+
* Tags an application version in the app service with a specified tag (e.g., 'latest', 'preview'
|
|
27
|
+
* or pr-1234).
|
|
41
28
|
*
|
|
42
29
|
* This function validates input, creates a client for the app service, and sends a tag request.
|
|
43
30
|
* It provides detailed logging and error handling for common failure scenarios.
|
|
@@ -14,4 +14,5 @@ import type { ConsoleLogger } from '../utils/index.js';
|
|
|
14
14
|
export declare const resolveAppManifest: (env: RuntimeEnv, pkg: ResolvedPackage, options?: {
|
|
15
15
|
log?: ConsoleLogger | null;
|
|
16
16
|
manifestPath?: string;
|
|
17
|
+
snapshot?: boolean | string;
|
|
17
18
|
}) => Promise<import("@equinor/fusion-framework-cli/app").AppManifest>;
|
|
@@ -6,7 +6,7 @@ export { startAppDevServer } from './app-dev.js';
|
|
|
6
6
|
export { checkApp } from './app-check.js';
|
|
7
7
|
export { loadAppManifest } from './app-manifest.js';
|
|
8
8
|
export { uploadApplication } from './app-upload.js';
|
|
9
|
-
export { tagApplication
|
|
9
|
+
export { tagApplication } from './app-tag.js';
|
|
10
10
|
export { startPortalDevServer } from './portal-dev.js';
|
|
11
11
|
export { buildPortal } from './portal-build.js';
|
|
12
12
|
export { bundlePortal } from './portal-pack.js';
|
|
@@ -9,9 +9,12 @@ export declare const DEFAULT_ARCHIVE: "app-bundle.zip";
|
|
|
9
9
|
* - Output filename and directory can be specified.
|
|
10
10
|
* - Optionally provide a manifest file to customize the bundle.
|
|
11
11
|
* - If no manifest is provided, defaults to app.manifest.[ts|js|json] in the current directory.
|
|
12
|
+
* - Supports `--snapshot` flag to generate a snapshot version without modifying package.json.
|
|
12
13
|
*
|
|
13
14
|
* Usage:
|
|
14
15
|
* $ ffc app pack [manifest] [options]
|
|
16
|
+
* $ ffc app pack --snapshot
|
|
17
|
+
* $ ffc app pack --snapshot pr-123
|
|
15
18
|
*
|
|
16
19
|
* Arguments:
|
|
17
20
|
* [manifest] Manifest file to use for bundling (e.g., app.manifest.ts)
|
|
@@ -20,10 +23,13 @@ export declare const DEFAULT_ARCHIVE: "app-bundle.zip";
|
|
|
20
23
|
* -a, --archive Name of the output archive file (default: app-bundle.zip)
|
|
21
24
|
* -o, --output Directory where the archive will be saved (default: current working directory)
|
|
22
25
|
* -d, --debug Enable debug mode for verbose logging
|
|
26
|
+
* -s, --snapshot Generate a snapshot version (optionally with custom identifier)
|
|
23
27
|
*
|
|
24
28
|
* Example:
|
|
25
29
|
* $ ffc app pack
|
|
26
30
|
* $ ffc app pack app.manifest.dev.ts --archive my-app.zip --output ./dist
|
|
31
|
+
* $ ffc app pack --snapshot
|
|
32
|
+
* $ ffc app pack --snapshot pr-456
|
|
27
33
|
*
|
|
28
34
|
* @see bundleApp for implementation details
|
|
29
35
|
*/
|
|
@@ -8,9 +8,12 @@
|
|
|
8
8
|
* - Builds the app first if no bundle is provided.
|
|
9
9
|
* - Supports specifying environment, manifest file, and tag.
|
|
10
10
|
* - Debug mode and authentication options are supported.
|
|
11
|
+
* - Supports `--snapshot` flag to publish with a snapshot version without modifying package.json.
|
|
11
12
|
*
|
|
12
13
|
* Usage:
|
|
13
14
|
* $ ffc app publish [bundle] [options]
|
|
15
|
+
* $ ffc app publish --snapshot
|
|
16
|
+
* $ ffc app publish --snapshot pr-123
|
|
14
17
|
*
|
|
15
18
|
* Arguments:
|
|
16
19
|
* [bundle] Path to the app bundle to upload
|
|
@@ -19,12 +22,15 @@
|
|
|
19
22
|
* -d, --debug Enable debug mode for verbose logging (default: false)
|
|
20
23
|
* -e, --env <env> Target environment
|
|
21
24
|
* -m, --manifest Manifest file to use for bundling (e.g., app.manifest.ts)
|
|
22
|
-
* -t, --tag Tag to apply to the published app (latest | preview)
|
|
25
|
+
* -t, --tag Tag to apply to the published app (e.g. latest | preview | pr-1234)
|
|
26
|
+
* -s, --snapshot Build with snapshot version (optionally with custom identifier)
|
|
23
27
|
*
|
|
24
28
|
* Example:
|
|
25
29
|
* $ ffc app publish
|
|
26
30
|
* $ ffc app publish --env prod --manifest app.manifest.prod.ts
|
|
27
31
|
* $ ffc app publish --tag latest app.bundle.zip
|
|
32
|
+
* $ ffc app publish --snapshot
|
|
33
|
+
* $ ffc app publish --snapshot pr-456
|
|
28
34
|
*
|
|
29
35
|
* @see uploadApplication, tagApplication for implementation details
|
|
30
36
|
*/
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* $ fusion tag <tag> [options]
|
|
13
13
|
*
|
|
14
14
|
* Arguments:
|
|
15
|
-
* <tag> Tag to apply (latest | preview)
|
|
15
|
+
* <tag> Tag to apply (e.g. latest | preview | pr-1234)
|
|
16
16
|
*
|
|
17
17
|
* Options:
|
|
18
18
|
* -p, --package [package@version] Package to tag in format name@version (e.g., my-app@1.0.0). If not provided, loaded from manifest
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
* $ ffc app tag latest
|
|
26
26
|
* $ ffc app tag preview --env prod --manifest app.manifest.prod.ts
|
|
27
27
|
* $ ffc app tag latest --package my-app@1.2.3
|
|
28
|
+
* $ ffc app tag pr-1234 --package my-app@1.2.3
|
|
28
29
|
*
|
|
29
30
|
* @see tagApplication for implementation details
|
|
30
31
|
*/
|
|
@@ -15,12 +15,13 @@
|
|
|
15
15
|
* -d, --debug Enable debug mode for verbose logging
|
|
16
16
|
* -e, --env <env> Target environment
|
|
17
17
|
* -m, --manifest Manifest file to use for bundling
|
|
18
|
-
* -t, --tag Tag to apply to the published portal (
|
|
18
|
+
* -t, --tag Tag to apply to the published portal (e.g latest | preview | pr-1234)
|
|
19
19
|
*
|
|
20
20
|
* Example:
|
|
21
21
|
* $ ffc portal publish
|
|
22
22
|
* $ ffc portal publish --env prod --manifest portal.manifest.prod.ts
|
|
23
23
|
* $ ffc portal publish --tag preview
|
|
24
|
+
* $ ffc portal publish --tag pr-1234
|
|
24
25
|
*
|
|
25
26
|
* @see uploadPortalBundle, tagPortal for implementation details
|
|
26
27
|
*/
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* $ ffc portal tag <tag> [options]
|
|
13
13
|
*
|
|
14
14
|
* Arguments:
|
|
15
|
-
* <tag> Tag to apply (e.g., latest, preview, next, or
|
|
15
|
+
* <tag> Tag to apply (e.g., latest, preview, next, or string [a-z, A-Z, 0-9, ".", "-"])
|
|
16
16
|
*
|
|
17
17
|
* Options:
|
|
18
18
|
* -m, --manifest <file> Manifest file to use (optional, defaults to portal.manifest.ts)
|
|
@@ -14,4 +14,6 @@ import type { RuntimeEnv } from '../types.js';
|
|
|
14
14
|
* @throws If required fields are missing in packageJson.
|
|
15
15
|
* @public
|
|
16
16
|
*/
|
|
17
|
-
export declare const createAppManifestFromPackage: (env: RuntimeEnv, packageJson: PackageJson
|
|
17
|
+
export declare const createAppManifestFromPackage: (env: RuntimeEnv, packageJson: PackageJson, options?: {
|
|
18
|
+
snapshot?: boolean | string;
|
|
19
|
+
}) => AppManifest;
|
|
@@ -4,3 +4,4 @@ export { resolvePackage, type ResolvedPackage } from './resolve-package.js';
|
|
|
4
4
|
export { fileExists, fileExistsSync } from './file-exists.js';
|
|
5
5
|
export { writeFile } from './write-file.js';
|
|
6
6
|
export { resolveAnnotations } from './resolve-annotations.js';
|
|
7
|
+
export { generateSnapshotVersion } from './snapshot.js';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates a snapshot version from a semantic version, coercing pre-release suffixes when present.
|
|
3
|
+
*
|
|
4
|
+
* This function accepts standard semantic versions and versions with pre-release suffixes (e.g.,
|
|
5
|
+
* `1.2.3-beta.1`). It uses {@link coerce} to normalize the input to the base `major.minor.patch`
|
|
6
|
+
* version before appending a timestamp-based snapshot suffix. Snapshot version formats:
|
|
7
|
+
* - With no identifier: {version}-snapshot.{unix_timestamp}
|
|
8
|
+
* - With identifier: {version}-{identifier}.{unix_timestamp}
|
|
9
|
+
*
|
|
10
|
+
* @param version - The semantic version to convert (pre-release suffixes are accepted and stripped)
|
|
11
|
+
* @param identifier - Optional snapshot identifier; if omitted or boolean, defaults to `snapshot`
|
|
12
|
+
* @returns The generated snapshot version string
|
|
13
|
+
* @throws {Error} If the version cannot be coerced into a valid semantic version
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* // With default identifier
|
|
18
|
+
* generateSnapshotVersion('1.2.3'); // Returns: "1.2.3-snapshot.1737545600"
|
|
19
|
+
*
|
|
20
|
+
* // With custom identifier
|
|
21
|
+
* generateSnapshotVersion('1.2.3', 'pr-123'); // Returns: "1.2.3-pr-123.1737545600"
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
export declare function generateSnapshotVersion(version: string, identifier?: boolean | string): string;
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "13.
|
|
1
|
+
export declare const version = "13.1.1";
|
package/docs/ai-commands.md
CHANGED
|
@@ -418,7 +418,7 @@ jobs:
|
|
|
418
418
|
|
|
419
419
|
- uses: actions/setup-node@v4
|
|
420
420
|
with:
|
|
421
|
-
node-version: '
|
|
421
|
+
node-version: '24'
|
|
422
422
|
|
|
423
423
|
- run: pnpm install
|
|
424
424
|
|
|
@@ -461,7 +461,7 @@ jobs:
|
|
|
461
461
|
- name: Setup Node.js
|
|
462
462
|
uses: actions/setup-node@v4
|
|
463
463
|
with:
|
|
464
|
-
node-version: '
|
|
464
|
+
node-version: '24'
|
|
465
465
|
cache: 'pnpm'
|
|
466
466
|
|
|
467
467
|
- name: Install dependencies
|
|
@@ -293,6 +293,16 @@ export default defineDevServerConfig(() => ({
|
|
|
293
293
|
- `3`: Error (shows only errors and critical messages)
|
|
294
294
|
- `4`: Critical (shows only critical messages - least verbose)
|
|
295
295
|
|
|
296
|
+
### AG Grid License Key
|
|
297
|
+
|
|
298
|
+
Eliminate AG Grid Enterprise license warnings during local development by setting the license key in your `.env` file:
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
FUSION_SPA_AG_GRID_KEY=your-license-key-here
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
The dev-portal automatically picks this up and configures AG Grid - no additional setup required.
|
|
305
|
+
|
|
296
306
|
### Portal Proxy Configuration
|
|
297
307
|
|
|
298
308
|
**When you need it**: You want to control how portal assets are loaded during development - either from the Fusion portal service or from locally installed portal packages.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/fusion-framework-cli",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.1.1",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"Fusion",
|
|
6
6
|
"Fusion Framework",
|
|
@@ -104,15 +104,16 @@
|
|
|
104
104
|
"is-mergeable-object": "^1.1.1",
|
|
105
105
|
"is-path-inside": "^4.0.0",
|
|
106
106
|
"ora": "^9.0.0",
|
|
107
|
-
"read-package-up": "^
|
|
107
|
+
"read-package-up": "^12.0.0",
|
|
108
|
+
"semver": "^7.6.0",
|
|
108
109
|
"simple-git": "^3.28.0",
|
|
109
110
|
"vite": "^7.1.12",
|
|
110
|
-
"vite-tsconfig-paths": "^
|
|
111
|
+
"vite-tsconfig-paths": "^6.0.4",
|
|
111
112
|
"zod": "^4.1.8",
|
|
112
|
-
"@equinor/fusion-framework-dev-portal": "1.
|
|
113
|
-
"@equinor/fusion-framework-
|
|
114
|
-
"@equinor/fusion-framework-
|
|
115
|
-
"@equinor/fusion-imports": "1.1.
|
|
113
|
+
"@equinor/fusion-framework-dev-portal": "1.4.0",
|
|
114
|
+
"@equinor/fusion-framework-dev-server": "1.1.20",
|
|
115
|
+
"@equinor/fusion-framework-module-msal-node": "2.0.3",
|
|
116
|
+
"@equinor/fusion-imports": "1.1.10"
|
|
116
117
|
},
|
|
117
118
|
"devDependencies": {
|
|
118
119
|
"@rollup/plugin-commonjs": "^29.0.0",
|
|
@@ -121,13 +122,14 @@
|
|
|
121
122
|
"@rollup/plugin-replace": "^6.0.2",
|
|
122
123
|
"@types/adm-zip": "^0.5.0",
|
|
123
124
|
"@types/normalize-package-data": "^2.4.4",
|
|
125
|
+
"@types/semver": "^7.5.8",
|
|
124
126
|
"@vitest/coverage-v8": "^3.2.4",
|
|
125
127
|
"adm-zip": "^0.5.10",
|
|
126
128
|
"ajv": "^8.17.1",
|
|
127
129
|
"chalk": "^5.6.0",
|
|
128
130
|
"is-ci": "^4.1.0",
|
|
129
131
|
"normalize-package-data": "^8.0.0",
|
|
130
|
-
"open": "^
|
|
132
|
+
"open": "^11.0.0",
|
|
131
133
|
"pretty-bytes": "^7.0.0",
|
|
132
134
|
"rollup": "^4.50.2",
|
|
133
135
|
"rollup-plugin-terser": "^7.0.2",
|
|
@@ -135,14 +137,14 @@
|
|
|
135
137
|
"type-fest": "^5.0.0",
|
|
136
138
|
"typescript": "^5.8.2",
|
|
137
139
|
"vitest": "^3.2.4",
|
|
138
|
-
"@equinor/fusion-framework-cli-plugin-ai-
|
|
139
|
-
"@equinor/fusion-framework-cli-plugin-ai-
|
|
140
|
-
"@equinor/fusion-framework-cli-plugin-ai-
|
|
141
|
-
"@equinor/fusion-framework-cli-plugin-ai-index": "1.0.
|
|
140
|
+
"@equinor/fusion-framework-cli-plugin-ai-chat": "1.0.3",
|
|
141
|
+
"@equinor/fusion-framework-cli-plugin-ai-mcp": "1.0.3",
|
|
142
|
+
"@equinor/fusion-framework-cli-plugin-ai-search": "1.0.3",
|
|
143
|
+
"@equinor/fusion-framework-cli-plugin-ai-index": "1.0.3",
|
|
142
144
|
"@equinor/fusion-framework-module": "5.0.5",
|
|
143
|
-
"@equinor/fusion-framework-module-app": "7.2.
|
|
144
|
-
"@equinor/fusion-framework-module-http": "7.0.
|
|
145
|
-
"@equinor/fusion-framework-module-service-discovery": "9.0.
|
|
145
|
+
"@equinor/fusion-framework-module-app": "7.2.2",
|
|
146
|
+
"@equinor/fusion-framework-module-http": "7.0.6",
|
|
147
|
+
"@equinor/fusion-framework-module-service-discovery": "9.0.5"
|
|
146
148
|
},
|
|
147
149
|
"peerDependenciesMeta": {
|
|
148
150
|
"typescript": {
|