-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(core): ensurePackage fails on pnpm workspaces #16002
fix(core): ensurePackage fails on pnpm workspaces #16002
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
db46661
to
7464280
Compare
@@ -158,8 +160,8 @@ export function getPackageManagerCommand({ | |||
runUninstalledPackage: 'pnpm dlx', | |||
install: 'pnpm i', | |||
ciInstall: 'pnpm install --frozen-lockfile', | |||
addProd: `pnpm add`, | |||
addDev: `pnpm add -D`, | |||
addProd: isPnpmWorkspace ? 'pnpm add -w' : 'pnpm add', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was strangely broken the whole time
}); | ||
}); | ||
|
||
afterEach(() => cleanupProject()); | ||
beforeEach(() => { | ||
runCommand(`git reset --hard`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use git reset to revert all the changes done on the repo
7464280
to
c415852
Compare
aed5f8e
to
9a0db05
Compare
9a0db05
to
1aef7b9
Compare
}, | ||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'], | ||
maxWorkers: 1, | ||
globals: { 'ts-jest': { tsconfig: '<rootDir>/tsconfig.spec.json' } }, | ||
globals: {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usage of ts-jest
in globals
is deprecated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strange that didn't get migrated 🤔
fb0a11b
to
90fd0c4
Compare
Converting back to draft until |
const isVerbose = process.env.NX_VERBOSE_LOGGING === 'true'; | ||
execSync( | ||
`${ | ||
getPackageManagerCommand(detectPackageManager(), tempDir).addDev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the case of pnpm
workspace, it would try to run the pnpm add -Dw ...
command, which fails since tempDir
is not a workspace.
3c56cc3
to
48b08a1
Compare
d31ffd9
to
381f049
Compare
381f049
to
e4b9cc9
Compare
e4b9cc9
to
d330fa6
Compare
d330fa6
to
ff14335
Compare
afterEach(() => cleanupProject()); | ||
afterEach(() => { | ||
runCommand(`git reset --hard HEAD`); | ||
runCommand(`git clean -fdx`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need x
here. x
will clean out even gitignore
'd files like node_modules
which will slow down the install.
(cherry picked from commit b3a3f2a)
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
This PR:
ensurePackage
onpnpm
workspacesensurePackage
getPackageManagerCommand
to acceptroot
as a second parameter-w
in thee2e
utilse2e-create-nx-workspace-npm
to use selected package managere2e-create-nx-workspace-npm
to re-use the same workspaceCurrent Behavior
The
ensurePackage
fails onpnpm
workspaceExpected Behavior
The
ensurePackage
passes onpnpm
workspace and installs the package as expected.Related Issue(s)
Fixes #