@tinkoff-monorepo/pkgs-collector-workspaces 3.101.4 → 3.101.6
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/lib/index.js +36 -39
- package/lib/index.js.map +1 -1
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -6,48 +6,45 @@ const glob_1 = tslib_1.__importDefault(require("glob"));
|
|
|
6
6
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
7
7
|
exports.Collector = {
|
|
8
8
|
name: '@tinkoff-monorepo/pkgs-collector-workspaces',
|
|
9
|
-
collect() {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const pkgJson = require(pkgJsonPath);
|
|
34
|
-
const absPath = path_1.default.dirname(pkgJsonPath);
|
|
35
|
-
return {
|
|
36
|
-
path: path_1.default.relative(process.cwd(), absPath),
|
|
37
|
-
absPath,
|
|
38
|
-
manifestPath: pkgJsonPath,
|
|
39
|
-
name: pkgJson.name,
|
|
40
|
-
meta: pkgJson,
|
|
41
|
-
};
|
|
42
|
-
});
|
|
43
|
-
if (!pkgs.length) {
|
|
44
|
-
throw new Error(`No packages found in workspaces:\n${pkgDirs.join('\n')}\n`);
|
|
45
|
-
}
|
|
9
|
+
async collect() {
|
|
10
|
+
const rootPkgJson = require(path_1.default.resolve('package.json'));
|
|
11
|
+
const pkgDirs = Array.isArray(rootPkgJson.workspaces)
|
|
12
|
+
? rootPkgJson.workspaces
|
|
13
|
+
: rootPkgJson.workspaces?.packages;
|
|
14
|
+
if (!pkgDirs) {
|
|
15
|
+
throw new Error('No workspaces in package.json found! Consider using different collector');
|
|
16
|
+
}
|
|
17
|
+
const pkgs = pkgDirs
|
|
18
|
+
.reduce((acc, dirPattern) => {
|
|
19
|
+
return acc.concat(glob_1.default.sync(dirPattern.endsWith('/') ? dirPattern : `${dirPattern}/`, {
|
|
20
|
+
ignore: ['**/node_modules/**'],
|
|
21
|
+
absolute: true,
|
|
22
|
+
}));
|
|
23
|
+
}, [])
|
|
24
|
+
.reduce((files, dir) => {
|
|
25
|
+
return files.concat(glob_1.default.sync('package.json', {
|
|
26
|
+
cwd: dir,
|
|
27
|
+
absolute: true,
|
|
28
|
+
}));
|
|
29
|
+
}, [])
|
|
30
|
+
.map((pkgJsonPath) => {
|
|
31
|
+
const pkgJson = require(pkgJsonPath);
|
|
32
|
+
const absPath = path_1.default.dirname(pkgJsonPath);
|
|
46
33
|
return {
|
|
47
|
-
|
|
48
|
-
|
|
34
|
+
path: path_1.default.relative(process.cwd(), absPath),
|
|
35
|
+
absPath,
|
|
36
|
+
manifestPath: pkgJsonPath,
|
|
37
|
+
name: pkgJson.name,
|
|
38
|
+
meta: pkgJson,
|
|
49
39
|
};
|
|
50
40
|
});
|
|
41
|
+
if (!pkgs.length) {
|
|
42
|
+
throw new Error(`No packages found in workspaces:\n${pkgDirs.join('\n')}\n`);
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
allPkgs: pkgs,
|
|
46
|
+
affectedPkgs: pkgs,
|
|
47
|
+
};
|
|
51
48
|
},
|
|
52
49
|
};
|
|
53
50
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,wDAAwB;AACxB,wDAAwB;AAGX,QAAA,SAAS,GAAuB;IAC3C,IAAI,EAAE,6CAA6C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings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AAE,cAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,CAAC;gBAC3C,OAAO;gBACP,YAAY,EAAE,WAAW;gBACzB,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,IAAI,EAAE,OAAO;aACd,CAAC;QACJ,CAAC,CAAC,CAAC;QAEL,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YAChB,MAAM,IAAI,KAAK,CAAC,qCAAqC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAC9E;QAED,OAAO;YACL,OAAO,EAAE,IAAI;YACb,YAAY,EAAE,IAAI;SACnB,CAAC;IACJ,CAAC;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinkoff-monorepo/pkgs-collector-workspaces",
|
|
3
|
-
"version": "3.101.
|
|
3
|
+
"version": "3.101.6",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
],
|
|
17
17
|
"license": "Apache-2.0",
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@tinkoff-monorepo/pkgs-collector": "3.101.
|
|
19
|
+
"@tinkoff-monorepo/pkgs-collector": "3.101.6",
|
|
20
20
|
"glob": "^7.1.6"
|
|
21
21
|
}
|
|
22
22
|
}
|