Skip to content

Commit

Permalink
Attempt with shadcn and vite
Browse files Browse the repository at this point in the history
  • Loading branch information
bcopy committed Feb 9, 2024
1 parent 6836594 commit e9aa672
Show file tree
Hide file tree
Showing 24 changed files with 3,614 additions and 25 deletions.
37 changes: 18 additions & 19 deletions modules/client-mobile/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,23 @@
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm


# dotenv environment variables file
.env

# webpack generate output
node_modules
dist
bin/
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
18 changes: 18 additions & 0 deletions modules/client-mobile/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Vue 3 + TypeScript + Vite

This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.

## Recommended IDE Setup

- [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).

## Type Support For `.vue` Imports in TS

TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.

If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:

1. Disable the built-in TypeScript Extension
1. Run `Extensions: Show Built-in Extensions` from VSCode's command palette
2. Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
76 changes: 76 additions & 0 deletions modules/client-mobile/app/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
:root {
--background: 0 0% 100%;
--foreground: 20 14.3% 4.1%;

--card: 0 0% 100%;
--card-foreground: 20 14.3% 4.1%;

--popover: 0 0% 100%;
--popover-foreground: 20 14.3% 4.1%;

--primary: 24 9.8% 10%;
--primary-foreground: 60 9.1% 97.8%;

--secondary: 60 4.8% 95.9%;
--secondary-foreground: 24 9.8% 10%;

--muted: 60 4.8% 95.9%;
--muted-foreground: 25 5.3% 44.7%;

--accent: 60 4.8% 95.9%;
--accent-foreground: 24 9.8% 10%;

--destructive: 0 84.2% 60.2%;
--destructive-foreground: 60 9.1% 97.8%;

--border: 20 5.9% 90%;
--input: 20 5.9% 90%;
--ring: 20 14.3% 4.1%;

--radius: 0.5rem;
}

.dark {
--background: 20 14.3% 4.1%;
--foreground: 60 9.1% 97.8%;

--card: 20 14.3% 4.1%;
--card-foreground: 60 9.1% 97.8%;

--popover: 20 14.3% 4.1%;
--popover-foreground: 60 9.1% 97.8%;

--primary: 60 9.1% 97.8%;
--primary-foreground: 24 9.8% 10%;

--secondary: 12 6.5% 15.1%;
--secondary-foreground: 60 9.1% 97.8%;

--muted: 12 6.5% 15.1%;
--muted-foreground: 24 5.4% 63.9%;

--accent: 12 6.5% 15.1%;
--accent-foreground: 60 9.1% 97.8%;

--destructive: 0 62.8% 30.6%;
--destructive-foreground: 60 9.1% 97.8%;

--border: 12 6.5% 15.1%;
--input: 12 6.5% 15.1%;
--ring: 24 5.7% 82.9%;
}
}

@layer base {
* {
@apply border-border;
}
body {
@apply bg-background text-foreground;
}
}
17 changes: 17 additions & 0 deletions modules/client-mobile/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "tailwind.config.js",
"css": "app/globals.css",
"baseColor": "stone",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils"
}
}
13 changes: 13 additions & 0 deletions modules/client-mobile/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Vue + TS</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
Loading

0 comments on commit e9aa672

Please sign in to comment.