@hubspot/cli 7.2.0 → 7.2.1-beta.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.
@@ -84,6 +84,8 @@ exports.handler = async (options) => {
84
84
  logger.log('');
85
85
  logger.log(chalk.bold(i18n(`${i18nKey}.logs.welcomeMessage`)));
86
86
  uiFeatureHighlight([
87
+ 'projectCommandTip',
88
+ 'projectUploadCommand',
87
89
  'projectDevCommand',
88
90
  'projectHelpCommand',
89
91
  'feedbackCommand',
package/lang/en.lyaml CHANGED
@@ -1083,10 +1083,10 @@ en:
1083
1083
  restartDev: " * Re-run {{ command }}"
1084
1084
  pushToGithub: " * Commit and push your changes to GitHub"
1085
1085
  activeInstallWarning:
1086
- installCount: "{{#bold}}The app {{ appName }} has {{ installCount }} production {{ installText }}{{/bold}}"
1086
+ installCount: "{{#bold}}The app {{ appName }} is installed in {{ installCount }} {{ accountText }}{{/bold}}"
1087
1087
  explanation: "Some changes made during local development may need to be synced to HubSpot, which will impact those existing installs. We strongly recommend creating a copy of this app to use instead."
1088
1088
  confirmation: "You will always be asked to confirm any permanent changes to your app’s configuration before uploading them."
1089
- confirmationPrompt: "Proceed with local development of this {{#bold}}production{{/bold}} app?"
1089
+ confirmationPrompt: "Proceed with local development of this app with existing installs?"
1090
1090
  devServer:
1091
1091
  cleanupError: "Failed to cleanup local dev server: {{ message }}"
1092
1092
  setupError: "Failed to setup local dev server: {{ message }}"
@@ -1178,7 +1178,7 @@ en:
1178
1178
  disabledUrlText: "See all HubSpot CLI commands here."
1179
1179
  featureHighlight:
1180
1180
  defaultTitle: "What's next?"
1181
- commandKeys:
1181
+ featureKeys:
1182
1182
  accountOption:
1183
1183
  command: "--account"
1184
1184
  message: "Use the {{ command }} option with any command to override the default account"
@@ -1208,10 +1208,12 @@ en:
1208
1208
  message: "Run {{ command }} to learn more about available project commands"
1209
1209
  projectUploadCommand:
1210
1210
  command: "hs project upload"
1211
- message: "Run {{ command }} to upload your project to HubSpot and trigger builds"
1211
+ message: "Run {{ command }} to upload your project to your HubSpot account"
1212
1212
  projectDevCommand:
1213
1213
  command: "hs project dev"
1214
1214
  message: "Run {{ command }} to set up your test environment and start local development"
1215
+ projectCommandTip:
1216
+ message: "Tip: All project commands must be run from within a project directory"
1215
1217
  sampleProjects:
1216
1218
  linkText: "HubSpot's sample projects"
1217
1219
  url: "https://developers.hubspot.com/docs/platform/sample-projects?utm_source=cli&utm_content=project_create_whats_next"
@@ -118,7 +118,7 @@ class LocalDevManager {
118
118
  logger_1.logger.warn((0, lang_1.i18n)(`${i18nKey}.activeInstallWarning.installCount`, {
119
119
  appName: this.activePublicAppData.name,
120
120
  installCount: this.publicAppActiveInstalls,
121
- installText: this.publicAppActiveInstalls === 1 ? 'install' : 'installs',
121
+ accountText: this.publicAppActiveInstalls === 1 ? 'account' : 'accounts',
122
122
  }));
123
123
  logger_1.logger.log((0, lang_1.i18n)(`${i18nKey}.activeInstallWarning.explanation`));
124
124
  (0, ui_1.uiLine)();
@@ -115,7 +115,7 @@ class LocalDevManagerV2 {
115
115
  logger_1.logger.warn((0, lang_1.i18n)(`${i18nKey}.activeInstallWarning.installCount`, {
116
116
  appName: this.activePublicAppData.name,
117
117
  installCount: this.publicAppActiveInstalls,
118
- installText: this.publicAppActiveInstalls === 1 ? 'install' : 'installs',
118
+ accountText: this.publicAppActiveInstalls === 1 ? 'account' : 'accounts',
119
119
  }));
120
120
  logger_1.logger.log((0, lang_1.i18n)(`${i18nKey}.activeInstallWarning.explanation`));
121
121
  (0, ui_1.uiLine)();
@@ -9,7 +9,20 @@ const path_1 = __importDefault(require("path"));
9
9
  const path_2 = require("@hubspot/local-dev-lib/path");
10
10
  const promptUtils_1 = require("./promptUtils");
11
11
  const lang_1 = require("../lang");
12
+ const constants_1 = require("../constants");
12
13
  const i18nKey = 'lib.prompts.createProjectPrompt';
14
+ function validateProjectDirectory(input) {
15
+ if (!input) {
16
+ return (0, lang_1.i18n)(`${i18nKey}.errors.destRequired`);
17
+ }
18
+ if (fs_1.default.existsSync(path_1.default.resolve((0, path_2.getCwd)(), path_1.default.join(input, constants_1.PROJECT_CONFIG_FILE)))) {
19
+ return (0, lang_1.i18n)(`${i18nKey}.errors.invalidDest`);
20
+ }
21
+ if (!(0, path_2.isValidPath)(input)) {
22
+ return (0, lang_1.i18n)(`${i18nKey}.errors.invalidCharacters`);
23
+ }
24
+ return true;
25
+ }
13
26
  function findTemplateByNameOrLabel(projectTemplates, templateNameOrLabel) {
14
27
  return projectTemplates.find(t => t.name === templateNameOrLabel || t.label === templateNameOrLabel);
15
28
  }
@@ -38,18 +51,7 @@ async function createProjectPrompt(promptOptions, projectTemplates) {
38
51
  const projectName = (0, path_2.sanitizeFileName)(promptOptions.name || answers.name);
39
52
  return path_1.default.resolve((0, path_2.getCwd)(), projectName);
40
53
  },
41
- validate: (input) => {
42
- if (!input) {
43
- return (0, lang_1.i18n)(`${i18nKey}.errors.destRequired`);
44
- }
45
- if (fs_1.default.existsSync(input)) {
46
- return (0, lang_1.i18n)(`${i18nKey}.errors.invalidDest`);
47
- }
48
- if (!(0, path_2.isValidPath)(input)) {
49
- return (0, lang_1.i18n)(`${i18nKey}.errors.invalidCharacters`);
50
- }
51
- return true;
52
- },
54
+ validate: validateProjectDirectory,
53
55
  filter: input => {
54
56
  return (0, path_2.untildify)(input);
55
57
  },
package/lib/ui/index.d.ts CHANGED
@@ -8,7 +8,7 @@ export declare function uiLink(linkText: string, url: string): string;
8
8
  export declare function uiAccountDescription(accountId?: number | null, bold?: boolean): string;
9
9
  export declare function uiInfoSection(title: string, logContent: () => void): void;
10
10
  export declare function uiCommandReference(command: string, withQuotes?: boolean): string;
11
- export declare function uiFeatureHighlight(commands: string[], title?: string): void;
11
+ export declare function uiFeatureHighlight(features: string[], title?: string): void;
12
12
  export declare function uiBetaTag(message: string, log?: boolean): string | undefined;
13
13
  export declare function uiDeprecatedTag(message: string): void;
14
14
  export declare function uiCommandDisabledBanner(command: string, url?: string, message?: string): void;
package/lib/ui/index.js CHANGED
@@ -77,14 +77,14 @@ function uiCommandReference(command, withQuotes = true) {
77
77
  ? chalk_1.default.hex(exports.UI_COLORS.MARIGOLD_DARK)(commandReference)
78
78
  : commandReference);
79
79
  }
80
- function uiFeatureHighlight(commands, title) {
80
+ function uiFeatureHighlight(features, title) {
81
81
  const i18nKey = 'lib.ui.featureHighlight';
82
82
  uiInfoSection(title ? title : (0, lang_1.i18n)(`${i18nKey}.defaultTitle`), () => {
83
- commands.forEach((c, i) => {
84
- const commandKey = `${i18nKey}.commandKeys.${c}`;
85
- const message = (0, lang_1.i18n)(`${commandKey}.message`, {
86
- command: uiCommandReference((0, lang_1.i18n)(`${commandKey}.command`)),
87
- link: uiLink((0, lang_1.i18n)(`${commandKey}.linkText`), (0, lang_1.i18n)(`${commandKey}.url`)),
83
+ features.forEach((c, i) => {
84
+ const featureKey = `${i18nKey}.featureKeys.${c}`;
85
+ const message = (0, lang_1.i18n)(`${featureKey}.message`, {
86
+ command: uiCommandReference((0, lang_1.i18n)(`${featureKey}.command`)),
87
+ link: uiLink((0, lang_1.i18n)(`${featureKey}.linkText`), (0, lang_1.i18n)(`${featureKey}.url`)),
88
88
  });
89
89
  if (i !== 0) {
90
90
  logger_1.logger.log('');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubspot/cli",
3
- "version": "7.2.0",
3
+ "version": "7.2.1-beta.0",
4
4
  "description": "The official CLI for developing on HubSpot",
5
5
  "license": "Apache-2.0",
6
6
  "repository": "https://github.com/HubSpot/hubspot-cli",
@@ -9,7 +9,7 @@
9
9
  "@hubspot/project-parsing-lib": "0.1.1",
10
10
  "@hubspot/serverless-dev-runtime": "7.0.2",
11
11
  "@hubspot/theme-preview-dev-server": "0.0.10",
12
- "@hubspot/ui-extensions-dev-server": "0.8.48",
12
+ "@hubspot/ui-extensions-dev-server": "0.8.50",
13
13
  "archiver": "7.0.1",
14
14
  "chalk": "4.1.2",
15
15
  "chokidar": "3.6.0",