@teispace/next-maker 3.0.3 → 3.0.5

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 (162) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/index.js +150 -150
  3. package/package.json +12 -10
  4. package/dist/build.d.ts +0 -1
  5. package/dist/src/commands/app.d.ts +0 -2
  6. package/dist/src/commands/component.d.ts +0 -2
  7. package/dist/src/commands/doctor.d.ts +0 -2
  8. package/dist/src/commands/env.d.ts +0 -2
  9. package/dist/src/commands/favicon.d.ts +0 -2
  10. package/dist/src/commands/feature.d.ts +0 -2
  11. package/dist/src/commands/hook.d.ts +0 -2
  12. package/dist/src/commands/index.d.ts +0 -2
  13. package/dist/src/commands/layout.d.ts +0 -2
  14. package/dist/src/commands/locale.d.ts +0 -2
  15. package/dist/src/commands/page.d.ts +0 -2
  16. package/dist/src/commands/provider.d.ts +0 -2
  17. package/dist/src/commands/remove.d.ts +0 -2
  18. package/dist/src/commands/service.d.ts +0 -2
  19. package/dist/src/commands/setup.d.ts +0 -2
  20. package/dist/src/commands/slice.d.ts +0 -2
  21. package/dist/src/commands/test.d.ts +0 -2
  22. package/dist/src/config/constants.d.ts +0 -0
  23. package/dist/src/config/errorHandlers.d.ts +0 -6
  24. package/dist/src/config/index.d.ts +0 -5
  25. package/dist/src/config/output.d.ts +0 -10
  26. package/dist/src/config/packages.d.ts +0 -25
  27. package/dist/src/config/path-safety.d.ts +0 -28
  28. package/dist/src/config/paths.d.ts +0 -93
  29. package/dist/src/config/spinner.d.ts +0 -11
  30. package/dist/src/config/utils.d.ts +0 -4
  31. package/dist/src/core/files.d.ts +0 -7
  32. package/dist/src/core/git.d.ts +0 -9
  33. package/dist/src/core/package-manager.d.ts +0 -11
  34. package/dist/src/detection/existence.checker.d.ts +0 -8
  35. package/dist/src/detection/index.d.ts +0 -3
  36. package/dist/src/detection/project.detector.d.ts +0 -14
  37. package/dist/src/generators/component.generator.d.ts +0 -8
  38. package/dist/src/generators/crud-service.generator.d.ts +0 -5
  39. package/dist/src/generators/feature.generator.d.ts +0 -6
  40. package/dist/src/generators/hook.generator.d.ts +0 -7
  41. package/dist/src/generators/index.d.ts +0 -19
  42. package/dist/src/generators/layout.generator.d.ts +0 -21
  43. package/dist/src/generators/locale.generator.d.ts +0 -9
  44. package/dist/src/generators/page.generator.d.ts +0 -9
  45. package/dist/src/generators/provider.generator.d.ts +0 -13
  46. package/dist/src/generators/service.generator.d.ts +0 -5
  47. package/dist/src/generators/slice.generator.d.ts +0 -10
  48. package/dist/src/generators/templates/barrel.template.d.ts +0 -11
  49. package/dist/src/generators/templates/component.template.d.ts +0 -4
  50. package/dist/src/generators/templates/crud-service.template.d.ts +0 -9
  51. package/dist/src/generators/templates/custom-hook.template.d.ts +0 -4
  52. package/dist/src/generators/templates/hook.template.d.ts +0 -8
  53. package/dist/src/generators/templates/layout.template.d.ts +0 -12
  54. package/dist/src/generators/templates/page.template.d.ts +0 -17
  55. package/dist/src/generators/templates/persist.template.d.ts +0 -5
  56. package/dist/src/generators/templates/provider.template.d.ts +0 -11
  57. package/dist/src/generators/templates/selectors.template.d.ts +0 -5
  58. package/dist/src/generators/templates/service.template.d.ts +0 -4
  59. package/dist/src/generators/templates/shared-component.template.d.ts +0 -9
  60. package/dist/src/generators/templates/slice.template.d.ts +0 -5
  61. package/dist/src/generators/templates/test.template.d.ts +0 -26
  62. package/dist/src/generators/templates/types.template.d.ts +0 -4
  63. package/dist/src/generators/test.generator.d.ts +0 -18
  64. package/dist/src/generators/types.d.ts +0 -18
  65. package/dist/src/index.d.ts +0 -1
  66. package/dist/src/manifests/bundle-analyzer.manifest.d.ts +0 -2
  67. package/dist/src/manifests/commitizen.manifest.d.ts +0 -2
  68. package/dist/src/manifests/dark-theme.manifest.d.ts +0 -2
  69. package/dist/src/manifests/http-client.manifest.d.ts +0 -2
  70. package/dist/src/manifests/i18n.manifest.d.ts +0 -2
  71. package/dist/src/manifests/index.d.ts +0 -23
  72. package/dist/src/manifests/react-compiler.manifest.d.ts +0 -2
  73. package/dist/src/manifests/redux.manifest.d.ts +0 -8
  74. package/dist/src/manifests/runner.d.ts +0 -36
  75. package/dist/src/manifests/security-headers.manifest.d.ts +0 -2
  76. package/dist/src/manifests/tests.manifest.d.ts +0 -2
  77. package/dist/src/manifests/transforms/next-config.d.ts +0 -24
  78. package/dist/src/manifests/transforms/unwrap-jsx.d.ts +0 -31
  79. package/dist/src/manifests/types.d.ts +0 -131
  80. package/dist/src/manifests/validate-scripts.manifest.d.ts +0 -2
  81. package/dist/src/manifests/ws.manifest.d.ts +0 -2
  82. package/dist/src/modifiers/api-registration.modifier.d.ts +0 -5
  83. package/dist/src/modifiers/app-paths.modifier.d.ts +0 -4
  84. package/dist/src/modifiers/crud-api-registration.modifier.d.ts +0 -4
  85. package/dist/src/modifiers/env-var.modifier.d.ts +0 -59
  86. package/dist/src/modifiers/helpers.d.ts +0 -13
  87. package/dist/src/modifiers/index.d.ts +0 -8
  88. package/dist/src/modifiers/root-provider.modifier.d.ts +0 -25
  89. package/dist/src/modifiers/root-reducer.modifier.d.ts +0 -6
  90. package/dist/src/modifiers/translation.modifier.d.ts +0 -4
  91. package/dist/src/modifiers/types.d.ts +0 -14
  92. package/dist/src/pipelines/feature.pipeline.d.ts +0 -13
  93. package/dist/src/pipelines/index.d.ts +0 -8
  94. package/dist/src/pipelines/runner.d.ts +0 -6
  95. package/dist/src/pipelines/service.pipeline.d.ts +0 -7
  96. package/dist/src/pipelines/slice.pipeline.d.ts +0 -8
  97. package/dist/src/pipelines/types.d.ts +0 -11
  98. package/dist/src/prompts/component.prompt.d.ts +0 -9
  99. package/dist/src/prompts/create-app.prompt.d.ts +0 -49
  100. package/dist/src/prompts/favicon.prompt.d.ts +0 -6
  101. package/dist/src/prompts/feature.prompt.d.ts +0 -10
  102. package/dist/src/prompts/hook.prompt.d.ts +0 -4
  103. package/dist/src/prompts/locale.prompt.d.ts +0 -12
  104. package/dist/src/prompts/page.prompt.d.ts +0 -12
  105. package/dist/src/prompts/service.prompt.d.ts +0 -6
  106. package/dist/src/prompts/slice.prompt.d.ts +0 -5
  107. package/dist/src/services/common/test-utils.d.ts +0 -11
  108. package/dist/src/services/favicon/css-colors.d.ts +0 -7
  109. package/dist/src/services/favicon/detect.d.ts +0 -15
  110. package/dist/src/services/favicon/encoders.d.ts +0 -22
  111. package/dist/src/services/favicon/index.d.ts +0 -6
  112. package/dist/src/services/favicon/manifest.d.ts +0 -24
  113. package/dist/src/services/favicon/pipeline.d.ts +0 -2
  114. package/dist/src/services/favicon/shapes.d.ts +0 -10
  115. package/dist/src/services/favicon/types.d.ts +0 -31
  116. package/dist/src/services/favicon/validate.d.ts +0 -10
  117. package/dist/src/services/init/cleanup/bundle-analyzer.cleanup.d.ts +0 -2
  118. package/dist/src/services/init/cleanup/dark-mode.cleanup.d.ts +0 -2
  119. package/dist/src/services/init/cleanup/http.cleanup.d.ts +0 -2
  120. package/dist/src/services/init/cleanup/i18n.cleanup.d.ts +0 -2
  121. package/dist/src/services/init/cleanup/index.d.ts +0 -2
  122. package/dist/src/services/init/cleanup/misc.cleanup.d.ts +0 -12
  123. package/dist/src/services/init/cleanup/react-compiler.cleanup.d.ts +0 -2
  124. package/dist/src/services/init/cleanup/redux.cleanup.d.ts +0 -2
  125. package/dist/src/services/init/cleanup/seo.cleanup.d.ts +0 -14
  126. package/dist/src/services/init/cleanup/tests.cleanup.d.ts +0 -2
  127. package/dist/src/services/init/cleanup/ws.cleanup.d.ts +0 -14
  128. package/dist/src/services/init/config.service.d.ts +0 -2
  129. package/dist/src/services/init/devtools.service.d.ts +0 -2
  130. package/dist/src/services/init/providers.service.d.ts +0 -3
  131. package/dist/src/services/init/template.service.d.ts +0 -1
  132. package/dist/src/services/setup/bundle-analyzer/index.d.ts +0 -1
  133. package/dist/src/services/setup/commitizen/index.d.ts +0 -2
  134. package/dist/src/services/setup/commitizen/package-modifier.d.ts +0 -16
  135. package/dist/src/services/setup/dark-theme/assets.d.ts +0 -3
  136. package/dist/src/services/setup/dark-theme/checks.d.ts +0 -5
  137. package/dist/src/services/setup/dark-theme/index.d.ts +0 -1
  138. package/dist/src/services/setup/dark-theme/injectors.d.ts +0 -4
  139. package/dist/src/services/setup/dark-theme/utils.d.ts +0 -1
  140. package/dist/src/services/setup/http-client/assets.d.ts +0 -4
  141. package/dist/src/services/setup/http-client/checks.d.ts +0 -7
  142. package/dist/src/services/setup/http-client/index.d.ts +0 -1
  143. package/dist/src/services/setup/http-client/injectors.d.ts +0 -97
  144. package/dist/src/services/setup/i18n/assets.d.ts +0 -3
  145. package/dist/src/services/setup/i18n/checks.d.ts +0 -5
  146. package/dist/src/services/setup/i18n/index.d.ts +0 -1
  147. package/dist/src/services/setup/i18n/injectors.d.ts +0 -5
  148. package/dist/src/services/setup/react-compiler/index.d.ts +0 -1
  149. package/dist/src/services/setup/redux/assets.d.ts +0 -4
  150. package/dist/src/services/setup/redux/checks.d.ts +0 -5
  151. package/dist/src/services/setup/redux/index.d.ts +0 -1
  152. package/dist/src/services/setup/redux/injectors.d.ts +0 -3
  153. package/dist/src/services/setup/security-headers/headers.d.ts +0 -28
  154. package/dist/src/services/setup/security-headers/index.d.ts +0 -2
  155. package/dist/src/services/setup/tests/index.d.ts +0 -1
  156. package/dist/src/services/setup/validate-scripts/index.d.ts +0 -3
  157. package/dist/src/services/setup/validate-scripts/package-modifier.d.ts +0 -18
  158. package/dist/src/services/setup/validate-scripts/scripts.d.ts +0 -11
  159. package/dist/src/services/setup/ws/assets.d.ts +0 -20
  160. package/dist/src/services/setup/ws/checks.d.ts +0 -17
  161. package/dist/src/services/setup/ws/index.d.ts +0 -20
  162. package/dist/src/services/setup/ws/injectors.d.ts +0 -56
