@forge/cli-shared 8.22.1-next.0 → 8.23.0-experimental-4a332af

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/out/ui/text.js CHANGED
@@ -270,6 +270,7 @@ What do you like or don't like about Forge? Share your feedback below or press C
270
270
  promptCategory: 'Select a category:',
271
271
  promptTemplate: 'Select a template:',
272
272
  promptProduct: 'Select an Atlassian app or platform tool:',
273
+ globalTemplateSelection: `${greenTick} UI Kit and global-ui will be used to create your app.`,
273
274
  taskTemplate: {
274
275
  title: 'Downloading template',
275
276
  downloading: (template) => `Downloading ${template} template project...`,
@@ -698,12 +699,16 @@ What do you like or don't like about Forge? Share your feedback below or press C
698
699
  json: 'output results in JSON format',
699
700
  outFile: 'specify a file to output the results',
700
701
  version1: 'source version to upgrade in a non-interactive mode',
701
- version2: 'target version to upgrade to in a non-interactive mode'
702
+ version2: 'target version to upgrade to in a non-interactive mode',
703
+ limit: 'limit the number of installations to upgrade (optional)'
702
704
  },
703
705
  desc: `upgrades installations using one major version to another version. The version selection list displays:\n${itemList(['major version number', 'deployment date', 'number of installations'])}`,
704
706
  overViewVersionTable: (versions, environment) => `\nDetails for a total of [${versions} major versions] in [${environment}] can be seen below.\nWhere there are no upgrade paths available, use \`forge version compare\` to compare versions and see more information:\n`,
705
707
  promptVersionTable: 'Getting app version list...',
706
- selectTargetVersionToUpgrade: (installations) => `Please select version to upgrade existing ${installations} installations to:`,
708
+ selectTargetVersionToUpgrade: (sourceVersion) => {
709
+ const sourceVersionText = sourceVersion ? ` from version ${sourceVersion}` : '';
710
+ return `Please select a version to upgrade installations${sourceVersionText} to:`;
711
+ },
707
712
  error: {
708
713
  missingVersionUpgradeParameters: `Missing parameters:\nError: [version bulk-upgrade start --non-interactive] requires --from-version and --to-version`,
709
714
  appVersionRolloutRunning: `App version rollout for this app environment is already running. Use \`forge version bulk-upgrade list\` to identify the running upgrade and \`forge version bulk-upgrade cancel\` to cancel.`,
@@ -718,8 +723,29 @@ What do you like or don't like about Forge? Share your feedback below or press C
718
723
  appVersionRolloutSuccess(appRolloutVersionId) {
719
724
  return `Your upgrade has been queued with upgrade ID ${appRolloutVersionId}. To view that status of your update please use the \`forge version bulk-upgrade list\` command.`;
720
725
  },
721
- warningMessage: (sourceVersionId, targetVersionId, installations) => `${chalk_1.default.bold('Warning:')} You are planning to move ${installations} installations from version ${sourceVersionId} to version ${targetVersionId}.`,
722
- promptConfirmation: 'Do you want to continue?'
726
+ limitWarningUserLimit: (expectedRemaining, totalEligible, userLimit) => `${chalk_1.default.yellow('Warning:')} Due to the limit you specified (${userLimit}), ${expectedRemaining} out of the eligible ${totalEligible} upgrades will remain unprocessed.`,
727
+ limitWarningAdjustedLimit: (expectedRemaining, totalEligible, userLimit, appliedLimit) => `${chalk_1.default.yellow('Warning:')} The limit you supplied (${userLimit}) could not be honored and a limit of ${appliedLimit} has been applied. Due to this limit ${expectedRemaining} out of the eligible ${totalEligible} upgrades will remain unprocessed.`,
728
+ limitWarningSystemLimit: (expectedRemaining, totalEligible, systemLimit) => `${chalk_1.default.yellow('Warning:')} The number of eligible installations exceeded the per-workflow maximum (${systemLimit}). Due to this maximum ${expectedRemaining} out of the eligible ${totalEligible} upgrades will remain unprocessed.`,
729
+ limitWarningFollowUp: 'These unprocessed installations can be processed by starting a new workflow after the completion of this one.',
730
+ warningMessage: (sourceVersionId, targetVersionId, installations, limit, enforcedSystemLimit, userProvidedLimit) => {
731
+ const effectiveInstallations = limit !== undefined && limit < (installations || 0) ? limit : installations;
732
+ const installationText = effectiveInstallations === 1 ? 'installation' : 'installations';
733
+ let limitNote = '';
734
+ if (enforcedSystemLimit !== undefined && userProvidedLimit !== undefined) {
735
+ limitNote = `. Provided limit (${userProvidedLimit}) not honored due to system limit`;
736
+ }
737
+ return `${chalk_1.default.bold('Warning:')} You are planning to move ${effectiveInstallations} ${installationText} from version ${sourceVersionId} to version ${targetVersionId}${limitNote}.`;
738
+ },
739
+ promptConfirmation: 'Do you want to continue?',
740
+ promptLimit: (installations) => `How many installations to upgrade? (${installations} eligible):`,
741
+ promptLimitWithTargetInfo: (installations, upgradeLimit) => {
742
+ const eligibleText = `${installations} eligible`;
743
+ const limitText = upgradeLimit && (installations ?? 0) > upgradeLimit ? `, system limit: ${upgradeLimit}` : ``;
744
+ return `How many installations to upgrade? (${eligibleText}${limitText}):`;
745
+ },
746
+ limitValidationError: (max) => max !== undefined
747
+ ? `Please enter a valid number between 1 and ${max}, or leave empty for no limit.`
748
+ : `Please enter a valid number greater than 0, or leave empty for no limit.`
723
749
  },
