@teispace/next-maker 1.20.0 → 2.0.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.0.0](https://github.com/teispace/npm-packages/compare/next-maker-v1.20.1...next-maker-v2.0.0) (2026-05-15)
4
+
5
+
6
+ ### ⚠ BREAKING CHANGES
7
+
8
+ * **next-maker:** apps generated before this release are missing shared/ and api-url.ts. Run `next-maker doctor --fix` or `next-maker setup http-client` to restore them.
9
+ * **next-maker:** services generated by `next-maker service <name>` or `next-maker service <name> --crud` now emit bare-path endpoints. Any hand-rolled endpoints in app-apis.ts that still use \`\${API_PREFIX}\` will double-prefix once the rest of the template (getApiBaseUrl) lands — strip the interpolation when migrating.
10
+ * **next-maker:** apps generated before this release are missing shared/ and api-url.ts. Run `next-maker doctor --fix` or `next-maker setup http-client` to restore them.
11
+
12
+ ### Features
13
+
14
+ * **next-maker:** emit bare-path endpoints in generated AppApis entries ([#71](https://github.com/teispace/npm-packages/issues/71)) ([0d836b3](https://github.com/teispace/npm-packages/commit/0d836b3dab9dd84dae3b04f74c4671b59e28b75b))
15
+ * **next-maker:** sync http-client setup with shared/ + api-url layout ([#70](https://github.com/teispace/npm-packages/issues/70)) ([3df79a4](https://github.com/teispace/npm-packages/commit/3df79a4c6de1698f1488311ab22f7fd80b662cdc))
16
+
17
+
18
+ ### Documentation
19
+
20
+ * **next-maker:** sync README with shared/ + api-url layout ([#72](https://github.com/teispace/npm-packages/issues/72)) ([3d64863](https://github.com/teispace/npm-packages/commit/3d648636ce1b88fa88c6f0788eb6538ea717b154))
21
+
22
+
23
+ ### Tests
24
+
25
+ * **next-maker:** cover copyHttpClientFiles and crudApiConfigTemplate ([#73](https://github.com/teispace/npm-packages/issues/73)) ([10597cf](https://github.com/teispace/npm-packages/commit/10597cfee2ec70000d79419a7f25669351caffcc))
26
+
27
+ ## [1.20.1](https://github.com/teispace/npm-packages/compare/next-maker-v1.20.0...next-maker-v1.20.1) (2026-05-06)
28
+
29
+
30
+ ### Bug Fixes
31
+
32
+ * **next-themes:** sync runtime props, validate cookies, harden hooks ([#68](https://github.com/teispace/npm-packages/issues/68)) ([05dc87c](https://github.com/teispace/npm-packages/commit/05dc87c5155d0919a1b179b8e7b842beebe65596))
33
+
3
34
  ## [1.20.0](https://github.com/teispace/npm-packages/compare/next-maker-v1.19.2...next-maker-v1.20.0) (2026-05-06)
4
35
 
5
36
 
package/README.md CHANGED
@@ -38,6 +38,7 @@ next-maker <command> [args] [options]
38
38
  | Config | `locale [code]` | Add a new language/locale |
39
39
  | Code | `hook <name>` | Custom React hook |
40
40
  | Code | `test <file>` | Sibling test stub for a component/hook/slice |
41
+ | Assets | `favicon` | Generate `favicon.ico` (and optionally PWA / OG / Apple icons) from a source image |
41
42
 
42
43
  Run `npx @teispace/next-maker <command> --help` for the full option list of any command.
43
44
 
@@ -99,7 +100,7 @@ The starter at [`teispace/nextjs-starter`](https://github.com/teispace/nextjs-st
99
100
  - Pino structured logger with redaction
100
101
  - Zod-validated env schema in `src/lib/env/`
101
102
  - Feature-based DDD architecture
102
- - Result-based HTTP clients (when enabled)
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
104
  - Hardened security headers in `next.config.ts`
104
105
  - `scripts/sync-env.ts` and `scripts/check-deprecated.ts` (used by the `validate` chain)
105
106
 
@@ -392,6 +393,8 @@ npx @teispace/next-maker service <name> [options]
392
393
 
393
394
  CRUD mode also generates `<Name>Summary` (list view) and `<Name>Detail` (detail view) types, `Create<Name>Dto`, `Update<Name>Dto`, and registers the endpoints in `app-apis.ts`.
394
395
 
396
+ Endpoints are emitted as **bare paths** (e.g. `'/users'`, `` `/users/${id}` ``) — the `/api/v{n}` prefix is owned by `getApiBaseUrl()` in `src/lib/config/api-url.ts` and applied at request time. Don't add `${API_PREFIX}` interpolation in `app-apis.ts`; the base URL composer handles it.
397
+
395
398
  ```bash
396
399
  npx @teispace/next-maker service payment --axios
397
400
  npx @teispace/next-maker service users --fetch --crud
@@ -540,6 +543,64 @@ Requires `setup --tests` first.
540
543
 
541
544
  ---
542
545
 
546
+ ### `favicon` — Generate icons from a source image
547
+
548
+ Generates `favicon.ico` (multi-size) into the App Router root, with optional `icon.png`, `apple-icon.png`, `opengraph-image.png`, `twitter-image.png`, and PWA manifest icons. Source can be PNG, JPG, JPEG, WebP, SVG, or AVIF.
549
+
550
+ ```bash
551
+ npx @teispace/next-maker favicon [options]
552
+ ```
553
+
554
+ | Flag | Effect |
555
+ | --- | --- |
556
+ | `--path <file>` | Source image. If omitted, you'll be prompted. |
557
+ | `--out <dir>` | Output directory (default: auto-detected `src/app` or `app`) |
558
+ | `--icon` | Also emit `icon.png` (512×512) |
559
+ | `--apple` | Also emit `apple-icon.png` (180×180) |
560
+ | `--og` | Also emit `opengraph-image.png` (1200×630) |
561
+ | `--og-source <file>` | Use a separate image for the OG/Twitter card |
562
+ | `--twitter` | Also emit `twitter-image.png` (1200×600) |
563
+ | `--all` | Shorthand for `--icon --apple --og` |
564
+ | `--pwa` | Detect PWA setup and emit manifest icons (192/512); errors if not detected |
565
+ | `--pwa-init` | Bootstrap `public/manifest.webmanifest` with icons |
566
+ | `--shape <shape>` | `square` \| `rounded` \| `circle` \| `squircle` (default: `square`) |
567
+ | `--radius <percent>` | Corner radius % when `--shape=rounded` (0–50, default: 20) |
568
+ | `--bg <color>` | Background: `transparent`, hex (`#0f172a`), CSS name, or `rgb()`/`rgba()`/`hsl()`/`hsla()` (default: `transparent`) |
569
+ | `--padding <percent>` | Padding around source content (0–30, default: 0) |
570
+ | `--fit <fit>` | `contain` \| `cover` \| `clip` (default: `contain`) |
571
+ | `--sizes <list>` | Comma-separated ICO sizes (default: `16,32,48`) |
572
+ | `--quality <n>` | PNG compression 1–100 (higher = smaller; PNG is lossless, default: 90) |
573
+ | `--force` | Overwrite existing files without prompt |
574
+ | `--dry-run` | Show what would be written without writing |
575
+
576
+ ```bash
577
+ # Minimal: just favicon.ico from a source PNG
578
+ npx @teispace/next-maker favicon --path ./brand/logo.png
579
+
580
+ # Full set: favicon + icon + apple-icon + OG image, rounded with brand background
581
+ npx @teispace/next-maker favicon \
582
+ --path ./brand/logo.svg \
583
+ --all \
584
+ --shape rounded --radius 24 \
585
+ --bg "#0f172a" \
586
+ --padding 8
587
+
588
+ # PWA: emit manifest icons and bootstrap public/manifest.webmanifest
589
+ npx @teispace/next-maker favicon --path ./brand/logo.png --pwa-init
590
+
591
+ # Separate OG art
592
+ npx @teispace/next-maker favicon \
593
+ --path ./brand/logo.png \
594
+ --og --og-source ./brand/social-card.png
595
+
596
+ # Preview without writing
597
+ npx @teispace/next-maker favicon --path ./brand/logo.png --all --dry-run
598
+ ```
599
+
600
+ Outputs land in your App Router root (`src/app/` or `app/`) so Next.js auto-resolves them via the file conventions for [`favicon.ico`](https://nextjs.org/docs/app/api-reference/file-conventions/metadata/app-icons), [`opengraph-image`](https://nextjs.org/docs/app/api-reference/file-conventions/metadata/opengraph-image), and [`apple-icon`](https://nextjs.org/docs/app/api-reference/file-conventions/metadata/app-icons) — no `<head>` wiring required.
601
+
602
+ ---
603
+
543
604
  ## End-to-end examples
544
605
 
545
606
  ### Quick start
@@ -663,7 +724,11 @@ my-project/
663
724
  │ │ ├── not-found.tsx
664
725
  │ │ ├── robots.ts
665
726
  │ │ ├── sitemap.ts
666
- │ │ └── favicon.ico
727
+ │ │ ├── favicon.ico # `favicon` command
728
+ │ │ ├── icon.png # (opt, `favicon --icon`/`--all`) 512×512
729
+ │ │ ├── apple-icon.png # (opt, `favicon --apple`/`--all`) 180×180
730
+ │ │ ├── opengraph-image.png # (opt, `favicon --og`/`--all`) 1200×630
731
+ │ │ └── twitter-image.png # (opt, `favicon --twitter`) 1200×600
667
732
  │ ├── proxy.ts # (opt, i18n) Next 16 middleware replacement
668
733
  │ ├── features/ # Feature modules (feature-first DDD)
669
734
  │ │ └── counter/ # (opt, redux) example feature
@@ -686,17 +751,18 @@ my-project/
686
751
  │ │ ├── api/ # API service barrel
687
752
  │ │ └── storage/ # react-secure-storage wrapper
688
753
  │ ├── lib/
689
- │ │ ├── config/ # seo, app-apis, app-paths, app-locales, constants
754
+ │ │ ├── config/ # seo, app-apis, app-paths, app-locales, constants, api-url (getApiBaseUrl)
690
755
  │ │ ├── env/ # Zod-validated env schema (schema.ts, validate.ts)
691
756
  │ │ ├── logger/ # Pino logger with auto-redaction
692
- │ │ ├── errors/ # ApiException, catchError
757
+ │ │ ├── errors/ # ApiException (carries requestId), catchError
693
758
  │ │ ├── enums/
694
759
  │ │ └── utils/
695
760
  │ │ ├── http/ # (opt, http-client)
761
+ │ │ │ ├── shared/ # runtime detection, cookie injection, request-id, parseApiError, toSearchParams
696
762
  │ │ │ ├── axios-client/ # interceptors, token refresh, Result-based
697
- │ │ │ ├── fetch-client/ # same Result pattern on native fetch
763
+ │ │ │ ├── fetch-client/ # same Result pattern on native fetch, typed `params`
698
764
  │ │ │ ├── client-utils.ts
699
- │ │ │ └── token-store.ts
765
+ │ │ │ └── token-store.ts # inert in cookie-mode (the default)
700
766
  │ │ └── validations/
701
767
  │ ├── i18n/ # (opt, i18n) routing, request, navigation, translations/
702
768
  │ ├── styles/globals.css # Tailwind v4 directives
@@ -733,7 +799,7 @@ Features that have first-class opt-out prompts during `init`: `httpClient`, `dar
733
799
 
734
800
  **CLI:** TypeScript, esbuild, Commander.js, Enquirer, Vitest, degit.
735
801
 
736
- **Generated apps:** Next.js 16+, TypeScript, Tailwind CSS v4, Biome, Pino, Zod, Redux Toolkit, `@teispace/next-themes`, next-intl, Axios, Vitest + RTL, React Compiler.
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.
737
803
 
738
804
  ---
739
805