ai-forge-cli 0.3.2 → 0.3.4

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.
@@ -72,8 +72,11 @@ var componentLocationValidator = {
72
72
  "node_modules/**",
73
73
  "dist/**",
74
74
  ".vinxi/**",
75
- "app/**",
76
- // TanStack Start entry files and routes
75
+ ".output/**",
76
+ "src/routes/**",
77
+ // Route files (allowed JSX)
78
+ "src/router.tsx",
79
+ // Router config
77
80
  "src/features/*/components/**",
78
81
  // Valid location
79
82
  "src/components/**",
@@ -96,6 +99,31 @@ var componentLocationValidator = {
96
99
  };
97
100
  }
98
101
  };
102
+ var componentSubdirValidator = {
103
+ name: "Component subdirectories",
104
+ async validate(cwd) {
105
+ const errors = [];
106
+ const warnings = [];
107
+ const subdirs = await fg2("src/components/*/", {
108
+ cwd,
109
+ onlyDirectories: true,
110
+ ignore: ["src/components/ui"]
111
+ });
112
+ for (const dir of subdirs) {
113
+ warnings.push({
114
+ file: dir,
115
+ message: "Subdirectory in src/components/ - consider using a feature for page-specific components"
116
+ });
117
+ }
118
+ return {
119
+ rule: this.name,
120
+ passed: true,
121
+ // Warnings don't fail the check
122
+ errors,
123
+ warnings
124
+ };
125
+ }
126
+ };
99
127
  var hookLocationValidator = {
100
128
  name: "Hook locations",
101
129
  async validate(cwd) {
@@ -115,7 +143,7 @@ var hookLocationValidator = {
115
143
  ]
116
144
  });
117
145
  for (const file of potentialHookFiles) {
118
- if (file.startsWith("app/routes/")) continue;
146
+ if (file.startsWith("src/routes/")) continue;
119
147
  errors.push({
120
148
  file,
121
149
  message: "Hook file outside valid location (should be in src/features/*/hooks.ts or src/hooks/)"
@@ -305,6 +333,7 @@ var featureParityValidator = {
305
333
  var validators = [
306
334
  featureStructureValidator,
307
335
  componentLocationValidator,
336
+ componentSubdirValidator,
308
337
  hookLocationValidator,
309
338
  thinRoutesValidator,
310
339
  crossFeatureValidator,
package/dist/index.js CHANGED
@@ -21,7 +21,7 @@ var main = defineCommand({
21
21
  subCommands: {
22
22
  init: () => import("./init-OYJP5QCZ.js").then((m) => m.default),
23
23
  "add:feature": () => import("./add-feature-MU65GMUK.js").then((m) => m.default),
24
- check: () => import("./check-B4VHLFHH.js").then((m) => m.default),
24
+ check: () => import("./check-YMGJNKME.js").then((m) => m.default),
25
25
  version: () => import("./version-VO3LHLDO.js").then((m) => m.default)
26
26
  },
27
27
  run({ args }) {
@@ -33,11 +33,21 @@ forge check # Validate architecture (run before finishing)
33
33
  ```
34
34
  src/routes/ → Thin route files (import from features, no logic)
35
35
  src/features/ → Feature code (components/, hooks.ts)
36
- src/components/ Shared UI only
36
+ src/components/ui/ shadcn primitives only
37
+ src/components/ → Truly shared components (Header, Footer, Logo)
37
38
  src/lib/ → Utilities
38
39
  convex/features/ → Backend (mirrors src/features/)
39
40
  ```
40
41
 
42
+ ## Where Components Go
43
+
44
+ - `src/components/ui/*` → shadcn primitives (Button, Card, Dialog)
45
+ - `src/components/*.tsx` → Truly shared components used across multiple pages
46
+ - `src/features/<name>/components/` → Page-specific components
47
+
48
+ **IMPORTANT:** NO subdirectories in `src/components/` except `ui/`.
49
+ If you need 3+ components for a page, create a feature with `forge add:feature`.
50
+
41
51
  ## Rules
42
52
 
43
53
  1. Routes are thin wrappers - no business logic, just imports and renders
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-forge-cli",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "TypeScript stack scaffolding & enforcement CLI for TanStack Start + Convex",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -33,11 +33,21 @@ forge check # Validate architecture (run before finishing)
33
33
  ```
34
34
  src/routes/ → Thin route files (import from features, no logic)
35
35
  src/features/ → Feature code (components/, hooks.ts)
36
- src/components/ Shared UI only
36
+ src/components/ui/ shadcn primitives only
37
+ src/components/ → Truly shared components (Header, Footer, Logo)
37
38
  src/lib/ → Utilities
38
39
  convex/features/ → Backend (mirrors src/features/)
39
40
  ```
40
41
 
42
+ ## Where Components Go
43
+
44
+ - `src/components/ui/*` → shadcn primitives (Button, Card, Dialog)
45
+ - `src/components/*.tsx` → Truly shared components used across multiple pages
46
+ - `src/features/<name>/components/` → Page-specific components
47
+
48
+ **IMPORTANT:** NO subdirectories in `src/components/` except `ui/`.
49
+ If you need 3+ components for a page, create a feature with `forge add:feature`.
50
+
41
51
  ## Rules
42
52
 
43
53
  1. Routes are thin wrappers - no business logic, just imports and renders