scripts: add list-publishable-packages helper#164
Open
tejaskochar-db wants to merge 1 commit into
Open
Conversation
Adds a small Node script that prints the npm package name of every workspace package that should be published. A package is treated as publishable when its package.json does not set "private": true — matching the convention already used by scripts/check-licenses.mjs. The script recurses through packages/ so it picks up packages nested under container directories like packages/uc/, while skipping node_modules, dist, src, and tests to avoid descending into build/test artifacts.
|
Please ensure that the NEXT_CHANGELOG.md file is updated with any relevant changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a small Node script that prints the npm package name of every workspace package that should be published, one per line.
Why
We periodically need the list of publishable packages — for release tooling, scripted checks, or ad-hoc shell pipelines (e.g. piping into
xargs npm view). Today the answer lives implicitly in the directory structure plus eachpackage.json's"private"flag, and producing it by hand is error-prone now that some packages live nested underpackages/uc/.This script reuses the same convention already encoded in
scripts/check-licenses.mjs: a package is publishable iff itspackage.jsondoes not set"private": true.What changed
Interface changes
scripts/list-publishable-packages.mjs— New Node script. Prints publishable package names (one per line, sorted), exits non-zero on malformedpackage.jsonfiles.Behavioral changes
None — purely additive tooling, no existing scripts or build steps are touched.
Internal changes
packages/recursively so nested layouts likepackages/uc/catalogs/are handled.package.json, and skips descending intonode_modules,dist,src, andtests.How is this tested?
Ran locally on this branch (rooted at `main`):
```
$ node scripts/list-publishable-packages.mjs | wc -l
91
```
Spot-checked that the output contains expected packages (e.g. `@databricks/sdk-core`, `@databricks/sdk-auth`) and excludes `@databricks/sdk-examples` (which sets `"private": true`).