@equinor/fusion-framework-cli 15.6.3 → 15.7.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 +16 -0
- package/bin/build/bin.mjs +1 -1
- package/bin/build/cli.mjs +3 -3
- package/dist/esm/version.js +1 -1
- package/dist/types/bin/upload-application.d.ts +4 -1
- package/dist/types/bin/upload-application.test.d.ts +1 -0
- package/dist/types/cli/commands/app/publish.command.d.ts +1 -0
- package/dist/types/cli/commands/app/publish.command.test.d.ts +1 -0
- package/dist/types/version.d.ts +1 -1
- package/docs/application.md +44 -0
- package/package.json +2 -2
package/dist/esm/version.js
CHANGED
|
@@ -12,6 +12,7 @@ import { type ConsoleLogger } from './utils/index.js';
|
|
|
12
12
|
* @property appKey - Optional application key to override bundle metadata.
|
|
13
13
|
* @property framework - The FusionFramework instance used for service discovery and requests.
|
|
14
14
|
* @property log - Optional logger for outputting progress and debug information.
|
|
15
|
+
* @property allowExistingVersion - Reuse the exact bundle version only on a structured duplicate-version upload conflict.
|
|
15
16
|
*
|
|
16
17
|
* @public
|
|
17
18
|
*/
|
|
@@ -20,6 +21,7 @@ type UploadApplicationOptions = {
|
|
|
20
21
|
appKey?: string;
|
|
21
22
|
framework: FusionFramework;
|
|
22
23
|
log?: ConsoleLogger;
|
|
24
|
+
allowExistingVersion?: boolean;
|
|
23
25
|
};
|
|
24
26
|
/**
|
|
25
27
|
* Uploads an application bundle to the app service for publishing or updating an app.
|
|
@@ -29,12 +31,13 @@ type UploadApplicationOptions = {
|
|
|
29
31
|
* for common failure scenarios, including HTTP status codes and bundle reading issues.
|
|
30
32
|
*
|
|
31
33
|
* @param opt - Options for bundle file, app key, framework, and logger.
|
|
32
|
-
* @returns The
|
|
34
|
+
* @returns The uploaded app identity, or the bundle identity marked `existingVersion` on an opted-in duplicate response. Existing versions must still be tagged by the caller.
|
|
33
35
|
* @throws If bundle reading or upload fails, or if the app service returns an error status.
|
|
34
36
|
* @public
|
|
35
37
|
*/
|
|
36
38
|
export declare const uploadApplication: (opt: UploadApplicationOptions) => Promise<{
|
|
37
39
|
appKey: string;
|
|
38
40
|
version: string;
|
|
41
|
+
existingVersion?: true;
|
|
39
42
|
}>;
|
|
40
43
|
export default uploadApplication;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* - Supports specifying environment, manifest file, and tag.
|
|
10
10
|
* - Debug mode and authentication options are supported.
|
|
11
11
|
* - Supports `--snapshot` flag to publish with a snapshot version without modifying package.json.
|
|
12
|
+
* - Supports `--allow-existing-version` to re-tag an exact existing bundle version on a duplicate upload response.
|
|
12
13
|
*
|
|
13
14
|
* Usage:
|
|
14
15
|
* $ ffc app publish [bundle] [options]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "15.
|
|
1
|
+
export declare const version = "15.7.1";
|
package/docs/application.md
CHANGED
|
@@ -497,6 +497,7 @@ This command uploads and tags your app for deployment. If no bundle is provided,
|
|
|
497
497
|
| `-m`, `--manifest` | Manifest file to use for bundling (e.g., `app.manifest.ts`) (optional). | `app.manifest.ts` |
|
|
498
498
|
| `-t`, `--tag` | Tag to apply to the published app (any string, commonly `latest` or `preview`). | `latest` |
|
|
499
499
|
| `-c`, `--config` | Upload application config after publishing. Accepts true for default config file or a path to a specific config file. | |
|
|
500
|
+
| `--allow-existing-version` | On a confirmed duplicate-version upload response, re-tag the exact existing bundle version instead of failing. | `false` |
|
|
500
501
|
| `-d`, `--debug` | Enable debug mode for verbose logging. | `false` |
|
|
501
502
|
| `--token` | Authentication token for Fusion. | |
|
|
502
503
|
| `--tenantId` | Azure tenant ID for authentication. | |
|
|
@@ -529,6 +530,49 @@ pnpm fusion-framework-cli publish --config app.config.prod.ts --env prod
|
|
|
529
530
|
> - Authentication options (`--token`, `--tenantId`, `--clientId`) can be set via CLI flags or environment variables.
|
|
530
531
|
> - If any step fails (build, upload, or tagging), an error will be logged and the process will exit with a non-zero code.
|
|
531
532
|
|
|
533
|
+
#### Re-deploy an existing version
|
|
534
|
+
|
|
535
|
+
Use `ffc app publish --allow-existing-version` to re-run a deployment or move a tag
|
|
536
|
+
back to an older published bundle without generating another version:
|
|
537
|
+
|
|
538
|
+
```sh
|
|
539
|
+
# Restore latest to the exact version in a previously published artifact.
|
|
540
|
+
ffc app publish --env ci --tag latest --allow-existing-version previous.bundle.zip
|
|
541
|
+
|
|
542
|
+
# Restore a pull-request preview tag.
|
|
543
|
+
ffc app publish --env ci --tag pr-42 --allow-existing-version app.bundle.zip
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
The option is disabled by default. Omit it to retain duplicate-version failures.
|
|
547
|
+
An ordinary successful upload is unchanged when the option is enabled.
|
|
548
|
+
|
|
549
|
+
Recovery requires an HTTP **409 from bundle upload** whose JSON `error` has
|
|
550
|
+
`code: "ConflictError"`, `resourceIdentifier: "version"`, and
|
|
551
|
+
`message: "An app build with version <version> already exists"`. The version must
|
|
552
|
+
exactly match the lowercased, valid semantic version in the uploaded ZIP's
|
|
553
|
+
`app-manifest.json`. The app key is the same key used for that upload, resolved
|
|
554
|
+
from the bundle metadata or an explicit programmatic override. The CLI does not
|
|
555
|
+
guess from the working directory, a tag, `package.json`, or a log message.
|
|
556
|
+
Unknown, malformed or mismatched responses still fail.
|
|
557
|
+
|
|
558
|
+
On that specific response, the CLI does not retry the upload. It tags the existing
|
|
559
|
+
version with the original `--tag`, using the same initialized framework,
|
|
560
|
+
authentication and `--env`. If requested, `--config` generation and publication
|
|
561
|
+
still run for that version. Only after tagging and requested config publication
|
|
562
|
+
succeed does the CLI report that the existing version was re-tagged.
|
|
563
|
+
|
|
564
|
+
Authentication, discovery, network, validation, unrelated conflicts, tagging and
|
|
565
|
+
config failures remain failures. A config failure can occur after the tag has
|
|
566
|
+
already moved; publishing is not transactional. Reusing a version deploys the
|
|
567
|
+
**existing** registry contents, not the newly supplied ZIP contents, and does not
|
|
568
|
+
compare their bytes. Use a new version when the build contents have changed.
|
|
569
|
+
|
|
570
|
+
For programmatic callers, `uploadApplication({ ..., allowExistingVersion: true })`
|
|
571
|
+
returns `{ appKey, version, existingVersion: true }` only for the confirmed
|
|
572
|
+
duplicate response. This result is not a completed deployment: the caller must
|
|
573
|
+
still tag that version and complete any requested config publication. Successful
|
|
574
|
+
new uploads retain the existing `{ appKey, version }` result shape.
|
|
575
|
+
|
|
532
576
|
### Config
|
|
533
577
|
|
|
534
578
|
Upload your application configuration to the Fusion app store (registry).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/fusion-framework-cli",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.7.1",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"Fusion",
|
|
6
6
|
"Fusion Framework",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"directory": "packages/cli"
|
|
95
95
|
},
|
|
96
96
|
"dependencies": {
|
|
97
|
-
"@equinor/fusion-framework-dev-portal": "11.1.
|
|
97
|
+
"@equinor/fusion-framework-dev-portal": "11.1.9",
|
|
98
98
|
"@equinor/fusion-framework-dev-server": "2.3.2",
|
|
99
99
|
"@equinor/fusion-framework-module-azure-identity": "0.3.4",
|
|
100
100
|
"@equinor/fusion-framework-vite-plugin-raw-imports": "2.0.5",
|