From bfa3418ee547b38a972626255361f91cba64af6b Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Sat, 18 Feb 2023 20:30:39 -0800 Subject: [PATCH] Better dir structure --- .eslintrc.cjs | 2 +- index.html | 2 +- rsw.toml | 2 +- {@rsw => src-wasm}/hello/.gitignore | 0 {@rsw => src-wasm}/hello/Cargo.toml | 0 {@rsw => src-wasm}/hello/src/lib.rs | 0 {@rsw => src-wasm}/hello/src/utils.rs | 0 {src => src-web}/App.tsx | 0 {src => src-web}/components/Button.tsx | 0 {src => src-web}/components/Dropdown.tsx | 0 {src => src-web}/components/Editor/Editor.css | 0 {src => src-web}/components/Editor/Editor.tsx | 0 {src => src-web}/components/Grid.tsx | 0 {src => src-web}/components/HotKey.tsx | 0 {src => src-web}/components/Input.tsx | 0 {src => src-web}/components/Stacks.tsx | 0 {src => src-web}/hooks/useCodemirror.ts | 0 {src => src-web}/main.css | 0 {src => src-web}/main.tsx | 2 +- tailwind.config.cjs | 2 +- tsconfig.json | 4 +++- 21 files changed, 8 insertions(+), 6 deletions(-) rename {@rsw => src-wasm}/hello/.gitignore (100%) rename {@rsw => src-wasm}/hello/Cargo.toml (100%) rename {@rsw => src-wasm}/hello/src/lib.rs (100%) rename {@rsw => src-wasm}/hello/src/utils.rs (100%) rename {src => src-web}/App.tsx (100%) rename {src => src-web}/components/Button.tsx (100%) rename {src => src-web}/components/Dropdown.tsx (100%) rename {src => src-web}/components/Editor/Editor.css (100%) rename {src => src-web}/components/Editor/Editor.tsx (100%) rename {src => src-web}/components/Grid.tsx (100%) rename {src => src-web}/components/HotKey.tsx (100%) rename {src => src-web}/components/Input.tsx (100%) rename {src => src-web}/components/Stacks.tsx (100%) rename {src => src-web}/hooks/useCodemirror.ts (100%) rename {src => src-web}/main.css (100%) rename {src => src-web}/main.tsx (92%) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index d73a43a0..a878337b 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -14,7 +14,7 @@ module.exports = { }, 'import/resolver': { node: { - paths: ['src'], + paths: ['src-web'], extensions: ['.js', '.jsx', '.ts', '.tsx'], }, }, diff --git a/index.html b/index.html index a4b59983..f041da8c 100644 --- a/index.html +++ b/index.html @@ -10,6 +10,6 @@
- + diff --git a/rsw.toml b/rsw.toml index a27c0bb0..e6d5e046 100644 --- a/rsw.toml +++ b/rsw.toml @@ -34,6 +34,6 @@ dir = "my-template" #! 📦 -------- package: @rsw -------- [[crates]] #! npm package name (path: $ROOT/@rsw) - name = "@rsw/hello" + name = "src-wasm/hello" #! run `npm link`: `true` | `false`, default is `false` link = true diff --git a/@rsw/hello/.gitignore b/src-wasm/hello/.gitignore similarity index 100% rename from @rsw/hello/.gitignore rename to src-wasm/hello/.gitignore diff --git a/@rsw/hello/Cargo.toml b/src-wasm/hello/Cargo.toml similarity index 100% rename from @rsw/hello/Cargo.toml rename to src-wasm/hello/Cargo.toml diff --git a/@rsw/hello/src/lib.rs b/src-wasm/hello/src/lib.rs similarity index 100% rename from @rsw/hello/src/lib.rs rename to src-wasm/hello/src/lib.rs diff --git a/@rsw/hello/src/utils.rs b/src-wasm/hello/src/utils.rs similarity index 100% rename from @rsw/hello/src/utils.rs rename to src-wasm/hello/src/utils.rs diff --git a/src/App.tsx b/src-web/App.tsx similarity index 100% rename from src/App.tsx rename to src-web/App.tsx diff --git a/src/components/Button.tsx b/src-web/components/Button.tsx similarity index 100% rename from src/components/Button.tsx rename to src-web/components/Button.tsx diff --git a/src/components/Dropdown.tsx b/src-web/components/Dropdown.tsx similarity index 100% rename from src/components/Dropdown.tsx rename to src-web/components/Dropdown.tsx diff --git a/src/components/Editor/Editor.css b/src-web/components/Editor/Editor.css similarity index 100% rename from src/components/Editor/Editor.css rename to src-web/components/Editor/Editor.css diff --git a/src/components/Editor/Editor.tsx b/src-web/components/Editor/Editor.tsx similarity index 100% rename from src/components/Editor/Editor.tsx rename to src-web/components/Editor/Editor.tsx diff --git a/src/components/Grid.tsx b/src-web/components/Grid.tsx similarity index 100% rename from src/components/Grid.tsx rename to src-web/components/Grid.tsx diff --git a/src/components/HotKey.tsx b/src-web/components/HotKey.tsx similarity index 100% rename from src/components/HotKey.tsx rename to src-web/components/HotKey.tsx diff --git a/src/components/Input.tsx b/src-web/components/Input.tsx similarity index 100% rename from src/components/Input.tsx rename to src-web/components/Input.tsx diff --git a/src/components/Stacks.tsx b/src-web/components/Stacks.tsx similarity index 100% rename from src/components/Stacks.tsx rename to src-web/components/Stacks.tsx diff --git a/src/hooks/useCodemirror.ts b/src-web/hooks/useCodemirror.ts similarity index 100% rename from src/hooks/useCodemirror.ts rename to src-web/hooks/useCodemirror.ts diff --git a/src/main.css b/src-web/main.css similarity index 100% rename from src/main.css rename to src-web/main.css diff --git a/src/main.tsx b/src-web/main.tsx similarity index 92% rename from src/main.tsx rename to src-web/main.tsx index baac0246..b6d89744 100644 --- a/src/main.tsx +++ b/src-web/main.tsx @@ -3,7 +3,7 @@ import ReactDOM from 'react-dom/client'; import App from './App'; import { HelmetProvider } from 'react-helmet-async'; import { MotionConfig } from 'framer-motion'; -import init, { greet } from '@rsw/hello'; +import init, { greet } from 'hello'; import './main.css'; diff --git a/tailwind.config.cjs b/tailwind.config.cjs index 35cd8b4f..c506cf44 100644 --- a/tailwind.config.cjs +++ b/tailwind.config.cjs @@ -2,7 +2,7 @@ module.exports = { content: [ "./index.html", - "./src/**/*.{js,ts,jsx,tsx}", + "./src-web/**/*.{js,ts,jsx,tsx}", ], theme: { extend: {}, diff --git a/tsconfig.json b/tsconfig.json index 3d0a51a8..6162bcb4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,6 +16,8 @@ "noEmit": true, "jsx": "react-jsx" }, - "include": ["src"], + "include": [ + "src-web" + ], "references": [{ "path": "./tsconfig.node.json" }] }