Gabriel Duncan
01/10/2022, 4:44 PMcolors
thing. is there a way i can pin a version of a library that is included by a dependency indirectly through npm? i know in jvm lang you can force pin a transitive dependency but not sure that works for npmGabriel Duncan
01/10/2022, 4:45 PMGabriel Duncan
01/10/2022, 4:46 PMephemient
01/10/2022, 6:08 PMGabriel Duncan
01/10/2022, 6:18 PMephemient
01/10/2022, 6:22 PMGabriel Duncan
01/10/2022, 6:23 PMGabriel Duncan
01/10/2022, 6:24 PMGabriel Duncan
01/10/2022, 6:27 PMephemient
01/10/2022, 6:33 PM./gradlew :kotlinStoreYarnLock
, but it's supposed to be automatic unless you somehow disabled itephemient
01/10/2022, 6:35 PMGabriel Duncan
01/10/2022, 6:35 PMstartParameter.excludedTaskNames += setOf(
":customer-portal-app:compileTestDevelopmentExecutableKotlinJs",
":customer-portal-app:compileTestProductionExecutableKotlinJs"
)
Gabriel Duncan
01/10/2022, 6:35 PMOliver.O
01/10/2022, 10:31 PMkotlinNpmInstall
task effectively
• invokes the kotlinRestoreYarnLock
task, copying kotlin-js-store/yarn.lock
to build/js/yarn.lock
, if the former exists.
• installs Npm packages,
• invokes the kotlinStoreYarnLock
task, creating or updating kotlin-js-store/yarn.lock
.
The intention is to track kotlin-js-store/yarn.lock
in a VCS to enable stable builds and discover differences.
Effects on Introducing Malicious Code
The feature will
1. ❌ block implicit Npm package version upgrades as long as no new dependencies are introduced,
2. ❌ block the execution of install scripts by default,
3. ✅ install newly declared dependencies, including their transitive dependencies.
◦ 💀 This can install malicious code.
So while the feature can ensure stable builds, it will update the stored version of yarn.lock
without asking. For a more robust implementation, which actually blocks running unchecked JS code, see this implementation. It is based on 1.5.31 and no longer current, but you might get the idea.ephemient
01/10/2022, 10:34 PMOliver.O
01/10/2022, 10:47 PMephemient
01/10/2022, 10:59 PMOliver.O
01/10/2022, 11:01 PMGabriel Duncan
01/10/2022, 11:01 PM