periderm-cli 0.1.43 → 0.1.44
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/dist/scanner/repo-checks.js +41 -5
- package/package.json +1 -1
|
@@ -270,10 +270,33 @@ export async function runRepoChecks(root, _files, ctx) {
|
|
|
270
270
|
const invisibleDeps = new Set([
|
|
271
271
|
"typescript", "vite", "esbuild", "tsx", "ts-node", "tsup",
|
|
272
272
|
"@types/node", "@types/react", "@types/react-dom",
|
|
273
|
-
"postcss", "autoprefixer", "tailwindcss", "@tailwindcss/vite",
|
|
273
|
+
"postcss", "autoprefixer", "tailwindcss", "@tailwindcss/vite", "@tailwindcss/typography",
|
|
274
274
|
"eslint", "prettier", "husky", "lint-staged",
|
|
275
275
|
"vitest", "jest", "@vitest/ui",
|
|
276
276
|
"react", "react-dom", // used via JSX runtime, not import
|
|
277
|
+
"@babel/parser", "@babel/traverse", "@babel/types",
|
|
278
|
+
"chalk", "commander", "fast-glob", "open", "ora",
|
|
279
|
+
"@babel/core", "@babel/preset-env", "@babel/preset-react", "@babel/preset-typescript",
|
|
280
|
+
"webpack", "rollup", "parcel",
|
|
281
|
+
"nodemon", "pm2",
|
|
282
|
+
"cross-env", "dotenv", "dotenv-expand",
|
|
283
|
+
"fs-extra", "glob", "rimraf", "mkdirp",
|
|
284
|
+
"zx", "execa", "shelljs",
|
|
285
|
+
"semver",
|
|
286
|
+
"nitropack", "h3",
|
|
287
|
+
"@tanstack/router-plugin", "@tanstack/react-router", "@tanstack/react-query", "@tanstack/react-start",
|
|
288
|
+
"vite-plugin-pwa", "vite-tsconfig-paths",
|
|
289
|
+
"clsx", "class-variance-authority", "tailwind-merge",
|
|
290
|
+
"lucide-react", "react-icons",
|
|
291
|
+
"date-fns", "dayjs", "luxon",
|
|
292
|
+
"framer-motion",
|
|
293
|
+
"marked", "dompurify",
|
|
294
|
+
"react-hook-form",
|
|
295
|
+
"recharts",
|
|
296
|
+
"sonner",
|
|
297
|
+
"vaul",
|
|
298
|
+
"zod",
|
|
299
|
+
"ws",
|
|
277
300
|
]);
|
|
278
301
|
const unused = [];
|
|
279
302
|
for (const dep of runtimeDeps) {
|
|
@@ -281,23 +304,36 @@ export async function runRepoChecks(root, _files, ctx) {
|
|
|
281
304
|
continue;
|
|
282
305
|
if (dep.startsWith("@types/"))
|
|
283
306
|
continue;
|
|
307
|
+
if (dep.startsWith("@babel/"))
|
|
308
|
+
continue; // Skip all babel packages
|
|
309
|
+
if (dep.startsWith("@tanstack/"))
|
|
310
|
+
continue; // Skip all tanstack packages
|
|
311
|
+
if (dep.startsWith("@tailwindcss/"))
|
|
312
|
+
continue; // Skip all tailwind packages
|
|
313
|
+
if (dep.startsWith("@radix-ui/"))
|
|
314
|
+
continue; // Skip all radix packages
|
|
315
|
+
if (dep.startsWith("@supabase/"))
|
|
316
|
+
continue; // Skip all supabase packages
|
|
317
|
+
if (dep.startsWith("@fontsource/"))
|
|
318
|
+
continue; // Skip all fontsource packages
|
|
284
319
|
// Sub-path imports still start with the package name
|
|
285
320
|
const escaped = dep.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
286
321
|
const re = new RegExp(`(?:from\\s+["']|require\\(["']|import\\(\\s*["']|import\\s+["']|@import\\s+["'])${escaped}(?:["']|/)`);
|
|
287
322
|
if (!re.test(importHaystack))
|
|
288
323
|
unused.push(dep);
|
|
289
324
|
}
|
|
290
|
-
if
|
|
325
|
+
// Only flag if we have MORE than 3 unused deps to reduce false positives
|
|
326
|
+
if (unused.length > 3) {
|
|
291
327
|
const shown = unused.slice(0, 8);
|
|
292
328
|
out.push({
|
|
293
329
|
id: "unused-dependencies",
|
|
294
330
|
category: "Performance & Bundle Size",
|
|
295
|
-
severity: "
|
|
331
|
+
severity: "low",
|
|
296
332
|
file: "package.json", line: 1,
|
|
297
333
|
message: `${unused.length} dependenc${unused.length === 1 ? "y" : "ies"} in package.json appear unused: ${shown.join(", ")}${unused.length > shown.length ? ", …" : ""}.`,
|
|
298
334
|
why: "Unused deps still get installed, audited, and (if imported anywhere transitively) can end up in the bundle. They also slow every CI install and confuse new contributors.",
|
|
299
|
-
fix: "Verify each one
|
|
300
|
-
aiPrompt: `The following dependencies have no import in the source tree: ${unused.join(", ")}. For each, decide whether to remove it (unused), move it to devDependencies (build/tool-only), or add the missing import (mistakenly deleted)
|
|
335
|
+
fix: "Verify each one carefully before removing - some may be used in build configs or scripts! Move build-only tools to devDependencies.",
|
|
336
|
+
aiPrompt: `The following dependencies have no import in the source tree: ${unused.join(", ")}. For each, decide whether to remove it (unused), move it to devDependencies (build/tool-only), or add the missing import (mistakenly deleted). Be extra careful with monorepo dependencies!`,
|
|
301
337
|
});
|
|
302
338
|
}
|
|
303
339
|
// Code-splitting heuristic: many routes, zero dynamic imports
|
package/package.json
CHANGED