Skip to content

Commit b374931

Browse files
committed
chore(yarn): disable install scripts and allowlist required builds
Set `enableScripts: false` so dependency build scripts no longer run implicitly during `yarn install`. This closes the largest supply-chain hole: a compromised transitive dependency can no longer execute code on every developer / CI install. Add a `dependenciesMeta` allowlist in root package.json that re-enables build scripts for the four packages this monorepo actually needs to compile: - @swc/core -- native binary, used by i18next-cli (yarn build) - better-sqlite3 -- native binding, used by the SDK's tests - react-native-nitro-modules -- RN native module used by SampleApp - unrs-resolver -- native resolver binary, used by jest-resolve Four other packages still print "lists build scripts, but all build scripts have been disabled" warnings on install. They are intentionally not allowlisted: - @firebase/util -- internal type-generation script, ship-time - es5-ext -- author advertisement postinstall - hyochan-welcome -- "welcome" advertisement postinstall - protobufjs -- proto compilation, not needed for pre-built package on npm The core SDK workspace's own `postinstall` (husky install + shared-native sync) continues to fire -- `enableScripts: false` gates dependency install scripts, not workspace lifecycle scripts. Verified `yarn install --immutable`, `yarn lint`, and `yarn build` all pass with the allowlist in place.
1 parent 0b668ee commit b374931

3 files changed

Lines changed: 24 additions & 1 deletion

File tree

.yarnrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ enableGlobalCache: true
55

66
enableHardenedMode: true
77

8-
enableScripts: true
8+
enableScripts: false
99

1010
enableTelemetry: false
1111

package.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,20 @@
1414
"prettier": "3.5.3",
1515
"react-native-keyboard-controller": "1.20.2"
1616
},
17+
"dependenciesMeta": {
18+
"@swc/core": {
19+
"built": true
20+
},
21+
"better-sqlite3": {
22+
"built": true
23+
},
24+
"react-native-nitro-modules": {
25+
"built": true
26+
},
27+
"unrs-resolver": {
28+
"built": true
29+
}
30+
},
1731
"repository": {
1832
"type": "git",
1933
"url": "https://github.com/GetStream/stream-chat-react-native.git"

yarn.lock

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21925,6 +21925,15 @@ __metadata:
2192521925
prettier: "npm:^3.5.1"
2192621926
semantic-release: "npm:^25.0.2"
2192721927
uglify-js: "npm:^3.19.2"
21928+
dependenciesMeta:
21929+
"@swc/core":
21930+
built: true
21931+
better-sqlite3:
21932+
built: true
21933+
react-native-nitro-modules:
21934+
built: true
21935+
unrs-resolver:
21936+
built: true
2192821937
languageName: unknown
2192921938
linkType: soft
2193021939

0 commit comments

Comments
 (0)