724
750
  list: {
725
751
  cmdName: 'list',
@@ -855,6 +881,9 @@ What do you like or don't like about Forge? Share your feedback below or press C
855
881
  buildTag: {
856
882
  description: 'specify a build tag to deploy (from forge build)'
857
883
  },
884
+ skipRollout: {
885
+ description: 'Skip rolling release rollout after deployment'
886
+ },
858
887
  connectKeyChange: {
859
888
  continueChange: `Do you wish to continue with changing the Connect key?`,
860
889
  continueDelete: `Do you wish to continue with deleting the Connect key?`,
@@ -1048,6 +1077,7 @@ ${buildTerminalLink(link)}\n`,
1048
1077
  noResourceId: 'Unknown site with no resource ID',
1049
1078
  noCloudId: 'Unknown workspace with no cloud ID',
1050
1079
  noResourceIdInWorkspace: 'Unknown workspace with no resource ID',
1080
+ noResourceIdInInstallation: 'Unknown installation with no resource ID',
1051
1081
  noInstallations: `The app is not installed anywhere.\nRun ${forge('install')} to install your app on an Atlassian site.\n`,
1052
1082
  status: {
1053
1083
  outdatedPermissions: 'Outdated permissions',
@@ -1137,6 +1167,7 @@ ${buildTerminalLink(link)}\n`,
1137
1167
  }
1138
1168
  },
