diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ee1e49b --- /dev/null +++ b/.gitignore @@ -0,0 +1,32 @@ +**/*.trace +**/*.zip +**/*.tar.gz +**/*.tgz +**/*.log + +package-lock.json +**/*.bun + +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# production +/build + +# misc +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index 1955e14..76f3b44 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -1,4 +1,4 @@ -FROM gitpod/workspace-full +FROM gitpod/ RUN curl -fsSL https://bun.sh/install | bash RUN echo 'export BUN_INSTALL="/home/gitpod/.bun"' >> /home/gitpod/.bashrc.d/600-bun | bash && \ diff --git a/.gitpod.yml b/.gitpod.yml index 86f4335..80f5d7b 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -2,13 +2,8 @@ image: file: .gitpod.Dockerfile tasks: - - name: Run Script Using Bun - command: bun run hashing.js - openMode: split-left - - name: Run Dev Server command: bun dev - openMode: split-right ports: - port: 3000 diff --git a/README.md b/README.md index 964f06c..6f5b70b 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,24 @@ -# Bun Template for Gitpod +# React Bun Template for Gitpod +This is a React project boostrapped with bun. -Spin up the [Bun](https://bun.sh) Server with a Single Click on Gitpod +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/Joshuafrankle/bun-react) -[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/Siddhant-K-code/bun-on-gitpod) +## Getting Started -## Run Any Script +### Install packages ```sh -bun run hashing.js +bun install +(or) +bun install --backend=copyfile && bun bun ``` -## Run the Dev Server +### Development -```sh +Run the development server. + +``` bun dev ``` -> Currently this will render the `index.html` file +You can start editing the page by modifying src/pages/Home.tsx. The page auto-updates as you edit the file. diff --git a/bun.lockb b/bun.lockb new file mode 100755 index 0000000..7768e79 Binary files /dev/null and b/bun.lockb differ diff --git a/hashing.js b/hashing.js deleted file mode 100644 index 08e7dad..0000000 --- a/hashing.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Example Taken From https://github.com/Jarred-Sumner/bun/blob/main/examples/hashing.js - */ - -// Accepts a string, TypedArray, or Blob (file blob supported is not implemented but planned) -const input = "hello world".repeat(400); - -// Bun.hash() defaults to Wyhash because it's fast -console.log(Bun.hash(input)); - -console.log(Bun.hash.wyhash(input)); -// and returns a number -// all of these hashing functions return numbers, not typed arrays. -console.log(Bun.hash.adler32(input)); -console.log(Bun.hash.crc32(input)); -console.log(Bun.hash.cityHash32(input)); -console.log(Bun.hash.cityHash64(input)); -console.log(Bun.hash.murmur32v3(input)); -console.log(Bun.hash.murmur64v2(input)); - -// Second argument accepts a seed where relevant -console.log(Bun.hash(input, 12345)); diff --git a/index.html b/index.html deleted file mode 100644 index ca2bcab..0000000 --- a/index.html +++ /dev/null @@ -1 +0,0 @@ -

Welcome to Bun From Gitpod 🍊

\ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..6397b08 --- /dev/null +++ b/package.json @@ -0,0 +1,22 @@ +{ + "name": "react-app", + "version": "0.0.47", + "dependencies": { + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-router-dom": "^6.3.0", + "react-scripts": "^5.0.1", + "web-vitals": "^2.1.4" + }, + "scripts": {}, + "eslintConfig": { + "extends": [ + "react-app", + "react-app/jest" + ] + }, + "devDependencies": { + "typescript": "latest", + "react-refresh": "0.10.0" + } +} \ No newline at end of file diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..a11777c Binary files /dev/null and b/public/favicon.ico differ diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..e933c56 --- /dev/null +++ b/public/index.html @@ -0,0 +1,44 @@ + + + + + + + + + + + + + React App + + + +
+ + + + diff --git a/public/logo192.png b/public/logo192.png new file mode 100644 index 0000000..fc44b0a Binary files /dev/null and b/public/logo192.png differ diff --git a/public/logo512.png b/public/logo512.png new file mode 100644 index 0000000..a4e47a6 Binary files /dev/null and b/public/logo512.png differ diff --git a/public/manifest.json b/public/manifest.json new file mode 100644 index 0000000..080d6c7 --- /dev/null +++ b/public/manifest.json @@ -0,0 +1,25 @@ +{ + "short_name": "React App", + "name": "Create React App Sample", + "icons": [ + { + "src": "favicon.ico", + "sizes": "64x64 32x32 24x24 16x16", + "type": "image/x-icon" + }, + { + "src": "logo192.png", + "type": "image/png", + "sizes": "192x192" + }, + { + "src": "logo512.png", + "type": "image/png", + "sizes": "512x512" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..e9e57dc --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,3 @@ +# https://www.robotstxt.org/robotstxt.html +User-agent: * +Disallow: diff --git a/src/App.tsx b/src/App.tsx new file mode 100644 index 0000000..b888beb --- /dev/null +++ b/src/App.tsx @@ -0,0 +1,15 @@ +import React from 'react'; +import { BrowserRouter, Routes, Route } from 'react-router-dom'; +import Home from './pages/Home'; + +function App() { + return ( + + + }/> + + + ); +} + +export default App; diff --git a/src/assets/css/App.css b/src/assets/css/App.css new file mode 100644 index 0000000..74b5e05 --- /dev/null +++ b/src/assets/css/App.css @@ -0,0 +1,38 @@ +.App { + text-align: center; +} + +.App-logo { + height: 40vmin; + pointer-events: none; +} + +@media (prefers-reduced-motion: no-preference) { + .App-logo { + animation: App-logo-spin infinite 20s linear; + } +} + +.App-header { + background-color: #282c34; + min-height: 100vh; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + font-size: calc(10px + 2vmin); + color: white; +} + +.App-link { + color: #61dafb; +} + +@keyframes App-logo-spin { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} diff --git a/src/assets/css/index.css b/src/assets/css/index.css new file mode 100644 index 0000000..ec2585e --- /dev/null +++ b/src/assets/css/index.css @@ -0,0 +1,13 @@ +body { + margin: 0; + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', + 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', + sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +code { + font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', + monospace; +} diff --git a/src/assets/images/react-logo.png b/src/assets/images/react-logo.png new file mode 100644 index 0000000..a4e47a6 Binary files /dev/null and b/src/assets/images/react-logo.png differ diff --git a/src/components/Loader.tsx b/src/components/Loader.tsx new file mode 100644 index 0000000..dac0def --- /dev/null +++ b/src/components/Loader.tsx @@ -0,0 +1,7 @@ +import React from 'react' + +export default function Loader() { + return ( +
Loader
+ ) +} diff --git a/src/index.tsx b/src/index.tsx new file mode 100644 index 0000000..9110a72 --- /dev/null +++ b/src/index.tsx @@ -0,0 +1,11 @@ +import React from 'react'; +import ReactDOM from 'react-dom/client'; +import App from './App'; +import "assets/css/index.css" + +const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement); +root.render( + + + +); diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx new file mode 100644 index 0000000..55d8576 --- /dev/null +++ b/src/pages/Home.tsx @@ -0,0 +1,22 @@ +import React from 'react' +import "assets/css/App.css" +import logo from "./logo.svg" + +export default function Home() { + return ( +
+
+ logo +

Welcome to React!

+ + Learn React + +
+
+ ) +} diff --git a/src/pages/logo.svg b/src/pages/logo.svg new file mode 100644 index 0000000..9dfc1c0 --- /dev/null +++ b/src/pages/logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/react-app-env.d.ts b/src/react-app-env.d.ts new file mode 100644 index 0000000..6431bc5 --- /dev/null +++ b/src/react-app-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..8508bd1 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "baseUrl": "./src", + "suppressImplicitAnyIndexErrors": true, + "target": "es5", + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "noFallthroughCasesInSwitch": true, + "module": "esnext", + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx" + }, + "include": ["src"] + } + \ No newline at end of file