@tinkoff-monorepo/pkgs-collector-workspaces 3.101.3 → 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 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
- var _a;
11
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
12
- const rootPkgJson = require(path_1.default.resolve('package.json'));
13
- const pkgDirs = Array.isArray(rootPkgJson.workspaces)
14
- ? rootPkgJson.workspaces
15
- : (_a = rootPkgJson.workspaces) === null || _a === void 0 ? void 0 : _a.packages;
16
- if (!pkgDirs) {
17
- throw new Error('No workspaces in package.json found! Consider using different collector');
18
- }
19
- const pkgs = pkgDirs
20
- .reduce((acc, dirPattern) => {
21
- return acc.concat(glob_1.default.sync(dirPattern.endsWith('/') ? dirPattern : `${dirPattern}/`, {
22
- ignore: ['**/node_modules/**'],
23
- absolute: true,
24
- }));
25
- }, [])
26
- .reduce((files, dir) => {
27
- return files.concat(glob_1.default.sync('package.json', {
28
- cwd: dir,
29
- absolute: true,
30
- }));
31
- }, [])
32
- .map((pkgJsonPath) => {
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
- allPkgs: pkgs,
48
- affectedPkgs: pkgs,
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;IAE7C,OAAO;;;YACX,MAAM,WAAW,GAAG,OAAO,CAAC,cAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC;YAE1D,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC;gBACnD,CAAC,CAAE,WAAW,CAAC,UAAuB;gBACtC,CAAC,CAAE,MAAA,WAAW,CAAC,UAAU,0CAAE,QAAqB,CAAC;YAEnD,IAAI,CAAC,OAAO,EAAE;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AAO,CAAC,WAAW,CAAC,CAAC;YACrC,MAAM,OAAO,GAAG,cAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;YAC1C,OAAO;gBACL,IAAI,EAAE,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",
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.3",
19
+ "@tinkoff-monorepo/pkgs-collector": "3.101.6",
20
20
  "glob": "^7.1.6"
21
21
  }
22
22
  }