diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cb9ab9f1..fa0d8fad 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,7 +23,7 @@ spec diverges from Solid, the divergence is recorded as a `DV-n` in ## Running the suite -Solid is built from its `next` branch at the pinned commit (needs pnpm and a +Solid is built from its `main` branch at the pinned commit (needs pnpm and a Rust toolchain): ```sh diff --git a/README.md b/README.md index f593c7b8..7b94e05d 100644 --- a/README.md +++ b/README.md @@ -177,7 +177,7 @@ node --experimental-strip-types ref/check.ts examples/todo.rx # check a progra node --experimental-strip-types ref/run.ts # run every scenario ``` -Running the scenarios on Solid itself needs Solid's `next` branch built from +Running the scenarios on Solid itself needs Solid's `main` branch built from source (pnpm and a Rust toolchain); see [CONTRIBUTING.md](CONTRIBUTING.md) and [`ref/README.md`](ref/README.md). The compiler builds with Cargo ([`compiler/README.md`](compiler/README.md)). To try an unreleased editor build, install a `.vsix` from a run of the diff --git a/ref/README.md b/ref/README.md index 30288915..ea1ca731 100644 --- a/ref/README.md +++ b/ref/README.md @@ -8,12 +8,13 @@ Why TypeScript and not OCaml: it runs in the playground later, and it can import `@solidjs/signals` to diff the interpreter against the real runtime on the same scenario. -Solid comes from its `next` branch, built from source at the commit in +Solid comes from its `main` branch, built from source at the commit in `ref/SOLID_NEXT`: `sh ref/scripts/solid-next.sh` checks it out beside this repository (`../solid-next`), builds `@solidjs/signals`, `solid-js`, `@solidjs/web`, `@solidjs/universal` and the native `@solidjs/compiler` (pnpm and a Rust toolchain), and `ref/package.json` links them -(`--latest` moves the pin to `next`'s HEAD). Views are JSX that +(`--latest` moves the pin to `main`'s HEAD, or to another branch's with +`SOLID_BRANCH=`). Views are JSX that `@solidjs/compiler` lowers (`compile/jsx.ts`): `universal` over a string-tree renderer for the compiled runner, `ssr` and `dom` (hydratable) for the server runner. diff --git a/ref/scripts/solid-next.sh b/ref/scripts/solid-next.sh index 0a708b97..eff50424 100644 --- a/ref/scripts/solid-next.sh +++ b/ref/scripts/solid-next.sh @@ -1,15 +1,22 @@ #!/bin/sh -# ref/ runs on Solid 2.0's `next` branch built from source — the branch the async rules come from — at the commit -# pinned in ref/SOLID_NEXT. The checkout lives beside this repository (../solid-next), or at $SOLID_NEXT. +# ref/ runs on Solid 2.0 built from source, at the commit pinned in ref/SOLID_NEXT. The checkout lives beside this +# repository (../solid-next), or at $SOLID_NEXT. # sh ref/scripts/solid-next.sh check out the pinned commit and build what ref/ links -# sh ref/scripts/solid-next.sh --latest move the pin to next's HEAD first +# sh ref/scripts/solid-next.sh --latest move the pin to main's HEAD first +# The pin is fetched by its hash, so it builds whichever branch it is on. $SOLID_BRANCH (default main) is the branch a +# new checkout starts on and --latest follows: `SOLID_BRANCH= sh ref/scripts/solid-next.sh --latest`. set -e HERE=$(cd "$(dirname "$0")/.." && pwd) DIR=${SOLID_NEXT:-$HERE/../../solid-next} -[ -d "$DIR/.git" ] || git clone --branch next https://github.com/solidjs/solid "$DIR" -git -C "$DIR" fetch -q origin next -if [ "$1" = "--latest" ]; then git -C "$DIR" rev-parse origin/next > "$HERE/SOLID_NEXT"; fi -git -C "$DIR" checkout -q "$(cat "$HERE/SOLID_NEXT")" +BRANCH=${SOLID_BRANCH:-main} +[ -d "$DIR/.git" ] || git clone --branch "$BRANCH" https://github.com/solidjs/solid "$DIR" +if [ "$1" = "--latest" ]; then + git -C "$DIR" fetch -q origin "$BRANCH" + git -C "$DIR" rev-parse FETCH_HEAD > "$HERE/SOLID_NEXT" +fi +PIN=$(cat "$HERE/SOLID_NEXT") +git -C "$DIR" cat-file -e "$PIN^{commit}" 2>/dev/null || git -C "$DIR" fetch -q origin "$PIN" +git -C "$DIR" checkout -q "$PIN" cd "$DIR" pnpm install --frozen-lockfile for p in signals solid web universal; do (cd "packages/$p" && pnpm run build && pnpm run --if-present types); done # types: the JSX types the types runner checks against