Files
Maciej Lisiewski d4c15db2ba fix(js): refuse npm installs in the JS workspaces, keep npx and npm run
Inside a workspace folder npm treats the folder as its own project and
resolves it from the registry, past pnpm-workspace.yaml's overrides and
release-age gate; the root preinstall never runs there, and
--ignore-scripts skips it at the root. Each workspace folder and the root
now carry an .npmrc with engine-strict=true and an engines.npm that no
npm satisfies. npm checks engines only when it builds a dependency tree,
so install (with --ignore-scripts, --package-lock-only or --force), ci,
update, dedupe, uninstall and link fail with EBADENGINE on npm 10 to 12,
while npx, npm exec and npm run work. pnpm reads neither.

The root refusal needs the root devEngines gone (npm skips root engines
while it is set), so this builds on the single-source pnpm pin. The root
.npmrc also makes npx strict about engines anywhere in the checkout.
npm-shrinkwrap.json joins package-lock.json in .gitignore.
2026-11-07 15:18:02 -08:00

55 lines
1.9 KiB
JSON

{
"name": "@hermes/shared",
"private": true,
"engines": {
"npm": "npm is refused here: run pnpm install --frozen-lockfile at the repository root"
},
"version": "0.0.0",
"type": "module",
"exports": {
".": "./src/index.ts",
"./ansi": "./src/ansi.ts",
"./billing": "./src/billing-types.ts",
"./billing-policy": "./src/billing-policy.ts",
"./charge-settlement": "./src/charge-settlement.ts",
"./circular-buffer": "./src/circular-buffer.ts",
"./color": "./src/color.ts",
"./format": "./src/format.ts",
"./fuzzy": "./src/fuzzy.ts",
"./gateway-canonical": "./src/gateway-canonical.ts",
"./gateway-client": "./src/node/gateway-client.ts",
"./gateway-events": "./src/gateway-events.ts",
"./gateway-text": "./src/gateway-text.ts",
"./gateway-types": "./src/gateway-types.ts",
"./i18n": "./src/i18n.ts",
"./interpolation": "./src/interpolation.ts",
"./json-rpc-channel": "./src/json-rpc-channel.ts",
"./model-search-text": "./src/model-search-text.ts",
"./plan-usage": "./src/plan-usage.ts",
"./prompt-history": "./src/node/prompt-history.ts",
"./provider-names": "./src/provider-names.ts",
"./reasoning-effort": "./src/reasoning-effort.ts",
"./reconnect-backoff": "./src/reconnect-backoff.ts",
"./skin": "./src/skin.ts",
"./slash": "./src/slash.ts",
"./slash-input": "./src/slash-input.ts",
"./slash-score": "./src/slash-score.ts",
"./theme-presets": "./src/theme-presets.ts",
"./usage-tick": "./src/usage-tick.ts"
},
"types": "./src/index.ts",
"scripts": {
"lint": "eslint src/",
"lint:fix": "eslint src/ --fix",
"fix": "pnpm run lint:fix",
"typecheck": "tsc -p . --noEmit && tsc -p tsconfig.node.json --noEmit",
"check": "pnpm run typecheck && pnpm run test && pnpm run lint",
"test": "vitest run"
},
"devDependencies": {
"@types/node": "22.20.5",
"typescript": "6.0.3",
"vitest": "4.1.12"
}
}