diff --git a/package.json b/package.json index be4823bc..47c1e315 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,6 @@ "compile": "tsc -p .", "fix": "gts fix", "format": "clang-format --style file -i --glob='bindings/**/*.{h,hh,cpp,cc}'", - "install": "exit 0", "lint": "jsgl --local . && gts check && clang-format --style file -n -Werror --glob='bindings/**/*.{h,hh,cpp,cc}'", "prepare": "npm run compile && npm run rebuild", "pretest:js-asan": "npm run compile && npm run build:asan", diff --git a/ts/test/test-no-build-scripts.ts b/ts/test/test-no-build-scripts.ts new file mode 100644 index 00000000..4aee2b12 --- /dev/null +++ b/ts/test/test-no-build-scripts.ts @@ -0,0 +1,14 @@ +import * as assert from 'assert'; +import * as fs from 'fs'; +import * as path from 'path'; + +describe('package manifest', () => { + it('declares no npm build lifecycle scripts (Yarn Berry YN0007)', () => { + const manifest = path.join(__dirname, '..', '..', 'package.json'); + const pkg = JSON.parse(fs.readFileSync(manifest, 'utf8')); + const scripts = pkg.scripts || {}; + const hooks = ['preinstall', 'install', 'postinstall']; + const present = hooks.filter(name => scripts[name] !== undefined); + assert.deepStrictEqual(present, []); + }); +});