@sitecore-content-sdk/cli 1.3.0-canary.2 → 1.3.0-canary.21

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 (49) hide show
  1. package/README.md +5 -5
  2. package/dist/cjs/bin/sitecore-tools.js +77 -77
  3. package/dist/cjs/cli.js +69 -69
  4. package/dist/cjs/scripts/index.js +40 -40
  5. package/dist/cjs/scripts/project/build.js +42 -42
  6. package/dist/cjs/scripts/project/component/add.js +236 -184
  7. package/dist/cjs/scripts/project/component/generate-map.js +68 -68
  8. package/dist/cjs/scripts/project/component/index.js +57 -57
  9. package/dist/cjs/scripts/project/component/scaffold.js +66 -66
  10. package/dist/cjs/scripts/project/index.js +56 -56
  11. package/dist/cjs/utils/load-config.js +42 -42
  12. package/dist/cjs/utils/process-env.js +70 -70
  13. package/dist/cjs/utils/watch-items.js +18 -18
  14. package/dist/esm/cli.js +63 -63
  15. package/dist/esm/scripts/index.js +4 -4
  16. package/dist/esm/scripts/project/build.js +35 -35
  17. package/dist/esm/scripts/project/component/add.js +193 -141
  18. package/dist/esm/scripts/project/component/generate-map.js +60 -60
  19. package/dist/esm/scripts/project/component/index.js +21 -21
  20. package/dist/esm/scripts/project/component/scaffold.js +58 -58
  21. package/dist/esm/scripts/project/index.js +20 -20
  22. package/dist/esm/utils/load-config.js +36 -36
  23. package/dist/esm/utils/process-env.js +31 -31
  24. package/dist/esm/utils/watch-items.js +12 -12
  25. package/package.json +3 -3
  26. package/types/bin/sitecore-tools.d.ts +3 -2
  27. package/types/bin/sitecore-tools.d.ts.map +1 -0
  28. package/types/cli.d.ts +14 -13
  29. package/types/cli.d.ts.map +1 -0
  30. package/types/scripts/index.d.ts +3 -2
  31. package/types/scripts/index.d.ts.map +1 -0
  32. package/types/scripts/project/build.d.ts +25 -24
  33. package/types/scripts/project/build.d.ts.map +1 -0
  34. package/types/scripts/project/component/add.d.ts +59 -58
  35. package/types/scripts/project/component/add.d.ts.map +1 -0
  36. package/types/scripts/project/component/generate-map.d.ts +33 -32
  37. package/types/scripts/project/component/generate-map.d.ts.map +1 -0
  38. package/types/scripts/project/component/index.d.ts +6 -5
  39. package/types/scripts/project/component/index.d.ts.map +1 -0
  40. package/types/scripts/project/component/scaffold.d.ts +45 -44
  41. package/types/scripts/project/component/scaffold.d.ts.map +1 -0
  42. package/types/scripts/project/index.d.ts +6 -5
  43. package/types/scripts/project/index.d.ts.map +1 -0
  44. package/types/utils/load-config.d.ts +9 -8
  45. package/types/utils/load-config.d.ts.map +1 -0
  46. package/types/utils/process-env.d.ts +9 -8
  47. package/types/utils/process-env.d.ts.map +1 -0
  48. package/types/utils/watch-items.d.ts +7 -6
  49. package/types/utils/watch-items.d.ts.map +1 -0
