fix(core): add missing bun PM support (#26084)

This fix add support for bun PM in daemon and affected changes.

Helps towards #26053 fix
This commit is contained in:
Jordan Hall 2024-05-27 15:00:35 +01:00 committed by GitHub
parent 33ba03a81f
commit 4cbb0f0988
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 53 additions and 32 deletions

View File

@ -23,6 +23,13 @@ npx create-nx-workspace --pm yarn
npx create-nx-workspace --pm pnpm npx create-nx-workspace --pm pnpm
``` ```
{% /tab %}
{% tab label="Bun" %}
```shell
bunx create-nx-workspace --pm bun
```
{% /tab %} {% /tab %}
{% /tabs %} {% /tabs %}
@ -85,6 +92,13 @@ yarn global add nx@latest
pnpm add --global nx@latest pnpm add --global nx@latest
``` ```
{% /tab %}
{% tab label="Bun" %}
```shell
bun install --global nx@latest
```
{% /tab %} {% /tab %}
{% /tabs %} {% /tabs %}

View File

@ -161,6 +161,7 @@ function replaceMentions(
'yarn.lock', 'yarn.lock',
'package-lock.json', 'package-lock.json',
'pnpm-lock.yaml', 'pnpm-lock.yaml',
'bun.lockb',
'CHANGELOG.md', 'CHANGELOG.md',
]; ];
if (ignoredFiles.includes(basename(path))) { if (ignoredFiles.includes(basename(path))) {

View File

@ -258,6 +258,7 @@ function lockFileHashChanged(): boolean {
join(workspaceRoot, 'package-lock.json'), join(workspaceRoot, 'package-lock.json'),
join(workspaceRoot, 'yarn.lock'), join(workspaceRoot, 'yarn.lock'),
join(workspaceRoot, 'pnpm-lock.yaml'), join(workspaceRoot, 'pnpm-lock.yaml'),
join(workspaceRoot, 'bun.lockb'),
] ]
.filter((file) => existsSync(file)) .filter((file) => existsSync(file))
.map((file) => hashFile(file)); .map((file) => hashFile(file));

View File

@ -36,8 +36,13 @@ describe('getTouchedProjectsFromLockFile', () => {
allNodes = Object.keys(graph.nodes); allNodes = Object.keys(graph.nodes);
}); });
['package-lock.json', 'yarn.lock', 'pnpm-lock.yaml', 'pnpm-lock.yml'].forEach( [
(lockFile) => { 'package-lock.json',
'yarn.lock',
'pnpm-lock.yaml',
'pnpm-lock.yml',
'bun.lockb',
].forEach((lockFile) => {
describe(`"${lockFile}"`, () => { describe(`"${lockFile}"`, () => {
it(`should not return changes when "${lockFile}" is not touched`, () => { it(`should not return changes when "${lockFile}" is not touched`, () => {
const result = getTouchedProjectsFromLockFile( const result = getTouchedProjectsFromLockFile(
@ -67,6 +72,5 @@ describe('getTouchedProjectsFromLockFile', () => {
expect(result).toEqual(allNodes); expect(result).toEqual(allNodes);
}); });
}); });
} });
);
}); });

View File

@ -10,6 +10,7 @@ export const getTouchedProjectsFromLockFile: TouchedProjectLocator<
'yarn.lock', 'yarn.lock',
'pnpm-lock.yaml', 'pnpm-lock.yaml',
'pnpm-lock.yml', 'pnpm-lock.yml',
'bun.lockb',
]; ];
if (fileChanges.some((f) => lockFiles.includes(f.file))) { if (fileChanges.some((f) => lockFiles.includes(f.file))) {