Skip to content

Fix(LanguageServer): Missing mcss-language-server binary entry - #412

Closed
0Miles wants to merge 1 commit into
master-co:rcfrom
0Miles:fix/313-language-server-bin
Closed

0Miles wants to merge 1 commit into
master-co:rcfrom
0Miles:fix/313-language-server-bin

Conversation

@0Miles

@0Miles 0Miles commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #313. The @master/css-language-server package had no executable binary entry — pnpm install -g @master/css-language-server produced nothing in the global bin directory, so non-VSCode LSP hosts (Neovim, Helix, Sublime) couldn't spawn it.

Changes

  • Added src/bin/index.ts (CJS shim that requires the built core and calls new CSSLanguageServer().start())
  • Added bin field to package.json: mcss-language-server and master-css-language-server both point to ./dist/bin/index.cjs
  • Updated css-docs/modules/language-server.md with a "Standalone binary" section

Why CJS, not ESM

The existing ESM build of this server re-exports through nested dependency subpaths (vscode-languageserver/node, vscode-css-languageservice/lib/umd/...) that have no `exports` map and therefore fail Node ≥ 22 ESM resolution. CJS `require` is forgiving and is what every LSP host ends up spawning anyway.

Testing

  • Real spawn test in `tests/bin.test.ts`: spawns the built bin, sends an LSP `initialize` JSON-RPC, asserts a `capabilities` reply
  • All 9 `@master/css-language-server` test files pass
  • Verified locally: `pnpm install -g` followed by `mcss-language-server --stdio` returns Content-Length-framed JSON-RPC reply with `textDocumentSync`, `completionProvider`, etc.

@vercel

vercel Bot commented Apr 30, 2026

Copy link
Copy Markdown

@0Miles is attempting to deploy a commit to the Aoyue Team on Vercel.

A member of the Team first needs to authorize it.

@0Miles 0Miles changed the title fix(language-server): add mcss-language-server bin entry, resolve #313 Fix(LanguageServer): Missing mcss-language-server binary entry Apr 30, 2026
The package had no executable binary entry; pnpm install -g produced
nothing in the global bin directory, so non-VSCode LSP hosts (Neovim,
Helix, Sublime) couldn't spawn it.

- Adds src/bin/index.ts (CJS shim that requires the built core and calls
  new CSSLanguageServer().start())
- Adds bin field to package.json: mcss-language-server and
  master-css-language-server both point to ./dist/bin/index.cjs
- CJS over ESM because vscode-languageserver/node and
  vscode-css-languageservice/lib/umd/... have no exports map and fail
  Node 22 ESM resolution
- Real spawn test in tests/bin.test.ts: spawns the built bin, sends LSP
  initialize, asserts capabilities reply
- Updates css-docs/modules/language-server.md

Closes master-co#313
@0Miles
0Miles force-pushed the fix/313-language-server-bin branch from 957a308 to 1289152 Compare April 30, 2026 19:00
@1aron

1aron commented May 3, 2026

Copy link
Copy Markdown
Member

Already supported; no action needed.

@1aron 1aron closed this May 3, 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.

💖 Missing binary after installing @master/css-language-server

2 participants