diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 0000000..4020bcb --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,14 @@ +module.exports = { + env: { browser: true, es2020: true }, + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:react-hooks/recommended', + ], + parser: '@typescript-eslint/parser', + parserOptions: { ecmaVersion: 'latest', sourceType: 'module' }, + plugins: ['react-refresh'], + rules: { + 'react-refresh/only-export-components': 'warn', + }, +} diff --git a/.gitignore b/.gitignore index 5e802e2..a547bf3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,24 +1,24 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/packages/*/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# production -/build - -# misc -.DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local - +# Logs +logs +*.log npm-debug.log* yarn-debug.log* yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..52e118f --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +nodejs lts diff --git a/index.html b/index.html new file mode 100644 index 0000000..489d059 --- /dev/null +++ b/index.html @@ -0,0 +1,13 @@ + + + + + + + Bipi! + + +
+ + + diff --git a/package.json b/package.json index 16ee0e8..fd5bcce 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,42 @@ { "name": "bipi", "private": true, - "workspaces": [ - "packages/*" - ], + "version": "0.0.0", + "type": "module", "scripts": { - "@rnw": "yarn workspace @bipi/react-native-web" + "dev": "vite", + "build": "tsc && vite build", + "lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0", + "preview": "vite preview" + }, + "dependencies": { + "@radix-ui/react-label": "^2.0.1", + "@radix-ui/react-popover": "^1.0.5", + "@radix-ui/react-slot": "^1.0.1", + "@radix-ui/react-switch": "^1.0.2", + "class-variance-authority": "^0.6.0", + "clsx": "^1.2.1", + "jotai": "^2.0.4", + "lucide-react": "^0.190.0", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "tailwind-merge": "^1.12.0", + "tailwindcss-animate": "^1.0.5" + }, + "devDependencies": { + "@types/react": "^18.0.28", + "@types/react-dom": "^18.0.11", + "@typescript-eslint/eslint-plugin": "^5.57.1", + "@typescript-eslint/parser": "^5.57.1", + "@vitejs/plugin-react": "^4.0.0", + "autoprefixer": "^10.4.14", + "eslint": "^8.38.0", + "eslint-plugin-react-hooks": "^4.6.0", + "eslint-plugin-react-refresh": "^0.3.4", + "postcss": "^8.4.23", + "tailwindcss": "^3.3.2", + "typescript": "^5.0.2", + "vite": "^4.3.2", + "vite-plugin-pwa": "^0.14.7" } } diff --git a/packages/react-native-web/.eslintrc.js b/packages/react-native-web/.eslintrc.js deleted file mode 100644 index 3144b06..0000000 --- a/packages/react-native-web/.eslintrc.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = { - parser: "@typescript-eslint/parser", - extends: [ - "plugin:@typescript-eslint/recommended", - "plugin:react/recommended", - ], - parserOptions: { - ecmaVersion: 2020, - sourceType: "module", - ecmaFeatures: { jsx: true }, - }, - plugins: ["react", "react-hooks"], - rules: { - "react-hooks/rules-of-hooks": "error", - "react-hooks/exhaustive-deps": "warn", - }, -}; diff --git a/packages/react-native-web/LICENSE b/packages/react-native-web/LICENSE deleted file mode 100644 index 9b08146..0000000 --- a/packages/react-native-web/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2019 Sehyun Chung - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/packages/react-native-web/README.md b/packages/react-native-web/README.md deleted file mode 100644 index 0f1ee86..0000000 --- a/packages/react-native-web/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# ๐ŸฅBipi! - -A Simple BPM Tapper PWA diff --git a/packages/react-native-web/craco.config.js b/packages/react-native-web/craco.config.js deleted file mode 100644 index ef720b7..0000000 --- a/packages/react-native-web/craco.config.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - babel: { - presets: ["@babel/preset-env", "@babel/preset-react"], - plugins: ["@babel/plugin-proposal-class-properties"], - }, -}; diff --git a/packages/react-native-web/package.json b/packages/react-native-web/package.json deleted file mode 100644 index 468d50d..0000000 --- a/packages/react-native-web/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "@bipi/react-native-web", - "version": "0.1.0", - "private": true, - "dependencies": { - "@babel/plugin-proposal-class-properties": "^7.12.13", - "@craco/craco": "^6.1.1", - "@types/jest": "26.0.20", - "@types/node": "14.14.27", - "@types/react": "^17.0.2", - "@types/react-dom": "17.0.1", - "@types/react-native": "^0.63.48", - "jotai": "^0.14.0", - "react": "^17.0.1", - "react-device-detect": "^1.11.14", - "react-dom": "^17.0.1", - "react-native-swipe-gestures": "^1.0.5", - "react-native-web": "^0.15.0", - "react-scripts": "4.0.2", - "react-spring": "^9.0.0-rc.3", - "scheduler": "^0.20.1", - "typescript": "4.1.5" - }, - "scripts": { - "start": "craco start", - "build": "craco build", - "test": "craco test", - "eject": "react-scripts eject" - }, - "eslintConfig": { - "extends": "react-app" - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - }, - "devDependencies": { - "@babel/preset-react": "^7.12.13", - "@typescript-eslint/eslint-plugin": "^4.15.0", - "@typescript-eslint/parser": "^4.15.0", - "babel-plugin-react-native-web": "^0.15.0", - "eslint": "^7.20.0", - "eslint-plugin-react": "^7.22.0", - "eslint-plugin-react-hooks": "^4.2.0" - } -} diff --git a/packages/react-native-web/public/favicon-16x16.png b/packages/react-native-web/public/favicon-16x16.png deleted file mode 100644 index 4df556c..0000000 Binary files a/packages/react-native-web/public/favicon-16x16.png and /dev/null differ diff --git a/packages/react-native-web/public/favicon-32x32.png b/packages/react-native-web/public/favicon-32x32.png deleted file mode 100644 index df40125..0000000 Binary files a/packages/react-native-web/public/favicon-32x32.png and /dev/null differ diff --git a/packages/react-native-web/public/favicon.ico b/packages/react-native-web/public/favicon.ico deleted file mode 100644 index 490a546..0000000 Binary files a/packages/react-native-web/public/favicon.ico and /dev/null differ diff --git a/packages/react-native-web/public/icon.svg b/packages/react-native-web/public/icon.svg deleted file mode 100644 index 759c041..0000000 --- a/packages/react-native-web/public/icon.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/packages/react-native-web/public/index.html b/packages/react-native-web/public/index.html deleted file mode 100644 index 6416544..0000000 --- a/packages/react-native-web/public/index.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - Bipi! - - - - -
- - - diff --git a/packages/react-native-web/public/logo192.png b/packages/react-native-web/public/logo192.png deleted file mode 100644 index 70f5eb3..0000000 Binary files a/packages/react-native-web/public/logo192.png and /dev/null differ diff --git a/packages/react-native-web/public/logo512.png b/packages/react-native-web/public/logo512.png deleted file mode 100644 index 49c6286..0000000 Binary files a/packages/react-native-web/public/logo512.png and /dev/null differ diff --git a/packages/react-native-web/public/manifest.json b/packages/react-native-web/public/manifest.json deleted file mode 100644 index c5756e0..0000000 --- a/packages/react-native-web/public/manifest.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "short_name": "Bipi!", - "name": "Bipi! - A Bpm Tapper PWA", - "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": "hsl(0, 0%, 64%)", - "background_color": "hsl(0, 0%, 64%)", - "orientation": "landscape" -} \ No newline at end of file diff --git a/packages/react-native-web/public/robots.txt b/packages/react-native-web/public/robots.txt deleted file mode 100644 index 01b0f9a..0000000 --- a/packages/react-native-web/public/robots.txt +++ /dev/null @@ -1,2 +0,0 @@ -# https://www.robotstxt.org/robotstxt.html -User-agent: * diff --git a/packages/react-native-web/src/App.test.tsx b/packages/react-native-web/src/App.test.tsx deleted file mode 100644 index 4bf1935..0000000 --- a/packages/react-native-web/src/App.test.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react' -import ReactDOM from 'react-dom' -import App from './App' - -it('renders without crashing', () => { - const div = document.createElement('div') - ReactDOM.render(, div) - ReactDOM.unmountComponentAtNode(div) -}) diff --git a/packages/react-native-web/src/App.tsx b/packages/react-native-web/src/App.tsx deleted file mode 100644 index 68e5af9..0000000 --- a/packages/react-native-web/src/App.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import React, { useEffect, useLayoutEffect } from "react"; -import { View, StyleSheet, Dimensions, ScaledSize } from "react-native"; -import { Provider, useAtom } from "jotai"; - -import Header from "./components/Header"; -import Bpm from "./components/Bpm"; -import Footer from "./components/Footer"; - -import { BACKGROUND_COLOR, dimensionsAtom } from "./internal"; - -function Bipi() { - const [dimensions, setDimensions] = useAtom(dimensionsAtom); - - const appStyle = StyleSheet.create({ - app: { - position: "absolute", - height: dimensions.height, - backgroundColor: BACKGROUND_COLOR, - }, - }); - - useLayoutEffect(() => { - const { width, height } = Dimensions.get("window"); - setDimensions(() => ({ width, height })); - - const listener = ({ window }: { window: ScaledSize }) => { - setDimensions(() => ({ height: window.height, width: window.width })); - }; - Dimensions.addEventListener("change", listener); - - return () => { - Dimensions.removeEventListener("change", listener); - }; - }, []); - - return ( - -
- -