Skip to content

feat: publish dbc to npm#381

Merged
amoeba merged 13 commits into
columnar-tech:mainfrom
amoeba:feat/npm
May 20, 2026
Merged

feat: publish dbc to npm#381
amoeba merged 13 commits into
columnar-tech:mainfrom
amoeba:feat/npm

Conversation

@amoeba
Copy link
Copy Markdown
Member

@amoeba amoeba commented May 18, 2026

Adds support for publishing dbc to npm by,

  1. Adding a create_packages.js script and shell packages that can create npm packages for each platform
  2. Integrating this into the release.yml workflow so we publish to npm automatically as part of a release

There are two options for shipping dbc on npm,

  1. A single package with a postinstall script that detects the user's platform and downloads and installs dbc at install time
  2. One package for each platform, with a wrapper package for the user to install

Option 1 is the only one supported by goreleaser but option 2 is better IMO because we ship the dbc binary in the npm package. This means installation isn't making an extra request to a separate origin and it also means the package can be installed with scripts disabled.

Closes #355

@amoeba amoeba requested a review from zeroshade May 18, 2026 18:34
Comment thread .github/workflows/release.yml
@amoeba amoeba requested a review from zeroshade May 19, 2026 01:38
@amoeba
Copy link
Copy Markdown
Member Author

amoeba commented May 19, 2026

I changed how the npm artifacts are built so as little as possible is checked into the repo. create_package.js now creates the entire file structure, including package.json. This is ready for another review.

Copy link
Copy Markdown
Member

@zeroshade zeroshade left a comment

Choose a reason for hiding this comment

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

LGTM, my only question is whether there is any ability to add a "snapshot" style dry-run path to the CI somehow (for example, we have --snapshot for goreleaser so that we can ensure via CI that we don't break the release process).

@amoeba
Copy link
Copy Markdown
Member Author

amoeba commented May 19, 2026

I added a step that just creates the npm packages to the snapshot job in bcec6d5.

@amoeba
Copy link
Copy Markdown
Member Author

amoeba commented May 20, 2026

I'm going to test the update to the snapshot job in a separate draft pr before merging just to make sure it works.

@amoeba
Copy link
Copy Markdown
Member Author

amoeba commented May 20, 2026

Okay, the snapshot job now has a test that actually installs the wrapper package and makes sure the equivalent of dbc --version runs successfully. I'll merge this.

@amoeba amoeba merged commit 1f119d0 into columnar-tech:main May 20, 2026
9 of 10 checks passed
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.

Distribute dbc on npm

2 participants