@equinor/fusion-framework-cli 11.0.0-next.5 → 11.0.0-next.6
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 +23 -0
- package/bin/build/bin.js +7 -7
- package/bin/build/cli.js +422 -188
- package/bin/build/{portal-pack-qpEBTWNW.js → portal-config-publish-CqqdoblS.js} +209 -7
- package/dist/esm/bin/helpers/resolve-portal-config.js +46 -0
- package/dist/esm/bin/helpers/resolve-portal-config.js.map +1 -0
- package/dist/esm/bin/index.js +2 -0
- package/dist/esm/bin/index.js.map +1 -1
- package/dist/esm/bin/portal-config-publish.js +74 -0
- package/dist/esm/bin/portal-config-publish.js.map +1 -0
- package/dist/esm/bin/portal-config.js +48 -0
- package/dist/esm/bin/portal-config.js.map +1 -0
- package/dist/esm/bin/portal-dev.js +3 -4
- package/dist/esm/bin/portal-dev.js.map +1 -1
- package/dist/esm/cli/commands/app/alias.js +4 -4
- package/dist/esm/cli/commands/app/alias.js.map +1 -1
- package/dist/esm/cli/commands/app/build.js +10 -3
- package/dist/esm/cli/commands/app/build.js.map +1 -1
- package/dist/esm/cli/commands/app/check.js +15 -5
- package/dist/esm/cli/commands/app/check.js.map +1 -1
- package/dist/esm/cli/commands/app/config.js +20 -8
- package/dist/esm/cli/commands/app/config.js.map +1 -1
- package/dist/esm/cli/commands/app/dev.js +10 -4
- package/dist/esm/cli/commands/app/dev.js.map +1 -1
- package/dist/esm/cli/commands/app/index.js +18 -1
- package/dist/esm/cli/commands/app/index.js.map +1 -1
- package/dist/esm/cli/commands/app/manifest.js +12 -3
- package/dist/esm/cli/commands/app/manifest.js.map +1 -1
- package/dist/esm/cli/commands/app/pack.js +16 -9
- package/dist/esm/cli/commands/app/pack.js.map +1 -1
- package/dist/esm/cli/commands/app/publish.js +15 -4
- package/dist/esm/cli/commands/app/publish.js.map +1 -1
- package/dist/esm/cli/commands/app/tag.js +16 -4
- package/dist/esm/cli/commands/app/tag.js.map +1 -1
- package/dist/esm/cli/commands/app/upload.js +13 -8
- package/dist/esm/cli/commands/app/upload.js.map +1 -1
- package/dist/esm/cli/commands/auth/index.js +13 -1
- package/dist/esm/cli/commands/auth/index.js.map +1 -1
- package/dist/esm/cli/commands/auth/login.js +11 -7
- package/dist/esm/cli/commands/auth/login.js.map +1 -1
- package/dist/esm/cli/commands/auth/logout.js +10 -7
- package/dist/esm/cli/commands/auth/logout.js.map +1 -1
- package/dist/esm/cli/commands/auth/token.js +13 -9
- package/dist/esm/cli/commands/auth/token.js.map +1 -1
- package/dist/esm/cli/commands/disco/resolve.js +13 -16
- package/dist/esm/cli/commands/disco/resolve.js.map +1 -1
- package/dist/esm/cli/commands/portal/build.js +12 -7
- package/dist/esm/cli/commands/portal/build.js.map +1 -1
- package/dist/esm/cli/commands/portal/config.js +101 -0
- package/dist/esm/cli/commands/portal/config.js.map +1 -0
- package/dist/esm/cli/commands/portal/dev.js +9 -6
- package/dist/esm/cli/commands/portal/dev.js.map +1 -1
- package/dist/esm/cli/commands/portal/index.js +3 -1
- package/dist/esm/cli/commands/portal/index.js.map +1 -1
- package/dist/esm/cli/commands/portal/manifest.js +11 -8
- package/dist/esm/cli/commands/portal/manifest.js.map +1 -1
- package/dist/esm/cli/commands/portal/pack.js +13 -8
- package/dist/esm/cli/commands/portal/pack.js.map +1 -1
- package/dist/esm/cli/commands/portal/publish.js +11 -8
- package/dist/esm/cli/commands/portal/publish.js.map +1 -1
- package/dist/esm/cli/commands/portal/schema.js +10 -8
- package/dist/esm/cli/commands/portal/schema.js.map +1 -1
- package/dist/esm/cli/commands/portal/tag.js +12 -8
- package/dist/esm/cli/commands/portal/tag.js.map +1 -1
- package/dist/esm/cli/commands/portal/upload.js +8 -7
- package/dist/esm/cli/commands/portal/upload.js.map +1 -1
- package/dist/esm/lib/portal/index.js +2 -0
- package/dist/esm/lib/portal/index.js.map +1 -1
- package/dist/esm/lib/portal/load-portal-config.js +49 -0
- package/dist/esm/lib/portal/load-portal-config.js.map +1 -0
- package/dist/esm/lib/portal/portal-config.js +23 -0
- package/dist/esm/lib/portal/portal-config.js.map +1 -0
- package/dist/esm/version.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/bin/helpers/resolve-portal-config.d.ts +18 -0
- package/dist/types/bin/index.d.ts +2 -0
- package/dist/types/bin/portal-config-publish.d.ts +26 -0
- package/dist/types/bin/portal-config.d.ts +46 -0
- package/dist/types/cli/commands/app/config.d.ts +3 -3
- package/dist/types/cli/commands/app/pack.d.ts +1 -1
- package/dist/types/cli/commands/auth/logout.d.ts +0 -4
- package/dist/types/cli/commands/auth/token.d.ts +0 -5
- package/dist/types/cli/commands/disco/resolve.d.ts +0 -7
- package/dist/types/cli/commands/portal/config.d.ts +32 -0
- package/dist/types/lib/portal/index.d.ts +2 -0
- package/dist/types/lib/portal/load-portal-config.d.ts +83 -0
- package/dist/types/lib/portal/portal-config.d.ts +69 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +5 -4
package/bin/build/cli.js
CHANGED
|
@@ -5,7 +5,7 @@ import { createCommand, createOption, InvalidOptionArgumentError, Command } from
|
|
|
5
5
|
import 'node:fs';
|
|
6
6
|
import chalk from 'chalk';
|
|
7
7
|
import 'pretty-bytes';
|
|
8
|
-
import { S as Spinner, b as buildApplication, a as bundleApp, F as FusionEnv, r as resolveDefaultEnv,
|
|
8
|
+
import { S as Spinner, b as buildApplication, a as bundleApp, F as FusionEnv, r as resolveDefaultEnv, i as resolveProjectPackage, j as resolveAppManifest, k as initializeFramework, p as publishAppConfig, g as generateApplicationConfig, m as formatPath, H as HttpJsonResponseError, n as loadAppManifest, s as startAppDevServer, o as fileExistsSync, N as NoAccountsError, q as resolvePortalManifest, t as resolvePortalConfig, u as createDevServer, l as loadPortalManifest, v as getDefaultExportFromCjs, w as loadPortalSchema, x as writeFile$1, c as buildPortal, d as bundlePortal, f as publishPortalConfig, e as generatePortalConfig } from './portal-config-publish-CqqdoblS.js';
|
|
9
9
|
import { importJSON } from '@equinor/fusion-imports';
|
|
10
10
|
import 'lodash.mergewith';
|
|
11
11
|
import '@equinor/fusion-framework-dev-server';
|
|
@@ -13,12 +13,12 @@ import 'vite';
|
|
|
13
13
|
import { mkdir, writeFile } from 'node:fs/promises';
|
|
14
14
|
import 'node:assert';
|
|
15
15
|
import 'node:child_process';
|
|
16
|
+
import 'zod';
|
|
16
17
|
import AdmZip from 'adm-zip';
|
|
17
18
|
import { stdout } from 'node:process';
|
|
18
19
|
import '@azure/msal-node';
|
|
19
20
|
import 'open';
|
|
20
21
|
import 'node:http';
|
|
21
|
-
import 'zod';
|
|
22
22
|
import 'is-ci';
|
|
23
23
|
import 'ora';
|
|
24
24
|
|
|
@@ -157,12 +157,19 @@ class ConsoleLogger {
|
|
|
157
157
|
*
|
|
158
158
|
* @see buildApplication for build implementation details
|
|
159
159
|
*/
|
|
160
|
-
const command$
|
|
161
|
-
.description(
|
|
162
|
-
|
|
163
|
-
'
|
|
160
|
+
const command$p = createCommand('build')
|
|
161
|
+
.description('Build the application using a manifest file and environment-specific configuration.')
|
|
162
|
+
.addHelpText('after', [
|
|
163
|
+
'Builds the application using a manifest file and environment-specific configuration.',
|
|
164
|
+
'If no manifest is provided, searches for a default app.manifest.[ts|js|json] in the current directory.',
|
|
164
165
|
'You can use environment variables to customize the build process.',
|
|
165
166
|
'',
|
|
167
|
+
'Arguments:',
|
|
168
|
+
' [manifest] Manifest file to use for building (e.g., app.manifest.ts)',
|
|
169
|
+
'',
|
|
170
|
+
'Options:',
|
|
171
|
+
' -d, --debug Enable debug mode for verbose logging (default: false)',
|
|
172
|
+
'',
|
|
166
173
|
'Examples:',
|
|
167
174
|
' $ fusion build',
|
|
168
175
|
' $ fusion build app.manifest.dev.ts --debug',
|
|
@@ -174,7 +181,7 @@ const command$o = createCommand('build')
|
|
|
174
181
|
await buildApplication({ log, manifest });
|
|
175
182
|
});
|
|
176
183
|
|
|
177
|
-
const
|
|
184
|
+
const DEFAULT_ARCHIVE = 'app-bundle.zip';
|
|
178
185
|
/**
|
|
179
186
|
* CLI command: `pack`
|
|
180
187
|
*
|
|
@@ -203,20 +210,27 @@ const defaultArchive = 'app-bundle.zip';
|
|
|
203
210
|
*
|
|
204
211
|
* @see bundleApp for implementation details
|
|
205
212
|
*/
|
|
206
|
-
const command$
|
|
207
|
-
.description(
|
|
208
|
-
|
|
209
|
-
'
|
|
210
|
-
'
|
|
211
|
-
'
|
|
212
|
-
'If no manifest is provided,
|
|
213
|
-
'
|
|
213
|
+
const command$o = createCommand('pack')
|
|
214
|
+
.description('Create a distributable app bundle of the application.')
|
|
215
|
+
.addHelpText('after', [
|
|
216
|
+
'Creates a distributable app bundle of the application.',
|
|
217
|
+
'Bundles all necessary files for deployment.',
|
|
218
|
+
'You can specify the output filename and directory, and optionally provide a manifest file.',
|
|
219
|
+
'If no manifest is provided, defaults to app.manifest.[ts|js|json] in the current directory.',
|
|
220
|
+
'',
|
|
221
|
+
'Arguments:',
|
|
222
|
+
' [manifest] Manifest file to use for bundling (e.g., app.manifest.ts)',
|
|
223
|
+
'',
|
|
224
|
+
'Options:',
|
|
225
|
+
' -a, --archive Name of the output archive file (default: app-bundle.zip)',
|
|
226
|
+
' -o, --output Directory where the archive will be saved (default: current working directory)',
|
|
227
|
+
' -d, --debug Enable debug mode for verbose logging',
|
|
214
228
|
'',
|
|
215
229
|
'Examples:',
|
|
216
230
|
' $ fusion pack',
|
|
217
231
|
' $ fusion pack app.manifest.dev.ts --archive my-app.zip --output ./dist',
|
|
218
232
|
].join('\n'))
|
|
219
|
-
.option('-a, --archive [string]', 'Name of the output archive file (default: app-bundle.zip)',
|
|
233
|
+
.option('-a, --archive [string]', 'Name of the output archive file (default: app-bundle.zip)', DEFAULT_ARCHIVE)
|
|
220
234
|
.option('-o, --output [string]', 'Directory where the archive will be saved (default: current working directory)', process.cwd())
|
|
221
235
|
.option('-d, --debug', 'Enable debug mode for verbose logging', false)
|
|
222
236
|
.argument('[manifest]', 'Manifest file to use for bundling (e.g., app.manifest.ts)')
|
|
@@ -437,11 +451,21 @@ const checkApp = async (options) => {
|
|
|
437
451
|
*
|
|
438
452
|
* @see checkApp for implementation details
|
|
439
453
|
*/
|
|
440
|
-
const command$
|
|
441
|
-
.description(
|
|
442
|
-
'
|
|
443
|
-
'
|
|
444
|
-
|
|
454
|
+
const command$n = withAuthOptions(createCommand('check')
|
|
455
|
+
.description('Check if application is registered in Fusion app store.')
|
|
456
|
+
.addHelpText('after', [
|
|
457
|
+
'Checks if the application is registered in the Fusion app store.',
|
|
458
|
+
'Verifies the registration status of your application in the Fusion app store.',
|
|
459
|
+
'Helps identify issues with app registration or configuration.',
|
|
460
|
+
'Supports authentication and environment options. Provides a debug mode for verbose logging.',
|
|
461
|
+
'',
|
|
462
|
+
'Options:',
|
|
463
|
+
' -d, --debug Enable debug mode for verbose logging (default: false)',
|
|
464
|
+
' --environment <env> Specify the environment (see available environments)',
|
|
465
|
+
' --token <token> Provide an authentication token (if required)',
|
|
466
|
+
'',
|
|
467
|
+
'Examples:',
|
|
468
|
+
' $ fusion check --environment prod --debug',
|
|
445
469
|
].join('\n'))
|
|
446
470
|
.option('-d, --debug', 'debug mode', false)
|
|
447
471
|
.addOption(createEnvOption({ allowDev: false }))
|
|
@@ -617,16 +641,21 @@ const uploadApplication = async (opt) => {
|
|
|
617
641
|
*
|
|
618
642
|
* @see uploadApplication for implementation details
|
|
619
643
|
*/
|
|
620
|
-
const command$
|
|
621
|
-
.description(
|
|
622
|
-
|
|
644
|
+
const command$m = withAuthOptions(createCommand('upload')
|
|
645
|
+
.description('Upload a Fusion application bundle to the Fusion App Store.')
|
|
646
|
+
.addHelpText('after', [
|
|
647
|
+
'',
|
|
648
|
+
'Uploads a Fusion application bundle to the Fusion App Store.',
|
|
649
|
+
'Uploads a distributable application bundle (e.g., app-bundle.zip) to the Fusion app registry.',
|
|
650
|
+
'Supports specifying application key, environment, and debug mode.',
|
|
623
651
|
'',
|
|
624
|
-
'
|
|
652
|
+
'Arguments:',
|
|
653
|
+
' [bundle] Application bundle to upload (default: app-bundle.zip)',
|
|
625
654
|
'',
|
|
626
655
|
'Options:',
|
|
627
|
-
' --appKey <string>
|
|
628
|
-
' --env <env>
|
|
629
|
-
' --debug
|
|
656
|
+
' -k, --appKey <string> Application key (if not provided, resolved from manifest)',
|
|
657
|
+
' -e, --env <env> Target environment',
|
|
658
|
+
' -d, --debug Enable debug mode for verbose logging',
|
|
630
659
|
'',
|
|
631
660
|
'Examples:',
|
|
632
661
|
' $ fusion upload',
|
|
@@ -636,7 +665,7 @@ const command$l = withAuthOptions(createCommand('upload')
|
|
|
636
665
|
.option('-d, --debug [boolean]', 'Enable debug mode for verbose logging', false)
|
|
637
666
|
.option('-k, --appKey <string>', 'Application key (if not provided, resolved from manifest)')
|
|
638
667
|
.addOption(createEnvOption({ allowDev: false }))
|
|
639
|
-
.argument('[bundle]', 'Application bundle to upload (default: app-bundle.zip)',
|
|
668
|
+
.argument('[bundle]', 'Application bundle to upload (default: app-bundle.zip)', DEFAULT_ARCHIVE)
|
|
640
669
|
.action(async (bundle, options) => {
|
|
641
670
|
const log = new ConsoleLogger('portal:upload', {
|
|
642
671
|
debug: options.debug,
|
|
@@ -688,25 +717,37 @@ const command$l = withAuthOptions(createCommand('upload')
|
|
|
688
717
|
* -o, --output <stdout|path> Output to stdout or a file (default: stdout)
|
|
689
718
|
*
|
|
690
719
|
* Example:
|
|
691
|
-
* $ fusion config app.config.ts
|
|
692
|
-
* $ fusion config app.config.prod.ts --output ./dist/app.config.json
|
|
693
|
-
* $ fusion config --publish --manifest app.manifest.ts --env prod
|
|
720
|
+
* $ fusion-framework-cli config app.config.ts
|
|
721
|
+
* $ fusion-framework-cli config app.config.prod.ts --output ./dist/app.config.json
|
|
722
|
+
* $ fusion-framework-cli config --publish --manifest app.manifest.ts --env prod
|
|
694
723
|
*
|
|
695
724
|
* @see generateApplicationConfig, publishAppConfig for implementation details
|
|
696
725
|
*/
|
|
697
|
-
const command$
|
|
698
|
-
.description(
|
|
726
|
+
const command$l = withAuthOptions(createCommand('config')
|
|
727
|
+
.description('Generate or publish the Fusion application configuration file.')
|
|
728
|
+
.addHelpText('after', [
|
|
699
729
|
'Generate and/or publish the application configuration for Fusion apps.',
|
|
700
730
|
'',
|
|
701
731
|
'By default, outputs the generated config to stdout or a file. Use --publish to upload the config to the Fusion app registry.',
|
|
702
732
|
'Options [token, tenant, client, manifest] are only relevant when --publish is used.',
|
|
703
733
|
'Option [-e, --env] cannot be set to dev when --publish is used.',
|
|
704
734
|
'',
|
|
735
|
+
'Arguments:',
|
|
736
|
+
' [config] Config build file to use (e.g., app.config[.env]?.[ts,js,json])',
|
|
737
|
+
'',
|
|
738
|
+
'Options:',
|
|
739
|
+
' --debug Enable debug mode for verbose logging',
|
|
740
|
+
' --silent Silent mode, suppresses output except errors',
|
|
741
|
+
' --publish Publish config to Fusion app registry',
|
|
742
|
+
' --manifest <path> Path to the app manifest file (required with --publish)',
|
|
743
|
+
' -e, --env <env> Target environment',
|
|
744
|
+
' -o, --output <stdout|path> Output to stdout or a file (default: stdout)',
|
|
745
|
+
'',
|
|
705
746
|
'Examples:',
|
|
706
|
-
' $ fusion config app.config.ts',
|
|
707
|
-
' $ fusion config app.config.prod.ts --output ./dist/app.config.json',
|
|
708
|
-
' $ fusion config --publish --manifest app.manifest.ts --env prod',
|
|
709
|
-
' $ fusion config --env prod my-custom.config.ts',
|
|
747
|
+
' $ fusion-framework-cli config app.config.ts',
|
|
748
|
+
' $ fusion-framework-cli config app.config.prod.ts --output ./dist/app.config.json',
|
|
749
|
+
' $ fusion-framework-cli config --publish --manifest app.manifest.ts --env prod',
|
|
750
|
+
' $ fusion-framework-cli config --env prod my-custom.config.ts',
|
|
710
751
|
].join('\n'))
|
|
711
752
|
.option('--debug', 'Enable debug mode for verbose logging')
|
|
712
753
|
.option('--silent', 'Silent mode, suppresses output except errors')
|
|
@@ -861,14 +902,26 @@ const tagApplication = async (options) => {
|
|
|
861
902
|
*
|
|
862
903
|
* @see tagApplication for implementation details
|
|
863
904
|
*/
|
|
864
|
-
const command$
|
|
865
|
-
.description(
|
|
866
|
-
|
|
905
|
+
const command$k = withAuthOptions(createCommand('tag')
|
|
906
|
+
.description('Tag your Fusion application with a specific version or preview.')
|
|
907
|
+
.addHelpText('after', [
|
|
867
908
|
'',
|
|
868
|
-
'
|
|
869
|
-
'
|
|
909
|
+
'Tags a Fusion application with a specific version or preview in the Fusion app registry.',
|
|
910
|
+
'Applies a tag to the specified application version for release management.',
|
|
911
|
+
'App key and version can be provided or resolved from the manifest file.',
|
|
870
912
|
'Supports environment selection, debug, and silent modes.',
|
|
871
913
|
'',
|
|
914
|
+
'Arguments:',
|
|
915
|
+
' <tag> Tag to apply (latest | preview | stable)',
|
|
916
|
+
'',
|
|
917
|
+
'Options:',
|
|
918
|
+
' --appKey <string> Application key (if not provided, resolved from manifest)',
|
|
919
|
+
' -v, --version <string> Version to tag (if not provided, resolved from manifest)',
|
|
920
|
+
' -m, --manifest <string> Manifest file to use for resolving app key and version',
|
|
921
|
+
' --debug Enable debug mode for verbose logging',
|
|
922
|
+
' --silent Silent mode, suppresses output except errors',
|
|
923
|
+
' -e, --env <env> Target environment',
|
|
924
|
+
'',
|
|
872
925
|
'Examples:',
|
|
873
926
|
' $ fusion tag latest',
|
|
874
927
|
' $ fusion tag preview --env prod --manifest app.manifest.prod.ts',
|
|
@@ -950,12 +1003,18 @@ const command$j = withAuthOptions(createCommand('tag')
|
|
|
950
1003
|
*
|
|
951
1004
|
* @see startAppDevServer for implementation details
|
|
952
1005
|
*/
|
|
953
|
-
const command$
|
|
954
|
-
.description(
|
|
955
|
-
|
|
1006
|
+
const command$j = createCommand('dev')
|
|
1007
|
+
.description('Start the application in development mode.')
|
|
1008
|
+
.addHelpText('after', [
|
|
956
1009
|
'',
|
|
957
|
-
'
|
|
958
|
-
'
|
|
1010
|
+
'Starts the application in development mode with a local dev server.',
|
|
1011
|
+
'',
|
|
1012
|
+
'Options:',
|
|
1013
|
+
' --debug Enable debug mode',
|
|
1014
|
+
' --manifest <path> Path to the app manifest file (app.manifest[.env]?.[ts,js,json])',
|
|
1015
|
+
' --config <path> Path to the app config file (app.config[.env]?.[ts,js,json])',
|
|
1016
|
+
' --env <environment> Runtime environment for the dev server (default: local)',
|
|
1017
|
+
' --port <port> Port for the development server (default: 3000)',
|
|
959
1018
|
'',
|
|
960
1019
|
'Examples:',
|
|
961
1020
|
' $ fusion app dev',
|
|
@@ -1008,14 +1067,23 @@ const command$i = createCommand('dev')
|
|
|
1008
1067
|
*
|
|
1009
1068
|
* @see loadAppManifest for implementation details
|
|
1010
1069
|
*/
|
|
1011
|
-
const command$
|
|
1012
|
-
.description(
|
|
1013
|
-
|
|
1070
|
+
const command$i = createCommand('manifest')
|
|
1071
|
+
.description('Build and output the application manifest for Fusion apps.')
|
|
1072
|
+
.addHelpText('after', [
|
|
1014
1073
|
'',
|
|
1015
|
-
'
|
|
1074
|
+
'Builds and outputs the application manifest for Fusion apps.',
|
|
1075
|
+
'By default, prints the manifest to stdout. Use --output to write to a file.',
|
|
1016
1076
|
'You can specify a custom manifest build file or use the default (app.manifest[.env]?.[ts,js,json]).',
|
|
1017
1077
|
'Supports debug and silent modes for flexible output.',
|
|
1018
1078
|
'',
|
|
1079
|
+
'Arguments:',
|
|
1080
|
+
' [manifest] Manifest build file to use (e.g., app.manifest[.env]?.[ts,js,json])',
|
|
1081
|
+
'',
|
|
1082
|
+
'Options:',
|
|
1083
|
+
' -d, --debug Enable debug mode for verbose logging',
|
|
1084
|
+
' -o, --output Write manifest to the specified file (default: stdout)',
|
|
1085
|
+
' -s, --silent Silent mode, suppresses output except errors',
|
|
1086
|
+
'',
|
|
1019
1087
|
'Examples:',
|
|
1020
1088
|
' $ fusion manifest',
|
|
1021
1089
|
' $ fusion manifest app.manifest.prod.ts --output ./dist/app.manifest.json',
|
|
@@ -1073,12 +1141,23 @@ const command$h = createCommand('manifest')
|
|
|
1073
1141
|
*
|
|
1074
1142
|
* @see uploadApplication, tagApplication for implementation details
|
|
1075
1143
|
*/
|
|
1076
|
-
const command$
|
|
1077
|
-
.description(
|
|
1078
|
-
'
|
|
1144
|
+
const command$h = withAuthOptions(createCommand('publish')
|
|
1145
|
+
.description('Build, upload, and tag your Fusion application for deployment.')
|
|
1146
|
+
.addHelpText('after', [
|
|
1147
|
+
'',
|
|
1148
|
+
'Builds, uploads, and tags a Fusion application for deployment to the Fusion portal.',
|
|
1149
|
+
'Bundles the app, uploads it to the Fusion app store, and applies a tag for versioning.',
|
|
1150
|
+
'Supports specifying environment, manifest file, and tag.',
|
|
1151
|
+
'Debug mode and authentication options are supported.',
|
|
1079
1152
|
'',
|
|
1080
|
-
'
|
|
1081
|
-
'
|
|
1153
|
+
'Arguments:',
|
|
1154
|
+
' [bundle] Path to the app bundle to upload',
|
|
1155
|
+
'',
|
|
1156
|
+
'Options:',
|
|
1157
|
+
' -d, --debug Enable debug mode for verbose logging (default: false)',
|
|
1158
|
+
' -e, --env <env> Target environment',
|
|
1159
|
+
' -m, --manifest Manifest file to use for bundling (e.g., app.manifest.ts)',
|
|
1160
|
+
' -t, --tag Tag to apply to the published app (latest | preview)',
|
|
1082
1161
|
'',
|
|
1083
1162
|
'Examples:',
|
|
1084
1163
|
' $ fusion publish',
|
|
@@ -1159,30 +1238,30 @@ const command$g = withAuthOptions(createCommand('publish')
|
|
|
1159
1238
|
* Each alias maps an old "build-*" command to its new equivalent, providing warnings and guidance for users.
|
|
1160
1239
|
* These aliases help maintain backward compatibility and inform users about updated command usage.
|
|
1161
1240
|
*/
|
|
1162
|
-
command$
|
|
1241
|
+
command$o.alias('build-pack').hook('preAction', (thisCommand) => {
|
|
1163
1242
|
if (process.argv[3] === 'build-pack') {
|
|
1164
1243
|
console.warn(chalk.bgRedBright.bold('The command "build-pack" is deprecated. Please use "pack" instead.'));
|
|
1165
1244
|
if (!thisCommand.getOptionValue('archive')) {
|
|
1166
|
-
thisCommand.setOptionValue('archive',
|
|
1245
|
+
thisCommand.setOptionValue('archive', DEFAULT_ARCHIVE);
|
|
1167
1246
|
}
|
|
1168
1247
|
}
|
|
1169
1248
|
});
|
|
1170
|
-
command$
|
|
1249
|
+
command$m.alias('build-upload').hook('preAction', (thisCommand) => {
|
|
1171
1250
|
if (process.argv[3] === 'build-upload') {
|
|
1172
1251
|
console.warn(chalk.bgRedBright.bold('The command "build-upload" is deprecated. Please use "upload" instead.'));
|
|
1173
1252
|
if (thisCommand.getOptionValue('service')) {
|
|
1174
1253
|
throw new Error('The --service option is deprecated. Please use --env instead.');
|
|
1175
1254
|
}
|
|
1176
|
-
const bundle = thisCommand.getOptionValue('bundle') ??
|
|
1255
|
+
const bundle = thisCommand.getOptionValue('bundle') ?? DEFAULT_ARCHIVE;
|
|
1177
1256
|
process.argv[4] = bundle;
|
|
1178
1257
|
}
|
|
1179
1258
|
});
|
|
1180
|
-
command$
|
|
1259
|
+
command$i.alias('build-manifest').hook('preAction', () => {
|
|
1181
1260
|
if (process.argv[3] === 'build-manifest') {
|
|
1182
1261
|
console.warn(chalk.bgRedBright.bold('The command "build-manifest" is deprecated. Please use "manifest" instead.'));
|
|
1183
1262
|
}
|
|
1184
1263
|
});
|
|
1185
|
-
command$
|
|
1264
|
+
command$h.alias('build-publish').hook('preAction', (thisCommand) => {
|
|
1186
1265
|
if (process.argv[3] === 'build-publish') {
|
|
1187
1266
|
console.warn(chalk.bgRedBright.bold('The command "build-publish" is deprecated. Please use "publish" instead.'));
|
|
1188
1267
|
}
|
|
@@ -1191,8 +1270,26 @@ command$g.alias('build-publish').hook('preAction', (thisCommand) => {
|
|
|
1191
1270
|
}
|
|
1192
1271
|
});
|
|
1193
1272
|
|
|
1194
|
-
const command$
|
|
1195
|
-
.description('Develop and deploy Fusion applications')
|
|
1273
|
+
const command$g = createCommand('app')
|
|
1274
|
+
.description('Develop, build, configure, and deploy Fusion applications from your workspace root.')
|
|
1275
|
+
.addHelpText('after', [
|
|
1276
|
+
'',
|
|
1277
|
+
'The "app" command is your main entry point for managing Fusion applications in this workspace.',
|
|
1278
|
+
'',
|
|
1279
|
+
'It provides access to subcommands for every stage of the application lifecycle, including development, building, packaging, configuration, deployment, and release management.',
|
|
1280
|
+
'',
|
|
1281
|
+
'All available subcommands are listed below automatically. For details and options for a specific subcommand, run:',
|
|
1282
|
+
' fusion app <subcommand> --help',
|
|
1283
|
+
'',
|
|
1284
|
+
'Typical usage:',
|
|
1285
|
+
' - Run and test your app locally with the dev subcommand',
|
|
1286
|
+
' - Build, bundle, and configure your app for deployment',
|
|
1287
|
+
' - Upload, publish, and tag releases to the Fusion App Store',
|
|
1288
|
+
' - Check registration and generate manifests as needed',
|
|
1289
|
+
'',
|
|
1290
|
+
'This command should be run from your app root directory.',
|
|
1291
|
+
].join('\n'))
|
|
1292
|
+
.addCommand(command$p)
|
|
1196
1293
|
.addCommand(command$o)
|
|
1197
1294
|
.addCommand(command$n)
|
|
1198
1295
|
.addCommand(command$m)
|
|
@@ -1200,30 +1297,33 @@ const command$f = createCommand('app')
|
|
|
1200
1297
|
.addCommand(command$k)
|
|
1201
1298
|
.addCommand(command$j)
|
|
1202
1299
|
.addCommand(command$i)
|
|
1203
|
-
.addCommand(command$h)
|
|
1204
|
-
.addCommand(command$g);
|
|
1300
|
+
.addCommand(command$h);
|
|
1205
1301
|
|
|
1206
1302
|
/**
|
|
1207
1303
|
* Command to authenticate and log in to Fusion Framework using interactive browser-based authentication.
|
|
1208
1304
|
*
|
|
1209
1305
|
* This command initializes the Fusion Framework and opens a browser window for secure login.
|
|
1210
1306
|
* Supports custom tenant, client, and scope options for advanced authentication scenarios.
|
|
1211
|
-
*
|
|
1212
|
-
* @example
|
|
1213
|
-
* $ fusion login
|
|
1214
|
-
* $ fusion login --tenant my-tenant --client my-client-id --scope api://my-app/.default
|
|
1215
1307
|
*/
|
|
1216
1308
|
const DEFAULT_SERVER_PORT = 49741;
|
|
1217
|
-
const command$
|
|
1218
|
-
.description(
|
|
1309
|
+
const command$f = createCommand('login')
|
|
1310
|
+
.description('Authenticate and log in to Fusion Framework using interactive browser-based authentication.')
|
|
1311
|
+
.addHelpText('after', [
|
|
1312
|
+
'',
|
|
1219
1313
|
'Authenticate and log in to Fusion Framework using interactive browser-based authentication.',
|
|
1220
1314
|
'',
|
|
1221
1315
|
'This command initializes the Fusion Framework and opens a browser window for secure login.',
|
|
1222
1316
|
'Supports custom tenant, client, and scope options for advanced authentication scenarios.',
|
|
1223
1317
|
'',
|
|
1318
|
+
'Options:',
|
|
1319
|
+
' --tenant <tenantId> Specify the tenant ID',
|
|
1320
|
+
' --client <clientId> Specify the client ID',
|
|
1321
|
+
' --scope <scope> Specify the scope(s) for authentication',
|
|
1322
|
+
' --debug Enable debug mode for verbose logging',
|
|
1323
|
+
'',
|
|
1224
1324
|
'Examples:',
|
|
1225
|
-
' $ fusion login',
|
|
1226
|
-
' $ fusion login --tenant my-tenant --client my-client-id --scope api://my-app/.default',
|
|
1325
|
+
' $ fusion-framework-cli login',
|
|
1326
|
+
' $ fusion-framework-cli login --tenant my-tenant --client my-client-id --scope api://my-app/.default',
|
|
1227
1327
|
].join('\n'))
|
|
1228
1328
|
.action(async (options) => {
|
|
1229
1329
|
const log = new ConsoleLogger('auth:login', { debug: options.debug });
|
|
@@ -1260,7 +1360,7 @@ const command$e = createCommand('login')
|
|
|
1260
1360
|
* Adds authentication options to the login command.
|
|
1261
1361
|
* @see withAuthOptions
|
|
1262
1362
|
*/
|
|
1263
|
-
withAuthOptions(command$
|
|
1363
|
+
withAuthOptions(command$f, {
|
|
1264
1364
|
includeScope: true,
|
|
1265
1365
|
excludeToken: true,
|
|
1266
1366
|
});
|
|
@@ -1270,21 +1370,24 @@ withAuthOptions(command$e, {
|
|
|
1270
1370
|
*
|
|
1271
1371
|
* This command removes your current authentication state from the Fusion Framework CLI.
|
|
1272
1372
|
* Supports custom tenant and client options for advanced scenarios.
|
|
1273
|
-
*
|
|
1274
|
-
* @example
|
|
1275
|
-
* $ fusion logout
|
|
1276
|
-
* $ fusion logout --tenant my-tenant --client my-client-id
|
|
1277
1373
|
*/
|
|
1278
|
-
const command$
|
|
1279
|
-
.description(
|
|
1374
|
+
const command$e = createCommand('logout')
|
|
1375
|
+
.description('Log out from Fusion Framework and clear your authentication session.')
|
|
1376
|
+
.addHelpText('after', [
|
|
1377
|
+
'',
|
|
1280
1378
|
'Log out from Fusion Framework and clear your authentication session.',
|
|
1281
1379
|
'',
|
|
1282
1380
|
'This command removes your current authentication state from the Fusion Framework CLI.',
|
|
1283
1381
|
'Supports custom tenant and client options for advanced scenarios.',
|
|
1284
1382
|
'',
|
|
1383
|
+
'Options:',
|
|
1384
|
+
' --tenant <tenantId> Specify the tenant ID',
|
|
1385
|
+
' --client <clientId> Specify the client ID',
|
|
1386
|
+
' --debug Enable debug mode for verbose logging',
|
|
1387
|
+
'',
|
|
1285
1388
|
'Examples:',
|
|
1286
|
-
' $ fusion logout',
|
|
1287
|
-
' $ fusion logout --tenant my-tenant --client my-client-id',
|
|
1389
|
+
' $ fusion-framework-cli logout',
|
|
1390
|
+
' $ fusion-framework-cli logout --tenant my-tenant --client my-client-id',
|
|
1288
1391
|
].join('\n'))
|
|
1289
1392
|
.action(async (options) => {
|
|
1290
1393
|
const log = new ConsoleLogger('auth:logout', { debug: options.debug });
|
|
@@ -1310,7 +1413,7 @@ const command$d = createCommand('logout')
|
|
|
1310
1413
|
* Adds authentication options to the logout command.
|
|
1311
1414
|
* @see withAuthOptions
|
|
1312
1415
|
*/
|
|
1313
|
-
withAuthOptions(command$
|
|
1416
|
+
withAuthOptions(command$e, {
|
|
1314
1417
|
excludeToken: true,
|
|
1315
1418
|
includeScope: false,
|
|
1316
1419
|
});
|
|
@@ -1320,23 +1423,27 @@ withAuthOptions(command$d, {
|
|
|
1320
1423
|
*
|
|
1321
1424
|
* This command retrieves an access token for the specified scopes, tenant, and client.
|
|
1322
1425
|
* Supports debug and silent modes for flexible output.
|
|
1323
|
-
*
|
|
1324
|
-
* @example
|
|
1325
|
-
* $ fusion token
|
|
1326
|
-
* $ fusion token --scope api://my-app/.default
|
|
1327
|
-
* $ fusion token --tenant my-tenant --client my-client-id --silent
|
|
1328
1426
|
*/
|
|
1329
|
-
const command$
|
|
1330
|
-
.description(
|
|
1427
|
+
const command$d = createCommand('token')
|
|
1428
|
+
.description('Acquire and print an access token for Fusion APIs using your current authentication context.')
|
|
1429
|
+
.addHelpText('after', [
|
|
1430
|
+
'',
|
|
1331
1431
|
'Acquire and print an access token for Fusion APIs using your current authentication context.',
|
|
1332
1432
|
'',
|
|
1333
1433
|
'This command retrieves an access token for the specified scopes, tenant, and client.',
|
|
1334
1434
|
'Supports debug and silent modes for flexible output.',
|
|
1335
1435
|
'',
|
|
1436
|
+
'Options:',
|
|
1437
|
+
' --tenant <tenantId> Specify the tenant ID',
|
|
1438
|
+
' --client <clientId> Specify the client ID',
|
|
1439
|
+
' --scope <scope> Specify the scope(s) for authentication',
|
|
1440
|
+
' --debug Enable debug mode for verbose logging',
|
|
1441
|
+
' --silent Only output the token (no extra logging)',
|
|
1442
|
+
'',
|
|
1336
1443
|
'Examples:',
|
|
1337
|
-
' $ fusion token',
|
|
1338
|
-
' $ fusion token --scope api://my-app/.default',
|
|
1339
|
-
' $ fusion token --tenant my-tenant --client my-client-id --silent',
|
|
1444
|
+
' $ fusion-framework-cli token',
|
|
1445
|
+
' $ fusion-framework-cli token --scope api://my-app/.default',
|
|
1446
|
+
' $ fusion-framework-cli token --tenant my-tenant --client my-client-id --silent',
|
|
1340
1447
|
].join('\n'))
|
|
1341
1448
|
.option('-d, --debug', 'Enable debug mode for verbose logging', false)
|
|
1342
1449
|
.option('--silent', 'Only output the token (no extra logging)')
|
|
@@ -1379,14 +1486,26 @@ const command$c = createCommand('token')
|
|
|
1379
1486
|
* Adds authentication options to the token command.
|
|
1380
1487
|
* @see withAuthOptions
|
|
1381
1488
|
*/
|
|
1382
|
-
withAuthOptions(command$
|
|
1489
|
+
withAuthOptions(command$d, {
|
|
1383
1490
|
includeScope: true,
|
|
1384
1491
|
});
|
|
1385
1492
|
|
|
1386
|
-
const command$
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1493
|
+
const command$c = new Command('auth')
|
|
1494
|
+
.description('Authenticate with Fusion Framework CLI')
|
|
1495
|
+
.addHelpText('after', [
|
|
1496
|
+
'',
|
|
1497
|
+
'Authentication commands for Fusion Framework CLI.',
|
|
1498
|
+
'',
|
|
1499
|
+
'Use these commands to log in, log out, or acquire tokens for Fusion APIs.',
|
|
1500
|
+
'',
|
|
1501
|
+
'Examples:',
|
|
1502
|
+
' $ fusion-framework-cli auth login',
|
|
1503
|
+
' $ fusion-framework-cli auth logout',
|
|
1504
|
+
' $ fusion-framework-cli auth token --scope api://my-app/.default',
|
|
1505
|
+
].join('\n'));
|
|
1506
|
+
command$c.addCommand(command$f, { isDefault: true });
|
|
1507
|
+
command$c.addCommand(command$e);
|
|
1508
|
+
command$c.addCommand(command$d);
|
|
1390
1509
|
|
|
1391
1510
|
/**
|
|
1392
1511
|
* The `resolve` command resolves and displays information about a service registered in Fusion service discovery.
|
|
@@ -1395,13 +1514,6 @@ command$b.addCommand(command$c);
|
|
|
1395
1514
|
*
|
|
1396
1515
|
* Supports environment selection and authentication options.
|
|
1397
1516
|
*
|
|
1398
|
-
* ## Examples
|
|
1399
|
-
*
|
|
1400
|
-
* ```sh
|
|
1401
|
-
* $ fusion resolve my-service
|
|
1402
|
-
* $ fusion resolve my-service --env prod
|
|
1403
|
-
* ```
|
|
1404
|
-
*
|
|
1405
1517
|
* @command resolve
|
|
1406
1518
|
* @description Resolve and display information about a service registered in Fusion service discovery.
|
|
1407
1519
|
* @argument {string} service - Name of the service to resolve in Fusion service discovery.
|
|
@@ -1411,16 +1523,20 @@ command$b.addCommand(command$c);
|
|
|
1411
1523
|
* @option {string} --clientId - Client ID for authentication.
|
|
1412
1524
|
* @returns {Promise<void>} Prints the resolved service details to the console.
|
|
1413
1525
|
*/
|
|
1414
|
-
const command$
|
|
1415
|
-
.description(
|
|
1526
|
+
const command$b = withAuthOptions(createCommand('resolve')
|
|
1527
|
+
.description('Resolve and display information about a service registered in Fusion service discovery.')
|
|
1528
|
+
.addHelpText('after', [
|
|
1529
|
+
'',
|
|
1416
1530
|
'Resolve and display information about a service registered in Fusion service discovery.',
|
|
1417
1531
|
'',
|
|
1418
1532
|
'This command looks up a service by name and prints its discovery details using the current authentication and environment.',
|
|
1419
|
-
'Supports environment selection and authentication options.',
|
|
1420
1533
|
'',
|
|
1421
1534
|
'Examples:',
|
|
1422
|
-
' $ fusion resolve my-service',
|
|
1423
|
-
' $ fusion resolve my-service --env prod',
|
|
1535
|
+
' $ fusion-framework-cli resolve my-service',
|
|
1536
|
+
' $ fusion-framework-cli resolve my-service --env prod',
|
|
1537
|
+
' $ fusion-framework-cli resolve my-service --env test --tenantId my-tenant --clientId my-client-id',
|
|
1538
|
+
'',
|
|
1539
|
+
'The command will print the resolved service details to the console.',
|
|
1424
1540
|
].join('\n'))
|
|
1425
1541
|
.addOption(createEnvOption({ allowDev: false }))
|
|
1426
1542
|
.argument('<service>', 'Name of the service to resolve in Fusion service discovery')
|
|
@@ -1443,8 +1559,8 @@ const command$a = withAuthOptions(createCommand('resolve')
|
|
|
1443
1559
|
console.debug(appClient);
|
|
1444
1560
|
}));
|
|
1445
1561
|
|
|
1446
|
-
const command$
|
|
1447
|
-
command$
|
|
1562
|
+
const command$a = createCommand('disco').description('Service discovery operations');
|
|
1563
|
+
command$a.addCommand(command$b);
|
|
1448
1564
|
|
|
1449
1565
|
/**
|
|
1450
1566
|
* Starts the portal development server for local development and testing.
|
|
@@ -1459,7 +1575,7 @@ command$9.addCommand(command$a);
|
|
|
1459
1575
|
*/
|
|
1460
1576
|
const startPortalDevServer = async (options) => {
|
|
1461
1577
|
const { log } = options ?? {};
|
|
1462
|
-
// Resolve the
|
|
1578
|
+
// Resolve the portals's package.json for root and metadata
|
|
1463
1579
|
const pkg = await resolveProjectPackage(log);
|
|
1464
1580
|
// Setup the runtime environment for the dev server
|
|
1465
1581
|
const env = {
|
|
@@ -1474,8 +1590,6 @@ const startPortalDevServer = async (options) => {
|
|
|
1474
1590
|
log,
|
|
1475
1591
|
manifestPath: options?.manifest,
|
|
1476
1592
|
});
|
|
1477
|
-
// Dummy implementation for resolving the portal config
|
|
1478
|
-
const resolvePortalConfig = async (...args) => ({ foo: 'bar' });
|
|
1479
1593
|
// Resolve the portal config (replace with real logic as needed)
|
|
1480
1594
|
const portalConfig = await resolvePortalConfig(env, { log, config: options?.config });
|
|
1481
1595
|
log?.start('Starting app development server...');
|
|
@@ -1505,16 +1619,19 @@ const startPortalDevServer = async (options) => {
|
|
|
1505
1619
|
return devServer;
|
|
1506
1620
|
};
|
|
1507
1621
|
|
|
1508
|
-
const command$
|
|
1509
|
-
.description(
|
|
1510
|
-
|
|
1622
|
+
const command$9 = createCommand('dev')
|
|
1623
|
+
.description('Start a local development server for the Fusion portal.')
|
|
1624
|
+
.addHelpText('after', [
|
|
1511
1625
|
'',
|
|
1512
|
-
'
|
|
1513
|
-
'
|
|
1626
|
+
'Starts a local development server for your Fusion portal.',
|
|
1627
|
+
'',
|
|
1628
|
+
'Options:',
|
|
1629
|
+
' -p, --port Port to run the development server on (default: 3000)',
|
|
1630
|
+
' -d, --debug Enable debug mode for verbose logging',
|
|
1514
1631
|
'',
|
|
1515
1632
|
'Examples:',
|
|
1516
|
-
' $ fusion portal dev',
|
|
1517
|
-
' $ fusion portal dev --port 4000 --debug',
|
|
1633
|
+
' $ fusion-framework-cli portal dev',
|
|
1634
|
+
' $ fusion-framework-cli portal dev --port 4000 --debug',
|
|
1518
1635
|
].join('\n'))
|
|
1519
1636
|
.option('-p, --port <number>', 'Port to run the development server on', '3000')
|
|
1520
1637
|
.option('-d, --debug', 'Enable debug mode for verbose logging')
|
|
@@ -1525,18 +1642,21 @@ const command$8 = createCommand('dev')
|
|
|
1525
1642
|
log.succeed('Development server started successfully.');
|
|
1526
1643
|
});
|
|
1527
1644
|
|
|
1528
|
-
const command$
|
|
1529
|
-
.description(
|
|
1530
|
-
|
|
1645
|
+
const command$8 = createCommand('manifest')
|
|
1646
|
+
.description('Generate or validate a Fusion portal manifest file.')
|
|
1647
|
+
.addHelpText('after', [
|
|
1648
|
+
'Generates or validates a Fusion portal manifest file.',
|
|
1531
1649
|
'',
|
|
1532
|
-
'
|
|
1533
|
-
'
|
|
1534
|
-
'
|
|
1650
|
+
'If no manifest is provided, a default portal.manifest.[ts|js|json] is used from the current directory.',
|
|
1651
|
+
'',
|
|
1652
|
+
'Options:',
|
|
1653
|
+
' -o, --output Write manifest to the specified file (default: stdout)',
|
|
1654
|
+
' -d, --debug Enable debug mode for verbose logging',
|
|
1655
|
+
' -s, --silent Silent mode, suppresses output except errors',
|
|
1535
1656
|
'',
|
|
1536
1657
|
'Examples:',
|
|
1537
|
-
' $ fusion portal manifest',
|
|
1538
|
-
' $ fusion portal manifest
|
|
1539
|
-
' $ fusion portal manifest --debug',
|
|
1658
|
+
' $ fusion-framework-cli portal manifest',
|
|
1659
|
+
' $ fusion-framework-cli portal manifest portal.manifest.prod.ts --output ./dist/portal.manifest.json',
|
|
1540
1660
|
].join('\n'))
|
|
1541
1661
|
.option('-d, --debug', 'Enable debug mode for verbose logging', false)
|
|
1542
1662
|
.option('-o, --output <string>', 'Write manifest to the specified file', 'stdout')
|
|
@@ -9342,18 +9462,20 @@ function require_2020 () {
|
|
|
9342
9462
|
var _2020Exports = require_2020();
|
|
9343
9463
|
var Ajv2020 = /*@__PURE__*/getDefaultExportFromCjs(_2020Exports);
|
|
9344
9464
|
|
|
9345
|
-
const command$
|
|
9346
|
-
.description(
|
|
9347
|
-
|
|
9465
|
+
const command$7 = createCommand('schema')
|
|
9466
|
+
.description('Generate or validate a Fusion portal schema file.')
|
|
9467
|
+
.addHelpText('after', [
|
|
9468
|
+
'Generates or validates a Fusion portal schema file.',
|
|
9348
9469
|
'',
|
|
9349
|
-
'
|
|
9350
|
-
'
|
|
9470
|
+
'Options:',
|
|
9471
|
+
' -o, --output Output file name (default: stdout)',
|
|
9472
|
+
' -v, --validate Validate the generated schema against a JSON file',
|
|
9473
|
+
' -d, --debug Enable debug mode for verbose logging',
|
|
9351
9474
|
'',
|
|
9352
9475
|
'Examples:',
|
|
9353
|
-
' $ fusion portal schema',
|
|
9354
|
-
' $ fusion portal schema --output portal.schema.json',
|
|
9355
|
-
' $ fusion portal schema --validate my-config.json',
|
|
9356
|
-
' $ fusion portal schema portal.schema.prod.ts --debug',
|
|
9476
|
+
' $ fusion-framework-cli portal schema',
|
|
9477
|
+
' $ fusion-framework-cli portal schema --output portal.schema.json',
|
|
9478
|
+
' $ fusion-framework-cli portal schema --validate my-config.json',
|
|
9357
9479
|
].join('\n'))
|
|
9358
9480
|
.addOption(createEnvOption({ allowDev: true }))
|
|
9359
9481
|
.option('-o, --output <string>', 'Output file name (default: stdout)', 'stdout')
|
|
@@ -9402,40 +9524,50 @@ const command$6 = createCommand('schema')
|
|
|
9402
9524
|
}
|
|
9403
9525
|
});
|
|
9404
9526
|
|
|
9405
|
-
const command$
|
|
9406
|
-
.description(
|
|
9407
|
-
|
|
9527
|
+
const command$6 = createCommand('build')
|
|
9528
|
+
.description('Build the Fusion portal from a manifest file with environment-specific settings.')
|
|
9529
|
+
.addHelpText('after', [
|
|
9530
|
+
'Builds the Fusion portal using a manifest file and environment-specific configuration.',
|
|
9408
9531
|
'',
|
|
9409
|
-
'If no manifest is provided, the command will search for a default
|
|
9410
|
-
'You can use environment variables to customize the build process.',
|
|
9532
|
+
'If no manifest is provided, the command will search for a default portal.manifest.[ts|js|json] in the current directory.',
|
|
9533
|
+
'You can use environment variables to customize the build process (e.g., NODE_ENV, FUSION_PORTAL_*).',
|
|
9534
|
+
'',
|
|
9535
|
+
'Options:',
|
|
9536
|
+
' -d, --debug Enable debug mode for verbose logging',
|
|
9411
9537
|
'',
|
|
9412
9538
|
'Examples:',
|
|
9413
|
-
' $ fusion portal build',
|
|
9414
|
-
' $ fusion portal build
|
|
9539
|
+
' $ fusion-framework-cli portal build',
|
|
9540
|
+
' $ fusion-framework-cli portal build portal.manifest.prod.ts --debug',
|
|
9541
|
+
'',
|
|
9415
9542
|
].join('\n'))
|
|
9416
9543
|
.option('-d, --debug', 'Enable debug mode for verbose logging', false)
|
|
9417
|
-
.argument('[manifest]', 'Manifest build file to use for building (e.g.,
|
|
9544
|
+
.argument('[manifest]', 'Manifest build file to use for building (e.g., portal.manifest[.env]?.[ts,js,json])')
|
|
9418
9545
|
.action(async (manifest, opt) => {
|
|
9419
9546
|
const log = new ConsoleLogger('portal:build', { debug: opt.debug });
|
|
9420
9547
|
await buildPortal({ log, manifest });
|
|
9421
9548
|
});
|
|
9422
9549
|
|
|
9423
|
-
const command$
|
|
9424
|
-
.description(
|
|
9425
|
-
|
|
9550
|
+
const command$5 = createCommand('pack')
|
|
9551
|
+
.description('Bundle the Fusion portal into a deployable archive.')
|
|
9552
|
+
.addHelpText('after', [
|
|
9553
|
+
'Bundles the Fusion portal using the provided manifest and schema into a zip archive for deployment.',
|
|
9426
9554
|
'',
|
|
9427
|
-
'
|
|
9428
|
-
'
|
|
9555
|
+
'If no manifest is provided, a default portal.manifest.[ts|js|json] is used from the current directory.',
|
|
9556
|
+
'',
|
|
9557
|
+
'Options:',
|
|
9558
|
+
' -a, --archive Name of the output archive file (default: out/bundle.zip)',
|
|
9559
|
+
' --schema Schema file to use for validation',
|
|
9560
|
+
' -d, --debug Enable debug mode for verbose logging',
|
|
9429
9561
|
'',
|
|
9430
9562
|
'Examples:',
|
|
9431
|
-
' $ fusion portal pack',
|
|
9432
|
-
' $ fusion portal pack --archive my-portal.zip --schema portal.schema.json',
|
|
9433
|
-
' $ fusion portal pack
|
|
9563
|
+
' $ fusion-framework-cli portal pack',
|
|
9564
|
+
' $ fusion-framework-cli portal pack --archive my-portal.zip --schema portal.schema.json',
|
|
9565
|
+
' $ fusion-framework-cli portal pack portal.manifest.prod.ts --debug',
|
|
9434
9566
|
].join('\n'))
|
|
9435
9567
|
.option('-a, --archive [string]', 'Name of the output archive file (default: out/bundle.zip)', 'out/bundle.zip')
|
|
9436
9568
|
.option('-d, --debug [boolean]', 'Enable debug mode for verbose logging', false)
|
|
9437
9569
|
.option('--schema [string]', 'Schema file to use for validation')
|
|
9438
|
-
.argument('[manifest]', 'Manifest file to use for bundling (e.g.,
|
|
9570
|
+
.argument('[manifest]', 'Manifest file to use for bundling (e.g., portal.manifest[.env]?.[ts,js,json])')
|
|
9439
9571
|
.action(async (manifest, options) => {
|
|
9440
9572
|
const log = new ConsoleLogger('portal:pack', {
|
|
9441
9573
|
debug: options.debug,
|
|
@@ -9545,17 +9677,18 @@ const uploadPortalBundle = async (opt) => {
|
|
|
9545
9677
|
}
|
|
9546
9678
|
};
|
|
9547
9679
|
|
|
9548
|
-
const command$
|
|
9549
|
-
.description(
|
|
9550
|
-
|
|
9680
|
+
const command$4 = withAuthOptions(createCommand('upload')
|
|
9681
|
+
.description('Upload a Fusion portal bundle to the portal registry.')
|
|
9682
|
+
.addHelpText('after', [
|
|
9683
|
+
'Uploads a distributable Fusion portal bundle to the portal registry for deployment.',
|
|
9551
9684
|
'',
|
|
9552
|
-
'
|
|
9553
|
-
'
|
|
9685
|
+
'Options:',
|
|
9686
|
+
' --env Target environment',
|
|
9687
|
+
' -d, --debug Enable debug mode for verbose logging',
|
|
9554
9688
|
'',
|
|
9555
9689
|
'Examples:',
|
|
9556
|
-
' $ fusion portal upload my-portal-bundle.zip',
|
|
9557
|
-
' $ fusion portal upload my-portal-bundle.zip --env prod',
|
|
9558
|
-
' $ fusion portal upload my-portal-bundle.zip --debug',
|
|
9690
|
+
' $ fusion-framework-cli portal upload my-portal-bundle.zip',
|
|
9691
|
+
' $ fusion-framework-cli portal upload my-portal-bundle.zip --env prod',
|
|
9559
9692
|
].join('\n'))
|
|
9560
9693
|
.option('-d, --debug [boolean]', 'Enable debug mode for verbose logging', false)
|
|
9561
9694
|
.addOption(createEnvOption({ allowDev: false }))
|
|
@@ -9670,18 +9803,22 @@ const tagPortal = async (options) => {
|
|
|
9670
9803
|
}
|
|
9671
9804
|
};
|
|
9672
9805
|
|
|
9673
|
-
const command$
|
|
9674
|
-
.description(
|
|
9675
|
-
|
|
9806
|
+
const command$3 = withAuthOptions(createCommand('tag')
|
|
9807
|
+
.description('Tag your Fusion portal with a specific version or label.')
|
|
9808
|
+
.addHelpText('after', [
|
|
9809
|
+
'Tags your Fusion portal with a specific version or label in the portal registry.',
|
|
9676
9810
|
'',
|
|
9677
|
-
'
|
|
9678
|
-
'
|
|
9679
|
-
'
|
|
9811
|
+
'Options:',
|
|
9812
|
+
' -n, --name Portal name (if not provided, resolved from manifest)',
|
|
9813
|
+
' -m, --manifest Manifest file to use for resolving portal name and version',
|
|
9814
|
+
' -v, --version Version to tag (if not provided, resolved from manifest)',
|
|
9815
|
+
' --env Target environment',
|
|
9816
|
+
' -d, --debug Enable debug mode for verbose logging',
|
|
9817
|
+
' --silent Silent mode, suppresses output except errors',
|
|
9680
9818
|
'',
|
|
9681
9819
|
'Examples:',
|
|
9682
|
-
' $ fusion portal tag latest',
|
|
9683
|
-
' $ fusion portal tag preview --env prod --manifest portal.manifest.prod.ts',
|
|
9684
|
-
' $ fusion portal tag stable --name my-portal --version 1.2.3',
|
|
9820
|
+
' $ fusion-framework-cli portal tag latest',
|
|
9821
|
+
' $ fusion-framework-cli portal tag preview --env prod --manifest portal.manifest.prod.ts',
|
|
9685
9822
|
].join('\n'))
|
|
9686
9823
|
.addOption(createEnvOption({ allowDev: false }))
|
|
9687
9824
|
.option('-n, --name <string>', 'Portal name (if not provided, resolved from manifest)')
|
|
@@ -9731,18 +9868,21 @@ const command$2 = withAuthOptions(createCommand('tag')
|
|
|
9731
9868
|
});
|
|
9732
9869
|
}));
|
|
9733
9870
|
|
|
9734
|
-
const command$
|
|
9735
|
-
.description(
|
|
9736
|
-
'
|
|
9871
|
+
const command$2 = withAuthOptions(createCommand('publish')
|
|
9872
|
+
.description('Build, upload, and tag your Fusion portal bundle for deployment.')
|
|
9873
|
+
.addHelpText('after', [
|
|
9874
|
+
'Builds, uploads, and tags your Fusion portal bundle for deployment to the portal registry.',
|
|
9737
9875
|
'',
|
|
9738
|
-
'
|
|
9739
|
-
'
|
|
9876
|
+
'Options:',
|
|
9877
|
+
' --env Target environment',
|
|
9878
|
+
' -m, --manifest Manifest file to use for bundling',
|
|
9879
|
+
' --schema Schema file to use for validation',
|
|
9880
|
+
' -t, --tag Tag to apply to the published portal',
|
|
9881
|
+
' -d, --debug Enable debug mode for verbose logging',
|
|
9740
9882
|
'',
|
|
9741
9883
|
'Examples:',
|
|
9742
|
-
' $ fusion portal publish',
|
|
9743
|
-
' $ fusion portal publish --env prod --manifest portal.manifest.prod.ts',
|
|
9744
|
-
' $ fusion portal publish --tag latest --debug',
|
|
9745
|
-
' $ fusion portal publish --schema portal.schema.json',
|
|
9884
|
+
' $ fusion-framework-cli portal publish',
|
|
9885
|
+
' $ fusion-framework-cli portal publish --env prod --manifest portal.manifest.prod.ts',
|
|
9746
9886
|
].join('\n'))
|
|
9747
9887
|
.option('-d, --debug', 'Enable debug mode for verbose logging', false)
|
|
9748
9888
|
.addOption(createEnvOption({ allowDev: false }))
|
|
@@ -9794,8 +9934,102 @@ const command$1 = withAuthOptions(createCommand('publish')
|
|
|
9794
9934
|
log.succeed('🏷️ Tagging completed');
|
|
9795
9935
|
}));
|
|
9796
9936
|
|
|
9937
|
+
/**
|
|
9938
|
+
* CLI command: `portal config`
|
|
9939
|
+
*
|
|
9940
|
+
* Generates and/or publishes the portal configuration for Fusion portals.
|
|
9941
|
+
*
|
|
9942
|
+
* Features:
|
|
9943
|
+
* - Outputs the generated config to stdout or a file.
|
|
9944
|
+
* - Use --publish to upload the config to the Fusion portal registry.
|
|
9945
|
+
* - Options [token, tenant, client, config, identifier, env, output] are only relevant when --publish is used.
|
|
9946
|
+
* - Option [--env] cannot be set to dev when --publish is used.
|
|
9947
|
+
*
|
|
9948
|
+
* Usage:
|
|
9949
|
+
* $ fusion-framework-cli portal config --identifier <portal@version> [options]
|
|
9950
|
+
*
|
|
9951
|
+
* Options:
|
|
9952
|
+
* --debug Enable debug mode for verbose logging
|
|
9953
|
+
* --silent Silent mode, suppresses output except errors
|
|
9954
|
+
* --publish Publish config to Fusion portal registry
|
|
9955
|
+
* --identifier <name@version> Identifier of the portal, example my-portal@1.2.3 (required with --publish)
|
|
9956
|
+
* -o, --output <stdout|path> Output to stdout or a file (default: stdout)
|
|
9957
|
+
* <config> Path to the portal config file (e.g., portal.config[.env]?.[ts,js,json])
|
|
9958
|
+
* --env <env> Target environment
|
|
9959
|
+
*
|
|
9960
|
+
* Examples:
|
|
9961
|
+
* $ fusion-framework-cli portal config --identifier my-portal@1.2.3 -o stdout portal.config.ts
|
|
9962
|
+
* $ fusion-framework-cli portal config --identifier my-portal@1.2.3 -o ./dist/portal.config.json portal.config.prod.ts
|
|
9963
|
+
* $ fusion-framework-cli portal config --publish --env prod --identifier my-portal@1.2.3 portal.config.ts
|
|
9964
|
+
*
|
|
9965
|
+
* @see generatePortalConfig, publishPortalConfig for implementation details
|
|
9966
|
+
*/
|
|
9967
|
+
const command$1 = withAuthOptions(createCommand('config')
|
|
9968
|
+
.description('Generate or publish the Fusion portal configuration file.')
|
|
9969
|
+
.addHelpText('after', [
|
|
9970
|
+
'Generates and/or publishes the Fusion portal configuration.',
|
|
9971
|
+
'',
|
|
9972
|
+
'By default, outputs the config to stdout or a file. Use --publish to upload to the portal registry.',
|
|
9973
|
+
'',
|
|
9974
|
+
'Options:',
|
|
9975
|
+
' --publish Publish config to Fusion portal registry',
|
|
9976
|
+
' --identifier Portal identifier (required with --publish)',
|
|
9977
|
+
' -o, --output Output to stdout or a file (default: stdout)',
|
|
9978
|
+
' --env Target environment',
|
|
9979
|
+
' --debug Enable debug mode for verbose logging',
|
|
9980
|
+
'',
|
|
9981
|
+
'Examples:',
|
|
9982
|
+
' $ fusion-framework-cli portal config --identifier my-portal@1.2.3 -o stdout portal.config.ts',
|
|
9983
|
+
' $ fusion-framework-cli portal config --publish --env prod --identifier my-portal@1.2.3 portal.config.ts',
|
|
9984
|
+
].join('\n'))
|
|
9985
|
+
.option('--debug', 'Enable debug mode for verbose logging')
|
|
9986
|
+
.option('--silent', 'Silent mode, suppresses output except errors')
|
|
9987
|
+
.option('--publish <name@version>', 'Publish config to Fusion portal registry, Identifier of the portal, example my-portal@1.2.3')
|
|
9988
|
+
.addOption(createEnvOption({ allowDev: true }))
|
|
9989
|
+
.option('-o, --output <stdout|path>', 'Output the result to stdout or a file (ignored with --publish, default: stdout)', 'stdout')
|
|
9990
|
+
.argument('[config]', 'Path to the portal config file (e.g., portal.config[.env]?.[ts,js,json])')
|
|
9991
|
+
.action(async (config, options) => {
|
|
9992
|
+
const log = options.silent
|
|
9993
|
+
? null
|
|
9994
|
+
: new ConsoleLogger('portal:config', { debug: !!options.debug });
|
|
9995
|
+
// Validate env for publish (no dev allowed)
|
|
9996
|
+
if (options.publish) {
|
|
9997
|
+
const [name, version] = options.publish.split('@') || [];
|
|
9998
|
+
if (!name || !version) {
|
|
9999
|
+
log?.fail('🤪', 'Portal identifier is required when using', chalk.blue('--publish'));
|
|
10000
|
+
log?.info('Example: fusion-framework-cli portal config --publish my-portal@1.2.3');
|
|
10001
|
+
process.exit(1);
|
|
10002
|
+
}
|
|
10003
|
+
if (options.env === 'dev') {
|
|
10004
|
+
log?.fail('🤪', chalk.blue('--env'), 'cannot be "dev" when', chalk.blue('--publish'), ' is used');
|
|
10005
|
+
process.exit(1);
|
|
10006
|
+
}
|
|
10007
|
+
return publishPortalConfig({
|
|
10008
|
+
config: options.config,
|
|
10009
|
+
portal: {
|
|
10010
|
+
name,
|
|
10011
|
+
version,
|
|
10012
|
+
},
|
|
10013
|
+
environment: options.env,
|
|
10014
|
+
auth: 'token' in options ? { token: options.token } : options,
|
|
10015
|
+
debug: options.debug,
|
|
10016
|
+
});
|
|
10017
|
+
}
|
|
10018
|
+
// Generate config
|
|
10019
|
+
const { config: portalConfig } = await generatePortalConfig({
|
|
10020
|
+
log,
|
|
10021
|
+
config,
|
|
10022
|
+
env: { environment: options.env },
|
|
10023
|
+
output: options.output === 'stdout' ? undefined : options.output,
|
|
10024
|
+
});
|
|
10025
|
+
if (options.output === 'stdout') {
|
|
10026
|
+
stdout.write(JSON.stringify(portalConfig, null, 2));
|
|
10027
|
+
}
|
|
10028
|
+
}));
|
|
10029
|
+
|
|
9797
10030
|
const command = createCommand('portal')
|
|
9798
10031
|
.description('Develop and deploy portal templates')
|
|
10032
|
+
.addCommand(command$9)
|
|
9799
10033
|
.addCommand(command$8)
|
|
9800
10034
|
.addCommand(command$7)
|
|
9801
10035
|
.addCommand(command$6)
|
|
@@ -9806,9 +10040,9 @@ const command = createCommand('portal')
|
|
|
9806
10040
|
.addCommand(command$1);
|
|
9807
10041
|
|
|
9808
10042
|
var registerCommands = (program) => {
|
|
9809
|
-
program.addCommand(command$
|
|
9810
|
-
program.addCommand(command$
|
|
9811
|
-
program.addCommand(command$
|
|
10043
|
+
program.addCommand(command$g);
|
|
10044
|
+
program.addCommand(command$c);
|
|
10045
|
+
program.addCommand(command$a);
|
|
9812
10046
|
program.addCommand(command);
|
|
9813
10047
|
};
|
|
9814
10048
|
|