@hubspot/cli 7.7.0-experimental.3 → 7.7.2-experimental.0

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.
Files changed (98) hide show
  1. package/bin/cli.js +96 -94
  2. package/commands/account/auth.js +51 -82
  3. package/commands/account.js +0 -2
  4. package/commands/app.js +0 -2
  5. package/commands/auth.js +2 -17
  6. package/commands/cms.js +0 -2
  7. package/commands/completion.js +0 -2
  8. package/commands/config/migrate.js +17 -36
  9. package/commands/config.js +0 -2
  10. package/commands/create.js +0 -2
  11. package/commands/customObject.js +0 -2
  12. package/commands/doctor.js +0 -2
  13. package/commands/feedback.js +0 -2
  14. package/commands/filemanager.js +0 -2
  15. package/commands/function.js +0 -2
  16. package/commands/hubdb.js +0 -2
  17. package/commands/init.js +1 -4
  18. package/commands/lint.js +0 -2
  19. package/commands/list.js +0 -2
  20. package/commands/module/marketplace-validate.js +6 -8
  21. package/commands/module.js +2 -1
  22. package/commands/mv.js +0 -2
  23. package/commands/open.js +0 -2
  24. package/commands/project/add.d.ts +5 -2
  25. package/commands/project/add.js +43 -80
  26. package/commands/project/create.d.ts +2 -8
  27. package/commands/project/create.js +84 -55
  28. package/commands/project/dev/deprecatedFlow.d.ts +8 -2
  29. package/commands/project/dev/deprecatedFlow.js +9 -1
  30. package/commands/project/dev/index.js +59 -34
  31. package/commands/project/dev/unifiedFlow.d.ts +10 -2
  32. package/commands/project/dev/unifiedFlow.js +28 -41
  33. package/commands/project.js +0 -2
  34. package/commands/remove.js +6 -14
  35. package/commands/sandbox.js +0 -2
  36. package/commands/secret.js +0 -2
  37. package/commands/theme/generate-selectors.js +7 -10
  38. package/commands/theme/marketplace-validate.js +6 -8
  39. package/commands/theme/preview.js +17 -18
  40. package/commands/theme.js +2 -4
  41. package/commands/upload.js +26 -65
  42. package/commands/watch.js +20 -32
  43. package/lang/en.d.ts +154 -95
  44. package/lang/en.js +156 -100
  45. package/lang/en.lyaml +3 -186
  46. package/lib/accountTypes.js +1 -3
  47. package/lib/commonOpts.d.ts +1 -3
  48. package/lib/commonOpts.js +1 -1
  49. package/lib/configMigrate.d.ts +2 -2
  50. package/lib/configMigrate.js +34 -69
  51. package/lib/constants.d.ts +23 -5
  52. package/lib/constants.js +24 -6
  53. package/lib/generateSelectors.js +3 -5
  54. package/lib/marketplaceValidate.d.ts +12 -2
  55. package/lib/marketplaceValidate.js +22 -29
  56. package/lib/middleware/configMiddleware.js +1 -0
  57. package/lib/middleware/fireAlarmMiddleware.d.ts +2 -2
  58. package/lib/middleware/fireAlarmMiddleware.js +5 -3
  59. package/lib/projects/add/legacyAddComponent.d.ts +5 -0
  60. package/lib/projects/add/legacyAddComponent.js +48 -0
  61. package/lib/projects/add/v3AddComponent.d.ts +8 -0
  62. package/lib/projects/add/v3AddComponent.js +85 -0
  63. package/lib/projects/components.d.ts +2 -0
  64. package/lib/projects/components.js +82 -0
  65. package/lib/projects/create/index.d.ts +23 -0
  66. package/lib/projects/create/index.js +33 -0
  67. package/lib/projects/create/legacy.d.ts +6 -0
  68. package/lib/projects/{create.js → create/legacy.js} +20 -11
  69. package/lib/projects/create/v3.d.ts +27 -0
  70. package/lib/projects/create/v3.js +158 -0
  71. package/lib/projects/localDev/AppDevModeInterface.d.ts +3 -2
  72. package/lib/projects/localDev/AppDevModeInterface.js +38 -8
  73. package/lib/projects/localDev/LocalDevProcess.d.ts +12 -5
  74. package/lib/projects/localDev/LocalDevProcess.js +47 -17
  75. package/lib/projects/localDev/LocalDevState.d.ts +16 -3
  76. package/lib/projects/localDev/LocalDevState.js +43 -2
  77. package/lib/projects/localDev/LocalDevWatcher.js +3 -6
  78. package/lib/projects/localDev/LocalDevWebsocketServer.d.ts +3 -0
  79. package/lib/projects/localDev/LocalDevWebsocketServer.js +48 -9
  80. package/lib/projects/upload.js +6 -0
  81. package/lib/prompts/createProjectPrompt.d.ts +14 -5
  82. package/lib/prompts/createProjectPrompt.js +36 -13
  83. package/lib/prompts/projectAddPrompt.d.ts +5 -1
  84. package/lib/prompts/projectAddPrompt.js +35 -7
  85. package/lib/prompts/promptUtils.d.ts +0 -1
  86. package/lib/prompts/promptUtils.js +0 -2
  87. package/lib/prompts/setAsDefaultAccountPrompt.js +10 -0
  88. package/package.json +7 -6
  89. package/types/LocalDev.d.ts +11 -1
  90. package/types/Projects.d.ts +19 -2
  91. package/types/Yargs.d.ts +2 -0
  92. package/commands/testAccount/create.d.ts +0 -7
  93. package/commands/testAccount/create.js +0 -118
  94. package/commands/testAccount/delete.d.ts +0 -6
  95. package/commands/testAccount/delete.js +0 -42
  96. package/commands/testAccount.d.ts +0 -3
  97. package/commands/testAccount.js +0 -27
  98. package/lib/projects/create.d.ts +0 -5
