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
10 changes: 0 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,5 @@
"owner": "wimi321",
"repo": "GoAgent"
}
},
"pnpm": {
"onlyBuiltDependencies": [
"electron",
"electron-winstaller",
"esbuild",
"onnxruntime-node",
"protobufjs",
"sharp"
]
}
}
7 changes: 7 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
packages:
- "."
- "website"
allowBuilds:
electron: true
electron-winstaller: true
esbuild: true
onnxruntime-node: true
protobufjs: true
sharp: true
20 changes: 20 additions & 0 deletions tests/pnpm-config-contract.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import assert from 'node:assert/strict'
import { readFileSync } from 'node:fs'
import { join } from 'node:path'
import test from 'node:test'

const root = process.cwd()

test('pnpm build-script approvals are compatible with pnpm 11', () => {
const packageJson = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8'))
const workspace = readFileSync(join(root, 'pnpm-workspace.yaml'), 'utf8')

assert.equal(packageJson.pnpm?.onlyBuiltDependencies, undefined)
assert.match(workspace, /^allowBuilds:\r?$/m)

for (const dependency of ['electron', 'electron-winstaller', 'esbuild', 'onnxruntime-node', 'protobufjs', 'sharp']) {
assert.match(workspace, new RegExp(`^ ${dependency}: true\\r?$`, 'm'), `missing allowBuilds approval for ${dependency}`)
}

assert.doesNotMatch(workspace, /set this to true or false/)
})
Loading