@sitecore-content-sdk/cli 2.2.0-canary.20260619082835 → 2.2.0-canary.20260619085214
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/dist/cjs/scripts/project/build.js +2 -0
- package/dist/cjs/scripts/project/component/generate-map.js +2 -0
- package/dist/cjs/utils/ensure-sitecore-directory.js +19 -0
- package/dist/esm/scripts/project/build.js +2 -0
- package/dist/esm/scripts/project/component/generate-map.js +2 -0
- package/dist/esm/utils/ensure-sitecore-directory.js +13 -0
- package/package.json +3 -3
- package/types/scripts/project/build.d.ts.map +1 -1
- package/types/scripts/project/component/generate-map.d.ts.map +1 -1
- package/types/utils/ensure-sitecore-directory.d.ts +6 -0
- package/types/utils/ensure-sitecore-directory.d.ts.map +1 -0
|
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.builder = exports.describe = exports.command = void 0;
|
|
16
16
|
exports.handler = handler;
|
|
17
17
|
const load_config_1 = __importDefault(require("../../utils/load-config"));
|
|
18
|
+
const ensure_sitecore_directory_1 = require("../../utils/ensure-sitecore-directory");
|
|
18
19
|
exports.command = ['build', 'b'];
|
|
19
20
|
exports.describe = 'Performs build time automation';
|
|
20
21
|
exports.builder = {
|
|
@@ -30,6 +31,7 @@ exports.builder = {
|
|
|
30
31
|
*/
|
|
31
32
|
function handler(argv) {
|
|
32
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
(0, ensure_sitecore_directory_1.ensureSitecoreDirectory)();
|
|
33
35
|
const cliConfig = (0, load_config_1.default)(argv.config);
|
|
34
36
|
if (cliConfig.build && Array.isArray(cliConfig.build.commands)) {
|
|
35
37
|
for (const command of cliConfig.build.commands) {
|
|
@@ -9,6 +9,7 @@ exports.handler = handler;
|
|
|
9
9
|
const core_1 = require("@sitecore-content-sdk/core");
|
|
10
10
|
const watch_items_1 = require("../../../utils/watch-items");
|
|
11
11
|
const load_config_1 = __importDefault(require("../../../utils/load-config"));
|
|
12
|
+
const ensure_sitecore_directory_1 = require("../../../utils/ensure-sitecore-directory");
|
|
12
13
|
const { ERROR_MESSAGES } = core_1.constants;
|
|
13
14
|
/**
|
|
14
15
|
* @param {Argv} yargs
|
|
@@ -47,6 +48,7 @@ function handler(argv) {
|
|
|
47
48
|
}
|
|
48
49
|
const componentMapGenerator = cliConfig.componentMap.generator;
|
|
49
50
|
const { paths, destination, componentImports, exclude, clientComponentMap, includeVariants } = cliConfig.componentMap;
|
|
51
|
+
(0, ensure_sitecore_directory_1.ensureSitecoreDirectory)(destination);
|
|
50
52
|
if (argv.watch) {
|
|
51
53
|
console.log(`Watching for component changes to component builder sources in:\n ${paths.join('\n')}`);
|
|
52
54
|
(0, watch_items_1.watchItems)(paths, componentMapGenerator.bind(null, {
|
|
@@ -0,0 +1,19 @@
|
|
|
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.ensureSitecoreDirectory = ensureSitecoreDirectory;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
/**
|
|
10
|
+
* Ensures the Sitecore output directory exists, creating it if necessary.
|
|
11
|
+
* @param {string} destination Relative path to the output directory.
|
|
12
|
+
*/
|
|
13
|
+
function ensureSitecoreDirectory(destination = '.sitecore') {
|
|
14
|
+
const outputPath = path_1.default.resolve(process.cwd(), destination);
|
|
15
|
+
if (!fs_1.default.existsSync(outputPath)) {
|
|
16
|
+
console.log('[Codegen] Creating Sitecore directory:', destination);
|
|
17
|
+
fs_1.default.mkdirSync(outputPath, { recursive: true });
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -8,6 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import loadCliConfig from '../../utils/load-config';
|
|
11
|
+
import { ensureSitecoreDirectory } from '../../utils/ensure-sitecore-directory';
|
|
11
12
|
export const command = ['build', 'b'];
|
|
12
13
|
export const describe = 'Performs build time automation';
|
|
13
14
|
export const builder = {
|
|
@@ -23,6 +24,7 @@ export const builder = {
|
|
|
23
24
|
*/
|
|
24
25
|
export function handler(argv) {
|
|
25
26
|
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
ensureSitecoreDirectory();
|
|
26
28
|
const cliConfig = loadCliConfig(argv.config);
|
|
27
29
|
if (cliConfig.build && Array.isArray(cliConfig.build.commands)) {
|
|
28
30
|
for (const command of cliConfig.build.commands) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { constants } from '@sitecore-content-sdk/core';
|
|
2
2
|
import { watchItems } from '../../../utils/watch-items';
|
|
3
3
|
import loadCliConfig from '../../../utils/load-config';
|
|
4
|
+
import { ensureSitecoreDirectory } from '../../../utils/ensure-sitecore-directory';
|
|
4
5
|
const { ERROR_MESSAGES } = constants;
|
|
5
6
|
/**
|
|
6
7
|
* @param {Argv} yargs
|
|
@@ -39,6 +40,7 @@ export function handler(argv) {
|
|
|
39
40
|
}
|
|
40
41
|
const componentMapGenerator = cliConfig.componentMap.generator;
|
|
41
42
|
const { paths, destination, componentImports, exclude, clientComponentMap, includeVariants } = cliConfig.componentMap;
|
|
43
|
+
ensureSitecoreDirectory(destination);
|
|
42
44
|
if (argv.watch) {
|
|
43
45
|
console.log(`Watching for component changes to component builder sources in:\n ${paths.join('\n')}`);
|
|
44
46
|
watchItems(paths, componentMapGenerator.bind(null, {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
/**
|
|
4
|
+
* Ensures the Sitecore output directory exists, creating it if necessary.
|
|
5
|
+
* @param {string} destination Relative path to the output directory.
|
|
6
|
+
*/
|
|
7
|
+
export function ensureSitecoreDirectory(destination = '.sitecore') {
|
|
8
|
+
const outputPath = path.resolve(process.cwd(), destination);
|
|
9
|
+
if (!fs.existsSync(outputPath)) {
|
|
10
|
+
console.log('[Codegen] Creating Sitecore directory:', destination);
|
|
11
|
+
fs.mkdirSync(outputPath, { recursive: true });
|
|
12
|
+
}
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sitecore-content-sdk/cli",
|
|
3
|
-
"version": "2.2.0-canary.
|
|
3
|
+
"version": "2.2.0-canary.20260619085214",
|
|
4
4
|
"description": "Sitecore Content SDK CLI",
|
|
5
5
|
"main": "dist/cjs/cli.js",
|
|
6
6
|
"module": "dist/esm/cli.js",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"url": "https://github.com/sitecore/content-sdk/issues"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@sitecore-content-sdk/content": "
|
|
38
|
-
"@sitecore-content-sdk/core": "2.
|
|
37
|
+
"@sitecore-content-sdk/content": "2.2.0-canary.20260619085214",
|
|
38
|
+
"@sitecore-content-sdk/core": "2.1.1-canary.20260619085214",
|
|
39
39
|
"chokidar": "^4.0.3",
|
|
40
40
|
"dotenv": "^16.5.0",
|
|
41
41
|
"dotenv-expand": "^12.0.2",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/scripts/project/build.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/scripts/project/build.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,UAAiB,CAAC;AAEtC,eAAO,MAAM,QAAQ,mCAAmC,CAAC;AAEzD,eAAO,MAAM,OAAO;;;;;;CAOnB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;GAGG;AACH,wBAAsB,OAAO,CAAC,IAAI,EAAE,SAAS,iBAY5C"}
|
|
@@ -1 +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;
|
|
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;AAQ7B;;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;;;;GAiBnD;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,kBAAkB,QAwC/C"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ensures the Sitecore output directory exists, creating it if necessary.
|
|
3
|
+
* @param {string} destination Relative path to the output directory.
|
|
4
|
+
*/
|
|
5
|
+
export declare function ensureSitecoreDirectory(destination?: string): void;
|
|
6
|
+
//# sourceMappingURL=ensure-sitecore-directory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ensure-sitecore-directory.d.ts","sourceRoot":"","sources":["../../src/utils/ensure-sitecore-directory.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,WAAW,SAAc,QAMhE"}
|