Skip to content

feat(changesets-renovate): filter out private packages #2545

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

silouanwright
Copy link

@silouanwright silouanwright commented Apr 10, 2025

In a monorepo, people may choose to have some packages published, and keep other packages private.

Private packages (which are represented with a private: true key) ideally shouldn't be published. An example below:

{
  "name": "@scope/package-name",
  "version": "0.0.0",
  "private": true,
  "description": "An internal package for providing a shared configuration to apps",
  "main": "./index.js",
}

In the original GitHub Action from Backstage this is based off, the code is in fact filtering out private packages:

// Parses package.json files and returns the package names
async function getPackagesNames(files) {
  const names = [];
  for (const file of files) {
    const data = JSON.parse(await fs.readFile(file, "utf8"));
    if (!data.private) { // ← It only grabs the package if it's not private.
      names.push(data.name);
    }
  }
  return names;
}

Would love to see that functionality represented in this package as well.

Copy link

changeset-bot bot commented Apr 10, 2025

🦋 Changeset detected

Latest commit: d4baef6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@scaleway/changesets-renovate Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@silouanwright silouanwright marked this pull request as ready for review April 10, 2025 19:24
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.

1 participant