package/lang/en.js CHANGED
@@ -5,9 +5,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.lib = exports.commands = void 0;
7
7
  const chalk_1 = __importDefault(require("chalk"));
8
+ const projects_1 = require("@hubspot/local-dev-lib/constants/projects");
9
+ const auth_1 = require("@hubspot/local-dev-lib/constants/auth");
10
+ const config_1 = require("@hubspot/local-dev-lib/constants/config");
8
11
  const ui_1 = require("../lib/ui");
9
12
  const urls_1 = require("../lib/projects/urls");
10
- const ui_2 = require("../lib/ui");
13
+ const constants_1 = require("../lib/constants");
14
+ const v3_1 = require("../lib/projects/create/v3");
11
15
  exports.commands = {
12
16
  generalErrors: {
13
17
  srcIsProject: (src, command) => `"${src}" is in a project folder. Did you mean "hs project ${command}"?`,
@@ -27,6 +31,22 @@ exports.commands = {
27
31
  account: {
28
32
  describe: 'Commands for managing configured accounts.',
29
33
  subcommands: {
34
+ auth: {
35
+ describe: 'Configure authentication for your HubSpot account.',
36
+ verboseDescribe: `Configure authentication for a HubSpot account. This will create or update the global config file at ${config_1.GLOBAL_CONFIG_PATH} that stores your account information.\n\nThe authentication method is ${chalk_1.default.bold(auth_1.PERSONAL_ACCESS_KEY_AUTH_METHOD.value)}, which is an access token tied to a specific user account.\n\nGlobal configuration replaces ${config_1.DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME}, and you will be prompted to migrate your existing config if one exists.`,
37
+ options: {
38
+ account: 'HubSpot account to authenticate',
39
+ },
40
+ errors: {
41
+ failedToUpdateConfig: 'Failed to update the configuration file. Please try again.',
42
+ migrationNotConfirmed: `Did not migrate your configuration file. Run ${(0, ui_1.uiCommandReference)('hs auth')} to update your existing config, or use ${(0, ui_1.uiCommandReference)('hs config migrate')} to switch to the new global configuration.`,
43
+ mergeNotConfirmed: `Did not merge configuration files. When you are ready to merge the deprecated config file with the global config file, run ${(0, ui_1.uiCommandReference)('hs config migrate')}.`,
44
+ },
45
+ success: {
46
+ configFileCreated: (configPath) => `Created config file "${configPath}"`,
47
+ configFileUpdated: (accountId) => `Connected account ${(0, ui_1.uiAccountDescription)(accountId)} and set it as the default account`,
48
+ },
49
+ },
30
50
  list: {
31
51
  accounts: `${chalk_1.default.bold('Accounts')}:`,
32
52
  defaultAccount: (account) => `${chalk_1.default.bold('Default account')}: ${account}`,
@@ -151,6 +171,21 @@ exports.commands = {
151
171
  config: {
152
172
  describe: 'Commands for managing the CLI config file.',
153
173
  subcommands: {
174
+ migrate: {
175
+ describe: `Migrate from the deprecated ${config_1.DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME} file to the new global config file at ${config_1.GLOBAL_CONFIG_PATH}.`,
176
+ verboseDescribe: `This command will create or update the global configuration file in your root directory. It will archive the current config as ${config_1.ARCHIVED_HUBSPOT_CONFIG_YAML_FILE_NAME}.`,
177
+ errors: {
178
+ noConfigToMigrate: `No ${config_1.DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME} was found. There is nothing to migrate.`,
179
+ configNotFound: (configPath) => `A configuration file at ${configPath} could not be found. Please try again with a valid file path.`,
180
+ },
181
+ options: {
182
+ force: 'Bypass prompts and overwrite any conflicting values in the global config with the deprecated config values.',
183
+ },
184
+ examples: {
185
+ default: `Migrate from the deprecated ${config_1.DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME} file to the new global config file at ${config_1.GLOBAL_CONFIG_PATH}`,
186
+ configFlag: `Migrate a specific config file (specified with the config flag) to the new global config file at ${config_1.GLOBAL_CONFIG_PATH}`,
187
+ },
188
+ },
154
189
  set: {
155
190
  describe: 'Set various configuration options within the hubspot CLI config file.',
156
191
  promptMessage: 'Select a config option to update',
@@ -814,18 +849,26 @@ exports.commands = {
814
849
  placeholderAccountSelection: 'Using default account as target account (for now)',
815
850
  learnMoreLocalDevServer: 'Learn more about the projects local dev server',
816
851
  accountTypeInformation: 'Testing in a developer test account is strongly recommended, but you can use a sandbox account if your plan allows you to create one.',
817
- learnMoreMessage: `Visit our ${(0, ui_1.uiLink)('docs on Developer Test and Sandbox accounts', 'https://developers.hubspot.com/docs/getting-started/account-types')} to learn more.`,
852
+ learnMoreMessage: `\nVisit our ${(0, ui_1.uiLink)('docs on Developer Test and Sandbox accounts', 'https://developers.hubspot.com/docs/getting-started/account-types')} to learn more.`,
818
853
  },
819
854
  errors: {
820
855
  noProjectConfig: 'No project detected. Please run this command again from a project directory.',
821
- noAccount: (accountId, authCommand) => `An error occurred while reading account ${accountId} from your config. Run ${chalk_1.default.bold(authCommand)} to re-auth this account.`,
856
+ noAccount: (accountId) => `An error occurred while reading account ${(0, ui_1.uiAccountDescription)(accountId)} from your config. Run ${(0, ui_1.uiCommandReference)('hs auth')} to re-auth this account.`,
822
857
  noAccountsInConfig: (authCommand) => `No accounts found in your config. Run ${chalk_1.default.bold(authCommand)} to configure a HubSpot account with the CLI.`,
823
858
  invalidProjectComponents: 'Projects cannot contain both private and public apps. Move your apps to separate projects before attempting local development.',
824
- noRunnableComponents: (command) => `No supported components were found in this project. Run ${chalk_1.default.bold(command)} to see a list of available components and add one to your project.`,
859
+ noRunnableComponents: `No supported components were found in this project. Run ${(0, ui_1.uiCommandReference)('hs project add')} to see a list of available components and add one to your project.`,
860
+ accountNotCombined: `\nLocal development of unified apps is currently only compatible with accounts that are opted into the unified apps beta. Make sure that this account is opted in or switch accounts using ${(0, ui_1.uiCommandReference)('hs account use')}.`,
861
+ unsupportedAccountFlagLegacy: 'The --projectAccount and --testingAccount flags are not supported for projects with platform versions earlier than 2025.2.',
862
+ unsupportedAccountFlagV3: 'The --account flag is is not supported supported for projects with platform versions 2025.2 and newer. Use --testingAccount and --projectAccount flags to specify accounts to use for local dev',
825
863
  },
826
864
  examples: {
827
865
  default: 'Start local dev for the current project',
828
866
  },
867
+ options: {
868
+ profile: 'The profile to target during local dev',
869
+ projectAccount: 'The id of the account to upload your project to. Only compatible with platform versions 2025.2 and above.',
870
+ testingAccount: 'The id of the account to install apps and test on. Only compatible with platform versions 2025.2 and above.',
871
+ },
829
872
  },
830
873
  create: {
831
874
  describe: 'Create a new project.',
@@ -836,8 +879,13 @@ exports.commands = {
836
879
  cannotNestProjects: (projectDir) => `A project already exists at ${projectDir}. Projects cannot be nested within other projects. Please choose a different destination and try again.`,
837
880
  },
838
881
  logs: {
839
- success: (projectName, projectDest) => `Project ${chalk_1.default.bold(projectName)} was successfully created in ${projectDest}`,
840
- welcomeMessage: 'Welcome to HubSpot Developer Projects!',
882
+ success: (projectName, projectDest) => `\nProject ${chalk_1.default.bold(projectName)} was successfully created in ${projectDest}`,
883
+ welcomeMessage: `\n${chalk_1.default.bold('Welcome to HubSpot Developer Projects!')}`,
884
+ },
885
+ prompts: {
886
+ parentComponents: '[--project-base] What would you like in your project?',
887
+ emptyProject: 'Empty Project',
888
+ app: 'App',
841
889
  },
842
890
  examples: {
843
891
  default: 'Create a new project',
@@ -856,6 +904,21 @@ exports.commands = {
856
904
  templateSource: {
857
905
  describe: 'Path to custom GitHub repository from which to create project template',
858
906
  },
907
+ platformVersion: {
908
+ describe: 'The target platform version for the new project.',
909
+ },
910
+ projectBase: {
911
+ describe: 'The top level component to include in the project.',
912
+ },
913
+ distribution: {
914
+ describe: 'How the app will be distributed.',
915
+ },
916
+ auth: {
917
+ describe: 'Authentication model for the application.',
918
+ },
919
+ features: {
920
+ describe: `Features to include in the project. Only valid if project-base is ${v3_1.PROJECT_WITH_APP}`,
921
+ },
859
922
  },
860
923
  },
861
924
  migrateApp: {
@@ -941,11 +1004,23 @@ exports.commands = {
941
1004
  type: {
942
1005
  describe: "The path to the component type's location within the hubspot-project-components Github repo: https://github.com/HubSpot/hubspot-project-components",
943
1006
  },
1007
+ distribution: {
1008
+ describe: 'The distribution method for the application.',
1009
+ },
1010
+ auth: {
1011
+ describe: 'The authentication type for the application.',
1012
+ },
1013
+ features: {
1014
+ describe: 'Which features to include with the application.',
1015
+ },
944
1016
  },
945
- creatingComponent: (projectName) => `Adding a new component to ${chalk_1.default.bold(projectName)}`,
946
- success: (componentName) => `${componentName} was successfully added to your project.`,
1017
+ creatingComponent: (projectName) => `\nAdding a new component to ${chalk_1.default.bold(projectName)}\n`,
1018
+ success: (componentName, multiple = false) => `${componentName} ${multiple ? 'were' : 'was'} successfully added to your app.`,
947
1019
  error: {
948
1020
  failedToDownloadComponent: 'Failed to download project component. Please try again later.',
1021
+ maxExceeded: (maxCount) => `This project has the maximum allowed(${maxCount})`,
1022
+ authTypeNotAllowed: (authType) => `Auth type '${authType}' not allowed.`,
1023
+ distributionNotAllowed: (dist) => `Distribution '${dist}' not allowed.`,
949
1024
  locationInProject: 'This command must be run from within a project directory.',
950
1025
  failedToFetchComponentList: 'Failed to fetch the list of available components. Please try again later.',
951
1026
  projectContainsPublicApp: 'This project contains a public app. This command is currently only compatible with projects that contain private apps.',
@@ -1176,15 +1251,13 @@ exports.commands = {
1176
1251
  },
1177
1252
  },
1178
1253
  remove: {
1179
- describe: 'Delete a file or folder from HubSpot.',
1180
- deleted: (path, accountId) => `Deleted "${path}" from account ${accountId}`,
1254
+ describe: 'Delete a file or folder from the HubSpot CMS.',
1255
+ deleted: (path, accountId) => `Deleted "${path}" from account ${(0, ui_1.uiAccountDescription)(accountId)}`,
1181
1256
  errors: {
1182
- deleteFailed: (path, accountId) => `Deleting "${path}" from account ${accountId} failed`,
1257
+ deleteFailed: (path, accountId) => `Deleting "${path}" from account ${(0, ui_1.uiAccountDescription)(accountId)} failed`,
1183
1258
  },
1184
1259
  positionals: {
1185
- path: {
1186
- describe: 'Remote hubspot path',
1187
- },
1260
+ path: 'Remote hubspot path',
1188
1261
  },
1189
1262
  },
1190
1263
  sandbox: {
@@ -1426,9 +1499,7 @@ exports.commands = {
1426
1499
  },
1427
1500
  success: (themePath, selectorsPath) => `Selectors generated for ${themePath}, please double check the selectors generated at ${selectorsPath} before uploading the theme.`,
1428
1501
  positionals: {
1429
- path: {
1430
- describe: "The path of the theme you'd like to generate an editor-preview.json for.",
1431
- },
1502
+ path: "The path of the theme you'd like to generate an editor-preview.json for.",
1432
1503
  },
1433
1504
  },
1434
1505
  marketplaceValidate: {
@@ -1459,25 +1530,16 @@ exports.commands = {
1459
1530
  errors: {
1460
1531
  invalidPath: (path) => `The path "${path}" is not a path to a directory`,
1461
1532
  noThemeComponents: 'Your project has no theme components available to preview.',
1533
+ uploadFailed: (src, dest) => `Uploading file "${src}" to "${dest}" failed`,
1462
1534
  },
1463
1535
  positionals: {
1464
- src: {
1465
- describe: 'Path to the local directory your theme is in, relative to your current working directory',
1466
- },
1467
- dest: {
1468
- describe: 'Path in HubSpot Design Tools. Can be a net new path. If you wish to preview a site page using your theme changes it must match the path of the theme used by the site.',
1469
- },
1536
+ src: 'Path to the local directory your theme is in, relative to your current working directory',
1537
+ dest: 'Path in HubSpot Design Tools. Can be a net new path. If you wish to preview a site page using your theme changes it must match the path of the theme used by the site.',
1470
1538
  },
1471
1539
  options: {
1472
- notify: {
1473
- describe: 'Log to specified file when a watch task is triggered and after workers have gone idle. Ex. --notify path/to/file',
1474
- },
1475
- noSsl: {
1476
- describe: 'Disable HTTPS',
1477
- },
1478
- port: {
1479
- describe: 'The port on which to start the local server',
1480
- },
1540
+ notify: 'Log to specified file when a watch task is triggered and after workers have gone idle. Ex. --notify path/to/file',
1541
+ noSsl: 'Disable HTTPS',
1542
+ port: 'The port on which to start the local server',
1481
1543
  },
1482
1544
  initialUploadProgressBar: {
1483
1545
  start: 'Starting...',
@@ -1501,11 +1563,6 @@ exports.commands = {
1501
1563
  logs: {
1502
1564
  validatingModule: (path) => `Validating module "${path}" \n`,
1503
1565
  },
1504
- options: {
1505
- json: {
1506
- describe: 'Output raw json data',
1507
- },
1508
- },
1509
1566
  results: {
1510
1567
  required: 'Required validation results:',
1511
1568
  recommended: 'Recommended validation results:',
@@ -1516,9 +1573,7 @@ exports.commands = {
1516
1573
  noErrors: 'No errors',
1517
1574
  },
1518
1575
  positionals: {
1519
- src: {
1520
- describe: 'Path to the module within the Design Manager.',
1521
- },
1576
+ src: 'Path to the module within the Design Manager.',
1522
1577
  },
1523
1578
  },
1524
1579
  },
@@ -1531,86 +1586,54 @@ exports.commands = {
1531
1586
  invalidPath: (path) => `The path "${path}" is not a path to a file or folder`,
1532
1587
  uploadFailed: (src, dest) => `Uploading file "${src}" to "${dest}" failed`,
1533
1588
  someFilesFailed: (dest) => `One or more files failed to upload to "${dest}" in the Design Manager`,
1534
- deleteFailed: (path, accountId) => `Deleting "${path}" from account ${accountId} failed`,
1589
+ deleteFailed: (path, accountId) => `Deleting "${path}" from account ${(0, ui_1.uiAccountDescription)(accountId)} failed`,
1535
1590
  },
1536
1591
  options: {
1537
- options: {
1538
- describe: 'Options to pass to javascript fields files',
1539
- },
1540
- saveOutput: {
1541
- describe: "If true, saves all output from javascript fields files as 'fields.output.json'.",
1542
- },
1543
- convertFields: {
1544
- describe: 'If true, converts any javascript fields files contained in module folder or project root.',
1545
- },
1546
- clean: {
1547
- describe: 'Will delete the destination directory and its contents before uploading. This will also clear the global content associated with any global partial templates and modules.',
1548
- },
1549
- force: {
1550
- describe: 'Skips confirmation prompts when doing a clean upload.',
1551
- },
1592
+ options: 'Options to pass to javascript fields files',
1593
+ saveOutput: "If true, saves all output from javascript fields files as 'fields.output.json'.",
1594
+ convertFields: 'If true, converts any javascript fields files contained in module folder or project root.',
1595
+ clean: 'Will delete the destination directory and its contents before uploading. This will also clear the global content associated with any global partial templates and modules.',
1596
+ force: 'Skips confirmation prompts when doing a clean upload.',
1552
1597
  },
1553
1598
  previewUrl: (previewUrl) => `To preview this theme, visit: ${previewUrl}`,
1554
1599
  positionals: {
1555
- src: {
1556
- describe: 'Path to the local file, relative to your current working directory.',
1557
- },
1558
- dest: {
1559
- describe: 'Path in HubSpot Design Tools, can be a net new path.',
1560
- },
1600
+ src: 'Path to the local file, relative to your current working directory.',
1601
+ dest: 'Path in HubSpot Design Tools, can be a net new path.',
1561
1602
  },
1562
1603
  success: {
1563
- fileUploaded: (src, dest, accountId) => `Uploaded file from "${src}" to "${dest}" in the Design Manager of account ${accountId}`,
1604
+ fileUploaded: (src, dest, accountId) => `Uploaded file from "${src}" to "${dest}" in the Design Manager of account ${(0, ui_1.uiAccountDescription)(accountId)}`,
1564
1605
  uploadComplete: (dest) => `Uploading files to "${dest}" in the Design Manager is complete`,
1565
1606
  },
1566
- uploading: (src, dest, accountId) => `Uploading files from "${src}" to "${dest}" in the Design Manager of account ${accountId}`,
1607
+ uploading: (src, dest, accountId) => `Uploading files from "${src}" to "${dest}" in the Design Manager of account ${(0, ui_1.uiAccountDescription)(accountId)}`,
1567
1608
  notUploaded: (src) => `There was an error processing "${src}". The file has not been uploaded.`,
1568
- cleaning: (filePath, accountId) => `Removing "${filePath}" from account ${accountId} and uploading local...`,
1569
- confirmCleanUpload: (filePath, accountId) => `You are about to delete the directory "${filePath}" and its contents on HubSpot account ${accountId} before uploading. This will also clear the global content associated with any global partial templates and modules. Are you sure you want to do this?`,
1609
+ cleaning: (filePath, accountId) => `Removing "${filePath}" from account ${(0, ui_1.uiAccountDescription)(accountId)} and uploading local...`,
1610
+ confirmCleanUpload: (filePath, accountId) => `You are about to delete the directory "${filePath}" and its contents on HubSpot account ${(0, ui_1.uiAccountDescription)(accountId)} before uploading. This will also clear the global content associated with any global partial templates and modules. Are you sure you want to do this?`,
1570
1611
  },
1571
1612
  watch: {
1572
1613
  describe: 'Watch a directory on your computer for changes and upload the changed files to the HubSpot CMS.',
1573
1614
  errors: {
1574
- folderFailed: (src, dest, accountId) => `Initial uploading of folder "${src}" to "${dest}" in account ${accountId} had failures`,
1575
- fileFailed: (file, dest, accountId) => `Upload of file "${file}" to "${dest}" in account ${accountId} failed`,
1615
+ folderFailed: (src, dest, accountId) => `Initial uploading of folder "${src}" to "${dest}" in account ${(0, ui_1.uiAccountDescription)(accountId)} had failures`,
1616
+ fileFailed: (file, dest, accountId) => `Upload of file "${file}" to "${dest}" in account ${(0, ui_1.uiAccountDescription)(accountId)} failed`,
1576
1617
  destinationRequired: 'A destination directory needs to be passed',
1577
1618
  invalidPath: (path) => `The "${path}" is not a path to a directory`,
1578
1619
  },
1579
1620
  options: {
1580
- disableInitial: {
1581
- describe: 'Disable the initial upload when watching a directory (default)',
1582
- },
1583
- initialUpload: {
1584
- describe: 'Upload directory before watching for updates',
1585
- },
1586
- notify: {
1587
- describe: 'Log to specified file when a watch task is triggered and after workers have gone idle. Ex. --notify path/to/file',
1588
- },
1589
- remove: {
1590
- describe: 'Will cause watch to delete files in your HubSpot account that are not found locally.',
1591
- },
1592
- convertFields: {
1593
- describe: 'If true, converts any javascript fields files contained in module folder or project root.',
1594
- },
1595
- saveOutput: {
1596
- describe: "If true, saves all output from javascript fields files as 'fields.output.json'.",
1597
- },
1598
- options: {
1599
- describe: 'Options to pass to javascript fields files',
1600
- },
1621
+ disableInitial: 'Disable the initial upload when watching a directory (default)',
1622
+ initialUpload: 'Upload directory before watching for updates',
1623
+ notify: 'Log to specified file when a watch task is triggered and after workers have gone idle. Ex. --notify path/to/file',
1624
+ remove: 'Will cause watch to delete files in your HubSpot account that are not found locally.',
1625
+ convertFields: 'If true, converts any javascript fields files contained in module folder or project root.',
1626
+ saveOutput: "If true, saves all output from javascript fields files as 'fields.output.json'.",
1627
+ options: 'Options to pass to javascript fields files',
1601
1628
  },
1602
1629
  positionals: {
1603
- src: {
1604
- describe: 'Path to the local directory your files are in, relative to your current working directory',
1605
- },
1606
- dest: {
1607
- describe: 'Path in HubSpot Design Tools. Can be a net new path',
1608
- },
1630
+ src: 'Path to the local directory your files are in, relative to your current working directory',
1631
+ dest: 'Path in HubSpot Design Tools. Can be a net new path',
1609
1632
  },
1610
1633
  warnings: {
1611
- disableInitial: () => `Passing the "${chalk_1.default.bold('--disable-initial')}" option is no longer necessary. Running "${chalk_1.default.bold('hs watch')}" no longer uploads the watched directory by default.`,
1612
- initialUpload: () => `To upload the directory run "${chalk_1.default.bold('hs upload')}" beforehand or add the "${chalk_1.default.bold('--initial-upload')}" option when running "${chalk_1.default.bold('hs watch')}".`,
1613
- notUploaded: (path) => `The "${chalk_1.default.bold('hs watch')}" command no longer uploads the watched directory when started. The directory "${path}" was not uploaded.`,
1634
+ disableInitial: `Passing the "${chalk_1.default.bold('--disable-initial')}" option is no longer necessary. Running "${(0, ui_1.uiCommandReference)('hs watch')}" no longer uploads the watched directory by default.`,
1635
+ initialUpload: `To upload the directory run "${(0, ui_1.uiCommandReference)('hs upload')}" beforehand or add the "${chalk_1.default.bold('--initial-upload')}" option when running "${(0, ui_1.uiCommandReference)('hs watch')}".`,
1636
+ notUploaded: (path) => `The "${(0, ui_1.uiCommandReference)('hs watch')}" command no longer uploads the watched directory when started. The directory "${path}" was not uploaded.`,
1614
1637
  },
1615
1638
  },
1616
1639
  convertFields: {
@@ -2231,7 +2254,7 @@ exports.lib = {
2231
2254
  noComponents: 'There are no components in this project.',
2232
2255
  betaMessage: 'HubSpot projects local development',
2233
2256
  learnMoreLocalDevServer: (0, ui_1.uiLink)('Learn more about the projects local dev server', 'https://developers.hubspot.com/docs/platform/project-cli-commands#start-a-local-development-server'),
2234
- running: (projectName, accountIdentifier) => chalk_1.default.hex(ui_2.UI_COLORS.SORBET)(`Running ${chalk_1.default.bold(projectName)} locally on ${accountIdentifier}, waiting for changes ...`),
2257
+ running: (projectName, accountIdentifier) => chalk_1.default.hex(ui_1.UI_COLORS.SORBET)(`Running ${chalk_1.default.bold(projectName)} locally on ${accountIdentifier}, waiting for changes ...`),
2235
2258
  quitHelper: `Press ${chalk_1.default.bold('q')} to stop the local dev server`,
2236
2259
  viewProjectLink: (name, accountId) => (0, ui_1.uiLink)('View project in HubSpot', (0, urls_1.getProjectDetailUrl)(name, accountId) || ''),
2237
2260
  viewTestAccountLink: 'View developer test account in HubSpot',
@@ -2276,6 +2299,7 @@ exports.lib = {
2276
2299
  unknownMessageType: (type) => `Unsupported message received. Unknown message type: ${type}`,
2277
2300
  invalidJSON: (data) => `Unsupported message received. Invalid JSON: ${data}`,
2278
2301
  portManagerNotRunning: (prefix) => `${prefix}Error: PortManagerServing must be running before starting LocalDevWebsocketServer.`,
2302
+ originNotAllowed: (origin) => `Connections from ${origin ? `origin ${origin}` : 'this origin'} are not allowed.`,
2279
2303
  },
2280
2304
  logs: {
2281
2305
  startup: (port) => `LocalDevWebsocketServer running on port ${port}`,
@@ -2362,10 +2386,21 @@ exports.lib = {
2362
2386
  },
2363
2387
  projects: {
2364
2388
  create: {
2389
+ prompt: {
2390
+ marketPlaceDistribution: 'On the HubSpot marketplace',
2391
+ privateDistribution: 'Privately',
2392
+ distribution: '[--distribution] How would you like to distribute your application?',
2393
+ auth: '[--auth] What type of authentication would you like your application to use',
2394
+ staticAuth: 'Static Auth',
2395
+ oauth: 'OAuth',
2396
+ },
2365
2397
  errors: {
2366
2398
  noProjectsInConfig: 'Unable to find any projects in the target repository\'s config.json file. Please ensure that there is a "projects" array in the config file.',
2367
2399
  missingConfigFileTemplateSource: 'Failed to fetch the config.json file from the target repository. Please ensure that there is a valid config.json file at the root of the repository and try again.',
2368
- missingPropertiesInConfig: 'Found misconfigured projects in the target repository\'s config.json file. Please ensure that each project in the target repository\'s config.json file contains the following properties: ["name", "label", "path", "insertPath"].',
2400
+ missingPropertiesInConfig: 'Found misconfigured projects in the target repository\'s config.json file. Please ensure that each project in the target repository\'s config.json file contains the following properties: ["name", "label", "path"].',
2401
+ exceededMaxNumberOfApps: (max) => `This project currently has the maximum number of apps: ${max}`,
2402
+ unableToParseAppConfig: (file) => `Unable to parse app file: ${file}`,
2403
+ invalidAuthDistCombo: (authType, distribution) => `Invalid distribution and auth combination. Apps with distribution '${distribution}' must have auth '${authType}'`,
2369
2404
  },
2370
2405
  },
2371
2406
  validateProjectConfig: {
@@ -2409,6 +2444,7 @@ exports.lib = {
2409
2444
  },
2410
2445
  },
2411
2446
  projectUpload: {
2447
+ wrongPlatformVersionMetaFiles: `Detected components that require a minimum platform version of ${projects_1.PLATFORM_VERSIONS.v2025_2}. You need to update your platform version in your ${constants_1.PROJECT_CONFIG_FILE} and run ${(0, ui_1.uiCommandReference)('hs project upload')}`,
2412
2448
  uploadProjectFiles: {
2413
2449
  add: (projectName, accountIdentifier) => `Uploading ${chalk_1.default.bold(projectName)} project files to ${accountIdentifier}`,
2414
2450
  fail: (projectName, accountIdentifier) => `Failed to upload ${chalk_1.default.bold(projectName)} project files to ${accountIdentifier}`,
@@ -2567,6 +2603,24 @@ exports.lib = {
2567
2603
  },
2568
2604
  },
2569
2605
  },
2606
+ configMigrate: {
2607
+ deprecatedConfigWarning: (deprecatedConfigPath) => `This command applies to global configuration, but we detected a deprecated config at ${deprecatedConfigPath}.`,
2608
+ handleMigration: {
2609
+ description: (archivedConfigName) => `We will migrate your deprecated config file to the new global configuration file location. This will create a new global configuration file in your root directory. Then it will archive the deprecated config as ${archivedConfigName} for you to manually cleanup at your convenience.`,
2610
+ confirmPrompt: 'Migrate the deprecated config to the global location?',
2611
+ success: 'Your deprecated config file has been successfully migrated.',
2612
+ },
2613
+ handleMergeConfigProperties: {
2614
+ mergeConflictMessage: (count, propertyList) => `Conflict${count > 1 ? 's' : ''} detected for ${chalk_1.default.bold(propertyList)}.`,
2615
+ mergeConfigConflictPrompt: (property, newValue, oldValue) => `Change ${property} from ${newValue} to ${oldValue}?`,
2616
+ },
2617
+ handleMerge: {
2618
+ description: (archivedConfigName) => `We will automatically merge the contents of your deprecated config file into your global configuration file. This will merge the configured accounts and settings into the global config. Then it will archive the deprecated config as ${archivedConfigName} for you to manually cleanup at your convenience.`,
2619
+ confirmPrompt: 'Merge the deprecated config into your global config?',
2620
+ skippedExistingAccounts: (accountIds) => `The following accounts were not merged because they already exist in the global config:${accountIds.map(id => `\n- ${(0, ui_1.uiAccountDescription)(Number(id))}`).join('')}`,
2621
+ success: 'Your deprecated config file has been successfully merged with the global config file.',
2622
+ },
2623
+ },
2570
2624
  prompts: {
2571
2625
  projectDevTargetAccountPrompt: {
2572
2626
  createNewSandboxOption: '<Test on a new development sandbox>',
@@ -2704,7 +2758,9 @@ exports.lib = {
2704
2758
  enterName: '[--name] Give your component a name: ',
2705
2759
  errors: {
2706
2760
  nameRequired: 'A component name is required',
2761
+ componentRequired: 'Must select a feature to add',
2707
2762
  invalidType: (type) => `[--type] Could not find type "${type}". Please choose an available type:`,
2763
+ cannotAddFeature: (feature, reasons) => `Cannot Add feature '${feature}' to project for the following reasons: ${reasons}`,
2708
2764
  },
2709
2765
  },
2710
2766
  secretPrompt: {