@hubspot/cli 7.7.1-experimental.0 → 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 (59) hide show
  1. package/commands/account/auth.js +51 -82
  2. package/commands/auth.js +2 -15
  3. package/commands/config/migrate.js +17 -36
  4. package/commands/init.js +1 -2
  5. package/commands/module/marketplace-validate.js +6 -8
  6. package/commands/module.js +2 -1
  7. package/commands/project/add.d.ts +5 -2
  8. package/commands/project/add.js +43 -80
  9. package/commands/project/create.d.ts +2 -8
  10. package/commands/project/create.js +84 -55
  11. package/commands/project/dev/unifiedFlow.js +1 -0
  12. package/commands/remove.js +6 -12
  13. package/commands/theme/generate-selectors.js +7 -10
  14. package/commands/theme/marketplace-validate.js +6 -8
  15. package/commands/theme/preview.js +17 -18
  16. package/commands/theme.js +2 -2
  17. package/commands/upload.js +26 -63
  18. package/commands/watch.js +20 -32
  19. package/lang/en.d.ts +140 -92
  20. package/lang/en.js +143 -98
  21. package/lang/en.lyaml +3 -186
  22. package/lib/configMigrate.d.ts +2 -2
  23. package/lib/configMigrate.js +34 -69
  24. package/lib/constants.d.ts +23 -5
  25. package/lib/constants.js +24 -6
  26. package/lib/generateSelectors.js +3 -5
  27. package/lib/marketplaceValidate.d.ts +12 -2
  28. package/lib/marketplaceValidate.js +22 -29
  29. package/lib/middleware/configMiddleware.js +1 -0
  30. package/lib/projects/add/legacyAddComponent.d.ts +5 -0
  31. package/lib/projects/add/legacyAddComponent.js +48 -0
  32. package/lib/projects/add/v3AddComponent.d.ts +8 -0
  33. package/lib/projects/add/v3AddComponent.js +85 -0
  34. package/lib/projects/components.d.ts +2 -0
  35. package/lib/projects/components.js +82 -0
  36. package/lib/projects/create/index.d.ts +23 -0
  37. package/lib/projects/create/index.js +33 -0
  38. package/lib/projects/create/legacy.d.ts +6 -0
  39. package/lib/projects/{create.js → create/legacy.js} +20 -11
  40. package/lib/projects/create/v3.d.ts +27 -0
  41. package/lib/projects/create/v3.js +158 -0
  42. package/lib/projects/localDev/AppDevModeInterface.d.ts +3 -2
  43. package/lib/projects/localDev/AppDevModeInterface.js +38 -2
  44. package/lib/projects/localDev/LocalDevProcess.d.ts +12 -5
  45. package/lib/projects/localDev/LocalDevProcess.js +47 -17
  46. package/lib/projects/localDev/LocalDevState.d.ts +16 -3
  47. package/lib/projects/localDev/LocalDevState.js +43 -2
  48. package/lib/projects/localDev/LocalDevWatcher.js +3 -6
  49. package/lib/projects/localDev/LocalDevWebsocketServer.d.ts +3 -0
  50. package/lib/projects/localDev/LocalDevWebsocketServer.js +48 -9
  51. package/lib/prompts/createProjectPrompt.d.ts +14 -5
  52. package/lib/prompts/createProjectPrompt.js +36 -13
  53. package/lib/prompts/projectAddPrompt.d.ts +5 -1
  54. package/lib/prompts/projectAddPrompt.js +35 -7
  55. package/lib/prompts/setAsDefaultAccountPrompt.js +10 -0
  56. package/package.json +6 -5
  57. package/types/LocalDev.d.ts +11 -1
  58. package/types/Projects.d.ts +19 -2
  59. package/lib/projects/create.d.ts +0 -5