@@ -1,5 +0,0 @@
1
- export declare const selectorsTemplate: (params: {
2
- componentName: string;
3
- camelName: string;
4
- sliceName: string;
5
- }) => string;
@@ -1,4 +0,0 @@
1
- export declare const serviceTemplate: (params: {
2
- camelName: string;
3
- httpClient: "axios" | "fetch";
4
- }) => string;
@@ -1,9 +0,0 @@
1
- export declare const sharedComponentTemplate: (params: {
2
- componentName: string;
3
- isClient: boolean;
4
- hasI18n: boolean;
5
- translationNamespace?: string;
6
- }) => string;
7
- export declare const componentBarrelTemplate: (params: {
8
- componentName: string;
9
- }) => string;
@@ -1,5 +0,0 @@
1
- export declare const sliceTemplate: (params: {
2
- componentName: string;
3
- camelName: string;
4
- typesImportPath: string;
5
- }) => string;
@@ -1,26 +0,0 @@
1
- export type ComponentTestParams = {
2
- componentName: string;
3
- /** Import path from the test file to the component, without extension. */
4
- sourceImportPath: string;
5
- /** Import path from the test file to `test/test-utils`, without extension. */
6
- testUtilsImportPath: string;
7
- hasRedux: boolean;
8
- hasI18n: boolean;
9
- };
10
- export declare const componentTestTemplate: (params: ComponentTestParams) => string;
11
- export type HookTestParams = {
12
- hookName: string;
13
- sourceImportPath: string;
14
- /** When the hook reads from the Redux store, wrap `renderHook` in TestProviders. */
15
- withStore: boolean;
16
- /** Only used when withStore is true. */
17
- testUtilsImportPath?: string;
18
- };
19
- export declare const hookTestTemplate: (params: HookTestParams) => string;
20
- export type SliceTestParams = {
21
- /** e.g. `counter` */
22
- camelName: string;
23
- /** Import path from the test file to the `.slice` file, without extension. */
24
- sourceImportPath: string;
25
- };
26
- export declare const sliceTestTemplate: (params: SliceTestParams) => string;
@@ -1,4 +0,0 @@
1
- export declare const stateTypesTemplate: (params: {
2
- componentName: string;
3
- withStore: boolean;
4
- }) => string;
@@ -1,18 +0,0 @@
1
- export type TestKind = 'component' | 'hook' | 'slice';
2
- export type GenerateTestOptions = {
3
- projectPath: string;
4
- /** Absolute path to the source file being tested. */
5
- sourceFile: string;
6
- kind: TestKind;
7
- /** Component/hook/slice identifier (e.g. "Counter", "useCounter", "counter"). */
8
- symbolName: string;
9
- hasRedux?: boolean;
10
- hasI18n?: boolean;
11
- /** Whether the hook uses the Redux store (only relevant for `kind === 'hook'`). */
12
- hookUsesStore?: boolean;
13
- };
14
- /**
15
- * Emit a sibling *.test.{ts,tsx} next to the source file. Returns the path
16
- * that was written.
17
- */
18
- export declare const generateTest: (options: GenerateTestOptions) => Promise<string>;
@@ -1,18 +0,0 @@
1
- export interface SliceGeneratorOptions {
2
- name: string;
3
- outputPath: string;
4
- persist: boolean;
5
- }
6
- export interface ServiceGeneratorOptions {
7
- name: string;
8
- outputPath: string;
9
- httpClient: 'axios' | 'fetch';
10
- }
11
- export interface FeatureGeneratorOptions {
12
- name: string;
13
- outputPath: string;
14
- createStore: boolean;
15
- persistStore: boolean;
16
- createService: boolean;
17
- httpClient?: 'axios' | 'fetch';
18
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- import type { FeatureManifest } from './types';
2
- export declare const bundleAnalyzerManifest: FeatureManifest;
@@ -1,2 +0,0 @@
1
- import type { FeatureManifest } from './types';
2
- export declare const commitizenManifest: FeatureManifest;
@@ -1,2 +0,0 @@
1
- import type { FeatureManifest } from './types';
2
- export declare const darkThemeManifest: FeatureManifest;
@@ -1,2 +0,0 @@
1
- import type { FeatureManifest } from './types';
2
- export declare const httpClientManifest: FeatureManifest;
@@ -1,2 +0,0 @@
1
- import type { FeatureManifest } from './types';
2
- export declare const i18nManifest: FeatureManifest;
@@ -1,23 +0,0 @@
1
- /**
2
- * Central registry of feature manifests. `doctor` and `remove` walk this
3
- * registry; `setup` imports individual manifests when it needs `apply`.
4
- */
5
- import { bundleAnalyzerManifest } from './bundle-analyzer.manifest';
6
- import { commitizenManifest } from './commitizen.manifest';
7
- import { darkThemeManifest } from './dark-theme.manifest';
8
- import { httpClientManifest } from './http-client.manifest';
9
- import { i18nManifest } from './i18n.manifest';
10
- import { reactCompilerManifest } from './react-compiler.manifest';
11
- import { reduxManifest } from './redux.manifest';
12
- import { securityHeadersManifest } from './security-headers.manifest';
13
- import { testsManifest } from './tests.manifest';
14
- import type { FeatureManifest } from './types';
15
- import { validateScriptsManifest } from './validate-scripts.manifest';
16
- import { wsManifest } from './ws.manifest';
17
- export type { RemoveSummary } from './runner';
18
- export { checkManifest, reverseManifest } from './runner';
19
- export type { CodeBlockRequirement, DepKind, FeatureCheckResult, FeatureFinding, FeatureManifest, FileRequirement, PackageRequirement, ScriptRequirement, } from './types';
20
- /** Ordered for sensible doctor output: simple/visible features first. */
21
- export declare const MANIFESTS: ReadonlyArray<FeatureManifest>;
22
- export declare const getManifest: (id: string) => FeatureManifest | undefined;
23
- export { bundleAnalyzerManifest, commitizenManifest, darkThemeManifest, httpClientManifest, i18nManifest, reactCompilerManifest, reduxManifest, securityHeadersManifest, testsManifest, validateScriptsManifest, wsManifest, };
@@ -1,2 +0,0 @@
1
- import type { FeatureManifest } from './types';
2
- export declare const reactCompilerManifest: FeatureManifest;
@@ -1,8 +0,0 @@
1
- import type { FeatureManifest } from './types';
2
- /**
3
- * Slim manifest for Redux. Detection covers the typical footprint, but the
4
- * code injections (root reducer, providers chain, page wiring) aren't
5
- * encoded as `removePattern`s — `remove` reports them as manual cleanup so
6
- * the user can confirm before stripping.
7
- */
8
- export declare const reduxManifest: FeatureManifest;
@@ -1,36 +0,0 @@
1
- import type { FeatureCheckResult, FeatureManifest } from './types';
2
- /**
3
- * Compute drift: walk every piece of the manifest's footprint and report
4
- * what's missing or mismatched. Returns an empty array when the feature is
5
- * present and complete.
6
- */
7
- export declare const checkManifest: (manifest: FeatureManifest, projectPath: string) => Promise<FeatureCheckResult>;
8
- export interface RemoveSummary {
9
- filesRemoved: string[];
10
- packagesUninstalled: string[];
11
- scriptsRemoved: string[];
12
- blocksStripped: Array<{
13
- file: string;
14
- description: string;
15
- }>;
16
- /** Manual-cleanup items the runner couldn't safely remove. */
17
- manualCleanup: Array<{
18
- file: string;
19
- description: string;
20
- }>;
21
- }
22
- /**
23
- * Generic reverse: walk the footprint and undo what we can confidently undo.
24
- *
25
- * - Files marked `generated: true` are deleted.
26
- * - Files marked `generated: false` are left alone (user-owned).
27
- * - Packages are uninstalled.
28
- * - Scripts are removed from package.json.
29
- * - Code blocks with a `removePattern` are stripped; without one, they end
30
- * up in `manualCleanup` so the caller can prompt the user.
31
- *
32
- * The `dryRun` flag computes the summary without touching anything.
33
- */
34
- export declare const reverseManifest: (manifest: FeatureManifest, projectPath: string, options?: {
35
- dryRun?: boolean;
36
- }) => Promise<RemoveSummary>;
@@ -1,2 +0,0 @@
1
- import type { FeatureManifest } from './types';
2
- export declare const securityHeadersManifest: FeatureManifest;
@@ -1,2 +0,0 @@
1
- import type { FeatureManifest } from './types';
2
- export declare const testsManifest: FeatureManifest;
@@ -1,24 +0,0 @@
1
- /**
2
- * Transforms for `next.config.ts` — undo the wraps that `setupI18n` and
3
- * `setupBundleAnalyzer` apply.
4
- *
5
- * Conservative: each helper bails out (returns `null`) if the file's shape
6
- * has drifted away from the canonical pattern. Better to ask the user to
7
- * resolve it than to corrupt their config.
8
- */
9
- import type { RemoveTransform } from '../types';
10
- /**
11
- * Undo `setupI18n`'s wrap: removes
12
- * - `import createNextIntlPlugin from 'next-intl/plugin';`
13
- * - `const withNextIntl = createNextIntlPlugin(...);`
14
- * - the `withNextIntl(...)` call inside the default export, replacing it
15
- * with the inner argument.
16
- */
17
- export declare const unwrapNextIntlPlugin: RemoveTransform;
18
- /**
19
- * Undo `setupBundleAnalyzer`'s wrap: removes
20
- * - `import withBundleAnalyzer from '@next/bundle-analyzer';`
21
- * - the `const bundleAnalyzer = withBundleAnalyzer({ ... });` block.
22
- * - the `bundleAnalyzer(...)` call inside the default export.
23
- */
24
- export declare const unwrapBundleAnalyzer: RemoveTransform;
@@ -1,31 +0,0 @@
1
- /**
2
- * JSX unwrap helpers used by manifests' `removePattern` to undo a provider
3
- * chain wrap (e.g. unwrap `<NextIntlClientProvider>{children}</NextIntlClientProvider>`
4
- * back to `{children}`) and clean up the now-orphan import statement.
5
- *
6
- * String-only transforms — no AST. Conservative: bail out (return `null`) when
7
- * the file shape has drifted from the canonical pattern instead of guessing.
8
- */
9
- import type { RemoveTransform } from '../types';
10
- /**
11
- * Drop a named or default import for `symbol`. If the import was the only
12
- * symbol in a named-import block, the whole line is removed; otherwise the
13
- * symbol is excised from the brace list.
14
- */
15
- export declare const removeNamedImport: (content: string, symbol: string) => string;
16
- /**
17
- * Build a `RemoveTransform` that:
18
- * 1. Locates `<ComponentName ...>` ... `</ComponentName>` in the file.
19
- * 2. Replaces the wrap with its body, outdented by one level (2 spaces).
20
- * 3. Drops the orphan import for `ComponentName`.
21
- *
22
- * Returns `null` (→ manual cleanup) when:
23
- * - The opening tag isn't found.
24
- * - The opening tag spans multiple lines (attributes broken across lines).
25
- * - No matching closing tag at the same indent is found.
26
- *
27
- * The conservative bail-outs keep auto-removal trustworthy: if the user has
28
- * customised the file beyond the canonical shape, we surface a manual hint
29
- * rather than corrupt their JSX.
30
- */
31
- export declare const unwrapJsxChain: (componentName: string) => RemoveTransform;
@@ -1,131 +0,0 @@
1
- /**
2
- * Declarative description of a "feature" the CLI can install/detect/remove.
3
- *
4
- * The same manifest powers three commands: `setup` (install), `doctor`
5
- * (detect drift), and `remove` (undo). Encoding the feature's footprint as
6
- * data — files, deps, scripts, code blocks — lets each command operate
7
- * generically without growing per-feature special cases.
8
- *
9
- * Manifests are intentionally additive: the simple features list every part
10
- * of their footprint, while heavy features (redux, i18n, etc.) start with a
11
- * lighter manifest that doctor/remove can extend over time.
12
- */
13
- export type DepKind = 'dependency' | 'devDependency';
14
- export interface PackageRequirement {
15
- name: string;
16
- kind: DepKind;
17
- }
18
- export interface FileRequirement {
19
- /** Path relative to the project root. */
20
- path: string;
21
- /**
22
- * If true (default), missing the file counts as drift when the feature is
23
- * installed. Optional files (e.g. `.env`) record presence without flagging.
24
- */
25
- required?: boolean;
26
- /** Whether the path points to a directory. */
27
- isDir?: boolean;
28
- /** Used by `remove` to decide whether deletion is safe. */
29
- generated: boolean;
30
- /**
31
- * Set on directories that may legitimately contain user-authored files
32
- * after the feature ships (e.g. `src/app/[locale]` accumulates pages,
33
- * `src/store` accumulates slices). `remove` will NEVER recursively delete
34
- * such paths — it surfaces them as manual cleanup with a guidance message
35
- * so the user can migrate their content first.
36
- */
37
- containsUserContent?: boolean;
38
- /**
39
- * Optional guidance shown when a `containsUserContent` directory is left
40
- * behind during `remove`. e.g. "Move pages out of src/app/[locale]/ before
41
- * deleting".
42
- */
43
- removeHint?: string;
44
- }
45
- export interface ScriptRequirement {
46
- /** package.json scripts.<name> */
47
- name: string;
48
- /** Optional exact-value check. When omitted, only the key's presence is checked. */
49
- expectedValue?: string;
50
- }
51
- /**
52
- * Custom remove transform.
53
- *
54
- * Receives the file's full content; returns either the transformed content
55
- * (auto-removal succeeded) or `null` to fall back to manual cleanup
56
- * (the file shape has drifted from what we expected and we'd rather
57
- * surface it for human review than guess).
58
- */
59
- export type RemoveTransform = (content: string) => string | null;
60
- export interface CodeBlockRequirement {
61
- /** File the block lives in, relative to the project root. */
62
- file: string;
63
- /** Human-readable label used in doctor output. */
64
- description: string;
65
- /** RegExp that matches when the block is present (for both detection and drift). */
66
- presence: RegExp;
67
- /**
68
- * Strategy for removal. Either:
69
- * - `RegExp`: matched content is replaced with empty string.
70
- * - `RemoveTransform` function: returns the transformed file content, or
71
- * `null` to surface as manual cleanup.
72
- *
73
- * If omitted entirely, `remove` reports the block as manual cleanup.
74
- */
75
- removePattern?: RegExp | RemoveTransform;
76
- }
77
- export interface FeatureFootprint {
78
- files: FileRequirement[];
79
- packages: PackageRequirement[];
80
- scripts: ScriptRequirement[];
81
- injections: CodeBlockRequirement[];
82
- }
83
- export interface FeatureManifest extends FeatureFootprint {
84
- id: string;
85
- name: string;
86
- description: string;
87
- /**
88
- * High-level "is this feature installed?" check. May be cheaper than
89
- * walking every file/package/injection in `footprint`.
90
- */
91
- detect: (projectPath: string) => Promise<boolean>;
92
- /**
93
- * Idempotent installer. Doctor's `--fix` flag and the manifest-based
94
- * `setup` path both call this. Optional because some manifests are
95
- * detection-only (e.g. core artifacts that should never be re-applied).
96
- */
97
- apply?: (projectPath: string) => Promise<void>;
98
- /**
99
- * Custom remover. When omitted, the generic reverser walks the footprint
100
- * and only removes pieces it is confident about (files marked `generated`,
101
- * scripts, packages, code blocks with a `removePattern`).
102
- */
103
- remove?: (projectPath: string) => Promise<void>;
104
- }
105
- export type FeatureFinding = {
106
- kind: 'missingFile';
107
- file: string;
108
- description?: string;
109
- } | {
110
- kind: 'missingPackage';
111
- name: string;
112
- depKind: DepKind;
113
- } | {
114
- kind: 'missingScript';
115
- name: string;
116
- } | {
117
- kind: 'mismatchedScript';
118
- name: string;
119
- expected: string;
120
- actual: string;
121
- } | {
122
- kind: 'missingInjection';
123
- file: string;
124
- description: string;
125
- };
126
- export interface FeatureCheckResult {
127
- manifest: FeatureManifest;
128
- installed: boolean;
129
- /** Empty when installed and complete; populated when there is drift. */
130
- drift: FeatureFinding[];
131
- }
@@ -1,2 +0,0 @@
1
- import type { FeatureManifest } from './types';
2
- export declare const validateScriptsManifest: FeatureManifest;
@@ -1,2 +0,0 @@
1
- import type { FeatureManifest } from './types';
2
- export declare const wsManifest: FeatureManifest;
@@ -1,5 +0,0 @@
1
- import type { RegisterApiOptions } from './types';
2
- /**
3
- * Register API endpoints for a service in app-apis.ts.
4
- */
5
- export declare const registerApiEndpoints: (options: RegisterApiOptions) => Promise<void>;
@@ -1,4 +0,0 @@
1
- /**
2
- * Add a route to AppPaths in app-paths.ts.
3
- */
4
- export declare const registerAppPath: (projectPath: string, routeName: string, routePath: string) => Promise<void>;
@@ -1,4 +0,0 @@
1
- /**
2
- * Register CRUD API endpoints for a service in app-apis.ts.
3
- */
4
- export declare const registerCrudApiEndpoints: (projectPath: string, serviceName: string) => Promise<void>;
@@ -1,59 +0,0 @@
1
- /**
2
- * Adds a new environment variable across the four files that the starter
3
- * keeps in sync: `.env.example`, `.env` (when present), the Zod
4
- * `envSchema`, and the typed config. Each transformation is pure and
5
- * idempotent so the orchestrator can call them in any order without
6
- * worrying about duplicate writes.
7
- */
8
- export type EnvVarType = 'string' | 'url' | 'number' | 'boolean' | 'enum';
9
- export interface EnvVarSpec {
10
- /** UPPER_SNAKE_CASE identifier as it will appear in the schema and `.env`. */
11
- name: string;
12
- type: EnvVarType;
13
- required: boolean;
14
- /** When set, the schema gets `.default(...)` and `.env`/`.env.example` get this initial value. */
15
- default?: string;
16
- description?: string;
17
- /** Allowed values when `type === 'enum'`. */
18
- enumValues?: string[];
19
- /** When true, mark the value as public (visible to the browser via `# -public` and the NEXT_PUBLIC_ prefix). */
20
- public: boolean;
21
- }
22
- export declare const validateName: (name: string) => void;
23
- export declare const ensurePublicPrefix: (name: string, isPublic: boolean) => string;
24
- /**
25
- * Build the line that goes inside `envSchema = z.object({ ... })`.
26
- *
27
- * Mirrors the starter's house style: numeric/string types get the
28
- * `preprocess(emptyStringToUndefined, …)` wrapper so empty values in `.env`
29
- * don't pre-empt zod defaults; enums skip it because they reject empty
30
- * strings outright anyway.
31
- */
32
- export declare const buildSchemaEntry: (spec: EnvVarSpec) => string;
33
- /**
34
- * Insert a new entry into `envSchema = z.object({ ... })`. Preserves the
35
- * existing trailing newline shape and is idempotent.
36
- */
37
- export declare const injectSchemaEntry: (content: string, spec: EnvVarSpec) => string;
38
- /**
39
- * Append a `KEY=` (or `KEY=defaultValue`) line to the .env.example contents.
40
- * Adds an optional comment line for the description. Idempotent.
41
- */
42
- export declare const appendEnvExampleEntry: (content: string, spec: EnvVarSpec) => string;
43
- /**
44
- * Mirror of `appendEnvExampleEntry` for `.env`. Always uses the spec default
45
- * (or empty) so secrets aren't leaked into the example file by mistake.
46
- * Idempotent.
47
- */
48
- export declare const appendEnvEntry: (content: string, spec: EnvVarSpec) => string;
49
- export interface AddEnvVarResult {
50
- schemaUpdated: boolean;
51
- envExampleUpdated: boolean;
52
- envUpdated: boolean;
53
- }
54
- /**
55
- * Orchestrates the four-file update. Each step is independently idempotent
56
- * so partial failures are easy to recover from — re-running picks up where
57
- * the previous run left off.
58
- */
59
- export declare const addEnvVar: (projectPath: string, spec: EnvVarSpec) => Promise<AddEnvVarResult>;
@@ -1,13 +0,0 @@
1
- /**
2
- * Add an import statement after the last existing import in a file.
3
- * If no imports exist, prepends to the file.
4
- */
5
- export declare const addImportStatement: (fileContent: string, importStatement: string) => string;
6
- /**
7
- * Add a reducer entry to a combineReducers({...}) call.
8
- */
9
- export declare const addToCombineReducers: (fileContent: string, reducerKey: string, reducerEntry: string) => string;
10
- /**
11
- * Insert a new endpoint object before the closing `} as const;` of AppApis.
12
- */
13
- export declare const addToAppApis: (fileContent: string, endpointBlock: string) => string;
@@ -1,8 +0,0 @@
1
- export { registerApiEndpoints } from './api-registration.modifier';
2
- export { registerAppPath } from './app-paths.modifier';
3
- export { type AddEnvVarResult, addEnvVar, appendEnvEntry, appendEnvExampleEntry, buildSchemaEntry, type EnvVarSpec, type EnvVarType, ensurePublicPrefix, injectSchemaEntry, validateName as validateEnvVarName, } from './env-var.modifier';
4
- export { addImportStatement, addToAppApis, addToCombineReducers } from './helpers';
5
- export { addProviderToBarrel, findRootProviderFile, injectProviderIntoChain, type RegisterProviderOptions, registerProvider, } from './root-provider.modifier';
6
- export { registerInRootReducer } from './root-reducer.modifier';
7
- export { addTranslationNamespace } from './translation.modifier';
8
- export type { RegisterApiOptions, RegisterReducerOptions } from './types';
@@ -1,25 +0,0 @@
1
- /**
2
- * Insert `<ComponentName>{children}</ComponentName>` as the innermost wrap
3
- * around `{children}`. Idempotent: returns the input unchanged if the tag
4
- * is already present.
5
- */
6
- export declare const injectProviderIntoChain: (content: string, componentName: string) => string;
7
- /**
8
- * Append a `export * from './<basename>';` line to the providers barrel,
9
- * keeping it sorted alphabetically among the other exports. Idempotent.
10
- */
11
- export declare const addProviderToBarrel: (content: string, fileBaseName: string) => string;
12
- /** Locates the RootProvider file or returns null when none can be confidently identified. */
13
- export declare const findRootProviderFile: (projectPath: string, fs?: {
14
- fileExists: (p: string) => boolean;
15
- readFile: (p: string) => Promise<string>;
16
- }) => Promise<string | null>;
17
- export interface RegisterProviderOptions {
18
- projectPath: string;
19
- componentName: string;
20
- fileBaseName: string;
21
- }
22
- export declare const registerProvider: (options: RegisterProviderOptions) => Promise<{
23
- rootProviderFile: string | null;
24
- barrelFile: string | null;
25
- }>;
@@ -1,6 +0,0 @@
1
- import type { RegisterReducerOptions } from './types';
2
- /**
3
- * Register a reducer in rootReducer.ts — unified handler for both
4
- * feature-embedded slices (import from /store) and standalone slices.
5
- */
6
- export declare const registerInRootReducer: (options: RegisterReducerOptions) => Promise<void>;
@@ -1,4 +0,0 @@
1
- /**
2
- * Add a translation namespace to the default (en) translation file.
3
- */
4
- export declare const addTranslationNamespace: (projectPath: string, namespace: string) => Promise<void>;
@@ -1,14 +0,0 @@
1
- export interface ModifyFileOptions {
2
- filePath: string;
3
- content: string;
4
- }
5
- export interface RegisterReducerOptions {
6
- projectPath: string;
7
- name: string;
8
- persist: boolean;
9
- importPath: string;
10
- }
11
- export interface RegisterApiOptions {
12
- serviceName: string;
13
- projectPath: string;
14
- }
@@ -1,13 +0,0 @@
1
- import type { ProjectDetection } from '../detection';
2
- import type { PipelineContext, PipelineStep } from './types';
3
- export interface FeaturePipelineContext extends PipelineContext {
4
- featureName: string;
5
- basePath: string;
6
- featurePath: string;
7
- createStore: boolean;
8
- persistStore: boolean;
9
- createService: boolean;
10
- httpClient?: 'axios' | 'fetch';
11
- detection: ProjectDetection;
12
- }
13
- export declare const createFeaturePipelineSteps: () => PipelineStep<FeaturePipelineContext>[];
@@ -1,8 +0,0 @@
1
- export type { FeaturePipelineContext } from './feature.pipeline';
2
- export { createFeaturePipelineSteps } from './feature.pipeline';
3
- export { executePipeline } from './runner';
4
- export type { ServicePipelineContext } from './service.pipeline';
5
- export { createServicePipelineSteps } from './service.pipeline';
6
- export type { SlicePipelineContext } from './slice.pipeline';
7
- export { createSlicePipelineSteps } from './slice.pipeline';
8
- export type { PipelineContext, PipelineStep } from './types';
@@ -1,6 +0,0 @@
1
- import type { PipelineContext, PipelineStep } from './types';
2
- /**
3
- * Execute a sequence of pipeline steps with spinner feedback.
4
- * Each step gets the shared context and reports progress via the spinner.
5
- */
6
- export declare const executePipeline: <T extends PipelineContext>(steps: PipelineStep<T>[], context: T) => Promise<void>;
@@ -1,7 +0,0 @@
1
- import type { PipelineContext, PipelineStep } from './types';
2
- export interface ServicePipelineContext extends PipelineContext {
3
- serviceName: string;
4
- servicePath: string;
5
- httpClient: 'axios' | 'fetch';
6
- }
7
- export declare const createServicePipelineSteps: () => PipelineStep<ServicePipelineContext>[];
@@ -1,8 +0,0 @@
1
- import type { PipelineContext, PipelineStep } from './types';
2
- export interface SlicePipelineContext extends PipelineContext {
3
- sliceName: string;
4
- basePath: string;
5
- slicePath: string;
6
- persistSlice: boolean;
7
- }
8
- export declare const createSlicePipelineSteps: () => PipelineStep<SlicePipelineContext>[];
@@ -1,11 +0,0 @@
1
- import type { Ora } from 'ora';
2
- export interface PipelineContext {
3
- projectPath: string;
4
- spinner: Ora;
5
- }
6
- export interface PipelineStep<TContext extends PipelineContext> {
7
- name: string;
8
- spinnerText: string;
9
- execute: (context: TContext) => Promise<void>;
10
- shouldSkip?: (context: TContext) => boolean;
11
- }
@@ -1,9 +0,0 @@
1
- export interface ComponentPromptResult {
2
- componentName: string;
3
- isClient: boolean;
4
- }
5
- export interface ComponentPromptPresets {
6
- /** When set, the `'use client'` prompt is skipped and this value is used. */
7
- client?: boolean;
8
- }
9
- export declare const promptForComponentDetails: (name?: string, presets?: ComponentPromptPresets) => Promise<ComponentPromptResult>;