@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.
- package/bin/cli.js +96 -94
- package/commands/account/auth.js +51 -82
- package/commands/account.js +0 -2
- package/commands/app.js +0 -2
- package/commands/auth.js +2 -17
- package/commands/cms.js +0 -2
- package/commands/completion.js +0 -2
- package/commands/config/migrate.js +17 -36
- package/commands/config.js +0 -2
- package/commands/create.js +0 -2
- package/commands/customObject.js +0 -2
- package/commands/doctor.js +0 -2
- package/commands/feedback.js +0 -2
- package/commands/filemanager.js +0 -2
- package/commands/function.js +0 -2
- package/commands/hubdb.js +0 -2
- package/commands/init.js +1 -4
- package/commands/lint.js +0 -2
- package/commands/list.js +0 -2
- package/commands/module/marketplace-validate.js +6 -8
- package/commands/module.js +2 -1
- package/commands/mv.js +0 -2
- package/commands/open.js +0 -2
- package/commands/project/add.d.ts +5 -2
- package/commands/project/add.js +43 -80
- package/commands/project/create.d.ts +2 -8
- package/commands/project/create.js +84 -55
- package/commands/project/dev/deprecatedFlow.d.ts +8 -2
- package/commands/project/dev/deprecatedFlow.js +9 -1
- package/commands/project/dev/index.js +59 -34
- package/commands/project/dev/unifiedFlow.d.ts +10 -2
- package/commands/project/dev/unifiedFlow.js +28 -41
- package/commands/project.js +0 -2
- package/commands/remove.js +6 -14
- package/commands/sandbox.js +0 -2
- package/commands/secret.js +0 -2
- package/commands/theme/generate-selectors.js +7 -10
- package/commands/theme/marketplace-validate.js +6 -8
- package/commands/theme/preview.js +17 -18
- package/commands/theme.js +2 -4
- package/commands/upload.js +26 -65
- package/commands/watch.js +20 -32
- package/lang/en.d.ts +154 -95
- package/lang/en.js +156 -100
- package/lang/en.lyaml +3 -186
- package/lib/accountTypes.js +1 -3
- package/lib/commonOpts.d.ts +1 -3
- package/lib/commonOpts.js +1 -1
- package/lib/configMigrate.d.ts +2 -2
- package/lib/configMigrate.js +34 -69
- package/lib/constants.d.ts +23 -5
- package/lib/constants.js +24 -6
- package/lib/generateSelectors.js +3 -5
- package/lib/marketplaceValidate.d.ts +12 -2
- package/lib/marketplaceValidate.js +22 -29
- package/lib/middleware/configMiddleware.js +1 -0
- package/lib/middleware/fireAlarmMiddleware.d.ts +2 -2
- package/lib/middleware/fireAlarmMiddleware.js +5 -3
- package/lib/projects/add/legacyAddComponent.d.ts +5 -0
- package/lib/projects/add/legacyAddComponent.js +48 -0
- package/lib/projects/add/v3AddComponent.d.ts +8 -0
- package/lib/projects/add/v3AddComponent.js +85 -0
- package/lib/projects/components.d.ts +2 -0
- package/lib/projects/components.js +82 -0
- package/lib/projects/create/index.d.ts +23 -0
- package/lib/projects/create/index.js +33 -0
- package/lib/projects/create/legacy.d.ts +6 -0
- package/lib/projects/{create.js → create/legacy.js} +20 -11
- package/lib/projects/create/v3.d.ts +27 -0
- package/lib/projects/create/v3.js +158 -0
- package/lib/projects/localDev/AppDevModeInterface.d.ts +3 -2
- package/lib/projects/localDev/AppDevModeInterface.js +38 -8
- package/lib/projects/localDev/LocalDevProcess.d.ts +12 -5
- package/lib/projects/localDev/LocalDevProcess.js +47 -17
- package/lib/projects/localDev/LocalDevState.d.ts +16 -3
- package/lib/projects/localDev/LocalDevState.js +43 -2
- package/lib/projects/localDev/LocalDevWatcher.js +3 -6
- package/lib/projects/localDev/LocalDevWebsocketServer.d.ts +3 -0
- package/lib/projects/localDev/LocalDevWebsocketServer.js +48 -9
- package/lib/projects/upload.js +6 -0
- package/lib/prompts/createProjectPrompt.d.ts +14 -5
- package/lib/prompts/createProjectPrompt.js +36 -13
- package/lib/prompts/projectAddPrompt.d.ts +5 -1
- package/lib/prompts/projectAddPrompt.js +35 -7
- package/lib/prompts/promptUtils.d.ts +0 -1
- package/lib/prompts/promptUtils.js +0 -2
- package/lib/prompts/setAsDefaultAccountPrompt.js +10 -0
- package/package.json +7 -6
- package/types/LocalDev.d.ts +11 -1
- package/types/Projects.d.ts +19 -2
- package/types/Yargs.d.ts +2 -0
- package/commands/testAccount/create.d.ts +0 -7
- package/commands/testAccount/create.js +0 -118
- package/commands/testAccount/delete.d.ts +0 -6
- package/commands/testAccount/delete.js +0 -42
- package/commands/testAccount.d.ts +0 -3
- package/commands/testAccount.js +0 -27
- package/lib/projects/create.d.ts +0 -5
package/lang/en.lyaml
CHANGED
|
@@ -20,19 +20,6 @@ en:
|
|
|
20
20
|
account:
|
|
21
21
|
describe: "Commands for managing configured accounts."
|
|
22
22
|
subcommands:
|
|
23
|
-
auth:
|
|
24
|
-
describe: "Configure authentication for your HubSpot account."
|
|
25
|
-
verboseDescribe: "Configure authentication for a HubSpot account. This will create or update the global config file at {{ globalConfigPath }} that stores your account information.\n\nThe recommended authentication method is {{#bold}}{{ authMethod }}{{/bold}}, which uses an access token tied to a specific user account.\nIf a deprecated config file exists, you will be prompted to migrate it to the new global config file. If both deprecated and global config files exist, you will be prompted to merge them. If any conflicts exist between the two files, you will be prompted to reconcile them."
|
|
26
|
-
options:
|
|
27
|
-
account:
|
|
28
|
-
describe: "HubSpot account to authenticate"
|
|
29
|
-
errors:
|
|
30
|
-
failedToUpdateConfig: "Failed to update the configuration file. Please try again."
|
|
31
|
-
migrationNotConfirmed: "Did not migrate. Use the {{ authCommand }} command to update the deprecated config at {{ deprecatedConfigPath }}."
|
|
32
|
-
mergeNotConfirmed: "Did not merge. When you are ready to merge the deprecated config file with the global config file, run the {{ authCommand }} or {{ migrateCommand }} command."
|
|
33
|
-
success:
|
|
34
|
-
configFileCreated: "Created config file \"{{ configPath }}\""
|
|
35
|
-
configFileUpdated: "Connected account \"{{ account }}\" and set it as the default account"
|
|
36
23
|
createOverride:
|
|
37
24
|
describe: "Create a new default account override file ({{ hsAccountFileName }}) in the current working directory."
|
|
38
25
|
success: "Default account override file created at {{ overrideFilePath }}"
|
|
@@ -156,7 +143,7 @@ en:
|
|
|
156
143
|
verboseDescribe: "Configure authentication for a HubSpot account. This will update the {{ configName }} file that stores your account information.\n\nThe recommended authentication method is {{#bold}}{{ authMethod }}{{/bold}}, which uses an access token tied to a specific user account."
|
|
157
144
|
errors:
|
|
158
145
|
unsupportedAuthType: "Unsupported auth type: {{ type }}. The only supported authentication protocols are {{ supportedProtocols }}."
|
|
159
|
-
globalConfigFileExists: "
|
|
146
|
+
globalConfigFileExists: "You are using our new global configuration for account management, which is not compatible with this command. Please use {{ accountAuthCommand }} instead."
|
|
160
147
|
options:
|
|
161
148
|
authType:
|
|
162
149
|
describe: "Authentication method"
|
|
@@ -167,17 +154,6 @@ en:
|
|
|
167
154
|
config:
|
|
168
155
|
describe: "Commands for managing the CLI config file."
|
|
169
156
|
subcommands:
|
|
170
|
-
migrate:
|
|
171
|
-
describe: "Migrate from the deprecated {{ deprecatedConfigPath }} file to the new global config file at {{ globalConfigPath }}."
|
|
172
|
-
verboseDescribe: "This command will create a new global configuration file in your root directory and rename the deprecated config to {{ archivedConfigPath }}. If any conflicting values are detected, we will prompt you to reconcile them unless the \"--force\" flag is supplied."
|
|
173
|
-
migrationAlreadyCompleted: "No {{ deprecatedConfigPath }} deprecated configuration file found. No migration necessary."
|
|
174
|
-
errors:
|
|
175
|
-
configNotFound: "A configuration file at {{ configPath }} could not be found. Please try again with a valid file path."
|
|
176
|
-
options:
|
|
177
|
-
force: "When merging a deprecated configuration file with an existing global configuration file, overwrite any conflicting values in the global config with the deprecated config values."
|
|
178
|
-
examples:
|
|
179
|
-
default: "Migrate from the deprecated {{ deprecatedConfigPath }} file to the new global config file at {{ globalConfigPath }}"
|
|
180
|
-
configFlag: "Migrate a specific config file (specified with the config flag) to the new global config file at {{ globalConfigPath }}"
|
|
181
157
|
set:
|
|
182
158
|
describe: "Set various configuration options within the hubspot.config.yml file."
|
|
183
159
|
promptMessage: "Select a config option to update"
|
|
@@ -532,7 +508,7 @@ en:
|
|
|
532
508
|
updateConfig: "To update an existing config file, use the \"hs auth\" command."
|
|
533
509
|
errors:
|
|
534
510
|
configFileExists: "The config file {{ configPath }} already exists."
|
|
535
|
-
globalConfigFileExists: "
|
|
511
|
+
globalConfigFileExists: "You are using our new global configuration for account management, which is not compatible with this command. Please use {{ accountAuthCommand }} instead."
|
|
536
512
|
lint:
|
|
537
513
|
issuesFound: "{{ count }} issues found."
|
|
538
514
|
groupName: "Linting {{ path }}"
|
|
@@ -874,14 +850,6 @@ en:
|
|
|
874
850
|
noProjectConfig: "No project detected. Run this command from a project directory."
|
|
875
851
|
noPackageJsonInProject: "No dependencies to install. The project {{ projectName }} folder might be missing component or subcomponent files. {{ link }}"
|
|
876
852
|
packageManagerNotInstalled: "This command depends on {{ packageManager }}, install {{#bold}}{{ link }}{{/bold}}"
|
|
877
|
-
remove:
|
|
878
|
-
describe: "Delete a file or folder from HubSpot."
|
|
879
|
-
deleted: "Deleted \"{{ path }}\" from account {{ accountId }}"
|
|
880
|
-
errors:
|
|
881
|
-
deleteFailed: "Deleting \"{{ path }}\" from account {{ accountId }} failed"
|
|
882
|
-
positionals:
|
|
883
|
-
path:
|
|
884
|
-
describe: "Remote hubspot path"
|
|
885
853
|
sandbox:
|
|
886
854
|
describe: "Commands for managing sandboxes."
|
|
887
855
|
subcommands:
|
|
@@ -979,144 +947,6 @@ en:
|
|
|
979
947
|
success:
|
|
980
948
|
update: "The secret \"{{ secretName }}\" was updated in the HubSpot account: {{ accountIdentifier }}"
|
|
981
949
|
updateExplanation: "Existing serverless functions will start using this new value within 10 seconds."
|
|
982
|
-
theme:
|
|
983
|
-
describe: "Commands for managing themes."
|
|
984
|
-
subcommands:
|
|
985
|
-
generateSelectors:
|
|
986
|
-
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."
|
|
987
|
-
errors:
|
|
988
|
-
invalidPath: "Could not find directory \"{{ themePath }}\""
|
|
989
|
-
fieldsNotFound: "Unable to find theme's fields.json."
|
|
990
|
-
noSelectorsFound: "No selectors found."
|
|
991
|
-
success: "Selectors generated for {{ themePath }}, please double check the selectors generated at {{ selectorsPath }} before uploading the theme."
|
|
992
|
-
positionals:
|
|
993
|
-
path:
|
|
994
|
-
describe: "The path of the theme you'd like to generate an editor-preview.json for."
|
|
995
|
-
marketplaceValidate:
|
|
996
|
-
describe: "Validate a theme for the marketplace."
|
|
997
|
-
errors:
|
|
998
|
-
invalidPath: "The path \"{{ path }}\" is not a path to a folder in the Design Manager"
|
|
999
|
-
logs:
|
|
1000
|
-
validatingTheme: "Validating theme \"{{ path }}\" \n"
|
|
1001
|
-
results:
|
|
1002
|
-
required: "Required validation results:"
|
|
1003
|
-
recommended: "Recommended validation results:"
|
|
1004
|
-
warnings:
|
|
1005
|
-
file: "File: {{ file }}"
|
|
1006
|
-
lineNumber: "Line number: {{ line }}"
|
|
1007
|
-
noErrors: "No errors"
|
|
1008
|
-
positionals:
|
|
1009
|
-
path:
|
|
1010
|
-
describe: "Path to the theme within the Design Manager."
|
|
1011
|
-
preview:
|
|
1012
|
-
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."
|
|
1013
|
-
errors:
|
|
1014
|
-
invalidPath: "The path \"{{ path }}\" is not a path to a directory"
|
|
1015
|
-
noThemeComponents: "Your project has no theme components available to preview."
|
|
1016
|
-
positionals:
|
|
1017
|
-
src:
|
|
1018
|
-
describe: "Path to the local directory your theme is in, relative to your current working directory"
|
|
1019
|
-
dest:
|
|
1020
|
-
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."
|
|
1021
|
-
options:
|
|
1022
|
-
notify:
|
|
1023
|
-
describe: "Log to specified file when a watch task is triggered and after workers have gone idle. Ex. --notify path/to/file"
|
|
1024
|
-
noSsl:
|
|
1025
|
-
describe: "Disable HTTPS"
|
|
1026
|
-
port:
|
|
1027
|
-
describe: "The port on which to start the local server"
|
|
1028
|
-
initialUploadProgressBar:
|
|
1029
|
-
start: "Starting..."
|
|
1030
|
-
uploading: "Uploading..."
|
|
1031
|
-
finish: "Complete!"
|
|
1032
|
-
logs:
|
|
1033
|
-
processExited: "Stopping dev server..."
|
|
1034
|
-
module:
|
|
1035
|
-
describe: "Commands for working with modules, including marketplace validation with the marketplace-validate subcommand."
|
|
1036
|
-
subcommands:
|
|
1037
|
-
marketplaceValidate:
|
|
1038
|
-
describe: "Validate a module for the marketplace. Make sure to include the suffix .module in the path to the module within the Design Manager."
|
|
1039
|
-
errors:
|
|
1040
|
-
invalidPath: "The path \"{{ path }}\" is not a path to a module within the Design Manager."
|
|
1041
|
-
logs:
|
|
1042
|
-
validatingModule: "Validating module \"{{ path }}\" \n"
|
|
1043
|
-
options:
|
|
1044
|
-
json:
|
|
1045
|
-
describe: "Output raw json data"
|
|
1046
|
-
results:
|
|
1047
|
-
required: "Required validation results:"
|
|
1048
|
-
recommended: "Recommended validation results:"
|
|
1049
|
-
warnings:
|
|
1050
|
-
file: "File: {{ file }}"
|
|
1051
|
-
lineNumber: "Line number: {{ line }}"
|
|
1052
|
-
noErrors: "No errors"
|
|
1053
|
-
positionals:
|
|
1054
|
-
src:
|
|
1055
|
-
describe: "Path to the module within the Design Manager."
|
|
1056
|
-
upload:
|
|
1057
|
-
describe: "Upload a folder or file from your computer to the HubSpot CMS."
|
|
1058
|
-
errors:
|
|
1059
|
-
destinationRequired: "A destination path needs to be passed"
|
|
1060
|
-
fileIgnored: "The file \"{{ path }}\" is being ignored via an .hsignore rule"
|
|
1061
|
-
invalidPath: "The path \"{{ path }}\" is not a path to a file or folder"
|
|
1062
|
-
uploadFailed: "Uploading file \"{{ src }}\" to \"{{ dest }}\" failed"
|
|
1063
|
-
someFilesFailed: "One or more files failed to upload to \"{{ dest }}\" in the Design Manager"
|
|
1064
|
-
deleteFailed: "Deleting \"{{ path }}\" from account {{ accountId }} failed"
|
|
1065
|
-
options:
|
|
1066
|
-
options:
|
|
1067
|
-
describe: "Options to pass to javascript fields files"
|
|
1068
|
-
saveOutput:
|
|
1069
|
-
describe: "If true, saves all output from javascript fields files as 'fields.output.json'."
|
|
1070
|
-
convertFields:
|
|
1071
|
-
describe: "If true, converts any javascript fields files contained in module folder or project root."
|
|
1072
|
-
clean:
|
|
1073
|
-
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."
|
|
1074
|
-
force:
|
|
1075
|
-
describe: "Skips confirmation prompts when doing a clean upload."
|
|
1076
|
-
previewUrl: "To preview this theme, visit: {{ previewUrl }}"
|
|
1077
|
-
positionals:
|
|
1078
|
-
src:
|
|
1079
|
-
describe: "Path to the local file, relative to your current working directory."
|
|
1080
|
-
dest:
|
|
1081
|
-
describe: "Path in HubSpot Design Tools, can be a net new path."
|
|
1082
|
-
success:
|
|
1083
|
-
fileUploaded: "Uploaded file from \"{{ src }}\" to \"{{ dest }}\" in the Design Manager of account {{ accountId }}"
|
|
1084
|
-
uploadComplete: "Uploading files to \"{{ dest }}\" in the Design Manager is complete"
|
|
1085
|
-
uploading: "Uploading files from \"{{ src }}\" to \"{{ dest }}\" in the Design Manager of account {{ accountId }}"
|
|
1086
|
-
notUploaded: "There was an error processing \"{{ src }}\". The file has not been uploaded."
|
|
1087
|
-
cleaning: "Removing \"{{ filePath }}\" from account {{ accountId }} and uploading local..."
|
|
1088
|
-
confirmCleanUpload: "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?"
|
|
1089
|
-
watch:
|
|
1090
|
-
describe: "Watch a directory on your computer for changes and upload the changed files to the HubSpot CMS."
|
|
1091
|
-
errors:
|
|
1092
|
-
folderFailed: "Initial uploading of folder \"{{ src }}\" to \"{{ dest }}\" in account {{ accountId }} had failures"
|
|
1093
|
-
fileFailed: "Upload of file \"{{ file }}\" to \"{{ dest }}\" in account {{ accountId }} failed"
|
|
1094
|
-
destinationRequired: "A destination directory needs to be passed"
|
|
1095
|
-
invalidPath: "The \"{{ path }}\" is not a path to a directory"
|
|
1096
|
-
options:
|
|
1097
|
-
disableInitial:
|
|
1098
|
-
describe: "Disable the initial upload when watching a directory (default)"
|
|
1099
|
-
initialUpload:
|
|
1100
|
-
describe: "Upload directory before watching for updates"
|
|
1101
|
-
notify:
|
|
1102
|
-
describe: "Log to specified file when a watch task is triggered and after workers have gone idle. Ex. --notify path/to/file"
|
|
1103
|
-
remove:
|
|
1104
|
-
describe: "Will cause watch to delete files in your HubSpot account that are not found locally."
|
|
1105
|
-
convertFields:
|
|
1106
|
-
describe: "If true, converts any javascript fields files contained in module folder or project root."
|
|
1107
|
-
saveOutput:
|
|
1108
|
-
describe: "If true, saves all output from javascript fields files as 'fields.output.json'."
|
|
1109
|
-
options:
|
|
1110
|
-
describe: "Options to pass to javascript fields files"
|
|
1111
|
-
positionals:
|
|
1112
|
-
src:
|
|
1113
|
-
describe: "Path to the local directory your files are in, relative to your current working directory"
|
|
1114
|
-
dest:
|
|
1115
|
-
describe: "Path in HubSpot Design Tools. Can be a net new path"
|
|
1116
|
-
warnings:
|
|
1117
|
-
disableInitial: "Passing the \"--disable-initial\" option is no longer necessary. Running \"hs watch\" no longer uploads the watched directory by default."
|
|
1118
|
-
initialUpload: "To upload the directory run \"hs upload\" beforehand or add the \"--initial-upload\" option when running \"hs watch\"."
|
|
1119
|
-
notUploaded: "The \"hs watch\" command no longer uploads the watched directory when started. The directory \"{{ path }}\" was not uploaded."
|
|
1120
950
|
convertFields:
|
|
1121
951
|
describe: "Converts a specific JavaScript fields file of a module or theme to JSON."
|
|
1122
952
|
positionals:
|
|
@@ -1203,7 +1033,7 @@ en:
|
|
|
1203
1033
|
errors:
|
|
1204
1034
|
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."
|
|
1205
1035
|
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."
|
|
1206
|
-
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\"
|
|
1036
|
+
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\"]."
|
|
1207
1037
|
validateProjectConfig:
|
|
1208
1038
|
configNotFound: "Unable to locate a project configuration file. Try running again from a project directory, or run {{ createCommand }} to create a new project."
|
|
1209
1039
|
configMissingFields: "The project configuration file is missing required fields."
|
|
@@ -1335,19 +1165,6 @@ en:
|
|
|
1335
1165
|
describe: "Use environment variable config"
|
|
1336
1166
|
debug:
|
|
1337
1167
|
describe: "Set log level to debug"
|
|
1338
|
-
configMigrate:
|
|
1339
|
-
migrationHeader: "Migrate your existing configuration file to the new global location?"
|
|
1340
|
-
migrationDescription: "This action will create a new global configuration file in your root directory and rename the deprecated config to {{ archivedConfigPath}}. If any conflicting values are detected, we will prompt you to reconcile them unless the \"--force\" flag is supplied."
|
|
1341
|
-
mergeHeader: "Merge your existing configuration file with the global config?"
|
|
1342
|
-
mergeDescription: "This action will merge your deprecated config file with the global config file located in your root directory. It will also rename the deprecated config to {{ archivedConfigPath }}. If any conflicting values are detected, we will prompt you to reconcile them unless the \"--force\" flag is supplied."
|
|
1343
|
-
migrateConfigPromptDescription: "From deprecated config file: {{ deprecatedConfigPath }}\nTo new global config file: {{ globalConfigPath }}"
|
|
1344
|
-
migrateConfigPrompt: "Migrate to the new config?"
|
|
1345
|
-
mergeConfigConflictPrompt: "Change the {{ property }} property in the global config from {{ newValue }} to {{ oldValue }}?"
|
|
1346
|
-
mergeConfigsPromptDescription: "Two config files detected. \nDeprecated config file: {{ deprecatedConfigPath }}\nGlobal config: {{ globalConfigPath }}"
|
|
1347
|
-
mergeConfigsPrompt: "Merge configs?"
|
|
1348
|
-
migrationSuccess: "The deprecated config file has been migrated to the new global config file at {{ globalConfigPath }}."
|
|
1349
|
-
mergeSuccess: "The deprecated config file has been merged with the global config file at {{ globalConfigPath }}."
|
|
1350
|
-
skippedExistingAccounts: "\nThe following accounts were not merged, because they already exist in the global config: {{ skippedAccountIds }}.\n"
|
|
1351
1168
|
prompts:
|
|
1352
1169
|
projectDevTargetAccountPrompt:
|
|
1353
1170
|
createNewSandboxOption: "<Test on a new development sandbox>"
|
package/lib/accountTypes.js
CHANGED
|
@@ -39,7 +39,5 @@ async function isUnifiedAccount(account) {
|
|
|
39
39
|
if (!accountId) {
|
|
40
40
|
return false;
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
return ((isStandardAccount(account) || isAppDeveloperAccount(account)) &&
|
|
44
|
-
isUngatedForUnifiedApps);
|
|
42
|
+
return (0, hasFeature_1.hasFeature)(accountId, constants_1.FEATURES.UNIFIED_APPS);
|
|
45
43
|
}
|
package/lib/commonOpts.d.ts
CHANGED
|
@@ -16,9 +16,7 @@ export declare function setLogLevel(options: Arguments<{
|
|
|
16
16
|
debug?: boolean;
|
|
17
17
|
networkDebug?: boolean;
|
|
18
18
|
}>): void;
|
|
19
|
-
export declare function getCommandName(argv: Arguments
|
|
20
|
-
_?: string[];
|
|
21
|
-
}>): string;
|
|
19
|
+
export declare function getCommandName(argv: Arguments): string;
|
|
22
20
|
export declare function getCmsPublishMode(options: Arguments<{
|
|
23
21
|
cmsPublishMode?: CmsPublishMode;
|
|
24
22
|
derivedAccountId?: number;
|
package/lib/commonOpts.js
CHANGED
|
@@ -138,7 +138,7 @@ function setLogLevel(options) {
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
function getCommandName(argv) {
|
|
141
|
-
return (argv && argv._ && argv._[0]) || '';
|
|
141
|
+
return String(argv && argv._ && argv._[0]) || '';
|
|
142
142
|
}
|
|
143
143
|
function getCmsPublishMode(options) {
|
|
144
144
|
// 1. --cmsPublishMode
|
package/lib/configMigrate.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function handleMigration(
|
|
2
|
-
export declare function handleMerge(
|
|
1
|
+
export declare function handleMigration(deprecatedConfigPath?: string, hideWarning?: boolean): Promise<boolean>;
|
|
2
|
+
export declare function handleMerge(deprecatedConfigPath?: string, force?: boolean, hideWarning?: boolean): Promise<boolean>;
|
package/lib/configMigrate.js
CHANGED
|
@@ -4,61 +4,44 @@ exports.handleMigration = handleMigration;
|
|
|
4
4
|
exports.handleMerge = handleMerge;
|
|
5
5
|
const migrate_1 = require("@hubspot/local-dev-lib/config/migrate");
|
|
6
6
|
const config_1 = require("@hubspot/local-dev-lib/constants/config");
|
|
7
|
-
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
8
7
|
const promptUtils_1 = require("./prompts/promptUtils");
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
async function handleMigration(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
logger_1.
|
|
18
|
-
logger_1.logger.log((0, lang_1.i18n)('lib.configMigrate.migrateConfigPromptDescription', {
|
|
19
|
-
deprecatedConfigPath: (0, migrate_1.getConfigPath)(configPath, false) ||
|
|
20
|
-
config_1.DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME,
|
|
21
|
-
globalConfigPath: config_1.GLOBAL_CONFIG_PATH,
|
|
22
|
-
}));
|
|
8
|
+
const en_1 = require("../lang/en");
|
|
9
|
+
const logger_1 = require("./ui/logger");
|
|
10
|
+
async function handleMigration(deprecatedConfigPath, hideWarning) {
|
|
11
|
+
if (!hideWarning) {
|
|
12
|
+
logger_1.uiLogger.warn(en_1.lib.configMigrate.deprecatedConfigWarning(deprecatedConfigPath || (0, migrate_1.getConfigPath)(undefined, false)));
|
|
13
|
+
logger_1.uiLogger.log('');
|
|
14
|
+
}
|
|
15
|
+
logger_1.uiLogger.log(en_1.lib.configMigrate.handleMigration.description(config_1.ARCHIVED_HUBSPOT_CONFIG_YAML_FILE_NAME));
|
|
16
|
+
logger_1.uiLogger.log('');
|
|
23
17
|
const { shouldMigrateConfig } = await (0, promptUtils_1.promptUser)({
|
|
24
18
|
name: 'shouldMigrateConfig',
|
|
25
19
|
type: 'confirm',
|
|
26
|
-
message:
|
|
20
|
+
message: en_1.lib.configMigrate.handleMigration.confirmPrompt,
|
|
27
21
|
});
|
|
28
22
|
if (!shouldMigrateConfig) {
|
|
29
|
-
(0, usageTracking_1.trackCommandMetadataUsage)('config-migrate', {
|
|
30
|
-
command: 'hs config migrate',
|
|
31
|
-
type: 'migration',
|
|
32
|
-
step: 'Reject migration via prompt',
|
|
33
|
-
}, accountId);
|
|
34
23
|
return false;
|
|
35
24
|
}
|
|
36
|
-
const deprecatedConfig = (0, migrate_1.getDeprecatedConfig)(
|
|
25
|
+
const deprecatedConfig = (0, migrate_1.getDeprecatedConfig)(deprecatedConfigPath);
|
|
37
26
|
(0, migrate_1.migrateConfig)(deprecatedConfig);
|
|
38
|
-
(
|
|
39
|
-
command: 'hs config migrate',
|
|
40
|
-
type: 'migration',
|
|
41
|
-
step: 'Confirm migration via prompt',
|
|
42
|
-
successful: true,
|
|
43
|
-
}, accountId);
|
|
44
|
-
logger_1.logger.success((0, lang_1.i18n)('lib.configMigrate.migrationSuccess', {
|
|
45
|
-
globalConfigPath: config_1.GLOBAL_CONFIG_PATH,
|
|
46
|
-
}));
|
|
27
|
+
logger_1.uiLogger.success(en_1.lib.configMigrate.handleMigration.success);
|
|
47
28
|
return true;
|
|
48
29
|
}
|
|
49
|
-
async function
|
|
30
|
+
async function handleMergeConfigProperties(globalConfig, deprecatedConfig, force) {
|
|
50
31
|
const { initialConfig, conflicts, } = (0, migrate_1.mergeConfigProperties)(globalConfig, deprecatedConfig, force);
|
|
51
32
|
if (conflicts.length > 0) {
|
|
33
|
+
const properties = conflicts.map(c => c.property);
|
|
34
|
+
const propertyList = properties.length <= 2
|
|
35
|
+
? properties.join(' and ')
|
|
36
|
+
: `${properties.slice(0, -1).join(', ')}, and ${properties.at(-1)}`;
|
|
37
|
+
logger_1.uiLogger.log('');
|
|
38
|
+
logger_1.uiLogger.warn(en_1.lib.configMigrate.handleMergeConfigProperties.mergeConflictMessage(conflicts.length, propertyList));
|
|
52
39
|
for (const conflict of conflicts) {
|
|
53
40
|
const { property, newValue, oldValue } = conflict;
|
|
54
41
|
const { shouldOverwrite } = await (0, promptUtils_1.promptUser)({
|
|
55
42
|
name: 'shouldOverwrite',
|
|
56
43
|
type: 'confirm',
|
|
57
|
-
message:
|
|
58
|
-
property,
|
|
59
|
-
oldValue: `${oldValue}`,
|
|
60
|
-
newValue: `${newValue}`,
|
|
61
|
-
}),
|
|
44
|
+
message: en_1.lib.configMigrate.handleMergeConfigProperties.mergeConfigConflictPrompt(property, newValue.toString(), oldValue.toString()),
|
|
62
45
|
});
|
|
63
46
|
if (shouldOverwrite) {
|
|
64
47
|
// @ts-expect-error Cannot reconcile CLIConfig_NEW and CLIConfig_DEPRECATED
|
|
@@ -68,51 +51,33 @@ async function mergeConfigProperties(globalConfig, deprecatedConfig, force) {
|
|
|
68
51
|
}
|
|
69
52
|
return initialConfig;
|
|
70
53
|
}
|
|
71
|
-
async function handleMerge(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
logger_1.
|
|
78
|
-
logger_1.logger.log((0, lang_1.i18n)('lib.configMigrate.mergeConfigsPromptDescription', {
|
|
79
|
-
deprecatedConfigPath: (0, migrate_1.getConfigPath)(configPath, false) ||
|
|
80
|
-
config_1.DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME,
|
|
81
|
-
globalConfigPath: config_1.GLOBAL_CONFIG_PATH,
|
|
82
|
-
}));
|
|
54
|
+
async function handleMerge(deprecatedConfigPath, force, hideWarning) {
|
|
55
|
+
if (!hideWarning) {
|
|
56
|
+
logger_1.uiLogger.warn(en_1.lib.configMigrate.deprecatedConfigWarning(deprecatedConfigPath || (0, migrate_1.getConfigPath)(undefined, false)));
|
|
57
|
+
logger_1.uiLogger.log('');
|
|
58
|
+
}
|
|
59
|
+
logger_1.uiLogger.log(en_1.lib.configMigrate.handleMerge.description(config_1.ARCHIVED_HUBSPOT_CONFIG_YAML_FILE_NAME));
|
|
60
|
+
logger_1.uiLogger.log('');
|
|
83
61
|
const { shouldMergeConfigs } = await (0, promptUtils_1.promptUser)({
|
|
84
62
|
name: 'shouldMergeConfigs',
|
|
85
63
|
type: 'confirm',
|
|
86
|
-
message:
|
|
64
|
+
message: en_1.lib.configMigrate.handleMerge.confirmPrompt,
|
|
87
65
|
});
|
|
88
66
|
if (!shouldMergeConfigs) {
|
|
89
|
-
(0, usageTracking_1.trackCommandMetadataUsage)('config-migrate', {
|
|
90
|
-
command: 'hs config migrate',
|
|
91
|
-
type: 'merge',
|
|
92
|
-
step: 'Reject merge via prompt',
|
|
93
|
-
}, accountId);
|
|
94
67
|
return false;
|
|
95
68
|
}
|
|
96
|
-
const deprecatedConfig = (0, migrate_1.getDeprecatedConfig)(
|
|
69
|
+
const deprecatedConfig = (0, migrate_1.getDeprecatedConfig)(deprecatedConfigPath);
|
|
97
70
|
const globalConfig = (0, migrate_1.getGlobalConfig)();
|
|
98
71
|
if (!deprecatedConfig || !globalConfig) {
|
|
99
72
|
return true;
|
|
100
73
|
}
|
|
101
|
-
const mergedConfig = await
|
|
74
|
+
const mergedConfig = await handleMergeConfigProperties(globalConfig, deprecatedConfig, force);
|
|
102
75
|
const { skippedAccountIds } = (0, migrate_1.mergeExistingConfigs)(mergedConfig, deprecatedConfig);
|
|
103
76
|
if (skippedAccountIds.length > 0) {
|
|
104
|
-
logger_1.
|
|
105
|
-
|
|
106
|
-
|
|
77
|
+
logger_1.uiLogger.log('');
|
|
78
|
+
logger_1.uiLogger.log(en_1.lib.configMigrate.handleMerge.skippedExistingAccounts(skippedAccountIds));
|
|
79
|
+
logger_1.uiLogger.log('');
|
|
107
80
|
}
|
|
108
|
-
logger_1.
|
|
109
|
-
globalConfigPath: config_1.GLOBAL_CONFIG_PATH,
|
|
110
|
-
}));
|
|
111
|
-
(0, usageTracking_1.trackCommandMetadataUsage)('config-migrate', {
|
|
112
|
-
command: 'hs config migrate',
|
|
113
|
-
type: 'merge',
|
|
114
|
-
step: 'Confirm merge via prompt',
|
|
115
|
-
successful: true,
|
|
116
|
-
}, accountId);
|
|
81
|
+
logger_1.uiLogger.success(en_1.lib.configMigrate.handleMerge.success);
|
|
117
82
|
return true;
|
|
118
83
|
}
|
package/lib/constants.d.ts
CHANGED
|
@@ -78,9 +78,27 @@ export declare const FEATURES: {
|
|
|
78
78
|
readonly UNIFIED_THEME_PREVIEW: "cms:react:unifiedThemePreview";
|
|
79
79
|
readonly UNIFIED_APPS: "Developers:UnifiedApps:PrivateBeta";
|
|
80
80
|
};
|
|
81
|
-
export declare const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
81
|
+
export declare const LOCAL_DEV_UI_MESSAGE_SEND_TYPES: {
|
|
82
|
+
UPLOAD_SUCCESS: string;
|
|
83
|
+
UPLOAD_FAILURE: string;
|
|
84
|
+
UPDATE_PROJECT_NODES: string;
|
|
85
|
+
UPDATE_APP_DATA: string;
|
|
86
|
+
UPDATE_PROJECT_DATA: string;
|
|
87
|
+
};
|
|
88
|
+
export declare const LOCAL_DEV_UI_MESSAGE_RECEIVE_TYPES: {
|
|
89
|
+
UPLOAD: string;
|
|
90
|
+
};
|
|
91
|
+
export declare const APP_INSTALLATION_STATES: {
|
|
92
|
+
readonly NOT_INSTALLED: "NOT_INSTALLED";
|
|
93
|
+
readonly INSTALLED: "INSTALLED";
|
|
94
|
+
readonly INSTALLED_WITH_OUTDATED_SCOPES: "INSTALLED_WITH_OUTDATED_SCOPES";
|
|
95
|
+
};
|
|
96
|
+
export declare const staticAuth = "static";
|
|
97
|
+
export declare const oAuth = "oauth";
|
|
98
|
+
export declare const privateDistribution = "private";
|
|
99
|
+
export declare const marketplaceDistribution = "marketplace";
|
|
100
|
+
export declare const appComponent = "app";
|
|
101
|
+
export declare const LOCAL_DEV_SERVER_MESSAGE_TYPES: {
|
|
102
|
+
readonly INITIAL: "INITIAL";
|
|
103
|
+
readonly WEBSOCKET_SERVER_CONNECTED: "WEBSOCKET_SERVER_CONNECTED";
|
|
86
104
|
};
|
package/lib/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.LOCAL_DEV_SERVER_MESSAGE_TYPES = exports.appComponent = exports.marketplaceDistribution = exports.privateDistribution = exports.oAuth = exports.staticAuth = exports.APP_INSTALLATION_STATES = exports.LOCAL_DEV_UI_MESSAGE_RECEIVE_TYPES = exports.LOCAL_DEV_UI_MESSAGE_SEND_TYPES = exports.FEATURES = exports.APP_AUTH_TYPES = exports.APP_DISTRIBUTION_TYPES = exports.IR_COMPONENT_TYPES = exports.PLATFORM_VERSION_ERROR_TYPES = exports.PROJECT_COMPONENT_TYPES = exports.PROJECT_TASK_TYPES = exports.PROJECT_ERROR_TYPES = exports.PROJECT_DEPLOY_TEXT = exports.PROJECT_BUILD_TEXT = exports.PROJECT_DEPLOY_STATES = exports.PROJECT_BUILD_STATES = exports.PROJECT_CONFIG_FILE = exports.DEFAULT_POLLING_DELAY = exports.MARKETPLACE_FOLDER = exports.HUBSPOT_FOLDER = exports.FEEDBACK_INTERVAL = exports.DEFAULT_PROJECT_TEMPLATE_BRANCH = exports.HUBSPOT_PROJECT_COMPONENTS_GITHUB_PATH = void 0;
|
|
4
4
|
exports.HUBSPOT_PROJECT_COMPONENTS_GITHUB_PATH = 'HubSpot/hubspot-project-components';
|
|
5
5
|
exports.DEFAULT_PROJECT_TEMPLATE_BRANCH = 'main';
|
|
6
6
|
exports.FEEDBACK_INTERVAL = 10;
|
|
@@ -73,9 +73,27 @@ exports.FEATURES = {
|
|
|
73
73
|
UNIFIED_THEME_PREVIEW: 'cms:react:unifiedThemePreview',
|
|
74
74
|
UNIFIED_APPS: 'Developers:UnifiedApps:PrivateBeta',
|
|
75
75
|
};
|
|
76
|
-
exports.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
76
|
+
exports.LOCAL_DEV_UI_MESSAGE_SEND_TYPES = {
|
|
77
|
+
UPLOAD_SUCCESS: 'server:uploadSuccess',
|
|
78
|
+
UPLOAD_FAILURE: 'server:uploadFailure',
|
|
79
|
+
UPDATE_PROJECT_NODES: 'server:updateProjectNodes',
|
|
80
|
+
UPDATE_APP_DATA: 'server:updateAppData',
|
|
81
|
+
UPDATE_PROJECT_DATA: 'server:updateProjectData',
|
|
82
|
+
};
|
|
83
|
+
exports.LOCAL_DEV_UI_MESSAGE_RECEIVE_TYPES = {
|
|
84
|
+
UPLOAD: 'client:upload',
|
|
85
|
+
};
|
|
86
|
+
exports.APP_INSTALLATION_STATES = {
|
|
87
|
+
NOT_INSTALLED: 'NOT_INSTALLED',
|
|
88
|
+
INSTALLED: 'INSTALLED',
|
|
89
|
+
INSTALLED_WITH_OUTDATED_SCOPES: 'INSTALLED_WITH_OUTDATED_SCOPES',
|
|
90
|
+
};
|
|
91
|
+
exports.staticAuth = 'static';
|
|
92
|
+
exports.oAuth = 'oauth';
|
|
93
|
+
exports.privateDistribution = 'private';
|
|
94
|
+
exports.marketplaceDistribution = 'marketplace';
|
|
95
|
+
exports.appComponent = 'app';
|
|
96
|
+
exports.LOCAL_DEV_SERVER_MESSAGE_TYPES = {
|
|
97
|
+
INITIAL: 'INITIAL',
|
|
98
|
+
WEBSOCKET_SERVER_CONNECTED: 'WEBSOCKET_SERVER_CONNECTED',
|
|
81
99
|
};
|
package/lib/generateSelectors.js
CHANGED
|
@@ -10,9 +10,9 @@ exports.setPreviewSelectors = setPreviewSelectors;
|
|
|
10
10
|
exports.generateInheritedSelectors = generateInheritedSelectors;
|
|
11
11
|
exports.generateSelectorsMap = generateSelectorsMap;
|
|
12
12
|
const fs_1 = __importDefault(require("fs"));
|
|
13
|
-
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
14
13
|
const exitCodes_1 = require("./enums/exitCodes");
|
|
15
|
-
const
|
|
14
|
+
const en_1 = require("../lang/en");
|
|
15
|
+
const logger_1 = require("./ui/logger");
|
|
16
16
|
const CSS_COMMENTS_REGEX = new RegExp(/\/\*.*\*\//, 'g');
|
|
17
17
|
const CSS_PSEUDO_CLASS_REGEX = new RegExp(/:active|:checked|:disabled|:empty|:enabled|:first-of-type|:focus|:hover|:in-range|:invalid|:link|:optional|:out-of-range|:read-only|:read-write|:required|:target|:valid|:visited/, 'g');
|
|
18
18
|
let maxFieldsDepth = 0;
|
|
@@ -22,9 +22,7 @@ function getMaxFieldsDepth() {
|
|
|
22
22
|
function findFieldsJsonPath(basePath) {
|
|
23
23
|
const _path = basePath.endsWith('/') ? basePath.slice(0, -1) : basePath;
|
|
24
24
|
if (!fs_1.default.existsSync(_path)) {
|
|
25
|
-
logger_1.
|
|
26
|
-
themePath: basePath,
|
|
27
|
-
}));
|
|
25
|
+
logger_1.uiLogger.error(en_1.commands.theme.subcommands.generateSelectors.errors.invalidPath(basePath));
|
|
28
26
|
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
29
27
|
}
|
|
30
28
|
const files = fs_1.default.readdirSync(_path);
|
|
@@ -2,5 +2,15 @@ import { GetValidationResultsResponse } from '@hubspot/local-dev-lib/types/Marke
|
|
|
2
2
|
export declare function kickOffValidation(accountId: number, assetType: string, src: string): Promise<number>;
|
|
3
3
|
export declare function pollForValidationFinish(accountId: number, validationId: number): Promise<void>;
|
|
4
4
|
export declare function fetchValidationResults(accountId: number, validationId: number): Promise<GetValidationResultsResponse>;
|
|
5
|
-
export declare function processValidationErrors(
|
|
6
|
-
|
|
5
|
+
export declare function processValidationErrors(invalidPathError: (path: string) => string, validationResults: GetValidationResultsResponse): void;
|
|
6
|
+
type ResultsCopy = {
|
|
7
|
+
noErrors: string;
|
|
8
|
+
required: string;
|
|
9
|
+
recommended: string;
|
|
10
|
+
warnings: {
|
|
11
|
+
file: (file: string) => string;
|
|
12
|
+
lineNumber: (line: string) => string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare function displayValidationResults(resultsCopy: ResultsCopy, validationResults: GetValidationResultsResponse): void;
|
|
16
|
+
export {};
|