@sitecore-jss/sitecore-jss-dev-tools 22.2.0-canary.81 → 22.2.0-canary.84
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.
|
@@ -1,36 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.getMetadata = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
6
9
|
/**
|
|
7
10
|
* Get application metadata
|
|
8
11
|
*/
|
|
9
12
|
function getMetadata() {
|
|
10
13
|
const metadata = { packages: {} };
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
* @param {Package[]} scPackages list of packages
|
|
26
|
-
* @returns {Record<string, string>} an object with the packages with their exact versions
|
|
27
|
-
*/
|
|
28
|
-
function getPackagesFromQueryResult(scPackages) {
|
|
29
|
-
const packages = {};
|
|
30
|
-
scPackages.forEach((scPackage) => {
|
|
31
|
-
if (trackedScopes.some((trackedScope) => scPackage.name.startsWith(trackedScope))) {
|
|
32
|
-
packages[scPackage.name] = scPackage.version;
|
|
14
|
+
const trackedScopes = ['@sitecore', '@sitecore-cloudsdk', '@sitecore-feaas', '@sitecore-jss'];
|
|
15
|
+
const dirs = fs_1.default.readdirSync('node_modules');
|
|
16
|
+
dirs.forEach((dir) => {
|
|
17
|
+
if (trackedScopes.includes(dir)) {
|
|
18
|
+
const packageNames = fs_1.default.readdirSync(path_1.default.join('node_modules', dir));
|
|
19
|
+
packageNames.forEach((pkg) => {
|
|
20
|
+
try {
|
|
21
|
+
const json = JSON.parse(fs_1.default.readFileSync(path_1.default.join('node_modules', dir, pkg, 'package.json'), 'utf8'));
|
|
22
|
+
metadata.packages[json.name] = json.version;
|
|
23
|
+
}
|
|
24
|
+
catch (e) {
|
|
25
|
+
console.error(`Failed to read/parse package.json for ${pkg}`, e);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
33
28
|
}
|
|
34
29
|
});
|
|
35
|
-
return
|
|
30
|
+
return metadata;
|
|
36
31
|
}
|
|
32
|
+
exports.getMetadata = getMetadata;
|
|
@@ -1,32 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
3
|
/**
|
|
4
4
|
* Get application metadata
|
|
5
5
|
*/
|
|
6
6
|
export function getMetadata() {
|
|
7
7
|
const metadata = { packages: {} };
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
* @returns {Record<string, string>} an object with the packages with their exact versions
|
|
23
|
-
*/
|
|
24
|
-
function getPackagesFromQueryResult(scPackages) {
|
|
25
|
-
const packages = {};
|
|
26
|
-
scPackages.forEach((scPackage) => {
|
|
27
|
-
if (trackedScopes.some((trackedScope) => scPackage.name.startsWith(trackedScope))) {
|
|
28
|
-
packages[scPackage.name] = scPackage.version;
|
|
8
|
+
const trackedScopes = ['@sitecore', '@sitecore-cloudsdk', '@sitecore-feaas', '@sitecore-jss'];
|
|
9
|
+
const dirs = fs.readdirSync('node_modules');
|
|
10
|
+
dirs.forEach((dir) => {
|
|
11
|
+
if (trackedScopes.includes(dir)) {
|
|
12
|
+
const packageNames = fs.readdirSync(path.join('node_modules', dir));
|
|
13
|
+
packageNames.forEach((pkg) => {
|
|
14
|
+
try {
|
|
15
|
+
const json = JSON.parse(fs.readFileSync(path.join('node_modules', dir, pkg, 'package.json'), 'utf8'));
|
|
16
|
+
metadata.packages[json.name] = json.version;
|
|
17
|
+
}
|
|
18
|
+
catch (e) {
|
|
19
|
+
console.error(`Failed to read/parse package.json for ${pkg}`, e);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
29
22
|
}
|
|
30
23
|
});
|
|
31
|
-
return
|
|
24
|
+
return metadata;
|
|
32
25
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sitecore-jss/sitecore-jss-dev-tools",
|
|
3
|
-
"version": "22.2.0-canary.
|
|
3
|
+
"version": "22.2.0-canary.84",
|
|
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",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@babel/parser": "^7.24.0",
|
|
36
|
-
"@sitecore-jss/sitecore-jss": "^22.2.0-canary.
|
|
36
|
+
"@sitecore-jss/sitecore-jss": "^22.2.0-canary.84",
|
|
37
37
|
"axios": "^1.3.2",
|
|
38
38
|
"chalk": "^4.1.2",
|
|
39
39
|
"chokidar": "^3.6.0",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"typescript": "~4.9.5"
|
|
87
87
|
},
|
|
88
88
|
"types": "types/index.d.ts",
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "c960f8732e2c72b994abb2dd3496a6f1bfda935b",
|
|
90
90
|
"files": [
|
|
91
91
|
"dist",
|
|
92
92
|
"types",
|