feat(create): add build contract with debug#321
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds debug build capabilities to the CKB JavaScript contract build system, enabling developers to build contracts with debugging features such as sourcemaps, unminified code, and debug symbols. Additionally, it refactors the template configuration structure to improve maintainability.
- Adds
--debugflag support tobuild-contract.jsandbuild-all.jsscripts with debug-specific esbuild parameters - Introduces new npm scripts (
build:debug,build:contract:debug,deploy:debug) for building and deploying debug versions - Refactors template configuration by extracting interfaces and separating concerns in
config.tsand creating a newtype.tsfile
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| templates/v4/base-template/scripts/build-contract.js | Adds debug mode support with conditional esbuild parameters and argument parsing for --debug flag |
| templates/v4/base-template/scripts/build-all.js | Propagates debug flag to individual contract builds |
| templates/v4/base-template/README.md.template | Documents new debug build commands and scripts |
| src/templates/type.ts | Extracts TemplateContext interface to separate type definition file |
| src/templates/prompts.ts | Updates import path for TemplateContext from config to type file |
| src/templates/processor.ts | Updates imports and refactors to use new config structure |
| src/templates/config.ts | Refactors configuration by introducing PackageJsonConfig interface and adding debug-related scripts |
| src/templates/README.md | Removes entire implementation documentation file (373 lines) |
| README.md | Minor wording improvement in project creation description |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
No description provided.