workspace-tools 0.19.2 → 0.20.0
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 +46 -1
- package/CHANGELOG.md +26 -2
- package/lib/paths.d.ts +12 -4
- package/lib/paths.js +22 -12
- package/package.json +3 -3
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,52 @@
|
|
|
2
2
|
"name": "workspace-tools",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "Thu, 23 Jun 2022
|
|
5
|
+
"date": "Thu, 23 Jun 2022 20:24:10 GMT",
|
|
6
|
+
"tag": "workspace-tools_v0.20.0",
|
|
7
|
+
"version": "0.20.0",
|
|
8
|
+
"comments": {
|
|
9
|
+
"minor": [
|
|
10
|
+
{
|
|
11
|
+
"author": "elcraig@microsoft.com",
|
|
12
|
+
"package": "workspace-tools",
|
|
13
|
+
"comment": "BREAKING: Remove getChangePath because it's specific to beachball and should be defined there",
|
|
14
|
+
"commit": "bbfc44143e2f2bc0ca17bf5c351bab52fe8c9025"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Thu, 23 Jun 2022 19:53:03 GMT",
|
|
21
|
+
"tag": "workspace-tools_v0.19.4",
|
|
22
|
+
"version": "0.19.4",
|
|
23
|
+
"comments": {
|
|
24
|
+
"patch": [
|
|
25
|
+
{
|
|
26
|
+
"author": "elcraig@microsoft.com",
|
|
27
|
+
"package": "workspace-tools",
|
|
28
|
+
"comment": "Add findProjectRoot path helper",
|
|
29
|
+
"commit": "5ad6577811656ad23cf567f0996cf9b70d8c23a0"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"date": "Thu, 23 Jun 2022 19:10:04 GMT",
|
|
36
|
+
"tag": "workspace-tools_v0.19.3",
|
|
37
|
+
"version": "0.19.3",
|
|
38
|
+
"comments": {
|
|
39
|
+
"patch": [
|
|
40
|
+
{
|
|
41
|
+
"author": "elcraig@microsoft.com",
|
|
42
|
+
"package": "workspace-tools",
|
|
43
|
+
"comment": "Move typedoc to devDependencies",
|
|
44
|
+
"commit": "8dbb9af66b8e1564734861d23849957b22dbe870"
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"date": "Thu, 23 Jun 2022 18:52:05 GMT",
|
|
6
51
|
"tag": "workspace-tools_v0.19.2",
|
|
7
52
|
"version": "0.19.2",
|
|
8
53
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,36 @@
|
|
|
1
1
|
# Change Log - workspace-tools
|
|
2
2
|
|
|
3
|
-
This log was last generated on Thu, 23 Jun 2022
|
|
3
|
+
This log was last generated on Thu, 23 Jun 2022 20:24:10 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 0.20.0
|
|
8
|
+
|
|
9
|
+
Thu, 23 Jun 2022 20:24:10 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- BREAKING: Remove getChangePath because it's specific to beachball and should be defined there (elcraig@microsoft.com)
|
|
14
|
+
|
|
15
|
+
## 0.19.4
|
|
16
|
+
|
|
17
|
+
Thu, 23 Jun 2022 19:53:03 GMT
|
|
18
|
+
|
|
19
|
+
### Patches
|
|
20
|
+
|
|
21
|
+
- Add findProjectRoot path helper (elcraig@microsoft.com)
|
|
22
|
+
|
|
23
|
+
## 0.19.3
|
|
24
|
+
|
|
25
|
+
Thu, 23 Jun 2022 19:10:04 GMT
|
|
26
|
+
|
|
27
|
+
### Patches
|
|
28
|
+
|
|
29
|
+
- Move typedoc to devDependencies (elcraig@microsoft.com)
|
|
30
|
+
|
|
7
31
|
## 0.19.2
|
|
8
32
|
|
|
9
|
-
Thu, 23 Jun 2022 18:
|
|
33
|
+
Thu, 23 Jun 2022 18:52:05 GMT
|
|
10
34
|
|
|
11
35
|
### Patches
|
|
12
36
|
|
package/lib/paths.d.ts
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Starting from `cwd`, searches up the directory hierarchy for `pathName
|
|
3
|
-
* @param pathName
|
|
4
|
-
* @param cwd
|
|
2
|
+
* Starting from `cwd`, searches up the directory hierarchy for `pathName`.
|
|
5
3
|
*/
|
|
6
4
|
export declare function searchUp(pathName: string, cwd: string): string | null;
|
|
5
|
+
/**
|
|
6
|
+
* Starting from `cwd`, searches up the directory hierarchy for `.git`.
|
|
7
|
+
*/
|
|
7
8
|
export declare function findGitRoot(cwd: string): string | null;
|
|
9
|
+
/**
|
|
10
|
+
* Starting from `cwd`, searches up the directory hierarchy for `package.json`.
|
|
11
|
+
*/
|
|
8
12
|
export declare function findPackageRoot(cwd: string): string | null;
|
|
9
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Starting from `cwd`, searches up the directory hierarchy for the workspace root,
|
|
15
|
+
* falling back to the git root if no workspace is detected.
|
|
16
|
+
*/
|
|
17
|
+
export declare function findProjectRoot(cwd: string): string | null;
|
|
10
18
|
export declare function isChildOf(child: string, parent: string): boolean;
|
package/lib/paths.js
CHANGED
|
@@ -3,13 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.isChildOf = exports.
|
|
6
|
+
exports.isChildOf = exports.findProjectRoot = exports.findPackageRoot = exports.findGitRoot = exports.searchUp = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
8
|
const fs_1 = __importDefault(require("fs"));
|
|
9
|
+
const getWorkspaceRoot_1 = require("./workspaces/getWorkspaceRoot");
|
|
9
10
|
/**
|
|
10
|
-
* Starting from `cwd`, searches up the directory hierarchy for `pathName
|
|
11
|
-
* @param pathName
|
|
12
|
-
* @param cwd
|
|
11
|
+
* Starting from `cwd`, searches up the directory hierarchy for `pathName`.
|
|
13
12
|
*/
|
|
14
13
|
function searchUp(pathName, cwd) {
|
|
15
14
|
const root = path_1.default.parse(cwd).root;
|
|
@@ -27,22 +26,33 @@ function searchUp(pathName, cwd) {
|
|
|
27
26
|
return null;
|
|
28
27
|
}
|
|
29
28
|
exports.searchUp = searchUp;
|
|
29
|
+
/**
|
|
30
|
+
* Starting from `cwd`, searches up the directory hierarchy for `.git`.
|
|
31
|
+
*/
|
|
30
32
|
function findGitRoot(cwd) {
|
|
31
|
-
return searchUp(
|
|
33
|
+
return searchUp(".git", cwd);
|
|
32
34
|
}
|
|
33
35
|
exports.findGitRoot = findGitRoot;
|
|
36
|
+
/**
|
|
37
|
+
* Starting from `cwd`, searches up the directory hierarchy for `package.json`.
|
|
38
|
+
*/
|
|
34
39
|
function findPackageRoot(cwd) {
|
|
35
|
-
return searchUp(
|
|
40
|
+
return searchUp("package.json", cwd);
|
|
36
41
|
}
|
|
37
42
|
exports.findPackageRoot = findPackageRoot;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Starting from `cwd`, searches up the directory hierarchy for the workspace root,
|
|
45
|
+
* falling back to the git root if no workspace is detected.
|
|
46
|
+
*/
|
|
47
|
+
function findProjectRoot(cwd) {
|
|
48
|
+
let workspaceRoot;
|
|
49
|
+
try {
|
|
50
|
+
workspaceRoot = (0, getWorkspaceRoot_1.getWorkspaceRoot)(cwd);
|
|
42
51
|
}
|
|
43
|
-
|
|
52
|
+
catch (_a) { }
|
|
53
|
+
return workspaceRoot || findGitRoot(cwd);
|
|
44
54
|
}
|
|
45
|
-
exports.
|
|
55
|
+
exports.findProjectRoot = findProjectRoot;
|
|
46
56
|
function isChildOf(child, parent) {
|
|
47
57
|
const relativePath = path_1.default.relative(child, parent);
|
|
48
58
|
return /^[.\/\\]+$/.test(relativePath);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "workspace-tools",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,8 +25,7 @@
|
|
|
25
25
|
"globby": "^11.0.0",
|
|
26
26
|
"jju": "^1.4.0",
|
|
27
27
|
"multimatch": "^4.0.0",
|
|
28
|
-
"read-yaml-file": "^2.0.0"
|
|
29
|
-
"typedoc": "^0.22.15"
|
|
28
|
+
"read-yaml-file": "^2.0.0"
|
|
30
29
|
},
|
|
31
30
|
"devDependencies": {
|
|
32
31
|
"@types/git-url-parse": "^9.0.0",
|
|
@@ -41,6 +40,7 @@
|
|
|
41
40
|
"jest": "^25.0.0",
|
|
42
41
|
"tmp": "^0.2.1",
|
|
43
42
|
"ts-jest": "^25.5.1",
|
|
43
|
+
"typedoc": "^0.22.15",
|
|
44
44
|
"typescript": "^4.5.4",
|
|
45
45
|
"gh-pages": "^3.2.3"
|
|
46
46
|
}
|