@akanjs/devkit 2.3.1 → 2.3.2-rc.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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/scanInfo.ts +18 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/devkit",
3
- "version": "2.3.1",
3
+ "version": "2.3.2-rc.0",
4
4
  "sourceType": "module",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -32,7 +32,7 @@
32
32
  "@langchain/openai": "^1.4.6",
33
33
  "@tailwindcss/node": "^4.3.0",
34
34
  "@trapezedev/project": "^7.1.4",
35
- "akanjs": "2.3.1",
35
+ "akanjs": "2.3.2-rc.0",
36
36
  "chalk": "^5.6.2",
37
37
  "commander": "^14.0.3",
38
38
  "daisyui": "^5.5.20",
package/scanInfo.ts CHANGED
@@ -167,23 +167,37 @@ async function validateModuleFiles(
167
167
  violations.push(`${getScanPath(exec, path.join(modulePath, dirname))}: unsupported module folder`);
168
168
  });
169
169
 
170
+ const uiModuleName = moduleName[0].toUpperCase() + moduleName.slice(1);
171
+
170
172
  files.forEach((filename) => {
171
173
  const filePath = path.join(modulePath, filename);
172
174
  if (filename === "index.ts" || filename === "index.tsx" || isAllowedTestFile(filename)) return;
173
175
  if (filename === `${moduleName}.abstract.md`) return;
174
176
 
175
- const uiMatch = filename.match(/\.([A-Z][A-Za-z0-9]*)\.tsx$/);
177
+ const uiMatch = filename.match(/^([A-Z][A-Za-z0-9]+)\.([A-Z][A-Za-z0-9]*)\.tsx$/);
176
178
  if (uiMatch) {
177
- const fileType = uiMatch[1];
179
+ const fileModuleName = uiMatch[1];
180
+ const fileType = uiMatch[2];
181
+ if (fileModuleName !== uiModuleName) {
182
+ violations.push(
183
+ `${getScanPath(exec, filePath)}: module name mismatch: expected '${uiModuleName}', got '${fileModuleName}'`,
184
+ );
185
+ }
178
186
  if (!moduleUiFileTypes[kind].has(fileType)) {
179
187
  violations.push(`${getScanPath(exec, filePath)}: unsupported ${kind} UI file`);
180
188
  }
181
189
  return;
182
190
  }
183
191
 
184
- const nonUiMatch = filename.match(/\.([a-z][A-Za-z0-9]*)\.ts$/);
192
+ const nonUiMatch = filename.match(/^([a-z][a-zA-Z0-9]*)\.([a-z][a-z0-9]*)\.ts$/);
185
193
  if (nonUiMatch) {
186
- const fileType = nonUiMatch[1];
194
+ const fileModuleName = nonUiMatch[1];
195
+ const fileType = nonUiMatch[2];
196
+ if (fileModuleName !== moduleName) {
197
+ violations.push(
198
+ `${getScanPath(exec, filePath)}: module name mismatch: expected '${moduleName}', got '${fileModuleName}'`,
199
+ );
200
+ }
187
201
  if (!moduleNonUiFileTypes[kind].has(fileType)) {
188
202
  violations.push(`${getScanPath(exec, filePath)}: unsupported ${kind} file`);
189
203
  }