Skip to content
Open
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
24 changes: 24 additions & 0 deletions .yarn/versions/ad9ce922.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
releases:
"@yarnpkg/cli": minor
"@yarnpkg/plugin-npm": minor

declined:
- "@yarnpkg/plugin-compat"
- "@yarnpkg/plugin-constraints"
- "@yarnpkg/plugin-dlx"
- "@yarnpkg/plugin-essentials"
- "@yarnpkg/plugin-init"
- "@yarnpkg/plugin-interactive-tools"
- "@yarnpkg/plugin-nm"
- "@yarnpkg/plugin-npm-cli"
- "@yarnpkg/plugin-pack"
- "@yarnpkg/plugin-patch"
- "@yarnpkg/plugin-pnp"
- "@yarnpkg/plugin-pnpm"
- "@yarnpkg/plugin-stage"
- "@yarnpkg/plugin-typescript"
- "@yarnpkg/plugin-version"
- "@yarnpkg/plugin-workspace-tools"
- "@yarnpkg/builder"
- "@yarnpkg/core"
- "@yarnpkg/doctor"
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ const mte = generatePkgDriver({
[`YARN_ENABLE_INLINE_BUILDS`]: `false`,
// Otherwise we would more often test the fallback rather than the real logic
[`YARN_PNP_FALLBACK_MODE`]: `none`,
// Disable the age gate by default; tests that specifically test it override this via subDefinition
[`YARN_NPM_MINIMAL_AGE_GATE`]: `0`,
// Otherwise tests fail on systems where this is globally set to true
[`YARN_ENABLE_GLOBAL_CACHE`]: `false`,
// To make sure we can call Git commands
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ describe(`Commands`, () => {
COREPACK_ROOT: `/path/to/corepack`,
YARN_IS_TEST_ENV: undefined,
YARN_CACHE_VERSION_OVERRIDE: undefined,
// Old yarn versions don't support this setting; unset to avoid "Unrecognized configuration" errors
YARN_NPM_MINIMAL_AGE_GATE: undefined,
},
}, async ({path, run, source}) => {
// To force yarnPath to be set; followed by a sanity check
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-npm/sources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const packageGateSettings = {
description: `Minimum age of a package version according to the publish date on the npm registry to be considered for installation`,
type: SettingsType.DURATION,
unit: DurationUnit.MINUTES,
default: `0m`,
default: `4320m`,
},
npmPreapprovedPackages: {
description: `Array of package descriptors or package name glob patterns to exclude from the minimum release age check`,
Expand Down
5 changes: 4 additions & 1 deletion packages/plugin-npm/sources/npmConfigUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ function shouldBeQuarantined({configuration, version, publishTimes}: IsPackageAp
const minimalAgeGate = configuration.get(`npmMinimalAgeGate`);

if (minimalAgeGate) {
const versionTime = publishTimes?.[version];
if (typeof publishTimes === `undefined`)
return false;

const versionTime = publishTimes[version];
if (typeof versionTime === `undefined`)
return true;

Expand Down
Loading