workspace-tools
Advanced tools
Comparing version 0.10.2 to 0.10.3
@@ -5,3 +5,18 @@ { | ||
{ | ||
"date": "Mon, 30 Nov 2020 18:53:24 GMT", | ||
"date": "Tue, 26 Jan 2021 09:28:29 GMT", | ||
"tag": "workspace-tools_v0.10.3", | ||
"version": "0.10.3", | ||
"comments": { | ||
"patch": [ | ||
{ | ||
"comment": "fix: Detect changed package(s) in nested monorepo", | ||
"author": "oliver.kuruma@gmail.com", | ||
"commit": "34f4c2ab31ffd8af1db1a705a9f446386975e4cb", | ||
"package": "workspace-tools" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"date": "Mon, 30 Nov 2020 18:53:38 GMT", | ||
"tag": "workspace-tools_v0.10.2", | ||
@@ -8,0 +23,0 @@ "version": "0.10.2", |
# Change Log - workspace-tools | ||
This log was last generated on Mon, 30 Nov 2020 18:53:24 GMT and should not be manually modified. | ||
This log was last generated on Tue, 26 Jan 2021 09:28:29 GMT and should not be manually modified. | ||
<!-- Start content --> | ||
## 0.10.3 | ||
Tue, 26 Jan 2021 09:28:29 GMT | ||
### Patches | ||
- fix: Detect changed package(s) in nested monorepo (oliver.kuruma@gmail.com) | ||
## 0.10.2 | ||
Mon, 30 Nov 2020 18:53:24 GMT | ||
Mon, 30 Nov 2020 18:53:38 GMT | ||
@@ -11,0 +19,0 @@ ### Patches |
@@ -22,2 +22,12 @@ "use strict"; | ||
}); | ||
it("can detect changes inside an untracked file in a nested monorepo", async () => { | ||
// arrange | ||
const root = path_1.default.join(await setupFixture_1.setupFixture("monorepo-nested"), "monorepo"); | ||
const newFile = path_1.default.join(root, "packages/package-a/footest.txt"); | ||
fs_1.default.writeFileSync(newFile, "hello foo test"); | ||
// act | ||
const changedPkgs = getChangedPackages_1.getChangedPackages(root, "master"); | ||
// assert | ||
expect(changedPkgs).toEqual(["package-a"]); | ||
}); | ||
it("can detect changes inside an unstaged file", async () => { | ||
@@ -33,2 +43,12 @@ // arrange | ||
}); | ||
it("can detect changes inside an unstaged file in a nested monorepo", async () => { | ||
// arrange | ||
const root = path_1.default.join(await setupFixture_1.setupFixture("monorepo-nested"), "monorepo"); | ||
const newFile = path_1.default.join(root, "packages/package-a/src/index.ts"); | ||
fs_1.default.writeFileSync(newFile, "hello foo test"); | ||
// act | ||
const changedPkgs = getChangedPackages_1.getChangedPackages(root, "master"); | ||
// assert | ||
expect(changedPkgs).toEqual(["package-a"]); | ||
}); | ||
it("can detect changes inside a staged file", async () => { | ||
@@ -45,2 +65,13 @@ // arrange | ||
}); | ||
it("can detect changes inside a staged file in a nested monorepo", async () => { | ||
// arrange | ||
const root = path_1.default.join(await setupFixture_1.setupFixture("monorepo-nested"), "monorepo"); | ||
const newFile = path_1.default.join(root, "packages/package-a/footest.txt"); | ||
fs_1.default.writeFileSync(newFile, "hello foo test"); | ||
git_1.git(["add", newFile], { cwd: root }); | ||
// act | ||
const changedPkgs = getChangedPackages_1.getChangedPackages(root, "master"); | ||
// assert | ||
expect(changedPkgs).toEqual(["package-a"]); | ||
}); | ||
it("can detect changes inside a file that has been committed in a different branch", async () => { | ||
@@ -58,2 +89,14 @@ // arrange | ||
}); | ||
it("can detect changes inside a file that has been committed in a different branch in a nested monorepo", async () => { | ||
// arrange | ||
const root = path_1.default.join(await setupFixture_1.setupFixture("monorepo-nested"), "monorepo"); | ||
const newFile = path_1.default.join(root, "packages/package-a/footest.txt"); | ||
fs_1.default.writeFileSync(newFile, "hello foo test"); | ||
git_1.git(["checkout", "-b", "newbranch"], { cwd: root }); | ||
git_1.stageAndCommit(["add", newFile], "test commit", root); | ||
// act | ||
const changedPkgs = getChangedPackages_1.getChangedPackages(root, "master"); | ||
// assert | ||
expect(changedPkgs).toEqual(["package-a"]); | ||
}); | ||
it("can ignore glob patterns in detecting changes", async () => { | ||
@@ -60,0 +103,0 @@ // arrange |
@@ -57,3 +57,3 @@ "use strict"; | ||
try { | ||
const results = git(["status", "-z"], { cwd }); | ||
const results = git(["status", "--short"], { cwd }); | ||
if (!results.success) { | ||
@@ -98,3 +98,3 @@ return []; | ||
try { | ||
const results = git(["--no-pager", "diff", "--name-only"], { | ||
const results = git(["--no-pager", "diff", "--name-only", "--relative"], { | ||
cwd, | ||
@@ -123,3 +123,3 @@ }); | ||
function getBranchChanges(branch, cwd) { | ||
const diffCmd = ["--no-pager", "diff", "--name-only", branch + "..."]; | ||
const diffCmd = ["--no-pager", "diff", "--name-only", "--relative", branch + "..."]; | ||
const results = git(diffCmd, { | ||
@@ -145,3 +145,3 @@ cwd, | ||
try { | ||
const results = git(["--no-pager", "diff", "--staged", "--name-only"], { | ||
const results = git(["--no-pager", "diff", "--staged", "--name-only", "--relative"], { | ||
cwd, | ||
@@ -148,0 +148,0 @@ }); |
{ | ||
"name": "workspace-tools", | ||
"version": "0.10.2", | ||
"version": "0.10.3", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
93671
2189