Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/enforce-pnpm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Enforce pnpm

on:
pull_request:
push:

jobs:
reject-npm-lockfile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Reject npm lockfiles
run: |
if git ls-files | grep -E '(^|/)package-lock\.json$'; then
echo "Remove package-lock.json and use pnpm."
exit 1
fi
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
min-release-age=3 # days
engine-strict=true
15 changes: 13 additions & 2 deletions bindings/lingua-wasm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,19 @@
"version": "0.1.0",
"description": "WASM bindings for Lingua",
"scripts": {
"preinstall": "node -e \"const userAgent = process.env.npm_config_user_agent || ''; if (process.env.INIT_CWD === process.cwd() && !userAgent.includes('pnpm/')) { console.error('Use pnpm in this repo.'); process.exit(1); }\"",
"build": "pnpm run build:nodejs && pnpm run build:web",
"build:nodejs": "cd ../../crates/lingua && wasm-pack build --target nodejs --release --out-dir ../../bindings/lingua-wasm/nodejs --no-pack",
"build:web": "cd ../../crates/lingua && wasm-pack build --target web --release --out-dir ../../bindings/lingua-wasm/web --no-pack"
},
"packageManager": "pnpm@10.33.0",
"devEngines": {
"packageManager": {
"name": "pnpm",
"version": ">=10.27.0",
"onFail": "error"
}
},
"files": [
"nodejs",
"web"
Expand Down Expand Up @@ -35,6 +44,8 @@
"./nodejs/lingua.js",
"./web/lingua.js"
],
"license": "MIT"
"license": "MIT",
"engines": {
"pnpm": ">=10.27.0"
}
}

12 changes: 12 additions & 0 deletions bindings/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,22 @@
"version": "0.1.0",
"description": "TypeScript bindings for Lingua - Universal message format for LLM APIs",
"scripts": {
"preinstall": "node -e \"const userAgent = process.env.npm_config_user_agent || ''; if (process.env.INIT_CWD === process.cwd() && !userAgent.includes('pnpm/')) { console.error('Use pnpm in this repo.'); process.exit(1); }\"",
"build": "rm -rf dist && tsup",
"generate": "cd ../.. && cargo test --features ts-rs/export",
"test": "vitest",
"test:run": "pnpm build && vitest run",
"typecheck": "tsc --noEmit",
"prepublishOnly": "pnpm run build"
},
"packageManager": "pnpm@10.33.0",
"devEngines": {
"packageManager": {
"name": "pnpm",
"version": ">=10.27.0",
"onFail": "error"
}
},
"files": [
"dist"
],
Expand Down Expand Up @@ -64,5 +73,8 @@
"peerDependencies": {
"@anthropic-ai/sdk": "^0.63.0",
"openai": "^5.22.0"
},
"engines": {
"pnpm": ">=10.27.0"
}
}
16 changes: 15 additions & 1 deletion examples/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,26 @@
"description": "Example demonstrating Lingua universal message format conversion",
"type": "module",
"scripts": {
"preinstall": "node -e \"const userAgent = process.env.npm_config_user_agent || ''; if (process.env.INIT_CWD === process.cwd() && !userAgent.includes('pnpm/')) { console.error('Use pnpm in this repo.'); process.exit(1); }\"",
"start": "dotenv -e .env -- tsx index.ts",
"watch": "dotenv -e .env -- tsx watch index.ts"
},
"packageManager": "pnpm@10.33.0",
"engines": {
"pnpm": ">=10.27.0",
"npm": "please-use-pnpm",
"yarn": "please-use-pnpm"
},
"devEngines": {
"packageManager": {
"name": "pnpm",
"version": ">=10.27.0",
"onFail": "error"
}
},
"dependencies": {
"@anthropic-ai/sdk": "^0.63.0",
"@braintrust/lingua": "file:../../bindings/typescript",
"@braintrust/lingua": "workspace:*",
"openai": "^5.22.0"
},
"devDependencies": {
Expand Down
Loading
Loading