cleanup stage

This commit is contained in:
Alexander Wang 2025-01-12 21:43:03 -07:00
parent e7f4df37ad
commit b93dd31ba6
No known key found for this signature in database
GPG key ID: BE3937D0D52D8927
4 changed files with 16 additions and 11 deletions

View file

@ -22,5 +22,5 @@ test: fmt
race: fmt
prefix "$@" ./ci/test.sh --race ./...
.PHONY: js
js:
cd d2js/js && prefix "$@" ./make.sh
js: gen
cd d2js/js && prefix "$@" ./make.sh all

View file

@ -1,6 +1,6 @@
.POSIX:
.PHONY: all
all: fmt build test
all: fmt build test cleanup
.PHONY: fmt
fmt: node_modules
@ -8,7 +8,7 @@ fmt: node_modules
prefix "$@" rm -f yarn.lock
.PHONY: build
build: node_modules
build: fmt
prefix "$@" ./ci/build.sh
.PHONY: test
@ -18,3 +18,7 @@ test: build
.PHONY: node_modules
node_modules:
prefix "$@" bun install $${CI:+--frozen-lockfile}
.PHONY: cleanup
cleanup: test
prefix "$@" git checkout -- src/platform.js

View file

@ -1,5 +1,5 @@
import { build } from "bun";
import { copyFile, mkdir, writeFile, readFile, rm } from "node:fs/promises";
import { copyFile, mkdir, writeFile, readFile, rm, chmod } from "node:fs/promises";
import { join, resolve } from "node:path";
const __dirname = new URL(".", import.meta.url).pathname;
@ -31,11 +31,12 @@ const commonConfig = {
async function buildPlatformFile(platform) {
const platformContent =
platform === "node"
? "export * from './platform.node.js';"
: "export * from './platform.browser.js';";
? `export * from "./platform.node.js";`
: `export * from "./platform.browser.js";`;
const platformPath = join(SRC_DIR, "platform.js");
await writeFile(platformPath, platformContent);
await chmod(platformPath, 0o600);
}
async function buildAndCopy(buildType) {

View file

@ -14,8 +14,8 @@ if ! go version | grep -q '1.2[0-9]'; then
exit 1
fi
if [ "${CI:-}" ]; then
export FORCE_COLOR=1
npx playwright@1.31.1 install --with-deps chromium
fi
# if [ "${CI:-}" ]; then
# export FORCE_COLOR=1
# npx playwright@1.31.1 install --with-deps chromium
# fi
_make "$@"