From cb70d08573e72a0c470f1aaf2aa3eed755912014 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Sun, 5 Sep 2021 21:43:25 -0700 Subject: [PATCH] current Former-commit-id: 8517ba72e79b75bf016c3fa66deb85fab9ff6554 --- .vscode/launch.json | 4 +- Makefile | 87 +------------------ build.zig | 1 + entitlements.plist | 8 +- .../hello-next/bun-framework-next/index.js | 1 - .../bun-framework-next/tsconfig.json | 4 +- .../hello-next/components/wow/such-path.ts | 1 + packages/bun-cli/package.json | 4 + packages/speedy-nextjs/package.json | 6 -- src/cli.zig | 2 +- 10 files changed, 16 insertions(+), 102 deletions(-) create mode 100644 examples/hello-next/components/wow/such-path.ts create mode 100644 packages/bun-cli/package.json delete mode 100644 packages/speedy-nextjs/package.json diff --git a/.vscode/launch.json b/.vscode/launch.json index 22a2be395f..93d2dadfa1 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -153,7 +153,7 @@ "request": "launch", "name": "PNPM .bun", "program": "${workspaceFolder}/build/debug/macos-x86_64/bun", - "args": ["bun", "./pages/index.tsx"], + "args": ["bun", "./pages/index.js"], "cwd": "/Users/jarred/Build/pnpm-bun/packages/app", "console": "internalConsole" }, @@ -196,7 +196,7 @@ "request": "launch", "name": "Dev CRA", "program": "${workspaceFolder}/build/debug/macos-x86_64/bun", - "args": ["dev", "./index.js", "--platform=browser"], + "args": ["dev", "--platform=browser"], "cwd": "${workspaceFolder}/examples/hello-create-react-app/", "console": "internalConsole" }, diff --git a/Makefile b/Makefile index cfaf71d3b7..d6e36a0dcd 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ build-obj: zig build obj -Drelease-fast sign-macos-x64: - gon sign.macos-x64.json + codesign -s 417F1E55D8BDFB5DE25DA3126EDF238ED1F45B7E -f -v --timestamp --entitlements entitlements.plist ./build/macos-aarch64/bun sign-macos-aarch64: gon sign.macos-aarch64.json @@ -148,88 +148,3 @@ sizegen: picohttp: clang -O3 -g -c src/deps/picohttpparser.c -Isrc/deps -o src/deps/picohttpparser.o; cd ../../ - -bun-prod-native-macos: picohttp - zig build -Drelease-fast -Dtarget=x86_64-macos-gnu - -bun-prod-native-macos-lib: - zig build lib -Drelease-fast -Dtarget=x86_64-macos-gnu - -bun-m1: - zig build -Drelease-fast -Dtarget=aarch64-macos-gnu - -bun-prod-wasm: - zig build -Drelease-fast -Dtarget=wasm32-freestanding - -bun-prod-wasi: - zig build -Drelease-fast -Dtarget=wasm32-wasi - -bun-dev: bun-dev-native bun-dev-wasi bun-dev-wasm - -bun-dev-native: - zig build - -bun-dev-wasm: - zig build -Dtarget=wasm32-freestanding - -bun-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-bun: | bench/rome-verify - cd bench/rome/src - /Users/jarred/Code/bun/build/macos-x86_64/bun --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 \ No newline at end of file diff --git a/build.zig b/build.zig index 4e1798155b..56fa235d2e 100644 --- a/build.zig +++ b/build.zig @@ -250,6 +250,7 @@ pub fn build(b: *std.build.Builder) void { obj_step.dependOn(&obj.step); obj.setOutputDir(output_dir); obj.setBuildMode(mode); + obj.setTarget(target); } else { b.default_step.dependOn(&exe.step); } diff --git a/entitlements.plist b/entitlements.plist index d0754d039c..2a6d39bbf8 100644 --- a/entitlements.plist +++ b/entitlements.plist @@ -1,3 +1,6 @@ + + + com.apple.security.cs.allow-jit @@ -5,8 +8,7 @@ com.apple.security.cs.allow-dyld-environment-variables - com.apple.security.cs.disable-library-validation - com.apple.security.cs.disable-executable-page-protection - \ No newline at end of file + + \ No newline at end of file diff --git a/examples/hello-next/bun-framework-next/index.js b/examples/hello-next/bun-framework-next/index.js index 10adb52052..e69de29bb2 100644 --- a/examples/hello-next/bun-framework-next/index.js +++ b/examples/hello-next/bun-framework-next/index.js @@ -1 +0,0 @@ -console.log("HI"); diff --git a/examples/hello-next/bun-framework-next/tsconfig.json b/examples/hello-next/bun-framework-next/tsconfig.json index 679268d715..d14767c9f1 100644 --- a/examples/hello-next/bun-framework-next/tsconfig.json +++ b/examples/hello-next/bun-framework-next/tsconfig.json @@ -14,9 +14,7 @@ "isolatedModules": true, "jsx": "preserve", "baseUrl": ".", - "paths": { - "path": ["node_modules/path-browserify"] - } + "paths": {} }, "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], "exclude": ["node_modules"] diff --git a/examples/hello-next/components/wow/such-path.ts b/examples/hello-next/components/wow/such-path.ts new file mode 100644 index 0000000000..a21ac9ab14 --- /dev/null +++ b/examples/hello-next/components/wow/such-path.ts @@ -0,0 +1 @@ +export const yep = true; diff --git a/packages/bun-cli/package.json b/packages/bun-cli/package.json new file mode 100644 index 0000000000..331aaeea34 --- /dev/null +++ b/packages/bun-cli/package.json @@ -0,0 +1,4 @@ +{ + "name": "bun-cli", + "version": "0.0.0-2" +} diff --git a/packages/speedy-nextjs/package.json b/packages/speedy-nextjs/package.json deleted file mode 100644 index cbe26e4c9e..0000000000 --- a/packages/speedy-nextjs/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "bun-nextjs", - "version": "1.0.0", - "main": "index.js", - "license": "MIT" -} diff --git a/src/cli.zig b/src/cli.zig index a6310022a1..ee0c131f9f 100644 --- a/src/cli.zig +++ b/src/cli.zig @@ -252,7 +252,7 @@ pub const Arguments = struct { ))) { entry_points = entry_points[1..]; } - }, + }, .DevCommand => { if (entry_points.len > 0 and (strings.eqlComptime( entry_points[0],