@planu/cli 5.3.36 → 5.3.37
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 +6 -0
- package/dist/engine/project-health-checker.js +13 -11
- package/package.json +1 -1
- package/planu-plugin.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,8 +3,9 @@ import { technologyValue } from './technology-registry.js';
|
|
|
3
3
|
// engine/project-health-checker.ts — SPEC-180 + SPEC-192 + SPEC-177: Project health check with convention scanning
|
|
4
4
|
import { execSync } from 'node:child_process';
|
|
5
5
|
import { readFile, access } from 'node:fs/promises';
|
|
6
|
-
import { join } from 'node:path';
|
|
6
|
+
import { join, relative } from 'node:path';
|
|
7
7
|
import { parseConventions, scanConventions } from './convention-scanner/index.js';
|
|
8
|
+
import { fastFindPatterns } from './core-bridge.js';
|
|
8
9
|
// ── helpers ──────────────────────────────────────────────────────────────────
|
|
9
10
|
function fileExists(path) {
|
|
10
11
|
return access(path)
|
|
@@ -75,17 +76,17 @@ async function checkConventions(projectPath) {
|
|
|
75
76
|
const nonAsciiPattern = /(?:function|const|let|var|export)\s+([À-ÿ\w]*[À-ÿ][À-ÿ\w]*)/;
|
|
76
77
|
let nonEnglishFiles = 0;
|
|
77
78
|
for (const dir of srcDirs) {
|
|
78
|
-
const
|
|
79
|
-
const
|
|
80
|
-
for (const
|
|
81
|
-
const content = await readFile(
|
|
79
|
+
const matches = fastFindPatterns(join(projectPath, dir), ['[À-ÿ]'], ['ts', 'js', 'tsx', 'jsx']);
|
|
80
|
+
const absPaths = Array.from(new Set(matches.map((m) => m.path))).slice(0, 5);
|
|
81
|
+
for (const absPath of absPaths) {
|
|
82
|
+
const content = await readFile(absPath, 'utf-8').catch(() => '');
|
|
82
83
|
if (nonAsciiPattern.test(content)) {
|
|
83
84
|
nonEnglishFiles++;
|
|
84
85
|
score -= 25;
|
|
85
86
|
items.push({
|
|
86
87
|
severity: 'warning',
|
|
87
88
|
category: 'conventions',
|
|
88
|
-
message: `Non-English identifiers found in ${
|
|
89
|
+
message: `Non-English identifiers found in ${relative(projectPath, absPath)}`,
|
|
89
90
|
fix: 'Rename identifiers to English to improve cross-team readability',
|
|
90
91
|
});
|
|
91
92
|
if (nonEnglishFiles >= 2) {
|
|
@@ -267,15 +268,16 @@ async function checkPlatformFitness(projectPath, knowledge) {
|
|
|
267
268
|
(await fileExists(join(projectPath, 'serverless.yml'))) ||
|
|
268
269
|
(await fileExists(join(projectPath, 'serverless.yaml')));
|
|
269
270
|
if (isServerless) {
|
|
270
|
-
|
|
271
|
-
const
|
|
272
|
-
const
|
|
273
|
-
if (
|
|
271
|
+
const dirs = ['src', 'lib'];
|
|
272
|
+
const matches = dirs.flatMap((dir) => fastFindPatterns(join(projectPath, dir), ['^let\\s+\\w+'], ['ts', 'js']));
|
|
273
|
+
const absPaths = Array.from(new Set(matches.map((m) => m.path))).slice(0, 3);
|
|
274
|
+
if (absPaths.length > 0) {
|
|
275
|
+
const relPaths = absPaths.map((p) => relative(projectPath, p));
|
|
274
276
|
score = 50;
|
|
275
277
|
items.push({
|
|
276
278
|
severity: 'warning',
|
|
277
279
|
category: 'platform-fitness',
|
|
278
|
-
message: `Module-level mutable state detected in serverless context (${
|
|
280
|
+
message: `Module-level mutable state detected in serverless context (${relPaths.slice(0, 2).join(', ')})`,
|
|
279
281
|
fix: 'Avoid module-level let in serverless functions — use Redis or database persistence for cross-request data (cold starts reset module state)',
|
|
280
282
|
});
|
|
281
283
|
}
|
package/package.json
CHANGED
package/planu-plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "dev.planu.cli",
|
|
3
3
|
"displayName": "Planu — Spec Driven Development",
|
|
4
4
|
"description": "Manage software specs, estimations, and autonomous SDD workflows. Language-agnostic MCP server for Claude Code.",
|
|
5
|
-
"version": "5.3.
|
|
5
|
+
"version": "5.3.37",
|
|
6
6
|
"icon": "assets/plugin/icon.svg",
|
|
7
7
|
"command": ["npx", "@planu/cli@latest"],
|
|
8
8
|
"packageName": "@planu/cli",
|