Closed chungweileong94 closed 4 months ago
So I installed biome via pnpm, and based on my understanding, biome will download the binary via postinstall script, which pnpm will put them under node_modules/.pnpm/@biomejs+biome@1.7.3/node_modules/@biomejs/cli-xxx-xxx
. Which mean we have to do more than just node_modules/@biomejs/cli-xxx-xxx
if we want to run it without Node.
pnpm creates a symbolic link though, so node_modules/@biomejs/cli-xxx-xxx
is still valid. Just need to follow the symbolic link, correct?
pnpm creates a symbolic link though
Yes, but apparently pnpm don't create symlink in node_modules/@biomejs/cli-xxx-xxx
🫤. I think pnpm won't includes any at the root of node_modules
that is not directly consumed by the user (dependencies in package.json). Unless we configure the hoist pattern https://pnpm.io/npmrc#hoist-pattern
Yeah... I guess we need to fallback to the node script.
I'm trying to use oxc_resolver, but it just resolves to "/node_modules/@biomejs/cli-darwin-arm64/biome" :/ which is wrong. (https://github.com/biomejs/biome-zed/tree/fix/resolve-binary)
I believe we need to do it ourselves, I think. Check if the binary is a symbolic link and follow it
So the node_modules look like this:
"optionalDependencies" are not linked directly under node_modules, which means we don't really have a link to follow.. :/
Ah, what a bummer :/
For the VS Code extension, I had to resolve the cli packages in the context of the @biomejs/biome
packages. I wonder if it's possible with oxc_resolver.
I checked the VSCode extension, it reminds me of yarn pnp, which I think this extension doesn't work OOB, but I think that can be fixed separately.
In version 0.1.0, the extension doesn't able to locate the biome language server, which likely due to this change https://github.com/biomejs/biome-zed/commit/be0e8868d042ff3cceae74a035fb2fc0d0eb198b.
My current workaround is to customize the lsp binary in settings