@teispace/next-maker 3.0.6 → 4.0.1
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 +18 -0
- package/README.md +21 -6
- package/dist/index.js +243 -239
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [4.0.1](https://github.com/teispace/npm-packages/compare/next-maker-v4.0.0...next-maker-v4.0.1) (2026-09-05)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **next-maker:** remove orphaned test files on init and pin the starter to v1.1.0 ([#155](https://github.com/teispace/npm-packages/issues/155)) ([fc07097](https://github.com/teispace/npm-packages/commit/fc07097244d534fd2040ac45cdf94369d5ac40b1))
|
|
9
|
+
|
|
10
|
+
## [4.0.0](https://github.com/teispace/npm-packages/compare/next-maker-v3.0.6...next-maker-v4.0.0) (2026-08-21)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### ⚠ BREAKING CHANGES
|
|
14
|
+
|
|
15
|
+
* **next-maker:** `doctor` now exits non-zero when drift survives a `--fix` run. Pipelines that relied on the previous always-green behaviour will correctly start failing when a project has real drift.
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **next-maker:** make doctor --fix actually repair drift and report truthfully ([58c95e8](https://github.com/teispace/npm-packages/commit/58c95e87e615a0b065955e737f119f8993db2935))
|
|
20
|
+
|
|
3
21
|
## [3.0.6](https://github.com/teispace/npm-packages/compare/next-maker-v3.0.5...next-maker-v3.0.6) (2026-06-28)
|
|
4
22
|
|
|
5
23
|
|
package/README.md
CHANGED
|
@@ -156,11 +156,11 @@ npx @teispace/next-maker doctor [options]
|
|
|
156
156
|
|
|
157
157
|
| Flag | Behaviour |
|
|
158
158
|
| --- | --- |
|
|
159
|
-
| `--fix` |
|
|
159
|
+
| `--fix` | Runs each drifted feature's **repair** path, then re-checks and reports FIXED / STILL DRIFTED / NO AUTOMATIC FIX AVAILABLE per feature |
|
|
160
160
|
| `--feature <id>` | Only check one manifest (e.g. `redux`, `security-headers`) |
|
|
161
161
|
| `--json` | Machine-readable output for CI |
|
|
162
162
|
|
|
163
|
-
Exit code is `0` on a clean report and `1` when drift is found — `next-maker doctor --json` makes a useful CI gate.
|
|
163
|
+
Exit code is `0` on a clean report and `1` when drift is found — `next-maker doctor --json` makes a useful CI gate. With `--fix`, the exit code reflects the state **after** the repair: `0` only when every feature re-checks clean, `1` when anything is still drifted.
|
|
164
164
|
|
|
165
165
|
```bash
|
|
166
166
|
# Human report
|
|
@@ -190,6 +190,20 @@ npx @teispace/next-maker doctor --json > health.json
|
|
|
190
190
|
Run with --fix to re-apply drifted features.
|
|
191
191
|
```
|
|
192
192
|
|
|
193
|
+
**Sample `--fix` output:**
|
|
194
|
+
|
|
195
|
+
```
|
|
196
|
+
🔧 Applying fixes...
|
|
197
|
+
|
|
198
|
+
✓ Validation Scripts FIXED
|
|
199
|
+
✗ Internationalization STILL DRIFTED
|
|
200
|
+
• missing file: src/app/[locale]
|
|
201
|
+
|
|
202
|
+
1 fixed, 1 still drifted
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
`--fix` never claims success it can't back up: every feature is re-checked after its repair runs, and only a clean re-check counts as FIXED.
|
|
206
|
+
|
|
193
207
|
Manifests live under `src/manifests/`; each one declares the files, packages, scripts, and code blocks the feature consists of. Adding a manifest for a new feature is a single file — `doctor` and `remove` automatically pick it up.
|
|
194
208
|
|
|
195
209
|
---
|
|
@@ -690,8 +704,8 @@ Each feature has a manifest in `src/manifests/<feature>.manifest.ts` describing:
|
|
|
690
704
|
- **files** — paths the feature owns (with `generated: true/false` to control deletion safety)
|
|
691
705
|
- **packages** — runtime/dev dependencies
|
|
692
706
|
- **scripts** — `package.json` script entries (with optional exact-value match)
|
|
693
|
-
- **injections** — code blocks in shared files (with `presence` and optional `
|
|
694
|
-
- **apply** —
|
|
707
|
+
- **injections** — code blocks in shared files (with `presence`, optional `removePattern`, and optional `alternativeFiles` when the block's home depends on the project shape — e.g. `[locale]/layout.tsx` *or* `src/app/layout.tsx`; the block only has to be in one of the candidates that exist)
|
|
708
|
+
- **apply** — `withRepair(setup<X>, repair<X>)`. Called with no drift it installs from scratch (`setup`); called with a drift array it takes the repair path (`doctor --fix`), fixing exactly the reported findings without consulting the installer's "already set up?" guard
|
|
695
709
|
- **remove** — optional custom remover (defaults to the generic reverser)
|
|
696
710
|
|
|
697
711
|
The manifest registry is consumed by:
|
|
@@ -826,14 +840,15 @@ Behaviour added in **v2.1.0** beyond the headline features. None of these change
|
|
|
826
840
|
- **`remove ws` strips cleanly without manual intervention.** The WS manifest's reducer-registration and bridge-mount injections now carry `removePattern` functions, so `next-maker remove ws` deletes the `wsReducer` import, the `ws: wsReducer` entry, the unwrapped-on-purpose JSDoc, and the `attachWsBridge` `useEffect` block — without any "manual cleanup" messages. The init-time `cleanupWs` and the `remove ws` flow share the same pure helpers, so the byte-level output is identical.
|
|
827
841
|
- **`useEffect` import auto-pruned.** When the WS bridge effect is stripped (init opt-out or `remove ws`), the `useEffect` import is dropped from `StoreProvider.tsx`'s React import line if no other `useEffect(` calls remain — avoiding the unused-import lint warning.
|
|
828
842
|
- **Wording-tolerant strip helpers.** The `stripBundleSentinel`, `stripBridgeMount`, and `stripWsReducerRegistration` helpers now anchor on stable code tokens (import paths, function names, the `ws` + `persistReducer` keywords inside JSDoc) rather than literal comment text. Upstream template comment rewording can't silently break cleanup.
|
|
829
|
-
- **`doctor` reports sentinel mount drift.** The HTTP manifest tracks the `<HttpClientBundleSentinel />` mount as a code injection
|
|
843
|
+
- **`doctor` reports sentinel mount drift — and only real drift.** The HTTP manifest tracks the `<HttpClientBundleSentinel />` mount as a single code injection with two possible homes (`alternativeFiles`): `[locale]/layout.tsx` when i18n is installed, `src/app/layout.tsx` otherwise. Only the layout that actually exists is checked, so a healthy project reports clean; if you delete the mount manually, `doctor` reports it, `doctor --fix` re-mounts it, and `remove http-client` strips it.
|
|
830
844
|
|
|
831
845
|
---
|
|
832
846
|
|
|
833
847
|
## Known issues
|
|
834
848
|
|
|
835
849
|
- **`setup --redux` post-init when `ws` was opted out.** The template's `StoreProvider.tsx` ships with the WS bridge mount inline. `next-maker setup --redux` copies the template's `StoreProvider.tsx` wholesale into the project — so running it on a project where `ws` is **not** wanted leaves `import { attachWsBridge, wsClient } from '@/lib/utils/ws'` in place, and `yarn build` fails because that module doesn't exist. Workaround until a fix lands: also run `next-maker setup --ws` to install the WS layer, then `next-maker remove ws` if you don't actually want it (clean removal handles both layers). Tracked separately; out of scope for v2.1.0.
|
|
836
|
-
- **`doctor --fix`
|
|
850
|
+
- **`doctor --fix` can't recreate `src/app/[locale]/`.** Producing that directory means running the i18n migration, which *moves* app-router pages. Doing that unattended to a project that has since lost the segment could relocate user code with no way back, so the i18n repair skips it and doctor reports it as STILL DRIFTED with guidance. Every other part of the i18n footprint is repaired.
|
|
851
|
+
- **Repairs that need starter assets need network.** `doctor --fix` re-copies deleted files (`src/i18n/`, `test/setup.ts`, `CustomThemeProvider.tsx`, …) from the starter repo via `degit`. Offline, those repairs fail and are reported as STILL DRIFTED rather than silently skipped. Package-only and code-block-only repairs work offline.
|
|
837
852
|
|
|
838
853
|
---
|
|
839
854
|
|