Jordan-Hall / nx-bun

https://jordan-hall.github.io/nx-bun/
Other
58 stars 6 forks source link

Support for NX v17 #19

Open DanielKucal opened 7 months ago

DanielKucal commented 7 months ago

Describe the bug With NX v17 there's a dependencies conflict for @nx/devkit package

% npm i @nx-bun/nx --include=dev                                              
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: @nx-monorepo/source@0.0.0
npm ERR! Found: @nx/devkit@17.1.3
npm ERR! node_modules/@nx/devkit
npm ERR!   dev @nx/devkit@"17.1.3" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @nx/devkit@">16.8.0 <17" from @nx-bun/nx@1.1.0
npm ERR! node_modules/@nx-bun/nx
npm ERR!   @nx-bun/nx@"^1.1.0" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

And after --force install, there's an error:

% nx g create api --dry-run --verbose

>  NX  Generating @nx-bun/nx:create

✔ What name would you like to use? · api
✔ Is this an application or a library? · application
✔ What should be the project name and where should it be generated? · api @ apps/api
In Nx 18, generating projects will no longer derive the name and root.
Please provide the exact project name and root in the future.
Example: nx g @nx-bun/nx:create api --directory apps/api
error: could not determine executable to run for package create-api

 >  NX   child process exited with code 1

Error: child process exited with code 1
    at ChildProcess.<anonymous> (/nx-monorepo/node_modules/@nx-bun/nx/src/utils/bun-cli.js:161:32)
    at ChildProcess.emit (node:events:514:28)
    at maybeClose (node:internal/child_process:1091:16)
    at ChildProcess._handle.onexit (node:internal/child_process:302:5)

To Reproduce Steps to reproduce the behavior: npm i @nx-bun/nx --include=dev or npm i @nx-bun/nx --include=dev --force and then nx g create application

Expected behavior I'd expect it to not break with new NX versions or maybe it could provide custom executor for bun to store it locally?

Jordan-Hall commented 7 months ago

I'll update it tomorrow evening sorry

Jordan-Hall commented 7 months ago

Hey @DanielKucal nx 17 support just been released

DanielKucal commented 6 months ago

@Jordan-Hall I've just tried it out. Installing with pnpm failed (will open another PR for that), but worked with npm. However, there's still some issue while trying to create an app:

% node --version
v20.10.0
% nx g create --verbose

 >  NX   Running global Nx CLI with PNPM may have issues.

   Prefer to use "pnpm" (https://pnpm.io/cli/exec) to execute commands in this workspace.
    TIP  create a shortcut such as: alias pnx="pnpm nx --"

>  NX  Generating @nx-bun/nx:create

✔ What name would you like to use? · api
✔ What name would you like to use? · api
✔ Is this an application or a library? · application
✔ What should be the project name and where should it be generated? · api @ apps/api
In Nx 18, generating projects will no longer derive the name and root.
Please provide the exact project name and root in the future.
Example: nx g @nx-bun/nx:create api --directory apps/api
error: could not determine executable to run for package create-api

 >  NX   child process exited with code 1

Error: child process exited with code 1
    at ChildProcess.<anonymous> (/nx-monorepo/packages/nx-bun/src/utils/bun-cli.ts:187:20)
    at ChildProcess.emit (node:events:514:28)
    at maybeClose (node:internal/child_process:1105:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:305:5)
Jordan-Hall commented 6 months ago

Thank you! Sorry I dont use PNPM anymore only bun and npm. If you can open a ticket that would be great otherwise i'll resolve this tonight. Working on publishable libs tonight which should be finished and new release in