@teispace/next-maker 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +23 -7
  3. package/dist/index.js +342 -200
  4. package/dist/index.js.map +4 -4
  5. package/dist/src/commands/setup.d.ts.map +1 -1
  6. package/dist/src/config/paths.d.ts +10 -0
  7. package/dist/src/config/paths.d.ts.map +1 -1
  8. package/dist/src/detection/project.detector.d.ts +7 -0
  9. package/dist/src/detection/project.detector.d.ts.map +1 -1
  10. package/dist/src/manifests/http-client.manifest.d.ts.map +1 -1
  11. package/dist/src/manifests/index.d.ts +2 -1
  12. package/dist/src/manifests/index.d.ts.map +1 -1
  13. package/dist/src/manifests/ws.manifest.d.ts +3 -0
  14. package/dist/src/manifests/ws.manifest.d.ts.map +1 -0
  15. package/dist/src/prompts/create-app.prompt.d.ts +6 -0
  16. package/dist/src/prompts/create-app.prompt.d.ts.map +1 -1
  17. package/dist/src/services/init/cleanup/http.cleanup.d.ts.map +1 -1
  18. package/dist/src/services/init/cleanup/index.d.ts.map +1 -1
  19. package/dist/src/services/init/cleanup/seo.cleanup.d.ts +15 -0
  20. package/dist/src/services/init/cleanup/seo.cleanup.d.ts.map +1 -0
  21. package/dist/src/services/init/cleanup/ws.cleanup.d.ts +15 -0
  22. package/dist/src/services/init/cleanup/ws.cleanup.d.ts.map +1 -0
  23. package/dist/src/services/init/providers.service.d.ts.map +1 -1
  24. package/dist/src/services/setup/http-client/assets.d.ts.map +1 -1
  25. package/dist/src/services/setup/http-client/index.d.ts.map +1 -1
  26. package/dist/src/services/setup/http-client/injectors.d.ts +72 -0
  27. package/dist/src/services/setup/http-client/injectors.d.ts.map +1 -1
  28. package/dist/src/services/setup/ws/assets.d.ts +21 -0
  29. package/dist/src/services/setup/ws/assets.d.ts.map +1 -0
  30. package/dist/src/services/setup/ws/checks.d.ts +18 -0
  31. package/dist/src/services/setup/ws/checks.d.ts.map +1 -0
  32. package/dist/src/services/setup/ws/index.d.ts +21 -0
  33. package/dist/src/services/setup/ws/index.d.ts.map +1 -0
  34. package/dist/src/services/setup/ws/injectors.d.ts +57 -0
  35. package/dist/src/services/setup/ws/injectors.d.ts.map +1 -0
  36. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.1.0](https://github.com/teispace/npm-packages/compare/next-maker-v2.0.0...next-maker-v2.1.0) (2026-05-15)
4
+
5
+
6
+ ### Features
7
+
8
+ * **next-maker:** add WebSocket setup service + manifest ([#79](https://github.com/teispace/npm-packages/issues/79)) ([7e2dc3f](https://github.com/teispace/npm-packages/commit/7e2dc3f72616309da18b6d815a60a7e727d571f8))
9
+ * **next-maker:** add ws prompt + detection (data flow only) ([#78](https://github.com/teispace/npm-packages/issues/78)) ([f79c4d1](https://github.com/teispace/npm-packages/commit/f79c4d1002995ac0b3f55c1d1f4e96ee3788a6c2))
10
+ * **next-maker:** cleanup WebSocket layer when opted out at init ([#80](https://github.com/teispace/npm-packages/issues/80)) ([4d3d421](https://github.com/teispace/npm-packages/commit/4d3d421a5056097f7fdefa88f2340f3523faa850))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **next-maker:** strip intl from seo.ts and sitemap.ts when i18n is off ([#75](https://github.com/teispace/npm-packages/issues/75)) ([a99d566](https://github.com/teispace/npm-packages/commit/a99d566ee634f551679525fff129bf62fcf0f578))
16
+ * **next-maker:** sync http-client with universal/server entry split + bundle sentinel ([#77](https://github.com/teispace/npm-packages/issues/77)) ([cebc885](https://github.com/teispace/npm-packages/commit/cebc88569bbe3b65ccba9e40ea64fe8d262af908))
17
+
18
+
19
+ ### Documentation
20
+
21
+ * **next-maker:** document ws feature + http universal/server entry split ([#81](https://github.com/teispace/npm-packages/issues/81)) ([e804700](https://github.com/teispace/npm-packages/commit/e80470001ec8ca03df2182e306340de4de0d6fbd))
22
+
3
23
  ## [2.0.0](https://github.com/teispace/npm-packages/compare/next-maker-v1.20.1...next-maker-v2.0.0) (2026-05-15)
4
24
 
5
25
 
package/README.md CHANGED
@@ -76,7 +76,7 @@ npx @teispace/next-maker init my-app -y --package-manager pnpm
76
76
  | HTTP client | `fetch` |
77
77
  | dark mode, redux, i18n, tests, react-compiler | ✅ on |
78
78
  | pre-commit hooks, commitizen, copy `.env` | ✅ on |
79
- | docker, GitHub Actions, bundle-analyzer, community files (CODE_OF_CONDUCT etc.) | ⏭ off |
79
+ | WebSocket (requires Redux), docker, GitHub Actions, bundle-analyzer, community files (CODE_OF_CONDUCT etc.) | ⏭ off |
80
80
 
81
81
  Anything you don't want? `next-maker remove <feature>` after init.
82
82
 
@@ -87,7 +87,7 @@ The starter at [`teispace/nextjs-starter`](https://github.com/teispace/nextjs-st
87
87
  | Section | Prompts |
88
88
  | --- | --- |
89
89
  | Identity | project name, description, author, version, support email, package manager, GitHub repo / issues / homepage |
90
- | Architecture | HTTP client (axios / fetch / both / none), dark mode, Redux Toolkit, i18n, testing, React Compiler, Bundle Analyzer |
90
+ | Architecture | HTTP client (axios / fetch / both / none), dark mode, Redux Toolkit, WebSocket (requires Redux), i18n, testing, React Compiler, Bundle Analyzer |
91
91
  | Tooling | community files (CODE_OF_CONDUCT, CONTRIBUTING, SECURITY), README, Docker, CI/CD, pre-commit hooks (Husky/Commitlint/Lint-staged), Commitizen, copy `.env.example` → `.env` |
92
92
  | Templates | keep GitHub issue/PR templates? include `react-secure-storage`? |
93
93
 
@@ -100,7 +100,8 @@ The starter at [`teispace/nextjs-starter`](https://github.com/teispace/nextjs-st
100
100
  - Pino structured logger with redaction
101
101
  - Zod-validated env schema in `src/lib/env/`
102
102
  - Feature-based DDD architecture
103
- - Dual HTTP clients (`fetchClient` + `axiosClient`) on a shared foundation: runtime-aware cookie forwarding (browser jar in CSR, `next/headers` injection in RSC), automatic `X-Request-Id` correlation, single `parseApiError` pipeline, cookie-mode auth by default, typed query params via `{ params }`
103
+ - Dual HTTP clients (`fetchClient` + `axiosClient`) on a shared foundation: two entry points (`@/lib/utils/http` universal, `@/lib/utils/http/server` for Server Components), automatic `X-Request-Id` correlation, single `parseApiError` pipeline, cookie-mode auth by default, typed query params via `{ params }`. A build-time `__bundle-sentinel__` rejects future regressions of the universal/server split.
104
+ - WebSocket transport — **opt-in via the `ws` prompt** (requires Redux): typed `socket.io-client` wrapper, lazy singleton, `useWsEvent` / `useWsEmit` / `useWsStatus` hooks, Redux bridge into a dedicated (non-persisted) `wsReducer`. Cookie-mode auth by default; browser-only (SSR throws).
104
105
  - Hardened security headers in `next.config.ts`
105
106
  - `scripts/sync-env.ts` and `scripts/check-deprecated.ts` (used by the `validate` chain)
106
107
 
@@ -119,6 +120,7 @@ npx @teispace/next-maker setup [options]
119
120
  | `--http-client` | Adds the axios and/or fetch Result-based clients under `src/lib/utils/http/` |
120
121
  | `--dark-theme` | Installs `@teispace/next-themes` and adds `CustomThemeProvider` |
121
122
  | `--redux` | Redux Toolkit + `react-redux` + `redux-persist`, `StoreProvider`, `src/store` |
123
+ | `--ws` | WebSocket transport — `socket.io-client@^4.8.3`, `src/lib/utils/ws/` subtree, non-persisted `wsReducer`, `attachWsBridge` mount in `StoreProvider`. Requires `--redux` to be installed first. |
122
124
  | `--i18n` | `next-intl` + `[locale]` routing + `proxy.ts` + `RootProvider` wiring |
123
125
  | `--tests` | Vitest + React Testing Library + jsdom + `test/test-utils.tsx` |
124
126
  | `--react-compiler` | `reactCompiler: true` in `next.config.ts` + `babel-plugin-react-compiler` |
@@ -135,6 +137,7 @@ npx @teispace/next-maker setup
135
137
 
136
138
  # Specific feature
137
139
  npx @teispace/next-maker setup --redux
140
+ npx @teispace/next-maker setup --ws # adds WebSocket layer (run after --redux)
138
141
  npx @teispace/next-maker setup --security-headers
139
142
  npx @teispace/next-maker setup --validate-scripts
140
143
  ```
@@ -747,6 +750,7 @@ my-project/
747
750
  │ │ ├── CustomThemeProvider.tsx # (opt, dark-mode) @teispace/next-themes
748
751
  │ │ └── index.ts # Barrel — `next-maker provider <name>` keeps it sorted
749
752
  │ ├── store/ # (opt, redux) makeStore, rootReducer, typed hooks
753
+ │ │ └── slices/ws.slice.ts # (opt, ws) non-persisted connection state slice
750
754
  │ ├── services/
751
755
  │ │ ├── api/ # API service barrel
752
756
  │ │ └── storage/ # react-secure-storage wrapper
@@ -758,11 +762,22 @@ my-project/
758
762
  │ │ ├── enums/
759
763
  │ │ └── utils/
760
764
  │ │ ├── http/ # (opt, http-client)
761
- │ │ │ ├── shared/ # runtime detection, cookie injection, request-id, parseApiError, toSearchParams
765
+ │ │ │ ├── shared/ # runtime guards, request-id, parseApiError, toSearchParams
762
766
  │ │ │ ├── axios-client/ # interceptors, token refresh, Result-based
763
767
  │ │ │ ├── fetch-client/ # same Result pattern on native fetch, typed `params`
768
+ │ │ │ ├── __bundle-sentinel__/ # build-time regression gate ('use client' check)
764
769
  │ │ │ ├── client-utils.ts
765
- │ │ │ └── token-store.ts # inert in cookie-mode (the default)
770
+ │ │ │ ├── token-store.ts # inert in cookie-mode (the default)
771
+ │ │ │ ├── index.ts # universal entry — safe in client/server/edge
772
+ │ │ │ └── server.ts # server-only entry — forwards next/headers cookies
773
+ │ │ ├── ws/ # (opt, ws) socket.io-client wrapper, hooks, Redux bridge
774
+ │ │ │ ├── client/ # WsClient + lazy `wsClient` singleton (Proxy)
775
+ │ │ │ ├── hooks/ # useWsStatus, useWsEvent, useWsEmit
776
+ │ │ │ ├── redux/ # bridge (the only WS dispatcher) + selectors
777
+ │ │ │ ├── shared/ # SSR guard, auth carrier, URL composer
778
+ │ │ │ ├── types/ # ClientToServerEvents/ServerToClientEvents, payloads
779
+ │ │ │ ├── constants.ts # namespace, heartbeat, reconnection bounds
780
+ │ │ │ └── index.ts # public barrel
766
781
  │ │ └── validations/
767
782
  │ ├── i18n/ # (opt, i18n) routing, request, navigation, translations/
768
783
  │ ├── styles/globals.css # Tailwind v4 directives
@@ -791,7 +806,7 @@ my-project/
791
806
  └── package.json
792
807
  ```
793
808
 
794
- Features that have first-class opt-out prompts during `init`: `httpClient`, `darkMode`, `redux`, `i18n`, `tests`, `reactCompiler`, `bundleAnalyzer`, `docker`, `ci`, `preCommitHooks`, `commitizen`, `communityFiles`, `readme`, `copyEnv`. Each opt-out has a matching `setup --<feature>` to re-add later. `doctor` and `remove` cover the whole installed footprint via manifests.
809
+ Features that have first-class opt-in/opt-out prompts during `init`: `httpClient`, `darkMode`, `redux`, `ws` (opt-in, requires `redux`), `i18n`, `tests`, `reactCompiler`, `bundleAnalyzer`, `docker`, `ci`, `preCommitHooks`, `commitizen`, `communityFiles`, `readme`, `copyEnv`. Each opt-out has a matching `setup --<feature>` to re-add later. `doctor` and `remove` cover the whole installed footprint via manifests.
795
810
 
796
811
  ---
797
812
 
@@ -799,7 +814,7 @@ Features that have first-class opt-out prompts during `init`: `httpClient`, `dar
799
814
 
800
815
  **CLI:** TypeScript, esbuild, Commander.js, Enquirer, Vitest, degit.
801
816
 
802
- **Generated apps:** Next.js 16+, TypeScript, Tailwind CSS v4, Biome, Pino, Zod, Redux Toolkit, `@teispace/next-themes`, next-intl, Fetch / Axios HTTP clients (shared foundation), Vitest + RTL, React Compiler.
817
+ **Generated apps:** Next.js 16+, TypeScript, Tailwind CSS v4, Biome, Pino, Zod, Redux Toolkit, `@teispace/next-themes`, next-intl, Fetch / Axios HTTP clients (shared foundation), `socket.io-client` (opt-in via `ws` prompt), Vitest + RTL, React Compiler.
803
818
 
804
819
  ---
805
820
 
@@ -849,6 +864,7 @@ node ../dist/index.js test src/hooks/useDebounce.ts --force
849
864
 
850
865
  # Maintenance
851
866
  node ../dist/index.js doctor
867
+ node ../dist/index.js setup --ws # add WebSocket layer (project must already have --redux)
852
868
  node ../dist/index.js remove redux --dry-run
853
869
  ```
854
870