Skip to content

scripts: add list-publishable-packages helper#164

Open
tejaskochar-db wants to merge 1 commit into
mainfrom
tejaskochar-db/list-publishable-packages
Open

scripts: add list-publishable-packages helper#164
tejaskochar-db wants to merge 1 commit into
mainfrom
tejaskochar-db/list-publishable-packages

Conversation

@tejaskochar-db
Copy link
Copy Markdown
Contributor

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 each package.json's "private" flag, and producing it by hand is error-prone now that some packages live nested under packages/uc/.

This script reuses the same convention already encoded in scripts/check-licenses.mjs: a package is publishable iff its package.json does 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 malformed package.json files.

Behavioral changes

None — purely additive tooling, no existing scripts or build steps are touched.

Internal changes

  • Walks packages/ recursively so nested layouts like packages/uc/catalogs/ are handled.
  • Treats a directory as a leaf package as soon as it contains a package.json, and skips descending into node_modules, dist, src, and tests.

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`).

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.
@github-actions
Copy link
Copy Markdown

Please ensure that the NEXT_CHANGELOG.md file is updated with any relevant changes.
If this is not necessary for your PR, please include the following in your PR description:
NO_CHANGELOG=true
and rerun the job.

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