@hubspot/cli 7.2.0-experimental.0 → 7.2.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.
Files changed (48) hide show
  1. package/commands/account/info.d.ts +1 -1
  2. package/commands/account/info.js +8 -5
  3. package/commands/auth.d.ts +9 -0
  4. package/commands/auth.js +89 -83
  5. package/commands/init.d.ts +11 -0
  6. package/commands/init.js +114 -100
  7. package/commands/list.d.ts +9 -0
  8. package/commands/list.js +63 -57
  9. package/commands/mv.d.ts +10 -0
  10. package/commands/mv.js +32 -32
  11. package/commands/open.d.ts +10 -0
  12. package/commands/open.js +37 -34
  13. package/commands/project/dev/deprecatedFlow.d.ts +5 -0
  14. package/commands/project/{dev.js → dev/deprecatedFlow.js} +14 -44
  15. package/commands/project/{dev.d.ts → dev/index.d.ts} +1 -3
  16. package/commands/project/dev/index.js +52 -0
  17. package/commands/project/dev/unifiedFlow.d.ts +5 -0
  18. package/commands/project/dev/unifiedFlow.js +112 -0
  19. package/commands/remove.d.ts +9 -0
  20. package/commands/remove.js +25 -23
  21. package/lang/en.lyaml +10 -6
  22. package/lib/DevServerManagerV2.d.ts +34 -0
  23. package/lib/DevServerManagerV2.js +85 -0
  24. package/lib/LocalDevManagerV2.d.ts +64 -0
  25. package/lib/LocalDevManagerV2.js +382 -0
  26. package/lib/commonOpts.d.ts +1 -0
  27. package/lib/commonOpts.js +30 -0
  28. package/lib/constants.d.ts +12 -0
  29. package/lib/constants.js +13 -1
  30. package/lib/localDev.d.ts +1 -1
  31. package/lib/localDev.js +2 -2
  32. package/lib/projects/structure.d.ts +4 -0
  33. package/lib/projects/structure.js +9 -0
  34. package/lib/prompts/accountNamePrompt.d.ts +2 -3
  35. package/lib/prompts/personalAccessKeyPrompt.d.ts +4 -4
  36. package/lib/ui/index.d.ts +1 -1
  37. package/lib/ui/index.js +2 -2
  38. package/lib/ui/supportHyperlinks.js +2 -2
  39. package/lib/ui/supportsColor.js +2 -2
  40. package/lib/usageTracking.d.ts +1 -1
  41. package/lib/yargsUtils.d.ts +9 -0
  42. package/lib/yargsUtils.js +40 -0
  43. package/package.json +3 -3
  44. package/types/ProjectComponents.d.ts +38 -0
  45. package/types/ProjectComponents.js +3 -0
  46. package/types/Yargs.d.ts +1 -0
  47. package/lib/hasFlag.d.ts +0 -1
  48. package/lib/hasFlag.js +0 -15
@@ -0,0 +1,9 @@
1
+ import { Argv } from 'yargs';
2
+ export declare function hasFlag(flag: string, argv?: string[]): boolean;
3
+ export declare function makeYargsBuilder<T>(callback: (yargs: Argv) => Argv<T>, command: string, describe: string, options: {
4
+ useGlobalOptions?: boolean;
5
+ useAccountOptions?: boolean;
6
+ useConfigOptions?: boolean;
7
+ useUseEnvironmentOptions?: boolean;
8
+ useTestingOptions?: boolean;
9
+ }): (yargs: Argv) => Promise<Argv<T>>;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.hasFlag = hasFlag;
7
+ exports.makeYargsBuilder = makeYargsBuilder;
8
+ const process_1 = __importDefault(require("process"));
9
+ const commonOpts_1 = require("./commonOpts");
10
+ // See https://github.com/sindresorhus/has-flag/blob/main/index.js (License: https://github.com/sindresorhus/has-flag/blob/main/license)
11
+ function hasFlag(flag, argv = process_1.default.argv) {
12
+ const prefix = flag.startsWith('-') ? '' : flag.length === 1 ? '-' : '--';
13
+ const position = argv.indexOf(prefix + flag);
14
+ const terminatorPosition = argv.indexOf('--');
15
+ return (position !== -1 &&
16
+ (terminatorPosition === -1 || position < terminatorPosition));
17
+ }
18
+ function makeYargsBuilder(callback, command, describe, options) {
19
+ return async function (yargs) {
20
+ if (options.useGlobalOptions) {
21
+ (0, commonOpts_1.addGlobalOptions)(yargs);
22
+ }
23
+ if (options.useAccountOptions) {
24
+ (0, commonOpts_1.addAccountOptions)(yargs);
25
+ }
26
+ if (options.useConfigOptions) {
27
+ (0, commonOpts_1.addConfigOptions)(yargs);
28
+ }
29
+ if (options.useUseEnvironmentOptions) {
30
+ (0, commonOpts_1.addUseEnvironmentOptions)(yargs);
31
+ }
32
+ if (options.useTestingOptions) {
33
+ (0, commonOpts_1.addTestingOptions)(yargs);
34
+ }
35
+ const result = callback(yargs);
36
+ // Must go last to pick up available options
37
+ await (0, commonOpts_1.addCustomHelpOutput)(result, command, describe);
38
+ return result;
39
+ };
40
+ }
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@hubspot/cli",
3
- "version": "7.2.0-experimental.0",
3
+ "version": "7.2.0",
4
4
  "description": "The official CLI for developing on HubSpot",
