Skip to content
Open
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
59 changes: 59 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,65 @@ jobs:
run: |
pnpm --filter '@bytecodealliance/${{ matrix.workspace }}' --fail-if-no-match run test

test-jco-std-wintertc:
runs-on: ubuntu-latest
needs:
- build
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24

- uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
with:
version: 11

# The WinterTC components are built for wasm32-wasip3 with the toolchain pinned in
# packages/jco-std/crates/rust-toolchain.toml.
- name: Install the WinterTC components' Rust toolchain
working-directory: packages/jco-std/crates
run: rustup toolchain install --no-self-update
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
workspaces: packages/jco-std/crates

- uses: taiki-e/cache-cargo-install-action@9ee83daaa7b96a6fab930949ecf1122bba04a389 # v3.0.8
with:
tool: wasm-tools
- uses: taiki-e/cache-cargo-install-action@9ee83daaa7b96a6fab930949ecf1122bba04a389 # v3.0.8
with:
tool: wac-cli
- uses: bytecodealliance/actions/wasmtime/setup@9152e710e9f7182e4c29ad218e4f335a7b203613 # v1.1.3
with:
version: v51.0.0

- name: Install node modules
run: pnpm install --frozen-lockfile

# The tests build components with the workspace CLI (`jco componentize --backend quickjs`).
- name: Restore workspace CLI and transpiler
uses: $/.github/actions/restore-jco

- name: Build the WinterTC components
run: pnpm --filter '@bytecodealliance/jco-std' --fail-if-no-match run build:wintertc:components

- name: Fetch the pinned WPT subset
run: pnpm --filter '@bytecodealliance/jco-std' --fail-if-no-match run fetch:wpt

- name: Type-check the WinterTC polyfills
run: pnpm --filter '@bytecodealliance/jco-std' --fail-if-no-match run check:wintertc

- name: Run the WinterTC tests in components
env:
WINTERTC_REQUIRE_TOOLS: "1"
run: pnpm --filter '@bytecodealliance/jco-std' --fail-if-no-match run test:wintertc

examples:
needs:
- build
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,13 @@ jobs:
run: |
pnpm install

# jco-std's prepack builds its WinterTC components with the Rust toolchain pinned in
# packages/jco-std/crates/rust-toolchain.toml.
- name: Install the jco-std components' Rust toolchain
if: ${{ needs.meta.outputs.project == 'jco-std' }}
working-directory: packages/jco-std/crates
run: rustup toolchain install --no-self-update

- name: Create release package
working-directory: ${{ needs.meta.outputs.project-dir }}
env:
Expand Down
1 change: 1 addition & 0 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- [CLI helpers](./wasi/preview2-shim/helpers/cli.md)
- [Filesystem helpers](./wasi/preview2-shim/helpers/filesystem.md)
- [Preview 3 shim](./wasi/preview3-shim.md)
- [WinterTC APIs](./wasi/wintertc.md)
- [JavaScript ecosystem interoperability](./interop/index.md)
- [`jco-std`](./interop/jco-std.md)
- [Node.js built-in compatibility](./interop/nodejs-builtins.md)
Expand Down
179 changes: 179 additions & 0 deletions docs/src/wasi/wintertc.md

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion packages/jco-std/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
dist
*.tgz
*.tgz

# WinterTC: generated type declarations (scripts/generate-wintertc-types.mjs)
src/wintertc/generated
src/wintertc/imports
# WinterTC components: cargo output and built components
crates/target
/wasm
# componentize-qjs end-to-end fixtures: bundles, WIT and components
test/wintertc/e2e-qjs/.build
test/wintertc/wpt/.cache/
test/wintertc/wpt/.cache.partial/
8 changes: 7 additions & 1 deletion packages/jco-std/.oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{
"ignorePatterns": ["src/wasi/**/generated/**/*"]
"ignorePatterns": [
"src/wasi/**/generated/**/*",
"src/wintertc/generated/**/*",
"src/wintertc/imports/**/*",
"test/wintertc/wpt/.cache/**/*",
"test/wintertc/wpt/.cache.partial/**/*"
]
}
4 changes: 3 additions & 1 deletion packages/jco-std/.oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"src/wasi/0.2.x/generated/types/**/*.d.ts",
"src/wasi/0.2.3/generated/types/**/*.d.ts",
"src/wasi/0.2.6/generated/types/**/*.d.ts",
"src/wasi/0.2.12/generated/types/**/*.d.ts"
"src/wasi/0.2.12/generated/types/**/*.d.ts",
"src/wintertc/generated/types/**/*.d.ts",
"src/wintertc/imports/**/*.d.ts"
],
"rules": {
"no-unused-vars": "error",
Expand Down
7 changes: 7 additions & 0 deletions packages/jco-std/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ Below is a list of adapters provided by `@bytecodealliance/jco-std`:
| -------------------- | ---------------------------------------------------- |
| `http/adapters/hono` | Enables easier building of [Hono][hono] HTTP servers |

## WinterTC APIs (in development)

The WinterTC Minimum Common API for WASI 0.3 components lives in `src/wintertc/`. A few APIs
(`URL`, `URLPattern`, compression streams, non-UTF-8 `TextDecoder`, `crypto.subtle`) are backed by
Rust components in `wasm/` that you compose with your component; see
[WinterTC APIs](https://bytecodealliance.github.io/jco/wasi/wintertc.html) in the jco book.

## NodeJS API (experimental)

`jco-std` also makes available an experimental NodeJS API that is used by tools like `jco` to
Expand Down
Loading