@sitecore-jss/sitecore-jss-dev-tools 22.3.0-canary.11 → 22.3.0-canary.13
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/clean.js +1 -2
- package/dist/cjs/deploy.js +1 -2
- package/dist/cjs/digest.js +2 -3
- package/dist/cjs/disconnected-server/create-default-disconnected-server.js +1 -2
- package/dist/cjs/disconnected-server/default-document.js +1 -2
- package/dist/cjs/disconnected-server/dictionary-service.js +1 -2
- package/dist/cjs/disconnected-server/layout-service.js +2 -3
- package/dist/cjs/disconnected-server/media-service.js +1 -2
- package/dist/cjs/manifest/generator/SitecoreIcon.js +1 -1
- package/dist/cjs/manifest/generator/generate.js +8 -11
- package/dist/cjs/manifest/generator/manifest.babel-shim.js +7 -8
- package/dist/cjs/manifest/generator/manifest.types.js +4 -4
- package/dist/cjs/manifest/generator/pipelines/generateManifest/generateMedia.js +1 -1
- package/dist/cjs/manifest/generator/pipelines/generateManifest/generatePlaceholders.js +1 -1
- package/dist/cjs/manifest/generator/pipelines/generateMedia/utils.js +3 -3
- package/dist/cjs/manifest/generator/traversal.js +4 -7
- package/dist/cjs/manifest/generator/utils.js +11 -11
- package/dist/cjs/package-deploy.js +10 -11
- package/dist/cjs/package-generate.js +1 -2
- package/dist/cjs/pipelines/configLoader.js +1 -1
- package/dist/cjs/pipelines/index.js +1 -1
- package/dist/cjs/pipelines/pipeline.js +3 -3
- package/dist/cjs/pipelines/utils.js +3 -4
- package/dist/cjs/resolve-scjssconfig.js +1 -2
- package/dist/cjs/setup/find-app-name.js +2 -3
- package/dist/cjs/setup/secret-patch.js +2 -3
- package/dist/cjs/setup/setup.js +2 -2
- package/dist/cjs/templating/components.js +1 -2
- package/dist/cjs/templating/metadata.js +1 -2
- package/dist/cjs/templating/nextjs/component-props.loader.js +1 -1
- package/dist/cjs/templating/nextjs/generate-component-builder.js +6 -7
- package/dist/cjs/templating/plugins.js +5 -5
- package/dist/cjs/templating/react/generate-component-builder.js +5 -6
- package/dist/cjs/templating/scaffold.js +2 -3
- package/dist/cjs/templating/utils.js +2 -3
- package/dist/esm/manifest/generator/generate.js +6 -8
- package/dist/esm/manifest/generator/pipelines/generateManifest/generateMedia.js +1 -1
- package/dist/esm/manifest/generator/pipelines/generateManifest/generatePlaceholders.js +1 -1
- package/dist/esm/manifest/generator/pipelines/generateMedia/utils.js +1 -1
- package/dist/esm/manifest/generator/traversal.js +0 -3
- package/dist/esm/manifest/generator/utils.js +4 -4
- package/dist/esm/package-deploy.js +2 -2
- package/dist/esm/pipelines/configLoader.js +1 -1
- package/dist/esm/pipelines/pipeline.js +3 -3
- package/dist/esm/pipelines/utils.js +1 -1
- package/dist/esm/templating/nextjs/generate-component-builder.js +3 -3
- package/dist/esm/templating/plugins.js +1 -1
- package/dist/esm/templating/react/generate-component-builder.js +2 -2
- package/package.json +7 -7
- package/types/manifest/generator/generate.d.ts +0 -2
- package/types/manifest/generator/pipelines/generateManifest/generateContentItems.d.ts +1 -1
- package/types/manifest/generator/pipelines/generateManifest/generateDictionary.d.ts +1 -1
- package/types/manifest/generator/pipelines/generateManifest/generatePlaceholders.d.ts +1 -1
- package/types/manifest/generator/pipelines/generateManifest/generateRenderings.d.ts +1 -1
- package/types/manifest/generator/pipelines/generateManifest/generateRouteItems.d.ts +1 -1
- package/types/manifest/generator/traversal.d.ts +0 -3
- package/types/manifest/generator/utils.d.ts +5 -6
- package/types/manifest/generator/validators.d.ts +2 -2
- package/types/manifest/utils.d.ts +1 -1
- package/types/package-deploy.d.ts +6 -9
- package/types/pipelines/configLoader.d.ts +5 -5
- package/types/pipelines/pipeline.d.ts +1 -1
- package/types/pipelines/utils.d.ts +3 -3
- package/types/templating/nextjs/generate-component-builder.d.ts +3 -3
- package/types/templating/plugins.d.ts +1 -1
- package/types/templating/react/generate-component-builder.d.ts +2 -2
|
@@ -3,7 +3,8 @@ 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.
|
|
6
|
+
exports.findAppNameInConfig = findAppNameInConfig;
|
|
7
|
+
exports.findAppNameInContents = findAppNameInContents;
|
|
7
8
|
const fs_1 = __importDefault(require("fs"));
|
|
8
9
|
/**
|
|
9
10
|
* @param {string} path
|
|
@@ -15,7 +16,6 @@ function findAppNameInConfig(path) {
|
|
|
15
16
|
const file = fs_1.default.readFileSync(path, 'utf8');
|
|
16
17
|
return findAppNameInContents(file);
|
|
17
18
|
}
|
|
18
|
-
exports.findAppNameInConfig = findAppNameInConfig;
|
|
19
19
|
/**
|
|
20
20
|
* @param {string} contents
|
|
21
21
|
*/
|
|
@@ -26,4 +26,3 @@ function findAppNameInContents(contents) {
|
|
|
26
26
|
}
|
|
27
27
|
return null;
|
|
28
28
|
}
|
|
29
|
-
exports.findAppNameInContents = findAppNameInContents;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.writeSecretPatchFile = writeSecretPatchFile;
|
|
4
|
+
exports.createSecretPatchContents = createSecretPatchContents;
|
|
4
5
|
const fs_1 = require("fs");
|
|
5
6
|
/**
|
|
6
7
|
* @param {string} path
|
|
@@ -10,7 +11,6 @@ const fs_1 = require("fs");
|
|
|
10
11
|
function writeSecretPatchFile(path, appName, secret) {
|
|
11
12
|
(0, fs_1.writeFileSync)(path, createSecretPatchContents(appName, secret), { encoding: 'utf8' });
|
|
12
13
|
}
|
|
13
|
-
exports.writeSecretPatchFile = writeSecretPatchFile;
|
|
14
14
|
/**
|
|
15
15
|
* @param {string} appName
|
|
16
16
|
* @param {string} secret
|
|
@@ -30,4 +30,3 @@ function createSecretPatchContents(appName, secret) {
|
|
|
30
30
|
</configuration>
|
|
31
31
|
`;
|
|
32
32
|
}
|
|
33
|
-
exports.createSecretPatchContents = createSecretPatchContents;
|
package/dist/cjs/setup/setup.js
CHANGED
|
@@ -3,7 +3,8 @@ 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.
|
|
6
|
+
exports.userConfigPath = void 0;
|
|
7
|
+
exports.setup = setup;
|
|
7
8
|
const chalk_1 = __importDefault(require("chalk"));
|
|
8
9
|
const fs_1 = __importDefault(require("fs"));
|
|
9
10
|
const glob_1 = __importDefault(require("glob"));
|
|
@@ -193,4 +194,3 @@ function setup(interactive, outputFile, initialData, configName = 'sitecore') {
|
|
|
193
194
|
}
|
|
194
195
|
console.log(`* Test your app in integrated mode by visiting ${chalk_1.default.green(configObject.layoutServiceHost)}`);
|
|
195
196
|
}
|
|
196
|
-
exports.setup = setup;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getComponentList =
|
|
3
|
+
exports.getComponentList = getComponentList;
|
|
4
4
|
const utils_1 = require("./utils");
|
|
5
5
|
/**
|
|
6
6
|
* Get list of components from @var path
|
|
@@ -24,4 +24,3 @@ function getComponentList(path) {
|
|
|
24
24
|
});
|
|
25
25
|
return components;
|
|
26
26
|
}
|
|
27
|
-
exports.getComponentList = getComponentList;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getMetadata =
|
|
3
|
+
exports.getMetadata = getMetadata;
|
|
4
4
|
const child_process_1 = require("child_process");
|
|
5
5
|
const trackedScopes = ['@sitecore', '@sitecore-cloudsdk', '@sitecore-feaas', '@sitecore-jss'];
|
|
6
6
|
/**
|
|
@@ -19,7 +19,6 @@ function getMetadata() {
|
|
|
19
19
|
metadata.packages = getPackagesFromQueryResult(queryResult);
|
|
20
20
|
return metadata;
|
|
21
21
|
}
|
|
22
|
-
exports.getMetadata = getMetadata;
|
|
23
22
|
/**
|
|
24
23
|
* Retrieve all packages of the tracked scopes with their exact versions
|
|
25
24
|
* @param {Package[]} scPackages list of packages
|
|
@@ -23,6 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.default = componentPropsLoader;
|
|
26
27
|
const recast = __importStar(require("recast"));
|
|
27
28
|
/**
|
|
28
29
|
* Webpack loader to strip functions from the source code
|
|
@@ -88,4 +89,3 @@ function componentPropsLoader(source) {
|
|
|
88
89
|
// Generate the output code
|
|
89
90
|
return recast.print(ast).code;
|
|
90
91
|
}
|
|
91
|
-
exports.default = componentPropsLoader;
|
|
@@ -3,7 +3,9 @@ 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.
|
|
6
|
+
exports.generateComponentBuilder = generateComponentBuilder;
|
|
7
|
+
exports.watchComponentBuilder = watchComponentBuilder;
|
|
8
|
+
exports.writeComponentBuilder = writeComponentBuilder;
|
|
7
9
|
const path_1 = __importDefault(require("path"));
|
|
8
10
|
const fs_1 = __importDefault(require("fs"));
|
|
9
11
|
const component_builder_1 = require("./templates/component-builder");
|
|
@@ -14,7 +16,7 @@ const defaultComponentBuilderOutputPath = 'src/temp/componentBuilder.ts';
|
|
|
14
16
|
const defaultComponentRootPath = 'src/components';
|
|
15
17
|
/**
|
|
16
18
|
* Generate component builder based on provided settings
|
|
17
|
-
* @param {
|
|
19
|
+
* @param {object} [settings] settings for component builder generation
|
|
18
20
|
* @param {string} [settings.componentRootPath] path to components root
|
|
19
21
|
* @param {string} [settings.componentBuilderOutputPath] path to component builder output
|
|
20
22
|
* @param {PackageDefinition[]} [settings.packages] list of packages to include in component builder
|
|
@@ -29,10 +31,9 @@ function generateComponentBuilder({ componentRootPath = defaultComponentRootPath
|
|
|
29
31
|
writeComponentBuilder({ componentRootPath, componentBuilderOutputPath, packages, components });
|
|
30
32
|
}
|
|
31
33
|
}
|
|
32
|
-
exports.generateComponentBuilder = generateComponentBuilder;
|
|
33
34
|
/**
|
|
34
35
|
* Watch for changes to component builder sources
|
|
35
|
-
* @param {
|
|
36
|
+
* @param {object} settings settings for component builder generation
|
|
36
37
|
* @param {string} settings.componentRootPath path to components root
|
|
37
38
|
* @param {string} settings.componentBuilderOutputPath path to component builder output
|
|
38
39
|
* @param {PackageDefinition[]} settings.packages list of packages to include in component builder
|
|
@@ -47,10 +48,9 @@ function watchComponentBuilder({ componentRootPath, componentBuilderOutputPath,
|
|
|
47
48
|
components,
|
|
48
49
|
}));
|
|
49
50
|
}
|
|
50
|
-
exports.watchComponentBuilder = watchComponentBuilder;
|
|
51
51
|
/**
|
|
52
52
|
* Write component builder to file
|
|
53
|
-
* @param {
|
|
53
|
+
* @param {object} settings settings for component builder generation
|
|
54
54
|
* @param {string} settings.componentRootPath path to components root
|
|
55
55
|
* @param {string} settings.componentBuilderOutputPath path to component builder output
|
|
56
56
|
* @param {PackageDefinition[]} settings.packages list of packages to include in component builder
|
|
@@ -69,4 +69,3 @@ function writeComponentBuilder({ componentRootPath, componentBuilderOutputPath,
|
|
|
69
69
|
encoding: 'utf8',
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
-
exports.writeComponentBuilder = writeComponentBuilder;
|
|
@@ -3,7 +3,9 @@ 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.
|
|
6
|
+
exports.ModuleType = void 0;
|
|
7
|
+
exports.getPluginList = getPluginList;
|
|
8
|
+
exports.generatePlugins = generatePlugins;
|
|
7
9
|
const fs_1 = __importDefault(require("fs"));
|
|
8
10
|
const path_1 = __importDefault(require("path"));
|
|
9
11
|
const utils_1 = require("./utils");
|
|
@@ -14,7 +16,7 @@ var ModuleType;
|
|
|
14
16
|
(function (ModuleType) {
|
|
15
17
|
ModuleType[ModuleType["CJS"] = 0] = "CJS";
|
|
16
18
|
ModuleType[ModuleType["ESM"] = 1] = "ESM";
|
|
17
|
-
})(ModuleType
|
|
19
|
+
})(ModuleType || (exports.ModuleType = ModuleType = {}));
|
|
18
20
|
/**
|
|
19
21
|
* Get list of plugins from @var path
|
|
20
22
|
* Returns a list of plugins in the following format:
|
|
@@ -23,7 +25,7 @@ var ModuleType;
|
|
|
23
25
|
* name: 'fooPlugin'
|
|
24
26
|
* }
|
|
25
27
|
* @example getPluginList('src/foo/plugins', 'Foo')
|
|
26
|
-
* @param {
|
|
28
|
+
* @param {object} definition plugin definition
|
|
27
29
|
* @param {string} definition.path path to get plugin from
|
|
28
30
|
* @param {string} definition.pluginName plugin name
|
|
29
31
|
* @param {boolean} [definition.silent] whether to suppress console output
|
|
@@ -39,7 +41,6 @@ function getPluginList({ path, pluginName, silent = false, }) {
|
|
|
39
41
|
});
|
|
40
42
|
return plugins;
|
|
41
43
|
}
|
|
42
|
-
exports.getPluginList = getPluginList;
|
|
43
44
|
/**
|
|
44
45
|
* Generates the plugins file and saves it to the filesystem.
|
|
45
46
|
* By convention, we expect to find plugins under {pluginName}/plugins/** (subfolders are searched recursively).
|
|
@@ -75,4 +76,3 @@ function generatePlugins(definition) {
|
|
|
75
76
|
encoding: 'utf8',
|
|
76
77
|
});
|
|
77
78
|
}
|
|
78
|
-
exports.generatePlugins = generatePlugins;
|
|
@@ -3,7 +3,9 @@ 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.
|
|
6
|
+
exports.generateComponentBuilder = generateComponentBuilder;
|
|
7
|
+
exports.watchComponentBuilder = watchComponentBuilder;
|
|
8
|
+
exports.writeComponentBuilder = writeComponentBuilder;
|
|
7
9
|
const path_1 = __importDefault(require("path"));
|
|
8
10
|
const fs_1 = __importDefault(require("fs"));
|
|
9
11
|
const component_builder_1 = require("./templates/component-builder");
|
|
@@ -14,7 +16,7 @@ const componentBuilderOutputPath = 'src/temp/componentBuilder.js';
|
|
|
14
16
|
const defaultComponentRootPath = 'src/components';
|
|
15
17
|
/**
|
|
16
18
|
* Generate component builder based on provided settings
|
|
17
|
-
* @param {
|
|
19
|
+
* @param {object} settings settings for component builder generation
|
|
18
20
|
* @param {string} settings.componentRootPath path to components root
|
|
19
21
|
* @param {PackageDefinition[]} [settings.packages] list of packages to include in component builder
|
|
20
22
|
* @param {ComponentFile[]} [settings.components] list of components to include in component builder
|
|
@@ -28,7 +30,6 @@ function generateComponentBuilder({ componentRootPath = defaultComponentRootPath
|
|
|
28
30
|
writeComponentBuilder({ componentRootPath, packages, components });
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
|
-
exports.generateComponentBuilder = generateComponentBuilder;
|
|
32
33
|
/**
|
|
33
34
|
* Watch for changes to component builder sources
|
|
34
35
|
* @param {object} config configuration for component builder watcher
|
|
@@ -40,10 +41,9 @@ function watchComponentBuilder({ componentRootPath, packages, components, }) {
|
|
|
40
41
|
console.log(`Watching for changes to component builder sources in ${componentRootPath}...`);
|
|
41
42
|
(0, utils_1.watchItems)([componentRootPath], writeComponentBuilder.bind(null, { componentRootPath, packages, components }));
|
|
42
43
|
}
|
|
43
|
-
exports.watchComponentBuilder = watchComponentBuilder;
|
|
44
44
|
/**
|
|
45
45
|
* Write component builder to file
|
|
46
|
-
* @param {
|
|
46
|
+
* @param {object} settings settings for component builder generation
|
|
47
47
|
* @param {string} settings.componentRootPath root path to components
|
|
48
48
|
* @param {PackageDefinition[]} settings.packages packages to include in component builder
|
|
49
49
|
* @param {ComponentFile[]} settings.components list of components to include in component builder
|
|
@@ -61,4 +61,3 @@ function writeComponentBuilder({ componentRootPath, packages, components, }) {
|
|
|
61
61
|
encoding: 'utf8',
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
|
-
exports.writeComponentBuilder = writeComponentBuilder;
|
|
@@ -3,7 +3,8 @@ 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.
|
|
6
|
+
exports.editLineEndings = editLineEndings;
|
|
7
|
+
exports.scaffoldFile = scaffoldFile;
|
|
7
8
|
const fs_1 = __importDefault(require("fs"));
|
|
8
9
|
const chalk_1 = __importDefault(require("chalk"));
|
|
9
10
|
const path_1 = __importDefault(require("path"));
|
|
@@ -15,7 +16,6 @@ const path_1 = __importDefault(require("path"));
|
|
|
15
16
|
function editLineEndings(content) {
|
|
16
17
|
return content.replace(/\r|\n/gm, '\r\n');
|
|
17
18
|
}
|
|
18
|
-
exports.editLineEndings = editLineEndings;
|
|
19
19
|
/**
|
|
20
20
|
* Creates a file relative to the specified path if the file doesn't exist.
|
|
21
21
|
* Creates directories as needed.
|
|
@@ -35,4 +35,3 @@ function scaffoldFile(filePath, fileContent) {
|
|
|
35
35
|
console.log(chalk_1.default.green(`File ${filePath} has been scaffolded.`));
|
|
36
36
|
return filePath;
|
|
37
37
|
}
|
|
38
|
-
exports.scaffoldFile = scaffoldFile;
|
|
@@ -3,7 +3,8 @@ 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.
|
|
6
|
+
exports.getItems = getItems;
|
|
7
|
+
exports.watchItems = watchItems;
|
|
7
8
|
const fs_1 = __importDefault(require("fs"));
|
|
8
9
|
const chokidar_1 = __importDefault(require("chokidar"));
|
|
9
10
|
/**
|
|
@@ -41,7 +42,6 @@ function getItems(settings) {
|
|
|
41
42
|
}
|
|
42
43
|
return items;
|
|
43
44
|
}
|
|
44
|
-
exports.getItems = getItems;
|
|
45
45
|
/**
|
|
46
46
|
* Run watch mode, watching on @var paths
|
|
47
47
|
* @param {string[]} paths paths to watch by chokidar
|
|
@@ -53,4 +53,3 @@ function watchItems(paths, cb) {
|
|
|
53
53
|
.on('add', cb)
|
|
54
54
|
.on('unlink', cb);
|
|
55
55
|
}
|
|
56
|
-
exports.watchItems = watchItems;
|
|
@@ -40,7 +40,7 @@ const processSpecFile = (moduleWrapper, manifest) => __awaiter(void 0, void 0, v
|
|
|
40
40
|
}
|
|
41
41
|
return manifest;
|
|
42
42
|
});
|
|
43
|
-
const processSpecFiles = (
|
|
43
|
+
const processSpecFiles = (_a) => __awaiter(void 0, [_a], void 0, function* ({ fileGlobs, manifestInstance, }) {
|
|
44
44
|
const moduleWrappers = importModules({ fileGlobs });
|
|
45
45
|
let manifest = manifestInstance;
|
|
46
46
|
for (const moduleWrapper of moduleWrappers) {
|
|
@@ -88,7 +88,7 @@ const copyMedia = (mediaPaths, outputPath) => {
|
|
|
88
88
|
throw `Source media file referred to in manifest data doesn't exist: ${mediaSourcePath}`;
|
|
89
89
|
});
|
|
90
90
|
};
|
|
91
|
-
const writeOutput = (
|
|
91
|
+
const writeOutput = (_a) => __awaiter(void 0, [_a], void 0, function* ({ outputPath, manifest, excludeMedia, }) {
|
|
92
92
|
if (outputPath !== 'console') {
|
|
93
93
|
yield fs.ensureFile(outputPath);
|
|
94
94
|
// we copy the media first, because we no longer need the media prop after that
|
|
@@ -105,7 +105,7 @@ const writeOutput = ({ outputPath, manifest, excludeMedia, }) => __awaiter(void
|
|
|
105
105
|
console.log('manifest', JSON.stringify(manifest, null, 2));
|
|
106
106
|
return manifest;
|
|
107
107
|
});
|
|
108
|
-
const getPipelineConfig = (
|
|
108
|
+
const getPipelineConfig = (_a) => __awaiter(void 0, [_a], void 0, function* ({ patchGlobs }) {
|
|
109
109
|
const manifestConfig = yield configLoader({
|
|
110
110
|
fileGlobs: ['./pipelines/**/pipeline.config.js'],
|
|
111
111
|
workingDirectory: __dirname,
|
|
@@ -124,11 +124,10 @@ const getPipelineConfig = ({ patchGlobs }) => __awaiter(void 0, void 0, void 0,
|
|
|
124
124
|
* NOTE: media is not copied into the manifest when using this method,
|
|
125
125
|
* and no files are written to disk. Use generateToFile() to make a manifest
|
|
126
126
|
* that is designed to get packaged/imported.
|
|
127
|
-
*
|
|
128
127
|
* @param {GenerateOptions} config
|
|
129
128
|
*/
|
|
130
|
-
export function generateToVariable(
|
|
131
|
-
return __awaiter(this,
|
|
129
|
+
export function generateToVariable(_a) {
|
|
130
|
+
return __awaiter(this, arguments, void 0, function* ({ requireArg, fileGlobs, pipelines, appName, excludeItems = false, excludeDictionary = false, language, pipelinePatchFileGlobs, debug, wipe, rootPlaceholders, skipPlaceholderBlacklist, }) {
|
|
132
131
|
initRequire(requireArg);
|
|
133
132
|
const finalPipelines = pipelines || (yield getPipelineConfig({ patchGlobs: pipelinePatchFileGlobs }));
|
|
134
133
|
let manifestInstance = createManifestInstance({
|
|
@@ -150,12 +149,11 @@ export function generateToVariable({ requireArg, fileGlobs, pipelines, appName,
|
|
|
150
149
|
/**
|
|
151
150
|
* generates a JSON manifest and writes its contents to a directory. Media referenced in the manifest
|
|
152
151
|
* is also copied to the directory.
|
|
153
|
-
*
|
|
154
152
|
* @param {GenerateToFileOptions} config
|
|
155
153
|
*/
|
|
156
154
|
export function generateToFile(_a) {
|
|
157
|
-
var { outputPath = 'console', excludeMedia = false } = _a, generateToVariableOptions = __rest(_a, ["outputPath", "excludeMedia"]);
|
|
158
155
|
return __awaiter(this, void 0, void 0, function* () {
|
|
156
|
+
var { outputPath = 'console', excludeMedia = false } = _a, generateToVariableOptions = __rest(_a, ["outputPath", "excludeMedia"]);
|
|
159
157
|
const manifestOutput = yield generateToVariable(generateToVariableOptions);
|
|
160
158
|
return writeOutput({ outputPath, manifest: manifestOutput, excludeMedia });
|
|
161
159
|
});
|
|
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { runPipeline } from './../../../../index';
|
|
11
|
-
const generateMedia = (
|
|
11
|
+
const generateMedia = (_a) => __awaiter(void 0, [_a], void 0, function* ({ items, templates, pipelines }) {
|
|
12
12
|
const pipeline = Object.assign({}, pipelines.generateMedia);
|
|
13
13
|
pipeline.args = Object.assign(Object.assign({}, pipeline.args), { routes: items.routes, content: items.nonRoutes, templates,
|
|
14
14
|
pipelines });
|
|
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { runPipeline } from './../../../../index';
|
|
11
|
-
const generatePlaceholders = (
|
|
11
|
+
const generatePlaceholders = (_a) => __awaiter(void 0, [_a], void 0, function* ({ items, renderings, placeholders, pipelines, rootPlaceholders, skipPlaceholderBlacklist, }) {
|
|
12
12
|
const pipeline = Object.assign({}, pipelines.generatePlaceholders);
|
|
13
13
|
const pipelineArgs = Object.assign(Object.assign({}, pipeline.args), { items: items.routes, renderings,
|
|
14
14
|
placeholders, placeholderNames: [], rootPlaceholders,
|
|
@@ -25,7 +25,6 @@ export const traverseItems = (items, callback) => {
|
|
|
25
25
|
* `items` is the root of the tree, eg routes or nonRoutes
|
|
26
26
|
* the callback gets two arguments: the item definition, and the item type
|
|
27
27
|
* ('item', 'rendering', or 'datasource')
|
|
28
|
-
*
|
|
29
28
|
* @param {any[]} items
|
|
30
29
|
* @param {Function} callback
|
|
31
30
|
*/
|
|
@@ -81,7 +80,6 @@ export function traverseAllItems(items, callback) {
|
|
|
81
80
|
}
|
|
82
81
|
/**
|
|
83
82
|
* Traverses every field value in an item array, including all children, datasource items, etc
|
|
84
|
-
*
|
|
85
83
|
* @param {any} items
|
|
86
84
|
* @param {Function} callback
|
|
87
85
|
*/
|
|
@@ -95,7 +93,6 @@ export function traverseAllFields(items, callback) {
|
|
|
95
93
|
}
|
|
96
94
|
/**
|
|
97
95
|
* Traverses all rendering instance definitions in an item tree
|
|
98
|
-
*
|
|
99
96
|
* @param {any} items
|
|
100
97
|
* @param {Function} callback
|
|
101
98
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Iterates the keys of the given object and constructs a new object with keys that satisfy the given filter function.
|
|
3
|
-
* @param {
|
|
3
|
+
* @param {object} obj
|
|
4
4
|
* @param {Function} filter
|
|
5
|
-
* @returns {
|
|
5
|
+
* @returns {object} filtered object
|
|
6
6
|
*/
|
|
7
7
|
export const filterObject = (obj, filter) => Object.keys(obj).reduce((res, key) => {
|
|
8
8
|
if (filter(key, obj[key])) {
|
|
@@ -162,11 +162,11 @@ export function findTemplateForComponent(component, templates) {
|
|
|
162
162
|
}
|
|
163
163
|
/**
|
|
164
164
|
* Validates that a set of field values are defined on their template definitions
|
|
165
|
-
* @param {
|
|
165
|
+
* @param {object} fields
|
|
166
166
|
* @param {TemplateDefinition | ComponentDefinition} template
|
|
167
167
|
* @param {Function} handleError
|
|
168
168
|
* @param {...Array<Array<TemplateDefinition | ComponentDefinition>>} inheritedTemplates
|
|
169
|
-
* @returns {
|
|
169
|
+
* @returns {object} validated fields
|
|
170
170
|
*/
|
|
171
171
|
export function validateFieldDefinitions(fields, template, handleError, ...inheritedTemplates) {
|
|
172
172
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
@@ -65,7 +65,7 @@ export function doFingerprintsMatch(fp1, fp2) {
|
|
|
65
65
|
return normalizeFingerprint(fp1) === normalizeFingerprint(fp2);
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
68
|
-
* @param {
|
|
68
|
+
* @param {object} params
|
|
69
69
|
* @param {string[]} params.warnings
|
|
70
70
|
* @param {string[]} params.errors
|
|
71
71
|
* @param {Function} params.resolve
|
|
@@ -90,7 +90,7 @@ export function finishWatchJobStatusTask({ warnings, errors, resolve, reject, })
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
/**
|
|
93
|
-
* @param {
|
|
93
|
+
* @param {object} params
|
|
94
94
|
* @param {string} params.message
|
|
95
95
|
* @param {string} params.entryLevel
|
|
96
96
|
* @param {string[]} params.warnings
|
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { createPipelinesRegistry } from './pipelinesRegistry';
|
|
11
11
|
import { importModules } from './utils';
|
|
12
12
|
// './**/pipeline.config.js'
|
|
13
|
-
const config = ({ fileGlobs = [], workingDirectory = '', existingConfig = {}, allowEmptyGlobs = false, createPipelinesRegistryImplementation, importModulesImplementation, })
|
|
13
|
+
const config = (_a) => __awaiter(void 0, [_a], void 0, function* ({ fileGlobs = [], workingDirectory = '', existingConfig = {}, allowEmptyGlobs = false, createPipelinesRegistryImplementation, importModulesImplementation, }) {
|
|
14
14
|
if (!fileGlobs || fileGlobs.length === 0) {
|
|
15
15
|
throw new Error('no pipeline config file search patterns specified');
|
|
16
16
|
}
|
|
@@ -32,7 +32,7 @@ const enhanceProcessors = (processors) => processors.map((processor) => {
|
|
|
32
32
|
}
|
|
33
33
|
return processor;
|
|
34
34
|
});
|
|
35
|
-
const runProcessor = (
|
|
35
|
+
const runProcessor = (_a) => __awaiter(void 0, [_a], void 0, function* ({ processor, args }) {
|
|
36
36
|
if (args && args.debug) {
|
|
37
37
|
console.log(`executing processor ${processor.name}`);
|
|
38
38
|
}
|
|
@@ -59,11 +59,11 @@ const runProcessor = ({ processor, args }) => __awaiter(void 0, void 0, void 0,
|
|
|
59
59
|
throw new Error(`Pipeline processor '${processor.name}' does not specify 'modulePath' or 'process'`);
|
|
60
60
|
});
|
|
61
61
|
/**
|
|
62
|
-
* @param {
|
|
62
|
+
* @param {object} args
|
|
63
63
|
* @param {Processor[]} args.processors the processors to run (optional but must be specified if pipeline is not specified)
|
|
64
64
|
* @param {any} args.pipelineArgs arguments to pass to the pipeline processors
|
|
65
65
|
*/
|
|
66
|
-
export const runProcessors = (
|
|
66
|
+
export const runProcessors = (_a) => __awaiter(void 0, [_a], void 0, function* ({ processors, pipelineArgs = {}, }) {
|
|
67
67
|
if (!processors || processors.length === 0) {
|
|
68
68
|
throw new Error('no processors specified to run');
|
|
69
69
|
}
|
|
@@ -95,7 +95,7 @@ export const importModules = ({ fileGlobs = [], workingDirectory = '', allowEmpt
|
|
|
95
95
|
}));
|
|
96
96
|
return modules;
|
|
97
97
|
};
|
|
98
|
-
export const initCompilers = (
|
|
98
|
+
export const initCompilers = (...args_1) => __awaiter(void 0, [...args_1], void 0, function* (compilers = []) {
|
|
99
99
|
if (!compilers || compilers.length === 0) {
|
|
100
100
|
console.warn('no compilers specified for initCompilers');
|
|
101
101
|
return Promise.resolve();
|
|
@@ -8,7 +8,7 @@ const defaultComponentBuilderOutputPath = 'src/temp/componentBuilder.ts';
|
|
|
8
8
|
const defaultComponentRootPath = 'src/components';
|
|
9
9
|
/**
|
|
10
10
|
* Generate component builder based on provided settings
|
|
11
|
-
* @param {
|
|
11
|
+
* @param {object} [settings] settings for component builder generation
|
|
12
12
|
* @param {string} [settings.componentRootPath] path to components root
|
|
13
13
|
* @param {string} [settings.componentBuilderOutputPath] path to component builder output
|
|
14
14
|
* @param {PackageDefinition[]} [settings.packages] list of packages to include in component builder
|
|
@@ -25,7 +25,7 @@ export function generateComponentBuilder({ componentRootPath = defaultComponentR
|
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* Watch for changes to component builder sources
|
|
28
|
-
* @param {
|
|
28
|
+
* @param {object} settings settings for component builder generation
|
|
29
29
|
* @param {string} settings.componentRootPath path to components root
|
|
30
30
|
* @param {string} settings.componentBuilderOutputPath path to component builder output
|
|
31
31
|
* @param {PackageDefinition[]} settings.packages list of packages to include in component builder
|
|
@@ -42,7 +42,7 @@ export function watchComponentBuilder({ componentRootPath, componentBuilderOutpu
|
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
44
|
* Write component builder to file
|
|
45
|
-
* @param {
|
|
45
|
+
* @param {object} settings settings for component builder generation
|
|
46
46
|
* @param {string} settings.componentRootPath path to components root
|
|
47
47
|
* @param {string} settings.componentBuilderOutputPath path to component builder output
|
|
48
48
|
* @param {PackageDefinition[]} settings.packages list of packages to include in component builder
|
|
@@ -17,7 +17,7 @@ export var ModuleType;
|
|
|
17
17
|
* name: 'fooPlugin'
|
|
18
18
|
* }
|
|
19
19
|
* @example getPluginList('src/foo/plugins', 'Foo')
|
|
20
|
-
* @param {
|
|
20
|
+
* @param {object} definition plugin definition
|
|
21
21
|
* @param {string} definition.path path to get plugin from
|
|
22
22
|
* @param {string} definition.pluginName plugin name
|
|
23
23
|
* @param {boolean} [definition.silent] whether to suppress console output
|
|
@@ -8,7 +8,7 @@ const componentBuilderOutputPath = 'src/temp/componentBuilder.js';
|
|
|
8
8
|
const defaultComponentRootPath = 'src/components';
|
|
9
9
|
/**
|
|
10
10
|
* Generate component builder based on provided settings
|
|
11
|
-
* @param {
|
|
11
|
+
* @param {object} settings settings for component builder generation
|
|
12
12
|
* @param {string} settings.componentRootPath path to components root
|
|
13
13
|
* @param {PackageDefinition[]} [settings.packages] list of packages to include in component builder
|
|
14
14
|
* @param {ComponentFile[]} [settings.components] list of components to include in component builder
|
|
@@ -35,7 +35,7 @@ export function watchComponentBuilder({ componentRootPath, packages, components,
|
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
37
|
* Write component builder to file
|
|
38
|
-
* @param {
|
|
38
|
+
* @param {object} settings settings for component builder generation
|
|
39
39
|
* @param {string} settings.componentRootPath root path to components
|
|
40
40
|
* @param {PackageDefinition[]} settings.packages packages to include in component builder
|
|
41
41
|
* @param {ComponentFile[]} settings.components list of components to include in component builder
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sitecore-jss/sitecore-jss-dev-tools",
|
|
3
|
-
"version": "22.3.0-canary.
|
|
3
|
+
"version": "22.3.0-canary.13",
|
|
4
4
|
"description": "Utilities to assist in the development and deployment of Sitecore JSS apps.",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"generate-docs": "npx typedoc --plugin typedoc-plugin-markdown --readme none --out ../../ref-docs/sitecore-jss-dev-tools src/index.ts --githubPages false"
|
|
17
17
|
},
|
|
18
18
|
"engines": {
|
|
19
|
-
"node": ">=
|
|
19
|
+
"node": ">=22"
|
|
20
20
|
},
|
|
21
21
|
"bin": {
|
|
22
22
|
"scjss-deploy": "./dist/cjs/bin/deploy.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@babel/parser": "^7.24.0",
|
|
36
|
-
"@sitecore-jss/sitecore-jss": "^22.3.0-canary.
|
|
36
|
+
"@sitecore-jss/sitecore-jss": "^22.3.0-canary.13",
|
|
37
37
|
"axios": "^1.3.2",
|
|
38
38
|
"chalk": "^4.1.2",
|
|
39
39
|
"chokidar": "^3.6.0",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"@types/glob": "^8.0.1",
|
|
67
67
|
"@types/js-yaml": "^4.0.5",
|
|
68
68
|
"@types/mocha": "^10.0.1",
|
|
69
|
-
"@types/node": "^
|
|
69
|
+
"@types/node": "^22.9.0",
|
|
70
70
|
"@types/readline-sync": "^1.4.4",
|
|
71
71
|
"@types/resolve": "^1.20.2",
|
|
72
72
|
"@types/sinon": "^10.0.13",
|
|
@@ -76,17 +76,17 @@
|
|
|
76
76
|
"chai": "^4.3.7",
|
|
77
77
|
"cross-env": "^7.0.3",
|
|
78
78
|
"del-cli": "^5.0.0",
|
|
79
|
-
"eslint": "^8.
|
|
79
|
+
"eslint": "^8.56.0",
|
|
80
80
|
"mocha": "^10.2.0",
|
|
81
81
|
"nock": "^13.3.0",
|
|
82
82
|
"nyc": "^15.1.0",
|
|
83
83
|
"sinon": "^15.0.1",
|
|
84
84
|
"ts-node": "^10.9.1",
|
|
85
85
|
"tsconfig-paths": "^4.1.2",
|
|
86
|
-
"typescript": "~
|
|
86
|
+
"typescript": "~5.6.3"
|
|
87
87
|
},
|
|
88
88
|
"types": "types/index.d.ts",
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "3594160e4faebace2e135b19675ae9583992a405",
|
|
90
90
|
"files": [
|
|
91
91
|
"dist",
|
|
92
92
|
"types",
|
|
@@ -24,14 +24,12 @@ export interface GenerateToFileOptions extends GenerateOptions {
|
|
|
24
24
|
* NOTE: media is not copied into the manifest when using this method,
|
|
25
25
|
* and no files are written to disk. Use generateToFile() to make a manifest
|
|
26
26
|
* that is designed to get packaged/imported.
|
|
27
|
-
*
|
|
28
27
|
* @param {GenerateOptions} config
|
|
29
28
|
*/
|
|
30
29
|
export declare function generateToVariable({ requireArg, fileGlobs, pipelines, appName, excludeItems, excludeDictionary, language, pipelinePatchFileGlobs, debug, wipe, rootPlaceholders, skipPlaceholderBlacklist, }: GenerateOptions): Promise<ManifestInstance>;
|
|
31
30
|
/**
|
|
32
31
|
* generates a JSON manifest and writes its contents to a directory. Media referenced in the manifest
|
|
33
32
|
* is also copied to the directory.
|
|
34
|
-
*
|
|
35
33
|
* @param {GenerateToFileOptions} config
|
|
36
34
|
*/
|
|
37
35
|
export declare function generateToFile({ outputPath, excludeMedia, ...generateToVariableOptions }: GenerateToFileOptions): Promise<ManifestInstance>;
|
|
@@ -9,7 +9,7 @@ declare const _default: (args: GeneratePipelineArgs) => Promise<{
|
|
|
9
9
|
appName: string;
|
|
10
10
|
templates: TemplateDefinition[];
|
|
11
11
|
placeholders: import("../../manifest.types").PlaceholderDefinition[];
|
|
12
|
-
media?: any[]
|
|
12
|
+
media?: any[];
|
|
13
13
|
dictionary: import("../../manifest.types").DictionaryDefinition[];
|
|
14
14
|
language: string;
|
|
15
15
|
wipeExisting: boolean;
|
|
@@ -9,7 +9,7 @@ declare const _default: (args: GeneratePipelineArgs) => {
|
|
|
9
9
|
nonRoutes: import("../../manifest.types").ItemDefinition[];
|
|
10
10
|
};
|
|
11
11
|
placeholders: import("../../manifest.types").PlaceholderDefinition[];
|
|
12
|
-
media?: any[]
|
|
12
|
+
media?: any[];
|
|
13
13
|
language: string;
|
|
14
14
|
wipeExisting: boolean;
|
|
15
15
|
rootPlaceholders: string[];
|
|
@@ -8,7 +8,7 @@ declare const _default: (args: GeneratePipelineArgs) => Promise<{
|
|
|
8
8
|
routes: import("../../manifest.types").RouteDefinition[];
|
|
9
9
|
nonRoutes: import("../../manifest.types").ItemDefinition[];
|
|
10
10
|
};
|
|
11
|
-
media?: any[]
|
|
11
|
+
media?: any[];
|
|
12
12
|
dictionary: import("../../manifest.types").DictionaryDefinition[];
|
|
13
13
|
language: string;
|
|
14
14
|
wipeExisting: boolean;
|