Skip to content

Commit 536fc32

Browse files
committed
Document "build/ts" scripts
1 parent b1f4e10 commit 536fc32

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

scripts/build/ts/build-dev.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
#!/usr/bin/env bash
22
set -Eeuo pipefail
33

4+
# Description:
5+
# Builds the o1js TypeScript project for development. This script:
6+
# - Compiles the TypeScript source files and outputs the compiled JavaScript to the `dist/` directory.
7+
# - Copies prebuilt Node bindings from `src/bindings/compiled/node_bindings/`
8+
# into `dist/node/bindings/compiled/node_bindings/`.
9+
# - Copies the top-level TypeScript declaration file (`src/bindings.d.ts`)
10+
# to `dist/node/` for type support.
11+
#
12+
# Notes:
13+
# - Expects node bindings to be prebuilt(compiled by earlier build steps).
14+
#
15+
# Usage:
16+
# npm run build:dev
17+
18+
419
# shared ux library
520
source ./scripts/lib/ux.sh
621

scripts/build/ts/build-node.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
#!/usr/bin/env bash
22
set -Eeuo pipefail
33

4+
# Description:
5+
# Builds the o1js project for Node.js usage. This script:
6+
# - Ensures that the Node bindings are available:
7+
# 1. Checks for precompiled bindings locally.
8+
# 2. Attempts to download CI-built bindings via `npm run check:bindings` if missing.
9+
# 3. Falls back to building bindings locally via `npm run build:bindings-node` if necessary.
10+
# - Cleans the `dist/node` directory to ensure a fresh build output.
11+
# - Runs the development TypeScript build (`npm run build:dev`) to produce compiled JS in `dist/`.
12+
# - Builds the final Node bundle via `src/build/build-node.js`.
13+
#
14+
# Usage:
15+
# npm run build
16+
17+
418
# shared libraries
519
source ./scripts/lib/ux.sh
620

scripts/build/ts/build-web.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
#!/usr/bin/env bash
22
set -Eeuo pipefail
33

4+
# Description:
5+
# Builds the o1js project for Web (browser) usage. This script:
6+
# - Cleans the existing `dist/web` directory to ensure a fresh build output.
7+
# - Runs the web build process via `src/build/build-web.js`, generating the
8+
# browser-compatible bundle and associated artifacts.
9+
#
10+
# Usage:
11+
# npm run build:web
12+
13+
414
# logging lib
515
source ./scripts/lib/ux.sh
616
setup_script "${BASH_SOURCE[0]}" "Web build"

0 commit comments

Comments
 (0)