mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 10:58:56 +00:00
92 lines
3.4 KiB
Makefile
92 lines
3.4 KiB
Makefile
|
|
speedy: speedy-prod-native speedy-prod-wasi speedy-prod-wasm
|
|
|
|
api:
|
|
peechy --schema src/api/schema.peechy --esm src/api/schema.js --ts src/api/schema.d.ts --zig src/api/schema.zig
|
|
|
|
|
|
speedy-prod-native-macos:
|
|
cd src/deps; clang -c picohttpparser.c; cd ../../
|
|
zig build -Drelease-fast -Dtarget=x86_64-macos-gnu
|
|
|
|
speedy-prod-native-macos-lib:
|
|
zig build lib -Drelease-fast -Dtarget=x86_64-macos-gnu
|
|
|
|
speedy-m1:
|
|
zig build -Drelease-fast -Dtarget=aarch64-macos-gnu
|
|
|
|
speedy-prod-wasm:
|
|
zig build -Drelease-fast -Dtarget=wasm32-freestanding
|
|
|
|
speedy-prod-wasi:
|
|
zig build -Drelease-fast -Dtarget=wasm32-wasi
|
|
|
|
speedy-dev: speedy-dev-native speedy-dev-wasi speedy-dev-wasm
|
|
|
|
speedy-dev-native:
|
|
zig build
|
|
|
|
speedy-dev-wasm:
|
|
zig build -Dtarget=wasm32-freestanding
|
|
|
|
speedy-dev-wasi:
|
|
zig build -Dtarget=wasm32-wasi
|
|
|
|
|
|
|
|
ROME_TSCONFIG += {
|
|
ROME_TSCONFIG += \"compilerOptions\": {
|
|
ROME_TSCONFIG += \"sourceMap\": true,
|
|
ROME_TSCONFIG += \"esModuleInterop\": true,
|
|
ROME_TSCONFIG += \"resolveJsonModule\": true,
|
|
ROME_TSCONFIG += \"moduleResolution\": \"node\",
|
|
ROME_TSCONFIG += \"target\": \"es2019\",
|
|
ROME_TSCONFIG += \"module\": \"commonjs\",
|
|
ROME_TSCONFIG += \"baseUrl\": \".\"
|
|
ROME_TSCONFIG += }
|
|
ROME_TSCONFIG += }
|
|
|
|
github/rome:
|
|
mkdir -p github/rome
|
|
cd github/rome && git init && git remote add origin https://github.com/romejs/rome.git
|
|
cd github/rome && git fetch --depth 1 origin d95a3a7aab90773c9b36d9c82a08c8c4c6b68aa5 && git checkout FETCH_HEAD
|
|
|
|
# This target provides an easy way to verify that the build is correct. Since
|
|
# Rome is self-hosted, we can just run the bundle to build Rome. This makes sure
|
|
# the bundle doesn't crash when run and is a good test of a non-trivial workload.
|
|
bench-rome-verify: | github/rome
|
|
mkdir -p bench/rome-verify
|
|
cp -r github/rome/packages bench/rome-verify/packages
|
|
cp github/rome/package.json bench/rome-verify/package.json
|
|
|
|
bench-rome:
|
|
rm -rf bench/rome
|
|
mkdir -p bench/rome
|
|
cp -r github/rome/packages bench/rome/src/
|
|
echo "$(ROME_TSCONFIG)" > bench/rome/src/tsconfig.json
|
|
echo 'import "rome/bin/rome"' > bench/rome/src/entry.ts
|
|
|
|
# Patch a cyclic import ordering issue that affects commonjs-style bundlers (webpack and parcel)
|
|
echo "export { default as createHook } from './api/createHook';" > .temp
|
|
sed "/createHook/d" bench/rome/src/@romejs/js-compiler/index.ts >> .temp
|
|
mv .temp bench/rome/src/@romejs/js-compiler/index.ts
|
|
|
|
# Replace "import fs = require('fs')" with "const fs = require('fs')" because
|
|
# the TypeScript compiler strips these statements when targeting "esnext",
|
|
# which breaks Parcel 2 when scope hoisting is enabled.
|
|
find bench/rome/src -name '*.ts' -type f -print0 | xargs -L1 -0 sed -i '' 's/import \([A-Za-z0-9_]*\) =/const \1 =/g'
|
|
find bench/rome/src -name '*.tsx' -type f -print0 | xargs -L1 -0 sed -i '' 's/import \([A-Za-z0-9_]*\) =/const \1 =/g'
|
|
|
|
# Get an approximate line count
|
|
rm -r bench/rome/src/@romejs/js-parser/test-fixtures
|
|
echo 'Line count:' && (find bench/rome/src -name '*.ts' && find bench/rome/src -name '*.js') | xargs wc -l | tail -n 1
|
|
|
|
|
|
bench-rome-speedy: | bench/rome-verify
|
|
cd bench/rome/src
|
|
/Users/jarred/Code/esdev/build/macos-x86_64/esdev --outdir=dist ./entry.ts
|
|
|
|
github-rome:
|
|
mkdir -p github/rome
|
|
cd github/rome && git init && git remote add origin https://github.com/romejs/rome.git
|
|
cd github/rome && git fetch --depth 1 origin d95a3a7aab90773c9b36d9c82a08c8c4c6b68aa5 && git checkout FETCH_HEAD
|