Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .eslintrc.js

This file was deleted.

19 changes: 10 additions & 9 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: 'Setup jq'
uses: dcarbone/install-jq-action@v1.0.1
with:
Expand All @@ -49,16 +52,16 @@ jobs:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-deps-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-deps-${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-deps-${{ matrix.node-version }}-
${{ runner.os }}-deps-

- name: Install Dependencies
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
run: yarn install
run: pnpm install --frozen-lockfile

- run: yarn run lint
- run: pnpm run lint

# The C template bundles hook/*.h from the xahaud release branch; fail if they drift.
headers-up-to-date:
Expand Down Expand Up @@ -94,8 +97,6 @@ jobs:

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10

- name: Cache node modules
id: cache-nodemodules
Expand All @@ -107,15 +108,15 @@ jobs:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-deps-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-deps-${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-deps-${{ matrix.node-version }}-
${{ runner.os }}-deps-

- name: Install Dependencies
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
run: yarn install
- run: yarn run build
run: pnpm install --frozen-lockfile
- run: pnpm run build
# Exercises `npm install` / `yarn install` / `pnpm install` + build for
# every supported --package-manager option of `hooks-cli init`.
- run: yarn run test:integration
- run: pnpm run test:integration
9 changes: 6 additions & 3 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v7

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Use Node.js
uses: actions/setup-node@v7
with:
node-version: '22.x'
cache: yarn
cache: pnpm

- name: Update npm for OIDC trusted publishing
run: npm install --global npm@latest
Expand Down Expand Up @@ -60,10 +63,10 @@ jobs:
fi

- name: Install dependencies
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile

- name: Build
run: yarn run build
run: pnpm run build

- name: Publish to npm (dry run)
if: ${{ inputs.dry_run }}
Expand Down
2 changes: 0 additions & 2 deletions .prettierignore

This file was deleted.

12 changes: 6 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
"editor.formatOnSave": true,
"editor.defaultFormatter": "biomejs.biome",
"[json]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
"[jsonc]": {
"editor.defaultFormatter": "biomejs.biome"
},
"cmake.configureOnOpen": false,
"cmake.sourceDirectory": "/Users/dustedfloor/projects/xrpl-labs/the-hooks-library/binaryen/test/lit",
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
- Node >= 20.12 is required.

### Changed:
- `init c` ships the header files in `contracts/include`, taken from the xahaud `release` branch (`yarn headers:update` / `yarn headers:check`).
- Repo tooling: yarn -> pnpm, eslint/prettier -> biome.
- `init c` ships the header files in `contracts/include`, taken from the xahaud `release` branch (`pnpm headers:update` / `pnpm headers:check`).

## [2.0.0] - 2025-01-22

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ c2wasm-cli contracts build --headers headers

This will compile the `contracts` directory and output the `.wasm` files into the `build` directory.

Compilation runs locally via [hooks-compiler](https://www.npmjs.com/package/hooks-compiler) (no compile server is used) and requires Node >= 20.12. If `--headers` is omitted, or the directory has no files, the bundled default headers are used. The bundled headers (also copied into `contracts/include` by `init c`) are `hook/*.h` from the [xahaud](https://github.com/Xahau/xahaud) `release` branch; `yarn headers:update` refreshes them and CI runs `yarn headers:check` to flag drift.
Compilation runs locally via [hooks-compiler](https://www.npmjs.com/package/hooks-compiler) (no compile server is used) and requires Node >= 20.12. If `--headers` is omitted, or the directory has no files, the bundled default headers are used. The bundled headers (also copied into `contracts/include` by `init c`) are `hook/*.h` from the [xahaud](https://github.com/Xahau/xahaud) `release` branch; `pnpm headers:update` refreshes them and CI runs `pnpm headers:check` to flag drift.

To listen to the debug stream, run:

Expand Down Expand Up @@ -67,7 +67,7 @@ await compileC(dirPath, outDir, { headers: "my/headers/dir" });
### Build Repo

```bash
yarn run build
pnpm run build
```

### Build Executable Package
Expand Down
1 change: 0 additions & 1 deletion bin/c2wasm-cli.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env node

// eslint-disable-next-line @typescript-eslint/no-var-requires
const { main } = require("../dist/npm/src/cli");

async function run() {
Expand Down
1 change: 0 additions & 1 deletion bin/cli.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env node

// eslint-disable-next-line @typescript-eslint/no-var-requires
const { main } = require("../dist/npm/src/cli");

async function run() {
Expand Down
19 changes: 19 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "https://biomejs.dev/schemas/2.5.15/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"includes": ["**", "!src/init", "!contracts-c"]
},
"formatter": {
"indentStyle": "space"
},
"javascript": {
"formatter": {
"trailingCommas": "es5"
}
}
}
14 changes: 5 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"scripts": {
"build": "tsc && cp -r src/init dist/npm/src",
"test:integration": "tsx --test test/integration/*.test.ts",
"lint": "eslint ./src/**/* --ext .ts",
"format": "npx prettier --write ./src",
"lint": "biome check",
"format": "biome check --write",
"headers:update": "node scripts/update-headers.mjs",
"headers:check": "node scripts/update-headers.mjs --check"
},
Expand All @@ -50,16 +50,12 @@
"ws": "^8.18.0"
},
"devDependencies": {
"@biomejs/biome": "2.5.15",
"@tsconfig/node24": "^24.0.4",
"@types/node": "^24.13.3",
"@types/ws": "^8.5.14",
"@typescript-eslint/eslint-plugin": "^5.54.1",
"@typescript-eslint/parser": "^5.54.1",
"eslint": "^8.36.0",
"eslint-config-prettier": "^8.7.0",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.8.4",
"tsx": "^4.23.15",
"typescript": "^5.9.3"
}
},
"packageManager": "pnpm@10.34.7"
}
Loading
Loading