1139
1169
  installationId: {
1170
+ option: 'specify the installation ID',
1140
1171
  prompt: "Enter the app's installation ID:",
1141
1172
  errors: {
1142
1173
  invalid: `Invalid installation ID. Run ${forge('install', 'list')} to see the installation IDs for the app.`,
@@ -1157,8 +1188,12 @@ ${buildTerminalLink(link)}\n`,
1157
1188
  confirmAllInstallations: 'This will uninstall the app from the listed contexts. Are you sure you want to continue?'
1158
1189
  },
1159
1190
  info: 'Uninstalling...',
1160
- done: (product, domain, environment, isMulti) => `${isMulti ? log_symbols_1.default.info : log_symbols_1.default.success} Uninstalled from the ${(0, environment_1.environmentToOption)(environment)} environment in ${product} on ${buildTerminalLink(domain)}.`,
1161
- failed: (product, domain, environment) => `Failed to uninstall the app from the ${(0, environment_1.environmentToOption)(environment)} environment in ${product} on ${buildTerminalLink(domain)}. Try rerunning the command, or ask for help if you continue to see this error.`,
1191
+ done: (product, domain, environment, isMulti) => product === 'Ecosystem'
1192
+ ? `${isMulti ? log_symbols_1.default.info : log_symbols_1.default.success} Uninstalled.`
1193
+ : `${isMulti ? log_symbols_1.default.info : log_symbols_1.default.success} Uninstalled from the ${(0, environment_1.environmentToOption)(environment)} environment in ${product} on ${buildTerminalLink(domain)}.`,
1194
+ failed: (product, domain, environment) => product === 'Ecosystem'
1195
+ ? `Failed to uninstall the app. Try rerunning the command, or ask for help if you continue to see this error.`
1196
+ : `Failed to uninstall the app from the ${(0, environment_1.environmentToOption)(environment)} environment in ${product} on ${buildTerminalLink(domain)}. Try rerunning the command, or ask for help if you continue to see this error.`,
1162
1197
  missingUninstallTask: `Cannot uninstall the app: something went wrong with starting the uninstall task.`,
1163
1198
  uninstallBatchBanner: (remainingInstallations) => log_color_1.LogColor.warn(`${log_symbols_1.default.info} ${chalk_1.default.bold(`Batch uninstallations are limited to ${installations_1.MAX_BATCH_UNINSTALLS} per request and there ${remainingInstallations > 1 ? `are ${remainingInstallations} installations` : 'is 1 installation'} remaining. Run the command multiple times to perform more uninstallations`)}`),
1164
1199
  uninstallBatchProductionError: `${log_symbols_1.default.error} ${chalk_1.default.bold('Batch uninstallations are not supported in production environments.')}`
@@ -1487,6 +1522,15 @@ When errors occur during Forge command execution, error details will be sent to
1487
1522
  }
1488
1523
  }
1489
1524
  },
1525
+ commandHelp: {
1526
+ groups: {
1527
+ quickStart: 'Quick Start',
1528
+ develop: 'Develop',
1529
+ manage: 'Manage',
1530
+ account: 'Account',
1531
+ cliExperience: 'CLI Experience'
1532
+ }
1533
+ },
1490
1534
  dynamicTable: {
1491
1535
  exiting: 'Exiting...'
1492
1536
  },
@@ -1500,16 +1544,65 @@ When errors occur during Forge command execution, error details will be sent to
1500
1544
  optionUiType: 'UI framework (ui-kit, custom-ui)',
1501
1545
  optionProduct: 'target product (Jira, Confluence, etc.)',
1502
1546
  optionDryRun: 'show what would be generated',
1503
- optionForce: 'overwrite existing files',
1547
+ optionForce: 'overwrite existing files and upgrade conflicting dependencies to template versions',
1504
1548
  optionNoInstall: 'skip installing dependencies',
1505
- optionUpgradeDeps: 'upgrade existing dependencies to template versions',
1506
1549
  promptSelectProduct: 'select a product',
1507
1550
  promptSelectModule: 'select a module',
1508
1551
  promptSelectUIFramework: 'select a UI framework',
1552
+ dryRunLabel: 'Dry run: ',
1553
+ filesToBeCreatedHeader: 'Files to be created:',
1554
+ fileChangeHeader: (fileName) => `${fileName} changes:`,
1555
+ depAdditionsHeader: 'Adding:',
1556
+ frontendDepHeader: 'Frontend dependencies:',
1557
+ depConflictsHeader: '⚠️ Dependency conflicts detected',
1558
+ depConflictsScopedHeader: (scope) => `⚠️ ${scope === 'frontend' ? 'Frontend' : 'Backend'} dependency conflicts detected`,
1559
+ depConflictsBlockedHeader: (scope) => `⚠️ ${scope === 'frontend' ? 'Frontend' : 'Backend'} dependency conflicts detected`,
1560
+ depConflictsColumnPackage: 'Package',
1561
+ depConflictsColumnCurrent: 'Your version',
1562
+ depConflictsColumnTemplate: 'Template version',
1563
+ depConflictsColumnStatus: 'Status',
1564
+ depConflictsStatusConflict: '⛔ CONFLICT',
1565
+ depConflictsStatusUpgraded: '⬆️ UPGRADED',
1566
+ depConflictsStatusDowngraded: '⬇️ DOWNGRADED',
1567
+ depConflictsStatusOk: '✅ OK',
1568
+ depConflictsSummary: (count) => `${count} conflict(s) found. Cannot proceed without resolution.`,
1569
+ depConflictsUpgradedSummary: (count) => `${count} conflicting package(s) upgraded to template versions.`,
1570
+ depConflictsOptionsHeader: 'Options:',
1571
+ depConflictsOptionForce: '--force Upgrade conflicting packages to template versions (still runs npm install)',
1572
+ depConflictsOptionNoInstall: '--no-install Add to package.json only, skip npm install',
1573
+ depConflictsOptionForceNoInstall: '--force --no-install Upgrade conflicting packages but skip npm install',
1574
+ depConflictsFooter: 'Resolve conflicts manually or re-run with --force to upgrade.',
1575
+ errorDepConflicts: (count) => `${count} dependency conflict(s) detected. Re-run with --force to upgrade, or --no-install to skip the install step.`,
1576
+ errorPackageJsonNotFound: (pkgPath) => `package.json not found at ${pkgPath}. Cannot determine existing dependencies.`,
1577
+ errorPackageJsonParseFailed: (pkgPath, message) => `Failed to parse package.json at ${pkgPath}: ${message}`,
1578
+ errorMissingDepVersion: (name) => `Template dependency "${name}" is missing an explicit version. Templates must declare a version for every dependency.`,
1579
+ warnNoManifest: (manifestPath) => `No manifest.yml found at ${manifestPath}. Manifest changes were not planned.`,
1580
+ warnNoFragment: 'Template did not provide a manifest fragment; manifest changes were not planned.',
1581
+ warnNoManifestDelta: 'Manifest fragment did not introduce any changes after merge.',
1582
+ warnAddedAppCompatibility: (existingProduct, newProduct) => `Adding a "${newProduct}" module to an app that already targets "${existingProduct}"; updated app.compatibility so the app must be installed to "${newProduct}" to see changes.`,
1583
+ warnUnsupportedFileOperations: (ops) => `Skipping ${ops.length} unsupported file operation(s): ${ops.join(', ')}. Only "create" operations are supported.`,
1584
+ warnViteConfigExists: (configPath) => `An existing vite.config.js at ${configPath} could not be merged automatically. Skipping vite config changes; re-run with --force to overwrite.`,
1585
+ errorViteConfigNestedInput: () => `Cannot safely merge vite.config.js: the existing "input" block contains a nested object. Merging would corrupt the file. Re-run with --force to regenerate the config from scratch, or edit the input map manually.`,
1586
+ errorApplyNotImplemented: 'module add apply mode is not implemented yet; re-run with --dry-run to preview changes.',
1509
1587
  errorInvalidProduct: (product) => `Invalid product "${product}"`,
1510
1588
  errorInvalidUIFramework: (uiFramework, moduleKey) => `Invalid UI framework "${uiFramework ?? 'unknown'}" for module "${moduleKey}"`,
1511
1589
  errorFailedToResolveChoice: (choice) => `Failed to resolve selected module from choice "${choice}"`,
1512
- errorFailedToDownloadTemplate: (moduleKey) => `Failed to download template for module "${moduleKey}"`
1590
+ errorFailedToDownloadTemplate: (moduleKey) => `Failed to download template for module "${moduleKey}"`,
1591
+ errorMissingTemplateSource: (sourcePath) => `Template source file not found in extracted bundle: ${sourcePath}`,
1592
+ errorTargetConflict: (targets) => `File(s) already exist and would be overwritten:\n- ${targets.join('\n- ')}\n\nRe-run with --force to overwrite, or choose different values to generate unique filenames.`,
1593
+ errorZipExtractionFailed: (moduleKey, message) => `Failed to extract template bundle for "${moduleKey}": ${message}`,
1594
+ errorZipCleanupFailed: (moduleKey) => `Failed to clean up downloaded zip for "${moduleKey}".`,
1595
+ errorCacheDirMissing: (moduleKey) => `Cache directory is not set for module "${moduleKey}". Call prepareModuleMetadata before downloading the bundle.`,
1596
+ errorFailedToDownloadBundle: (moduleKey, message) => `Failed to download bundle for "${moduleKey}": ${message}`,
1597
+ errorCacheCleanupFailed: (cacheDir) => `Failed to clean up cache directory: ${cacheDir}`,
1598
+ errorNoBundle: (moduleKey, searched) => `No template bundle was found for "${moduleKey}". Searched the following paths:\n- ${searched.join('\n- ')}\n\nThe template archive may have failed to download, or its layout may not match expectations.`,
1599
+ errorNoFileOperations: (moduleKey, uiFramework) => `Template "${moduleKey}"${uiFramework ? ` (variant "${uiFramework}")` : ''} declares no "create" file operations; nothing to copy.`,
1600
+ warnDownloadFailed: (moduleKey, message) => `Failed to download template archive for "${moduleKey}": ${message}. File copy will be skipped.`,
1601
+ warnNoBundle: 'Template bundle was not downloaded; file copy was skipped.',
1602
+ warnInstallSkipped: '⚠️ Skipping install: Run npm install to install new dependencies.',
1603
+ infoReusingResource: (resourceKey) => `Reusing existing resource '${resourceKey}'`,
1604
+ errorResourceEntryConflict: (resourceKey, entryName, existing, incoming) => `Resource '${resourceKey}' already declares entry '${entryName}' as '${existing}', but the new module wants '${incoming}'. Choose a different moduleKey or remove the existing entry.`,
1605
+ errorResourcePathConflict: (resourceKey, existing, incoming) => `Resource '${resourceKey}' already declares path '${existing}', but the new module wants '${incoming}'. Resources sharing a key must share a path.`
1513
1606
  },
1514
1607
  list: {
1515
1608
  description: 'list available module templates',
@@ -1526,9 +1619,11 @@ When errors occur during Forge command execution, error details will be sent to
1526
1619
  bifrostIndexInvalid: 'Error: expected array of templates',
1527
1620
  bifrostIndexFetchFailed: (status, statusText) => `Error: template fetch failed: ${status} ${statusText}`,
1528
1621
  bifrostManifestFragmentFetchFailed: (status, statusText) => `Error: failed to fetch manifest fragment: ${status} ${statusText}`,
1529
- duplicateModuleKey: (value, moduleKey) => `Module key "${value}" already exists for ${moduleKey}. Please enter a different value.`,
1622
+ bifrostZipFetchFailed: (moduleKey, status, statusText) => `Error: failed to fetch template bundle for "${moduleKey}": ${status} ${statusText}`,
1623
+ duplicateModuleKey: (value) => `Module key "${value}" already exists in the manifest. Please enter a different value.`,
1530
1624
  duplicateFunctionKey: (value) => `Function key "${value}" already exists. Please enter a different value.`,
1531
- duplicateResourceKey: (value) => `Resource key "${value}" already exists. Please enter a different value.`
1625
+ duplicateResourceKey: (value) => `Resource key "${value}" already exists. Please enter a different value.`,
1626
+ duplicateKey: (value) => `"${value}" must be unique. Please enter a different value.`
1532
1627
  }
1533
1628
  }
1534
1629
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/cli-shared",
3
- "version": "8.22.1-next.0",
3
+ "version": "8.23.0-experimental-4a332af",
4
4
  "description": "Common functionality for Forge CLI",
5
5
  "author": "Atlassian",
6
6
  "license": "SEE LICENSE IN LICENSE.txt",
@@ -12,10 +12,11 @@
12
12
  "generate-graphql-types": "graphql-codegen --config src/graphql/codegen.yml"
13
13
  },
14
14
  "dependencies": {
15
- "@forge/manifest": "12.7.1-next.0",
15
+ "@forge/manifest": "12.8.0-experimental-4a332af",
16
16
  "@forge/util": "2.0.1",
17
17
  "@forge/i18n": "0.0.7",
18
18
  "@sentry/node": "7.106.0",
19
+ "@vercel/detect-agent": "^1.2.3",
19
20
  "adm-zip": "^0.5.10",
20
21
  "array.prototype.flatmap": "^1.3.3",
21
22
  "case": "^1.6.3",
@@ -47,6 +48,7 @@
47
48
  },
48
49
  "devDependencies": {
49
50
  "@atlassian/xen-test-util": "^4.2.0",
51
+ "@colors/colors": "1.5.0",
50
52
  "@graphql-codegen/add": "^5.0.2",
51
53
  "@graphql-codegen/cli": "^5.0.2",
52
54
  "@graphql-codegen/typescript": "^4.1.6",