@@ -1,58 +1,59 @@
1
- import { Argv } from 'yargs';
2
- import * as tools from '@sitecore-content-sdk/core/tools';
3
- export declare const unitMocks: (toolsModule: Pick<typeof tools, "getComponentVariantSpec" | "getComponentList" | "getComponentVariantSpecUrl">) => void;
4
- type AddArgs = {
5
- /**
6
- * The unique identifier of the newly created variant.
7
- */
8
- variantId: string;
9
- /**
10
- * The authentication token.
11
- */
12
- token: string;
13
- /**
14
- * The target path for the component variant.
15
- */
16
- targetPath?: string;
17
- /**
18
- * If true, skips the component map generation.
19
- * Default: false.
20
- */
21
- skipComponentMap?: boolean;
22
- /**
23
- * If true, overwrites the existing component.
24
- * Default: false.
25
- */
26
- overwrite?: boolean;
27
- /**
28
- * Path to the `sitecore.cli.config` file.
29
- * Supports both JavaScript (`.js`) and TypeScript (`.ts`) formats.
30
- */
31
- config?: string;
32
- };
33
- /**
34
- * @param {Argv} yargs
35
- */
36
- export declare function args(yargs: Argv<AddArgs>): Argv<import("yargs").Omit<import("yargs").Omit<import("yargs").Omit<import("yargs").Omit<AddArgs, "variantId"> & {
37
- variantId: string | undefined;
38
- }, "token"> & {
39
- token: string;
40
- } & {
41
- "target-path": string | undefined;
42
- } & {
43
- "skip-component-map": boolean;
44
- }, "overwrite"> & {
45
- overwrite: boolean;
46
- }, "config"> & {
47
- config: string | undefined;
48
- }>;
49
- /**
50
- * @param {Argv} yargs
51
- */
52
- export declare function builder(yargs: Argv<AddArgs>): Argv<AddArgs>;
53
- /**
54
- * Handler for the add command.
55
- * @param {AddArgs} argv - The arguments passed to the command.
56
- */
57
- export declare function handler(argv: AddArgs): Promise<void>;
58
- export {};
1
+ import { Argv } from 'yargs';
2
+ import * as tools from '@sitecore-content-sdk/core/tools';
3
+ export declare const unitMocks: (toolsModule: Pick<typeof tools, "getComponentSpec" | "getComponentList" | "getComponentSpecUrl">) => void;
4
+ type AddArgs = {
5
+ /**
6
+ * The unique identifier of the newly created component.
7
+ */
8
+ componentId: string;
9
+ /**
10
+ * The authentication token.
11
+ */
12
+ token: string;
13
+ /**
14
+ * The target path for the component.
15
+ */
16
+ targetPath?: string;
17
+ /**
18
+ * If true, skips the component map generation.
19
+ * Default: false.
20
+ */
21
+ skipComponentMap?: boolean;
22
+ /**
23
+ * If true, overwrites the existing component.
24
+ * Default: false.
25
+ */
26
+ overwrite?: boolean;
27
+ /**
28
+ * Path to the `sitecore.cli.config` file.
29
+ * Supports both JavaScript (`.js`) and TypeScript (`.ts`) formats.
30
+ */
31
+ config?: string;
32
+ };
33
+ /**
34
+ * @param {Argv} yargs
35
+ */
36
+ export declare function args(yargs: Argv<AddArgs>): Argv<import("yargs").Omit<import("yargs").Omit<import("yargs").Omit<import("yargs").Omit<AddArgs, "componentId"> & {
37
+ componentId: string | undefined;
38
+ }, "token"> & {
39
+ token: string;
40
+ } & {
41
+ "target-path": string | undefined;
42
+ } & {
43
+ "skip-component-map": boolean;
44
+ }, "overwrite"> & {
45
+ overwrite: boolean;
46
+ }, "config"> & {
47
+ config: string | undefined;
48
+ }>;
49
+ /**
50
+ * @param {Argv} yargs
51
+ */
52
+ export declare function builder(yargs: Argv<AddArgs>): Argv<AddArgs>;
53
+ /**
54
+ * Handler for the add command.
55
+ * @param {AddArgs} argv - The arguments passed to the command.
56
+ */
57
+ export declare function handler(argv: AddArgs): Promise<void>;
58
+ export {};
59
+ //# sourceMappingURL=add.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../../src/scripts/project/component/add.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAK7B,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAO1D,eAAO,MAAM,SAAS,GACpB,aAAa,IAAI,CAAC,OAAO,KAAK,EAAE,kBAAkB,GAAG,kBAAkB,GAAG,qBAAqB,CAAC,SAKjG,CAAC;AAEF,KAAK,OAAO,GAAG;IACb;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC;;;;;;;;;;;;GAuCxC;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,iBAG3C;AAyBD;;;GAGG;AACH,wBAAsB,OAAO,CAAC,IAAI,EAAE,OAAO,iBAoI1C"}
@@ -1,32 +1,33 @@
1
- import { Argv } from 'yargs';
2
- /**
3
- * @param {Argv} yargs
4
- */
5
- export declare function builder(yargs: Argv<GenerateMapCliArgs>): Argv<GenerateMapCliArgs>;
6
- /**
7
- * The arguments for the build command.
8
- */
9
- export type GenerateMapCliArgs = {
10
- /**
11
- * If true, watches for changes in the specified paths and updates the component map accordingly.
12
- */
13
- watch?: boolean;
14
- /**
15
- * Path to the `sitecore.cli.config` file.
16
- * Supports both JavaScript (`.js`) and TypeScript (`.ts`) formats.
17
- */
18
- config?: string;
19
- };
20
- /**
21
- * @param {Argv} yargs
22
- */
23
- export declare function args(yargs: Argv<GenerateMapCliArgs>): Argv<import("yargs").Omit<import("yargs").Omit<GenerateMapCliArgs, "watch"> & {
24
- watch: boolean;
25
- }, "config"> & {
26
- config: string | undefined;
27
- }>;
28
- /**
29
- * Handler for the `generate-map` command.
30
- * @param {GenerateMapCliArgs} argv Cli arguments for the command
31
- */
32
- export declare function handler(argv: GenerateMapCliArgs): void;
1
+ import { Argv } from 'yargs';
2
+ /**
3
+ * @param {Argv} yargs
4
+ */
5
+ export declare function builder(yargs: Argv<GenerateMapCliArgs>): Argv<GenerateMapCliArgs>;
6
+ /**
7
+ * The arguments for the build command.
8
+ */
9
+ export type GenerateMapCliArgs = {
10
+ /**
11
+ * If true, watches for changes in the specified paths and updates the component map accordingly.
12
+ */
13
+ watch?: boolean;
14
+ /**
15
+ * Path to the `sitecore.cli.config` file.
16
+ * Supports both JavaScript (`.js`) and TypeScript (`.ts`) formats.
17
+ */
18
+ config?: string;
19
+ };
20
+ /**
21
+ * @param {Argv} yargs
22
+ */
23
+ export declare function args(yargs: Argv<GenerateMapCliArgs>): Argv<import("yargs").Omit<import("yargs").Omit<GenerateMapCliArgs, "watch"> & {
24
+ watch: boolean;
25
+ }, "config"> & {
26
+ config: string | undefined;
27
+ }>;
28
+ /**
29
+ * Handler for the `generate-map` command.
30
+ * @param {GenerateMapCliArgs} argv Cli arguments for the command
31
+ */
32
+ export declare function handler(argv: GenerateMapCliArgs): void;
33
+ //# sourceMappingURL=generate-map.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-map.d.ts","sourceRoot":"","sources":["../../../../src/scripts/project/component/generate-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAI7B;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,kBAAkB,CAAC,4BAOtD;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,kBAAkB,CAAC;;;;GAenD;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,kBAAkB,QAqC/C"}
@@ -1,5 +1,6 @@
1
- import { Argv } from 'yargs';
2
- /**
3
- * @param {Argv} yargs
4
- */
5
- export declare function builder(yargs: Argv): Argv<{}>;
1
+ import { Argv } from 'yargs';
2
+ /**
3
+ * @param {Argv} yargs
4
+ */
5
+ export declare function builder(yargs: Argv): Argv<{}>;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/scripts/project/component/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAK7B;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,IAAI,YAiBlC"}
@@ -1,44 +1,45 @@
1
- import { Argv } from 'yargs';
2
- /**
3
- * @param {Argv} yargs
4
- */
5
- export declare function builder(yargs: Argv<ScaffoldArgs>): Argv<ScaffoldArgs>;
6
- /**
7
- * @param {Argv} yargs
8
- */
9
- export declare function args(yargs: Argv<ScaffoldArgs>): Argv<import("yargs").Omit<import("yargs").Omit<import("yargs").Omit<import("yargs").Omit<ScaffoldArgs, "componentName"> & {
10
- componentName: string | undefined;
11
- }, "config"> & {
12
- config: string | undefined;
13
- }, "templateName"> & {
14
- templateName: string | undefined;
15
- }, "byoc"> & {
16
- byoc: boolean;
17
- }>;
18
- /**
19
- * Arguments for the scaffold command.
20
- */
21
- export type ScaffoldArgs = {
22
- /**
23
- * The name of the component to be scaffolded.
24
- */
25
- componentName: string;
26
- /**
27
- * Path to the `sitecore.cli.config` file.
28
- * Supports both JavaScript (`.js`) and TypeScript (`.ts`) formats.
29
- */
30
- config?: string;
31
- /**
32
- * The name of the template to use for scaffolding.
33
- */
34
- templateName?: string;
35
- /**
36
- * Indicates whether to scaffold a BYOC type component.
37
- */
38
- byoc?: boolean;
39
- };
40
- /**
41
- * Handler for the scaffold command.
42
- * @param {ScaffoldArgs} argv - The arguments passed to the command.
43
- */
44
- export declare function handler(argv: ScaffoldArgs): void;
1
+ import { Argv } from 'yargs';
2
+ /**
3
+ * @param {Argv} yargs
4
+ */
5
+ export declare function builder(yargs: Argv<ScaffoldArgs>): Argv<ScaffoldArgs>;
6
+ /**
7
+ * @param {Argv} yargs
8
+ */
9
+ export declare function args(yargs: Argv<ScaffoldArgs>): Argv<import("yargs").Omit<import("yargs").Omit<import("yargs").Omit<import("yargs").Omit<ScaffoldArgs, "componentName"> & {
10
+ componentName: string | undefined;
11
+ }, "config"> & {
12
+ config: string | undefined;
13
+ }, "templateName"> & {
14
+ templateName: string | undefined;
15
+ }, "byoc"> & {
16
+ byoc: boolean;
17
+ }>;
18
+ /**
19
+ * Arguments for the scaffold command.
20
+ */
21
+ export type ScaffoldArgs = {
22
+ /**
23
+ * The name of the component to be scaffolded.
24
+ */
25
+ componentName: string;
26
+ /**
27
+ * Path to the `sitecore.cli.config` file.
28
+ * Supports both JavaScript (`.js`) and TypeScript (`.ts`) formats.
29
+ */
30
+ config?: string;
31
+ /**
32
+ * The name of the template to use for scaffolding.
33
+ */
34
+ templateName?: string;
35
+ /**
36
+ * Indicates whether to scaffold a BYOC type component.
37
+ */
38
+ byoc?: boolean;
39
+ };
40
+ /**
41
+ * Handler for the scaffold command.
42
+ * @param {ScaffoldArgs} argv - The arguments passed to the command.
43
+ */
44
+ export declare function handler(argv: ScaffoldArgs): void;
45
+ //# sourceMappingURL=scaffold.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../../../src/scripts/project/component/scaffold.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAG7B;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,sBAOhD;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC;;;;;;;;GA2B7C;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,YAAY,QAsBzC"}
@@ -1,5 +1,6 @@
1
- import { Argv } from 'yargs';
2
- /**
3
- * @param {Argv} yargs
4
- */
5
- export declare function builder(yargs: Argv): Argv<{}>;
1
+ import { Argv } from 'yargs';
2
+ /**
3
+ * @param {Argv} yargs
4
+ */
5
+ export declare function builder(yargs: Argv): Argv<{}>;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/scripts/project/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAK7B;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,IAAI,YAgBlC"}
@@ -1,8 +1,9 @@
1
- import { SitecoreCliConfig } from '@sitecore-content-sdk/core/types/config';
2
- /**
3
- * Loads Sitecore Content SDK CLI configuration from the specified file.
4
- * @param {string} [configFile] - The path to the configuration file.
5
- * @returns {SitecoreCliConfig} The default export from the configuration file.
6
- * @throws Will throw an error if the configuration file does not exist or does not have a default export.
7
- */
8
- export default function loadCliConfig(configFile?: string): SitecoreCliConfig;
1
+ import { SitecoreCliConfig } from '@sitecore-content-sdk/core/types/config';
2
+ /**
3
+ * Loads Sitecore Content SDK CLI configuration from the specified file.
4
+ * @param {string} [configFile] - The path to the configuration file.
5
+ * @returns {SitecoreCliConfig} The default export from the configuration file.
6
+ * @throws Will throw an error if the configuration file does not exist or does not have a default export.
7
+ */
8
+ export default function loadCliConfig(configFile?: string): SitecoreCliConfig;
9
+ //# sourceMappingURL=load-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load-config.d.ts","sourceRoot":"","sources":["../../src/utils/load-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAO5E;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,iBAAiB,CA4B5E"}
@@ -1,8 +1,9 @@
1
- /**
2
- * Loads and processes environment variables from `.env` files in the specified directory.
3
- * It supports multiple `.env` files, including
4
- * environment-specific files (e.g., `.env.development`, `.env.production`) and local overrides
5
- * (e.g., `.env.local`, `.env.development.local`).
6
- * @param {string} dir - The directory to search for `.env` files.
7
- */
8
- export default function processEnv(dir: string): void;
1
+ /**
2
+ * Loads and processes environment variables from `.env` files in the specified directory.
3
+ * It supports multiple `.env` files, including
4
+ * environment-specific files (e.g., `.env.development`, `.env.production`) and local overrides
5
+ * (e.g., `.env.local`, `.env.development.local`).
6
+ * @param {string} dir - The directory to search for `.env` files.
7
+ */
8
+ export default function processEnv(dir: string): void;
9
+ //# sourceMappingURL=process-env.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-env.d.ts","sourceRoot":"","sources":["../../src/utils/process-env.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,GAAG,EAAE,MAAM,QAqB7C"}
@@ -1,6 +1,7 @@
1
- /**
2
- * Run watch mode, watching on @var paths
3
- * @param {string[]} paths paths to watch by chokidar
4
- * @param {Function<void>} cb callback to run on file change
5
- */
6
- export declare function watchItems(paths: string[], cb: () => void): void;
1
+ /**
2
+ * Run watch mode, watching on @var paths
3
+ * @param {string[]} paths paths to watch by chokidar
4
+ * @param {Function<void>} cb callback to run on file change
5
+ */
6
+ export declare function watchItems(paths: string[], cb: () => void): void;
7
+ //# sourceMappingURL=watch-items.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"watch-items.d.ts","sourceRoot":"","sources":["../../src/utils/watch-items.ts"],"names":[],"mappings":"AACA;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,IAAI,GAAG,IAAI,CAKhE"}