Skip to content

Commit

Permalink
Bootstrap/Scaffolding tool (ckb-create-js-vm-app) (#59)
Browse files Browse the repository at this point in the history
* feat: add create-app
  • Loading branch information
XuJiandong authored Mar 5, 2025
1 parent 027d906 commit 0f5a4f8
Show file tree
Hide file tree
Showing 26 changed files with 951 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ jobs:
run: cd packages/ckb-testtool && pnpm build && pnpm test
- name: Generate typedoc
run: pnpm run docs
- name: Create app
run: cd .. && node ckb-js-vm/packages/create-app/dist/index.js test-app && cd test-app && pnpm build && pnpm test
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@ Ensure you have the following installed:
- [ckb-debugger](https://github.com/nervosnetwork/ckb-standalone-debugger)
- clang-18

## Installation

## Quick Start with create-ckb-js-vm-app (Recommended)

```bash
pnpm create ckb-js-vm-app
```


## Install Manually

### Building ckb-js-vm (On-chain Script)

Expand Down
13 changes: 13 additions & 0 deletions packages/create-app/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
node_modules/

dist/
dist.commonjs/

.npmignore
.prettierrc
tsconfig.json
eslint.config.mjs
.prettierrc

tsconfig.tsbuildinfo
.github/
9 changes: 9 additions & 0 deletions packages/create-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# create-ckb-js-vm-app

create-ckb-js-vm-app is a CLI tool that helps you quickly bootstrap CKB script powered by [ckb-js-vm](https://github.com/nervosnetwork/ckb-js-vm). It allows you to generate a on-chain script project with support for TypeScript.

# Getting Started

```bash
pnpm create ckb-js-vm-app
```
46 changes: 46 additions & 0 deletions packages/create-app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "create-ckb-js-vm-app",
"version": "0.1.3",
"description": "CLI tool to quickly bootstrap CKB on-chain script with ckb-js-vm.",
"private": false,
"homepage": "https://github.com/nervosnetwork/ckb-js-vm",
"repository": {
"type": "https",
"url": "https://github.com/nervosnetwork/ckb-js-vm.git"
},
"keywords": [
"create ckb-js-vm on-chain script"
],
"license": "MIT",
"publishConfig": {
"access": "public"
},
"author": "CKB VM Team",
"main": "dist/index.js",
"scripts": {
"build": "tsc",
"format": "prettier --write .",
"dev": "tsc --watch"
},
"bin": {
"create-ckb-js-vm-app": "./dist/index.js"
},
"dependencies": {
"commander": "^12.1.0",
"cross-spawn": "^7.0.5",
"fs-extra": "^11.2.0",
"picocolors": "^1.1.1",
"prompts": "^2.4.2",
"update-check": "^1.5.4",
"validate-npm-package-name": "^6.0.0"
},
"devDependencies": {
"prettier": "^3.2.5",
"@types/cross-spawn": "^6.0.6",
"@types/fs-extra": "^11.0.4",
"@types/node": "^20.11.24",
"@types/prompts": "^2.4.9",
"@types/validate-npm-package-name": "^4.0.2",
"typescript": "^5.3.3"
}
}
5 changes: 5 additions & 0 deletions packages/create-app/src/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Default versions for dependencies
export const bindingVersion = "~0.1.0";
export const coreVersion = "~0.1.1";
export const testtoolVersion = "~0.1.1";
export const cccCoreVersion = "~1.5.0";
Loading

0 comments on commit 0f5a4f8

Please sign in to comment.