aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-09-05 21:43:25 -0700
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-09-05 21:43:25 -0700
commitcb70d08573e72a0c470f1aaf2aa3eed755912014 (patch)
tree8d41b835955da65d35b584fb24c8ed054bea8d58
parentcd69063660ed24ea31447006319343fe841fd147 (diff)
downloadbun-cb70d08573e72a0c470f1aaf2aa3eed755912014.tar.gz
bun-cb70d08573e72a0c470f1aaf2aa3eed755912014.tar.zst
bun-cb70d08573e72a0c470f1aaf2aa3eed755912014.zip
current
Former-commit-id: 8517ba72e79b75bf016c3fa66deb85fab9ff6554
-rw-r--r--.vscode/launch.json4
-rw-r--r--Makefile87
-rw-r--r--build.zig1
-rw-r--r--entitlements.plist8
-rw-r--r--examples/hello-next/bun-framework-next/index.js1
-rw-r--r--examples/hello-next/bun-framework-next/tsconfig.json4
-rw-r--r--examples/hello-next/components/wow/such-path.ts1
-rw-r--r--packages/bun-cli/package.json4
-rw-r--r--packages/speedy-nextjs/package.json6
-rw-r--r--src/cli.zig2
10 files changed, 16 insertions, 102 deletions
diff --git a/.vscode/launch.json b/.vscode/launch.json
index 22a2be395..93d2dadfa 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 cfaf71d3b..d6e36a0dc 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 4e1798155..56fa235d2 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 d0754d039..2a6d39bbf 100644
--- a/entitlements.plist
+++ b/entitlements.plist
@@ -1,3 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
@@ -5,8 +8,7 @@
<true/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
- <key>com.apple.security.cs.disable-library-validation</key>
- <true/>
<key>com.apple.security.cs.disable-executable-page-protection</key>
<true/>
- </dict> \ No newline at end of file
+ </dict>
+ </plist> \ 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 10adb5205..e69de29bb 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 679268d71..d14767c9f 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 000000000..a21ac9ab1
--- /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 000000000..331aaeea3
--- /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 cbe26e4c9..000000000
--- 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 a6310022a..ee0c131f9 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],