5
5
  "license": "Apache-2.0",
6
6
  "repository": "https://github.com/HubSpot/hubspot-cli",
7
7
  "dependencies": {
8
8
  "@hubspot/local-dev-lib": "3.3.2",
9
- "@hubspot/project-parsing-lib": "0.0.12-experimental.0",
9
+ "@hubspot/project-parsing-lib": "0.1.1",
10
10
  "@hubspot/serverless-dev-runtime": "7.0.2",
11
11
  "@hubspot/theme-preview-dev-server": "0.0.10",
12
- "@hubspot/ui-extensions-dev-server": "0.8.42",
12
+ "@hubspot/ui-extensions-dev-server": "0.8.48",
13
13
  "archiver": "7.0.1",
14
14
  "chalk": "4.1.2",
15
15
  "chokidar": "3.6.0",
@@ -0,0 +1,38 @@
1
+ import { IntermediateRepresentationNodeLocalDev } from '@hubspot/project-parsing-lib/src/lib/types';
2
+ import { IR_COMPONENT_TYPES, APP_DISTRIBUTION_TYPES, APP_AUTH_TYPES } from '../lib/constants';
3
+ import { ValueOf } from '@hubspot/local-dev-lib/types/Utils';
4
+ type AppDistributionType = ValueOf<typeof APP_DISTRIBUTION_TYPES>;
5
+ type AppAuthType = ValueOf<typeof APP_AUTH_TYPES>;
6
+ type AppConfig = {
7
+ description: string;
8
+ name: string;
9
+ logo: string;
10
+ distribution: AppDistributionType;
11
+ auth: {
12
+ type: AppAuthType;
13
+ redirectUrls: string[];
14
+ requiredScopes: string[];
15
+ optionalScopes: string[];
16
+ conditionallyRequiredScopes: string[];
17
+ };
18
+ };
19
+ type CardConfig = {
20
+ name: string;
21
+ description: string;
22
+ previewImage: {
23
+ file: string;
24
+ altText: string;
25
+ };
26
+ entrypoint: string;
27
+ location: string;
28
+ objectTypes: string[];
29
+ };
30
+ export interface AppIRNode extends IntermediateRepresentationNodeLocalDev {
31
+ componentType: typeof IR_COMPONENT_TYPES.APPLICATION;
32
+ config: AppConfig;
33
+ }
34
+ export interface CardIRNode extends IntermediateRepresentationNodeLocalDev {
35
+ componentType: typeof IR_COMPONENT_TYPES.CARD;
36
+ config: CardConfig;
37
+ }
38
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // These types are for Unified Apps and projects on platform version 2025.1 and above
3
+ Object.defineProperty(exports, "__esModule", { value: true });
package/types/Yargs.d.ts CHANGED
@@ -23,6 +23,7 @@ export type OverwriteArgs = Options & {
23
23
  export type StringArgType = Options & {
24
24
  type: 'string';
25
25
  };
26
+ export type ProjectDevArgs = CommonArgs & ConfigArgs & EnvironmentArgs;
26
27
  export type TestingArgs = {
27
28
  qa?: boolean;
28
29
  };
package/lib/hasFlag.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare function hasFlag(flag: string, argv?: string[]): boolean;
package/lib/hasFlag.js DELETED
@@ -1,15 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.hasFlag = hasFlag;
7
- const process_1 = __importDefault(require("process"));
8
- // See https://github.com/sindresorhus/has-flag/blob/main/index.js (License: https://github.com/sindresorhus/has-flag/blob/main/license)
9
- function hasFlag(flag, argv = process_1.default.argv) {
10
- const prefix = flag.startsWith('-') ? '' : flag.length === 1 ? '-' : '--';
11
- const position = argv.indexOf(prefix + flag);
12
- const terminatorPosition = argv.indexOf('--');
13
- return (position !== -1 &&
14
- (terminatorPosition === -1 || position < terminatorPosition));
15
- }