package/lang/en.d.ts CHANGED
@@ -17,6 +17,26 @@ export declare const commands: {
17
17
  readonly account: {
18
18
  readonly describe: "Commands for managing configured accounts.";
19
19
  readonly subcommands: {
20
+ readonly auth: {
21
+ readonly describe: "Configure authentication for your HubSpot account.";
22
+ readonly verboseDescribe: `Configure authentication for a HubSpot account. This will create or update the global config file at ${string} that stores your account information.
23
+
24
+ The authentication method is ${string}, which is an access token tied to a specific user account.
25
+
26
+ Global configuration replaces hubspot.config.yml, and you will be prompted to migrate your existing config if one exists.`;
27
+ readonly options: {
28
+ readonly account: "HubSpot account to authenticate";
29
+ };
30
+ readonly errors: {
31
+ readonly failedToUpdateConfig: "Failed to update the configuration file. Please try again.";
32
+ readonly migrationNotConfirmed: `Did not migrate your configuration file. Run ${string} to update your existing config, or use ${string} to switch to the new global configuration.`;
33
+ readonly mergeNotConfirmed: `Did not merge configuration files. When you are ready to merge the deprecated config file with the global config file, run ${string}.`;
34
+ };
35
+ readonly success: {
36
+ readonly configFileCreated: (configPath: string) => string;
37
+ readonly configFileUpdated: (accountId: number) => string;
38
+ };
39
+ };
20
40
  readonly list: {
21
41
  readonly accounts: `${string}:`;
22
42
  readonly defaultAccount: (account: string) => string;
@@ -141,6 +161,21 @@ export declare const commands: {
141
161
  readonly config: {
142
162
  readonly describe: "Commands for managing the CLI config file.";
143
163
  readonly subcommands: {
164
+ readonly migrate: {
165
+ readonly describe: `Migrate from the deprecated hubspot.config.yml file to the new global config file at ${string}.`;
166
+ readonly verboseDescribe: "This command will create or update the global configuration file in your root directory. It will archive the current config as archived.hubspot.config.yml.";
167
+ readonly errors: {
168
+ readonly noConfigToMigrate: "No hubspot.config.yml was found. There is nothing to migrate.";
169
+ readonly configNotFound: (configPath: string) => string;
170
+ };
171
+ readonly options: {
172
+ readonly force: "Bypass prompts and overwrite any conflicting values in the global config with the deprecated config values.";
173
+ };
174
+ readonly examples: {
175
+ readonly default: `Migrate from the deprecated hubspot.config.yml file to the new global config file at ${string}`;
176
+ readonly configFlag: `Migrate a specific config file (specified with the config flag) to the new global config file at ${string}`;
177
+ };
178
+ };
144
179
  readonly set: {
145
180
  readonly describe: "Set various configuration options within the hubspot CLI config file.";
146
181
  readonly promptMessage: "Select a config option to update";
@@ -843,7 +878,13 @@ Local development of unified apps is currently only compatible with accounts tha
843
878
  };
844
879
  readonly logs: {
845
880
  readonly success: (projectName: string, projectDest: string) => string;
846
- readonly welcomeMessage: "Welcome to HubSpot Developer Projects!";
881
+ readonly welcomeMessage: `
882
+ ${string}`;
883
+ };
884
+ readonly prompts: {
885
+ readonly parentComponents: "[--project-base] What would you like in your project?";
886
+ readonly emptyProject: "Empty Project";
887
+ readonly app: "App";
847
888
  };
848
889
  readonly examples: {
849
890
  readonly default: "Create a new project";
@@ -862,6 +903,21 @@ Local development of unified apps is currently only compatible with accounts tha
862
903
  readonly templateSource: {
863
904
  readonly describe: "Path to custom GitHub repository from which to create project template";
864
905
  };
906
+ readonly platformVersion: {
907
+ readonly describe: "The target platform version for the new project.";
908
+ };
909
+ readonly projectBase: {
910
+ readonly describe: "The top level component to include in the project.";
911
+ };
912
+ readonly distribution: {
913
+ readonly describe: "How the app will be distributed.";
914
+ };
915
+ readonly auth: {
916
+ readonly describe: "Authentication model for the application.";
917
+ };
918
+ readonly features: {
919
+ readonly describe: "Features to include in the project. Only valid if project-base is app";
920
+ };
865
921
  };
866
922
  };
867
923
  readonly migrateApp: {
@@ -947,11 +1003,23 @@ Local development of unified apps is currently only compatible with accounts tha
947
1003
  readonly type: {
948
1004
  readonly describe: "The path to the component type's location within the hubspot-project-components Github repo: https://github.com/HubSpot/hubspot-project-components";
949
1005
  };
1006
+ readonly distribution: {
1007
+ readonly describe: "The distribution method for the application.";
1008
+ };
1009
+ readonly auth: {
1010
+ readonly describe: "The authentication type for the application.";
1011
+ };
1012
+ readonly features: {
1013
+ readonly describe: "Which features to include with the application.";
1014
+ };
950
1015
  };
951
1016
  readonly creatingComponent: (projectName: string) => string;
952
- readonly success: (componentName: string) => string;
1017
+ readonly success: (componentName: string, multiple?: boolean) => string;
953
1018
  readonly error: {
954
1019
  readonly failedToDownloadComponent: "Failed to download project component. Please try again later.";
1020
+ readonly maxExceeded: (maxCount: number) => string;
1021
+ readonly authTypeNotAllowed: (authType: string) => string;
1022
+ readonly distributionNotAllowed: (dist: string) => string;
955
1023
  readonly locationInProject: "This command must be run from within a project directory.";
956
1024
  readonly failedToFetchComponentList: "Failed to fetch the list of available components. Please try again later.";
957
1025
  readonly projectContainsPublicApp: "This project contains a public app. This command is currently only compatible with projects that contain private apps.";
@@ -1184,15 +1252,13 @@ Local development of unified apps is currently only compatible with accounts tha
1184
1252
  };
1185
1253
  };
1186
1254
  readonly remove: {
1187
- readonly describe: "Delete a file or folder from HubSpot.";
1188
- readonly deleted: (path: string, accountId: string) => string;
1255
+ readonly describe: "Delete a file or folder from the HubSpot CMS.";
1256
+ readonly deleted: (path: string, accountId: number) => string;
1189
1257
  readonly errors: {
1190
- readonly deleteFailed: (path: string, accountId: string) => string;
1258
+ readonly deleteFailed: (path: string, accountId: number) => string;
1191
1259
  };
1192
1260
  readonly positionals: {
1193
- readonly path: {
1194
- readonly describe: "Remote hubspot path";
1195
- };
1261
+ readonly path: "Remote hubspot path";
1196
1262
  };
1197
1263
  };
1198
1264
  readonly sandbox: {
@@ -1434,9 +1500,7 @@ Local development of unified apps is currently only compatible with accounts tha
1434
1500
  };
1435
1501
  readonly success: (themePath: string, selectorsPath: string) => string;
1436
1502
  readonly positionals: {
1437
- readonly path: {
1438
- readonly describe: "The path of the theme you'd like to generate an editor-preview.json for.";
1439
- };
1503
+ readonly path: "The path of the theme you'd like to generate an editor-preview.json for.";
1440
1504
  };
1441
1505
  };
1442
1506
  readonly marketplaceValidate: {
@@ -1467,25 +1531,16 @@ Local development of unified apps is currently only compatible with accounts tha
1467
1531
  readonly errors: {
1468
1532
  readonly invalidPath: (path: string) => string;
1469
1533
  readonly noThemeComponents: "Your project has no theme components available to preview.";
1534
+ readonly uploadFailed: (src: string, dest: string) => string;
1470
1535
  };
1471
1536
  readonly positionals: {
1472
- readonly src: {
1473
- readonly describe: "Path to the local directory your theme is in, relative to your current working directory";
1474
- };
1475
- readonly dest: {
1476
- readonly 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.";
1477
- };
1537
+ readonly src: "Path to the local directory your theme is in, relative to your current working directory";
1538
+ readonly 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.";
1478
1539
  };
1479
1540
  readonly options: {
1480
- readonly notify: {
1481
- readonly describe: "Log to specified file when a watch task is triggered and after workers have gone idle. Ex. --notify path/to/file";
1482
- };
1483
- readonly noSsl: {
1484
- readonly describe: "Disable HTTPS";
1485
- };
1486
- readonly port: {
1487
- readonly describe: "The port on which to start the local server";
1488
- };
1541
+ readonly notify: "Log to specified file when a watch task is triggered and after workers have gone idle. Ex. --notify path/to/file";
1542
+ readonly noSsl: "Disable HTTPS";
1543
+ readonly port: "The port on which to start the local server";
1489
1544
  };
1490
1545
  readonly initialUploadProgressBar: {
1491
1546
  readonly start: "Starting...";
@@ -1509,11 +1564,6 @@ Local development of unified apps is currently only compatible with accounts tha
1509
1564
  readonly logs: {
1510
1565
  readonly validatingModule: (path: string) => string;
1511
1566
  };
1512
- readonly options: {
1513
- readonly json: {
1514
- readonly describe: "Output raw json data";
1515
- };
1516
- };
1517
1567
  readonly results: {
1518
1568
  readonly required: "Required validation results:";
1519
1569
  readonly recommended: "Recommended validation results:";
@@ -1524,9 +1574,7 @@ Local development of unified apps is currently only compatible with accounts tha
1524
1574
  readonly noErrors: "No errors";
1525
1575
  };
1526
1576
  readonly positionals: {
1527
- readonly src: {
1528
- readonly describe: "Path to the module within the Design Manager.";
1529
- };
1577
+ readonly src: "Path to the module within the Design Manager.";
1530
1578
  };
1531
1579
  };
1532
1580
  };
@@ -1539,85 +1587,53 @@ Local development of unified apps is currently only compatible with accounts tha
1539
1587
  readonly invalidPath: (path: string) => string;
1540
1588
  readonly uploadFailed: (src: string, dest: string) => string;
1541
1589
  readonly someFilesFailed: (dest: string) => string;
1542
- readonly deleteFailed: (path: string, accountId: string) => string;
1590
+ readonly deleteFailed: (path: string, accountId: number) => string;
1543
1591
  };
1544
1592
  readonly options: {
1545
- readonly options: {
1546
- readonly describe: "Options to pass to javascript fields files";
1547
- };
1548
- readonly saveOutput: {
1549
- readonly describe: "If true, saves all output from javascript fields files as 'fields.output.json'.";
1550
- };
1551
- readonly convertFields: {
1552
- readonly describe: "If true, converts any javascript fields files contained in module folder or project root.";
1553
- };
1554
- readonly clean: {
1555
- readonly 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.";
1556
- };
1557
- readonly force: {
1558
- readonly describe: "Skips confirmation prompts when doing a clean upload.";
1559
- };
1593
+ readonly options: "Options to pass to javascript fields files";
1594
+ readonly saveOutput: "If true, saves all output from javascript fields files as 'fields.output.json'.";
1595
+ readonly convertFields: "If true, converts any javascript fields files contained in module folder or project root.";
1596
+ readonly 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.";
1597
+ readonly force: "Skips confirmation prompts when doing a clean upload.";
1560
1598
  };
1561
1599
  readonly previewUrl: (previewUrl: string) => string;
1562
1600
  readonly positionals: {
1563
- readonly src: {
1564
- readonly describe: "Path to the local file, relative to your current working directory.";
1565
- };
1566
- readonly dest: {
1567
- readonly describe: "Path in HubSpot Design Tools, can be a net new path.";
1568
- };
1601
+ readonly src: "Path to the local file, relative to your current working directory.";
1602
+ readonly dest: "Path in HubSpot Design Tools, can be a net new path.";
1569
1603
  };
1570
1604
  readonly success: {
1571
- readonly fileUploaded: (src: string, dest: string, accountId: string) => string;
1605
+ readonly fileUploaded: (src: string, dest: string, accountId: number) => string;
1572
1606
  readonly uploadComplete: (dest: string) => string;
1573
1607
  };
1574
- readonly uploading: (src: string, dest: string, accountId: string) => string;
1608
+ readonly uploading: (src: string, dest: string, accountId: number) => string;
1575
1609
  readonly notUploaded: (src: string) => string;
1576
- readonly cleaning: (filePath: string, accountId: string) => string;
1577
- readonly confirmCleanUpload: (filePath: string, accountId: string) => string;
1610
+ readonly cleaning: (filePath: string, accountId: number) => string;
1611
+ readonly confirmCleanUpload: (filePath: string, accountId: number) => string;
1578
1612
  };
1579
1613
  readonly watch: {
1580
1614
  readonly describe: "Watch a directory on your computer for changes and upload the changed files to the HubSpot CMS.";
1581
1615
  readonly errors: {
1582
- readonly folderFailed: (src: string, dest: string, accountId: string) => string;
1583
- readonly fileFailed: (file: string, dest: string, accountId: string) => string;
1616
+ readonly folderFailed: (src: string, dest: string, accountId: number) => string;
1617
+ readonly fileFailed: (file: string, dest: string, accountId: number) => string;
1584
1618
  readonly destinationRequired: "A destination directory needs to be passed";
1585
1619
  readonly invalidPath: (path: string) => string;
1586
1620
  };
1587
1621
  readonly options: {
1588
- readonly disableInitial: {
1589
- readonly describe: "Disable the initial upload when watching a directory (default)";
1590
- };
1591
- readonly initialUpload: {
1592
- readonly describe: "Upload directory before watching for updates";
1593
- };
1594
- readonly notify: {
1595
- readonly describe: "Log to specified file when a watch task is triggered and after workers have gone idle. Ex. --notify path/to/file";
1596
- };
1597
- readonly remove: {
1598
- readonly describe: "Will cause watch to delete files in your HubSpot account that are not found locally.";
1599
- };
1600
- readonly convertFields: {
1601
- readonly describe: "If true, converts any javascript fields files contained in module folder or project root.";
1602
- };
1603
- readonly saveOutput: {
1604
- readonly describe: "If true, saves all output from javascript fields files as 'fields.output.json'.";
1605
- };
1606
- readonly options: {
1607
- readonly describe: "Options to pass to javascript fields files";
1608
- };
1622
+ readonly disableInitial: "Disable the initial upload when watching a directory (default)";
1623
+ readonly initialUpload: "Upload directory before watching for updates";
1624
+ readonly notify: "Log to specified file when a watch task is triggered and after workers have gone idle. Ex. --notify path/to/file";
1625
+ readonly remove: "Will cause watch to delete files in your HubSpot account that are not found locally.";
1626
+ readonly convertFields: "If true, converts any javascript fields files contained in module folder or project root.";
1627
+ readonly saveOutput: "If true, saves all output from javascript fields files as 'fields.output.json'.";
1628
+ readonly options: "Options to pass to javascript fields files";
1609
1629
  };
1610
1630
  readonly positionals: {
1611
- readonly src: {
1612
- readonly describe: "Path to the local directory your files are in, relative to your current working directory";
1613
- };
1614
- readonly dest: {
1615
- readonly describe: "Path in HubSpot Design Tools. Can be a net new path";
1616
- };
1631
+ readonly src: "Path to the local directory your files are in, relative to your current working directory";
1632
+ readonly dest: "Path in HubSpot Design Tools. Can be a net new path";
1617
1633
  };
1618
1634
  readonly warnings: {
1619
- readonly disableInitial: () => string;
1620
- readonly initialUpload: () => string;
1635
+ readonly disableInitial: `Passing the "${string}" option is no longer necessary. Running "${string}" no longer uploads the watched directory by default.`;
1636
+ readonly initialUpload: `To upload the directory run "${string}" beforehand or add the "${string}" option when running "${string}".`;
1621
1637
  readonly notUploaded: (path: string) => string;
1622
1638
  };
1623
1639
  };
@@ -2284,6 +2300,7 @@ export declare const lib: {
2284
2300
  readonly unknownMessageType: (type: string) => string;
2285
2301
  readonly invalidJSON: (data: string) => string;
2286
2302
  readonly portManagerNotRunning: (prefix: string) => string;
2303
+ readonly originNotAllowed: (origin?: string) => string;
2287
2304
  };
2288
2305
  readonly logs: {
2289
2306
  readonly startup: (port: number) => string;
@@ -2371,10 +2388,21 @@ Run ${string} to upgrade to version ${string}`;
2371
2388
  };
2372
2389
  readonly projects: {
2373
2390
  readonly create: {
2391
+ readonly prompt: {
2392
+ readonly marketPlaceDistribution: "On the HubSpot marketplace";
2393
+ readonly privateDistribution: "Privately";
2394
+ readonly distribution: "[--distribution] How would you like to distribute your application?";
2395
+ readonly auth: "[--auth] What type of authentication would you like your application to use";
2396
+ readonly staticAuth: "Static Auth";
2397
+ readonly oauth: "OAuth";
2398
+ };
2374
2399
  readonly errors: {
2375
2400
  readonly 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.";
2376
2401
  readonly 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.";
2377
- readonly 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\"].";
2402
+ readonly 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\"].";
2403
+ readonly exceededMaxNumberOfApps: (max: number) => string;
2404
+ readonly unableToParseAppConfig: (file: string) => string;
2405
+ readonly invalidAuthDistCombo: (authType: string, distribution: string) => string;
2378
2406
  };
2379
2407
  };
2380
2408
  readonly validateProjectConfig: {
@@ -2579,6 +2607,24 @@ Run ${string} to upgrade to version ${string}`;
2579
2607
  };
2580
2608
  };
2581
2609
  };
