Skip to content

docs: fix npmMinimalAgeGate default value.#7125

Open
ryanfox1985 wants to merge 3 commits intoyarnpkg:masterfrom
ryanfox1985:fix_default_parameter
Open

docs: fix npmMinimalAgeGate default value.#7125
ryanfox1985 wants to merge 3 commits intoyarnpkg:masterfrom
ryanfox1985:fix_default_parameter

Conversation

@ryanfox1985
Copy link
Copy Markdown

@ryanfox1985 ryanfox1985 commented Apr 30, 2026

What's the problem this PR addresses?

according the documentation https://github.com/ryanfox1985/berry/blob/fix_default_parameter/packages/docusaurus/static/configuration/yarnrc.json#L506

    "npmMinimalAgeGate": {
      "_package": "@yarnpkg/core",
      "title": "Minimum age of a package version according to the publish date on the npm registry to be considered for installation.",
      "description": "If a package version is newer than the minimal age gate, it will not be considered for installation. This can be used to reduce the likelihood of installing compromised packages, or to avoid relying on packages that could still be unpublished (e.g. the npm registry has specific rules for packages less than 3 days old).",
      "type": ["number", "string"],
      "oneOf": [
        { "type": "number" },
        { "type": "string", "pattern": "^(\\d*\\.?\\d+)(ms|s|m|h|d|w)?$" }
      ],
      "default": "3d"
    },

The default parameter is 3 days and current code doesn't apply any default.

How did you fix it?

Just appending the default value.

Checklist

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

@ryanfox1985 ryanfox1985 changed the title Fixed default parameter. Fixed npmMinimalAgeGate default parameter. Apr 30, 2026
@ryanfox1985 ryanfox1985 changed the title Fixed npmMinimalAgeGate default parameter. Fixed npmMinimalAgeGate default value. Apr 30, 2026
@ryanfox1985 ryanfox1985 changed the title Fixed npmMinimalAgeGate default value. Fix: npmMinimalAgeGate default value. Apr 30, 2026
Copy link
Copy Markdown
Member

@clemyan clemyan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. The docs is wrong here, so that's what should be fixed. Set the correct default there and bump 3d down to an example.

Enabling minimal age by default is a huge breaking change and should not be done lightly

@ryanfox1985
Copy link
Copy Markdown
Author

@clemyan I pushed the docs fix then.

{ "type": "string", "pattern": "^(\\d*\\.?\\d+)(ms|s|m|h|d|w)?$" }
],
"default": "3d"
"default": "0m"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"default": "0m"
"default": "0m",
"examples": ["3d"]

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we could append 1w too?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As an array

@merceyz merceyz changed the title Fix: npmMinimalAgeGate default value. docs: fix npmMinimalAgeGate default value. May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants