aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-10-13 00:28:20 -0700
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-10-13 00:28:20 -0700
commit9e3e9a2d6da9f33f2cfcdb10254f5ef37955019c (patch)
treeb421e988ac6c23bc5bff88a95dbf15722b35e01d /examples
parent88a5e2d34d25c3ac3d13a432bbd85daa075c4bcb (diff)
downloadbun-9e3e9a2d6da9f33f2cfcdb10254f5ef37955019c.tar.gz
bun-9e3e9a2d6da9f33f2cfcdb10254f5ef37955019c.tar.zst
bun-9e3e9a2d6da9f33f2cfcdb10254f5ef37955019c.zip
Clean up examples a little
Diffstat (limited to 'examples')
-rw-r--r--examples/hello-next/components/wow/such-path.ts1
-rw-r--r--examples/hello-next/pages/api/hello.tsx5
-rw-r--r--examples/hello-next/pages/foo/bar/third.tsx26
-rw-r--r--examples/hello-next/pages/posts/[id].tsx19
-rw-r--r--examples/hello-next/styles/2.css0
-rw-r--r--examples/lotta-modules/index.js1
-rw-r--r--examples/lotta-modules/package.json31
-rw-r--r--examples/lotta-modules/public/index.html6
-rw-r--r--examples/next/.eslintrc.json (renamed from examples/hello-next/.eslintrc.json)0
-rw-r--r--examples/next/.gitignore (renamed from examples/hello-next/.gitignore)0
-rw-r--r--examples/next/README.md (renamed from examples/hello-next/README.md)0
-rw-r--r--examples/next/components/Title.tsx (renamed from examples/hello-next/components/Title.tsx)0
-rw-r--r--examples/next/components/subtitle.tsx (renamed from examples/hello-next/components/subtitle.tsx)0
-rw-r--r--examples/next/next-env.d.ts (renamed from examples/hello-next/next-env.d.ts)0
-rw-r--r--examples/next/next.config.js (renamed from examples/hello-next/next.config.js)0
-rw-r--r--examples/next/package-lock.json (renamed from examples/hello-next/package-lock.json)0
-rw-r--r--examples/next/package.json (renamed from examples/hello-next/package.json)10
-rw-r--r--examples/next/pages/_app.tsx (renamed from examples/hello-next/pages/_app.tsx)0
-rw-r--r--examples/next/pages/index.tsx (renamed from examples/hello-next/pages/index.tsx)10
-rw-r--r--examples/next/pages/second.tsx (renamed from examples/hello-next/pages/second.tsx)0
-rw-r--r--examples/next/public/favicon.ico (renamed from examples/hello-next/public/favicon.ico)bin25931 -> 25931 bytes
-rw-r--r--examples/next/public/vercel.svg (renamed from examples/hello-next/public/vercel.svg)0
-rw-r--r--examples/next/styles/Home.module.css (renamed from examples/hello-next/styles/Home.module.css)0
-rw-r--r--examples/next/styles/globals.css (renamed from examples/hello-next/styles/globals.css)0
-rw-r--r--examples/next/tsconfig.json (renamed from examples/hello-next/tsconfig.json)0
-rw-r--r--examples/react/.gitignore (renamed from examples/hello-create-react-app/.gitignore)0
-rw-r--r--examples/react/README.md (renamed from examples/hello-create-react-app/README.md)0
-rw-r--r--examples/react/package.json (renamed from examples/hello-create-react-app/package.json)0
-rw-r--r--examples/react/public/favicon.ico (renamed from examples/hello-create-react-app/public/favicon.ico)bin3870 -> 3870 bytes
-rw-r--r--examples/react/public/index.html (renamed from examples/hello-create-react-app/public/index.html)0
-rw-r--r--examples/react/public/logo192.png (renamed from examples/hello-create-react-app/public/logo192.png)bin5347 -> 5347 bytes
-rw-r--r--examples/react/public/logo512.png (renamed from examples/hello-create-react-app/public/logo512.png)bin9664 -> 9664 bytes
-rw-r--r--examples/react/public/manifest.json (renamed from examples/hello-create-react-app/public/manifest.json)0
-rw-r--r--examples/react/public/robots.txt (renamed from examples/hello-create-react-app/public/robots.txt)0
-rw-r--r--examples/react/src/App.css (renamed from examples/hello-create-react-app/src/App.css)0
-rw-r--r--examples/react/src/App.jsx (renamed from examples/hello-create-react-app/src/App.jsx)0
-rw-r--r--examples/react/src/App.test.js (renamed from examples/hello-create-react-app/src/App.test.js)0
-rw-r--r--examples/react/src/index.css (renamed from examples/hello-create-react-app/src/index.css)0
-rw-r--r--examples/react/src/index.jsx (renamed from examples/hello-create-react-app/src/index.jsx)0
-rw-r--r--examples/react/src/logo.svg (renamed from examples/hello-create-react-app/src/logo.svg)0
-rw-r--r--examples/react/src/reportWebVitals.js (renamed from examples/hello-create-react-app/src/reportWebVitals.js)0
-rw-r--r--examples/react/src/setupTests.js (renamed from examples/hello-create-react-app/src/setupTests.js)0
42 files changed, 7 insertions, 102 deletions
diff --git a/examples/hello-next/components/wow/such-path.ts b/examples/hello-next/components/wow/such-path.ts
deleted file mode 100644
index a21ac9ab1..000000000
--- a/examples/hello-next/components/wow/such-path.ts
+++ /dev/null
@@ -1 +0,0 @@
-export const yep = true;
diff --git a/examples/hello-next/pages/api/hello.tsx b/examples/hello-next/pages/api/hello.tsx
deleted file mode 100644
index df63de88f..000000000
--- a/examples/hello-next/pages/api/hello.tsx
+++ /dev/null
@@ -1,5 +0,0 @@
-// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
-
-export default function handler(req, res) {
- res.status(200).json({ name: 'John Doe' })
-}
diff --git a/examples/hello-next/pages/foo/bar/third.tsx b/examples/hello-next/pages/foo/bar/third.tsx
deleted file mode 100644
index e1df24bc1..000000000
--- a/examples/hello-next/pages/foo/bar/third.tsx
+++ /dev/null
@@ -1,26 +0,0 @@
-import Link from "next/link";
-
-export default function Baz({}) {
- return (
- <div style={{ padding: 16 }}>
- <h1>Third</h1>
- <ul>
- <li>
- <Link href="/">
- <a>Root page</a>
- </Link>
- </li>
- <li>
- <Link href="/second">
- <a>Second page</a>
- </Link>
- </li>
- <li>
- <Link href="/posts/123">
- <a>Post page 123</a>
- </Link>
- </li>
- </ul>
- </div>
- );
-}
diff --git a/examples/hello-next/pages/posts/[id].tsx b/examples/hello-next/pages/posts/[id].tsx
deleted file mode 100644
index bf795ae83..000000000
--- a/examples/hello-next/pages/posts/[id].tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import { useRouter } from "next/router";
-import Link from "next/link";
-
-export default function Post({}) {
- const router = useRouter();
-
- return (
- <div style={{ padding: 16 }}>
- <h1>Post: {router.query.id}</h1>
- <ul>
- <li>
- <Link href="/">
- <a>Root page</a>
- </Link>
- </li>
- </ul>
- </div>
- );
-}
diff --git a/examples/hello-next/styles/2.css b/examples/hello-next/styles/2.css
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/hello-next/styles/2.css
+++ /dev/null
diff --git a/examples/lotta-modules/index.js b/examples/lotta-modules/index.js
deleted file mode 100644
index e8ea94ca2..000000000
--- a/examples/lotta-modules/index.js
+++ /dev/null
@@ -1 +0,0 @@
-import "@babel/standalone/babel";
diff --git a/examples/lotta-modules/package.json b/examples/lotta-modules/package.json
deleted file mode 100644
index f336c9c44..000000000
--- a/examples/lotta-modules/package.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "name": "lotta-modules",
- "version": "1.0.0",
- "license": "MIT",
- "dependencies": {
- "@babel/standalone": "^7.15.3",
- "lodash": "^4.17.21",
- "three.js": "^0.77.1",
- "underscore": "^1.13.1",
- "webpack": "^5.56.0"
- },
- "type": "module",
- "browserslist": [
- "last 1 version"
- ],
- "scripts": {
- "generate": "cp node_modules/three/three.js node_modules/three/three1.js; cp node_modules/three/three.js node_modules/three/three2.js; cp node_modules/three/three.js node_modules/three/three3.js; cp node_modules/three/three.js node_modules/three/three4.js; cp node_modules/three/three.js node_modules/three/three5.js; cp node_modules/three/three.js node_modules/three/three6.js; cp node_modules/three/three.js node_modules/three/three7.js; cp node_modules/three/three.js node_modules/three/three8.js; cp node_modules/three/three.js node_modules/three/three9.js; cp node_modules/three/three.js node_modules/three/three10.js",
- "bench": "hyperfine \"bun bun ./index.js\" \"GOMAXPROCS=1 bun bun ./index.js\" \"esbuild --bundle ./index.js --platform=browser --format=esm > /dev/null\" \"swc ./node_modules/three/three1.js ./node_modules/three/three2.js ./node_modules/three/three3.js ./node_modules/three/three4.js ./node_modules/three/three5.js ./node_modules/three/three6.js ./node_modules/three/three7.js ./node_modules/three/three8.js ./node_modules/three/three9.js ./node_modules/three/three10.js -C \"module.type=es6\" --no-swcrc -s false -o /tmp/out.swc.js\" \"node_modules/.bin/parcel build --no-optimize --no-source-maps --no-content-hash --no-cache --no-autoinstall ./index.js\" --prepare=\"rm -rf dist *.bun .parcel-cache;\"",
- "bench-sync": "hyperfine \"GOMAXPROCS=1 bun bun ./index.js\" \"GOMAXPROCS=1 esbuild --bundle ./index.js --platform=browser --format=esm > /dev/null\" \"swc ./node_modules/three/three1.js ./node_modules/three/three2.js ./node_modules/three/three3.js ./node_modules/three/three4.js ./node_modules/three/three5.js ./node_modules/three/three6.js ./node_modules/three/three7.js ./node_modules/three/three8.js ./node_modules/three/three9.js ./node_modules/three/three10.js -C \"module.type=es6\" --sync --no-swcrc -s false -o /tmp/out.swc.js\" --prepare=\"rm -rf *.bun\" ",
- "bench-all": "hyperfine \"bun bun ./index.js\" \"esbuild --bundle ./index.js --platform=browser --format=esm > /dev/null\" \"esbuild --bundle ./index.js --platform=browser --format=esm > /dev/null\" \"swc ./node_modules/three/three1.js ./node_modules/three/three2.js ./node_modules/three/three3.js ./node_modules/three/three4.js ./node_modules/three/three5.js ./node_modules/three/three6.js ./node_modules/three/three7.js ./node_modules/three/three8.js ./node_modules/three/three9.js ./node_modules/three/three10.js -C \"module.type=es6\" --no-swcrc -s false -o /tmp/out.swc.js\" \"GOMAXPROCS=1 bun bun ./index.js\" \"GOMAXPROCS=1 esbuild --bundle ./index.js --platform=browser --format=esm > /dev/null\" \"swc ./node_modules/three/three1.js ./node_modules/three/three2.js ./node_modules/three/three3.js ./node_modules/three/three4.js ./node_modules/three/three5.js ./node_modules/three/three6.js ./node_modules/three/three7.js ./node_modules/three/three8.js ./node_modules/three/three9.js ./node_modules/three/three10.js -C \"module.type=es6\" --sync --no-swcrc -s false -o /tmp/out.swc.js\" --prepare=\"rm -rf *.bun\"",
- "postinstall": "generate"
- },
- "devDependencies": {
- "@babel/core": "^7.15.5",
- "@babel/preset-env": "^7.15.6",
- "@parcel/core": "^2.0.0-rc.0",
- "babel-loader": "^8.2.2",
- "parcel": "^2.0.0-rc.0",
- "webpack-cli": "^4.8.0"
- }
-}
diff --git a/examples/lotta-modules/public/index.html b/examples/lotta-modules/public/index.html
deleted file mode 100644
index bb6a38234..000000000
--- a/examples/lotta-modules/public/index.html
+++ /dev/null
@@ -1,6 +0,0 @@
-<html>
- <head> </head>
- <body>
- <script src="/index.js"></script>
- </body>
-</html>
diff --git a/examples/hello-next/.eslintrc.json b/examples/next/.eslintrc.json
index bffb357a7..bffb357a7 100644
--- a/examples/hello-next/.eslintrc.json
+++ b/examples/next/.eslintrc.json
diff --git a/examples/hello-next/.gitignore b/examples/next/.gitignore
index 1437c53f7..1437c53f7 100644
--- a/examples/hello-next/.gitignore
+++ b/examples/next/.gitignore
diff --git a/examples/hello-next/README.md b/examples/next/README.md
index b12f3e33e..b12f3e33e 100644
--- a/examples/hello-next/README.md
+++ b/examples/next/README.md
diff --git a/examples/hello-next/components/Title.tsx b/examples/next/components/Title.tsx
index 73963663a..73963663a 100644
--- a/examples/hello-next/components/Title.tsx
+++ b/examples/next/components/Title.tsx
diff --git a/examples/hello-next/components/subtitle.tsx b/examples/next/components/subtitle.tsx
index 1fda3db60..1fda3db60 100644
--- a/examples/hello-next/components/subtitle.tsx
+++ b/examples/next/components/subtitle.tsx
diff --git a/examples/hello-next/next-env.d.ts b/examples/next/next-env.d.ts
index 9bc3dd46b..9bc3dd46b 100644
--- a/examples/hello-next/next-env.d.ts
+++ b/examples/next/next-env.d.ts
diff --git a/examples/hello-next/next.config.js b/examples/next/next.config.js
index c161436ab..c161436ab 100644
--- a/examples/hello-next/next.config.js
+++ b/examples/next/next.config.js
diff --git a/examples/hello-next/package-lock.json b/examples/next/package-lock.json
index 5bbdc1b58..5bbdc1b58 100644
--- a/examples/hello-next/package-lock.json
+++ b/examples/next/package-lock.json
diff --git a/examples/hello-next/package.json b/examples/next/package.json
index f838f1e65..eb34a5f16 100644
--- a/examples/hello-next/package.json
+++ b/examples/next/package.json
@@ -4,17 +4,19 @@
"main": "index.js",
"license": "MIT",
"dependencies": {
- "date-fns": "^2.23.0",
- "isomorphic-fetch": "^3.0.0",
"next": "11.1.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
- "react-is": "^17.0.2",
- "whatwg-url": "^9.1.0"
+ "react-is": "^17.0.2"
},
"devDependencies": {
"@types/react": "^17.0.19",
"bun-framework-next": "^0.0.0-21",
"typescript": "^4.3.5"
+ },
+ "bun-template": {
+ "postinstall": [
+ "bun bun --use next"
+ ]
}
}
diff --git a/examples/hello-next/pages/_app.tsx b/examples/next/pages/_app.tsx
index 2fc3e0700..2fc3e0700 100644
--- a/examples/hello-next/pages/_app.tsx
+++ b/examples/next/pages/_app.tsx
diff --git a/examples/hello-next/pages/index.tsx b/examples/next/pages/index.tsx
index 9101ed8c7..11903e8e5 100644
--- a/examples/hello-next/pages/index.tsx
+++ b/examples/next/pages/index.tsx
@@ -20,7 +20,7 @@ export default function Home({}) {
<main className={styles.main}>
<h1 className={styles.title}>
- Welcome!!to <a href="https://nextjs.org">Next.js!</a>
+ Welcome to <a href="https://nextjs.org">Next.js!</a>
</h1>
<p className={styles.description}>
@@ -37,14 +37,6 @@ export default function Home({}) {
</Link>
<a
- onClick={() => router.push("/foo/bar/third")}
- className={styles.card}
- >
- <h2>Third Page &rarr;</h2>
- <p>button, router.push()</p>
- </a>
-
- <a
href="https://github.com/vercel/next.js/tree/master/examples"
className={styles.card}
>
diff --git a/examples/hello-next/pages/second.tsx b/examples/next/pages/second.tsx
index 0e7b5a5cf..0e7b5a5cf 100644
--- a/examples/hello-next/pages/second.tsx
+++ b/examples/next/pages/second.tsx
diff --git a/examples/hello-next/public/favicon.ico b/examples/next/public/favicon.ico
index 718d6fea4..718d6fea4 100644
--- a/examples/hello-next/public/favicon.ico
+++ b/examples/next/public/favicon.ico
Binary files differ
diff --git a/examples/hello-next/public/vercel.svg b/examples/next/public/vercel.svg
index fbf0e25a6..fbf0e25a6 100644
--- a/examples/hello-next/public/vercel.svg
+++ b/examples/next/public/vercel.svg
diff --git a/examples/hello-next/styles/Home.module.css b/examples/next/styles/Home.module.css
index 539fb3eaf..539fb3eaf 100644
--- a/examples/hello-next/styles/Home.module.css
+++ b/examples/next/styles/Home.module.css
diff --git a/examples/hello-next/styles/globals.css b/examples/next/styles/globals.css
index 1abf383f1..1abf383f1 100644
--- a/examples/hello-next/styles/globals.css
+++ b/examples/next/styles/globals.css
diff --git a/examples/hello-next/tsconfig.json b/examples/next/tsconfig.json
index 7af6240a5..7af6240a5 100644
--- a/examples/hello-next/tsconfig.json
+++ b/examples/next/tsconfig.json
diff --git a/examples/hello-create-react-app/.gitignore b/examples/react/.gitignore
index 4d29575de..4d29575de 100644
--- a/examples/hello-create-react-app/.gitignore
+++ b/examples/react/.gitignore
diff --git a/examples/hello-create-react-app/README.md b/examples/react/README.md
index 02aac3f6e..02aac3f6e 100644
--- a/examples/hello-create-react-app/README.md
+++ b/examples/react/README.md
diff --git a/examples/hello-create-react-app/package.json b/examples/react/package.json
index 43f60301a..43f60301a 100644
--- a/examples/hello-create-react-app/package.json
+++ b/examples/react/package.json
diff --git a/examples/hello-create-react-app/public/favicon.ico b/examples/react/public/favicon.ico
index a11777cc4..a11777cc4 100644
--- a/examples/hello-create-react-app/public/favicon.ico
+++ b/examples/react/public/favicon.ico
Binary files differ
diff --git a/examples/hello-create-react-app/public/index.html b/examples/react/public/index.html
index e933c5650..e933c5650 100644
--- a/examples/hello-create-react-app/public/index.html
+++ b/examples/react/public/index.html
diff --git a/examples/hello-create-react-app/public/logo192.png b/examples/react/public/logo192.png
index fc44b0a37..fc44b0a37 100644
--- a/examples/hello-create-react-app/public/logo192.png
+++ b/examples/react/public/logo192.png
Binary files differ
diff --git a/examples/hello-create-react-app/public/logo512.png b/examples/react/public/logo512.png
index a4e47a654..a4e47a654 100644
--- a/examples/hello-create-react-app/public/logo512.png
+++ b/examples/react/public/logo512.png
Binary files differ
diff --git a/examples/hello-create-react-app/public/manifest.json b/examples/react/public/manifest.json
index 080d6c77a..080d6c77a 100644
--- a/examples/hello-create-react-app/public/manifest.json
+++ b/examples/react/public/manifest.json
diff --git a/examples/hello-create-react-app/public/robots.txt b/examples/react/public/robots.txt
index e9e57dc4d..e9e57dc4d 100644
--- a/examples/hello-create-react-app/public/robots.txt
+++ b/examples/react/public/robots.txt
diff --git a/examples/hello-create-react-app/src/App.css b/examples/react/src/App.css
index 74b5e0534..74b5e0534 100644
--- a/examples/hello-create-react-app/src/App.css
+++ b/examples/react/src/App.css
diff --git a/examples/hello-create-react-app/src/App.jsx b/examples/react/src/App.jsx
index a675d389d..a675d389d 100644
--- a/examples/hello-create-react-app/src/App.jsx
+++ b/examples/react/src/App.jsx
diff --git a/examples/hello-create-react-app/src/App.test.js b/examples/react/src/App.test.js
index 1f03afeec..1f03afeec 100644
--- a/examples/hello-create-react-app/src/App.test.js
+++ b/examples/react/src/App.test.js
diff --git a/examples/hello-create-react-app/src/index.css b/examples/react/src/index.css
index ec2585e8c..ec2585e8c 100644
--- a/examples/hello-create-react-app/src/index.css
+++ b/examples/react/src/index.css
diff --git a/examples/hello-create-react-app/src/index.jsx b/examples/react/src/index.jsx
index 26419cdcb..26419cdcb 100644
--- a/examples/hello-create-react-app/src/index.jsx
+++ b/examples/react/src/index.jsx
diff --git a/examples/hello-create-react-app/src/logo.svg b/examples/react/src/logo.svg
index 9dfc1c058..9dfc1c058 100644
--- a/examples/hello-create-react-app/src/logo.svg
+++ b/examples/react/src/logo.svg
diff --git a/examples/hello-create-react-app/src/reportWebVitals.js b/examples/react/src/reportWebVitals.js
index 5253d3ad9..5253d3ad9 100644
--- a/examples/hello-create-react-app/src/reportWebVitals.js
+++ b/examples/react/src/reportWebVitals.js
diff --git a/examples/hello-create-react-app/src/setupTests.js b/examples/react/src/setupTests.js
index 8f2609b7b..8f2609b7b 100644
--- a/examples/hello-create-react-app/src/setupTests.js
+++ b/examples/react/src/setupTests.js