2610
+ readonly configMigrate: {
2611
+ readonly deprecatedConfigWarning: (deprecatedConfigPath: string) => string;
2612
+ readonly handleMigration: {
2613
+ readonly description: (archivedConfigName: string) => string;
2614
+ readonly confirmPrompt: "Migrate the deprecated config to the global location?";
2615
+ readonly success: "Your deprecated config file has been successfully migrated.";
2616
+ };
2617
+ readonly handleMergeConfigProperties: {
2618
+ readonly mergeConflictMessage: (count: number, propertyList: string) => string;
2619
+ readonly mergeConfigConflictPrompt: (property: string, newValue: string, oldValue: string) => string;
2620
+ };
2621
+ readonly handleMerge: {
2622
+ readonly description: (archivedConfigName: string) => string;
2623
+ readonly confirmPrompt: "Merge the deprecated config into your global config?";
2624
+ readonly skippedExistingAccounts: (accountIds: (string | number)[]) => string;
2625
+ readonly success: "Your deprecated config file has been successfully merged with the global config file.";
2626
+ };
2627
+ };
2582
2628
  readonly prompts: {
2583
2629
  readonly projectDevTargetAccountPrompt: {
2584
2630
  readonly createNewSandboxOption: "<Test on a new development sandbox>";
@@ -2716,7 +2762,9 @@ Run ${string} to upgrade to version ${string}`;
2716
2762
  readonly enterName: "[--name] Give your component a name: ";
2717
2763
  readonly errors: {
2718
2764
  readonly nameRequired: "A component name is required";
2765
+ readonly componentRequired: "Must select a feature to add";
2719
2766
  readonly invalidType: (type: string) => string;
2767
+ readonly cannotAddFeature: (feature: string, reasons: string | boolean) => string;
2720
2768
  };
2721
2769
  };
2722
2770
  readonly secretPrompt: {