Skip to content

feat: build and publish preset binaries - #82

Draft
spiral-ladder wants to merge 1 commit into
mainfrom
bing/publish-minimal
Draft

spiral-ladder wants to merge 1 commit into
mainfrom
bing/publish-minimal

Conversation

@spiral-ladder

Copy link
Copy Markdown
Member

Add an optional zapi.presets list to package.json. Each preset is a build of the same step with extra zig build args.

The 1st preset is the mainnet preset (the default) and keeps .node. The 2nd preset is the minimal preset -minimal.node

requireNapiLibrary(dir, preset) selects one at load time. zapi build --preset <name> renames a local build to match.

A preset is bundled into the target packages unless it is marked standalone, in which case prepublish and publish emit it as its own -- packages that are left out of the main package's optionalDependencies, so consumers download it only when they depend on it explicitly.

Motivation: lodestar-z compiles the consensus preset in, and lodestar's minimal-preset spec tests need a minimal binary that production installs should not have to download.

Add an optional zapi.presets list to package.json. Each preset is a
build of the same step with extra zig build args.

The 1st preset is the mainnet preset (the default) and keeps <binaryName>.node.
The 2nd preset is the minimal preset <binaryName>-minimal.node

`requireNapiLibrary(dir, preset)` selects one at load time.
`zapi build --preset <name>` renames a local build to match.

A preset is bundled into the target packages unless it is marked
standalone, in which case prepublish and publish emit it as its own
<name>-<preset>-<target> packages that are left out of the main
package's `optionalDependencies`, so consumers download it only when
they depend on it explicitly.

Motivation: lodestar-z compiles the consensus preset in, and lodestar's
minimal-preset spec tests need a minimal binary that production
installs should not have to download.
@spiral-ladder

Copy link
Copy Markdown
Member Author

putting this in draft first bc a lot of the text is still quite slop/verbose, i want to trim it down

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

1 participant