From eed843b2afb8188d571cfbdb5b6aaf36857719bb Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Sat, 27 Jun 2026 01:07:13 +0200 Subject: [PATCH] fix: drop no-op install script that triggers Yarn build warning Yarn Berry (Plug'n'Play) prints "YN0007: @datadog/pprof must be built" for any dependency that declares an install/preinstall/postinstall script, even the no-op "exit 0". The package ships prebuilt binaries and excludes binding.gyp from the published tarball, so a consumer has nothing to build; the script only suppressed npm's implicit node-gyp rebuild in the dev tree, which CI and the prepare script do explicitly. Removing it stops the spurious warning for Yarn Berry consumers. Refs: https://github.com/DataDog/dd-trace-js/issues/5432 --- package.json | 1 - ts/test/test-no-build-scripts.ts | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 ts/test/test-no-build-scripts.ts 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, []); + }); +});