Skip to content

feat: @template/env + over-engineering cleanup + docs - #1

Merged
zschzen merged 4 commits into
mainfrom
feat/packages-env
Aug 24, 2026
Merged

feat: @template/env + over-engineering cleanup + docs#1
zschzen merged 4 commits into
mainfrom
feat/packages-env

Conversation

@zschzen

@zschzen zschzen commented Aug 11, 2026

Copy link
Copy Markdown
Owner

What

  • packages/env: Zod-validated env at startup — fail fast, typed, no process.env scattered across config
  • Replace process.env with validated env in nuxt.config.ts
  • Shared subscriptions Map for push endpoints (was 3 separate Maps talking to different instances)

Over-engineering cleanup

Deleted Why
usePwaStore Reimplements VueUse's useOnline, useMediaQuery, Notification.permission
usePwa composable Wraps the store + VueUse — two layers doing the same thing
useLayout Reimplements useMediaQuery from VueUse (unused)
01-pwa.client.ts plugin Redundant with @vite-pwa/nuxt auto-registration
uno.config.ts Empty config existing only for ESLint plugin

Catalog audit (antfu pattern)

Categorization over version-only management. Each catalog name communicates purpose:

Change Before After
typescript catalog:core catalog:types (it's a dev tool)
@types/web-push default catalog: catalog:types

Docs

  • Root README: architecture, catalog rationale, getting started
  • packages/env: schema, usage, graceful fallback
  • packages/eslint-config: rules, customization
  • packages/ui: layer usage, UnoCSS presets, components
  • apps/web: PWA flow, push API, composables, env setup

Also

  • Add @types/web-push for proper type declarations
  • Add zod to pnpm catalogs

- Add packages/env with Zod env validation (fail-fast typed config)
- Replace process.env with validated env in nuxt.config.ts
- Shared subscriptions Map for push endpoints (was 3 separate Maps)
- Delete usePwaStore/usePwa (reimplements VueUse + @vite-pwa/nuxt)
- Delete useLayout (reimplements useMediaQuery from VueUse)
- Delete 01-pwa.client.ts plugin (redundant with @vite-pwa/nuxt)
- Delete empty uno.config.ts (was only for ESLint plugin)
- Add @types/web-push for proper type declarations
- Root README: add env package, validation catalog, catalog rationale
- packages/env/README: schema, usage, graceful fallback
- packages/eslint-config/README: rules, customization
- packages/ui/README: layer usage, UnoCSS presets, components
- apps/web/README: PWA flow, push API, composables, env setup

Catalog fixes:
- Move typescript from core → types (it's a dev tool)
- Move @types/web-push from default catalog → types
- pnpm-workspace.yaml: remove stale default catalog entry
@zschzen zschzen changed the title feat: add @template/env + over-engineering cleanup feat: @template/env + over-engineering cleanup + docs Aug 11, 2026
Nitro auto-imports server/utils/* — explicit imports unnecessary.
Top-level await rejected by es2019 target.
@zschzen
zschzen merged commit 64bcd50 into main Aug 24, 2026
@zschzen
zschzen deleted the feat/packages-env branch August 24, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant