-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cli):
pnpm
is default package manager (#419)
* Install dependencies using pnpm * Use pnpm installer * Fix cli tests
- Loading branch information
1 parent
d22af15
commit 72b59ed
Showing
6 changed files
with
73 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ describe<{ | |
|
||
installer.install("@mainsail/core"); | ||
|
||
spySync.calledWith("yarn global add @mainsail/core@latest --force", { shell: true }); | ||
spySync.calledWith("pnpm install -g @mainsail/core@latest", { shell: true }); | ||
}); | ||
|
||
it("#install - should install specific package when tag is provided", ({ installer }) => { | ||
|
@@ -38,7 +38,7 @@ describe<{ | |
|
||
installer.install("@mainsail/core", "3.0.0"); | ||
|
||
spySync.calledWith("yarn global add @mainsail/[email protected] --force", { shell: true }); | ||
spySync.calledWith("pnpm install -g @mainsail/[email protected]", { shell: true }); | ||
}); | ||
|
||
it("#install - should throw when exit code isn't 0", ({ installer }) => { | ||
|
@@ -51,20 +51,25 @@ describe<{ | |
|
||
assert.throws(() => installer.install("@mainsail/core"), "stderr"); | ||
|
||
spySync.calledWith("yarn global add @mainsail/core@latest --force", { shell: true }); | ||
spySync.calledWith("pnpm install -g @mainsail/core@latest", { shell: true }); | ||
}); | ||
|
||
it("#installPeerDependencies - should install each peer dependency", ({ installer }) => { | ||
const spyInstallRangeLatest = stub(installer, "installRangeLatest"); | ||
|
||
const spySync = stub(execa, "sync").returnValue({ | ||
exitCode: 0, | ||
stdout: JSON.stringify({ data: { pm2: "4.5.0", somepkg: "^1.0.0" } }), | ||
}); | ||
const spySync = stub(execa, "sync") | ||
.returnValueOnce({ | ||
exitCode: 0, | ||
stdout: JSON.stringify({ pm2: "4.5.0", somepkg: "^1.0.0" }), | ||
}) | ||
.returnValue({ | ||
exitCode: 0, | ||
stdout: "", | ||
}); | ||
|
||
installer.installPeerDependencies("@mainsail/core", "3.0.0"); | ||
|
||
spySync.calledWith("yarn info @mainsail/[email protected] peerDependencies --json", { | ||
spySync.calledWith("pnpm info @mainsail/[email protected] peerDependencies --json", { | ||
shell: true, | ||
}); | ||
|
||
|
@@ -77,12 +82,12 @@ describe<{ | |
|
||
const spySync = stub(execa, "sync").returnValue({ | ||
exitCode: 0, | ||
stdout: JSON.stringify({}), | ||
stdout: "", | ||
}); | ||
|
||
installer.installPeerDependencies("@mainsail/core", "3.0.0"); | ||
|
||
spySync.calledWith("yarn info @mainsail/[email protected] peerDependencies --json", { | ||
spySync.calledWith("pnpm info @mainsail/[email protected] peerDependencies --json", { | ||
shell: true, | ||
}); | ||
|
||
|
@@ -97,7 +102,7 @@ describe<{ | |
|
||
assert.throws(() => installer.installPeerDependencies("@mainsail/core"), "stderr"); | ||
|
||
spySync.calledWith("yarn info @mainsail/core@latest peerDependencies --json", { | ||
spySync.calledWith("pnpm info @mainsail/core@latest peerDependencies --json", { | ||
shell: true, | ||
}); | ||
}); | ||
|
@@ -107,12 +112,12 @@ describe<{ | |
|
||
const spySync = stub(execa, "sync").returnValue({ | ||
exitCode: 0, | ||
stdout: JSON.stringify({ data: ["3.0.0", "3.1.0", "3.0.0-next.9"] }), | ||
stdout: JSON.stringify(["3.0.0", "3.1.0", "3.0.0-next.9"]), | ||
}); | ||
|
||
installer.installRangeLatest("@mainsail/core", "^3.0.0 <3.4.0"); | ||
|
||
spySync.calledWith("yarn info @mainsail/core versions --json", { | ||
spySync.calledWith("pnpm info @mainsail/core versions --json", { | ||
shell: true, | ||
}); | ||
|
||
|
@@ -127,7 +132,7 @@ describe<{ | |
|
||
assert.throws(() => installer.installRangeLatest("@mainsail/core", "^3.0.0 <3.4.0"), "stderr"); | ||
|
||
spySync.calledWith("yarn info @mainsail/core versions --json", { | ||
spySync.calledWith("pnpm info @mainsail/core versions --json", { | ||
shell: true, | ||
}); | ||
}); | ||
|
@@ -137,15 +142,15 @@ describe<{ | |
}) => { | ||
const spySync = stub(execa, "sync").returnValue({ | ||
exitCode: 0, | ||
stdout: JSON.stringify({ data: ["3.0.0", "3.0.0-next.9"] }), | ||
stdout: JSON.stringify(["3.0.0", "3.0.0-next.9"]), | ||
}); | ||
|
||
assert.throws( | ||
() => installer.installRangeLatest("@mainsail/core", "^4.0.0 <4.4.0"), | ||
"No @mainsail/core version to satisfy ^4.0.0 <4.4.0".replace(/[\s#$()*+,.?[\\\]^{|}-]/g, "\\$&"), | ||
); | ||
|
||
spySync.calledWith("yarn info @mainsail/core versions --json", { | ||
spySync.calledWith("pnpm info @mainsail/core versions --json", { | ||
shell: true, | ||
}); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters