@domain-first/project-structure 8.2.0 → 8.4.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/README.md +5 -1
- package/dist/287.js +333 -30
- package/dist/561.js +75 -32
- package/dist/agent-cli.d.ts +40 -1
- package/dist/agent-requests.d.ts +78 -0
- package/dist/backend-module-move.d.ts +16 -0
- package/dist/index.cjs +383 -35
- package/dist/index.js +4 -2
- package/dist/init.cjs +55 -55
- package/dist/integration.cjs +406 -60
- package/dist/react-module-move.d.ts +47 -3
- package/dist/react.cjs +425 -61
- package/dist/react.js +20 -2
- package/dist/use-cases/delete-backend-unit.d.ts +6 -0
- package/dist/use-cases/delete-react-module.d.ts +8 -0
- package/dist/use-cases/index.d.ts +2 -0
- package/package.json +1 -1
- package/skills/df-ps-react/SKILL.md +5 -3
- package/skills/df-ps-react/references/generators.md +8 -0
- package/skills/df-ps-scaffold/SKILL.md +5 -4
- package/skills/df-ps-scaffold/references/agent-mode.md +1 -0
- package/skills/df-ps-scaffold/references/agent-operations.md +7 -0
- package/skills/df-ps-scaffold/references/units/delete.md +19 -0
- package/skills/df-ps-scaffold/scripts/drive.mjs +5 -0
|
@@ -1,16 +1,39 @@
|
|
|
1
1
|
import { type MovePlan } from './module-move';
|
|
2
|
+
import { NestedName } from './nested-name';
|
|
2
3
|
export type { MovePlan } from './module-move';
|
|
3
|
-
export type ReactModuleKind = 'page' | 'widget';
|
|
4
|
+
export type ReactModuleKind = 'page' | 'widget' | 'ui-kit' | 'hook';
|
|
4
5
|
export type ReactModule = {
|
|
5
6
|
kind: ReactModuleKind;
|
|
6
|
-
/**
|
|
7
|
+
/** Name, nested for pages and widgets, e.g. `admin/users`. */
|
|
7
8
|
name: string;
|
|
8
|
-
/** The page file
|
|
9
|
+
/** The page or hook file; the widget or UI-kit folder. */
|
|
9
10
|
path: string;
|
|
10
11
|
/** The name part of file names, e.g. `admin-users` in `admin-users-page.tsx`. */
|
|
11
12
|
fileBase: string;
|
|
12
13
|
ClassName: string;
|
|
13
14
|
};
|
|
15
|
+
type ReactKindLayout = {
|
|
16
|
+
/** Folder under `presentation/react`. */
|
|
17
|
+
folder: string;
|
|
18
|
+
/** Names may contain folders (`admin/users`). */
|
|
19
|
+
nested: boolean;
|
|
20
|
+
/** The module is a folder (widget, UI-kit) rather than files. */
|
|
21
|
+
inFolder: boolean;
|
|
22
|
+
/** For file modules: the files of a module, by file base. */
|
|
23
|
+
ownFile?: (fileBase: string) => RegExp;
|
|
24
|
+
/** Where a module of this name lives. */
|
|
25
|
+
target: (reactFolder: string, name: NestedName) => string;
|
|
26
|
+
/** Code names: a prefix group and what follows the class name. */
|
|
27
|
+
classPrefix: string;
|
|
28
|
+
classSuffix: string;
|
|
29
|
+
/** Generated story title, followed by renames. */
|
|
30
|
+
storyTitle?: (segments: string[]) => string;
|
|
31
|
+
};
|
|
32
|
+
export declare const reactKindLayouts: Record<ReactModuleKind, ReactKindLayout>;
|
|
33
|
+
/** How menus name each kind, singular and plural. */
|
|
34
|
+
export declare const reactKindTitles: Record<ReactModuleKind, [string, string]>;
|
|
35
|
+
/** A hook's name is entered without `use-`, as its generator takes it. */
|
|
36
|
+
export declare const reactModuleName: (kind: ReactModuleKind, rawName: string) => string;
|
|
14
37
|
export declare const findReactModules: (reactFolder: string, kind: ReactModuleKind) => ReactModule[];
|
|
15
38
|
export declare const validateMove: (reactFolder: string, module: ReactModule, rawName: string) => string | true;
|
|
16
39
|
/** A Next.js App Router route folder moved with a page. */
|
|
@@ -33,3 +56,24 @@ export declare const routeFiles: (folder: string) => string[];
|
|
|
33
56
|
* files of that Next.js route folder move too.
|
|
34
57
|
*/
|
|
35
58
|
export declare const moveReactModule: (projectRoot: string, reactFolder: string, module: ReactModule, rawName: string, route?: RouteMove) => MovePlan;
|
|
59
|
+
/**
|
|
60
|
+
* The route folder of a page with Next.js: `<app>/<name>/` when its
|
|
61
|
+
* `page.tsx` renders the page. Undefined for other routes or none.
|
|
62
|
+
*/
|
|
63
|
+
export declare const pageRouteFolder: (appFolder: string, page: ReactModule) => string | undefined;
|
|
64
|
+
export type ReactDeleteResult = {
|
|
65
|
+
/** Files outside the module that still import it: [file, import]. */
|
|
66
|
+
usedBy: [string, string][];
|
|
67
|
+
} | {
|
|
68
|
+
deleted: string[];
|
|
69
|
+
usedBy?: undefined;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Stages the deletion of a page or widget with its files, and with `route`
|
|
73
|
+
* the files of that Next.js route folder too. Nothing is staged while other
|
|
74
|
+
* files still import the module; those imports are returned instead.
|
|
75
|
+
*/
|
|
76
|
+
export declare const deleteReactModule: (projectRoot: string, reactFolder: string, module: ReactModule, route?: {
|
|
77
|
+
appFolder: string;
|
|
78
|
+
folder: string;
|
|
79
|
+
}) => ReactDeleteResult;
|