-
Notifications
You must be signed in to change notification settings - Fork 1
cre: build package #35
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
Conversation
console.log( | ||
'Platform specific package already installed. Will fall back to manually downloading binary.' | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thought: I'm confused with this log
If the package is already installed, the install script isn't expected to do anything, right?
The code says so.
OTOH, IIUC the log is saying it will manually download a binary.
|
||
execFileSync(getBinaryPath(), process.argv.slice(2), { | ||
stdio: 'inherit', | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add EOF new line
"proto:format": "bunx @bufbuild/buf format --write", | ||
"test": "bun test", | ||
"test:standard": "./scripts/run-standard-tests.sh", | ||
"build": "bun build --target=node --entrypoints ./src/sdk/index.ts ./src/sdk/utils/index.ts ./src/sdk/runtime/index.ts --outdir=dist && bun run build:declaration && bun run build:cli", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: these scripts are easier to find in alphabetical order.
Problem with this branch is now when I just do This is probably connected with the fact that bun is by default blocking post install |
…ipt after copying the package json
Fixed here -> 6a9acfd |
This pull request introduces significant improvements to the build, packaging, and developer workflow for the SDK, focusing on multi-platform support, streamlined script execution, and enhanced distribution packaging. The main changes include new build and install scripts for handling binaries across platforms, updates to the package manifest for correct publishing, and refactoring of workflow build scripts for better modularity and usability.
Build and Packaging Automation:
build-bins.sh
to automate building CLI binaries for multiple platforms (darwin, linux, windows, arm64, x64) and generate correspondingpackage.json
files for each binary.build-pkg.sh
to orchestrate SDK and binary builds, set executable permissions, clean up build artifacts, and prepare thedist
folder for publishing.mock-install.sh
to simulate local installation of the SDK into a target directory, including moving built binaries and creating symlinks for executables innode_modules/.bin
.Package Manifest and Distribution:
package.json
:@chainlink/cre-sdk
.files
,include
, andbin
fields to ensure correct files and binaries are included in the published package.rimraf
as a dev dependency for cleaning up build artifacts. [1] [2] [3]Developer Workflow and Script Refactoring:
build-single-workflow-js-cmd.ts
andcompile-single-workflow-to-wasm-cmd.ts
for reusability and argument clarity. [1] [2]build-single-workflow.ts
to use the new modular functions, improving clarity and maintainability. [1] [2]scripts/run.ts
to use a mapping of script names to main functions, simplifying script execution and error handling.SDK Exports and TypeScript Configuration:
src/sdk/index.ts
,src/sdk/runtime/index.ts
, andsrc/sdk/utils/index.ts
to ensure all necessary modules and types are available for consumers. [1] [2] [3]tsconfig.types.json
to generate TypeScript declaration files (.d.ts
) only for SDK code, excluding workflow sources.Minor Refactoring and Improvements:
These changes collectively improve the SDK's build reliability, cross-platform support, and developer experience.