Skip to content

Commit

Permalink
feat!: Restructure theme commands to match new design guidelines
Browse files Browse the repository at this point in the history
  • Loading branch information
joe-yeager committed Nov 22, 2024
1 parent c34a566 commit d38c611
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion commands/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const { i18n } = require('../lib/lang');

const i18nKey = 'commands.theme';

exports.command = 'theme';
exports.command = ['theme', 'themes'];
exports.describe = i18n(`${i18nKey}.describe`);

exports.builder = yargs => {
Expand Down
6 changes: 3 additions & 3 deletions commands/theme/generate-selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const THEME_PATH_REGEX = new RegExp(/=\s*.*(theme\.(\w|\.)*)/, 'i');

const i18nKey = 'commands.theme.subcommands.generateSelectors';

exports.command = 'generate-selectors <themePath>';
exports.command = 'generate-selectors <path>';
exports.describe = i18n(`${i18nKey}.describe`);

exports.handler = options => {
Expand Down Expand Up @@ -206,8 +206,8 @@ exports.handler = options => {
};

exports.builder = yargs => {
yargs.positional('themePath', {
describe: i18n(`${i18nKey}.positionals.themePath.describe`),
yargs.positional('path', {
describe: i18n(`${i18nKey}.positionals.path.describe`),
type: 'string',
});

Expand Down
6 changes: 3 additions & 3 deletions commands/theme/marketplace-validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const { i18n } = require('../../lib/lang');

const i18nKey = 'commands.theme.subcommands.marketplaceValidate';

exports.command = 'marketplace-validate <src>';
exports.command = 'marketplace-validate <path>';
exports.describe = i18n(`${i18nKey}.describe`);

exports.handler = async options => {
Expand Down Expand Up @@ -61,8 +61,8 @@ exports.builder = yargs => {
addAccountOptions(yargs);
addUseEnvironmentOptions(yargs);

yargs.positional('src', {
describe: i18n(`${i18nKey}.positionals.src.describe`),
yargs.positional('path', {
describe: i18n(`${i18nKey}.positionals.path.describe`),
type: 'string',
});
return yargs;
Expand Down
4 changes: 2 additions & 2 deletions commands/theme/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const { preview } = require('@hubspot/theme-preview-dev-server');
const { hasFeature } = require('../../lib/hasFeature');
const i18nKey = 'commands.theme.subcommands.preview';

exports.command = 'preview [--src] [--dest]';
exports.command = 'preview [--path] [--dest]';
exports.describe = i18n(`${i18nKey}.describe`);

const validateSrcPath = src => {
Expand Down Expand Up @@ -232,7 +232,7 @@ exports.builder = yargs => {
addConfigOptions(yargs);
addAccountOptions(yargs);

yargs.option('src', {
yargs.option('path', {
describe: i18n(`${i18nKey}.options.src.describe`),
type: 'string',
requiresArg: true,
Expand Down
10 changes: 5 additions & 5 deletions lang/en.lyaml
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ en:
update: "The secret \"{{ secretName }}\" was updated in the HubSpot account: {{ accountIdentifier }}"
updateExplanation: "Existing serverless functions will start using this new value within 10 seconds."
theme:
describe: "Commands for working with themes, including marketplace validation with the marketplace-validate subcommand."
describe: "Commands for managing themes."
subcommands:
generateSelectors:
describe: "Automatically generates an editor-preview.json file for the given theme. The selectors this command generates are not perfect, so please edit editor-preview.json after running."
Expand All @@ -855,10 +855,10 @@ en:
noSelectorsFound: "No selectors found."
success: "Selectors generated for {{ themePath }}, please double check the selectors generated at {{ selectorsPath }} before uploading the theme."
positionals:
themePath:
path:
describe: "The path of the theme you'd like to generate an editor-preview.json for."
marketplaceValidate:
describe: "Validate a theme for the marketplace"
describe: "Validate a theme for the marketplace."
errors:
invalidPath: "The path \"{{ path }}\" is not a path to a folder in the Design Manager"
logs:
Expand All @@ -871,10 +871,10 @@ en:
lineNumber: "Line number: {{ line }}"
noErrors: "No errors"
positionals:
src:
path:
describe: "Path to the theme within the Design Manager."
preview:
describe: "Upload and watch a theme directory on your computer for changes and start a local development server to preview theme changes on a site"
describe: "Upload and watch a theme directory on your computer for changes and start a local development server to preview theme changes on a site."
errors:
invalidPath: "The path \"{{ path }}\" is not a path to a directory"
noThemeComponents: "Your project has no theme components available to preview."
Expand Down

0 comments on commit d38c611

Please sign in to comment.