@hubspot/cli 7.4.8 → 7.4.9-beta.1
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/commands/account/auth.d.ts +3 -7
- package/commands/account/auth.js +19 -9
- package/commands/account/clean.d.ts +3 -7
- package/commands/account/clean.js +16 -9
- package/commands/account/createOverride.d.ts +3 -7
- package/commands/account/createOverride.js +23 -6
- package/commands/account/info.d.ts +3 -7
- package/commands/account/info.js +13 -5
- package/commands/account/list.d.ts +3 -7
- package/commands/account/list.js +15 -8
- package/commands/account/remove.d.ts +3 -7
- package/commands/account/remove.js +21 -9
- package/commands/account/removeOverride.d.ts +3 -7
- package/commands/account/removeOverride.js +23 -6
- package/commands/account/rename.d.ts +3 -7
- package/commands/account/rename.js +16 -9
- package/commands/account/use.d.ts +5 -9
- package/commands/account/use.js +14 -6
- package/commands/account.d.ts +3 -4
- package/commands/account.js +35 -58
- package/commands/cms/convertFields.d.ts +7 -1
- package/commands/cms/convertFields.js +57 -41
- package/commands/cms/getReactModule.d.ts +7 -1
- package/commands/cms/getReactModule.js +52 -34
- package/commands/cms/lighthouseScore.d.ts +8 -1
- package/commands/cms/lighthouseScore.js +129 -100
- package/commands/cms.d.ts +3 -1
- package/commands/cms.js +24 -15
- package/commands/completion.d.ts +3 -1
- package/commands/completion.js +25 -12
- package/commands/config/migrate.d.ts +1 -1
- package/commands/config/migrate.js +16 -12
- package/commands/create/api-sample.d.ts +3 -1
- package/commands/create/api-sample.js +34 -38
- package/commands/create/app.d.ts +3 -1
- package/commands/create/app.js +9 -7
- package/commands/create/function.d.ts +3 -1
- package/commands/create/function.js +11 -10
- package/commands/create/index.d.ts +5 -1
- package/commands/create/index.js +23 -11
- package/commands/create/module.d.ts +3 -1
- package/commands/create/module.js +14 -13
- package/commands/create/react-app.d.ts +3 -1
- package/commands/create/react-app.js +10 -7
- package/commands/create/template.d.ts +3 -1
- package/commands/create/template.js +14 -14
- package/commands/create/vue-app.d.ts +3 -1
- package/commands/create/vue-app.js +10 -7
- package/commands/create/webpack-serverless.d.ts +3 -1
- package/commands/create/webpack-serverless.js +10 -7
- package/commands/create/website-theme.d.ts +3 -1
- package/commands/create/website-theme.js +10 -9
- package/commands/create.d.ts +4 -24
- package/commands/create.js +63 -74
- package/commands/customObject/create.d.ts +4 -9
- package/commands/customObject/create.js +17 -10
- package/commands/customObject/schema/create.d.ts +4 -9
- package/commands/customObject/schema/create.js +18 -11
- package/commands/customObject/schema/delete.d.ts +4 -9
- package/commands/customObject/schema/delete.js +17 -10
- package/commands/customObject/schema/fetch-all.d.ts +4 -9
- package/commands/customObject/schema/fetch-all.js +17 -10
- package/commands/customObject/schema/fetch.d.ts +4 -9
- package/commands/customObject/schema/fetch.js +17 -10
- package/commands/customObject/schema/list.d.ts +4 -8
- package/commands/customObject/schema/list.js +17 -10
- package/commands/customObject/schema/update.d.ts +4 -9
- package/commands/customObject/schema/update.js +18 -11
- package/commands/customObject/schema.d.ts +3 -5
- package/commands/customObject/schema.js +27 -54
- package/commands/customObject.d.ts +3 -4
- package/commands/customObject.js +20 -45
- package/commands/feedback.d.ts +4 -1
- package/commands/feedback.js +40 -47
- package/commands/fetch.d.ts +12 -1
- package/commands/fetch.js +49 -33
- package/commands/filemanager/fetch.d.ts +4 -9
- package/commands/filemanager/fetch.js +18 -11
- package/commands/filemanager/upload.d.ts +4 -9
- package/commands/filemanager/upload.js +17 -11
- package/commands/filemanager.d.ts +3 -4
- package/commands/filemanager.js +20 -41
- package/commands/function/deploy.d.ts +6 -1
- package/commands/function/deploy.js +70 -50
- package/commands/function/list.d.ts +6 -1
- package/commands/function/list.js +44 -32
- package/commands/function/server.d.ts +10 -1
- package/commands/function/server.js +49 -38
- package/commands/function.d.ts +5 -1
- package/commands/function.js +24 -10
- package/commands/hubdb/clear.d.ts +4 -9
- package/commands/hubdb/clear.js +17 -10
- package/commands/hubdb/create.d.ts +4 -9
- package/commands/hubdb/create.js +17 -10
- package/commands/hubdb/delete.d.ts +4 -9
- package/commands/hubdb/delete.js +17 -10
- package/commands/hubdb/fetch.d.ts +4 -9
- package/commands/hubdb/fetch.js +17 -10
- package/commands/hubdb.d.ts +3 -2
- package/commands/hubdb.js +23 -45
- package/commands/lint.d.ts +6 -4
- package/commands/lint.js +44 -43
- package/commands/logs.d.ts +10 -1
- package/commands/logs.js +53 -44
- package/commands/module/marketplace-validate.d.ts +6 -1
- package/commands/module/marketplace-validate.js +39 -27
- package/commands/module.d.ts +3 -1
- package/commands/module.js +22 -10
- package/commands/project/cloneApp.d.ts +1 -1
- package/commands/project/create.js +3 -3
- package/commands/project/deploy.d.ts +1 -0
- package/commands/project/deploy.js +40 -12
- package/commands/project/dev/index.d.ts +1 -4
- package/commands/project/dev/index.js +44 -15
- package/commands/project/dev/unifiedFlow.d.ts +2 -1
- package/commands/project/dev/unifiedFlow.js +52 -20
- package/commands/project/migrate.d.ts +1 -0
- package/commands/project/profile/add.d.ts +7 -0
- package/commands/project/profile/add.js +190 -0
- package/commands/project/profile/remove.d.ts +6 -0
- package/commands/project/profile/remove.js +119 -0
- package/commands/project/profile.d.ts +3 -0
- package/commands/project/profile.js +25 -0
- package/commands/project/upload.d.ts +1 -0
- package/commands/project/upload.js +38 -8
- package/commands/project.js +2 -0
- package/commands/sandbox/create.d.ts +4 -9
- package/commands/sandbox/create.js +18 -11
- package/commands/sandbox/delete.d.ts +4 -9
- package/commands/sandbox/delete.js +18 -11
- package/commands/sandbox.d.ts +3 -4
- package/commands/sandbox.js +20 -43
- package/commands/secret/addSecret.d.ts +4 -9
- package/commands/secret/addSecret.js +17 -10
- package/commands/secret/deleteSecret.d.ts +4 -9
- package/commands/secret/deleteSecret.js +17 -10
- package/commands/secret/listSecret.d.ts +4 -9
- package/commands/secret/listSecret.js +17 -10
- package/commands/secret/updateSecret.d.ts +4 -9
- package/commands/secret/updateSecret.js +17 -10
- package/commands/secret.d.ts +3 -4
- package/commands/secret.js +25 -48
- package/commands/theme/generate-selectors.d.ts +3 -7
- package/commands/theme/generate-selectors.js +14 -6
- package/commands/theme/marketplace-validate.d.ts +4 -9
- package/commands/theme/marketplace-validate.js +17 -10
- package/commands/theme/preview.d.ts +4 -9
- package/commands/theme/preview.js +16 -9
- package/commands/theme.d.ts +3 -4
- package/commands/theme.js +23 -46
- package/commands/upload.d.ts +12 -1
- package/commands/upload.js +118 -97
- package/commands/watch.d.ts +14 -1
- package/commands/watch.js +76 -65
- package/lang/en.d.ts +654 -558
- package/lang/en.js +443 -353
- package/lang/en.lyaml +23 -13
- package/lib/app/migrate.d.ts +23 -0
- package/lib/app/migrate.js +14 -3
- package/lib/app/migrate_legacy.js +5 -5
- package/lib/configMigrate.js +24 -10
- package/lib/constants.d.ts +6 -0
- package/lib/constants.js +7 -1
- package/lib/errorHandlers/suppressError.js +12 -19
- package/lib/filesystem.d.ts +1 -1
- package/lib/interpolation.d.ts +2 -3
- package/lib/lang.d.ts +2 -3
- package/lib/middleware/configMiddleware.js +8 -0
- package/lib/projectProfiles.d.ts +6 -0
- package/lib/projectProfiles.js +65 -0
- package/lib/projects/buildAndDeploy.js +17 -2
- package/lib/projects/localDev/AppDevModeInterface.d.ts +25 -0
- package/lib/projects/localDev/AppDevModeInterface.js +117 -0
- package/lib/projects/localDev/DevServerManagerV2.d.ts +11 -22
- package/lib/projects/localDev/DevServerManagerV2.js +19 -15
- package/lib/projects/localDev/LocalDevLogger.d.ts +30 -0
- package/lib/projects/localDev/LocalDevLogger.js +158 -0
- package/lib/projects/localDev/LocalDevManager.js +2 -3
- package/lib/projects/localDev/LocalDevProcess.d.ts +27 -0
- package/lib/projects/localDev/LocalDevProcess.js +171 -0
- package/lib/projects/localDev/LocalDevState.d.ts +37 -0
- package/lib/projects/localDev/LocalDevState.js +78 -0
- package/lib/projects/localDev/LocalDevWatcher.d.ts +10 -0
- package/lib/projects/localDev/LocalDevWatcher.js +56 -0
- package/lib/projects/localDev/LocalDevWebsocketServer.d.ts +17 -0
- package/lib/projects/localDev/LocalDevWebsocketServer.js +92 -0
- package/lib/projects/localDev/helpers.d.ts +1 -1
- package/lib/projects/localDev/helpers.js +2 -1
- package/lib/projects/upload.d.ts +2 -1
- package/lib/projects/upload.js +2 -2
- package/lib/prompts/createApiSamplePrompt.d.ts +2 -10
- package/lib/prompts/createTemplatePrompt.d.ts +22 -4
- package/lib/testUtils.d.ts +3 -3
- package/lib/testUtils.js +8 -9
- package/lib/upload.d.ts +1 -1
- package/lib/validation.js +4 -5
- package/lib/yargsUtils.d.ts +4 -0
- package/lib/yargsUtils.js +6 -0
- package/package.json +5 -3
- package/types/Cms.d.ts +30 -0
- package/types/Cms.js +2 -0
- package/types/LocalDev.d.ts +24 -0
- package/types/LocalDev.js +2 -0
- package/types/Yargs.d.ts +8 -1
- package/lib/projects/localDev/LocalDevManagerV2.d.ts +0 -64
- package/lib/projects/localDev/LocalDevManagerV2.js +0 -345
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
type CombinedArgs = ConfigArgs & AccountArgs & EnvironmentArgs;
|
|
6
|
-
type ListSecretArgs = CommonArgs & CombinedArgs;
|
|
7
|
-
export declare function handler(args: ArgumentsCamelCase<ListSecretArgs>): Promise<void>;
|
|
8
|
-
export declare function builder(yargs: Argv): Argv<ListSecretArgs>;
|
|
9
|
-
export {};
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
|
+
type ListSecretArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs;
|
|
3
|
+
declare const listSecretCommand: YargsCommandModule<unknown, ListSecretArgs>;
|
|
4
|
+
export default listSecretCommand;
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.describe = exports.command = void 0;
|
|
4
|
-
exports.handler = handler;
|
|
5
|
-
exports.builder = builder;
|
|
6
3
|
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
7
4
|
const secrets_1 = require("@hubspot/local-dev-lib/api/secrets");
|
|
8
5
|
const index_1 = require("../../lib/errorHandlers/index");
|
|
9
6
|
const usageTracking_1 = require("../../lib/usageTracking");
|
|
10
7
|
const ui_1 = require("../../lib/ui");
|
|
11
|
-
const commonOpts_1 = require("../../lib/commonOpts");
|
|
12
8
|
const lang_1 = require("../../lib/lang");
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
10
|
+
const command = 'list';
|
|
11
|
+
const describe = (0, lang_1.i18n)(`commands.secret.subcommands.list.describe`);
|
|
15
12
|
async function handler(args) {
|
|
16
13
|
const { derivedAccountId } = args;
|
|
17
14
|
(0, usageTracking_1.trackCommandUsage)('secrets-list', {}, derivedAccountId);
|
|
@@ -32,9 +29,19 @@ async function handler(args) {
|
|
|
32
29
|
}));
|
|
33
30
|
}
|
|
34
31
|
}
|
|
35
|
-
function
|
|
36
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
37
|
-
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
38
|
-
(0, commonOpts_1.addUseEnvironmentOptions)(yargs);
|
|
32
|
+
function listSecretBuilder(yargs) {
|
|
39
33
|
return yargs;
|
|
40
34
|
}
|
|
35
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(listSecretBuilder, command, describe, {
|
|
36
|
+
useGlobalOptions: true,
|
|
37
|
+
useConfigOptions: true,
|
|
38
|
+
useAccountOptions: true,
|
|
39
|
+
useEnvironmentOptions: true,
|
|
40
|
+
});
|
|
41
|
+
const listSecretCommand = {
|
|
42
|
+
command,
|
|
43
|
+
describe,
|
|
44
|
+
handler,
|
|
45
|
+
builder,
|
|
46
|
+
};
|
|
47
|
+
exports.default = listSecretCommand;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare const command = "update [name]";
|
|
4
|
-
export declare const describe: string;
|
|
5
|
-
type CombinedArgs = ConfigArgs & AccountArgs & EnvironmentArgs;
|
|
6
|
-
type UpdateSecretArgs = CommonArgs & CombinedArgs & {
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
|
+
type UpdateSecretArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & {
|
|
7
3
|
name?: string;
|
|
8
4
|
};
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
export {};
|
|
5
|
+
declare const updateSecretCommand: YargsCommandModule<unknown, UpdateSecretArgs>;
|
|
6
|
+
export default updateSecretCommand;
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.describe = exports.command = void 0;
|
|
4
|
-
exports.handler = handler;
|
|
5
|
-
exports.builder = builder;
|
|
6
3
|
const secrets_1 = require("@hubspot/local-dev-lib/api/secrets");
|
|
7
4
|
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
8
5
|
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
9
6
|
const index_1 = require("../../lib/errorHandlers/index");
|
|
10
7
|
const usageTracking_1 = require("../../lib/usageTracking");
|
|
11
8
|
const ui_1 = require("../../lib/ui");
|
|
12
|
-
const commonOpts_1 = require("../../lib/commonOpts");
|
|
13
9
|
const secretPrompt_1 = require("../../lib/prompts/secretPrompt");
|
|
14
10
|
const lang_1 = require("../../lib/lang");
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
12
|
+
const command = 'update [name]';
|
|
13
|
+
const describe = (0, lang_1.i18n)(`commands.secret.subcommands.update.describe`);
|
|
17
14
|
async function handler(args) {
|
|
18
15
|
const { name, derivedAccountId } = args;
|
|
19
16
|
let secretName = name;
|
|
@@ -48,13 +45,23 @@ async function handler(args) {
|
|
|
48
45
|
}));
|
|
49
46
|
}
|
|
50
47
|
}
|
|
51
|
-
function
|
|
52
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
53
|
-
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
54
|
-
(0, commonOpts_1.addUseEnvironmentOptions)(yargs);
|
|
48
|
+
function updateSecretBuilder(yargs) {
|
|
55
49
|
yargs.positional('name', {
|
|
56
50
|
describe: (0, lang_1.i18n)(`commands.secret.subcommands.update.positionals.name.describe`),
|
|
57
51
|
type: 'string',
|
|
58
52
|
});
|
|
59
53
|
return yargs;
|
|
60
54
|
}
|
|
55
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(updateSecretBuilder, command, describe, {
|
|
56
|
+
useGlobalOptions: true,
|
|
57
|
+
useConfigOptions: true,
|
|
58
|
+
useAccountOptions: true,
|
|
59
|
+
useEnvironmentOptions: true,
|
|
60
|
+
});
|
|
61
|
+
const updateSecretCommand = {
|
|
62
|
+
command,
|
|
63
|
+
describe,
|
|
64
|
+
handler,
|
|
65
|
+
builder,
|
|
66
|
+
};
|
|
67
|
+
exports.default = updateSecretCommand;
|
package/commands/secret.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export declare function builder(yargs: Argv): Argv;
|
|
1
|
+
import { YargsCommandModuleBucket } from '../types/Yargs';
|
|
2
|
+
declare const secretCommand: YargsCommandModuleBucket;
|
|
3
|
+
export default secretCommand;
|
package/commands/secret.js
CHANGED
|
@@ -1,55 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
})();
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
35
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const listSecretCommand = __importStar(require("./secret/listSecret"));
|
|
41
|
-
const deleteSecretCommand = __importStar(require("./secret/deleteSecret"));
|
|
42
|
-
const updateSecretCommand = __importStar(require("./secret/updateSecret"));
|
|
6
|
+
const addSecret_1 = __importDefault(require("./secret/addSecret"));
|
|
7
|
+
const listSecret_1 = __importDefault(require("./secret/listSecret"));
|
|
8
|
+
const deleteSecret_1 = __importDefault(require("./secret/deleteSecret"));
|
|
9
|
+
const updateSecret_1 = __importDefault(require("./secret/updateSecret"));
|
|
43
10
|
const lang_1 = require("../lib/lang");
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
11
|
+
const yargsUtils_1 = require("../lib/yargsUtils");
|
|
12
|
+
const command = ['secret', 'secrets'];
|
|
13
|
+
const describe = (0, lang_1.i18n)(`commands.secret.describe`);
|
|
14
|
+
function secretBuilder(yargs) {
|
|
48
15
|
yargs
|
|
49
|
-
.command(
|
|
50
|
-
.command(
|
|
51
|
-
.command(
|
|
52
|
-
.command(
|
|
16
|
+
.command(listSecret_1.default)
|
|
17
|
+
.command(addSecret_1.default)
|
|
18
|
+
.command(updateSecret_1.default)
|
|
19
|
+
.command(deleteSecret_1.default)
|
|
53
20
|
.demandCommand(1, '');
|
|
54
21
|
return yargs;
|
|
55
22
|
}
|
|
23
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(secretBuilder, command, describe);
|
|
24
|
+
const secretCommand = {
|
|
25
|
+
command,
|
|
26
|
+
describe,
|
|
27
|
+
builder,
|
|
28
|
+
handler: () => { },
|
|
29
|
+
};
|
|
30
|
+
exports.default = secretCommand;
|
|
31
|
+
// TODO Remove this legacy export once we've migrated all commands to TS
|
|
32
|
+
module.exports = secretCommand;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CommonArgs } from '../../types/Yargs';
|
|
3
|
-
export declare const command = "generate-selectors <path>";
|
|
4
|
-
export declare const describe: string;
|
|
1
|
+
import { CommonArgs, YargsCommandModule } from '../../types/Yargs';
|
|
5
2
|
type ThemeSelectorArgs = CommonArgs & {
|
|
6
3
|
path: string;
|
|
7
4
|
};
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
export {};
|
|
5
|
+
declare const themeSelectorsCommand: YargsCommandModule<unknown, ThemeSelectorArgs>;
|
|
6
|
+
export default themeSelectorsCommand;
|
|
@@ -3,14 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.describe = exports.command = void 0;
|
|
7
|
-
exports.handler = handler;
|
|
8
|
-
exports.builder = builder;
|
|
9
6
|
const fs_1 = __importDefault(require("fs"));
|
|
10
7
|
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
11
8
|
const lang_1 = require("../../lib/lang");
|
|
12
9
|
const generateSelectors_1 = require("../../lib/generateSelectors");
|
|
13
10
|
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
11
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
14
12
|
const HUBL_EXPRESSION_REGEX = new RegExp(/{%\s*(.*)\s*%}/, 'g');
|
|
15
13
|
const HUBL_VARIABLE_NAME_REGEX = new RegExp(/{%\s*set\s*(\w*)/, 'i');
|
|
16
14
|
const HUBL_STATEMENT_REGEX = new RegExp(/{{\s*[\w.(,\d\-\s)|/~]*.*}}/, 'g');
|
|
@@ -20,8 +18,8 @@ const CSS_VARS_NAME_REGEX = new RegExp(/(--[\w.(,\d\-)]*)/, 'g');
|
|
|
20
18
|
const CSS_SELECTORS_REGEX = new RegExp(/([\s\w:.,\0-[\]]*){/, 'i');
|
|
21
19
|
const CSS_EXPRESSION_REGEX = new RegExp(/(?!\s)([^}])*(?![.#\s,>])[^}]*}/, 'g');
|
|
22
20
|
const THEME_PATH_REGEX = new RegExp(/=\s*.*(theme\.(\w|\.)*)/, 'i');
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
const command = 'generate-selectors <path>';
|
|
22
|
+
const describe = (0, lang_1.i18n)('commands.theme.subcommands.generateSelectors.describe');
|
|
25
23
|
async function handler(args) {
|
|
26
24
|
const { path } = args;
|
|
27
25
|
const fieldsJsonPath = (0, generateSelectors_1.findFieldsJsonPath)(path);
|
|
@@ -158,7 +156,7 @@ async function handler(args) {
|
|
|
158
156
|
selectorsPath,
|
|
159
157
|
}));
|
|
160
158
|
}
|
|
161
|
-
function
|
|
159
|
+
function themeSelectorBuilder(yargs) {
|
|
162
160
|
yargs.positional('path', {
|
|
163
161
|
describe: (0, lang_1.i18n)('commands.theme.subcommands.generateSelectors.positionals.path.describe'),
|
|
164
162
|
type: 'string',
|
|
@@ -166,3 +164,13 @@ function builder(yargs) {
|
|
|
166
164
|
});
|
|
167
165
|
return yargs;
|
|
168
166
|
}
|
|
167
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(themeSelectorBuilder, command, describe, {
|
|
168
|
+
useGlobalOptions: true,
|
|
169
|
+
});
|
|
170
|
+
const themeSelectorsCommand = {
|
|
171
|
+
command,
|
|
172
|
+
describe,
|
|
173
|
+
handler,
|
|
174
|
+
builder,
|
|
175
|
+
};
|
|
176
|
+
exports.default = themeSelectorsCommand;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare const command = "marketplace-validate <path>";
|
|
4
|
-
export declare const describe: string;
|
|
5
|
-
type CombinedArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs;
|
|
6
|
-
type ThemeValidateArgs = CombinedArgs & {
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
|
+
type ThemeValidateArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & {
|
|
7
3
|
path: string;
|
|
8
4
|
};
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
export {};
|
|
5
|
+
declare const themeValidateCommand: YargsCommandModule<unknown, ThemeValidateArgs>;
|
|
6
|
+
export default themeValidateCommand;
|
|
@@ -3,16 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.describe = exports.command = void 0;
|
|
7
|
-
exports.handler = handler;
|
|
8
|
-
exports.builder = builder;
|
|
9
6
|
const SpinniesManager_1 = __importDefault(require("../../lib/ui/SpinniesManager"));
|
|
10
|
-
const commonOpts_1 = require("../../lib/commonOpts");
|
|
11
7
|
const usageTracking_1 = require("../../lib/usageTracking");
|
|
12
8
|
const marketplaceValidate_1 = require("../../lib/marketplaceValidate");
|
|
13
9
|
const lang_1 = require("../../lib/lang");
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
11
|
+
const command = 'marketplace-validate <path>';
|
|
12
|
+
const describe = (0, lang_1.i18n)('commands.theme.subcommands.marketplaceValidate.describe');
|
|
16
13
|
async function handler(args) {
|
|
17
14
|
const { path, derivedAccountId } = args;
|
|
18
15
|
(0, usageTracking_1.trackCommandUsage)('validate', {}, derivedAccountId);
|
|
@@ -31,10 +28,7 @@ async function handler(args) {
|
|
|
31
28
|
(0, marketplaceValidate_1.displayValidationResults)('commands.theme.subcommands.marketplaceValidate', validationResults);
|
|
32
29
|
process.exit();
|
|
33
30
|
}
|
|
34
|
-
function
|
|
35
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
36
|
-
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
37
|
-
(0, commonOpts_1.addUseEnvironmentOptions)(yargs);
|
|
31
|
+
function themeValidateBuilder(yargs) {
|
|
38
32
|
yargs.positional('path', {
|
|
39
33
|
describe: (0, lang_1.i18n)('commands.theme.subcommands.marketplaceValidate.positionals.path.describe'),
|
|
40
34
|
type: 'string',
|
|
@@ -42,3 +36,16 @@ function builder(yargs) {
|
|
|
42
36
|
});
|
|
43
37
|
return yargs;
|
|
44
38
|
}
|
|
39
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(themeValidateBuilder, command, describe, {
|
|
40
|
+
useGlobalOptions: true,
|
|
41
|
+
useConfigOptions: true,
|
|
42
|
+
useAccountOptions: true,
|
|
43
|
+
useEnvironmentOptions: true,
|
|
44
|
+
});
|
|
45
|
+
const themeValidateCommand = {
|
|
46
|
+
command,
|
|
47
|
+
describe,
|
|
48
|
+
handler,
|
|
49
|
+
builder,
|
|
50
|
+
};
|
|
51
|
+
exports.default = themeValidateCommand;
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare const command = "preview [--src] [--dest]";
|
|
4
|
-
export declare const describe: string;
|
|
5
|
-
type CombinedArgs = CommonArgs & ConfigArgs & AccountArgs;
|
|
6
|
-
type ThemePreviewArgs = CombinedArgs & {
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
|
+
type ThemePreviewArgs = CommonArgs & ConfigArgs & AccountArgs & {
|
|
7
3
|
src: string;
|
|
8
4
|
dest: string;
|
|
9
5
|
notify: string;
|
|
@@ -12,6 +8,5 @@ type ThemePreviewArgs = CombinedArgs & {
|
|
|
12
8
|
resetSession?: boolean;
|
|
13
9
|
generateFieldsTypes?: boolean;
|
|
14
10
|
};
|
|
15
|
-
|
|
16
|
-
export
|
|
17
|
-
export {};
|
|
11
|
+
declare const themePreviewCommand: YargsCommandModule<unknown, ThemePreviewArgs>;
|
|
12
|
+
export default themePreviewCommand;
|
|
@@ -3,9 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.describe = exports.command = void 0;
|
|
7
|
-
exports.handler = handler;
|
|
8
|
-
exports.builder = builder;
|
|
9
6
|
const fs_1 = __importDefault(require("fs"));
|
|
10
7
|
const path_1 = __importDefault(require("path"));
|
|
11
8
|
const cli_progress_1 = __importDefault(require("cli-progress"));
|
|
@@ -15,7 +12,6 @@ const path_2 = require("@hubspot/local-dev-lib/path");
|
|
|
15
12
|
const files_1 = require("@hubspot/local-dev-lib/constants/files");
|
|
16
13
|
const themes_1 = require("@hubspot/local-dev-lib/cms/themes");
|
|
17
14
|
const theme_preview_dev_server_1 = require("@hubspot/theme-preview-dev-server");
|
|
18
|
-
const commonOpts_1 = require("../../lib/commonOpts");
|
|
19
15
|
const upload_1 = require("../../lib/upload");
|
|
20
16
|
const usageTracking_1 = require("../../lib/usageTracking");
|
|
21
17
|
const previewPrompt_1 = require("../../lib/prompts/previewPrompt");
|
|
@@ -27,8 +23,9 @@ const structure_1 = require("../../lib/projects/structure");
|
|
|
27
23
|
const Projects_1 = require("../../types/Projects");
|
|
28
24
|
const hasFeature_1 = require("../../lib/hasFeature");
|
|
29
25
|
const constants_1 = require("../../lib/constants");
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
27
|
+
const command = 'preview [--src] [--dest]';
|
|
28
|
+
const describe = (0, lang_1.i18n)('commands.theme.subcommands.preview.describe');
|
|
32
29
|
function validateSrcPath(src) {
|
|
33
30
|
const logInvalidPath = () => {
|
|
34
31
|
logger_1.logger.error((0, lang_1.i18n)('commands.theme.subcommands.preview.errors.invalidPath', {
|
|
@@ -183,9 +180,7 @@ async function handler(args) {
|
|
|
183
180
|
});
|
|
184
181
|
}
|
|
185
182
|
}
|
|
186
|
-
function
|
|
187
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
188
|
-
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
183
|
+
function themePreviewBuilder(yargs) {
|
|
189
184
|
yargs
|
|
190
185
|
.option('src', {
|
|
191
186
|
describe: (0, lang_1.i18n)('commands.theme.subcommands.preview.options.src.describe'),
|
|
@@ -221,3 +216,15 @@ function builder(yargs) {
|
|
|
221
216
|
});
|
|
222
217
|
return yargs;
|
|
223
218
|
}
|
|
219
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(themePreviewBuilder, command, describe, {
|
|
220
|
+
useGlobalOptions: true,
|
|
221
|
+
useConfigOptions: true,
|
|
222
|
+
useAccountOptions: true,
|
|
223
|
+
});
|
|
224
|
+
const themePreviewCommand = {
|
|
225
|
+
command,
|
|
226
|
+
describe,
|
|
227
|
+
handler,
|
|
228
|
+
builder,
|
|
229
|
+
};
|
|
230
|
+
exports.default = themePreviewCommand;
|
package/commands/theme.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export declare function builder(yargs: Argv): Argv;
|
|
1
|
+
import { YargsCommandModuleBucket } from '../types/Yargs';
|
|
2
|
+
declare const themeCommand: YargsCommandModuleBucket;
|
|
3
|
+
export default themeCommand;
|
package/commands/theme.js
CHANGED
|
@@ -1,53 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
})();
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
35
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
const generateSelectors = __importStar(require("./theme/generate-selectors"));
|
|
40
|
-
const previewCommand = __importStar(require("./theme/preview"));
|
|
41
|
-
const commonOpts_1 = require("../lib/commonOpts");
|
|
6
|
+
const marketplace_validate_1 = __importDefault(require("./theme/marketplace-validate"));
|
|
7
|
+
const generate_selectors_1 = __importDefault(require("./theme/generate-selectors"));
|
|
8
|
+
const preview_1 = __importDefault(require("./theme/preview"));
|
|
42
9
|
const lang_1 = require("../lib/lang");
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
10
|
+
const yargsUtils_1 = require("../lib/yargsUtils");
|
|
11
|
+
const command = ['theme', 'themes'];
|
|
12
|
+
const describe = (0, lang_1.i18n)('commands.theme.describe');
|
|
13
|
+
function themeBuilder(yargs) {
|
|
47
14
|
yargs
|
|
48
|
-
.command(
|
|
49
|
-
.command(
|
|
50
|
-
.command(
|
|
15
|
+
.command(preview_1.default)
|
|
16
|
+
.command(marketplace_validate_1.default)
|
|
17
|
+
.command(generate_selectors_1.default)
|
|
51
18
|
.demandCommand(1, '');
|
|
52
19
|
return yargs;
|
|
53
20
|
}
|
|
21
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(themeBuilder, command, describe);
|
|
22
|
+
const themeCommand = {
|
|
23
|
+
command,
|
|
24
|
+
describe,
|
|
25
|
+
builder,
|
|
26
|
+
handler: () => { },
|
|
27
|
+
};
|
|
28
|
+
exports.default = themeCommand;
|
|
29
|
+
// TODO Remove this legacy export once we've migrated all commands to TS
|
|
30
|
+
module.exports = themeCommand;
|
package/commands/upload.d.ts
CHANGED
|
@@ -1 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, CmsPublishModeArgs, YargsCommandModule } from '../types/Yargs';
|
|
2
|
+
type UploadArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & CmsPublishModeArgs & {
|
|
3
|
+
src?: string;
|
|
4
|
+
dest?: string;
|
|
5
|
+
fieldOptions?: string | string[];
|
|
6
|
+
saveOutput?: boolean;
|
|
7
|
+
convertFields?: boolean;
|
|
8
|
+
clean?: boolean;
|
|
9
|
+
force?: boolean;
|
|
10
|
+
};
|
|
11
|
+
declare const uploadCommand: YargsCommandModule<unknown, UploadArgs>;
|
|
12
|
+
export default uploadCommand;
|