workspace-tools 0.25.3 → 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 +24 -1
- package/CHANGELOG.md +10 -2
- package/lib/graph/createPackageGraph.js +2 -2
- package/lib/helpers/setupFixture.js +1 -1
- package/lib/scope.d.ts +2 -4
- package/lib/scope.js +5 -7
- package/lib/workspaces/getPackagesByFiles.js +2 -2
- package/package.json +6 -5
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,30 @@
|
|
|
2
2
|
"name": "workspace-tools",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
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",
|
|
6
29
|
"tag": "workspace-tools_v0.25.3",
|
|
7
30
|
"version": "0.25.3",
|
|
8
31
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
# Change Log - workspace-tools
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
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
|
+
|
|
7
15
|
## 0.25.3
|
|
8
16
|
|
|
9
|
-
Wed, 03 Aug 2022 08:01:
|
|
17
|
+
Wed, 03 Aug 2022 08:01:34 GMT
|
|
10
18
|
|
|
11
19
|
### Patches
|
|
12
20
|
|
|
@@ -5,7 +5,7 @@ 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
|
|
8
|
+
const micromatch_1 = __importDefault(require("micromatch"));
|
|
9
9
|
function createPackageGraph(packages, filters) {
|
|
10
10
|
/** set of packages being accumulated as the graph is filtered */
|
|
11
11
|
const packageSet = new Set();
|
|
@@ -83,7 +83,7 @@ function visitPackageGraph(packages, dependencyMap, visitor, filter) {
|
|
|
83
83
|
var _a, _b;
|
|
84
84
|
const visited = new Set();
|
|
85
85
|
const packageNames = Object.keys(packages);
|
|
86
|
-
const stack = filter ? (0,
|
|
86
|
+
const stack = filter ? (0, micromatch_1.default)(packageNames, filter.namePatterns) : packageNames;
|
|
87
87
|
while (stack.length > 0) {
|
|
88
88
|
const pkg = stack.pop();
|
|
89
89
|
if (visited.has(pkg)) {
|
|
@@ -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;
|
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:
|
|
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,12 +4,10 @@ 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
|
|
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:
|
|
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
13
|
const packageNames = Array.isArray(packages) ? packages : Object.keys(packages);
|
|
@@ -17,7 +15,7 @@ function getScopedPackages(search, packages) {
|
|
|
17
15
|
// perform a package-scoped search (e.g. search is @scope/foo*)
|
|
18
16
|
const scopedSearch = search.filter((needle) => needle.startsWith("@") || needle.startsWith("!@"));
|
|
19
17
|
if (scopedSearch.length > 0) {
|
|
20
|
-
const matched = (0,
|
|
18
|
+
const matched = (0, micromatch_1.default)(packageNames, scopedSearch);
|
|
21
19
|
for (const pkg of matched) {
|
|
22
20
|
results.add(pkg);
|
|
23
21
|
}
|
|
@@ -27,7 +25,7 @@ function getScopedPackages(search, packages) {
|
|
|
27
25
|
if (unscopedSearch.length > 0) {
|
|
28
26
|
// only generate the bare package map if there ARE unscoped searches
|
|
29
27
|
const barePackageMap = generateBarePackageMap(packageNames);
|
|
30
|
-
let matched = (0,
|
|
28
|
+
let matched = (0, micromatch_1.default)(Object.keys(barePackageMap), unscopedSearch);
|
|
31
29
|
for (const bare of matched) {
|
|
32
30
|
for (const pkg of barePackageMap[bare]) {
|
|
33
31
|
results.add(pkg);
|
|
@@ -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
|
|
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,
|
|
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.
|
|
3
|
+
"version": "0.25.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,25 +28,26 @@
|
|
|
28
28
|
"git-url-parse": "^12.0.0",
|
|
29
29
|
"globby": "^11.0.0",
|
|
30
30
|
"jju": "^1.4.0",
|
|
31
|
-
"
|
|
31
|
+
"micromatch": "^4.0.0",
|
|
32
32
|
"read-yaml-file": "^2.0.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
+
"@types/fs-extra": "9.0.13",
|
|
35
36
|
"@types/git-url-parse": "9.0.1",
|
|
36
37
|
"@types/jest": "28.1.6",
|
|
37
38
|
"@types/jju": "1.4.2",
|
|
38
|
-
"@types/
|
|
39
|
+
"@types/micromatch": "4.0.2",
|
|
39
40
|
"@types/node": "13.13.5",
|
|
40
41
|
"@types/tmp": "0.2.3",
|
|
41
42
|
"@types/yarnpkg__lockfile": "1.1.5",
|
|
42
43
|
"beachball": "2.26.0",
|
|
43
44
|
"fs-extra": "10.1.0",
|
|
45
|
+
"gh-pages": "3.2.3",
|
|
44
46
|
"jest": "28.1.3",
|
|
45
47
|
"prettier": "2.7.1",
|
|
46
48
|
"tmp": "0.2.1",
|
|
47
49
|
"ts-jest": "28.0.7",
|
|
48
50
|
"typedoc": "0.22.15",
|
|
49
|
-
"typescript": "4.5.4"
|
|
50
|
-
"gh-pages": "4.0.0"
|
|
51
|
+
"typescript": "4.5.4"
|
|
51
52
|
}
|
|
52
53
|
}
|