Skip to content

davidemaggi/davidemaggi.dev

Repository files navigation

React + TypeScript + Vite

Release automatica (semantic-release) + Docker su GHCR

Il progetto usa semantic-release nel workflow .github/workflows/docker-build-push.yml su push verso main/master (o workflow_dispatch). Non devi creare tag manuali: i tag Git vengono creati automaticamente nel formato vX.Y.Z.

Regole Conventional Commits usate per il version bump:

  • fix: -> patch
  • feat: -> minor
  • BREAKING CHANGE o ! -> major

Quando esce una nuova release:

  1. semantic-release calcola la nuova versione.
  2. Aggiorna CHANGELOG.md, package.json e package-lock.json (commit di release automatico).
  3. Crea release GitHub.
  4. Solo in questo caso builda e pubblica l'immagine Docker su GHCR.

Allineamento versione app/immagine:

  • il workflow valida che package.json.version sia uguale alla versione release;
  • i tag Docker pubblicati sono ${version}, v${version} e latest.

Registry immagine:

  • ghcr.io/<owner>/<repo> (sempre lowercase)
  • esempio: ghcr.io/davidemaggidev/davidemaggidev

Coerenza lockfile (npm)

Per evitare errori npm ci in GitHub Actions, il repository e' fissato a npm@10.9.4 (vedi package.json e workflow). Quando aggiorni dipendenze o lockfile, usa npm 10.9.4. Inoltre e' presente un check dedicato (.github/workflows/ci-lockfile.yml) che valida npm ci su ogni push e pull request.

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Debug da altro dispositivo (stessa rete)

  1. Avvia Vite in LAN:
npm run dev:lan
  1. Trova l'IP locale del tuo computer (es. 192.168.1.24).
  2. Dal telefono/tablet collegato alla stessa rete apri:
http://<IP_LOCALE>:5173

Note rapide:

  • PC e dispositivo devono essere sulla stessa rete Wi-Fi/LAN.
  • Se non si apre, controlla firewall/VPN o isolamento client del router.

Currently, two official plugins are available:

React Compiler

The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.

Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:

export default defineConfig([
  globalIgnores(['dist']),
  {
    files: ['**/*.{ts,tsx}'],
    extends: [
      // Other configs...

      // Remove tseslint.configs.recommended and replace with this
      tseslint.configs.recommendedTypeChecked,
      // Alternatively, use this for stricter rules
      tseslint.configs.strictTypeChecked,
      // Optionally, add this for stylistic rules
      tseslint.configs.stylisticTypeChecked,

      // Other configs...
    ],
    languageOptions: {
      parserOptions: {
        project: ['./tsconfig.node.json', './tsconfig.app.json'],
        tsconfigRootDir: import.meta.dirname,
      },
      // other options...
    },
  },
])

You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:

// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'

export default defineConfig([
  globalIgnores(['dist']),
  {
    files: ['**/*.{ts,tsx}'],
    extends: [
      // Other configs...
      // Enable lint rules for React
      reactX.configs['recommended-typescript'],
      // Enable lint rules for React DOM
      reactDom.configs.recommended,
    ],
    languageOptions: {
      parserOptions: {
        project: ['./tsconfig.node.json', './tsconfig.app.json'],
        tsconfigRootDir: import.meta.dirname,
      },
      // other options...
    },
  },
])

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages