Modelo de projeto·Pro
Vite + React + TypeScript
Um rastreador de hábitos em React e TypeScript, feito com Vite 8: grade semanal, sequências, um hook próprio e um teste. Precisa do ambiente Linux com Node.js; o primeiro npm install baixa cerca de 25 pacotes (uns 80 MB).
Para instalar, você precisa do PocketCode Pro.
Se o PocketCode estiver instalado no seu Android, isto abre a página no app.
Prévia
Arquivos
README.md
index.html
package-lock.json
package.json
public/favicon.svg
src/App.tsx
src/index.css
src/main.tsx
src/useLocalStorage.ts
src/week.ts
test/week.test.ts
tsconfig.json
vite.config.tsREADME.md
# Habit tracker: Vite + React + TypeScript A small React app in TypeScript, built with Vite: a weekly grid of habits you tick off day by day, with a streak counter. Habits are saved in the browser (localStorage). It shows the usual pieces of a React project: components, state, a custom hook, typed data and a test. ## Run it in PocketCode You need the app's Linux environment with Node.js 20.19 or newer (the Developer pack in Terminal › Linux includes Node.js and npm). 1. Open the terminal in this project's folder (Open Terminal Here, in the editor menu). 2. Install the dependencies. The first time downloads about 25 packages (around 80 MB on disk) and needs internet: ```sh npm install ``` 3. Start the development server: ```sh npm run dev ``` 4. Open http://localhost:5173 in the DevBrowser (or in the phone's browser). Saving a file updates the page. Stop the server with Ctrl+C in the terminal. ## Other commands | Command | What it does | |---|---| | `npm run build` | Type-checks with `tsc` and writes the production build to `dist/` | | `npm run preview` | Serves `dist/` on http://localhost:4173 | | `npm run typecheck` | Only the type check | | `npm test` | Tests for `src/week.ts` with Node's test runner (Node 22.18 or newer) | ## Where things are | Path | What it does | |---|---| | `index.html` | The page Vite serves; it loads `src/main.tsx` | | `src/App.tsx` | The app: form, weekly grid, streaks |Esta prévia está encurtada. O conteúdo completo vem com a instalação.
Mudanças na 1.0.0
Primeira versão.