@hubspot/cli 7.2.0-experimental.0 → 7.2.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 +52 -3
- package/commands/account/auth.d.ts +10 -0
- package/commands/account/auth.js +154 -0
- package/commands/account/createOverride.d.ts +10 -0
- package/commands/account/createOverride.js +62 -0
- package/commands/account/list.js +4 -0
- package/commands/account.js +4 -0
- package/commands/auth.js +9 -5
- package/commands/config/migrate.d.ts +10 -0
- package/commands/config/migrate.js +86 -0
- package/commands/config/set.d.ts +12 -0
- package/commands/config/set.js +30 -29
- package/commands/config.d.ts +4 -1
- package/commands/config.js +45 -10
- package/commands/create/api-sample.js +4 -14
- package/commands/customObject/create.d.ts +0 -11
- package/commands/customObject/create.js +28 -37
- package/commands/customObject/schema/create.d.ts +0 -10
- package/commands/customObject/schema/create.js +42 -40
- package/commands/customObject/schema/delete.d.ts +0 -11
- package/commands/customObject/schema/delete.js +27 -34
- package/commands/customObject/schema/fetch-all.d.ts +0 -10
- package/commands/customObject/schema/fetch-all.js +24 -31
- package/commands/customObject/schema/fetch.d.ts +0 -11
- package/commands/customObject/schema/fetch.js +42 -34
- package/commands/customObject/schema/list.d.ts +0 -7
- package/commands/customObject/schema/list.js +14 -23
- package/commands/customObject/schema/update.d.ts +0 -11
- package/commands/customObject/schema/update.js +46 -44
- package/commands/customObject/schema.d.ts +1 -5
- package/commands/customObject/schema.js +11 -49
- package/commands/customObject.d.ts +1 -4
- package/commands/customObject.js +21 -54
- package/commands/filemanager/fetch.d.ts +0 -12
- package/commands/filemanager/fetch.js +30 -33
- package/commands/filemanager/upload.d.ts +0 -11
- package/commands/filemanager/upload.js +47 -53
- package/commands/filemanager.d.ts +1 -4
- package/commands/filemanager.js +7 -41
- package/commands/init.js +15 -26
- package/commands/project/add.js +16 -62
- package/commands/project/cloneApp.js +3 -3
- package/commands/project/create.js +15 -70
- package/commands/project/dev.d.ts +0 -7
- package/commands/project/dev.js +75 -96
- package/commands/project/migrateApp.js +3 -3
- package/commands/project/upload.js +2 -7
- package/commands/sandbox/create.d.ts +0 -12
- package/commands/sandbox/create.js +72 -90
- package/commands/sandbox/delete.d.ts +0 -11
- package/commands/sandbox/delete.js +95 -112
- package/commands/sandbox.d.ts +1 -4
- package/commands/sandbox.js +10 -44
- package/commands/theme/generate-selectors.d.ts +0 -9
- package/commands/theme/generate-selectors.js +43 -61
- package/commands/theme/marketplace-validate.d.ts +0 -10
- package/commands/theme/marketplace-validate.js +26 -32
- package/commands/theme/preview.d.ts +0 -16
- package/commands/theme/preview.js +97 -104
- package/commands/theme.d.ts +1 -4
- package/commands/theme.js +10 -44
- package/lang/en.lyaml +67 -39
- package/lib/LocalDevManager.d.ts +2 -2
- package/lib/buildAccount.d.ts +3 -2
- package/lib/configMigrate.d.ts +2 -0
- package/lib/configMigrate.js +83 -0
- package/lib/constants.d.ts +3 -0
- package/lib/constants.js +4 -1
- package/lib/doctor/Diagnosis.d.ts +1 -0
- package/lib/doctor/Diagnosis.js +7 -0
- package/lib/doctor/DiagnosticInfoBuilder.d.ts +1 -6
- package/lib/doctor/DiagnosticInfoBuilder.js +1 -5
- package/lib/doctor/Doctor.d.ts +1 -1
- package/lib/doctor/Doctor.js +14 -6
- package/lib/localDev.d.ts +1 -2
- package/lib/marketplaceValidate.d.ts +2 -2
- package/lib/projects/buildAndDeploy.js +1 -4
- package/lib/projects/index.d.ts +5 -1
- package/lib/projects/index.js +62 -1
- package/lib/projects/upload.d.ts +1 -1
- package/lib/projects/upload.js +2 -2
- package/lib/prompts/accountNamePrompt.d.ts +1 -1
- package/lib/prompts/createProjectPrompt.d.ts +8 -6
- package/lib/prompts/createProjectPrompt.js +54 -26
- package/lib/prompts/projectAddPrompt.d.ts +3 -3
- package/lib/prompts/projectAddPrompt.js +6 -16
- package/lib/prompts/projectDevTargetAccountPrompt.d.ts +2 -3
- package/lib/prompts/sandboxesPrompt.d.ts +2 -3
- package/lib/prompts/sandboxesPrompt.js +1 -1
- package/lib/sandboxSync.js +2 -6
- package/lib/sandboxes.d.ts +5 -2
- package/lib/ui/index.d.ts +1 -1
- package/lib/ui/index.js +0 -1
- package/lib/upload.d.ts +1 -1
- package/lib/upload.js +20 -20
- package/lib/usageTracking.d.ts +1 -1
- package/lib/validation.d.ts +1 -1
- package/package.json +3 -4
- package/types/Projects.d.ts +6 -1
- package/types/Prompts.d.ts +0 -7
- package/types/Sandboxes.d.ts +0 -2
- package/types/Yargs.d.ts +0 -7
- package/lib/customObject.d.ts +0 -3
- package/lib/customObject.js +0 -15
- package/lib/projects/create.d.ts +0 -5
- package/lib/projects/create.js +0 -51
- package/lib/testUtils.d.ts +0 -12
- package/lib/testUtils.js +0 -10
|
@@ -1,45 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const marketplaceValidate_1 = require("../../lib/marketplaceValidate");
|
|
13
|
-
const lang_1 = require("../../lib/lang");
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
const SpinniesManager = require('../../lib/ui/SpinniesManager');
|
|
5
|
+
const { addConfigOptions, addAccountOptions, addUseEnvironmentOptions, } = require('../../lib/commonOpts');
|
|
6
|
+
const { trackCommandUsage } = require('../../lib/usageTracking');
|
|
7
|
+
const { kickOffValidation, pollForValidationFinish, fetchValidationResults, processValidationErrors, displayValidationResults, } = require('../../lib/marketplaceValidate');
|
|
8
|
+
const { i18n } = require('../../lib/lang');
|
|
14
9
|
const i18nKey = 'commands.theme.subcommands.marketplaceValidate';
|
|
15
10
|
exports.command = 'marketplace-validate <path>';
|
|
16
|
-
exports.describe =
|
|
17
|
-
async
|
|
18
|
-
const { path, derivedAccountId } =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
text:
|
|
11
|
+
exports.describe = i18n(`${i18nKey}.describe`);
|
|
12
|
+
exports.handler = async (options) => {
|
|
13
|
+
const { path, derivedAccountId } = options;
|
|
14
|
+
trackCommandUsage('validate', null, derivedAccountId);
|
|
15
|
+
SpinniesManager.init();
|
|
16
|
+
SpinniesManager.add('marketplaceValidation', {
|
|
17
|
+
text: i18n(`${i18nKey}.logs.validatingTheme`, {
|
|
23
18
|
path,
|
|
24
19
|
}),
|
|
25
20
|
});
|
|
26
21
|
const assetType = 'THEME';
|
|
27
|
-
const validationId = await
|
|
28
|
-
await
|
|
29
|
-
|
|
30
|
-
const validationResults = await
|
|
31
|
-
|
|
32
|
-
|
|
22
|
+
const validationId = await kickOffValidation(derivedAccountId, assetType, path);
|
|
23
|
+
await pollForValidationFinish(derivedAccountId, validationId);
|
|
24
|
+
SpinniesManager.remove('marketplaceValidation');
|
|
25
|
+
const validationResults = await fetchValidationResults(derivedAccountId, validationId);
|
|
26
|
+
processValidationErrors(i18nKey, validationResults);
|
|
27
|
+
displayValidationResults(i18nKey, validationResults);
|
|
33
28
|
process.exit();
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
29
|
+
};
|
|
30
|
+
exports.builder = yargs => {
|
|
31
|
+
addConfigOptions(yargs);
|
|
32
|
+
addAccountOptions(yargs);
|
|
33
|
+
addUseEnvironmentOptions(yargs);
|
|
39
34
|
yargs.positional('path', {
|
|
40
|
-
describe:
|
|
35
|
+
describe: i18n(`${i18nKey}.positionals.path.describe`),
|
|
41
36
|
type: 'string',
|
|
42
|
-
required: true,
|
|
43
37
|
});
|
|
44
38
|
return yargs;
|
|
45
|
-
}
|
|
39
|
+
};
|
|
@@ -1,17 +1 @@
|
|
|
1
|
-
import { Argv, ArgumentsCamelCase } from 'yargs';
|
|
2
|
-
import { CommonArgs, ConfigArgs, AccountArgs } from '../../types/Yargs';
|
|
3
|
-
export declare const command = "preview [--src] [--dest]";
|
|
4
|
-
export declare const describe: string;
|
|
5
|
-
type CombinedArgs = CommonArgs & ConfigArgs & AccountArgs;
|
|
6
|
-
type ThemePreviewArgs = CombinedArgs & {
|
|
7
|
-
src: string;
|
|
8
|
-
dest: string;
|
|
9
|
-
notify: string;
|
|
10
|
-
'no-ssl'?: boolean;
|
|
11
|
-
port?: number;
|
|
12
|
-
resetSession?: boolean;
|
|
13
|
-
generateFieldsTypes?: boolean;
|
|
14
|
-
};
|
|
15
|
-
export declare function handler(args: ArgumentsCamelCase<ThemePreviewArgs>): Promise<void>;
|
|
16
|
-
export declare function builder(yargs: Argv): Argv<ThemePreviewArgs>;
|
|
17
1
|
export {};
|
|
@@ -1,42 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const Projects_1 = require("../../types/Projects");
|
|
28
|
-
const hasFeature_1 = require("../../lib/hasFeature");
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
const { i18n } = require('../../lib/lang');
|
|
7
|
+
const { logger } = require('@hubspot/local-dev-lib/logger');
|
|
8
|
+
const { addAccountOptions, addConfigOptions } = require('../../lib/commonOpts');
|
|
9
|
+
const { getCwd } = require('@hubspot/local-dev-lib/path');
|
|
10
|
+
const { getUploadableFileList } = require('../../lib/upload');
|
|
11
|
+
const { trackCommandUsage } = require('../../lib/usageTracking');
|
|
12
|
+
const { previewPrompt, previewProjectPrompt, } = require('../../lib/prompts/previewPrompt');
|
|
13
|
+
const { EXIT_CODES } = require('../../lib/enums/exitCodes');
|
|
14
|
+
const { FILE_UPLOAD_RESULT_TYPES, } = require('@hubspot/local-dev-lib/constants/files');
|
|
15
|
+
const cliProgress = require('cli-progress');
|
|
16
|
+
const { ApiErrorContext, logError } = require('../../lib/errorHandlers/index');
|
|
17
|
+
const { handleExit, handleKeypress } = require('../../lib/process');
|
|
18
|
+
const { getThemeJSONPath } = require('@hubspot/local-dev-lib/cms/themes');
|
|
19
|
+
const { getProjectConfig } = require('../../lib/projects');
|
|
20
|
+
const { findProjectComponents } = require('../../lib/projects/structure');
|
|
21
|
+
const { ComponentTypes } = require('../../types/Projects');
|
|
22
|
+
const { preview } = require('@hubspot/theme-preview-dev-server');
|
|
23
|
+
const { hasFeature } = require('../../lib/hasFeature');
|
|
29
24
|
const i18nKey = 'commands.theme.subcommands.preview';
|
|
30
25
|
exports.command = 'preview [--src] [--dest]';
|
|
31
|
-
exports.describe =
|
|
32
|
-
|
|
26
|
+
exports.describe = i18n(`${i18nKey}.describe`);
|
|
27
|
+
const validateSrcPath = src => {
|
|
33
28
|
const logInvalidPath = () => {
|
|
34
|
-
|
|
29
|
+
logger.error(i18n(`${i18nKey}.errors.invalidPath`, {
|
|
35
30
|
path: src,
|
|
36
31
|
}));
|
|
37
32
|
};
|
|
38
33
|
try {
|
|
39
|
-
const stats =
|
|
34
|
+
const stats = fs.statSync(src);
|
|
40
35
|
if (!stats.isDirectory()) {
|
|
41
36
|
logInvalidPath();
|
|
42
37
|
return false;
|
|
@@ -47,65 +42,65 @@ function validateSrcPath(src) {
|
|
|
47
42
|
return false;
|
|
48
43
|
}
|
|
49
44
|
return true;
|
|
50
|
-
}
|
|
51
|
-
|
|
45
|
+
};
|
|
46
|
+
const handleUserInput = () => {
|
|
52
47
|
const onTerminate = () => {
|
|
53
|
-
|
|
54
|
-
process.exit(
|
|
48
|
+
logger.log(i18n(`${i18nKey}.logs.processExited`));
|
|
49
|
+
process.exit(EXIT_CODES.SUCCESS);
|
|
55
50
|
};
|
|
56
|
-
|
|
57
|
-
|
|
51
|
+
handleExit(onTerminate);
|
|
52
|
+
handleKeypress(key => {
|
|
58
53
|
if ((key.ctrl && key.name === 'c') || key.name === 'q') {
|
|
59
54
|
onTerminate();
|
|
60
55
|
}
|
|
61
56
|
});
|
|
62
|
-
}
|
|
63
|
-
async
|
|
57
|
+
};
|
|
58
|
+
const determineSrcAndDest = async (options) => {
|
|
64
59
|
let absoluteSrc;
|
|
65
60
|
let dest;
|
|
66
|
-
const { projectDir, projectConfig } = await
|
|
61
|
+
const { projectDir, projectConfig } = await getProjectConfig();
|
|
67
62
|
if (!(projectDir && projectConfig)) {
|
|
68
63
|
// Not in a project, prompt for src and dest of traditional theme
|
|
69
|
-
const previewPromptAnswers = await
|
|
70
|
-
const src =
|
|
71
|
-
dest =
|
|
72
|
-
absoluteSrc =
|
|
64
|
+
const previewPromptAnswers = await previewPrompt(options);
|
|
65
|
+
const src = options.src || previewPromptAnswers.src;
|
|
66
|
+
dest = options.dest || previewPromptAnswers.dest;
|
|
67
|
+
absoluteSrc = path.resolve(getCwd(), src);
|
|
73
68
|
if (!dest || !validateSrcPath(absoluteSrc)) {
|
|
74
|
-
process.exit(
|
|
69
|
+
process.exit(EXIT_CODES.ERROR);
|
|
75
70
|
}
|
|
76
71
|
}
|
|
77
72
|
else {
|
|
78
73
|
// In a project
|
|
79
|
-
let themeJsonPath =
|
|
74
|
+
let themeJsonPath = getThemeJSONPath();
|
|
80
75
|
if (!themeJsonPath) {
|
|
81
|
-
const projectComponents = await
|
|
82
|
-
const themeComponents = projectComponents.filter(c => c.type ===
|
|
76
|
+
const projectComponents = await findProjectComponents(projectDir);
|
|
77
|
+
const themeComponents = projectComponents.filter(c => c.type === ComponentTypes.HublTheme);
|
|
83
78
|
if (themeComponents.length === 0) {
|
|
84
|
-
|
|
85
|
-
process.exit(
|
|
79
|
+
logger.error(i18n(`${i18nKey}.errors.noThemeComponents`));
|
|
80
|
+
process.exit(EXIT_CODES.ERROR);
|
|
86
81
|
}
|
|
87
|
-
const answer = await
|
|
82
|
+
const answer = await previewProjectPrompt(themeComponents);
|
|
88
83
|
themeJsonPath = `${answer.themeComponentPath}/theme.json`;
|
|
89
84
|
}
|
|
90
|
-
const { dir: themeDir } =
|
|
85
|
+
const { dir: themeDir } = path.parse(themeJsonPath);
|
|
91
86
|
absoluteSrc = themeDir;
|
|
92
|
-
const { base: themeName } =
|
|
87
|
+
const { base: themeName } = path.parse(themeDir);
|
|
93
88
|
dest = `@projects/${projectConfig.name}/${themeName}`;
|
|
94
89
|
}
|
|
95
90
|
return { absoluteSrc, dest };
|
|
96
|
-
}
|
|
97
|
-
async
|
|
98
|
-
const { derivedAccountId, notify, noSsl, resetSession, port, generateFieldsTypes, } =
|
|
99
|
-
const { absoluteSrc, dest } = await determineSrcAndDest(
|
|
100
|
-
const filePaths = await
|
|
101
|
-
|
|
102
|
-
const initialUploadProgressBar = new
|
|
91
|
+
};
|
|
92
|
+
exports.handler = async (options) => {
|
|
93
|
+
const { derivedAccountId, notify, noSsl, resetSession, port, generateFieldsTypes, } = options;
|
|
94
|
+
const { absoluteSrc, dest } = await determineSrcAndDest(options);
|
|
95
|
+
const filePaths = await getUploadableFileList(absoluteSrc, false);
|
|
96
|
+
const startProgressBar = numFiles => {
|
|
97
|
+
const initialUploadProgressBar = new cliProgress.SingleBar({
|
|
103
98
|
gracefulExit: true,
|
|
104
99
|
format: '[{bar}] {percentage}% | {value}/{total} | {label}',
|
|
105
100
|
hideCursor: true,
|
|
106
|
-
},
|
|
101
|
+
}, cliProgress.Presets.rect);
|
|
107
102
|
initialUploadProgressBar.start(numFiles, 0, {
|
|
108
|
-
label:
|
|
103
|
+
label: i18n(`${i18nKey}.initialUploadProgressBar.start`),
|
|
109
104
|
});
|
|
110
105
|
let uploadsHaveStarted = false;
|
|
111
106
|
const uploadOptions = {
|
|
@@ -117,7 +112,7 @@ async function handler(args) {
|
|
|
117
112
|
if (!uploadsHaveStarted) {
|
|
118
113
|
uploadsHaveStarted = true;
|
|
119
114
|
initialUploadProgressBar.update(0, {
|
|
120
|
-
label:
|
|
115
|
+
label: i18n(`${i18nKey}.initialUploadProgressBar.uploading`),
|
|
121
116
|
});
|
|
122
117
|
}
|
|
123
118
|
},
|
|
@@ -128,15 +123,15 @@ async function handler(args) {
|
|
|
128
123
|
/* Intentionally blank */
|
|
129
124
|
},
|
|
130
125
|
onFinalErrorCallback: () => initialUploadProgressBar.increment(),
|
|
131
|
-
onFinishCallback:
|
|
126
|
+
onFinishCallback: results => {
|
|
132
127
|
initialUploadProgressBar.update(numFiles, {
|
|
133
|
-
label:
|
|
128
|
+
label: i18n(`${i18nKey}.initialUploadProgressBar.finish`),
|
|
134
129
|
});
|
|
135
130
|
initialUploadProgressBar.stop();
|
|
136
131
|
results.forEach(result => {
|
|
137
|
-
if (result.resultType ==
|
|
138
|
-
|
|
139
|
-
|
|
132
|
+
if (result.resultType == FILE_UPLOAD_RESULT_TYPES.FAILURE) {
|
|
133
|
+
logger.error('Uploading file "%s" to "%s" failed', result.file, dest);
|
|
134
|
+
logError(result.error, new ApiErrorContext({
|
|
140
135
|
accountId: derivedAccountId,
|
|
141
136
|
request: dest,
|
|
142
137
|
payload: result.file,
|
|
@@ -146,78 +141,76 @@ async function handler(args) {
|
|
|
146
141
|
},
|
|
147
142
|
};
|
|
148
143
|
return uploadOptions;
|
|
149
|
-
}
|
|
150
|
-
|
|
144
|
+
};
|
|
145
|
+
trackCommandUsage('preview', derivedAccountId);
|
|
151
146
|
let createUnifiedDevServer;
|
|
152
147
|
try {
|
|
153
|
-
// @ts-ignore TODO: Remove when we deprecate Node 18
|
|
154
148
|
require.resolve('@hubspot/cms-dev-server');
|
|
155
|
-
// @ts-ignore TODO: Remove when we deprecate Node 18
|
|
156
149
|
const { createDevServer } = await import('@hubspot/cms-dev-server');
|
|
157
150
|
createUnifiedDevServer = createDevServer;
|
|
158
151
|
}
|
|
159
152
|
catch (e) {
|
|
160
|
-
|
|
153
|
+
logger.warn('Unified dev server requires node 20 to run. Defaulting to legacy preview.');
|
|
161
154
|
}
|
|
162
|
-
const isUngatedForUnified = await
|
|
155
|
+
const isUngatedForUnified = await hasFeature(derivedAccountId, 'cms:react:unifiedThemePreview');
|
|
163
156
|
if (isUngatedForUnified && createUnifiedDevServer) {
|
|
164
157
|
if (port) {
|
|
165
|
-
process.env['PORT'] = port
|
|
158
|
+
process.env['PORT'] = port;
|
|
166
159
|
}
|
|
167
|
-
createUnifiedDevServer(absoluteSrc, false,
|
|
160
|
+
createUnifiedDevServer(absoluteSrc, false, false, false, !noSsl, generateFieldsTypes, {
|
|
168
161
|
filePaths,
|
|
169
|
-
resetSession
|
|
162
|
+
resetSession,
|
|
170
163
|
startProgressBar,
|
|
164
|
+
handleUserInput,
|
|
171
165
|
dest,
|
|
172
166
|
});
|
|
173
167
|
}
|
|
174
168
|
else {
|
|
175
|
-
|
|
169
|
+
preview(derivedAccountId, absoluteSrc, dest, {
|
|
176
170
|
notify,
|
|
177
171
|
filePaths,
|
|
178
172
|
noSsl,
|
|
179
173
|
port,
|
|
180
|
-
resetSession
|
|
174
|
+
resetSession,
|
|
181
175
|
startProgressBar,
|
|
182
176
|
handleUserInput,
|
|
183
177
|
});
|
|
184
178
|
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
yargs
|
|
190
|
-
.
|
|
191
|
-
describe: (0, lang_1.i18n)(`${i18nKey}.options.src.describe`),
|
|
179
|
+
};
|
|
180
|
+
exports.builder = yargs => {
|
|
181
|
+
addConfigOptions(yargs);
|
|
182
|
+
addAccountOptions(yargs);
|
|
183
|
+
yargs.option('src', {
|
|
184
|
+
describe: i18n(`${i18nKey}.options.src.describe`),
|
|
192
185
|
type: 'string',
|
|
193
186
|
requiresArg: true,
|
|
194
|
-
})
|
|
195
|
-
|
|
196
|
-
describe:
|
|
187
|
+
});
|
|
188
|
+
yargs.option('dest', {
|
|
189
|
+
describe: i18n(`${i18nKey}.options.dest.describe`),
|
|
197
190
|
type: 'string',
|
|
198
191
|
requiresArg: true,
|
|
199
|
-
})
|
|
200
|
-
|
|
192
|
+
});
|
|
193
|
+
yargs.option('notify', {
|
|
201
194
|
alias: 'n',
|
|
202
|
-
describe:
|
|
195
|
+
describe: i18n(`${i18nKey}.options.notify.describe`),
|
|
203
196
|
type: 'string',
|
|
204
197
|
requiresArg: true,
|
|
205
|
-
})
|
|
206
|
-
|
|
207
|
-
describe:
|
|
198
|
+
});
|
|
199
|
+
yargs.option('no-ssl', {
|
|
200
|
+
describe: i18n(`${i18nKey}.options.noSsl.describe`),
|
|
208
201
|
type: 'boolean',
|
|
209
|
-
})
|
|
210
|
-
|
|
211
|
-
describe:
|
|
202
|
+
});
|
|
203
|
+
yargs.option('port', {
|
|
204
|
+
describe: i18n(`${i18nKey}.options.port.describe`),
|
|
212
205
|
type: 'number',
|
|
213
|
-
})
|
|
214
|
-
|
|
215
|
-
|
|
206
|
+
});
|
|
207
|
+
yargs.option('resetSession', {
|
|
208
|
+
describe: false,
|
|
216
209
|
type: 'boolean',
|
|
217
|
-
})
|
|
218
|
-
|
|
219
|
-
|
|
210
|
+
});
|
|
211
|
+
yargs.option('generateFieldsTypes', {
|
|
212
|
+
describe: false,
|
|
220
213
|
type: 'boolean',
|
|
221
214
|
});
|
|
222
215
|
return yargs;
|
|
223
|
-
}
|
|
216
|
+
};
|
package/commands/theme.d.ts
CHANGED
package/commands/theme.js
CHANGED
|
@@ -1,54 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
const lang_1 = require("../lib/lang");
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
const marketplaceValidate = require('./theme/marketplace-validate');
|
|
5
|
+
const generateSelectors = require('./theme/generate-selectors');
|
|
6
|
+
const previewCommand = require('./theme/preview');
|
|
7
|
+
const { addGlobalOptions } = require('../lib/commonOpts');
|
|
8
|
+
const { i18n } = require('../lib/lang');
|
|
43
9
|
const i18nKey = 'commands.theme';
|
|
44
10
|
exports.command = ['theme', 'themes'];
|
|
45
|
-
exports.describe =
|
|
46
|
-
|
|
47
|
-
|
|
11
|
+
exports.describe = i18n(`${i18nKey}.describe`);
|
|
12
|
+
exports.builder = yargs => {
|
|
13
|
+
addGlobalOptions(yargs);
|
|
48
14
|
yargs
|
|
49
15
|
.command(previewCommand)
|
|
50
16
|
.command(marketplaceValidate)
|
|
51
17
|
.command(generateSelectors)
|
|
52
18
|
.demandCommand(1, '');
|
|
53
19
|
return yargs;
|
|
54
|
-
}
|
|
20
|
+
};
|