workspace-tools 0.25.1 → 0.25.4

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/CHANGELOG.json CHANGED
@@ -2,7 +2,251 @@
2
2
  "name": "workspace-tools",
3
3
  "entries": [
4
4
  {
5
- "date": "Thu, 21 Jul 2022 21:21:43 GMT",
5
+ "date": "Thu, 04 Aug 2022 08:01:45 GMT",
6
+ "tag": "workspace-tools_v0.25.4",
7
+ "version": "0.25.4",
8
+ "comments": {
9
+ "none": [
10
+ {
11
+ "author": "email not defined",
12
+ "package": "workspace-tools",
13
+ "commit": "32e204ebc47d7e619b6b16e6b34873e6b1c7a96f",
14
+ "comment": "Pin devDependency @types/micromatch to 4.0.2"
15
+ }
16
+ ],
17
+ "patch": [
18
+ {
19
+ "author": "elcraig@microsoft.com",
20
+ "package": "workspace-tools",
21
+ "commit": "95ad5f346a1ce0c6e4c1b2d5bb173ceeac136aa2",
22
+ "comment": "Switch from multimatch to micromatch"
23
+ }
24
+ ]
25
+ }
26
+ },
27
+ {
28
+ "date": "Wed, 03 Aug 2022 08:01:34 GMT",
29
+ "tag": "workspace-tools_v0.25.3",
30
+ "version": "0.25.3",
31
+ "comments": {
32
+ "none": [
33
+ {
34
+ "author": "renovate@whitesourcesoftware.com",
35
+ "package": "workspace-tools",
36
+ "commit": "c51bca9b331ae106b22ed260b5c045936dd3b723",
37
+ "comment": "Update devDependency gh-pages to v4"
38
+ }
39
+ ],
40
+ "patch": [
41
+ {
42
+ "author": "elcraig@microsoft.com",
43
+ "package": "workspace-tools",
44
+ "commit": "ae076192e9010c32fc90a7cb2a6d1488d382cec6",
45
+ "comment": "Simplify createPackageGraph and getPackageDependencies"
46
+ },
47
+ {
48
+ "author": "elcraig@microsoft.com",
49
+ "package": "workspace-tools",
50
+ "commit": "f81a7c1f61ec402febbc1cc1927343dadefbcdd5",
51
+ "comment": "Update find-up to v5"
52
+ }
53
+ ]
54
+ }
55
+ },
56
+ {
57
+ "date": "Tue, 02 Aug 2022 23:03:14 GMT",
58
+ "tag": "workspace-tools_v0.25.2",
59
+ "version": "0.25.2",
60
+ "comments": {
61
+ "patch": [
62
+ {
63
+ "author": "elcraig@microsoft.com",
64
+ "package": "workspace-tools",
65
+ "commit": "476b210fe32e5ebfc5ab6ac0fc3c209e17767f0b",
66
+ "comment": "Add fs-extra to devDependencies and remove non-dev usage"
67
+ }
68
+ ]
69
+ }
70
+ },
71
+ {
72
+ "date": "Tue, 26 Jul 2022 05:21:19 GMT",
73
+ "tag": "workspace-tools_v0.25.1",
74
+ "version": "0.25.1",
75
+ "comments": {
76
+ "none": [
77
+ {
78
+ "author": "email not defined",
79
+ "package": "workspace-tools",
80
+ "commit": "not available",
81
+ "comment": "Update devDependency @types/tmp to v0.2.3"
82
+ }
83
+ ]
84
+ }
85
+ },
86
+ {
87
+ "date": "Tue, 26 Jul 2022 05:20:52 GMT",
88
+ "tag": "workspace-tools_v0.25.1",
89
+ "version": "0.25.1",
90
+ "comments": {
91
+ "none": [
92
+ {
93
+ "author": "email not defined",
94
+ "package": "workspace-tools",
95
+ "commit": "b1541150f96f183fdc2ec1c07eba08316494ad38",
96
+ "comment": "Update devDependency @types/tmp to v0.2.3"
97
+ },
98
+ {
99
+ "author": "renovate@whitesourcesoftware.com",
100
+ "package": "workspace-tools",
101
+ "commit": "not available",
102
+ "comment": "Update jest monorepo to v28"
103
+ }
104
+ ]
105
+ }
106
+ },
107
+ {
108
+ "date": "Tue, 26 Jul 2022 05:20:33 GMT",
109
+ "tag": "workspace-tools_v0.25.1",
110
+ "version": "0.25.1",
111
+ "comments": {
112
+ "none": [
113
+ {
114
+ "author": "renovate@whitesourcesoftware.com",
115
+ "package": "workspace-tools",
116
+ "commit": "ceb72cdb72daff7d8e303ba61fec567ae880a35e",
117
+ "comment": "Update jest monorepo to v28"
118
+ }
119
+ ]
120
+ }
121
+ },
122
+ {
123
+ "date": "Tue, 26 Jul 2022 03:54:05 GMT",
124
+ "tag": "workspace-tools_v0.25.1",
125
+ "version": "0.25.1",
126
+ "comments": {
127
+ "none": [
128
+ {
129
+ "author": "renovate@whitesourcesoftware.com",
130
+ "package": "workspace-tools",
131
+ "commit": "not available",
132
+ "comment": "Update devDependency @types/yarnpkg__lockfile to v1.1.5"
133
+ }
134
+ ]
135
+ }
136
+ },
137
+ {
138
+ "date": "Tue, 26 Jul 2022 03:53:33 GMT",
139
+ "tag": "workspace-tools_v0.25.1",
140
+ "version": "0.25.1",
141
+ "comments": {
142
+ "none": [
143
+ {
144
+ "author": "renovate@whitesourcesoftware.com",
145
+ "package": "workspace-tools",
146
+ "commit": "215d005bda9685bfd53131078e13aa00fb27f291",
147
+ "comment": "Update devDependency @types/yarnpkg__lockfile to v1.1.5"
148
+ }
149
+ ]
150
+ }
151
+ },
152
+ {
153
+ "date": "Tue, 26 Jul 2022 02:20:08 GMT",
154
+ "tag": "workspace-tools_v0.25.1",
155
+ "version": "0.25.1",
156
+ "comments": {
157
+ "none": [
158
+ {
159
+ "author": "renovate@whitesourcesoftware.com",
160
+ "package": "workspace-tools",
161
+ "commit": "beb806b17f64ce3d5babf13621e6e3b63bd16f90",
162
+ "comment": "Update devDependency beachball to v2.26.0"
163
+ }
164
+ ]
165
+ }
166
+ },
167
+ {
168
+ "date": "Tue, 26 Jul 2022 02:16:55 GMT",
169
+ "tag": "workspace-tools_v0.25.1",
170
+ "version": "0.25.1",
171
+ "comments": {
172
+ "none": [
173
+ {
174
+ "author": "email not defined",
175
+ "package": "workspace-tools",
176
+ "comment": "Update devDependency @types/jest to v25.2.3",
177
+ "commit": "a4ea3510cab1d33efa55e2644cec7e0d543a6ef2"
178
+ }
179
+ ]
180
+ }
181
+ },
182
+ {
183
+ "date": "Tue, 26 Jul 2022 01:37:45 GMT",
184
+ "tag": "workspace-tools_v0.25.1",
185
+ "version": "0.25.1",
186
+ "comments": {
187
+ "none": [
188
+ {
189
+ "author": "renovate@whitesourcesoftware.com",
190
+ "package": "workspace-tools",
191
+ "comment": "Update devDependency @types/jju to v1.4.2",
192
+ "commit": "f5b7af07f4bcbecb5db1d47589ac7e66f4bae21f"
193
+ }
194
+ ]
195
+ }
196
+ },
197
+ {
198
+ "date": "Tue, 26 Jul 2022 01:37:23 GMT",
199
+ "tag": "workspace-tools_v0.25.1",
200
+ "version": "0.25.1",
201
+ "comments": {
202
+ "none": [
203
+ {
204
+ "author": "renovate@whitesourcesoftware.com",
205
+ "package": "workspace-tools",
206
+ "comment": "Update devDependency @types/jju to v1.4.2",
207
+ "commit": "763800ee9cdb0f39e9748e601cd6fdc8997de64b"
208
+ },
209
+ {
210
+ "author": "email not defined",
211
+ "package": "workspace-tools",
212
+ "comment": "Update devDependency @types/git-url-parse to v9.0.1",
213
+ "commit": "763800ee9cdb0f39e9748e601cd6fdc8997de64b"
214
+ }
215
+ ]
216
+ }
217
+ },
218
+ {
219
+ "date": "Tue, 26 Jul 2022 01:36:52 GMT",
220
+ "tag": "workspace-tools_v0.25.1",
221
+ "version": "0.25.1",
222
+ "comments": {
223
+ "none": [
224
+ {
225
+ "author": "email not defined",
226
+ "package": "workspace-tools",
227
+ "comment": "Update devDependency @types/git-url-parse to v9.0.1",
228
+ "commit": "51be1586f27bd2029028e9c2f035d809f3ce07cb"
229
+ }
230
+ ]
231
+ }
232
+ },
233
+ {
234
+ "date": "Tue, 26 Jul 2022 01:31:27 GMT",
235
+ "tag": "workspace-tools_v0.25.1",
236
+ "version": "0.25.1",
237
+ "comments": {
238
+ "none": [
239
+ {
240
+ "author": "email not defined",
241
+ "package": "workspace-tools",
242
+ "comment": "Pin devDependencies",
243
+ "commit": "fd4e4d468c26f7ea6003b590cdabf0eac1acec9a"
244
+ }
245
+ ]
246
+ }
247
+ },
248
+ {
249
+ "date": "Thu, 21 Jul 2022 21:21:48 GMT",
6
250
  "tag": "workspace-tools_v0.25.1",
7
251
  "version": "0.25.1",
8
252
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,37 @@
1
1
  # Change Log - workspace-tools
2
2
 
3
- This log was last generated on Thu, 21 Jul 2022 21:21:43 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 04 Aug 2022 08:01:45 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 0.25.4
8
+
9
+ Thu, 04 Aug 2022 08:01:45 GMT
10
+
11
+ ### Patches
12
+
13
+ - Switch from multimatch to micromatch (elcraig@microsoft.com)
14
+
15
+ ## 0.25.3
16
+
17
+ Wed, 03 Aug 2022 08:01:34 GMT
18
+
19
+ ### Patches
20
+
21
+ - Simplify createPackageGraph and getPackageDependencies (elcraig@microsoft.com)
22
+ - Update find-up to v5 (elcraig@microsoft.com)
23
+
24
+ ## 0.25.2
25
+
26
+ Tue, 02 Aug 2022 23:03:14 GMT
27
+
28
+ ### Patches
29
+
30
+ - Add fs-extra to devDependencies and remove non-dev usage (elcraig@microsoft.com)
31
+
7
32
  ## 0.25.1
8
33
 
9
- Thu, 21 Jul 2022 21:21:43 GMT
34
+ Thu, 21 Jul 2022 21:21:48 GMT
10
35
 
11
36
  ### Patches
12
37
 
@@ -2,11 +2,9 @@ import { getTransitiveConsumers, getTransitiveProviders } from "./transitiveDeps
2
2
  import { getPackageDependencies } from "../graph/getPackageDependencies";
3
3
  /** @deprecated Do not use */
4
4
  export declare const getTransitiveDependencies: typeof getTransitiveProviders;
5
- /** @deprecated Do not use */
6
5
  export { getTransitiveProviders };
7
6
  /** @deprecated Do not use */
8
7
  export declare const getTransitiveDependents: typeof getTransitiveConsumers;
9
- /** @deprecated Do not use */
10
8
  export { getTransitiveConsumers };
11
9
  /** @deprecated Do not use */
12
10
  export declare const getInternalDeps: typeof getPackageDependencies;
@@ -4,16 +4,11 @@ export declare function getDependentMap(packages: PackageInfos): Map<string, Set
4
4
  * @deprecated Do not use
5
5
  *
6
6
  * for a package graph of a->b->c (where b depends on a), transitive consumers of a are b & c and their consumers (or what are the consequences of a)
7
- * @param targets
8
- * @param packages
9
- * @param scope
10
7
  */
11
8
  export declare function getTransitiveConsumers(targets: string[], packages: PackageInfos, scope?: string[]): string[];
12
9
  /**
13
10
  * @deprecated Do not use
14
11
  *
15
12
  * for a package graph of a->b->c (where b depends on a), transitive providers of c are a & b and their providers (or what is needed to satisfy c)
16
- * @param targets
17
- * @param packages
18
13
  */
19
14
  export declare function getTransitiveProviders(targets: string[], packages: PackageInfos): string[];
@@ -53,9 +53,6 @@ exports.getDependentMap = getDependentMap;
53
53
  * @deprecated Do not use
54
54
  *
55
55
  * for a package graph of a->b->c (where b depends on a), transitive consumers of a are b & c and their consumers (or what are the consequences of a)
56
- * @param targets
57
- * @param packages
58
- * @param scope
59
56
  */
60
57
  function getTransitiveConsumers(targets, packages, scope = []) {
61
58
  const graph = getPackageGraph(packages, scope);
@@ -79,8 +76,6 @@ exports.getTransitiveConsumers = getTransitiveConsumers;
79
76
  * @deprecated Do not use
80
77
  *
81
78
  * for a package graph of a->b->c (where b depends on a), transitive providers of c are a & b and their providers (or what is needed to satisfy c)
82
- * @param targets
83
- * @param packages
84
79
  */
85
80
  function getTransitiveProviders(targets, packages) {
86
81
  const graph = getPackageGraph(packages);
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getDefaultRemote = void 0;
7
- const fs_extra_1 = __importDefault(require("fs-extra"));
7
+ const fs_1 = __importDefault(require("fs"));
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const paths_1 = require("../paths");
10
10
  const getRepositoryName_1 = require("./getRepositoryName");
@@ -23,7 +23,7 @@ function getDefaultRemote(cwdOrOptions) {
23
23
  let packageJson = {};
24
24
  const packageJsonPath = path_1.default.join(gitRoot, "package.json");
25
25
  try {
26
- packageJson = fs_extra_1.default.readJSONSync(packageJsonPath);
26
+ packageJson = JSON.parse(fs_1.default.readFileSync(packageJsonPath, "utf8").trim());
27
27
  }
28
28
  catch (e) {
29
29
  throw new Error(`Could not read "${packageJsonPath}"`);
@@ -1,7 +1,9 @@
1
1
  import { PackageDependenciesOptions } from "./getPackageDependencies";
2
2
  import { PackageInfos } from "../types/PackageInfo";
3
+ /** @internal */
3
4
  export interface DependencyMap {
4
5
  dependencies: Map<string, Set<string>>;
5
6
  dependents: Map<string, Set<string>>;
6
7
  }
8
+ /** @internal */
7
9
  export declare function createDependencyMap(packages: PackageInfos, options?: PackageDependenciesOptions): DependencyMap;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createDependencyMap = void 0;
4
4
  const getPackageDependencies_1 = require("./getPackageDependencies");
5
- // @internal
5
+ /** @internal */
6
6
  function createDependencyMap(packages, options = { withDevDependencies: true, withPeerDependencies: false }) {
7
7
  const map = {
8
8
  dependencies: new Map(),
@@ -5,18 +5,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.createPackageGraph = void 0;
7
7
  const createDependencyMap_1 = require("./createDependencyMap");
8
- const multimatch_1 = __importDefault(require("multimatch"));
8
+ const micromatch_1 = __importDefault(require("micromatch"));
9
9
  function createPackageGraph(packages, filters) {
10
- /** packageSet is the set of packages being accumulated as the graph is filtered */
10
+ /** set of packages being accumulated as the graph is filtered */
11
11
  const packageSet = new Set();
12
- /** edges is the array of package names & its dependency being accumulated as the graph is filtered */
12
+ /** array of package names & its dependency being accumulated as the graph is filtered */
13
13
  const edges = [];
14
14
  const edgeKeys = new Set();
15
15
  let dependencyMapWithPeerDevDeps = undefined;
16
16
  let dependencyMapWithPeerDeps = undefined;
17
17
  let dependencyMapWithDevDeps = undefined;
18
18
  let dependencyMapWithoutPeerDevDeps = undefined;
19
- /** a visitor for a single filter, */
20
19
  function visitorForFilter(filter, pkg, dependencies, dependents) {
21
20
  packageSet.add(pkg);
22
21
  if (!filter || (filter.includeDependencies && dependencies)) {
@@ -41,17 +40,10 @@ function createPackageGraph(packages, filters) {
41
40
  }
42
41
  }
43
42
  if (filters) {
44
- if (Array.isArray(filters)) {
45
- for (const filter of filters) {
46
- const dependencyMap = getDependencyMapForFilter(packages, filter);
47
- const visitor = visitorForFilter.bind(undefined, filter);
48
- visitPackageGraph(packages, dependencyMap, visitor, filter);
49
- }
50
- }
51
- else {
52
- const filter = filters;
53
- const dependencyMap = getDependencyMapForFilter(packages, filter);
43
+ filters = Array.isArray(filters) ? filters : [filters];
44
+ for (const filter of filters) {
54
45
  const visitor = visitorForFilter.bind(undefined, filter);
46
+ const dependencyMap = getDependencyMapForFilter(packages, filter);
55
47
  visitPackageGraph(packages, dependencyMap, visitor, filter);
56
48
  }
57
49
  }
@@ -70,19 +62,20 @@ function createPackageGraph(packages, filters) {
70
62
  if (!filter) {
71
63
  return (0, createDependencyMap_1.createDependencyMap)(packages);
72
64
  }
73
- if (filter.withDevDependencies && filter.withPeerDependencies && !dependencyMapWithPeerDevDeps) {
74
- dependencyMapWithPeerDevDeps = (0, createDependencyMap_1.createDependencyMap)(packages, { withDevDependencies: true, withPeerDependencies: true });
75
- }
76
- else if (filter.withDevDependencies && !filter.withPeerDependencies && !dependencyMapWithDevDeps) {
77
- dependencyMapWithDevDeps = (0, createDependencyMap_1.createDependencyMap)(packages, { withDevDependencies: true, withPeerDependencies: false });
65
+ if (filter.withDevDependencies && filter.withPeerDependencies) {
66
+ dependencyMapWithPeerDevDeps !== null && dependencyMapWithPeerDevDeps !== void 0 ? dependencyMapWithPeerDevDeps : (dependencyMapWithPeerDevDeps = (0, createDependencyMap_1.createDependencyMap)(packages, filter));
67
+ return dependencyMapWithPeerDevDeps;
78
68
  }
79
- else if (!filter.withDevDependencies && filter.withPeerDependencies && !dependencyMapWithPeerDeps) {
80
- dependencyMapWithPeerDeps = (0, createDependencyMap_1.createDependencyMap)(packages, { withDevDependencies: false, withPeerDependencies: true });
69
+ if (filter.withDevDependencies && !filter.withPeerDependencies) {
70
+ dependencyMapWithDevDeps !== null && dependencyMapWithDevDeps !== void 0 ? dependencyMapWithDevDeps : (dependencyMapWithDevDeps = (0, createDependencyMap_1.createDependencyMap)(packages, filter));
71
+ return dependencyMapWithDevDeps;
81
72
  }
82
- else {
83
- dependencyMapWithoutPeerDevDeps = (0, createDependencyMap_1.createDependencyMap)(packages, { withDevDependencies: false, withPeerDependencies: false });
73
+ if (!filter.withDevDependencies && filter.withPeerDependencies) {
74
+ dependencyMapWithPeerDeps !== null && dependencyMapWithPeerDeps !== void 0 ? dependencyMapWithPeerDeps : (dependencyMapWithPeerDeps = (0, createDependencyMap_1.createDependencyMap)(packages, filter));
75
+ return dependencyMapWithPeerDeps;
84
76
  }
85
- return ((filter.withDevDependencies && filter.withPeerDependencies) ? dependencyMapWithPeerDevDeps : (filter.withDevDependencies ? dependencyMapWithDevDeps : (filter.withPeerDependencies ? dependencyMapWithPeerDeps : dependencyMapWithoutPeerDevDeps)));
77
+ dependencyMapWithoutPeerDevDeps !== null && dependencyMapWithoutPeerDevDeps !== void 0 ? dependencyMapWithoutPeerDevDeps : (dependencyMapWithoutPeerDevDeps = (0, createDependencyMap_1.createDependencyMap)(packages, filter));
78
+ return dependencyMapWithoutPeerDevDeps;
86
79
  }
87
80
  }
88
81
  exports.createPackageGraph = createPackageGraph;
@@ -90,7 +83,7 @@ function visitPackageGraph(packages, dependencyMap, visitor, filter) {
90
83
  var _a, _b;
91
84
  const visited = new Set();
92
85
  const packageNames = Object.keys(packages);
93
- const stack = filter ? (0, multimatch_1.default)(packageNames, filter.namePatterns) : packageNames;
86
+ const stack = filter ? (0, micromatch_1.default)(packageNames, filter.namePatterns) : packageNames;
94
87
  while (stack.length > 0) {
95
88
  const pkg = stack.pop();
96
89
  if (visited.has(pkg)) {
@@ -2,19 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getPackageDependencies = void 0;
4
4
  function getPackageDependencies(info, packages, options = { withDevDependencies: true }) {
5
- let deps = [];
6
- if (options.withDevDependencies && options.withPeerDependencies) {
7
- deps = Object.keys(Object.assign(Object.assign(Object.assign({}, info.dependencies), info.devDependencies), info.peerDependencies));
8
- }
9
- else if (options.withDevDependencies) {
10
- deps = Object.keys(Object.assign(Object.assign({}, info.dependencies), info.devDependencies));
11
- }
12
- else if (options.withPeerDependencies) {
13
- deps = Object.keys(Object.assign(Object.assign({}, info.dependencies), info.peerDependencies));
14
- }
15
- else {
16
- deps = Object.keys(Object.assign({}, info.dependencies));
17
- }
18
- return Object.keys(packages).filter((pkg) => deps.includes(pkg));
5
+ const deps = Object.assign(Object.assign(Object.assign({}, info.dependencies), (options.withDevDependencies && info.devDependencies)), (options.withPeerDependencies && info.peerDependencies));
6
+ return Object.keys(packages).filter((pkg) => !!deps[pkg]);
19
7
  }
20
8
  exports.getPackageDependencies = getPackageDependencies;
@@ -49,7 +49,7 @@ function setupFixture(fixtureName) {
49
49
  (0, git_1.gitFailFast)(["config", "init.defaultBranch", "main"], { cwd });
50
50
  // Copy and commit the fixture if requested
51
51
  if (fixturePath) {
52
- fs_extra_1.default.copySync(fixturePath, cwd);
52
+ fs_extra_1.default.copySync(fixturePath, cwd, { filter: (src) => !/[/\\](node_modules|temp|.rush)([/\\]|$)/.test(src) });
53
53
  (0, git_1.stageAndCommit)(["."], "test", cwd);
54
54
  }
55
55
  return cwd;
@@ -18,7 +18,7 @@ function parsePnpmLock(yaml) {
18
18
  }
19
19
  return {
20
20
  object,
21
- type: "success"
21
+ type: "success",
22
22
  };
23
23
  }
24
24
  exports.parsePnpmLock = parsePnpmLock;
package/lib/scope.d.ts CHANGED
@@ -1,8 +1,6 @@
1
1
  /**
2
- * Searches all package names based on "scoping" (i.e. "scope" in the sense of inclusion)
3
- * NOTE: scoping is different than package scopes (@scope/package)
4
- * @param search
5
- * @param packages
2
+ * Searches all package names based on "scoping" (i.e. "scope" in the sense of inclusion).
3
+ * NOTE: this is not the same as package scopes (`@scope/package`).
6
4
  */
7
5
  export declare function getScopedPackages(search: string[], packages: {
8
6
  [pkg: string]: unknown;
package/lib/scope.js CHANGED
@@ -4,22 +4,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getScopedPackages = void 0;
7
- const multimatch_1 = __importDefault(require("multimatch"));
7
+ const micromatch_1 = __importDefault(require("micromatch"));
8
8
  /**
9
- * Searches all package names based on "scoping" (i.e. "scope" in the sense of inclusion)
10
- * NOTE: scoping is different than package scopes (@scope/package)
11
- * @param search
12
- * @param packages
9
+ * Searches all package names based on "scoping" (i.e. "scope" in the sense of inclusion).
10
+ * NOTE: this is not the same as package scopes (`@scope/package`).
13
11
  */
14
12
  function getScopedPackages(search, packages) {
15
- const packageNames = Array.isArray(packages)
16
- ? packages
17
- : Object.keys(packages);
13
+ const packageNames = Array.isArray(packages) ? packages : Object.keys(packages);
18
14
  const results = new Set();
19
15
  // perform a package-scoped search (e.g. search is @scope/foo*)
20
16
  const scopedSearch = search.filter((needle) => needle.startsWith("@") || needle.startsWith("!@"));
21
17
  if (scopedSearch.length > 0) {
22
- const matched = (0, multimatch_1.default)(packageNames, scopedSearch);
18
+ const matched = (0, micromatch_1.default)(packageNames, scopedSearch);
23
19
  for (const pkg of matched) {
24
20
  results.add(pkg);
25
21
  }
@@ -29,7 +25,7 @@ function getScopedPackages(search, packages) {
29
25
  if (unscopedSearch.length > 0) {
30
26
  // only generate the bare package map if there ARE unscoped searches
31
27
  const barePackageMap = generateBarePackageMap(packageNames);
32
- let matched = (0, multimatch_1.default)(Object.keys(barePackageMap), unscopedSearch);
28
+ let matched = (0, micromatch_1.default)(Object.keys(barePackageMap), unscopedSearch);
33
29
  for (const bare of matched) {
34
30
  for (const pkg of barePackageMap[bare]) {
35
31
  results.add(pkg);
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- ;
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getPackagesByFiles = void 0;
7
- const multimatch_1 = __importDefault(require("multimatch"));
7
+ const micromatch_1 = __importDefault(require("micromatch"));
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const getWorkspaces_1 = require("./getWorkspaces");
10
10
  /**
@@ -18,7 +18,7 @@ const getWorkspaces_1 = require("./getWorkspaces");
18
18
  */
19
19
  function getPackagesByFiles(workspaceRoot, files, ignoreGlobs = [], returnAllPackagesOnNoMatch = false) {
20
20
  const workspaceInfo = (0, getWorkspaces_1.getWorkspaces)(workspaceRoot);
21
- const ignoreSet = new Set((0, multimatch_1.default)(files, ignoreGlobs));
21
+ const ignoreSet = new Set((0, micromatch_1.default)(files, ignoreGlobs));
22
22
  files = files.filter((change) => !ignoreSet.has(change));
23
23
  const packages = new Set();
24
24
  for (const file of files) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "workspace-tools",
3
- "version": "0.25.1",
3
+ "version": "0.25.4",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -17,34 +17,37 @@
17
17
  "release:docs": "typedoc src/index.ts && gh-pages -d docs",
18
18
  "change": "beachball change",
19
19
  "checkchange": "beachball check",
20
+ "format": "prettier --write .",
20
21
  "release": "beachball publish -y",
21
22
  "start": "tsc -w --preserveWatchOutput",
22
23
  "test": "jest"
23
24
  },
24
25
  "dependencies": {
25
26
  "@yarnpkg/lockfile": "^1.1.0",
26
- "find-up": "^4.1.0",
27
+ "find-up": "^5.0.0",
27
28
  "git-url-parse": "^12.0.0",
28
29
  "globby": "^11.0.0",
29
30
  "jju": "^1.4.0",
30
- "multimatch": "^4.0.0",
31
+ "micromatch": "^4.0.0",
31
32
  "read-yaml-file": "^2.0.0"
32
33
  },
33
34
  "devDependencies": {
34
- "@types/git-url-parse": "^9.0.0",
35
- "@types/jest": "^25.2.2",
36
- "@types/jju": "^1.4.1",
37
- "@types/multimatch": "^4.0.0",
38
- "@types/node": ">=12.0.0",
39
- "@types/tmp": "^0.2.0",
40
- "@types/yarnpkg__lockfile": "^1.1.3",
41
- "beachball": "^2.17.0",
42
- "jest": "^25.0.0",
43
- "prettier": "^2.7.1",
44
- "tmp": "^0.2.1",
45
- "ts-jest": "^25.5.1",
46
- "typedoc": "^0.22.15",
47
- "typescript": "^4.5.4",
48
- "gh-pages": "^3.2.3"
35
+ "@types/fs-extra": "9.0.13",
36
+ "@types/git-url-parse": "9.0.1",
37
+ "@types/jest": "28.1.6",
38
+ "@types/jju": "1.4.2",
39
+ "@types/micromatch": "4.0.2",
40
+ "@types/node": "13.13.5",
41
+ "@types/tmp": "0.2.3",
42
+ "@types/yarnpkg__lockfile": "1.1.5",
43
+ "beachball": "2.26.0",
44
+ "fs-extra": "10.1.0",
45
+ "gh-pages": "3.2.3",
46
+ "jest": "28.1.3",
47
+ "prettier": "2.7.1",
48
+ "tmp": "0.2.1",
49
+ "ts-jest": "28.0.7",
50
+ "typedoc": "0.22.15",
51
+ "typescript": "4.5.4"
49
52
  }
50
53
  }