Skip to content

Fix spec formatting without requiring pnpm - #3

Closed
CryptAm wants to merge 1 commit into
ProjectOpenSea:mainfrom
CryptAm:patch-1
Closed

CryptAm wants to merge 1 commit into
ProjectOpenSea:mainfrom
CryptAm:patch-1

Conversation

@CryptAm

@CryptAm CryptAm commented Oct 3, 2026

Copy link
Copy Markdown

Motivation

scripts/update-spec.mjs currently runs Biome through pnpm exec.

The package does not declare pnpm as a dependency, while the update workflow is exposed through npm run update-spec. On Windows, when pnpm is unavailable, the formatting step fails with:

spawnSync pnpm ENOENT

The script continues after this error, leaving opensea-api.json unformatted and causing unnecessary formatting noise in the diff.

Reproduction

With pnpm unavailable:

biome format failed (continuing): spawnSync pnpm ENOENT

This resulted in a large formatting diff in opensea-api.json:

3966 additions / 1157 deletions

Solution

Replace the pnpm exec invocation with npm exec -- biome in scripts/update-spec.mjs.

This uses the existing @biomejs/biome devDependency and removes the undeclared pnpm requirement from the spec update workflow.

`scripts/update-spec.mjs` currently runs Biome through `pnpm exec`.

The package does not declare `pnpm` as a dependency, while the update workflow is exposed through `npm run update-spec`. On Windows, when `pnpm` is unavailable, the formatting step fails with:

`spawnSync pnpm ENOENT`

The script continues after this error, leaving `opensea-api.json` unformatted and causing unnecessary formatting noise in the diff.

### Reproduction

With `pnpm` unavailable:

```text
biome format failed (continuing): spawnSync pnpm ENOENT
```

This resulted in a large formatting diff in `opensea-api.json`:

```text
3966 additions / 1157 deletions
```

### Change

Replace the `pnpm exec` invocation with `npm exec -- biome` in `scripts/update-spec.mjs`.

This uses the existing `@biomejs/biome` devDependency and removes the undeclared `pnpm` requirement from the spec update workflow.
@ryanio

ryanio commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

Thanks, the problem is real: this mirror installs with npm, so pnpm exec fails and the spec is left unformatted.

We fixed it a little differently in ProjectOpenSea/opensea-devtools#789 (now merged), with you credited. The script now resolves @biomejs/biome/bin/biome through Node's module resolution and runs it with the current node binary via execFileSync. That keeps the path out of a shell string. It also avoids npm exec falling back to downloading an unrelated package named biome when Biome isn't installed locally.

This repo is a read-only mirror, so we can't merge here, but we review every PR.

@ryanio ryanio closed this Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants