periderm-cli 0.1.36 → 0.1.38

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/index.js CHANGED
@@ -31,7 +31,7 @@ const program = new Command();
31
31
  program
32
32
  .name("periderm")
33
33
  .description("A pre-launch checklist.")
34
- .version("0.1.36");
34
+ .version("0.1.37");
35
35
  // Easter egg: `periderm bless` — hidden, undocumented
36
36
  program
37
37
  .command("bless", { hidden: true })
@@ -119,7 +119,8 @@ export function renderMarkdown(r) {
119
119
  lines.push(`You are reviewing a Periderm CLI scan: Launch Confidence ${r.scores.confidence}/100, Reality ${r.scores.reality}/100, Perceived ${r.scores.perceived}/100 — verdict ${verdictLabel}.`);
120
120
  lines.push(`There are ${r.counts.critical} critical, ${r.counts.high} high, ${r.counts.medium} medium, ${r.counts.low} low findings.`);
121
121
  lines.push(`Fix them in priority order. For each finding, open the listed file, apply the Exact fix, and keep the change minimal.`);
122
- lines.push(`IMPORTANT: Before you begin, read the instructions in \`.periderm/ai-instructions.md\` for the full iterative process on how to run the scanner, verify fixes, and handle any authentication requirements.`);
122
+ const aiInstructionsPath = process.cwd() + "/.periderm/ai-instructions.md";
123
+ lines.push(`IMPORTANT: Before you begin, read the instructions in \`${aiInstructionsPath}\` for the full iterative process on how to run the scanner, verify fixes, and handle any authentication requirements.`);
123
124
  lines.push("```");
124
125
  lines.push("");
125
126
  // Hidden watermark — only visible in raw .md source
@@ -784,7 +784,7 @@ const formInputNoLabel = (source, file) => {
784
784
  severity: "high",
785
785
  file, line: lineOf(source, m.index),
786
786
  message: `<${tag}> has no associated <label> or aria-label.`,
787
- why: "Screen readers announce the field with no name. Users have no idea what to type. Violates WCAG 2.1 SC 1.3.1 & 3.3.2.",
787
+ why: "Screen readers announce the field with no name. Disabled users have no idea what to type. Violates WCAG 2.1 SC 1.3.1 & 3.3.2.",
788
788
  fix: "Either wrap the field in a <label>, add htmlFor={id}, or set aria-label=\"...\" on the field itself.",
789
789
  aiPrompt: `In ${file} near line ${lineOf(source, m.index)}, the <${tag}> is missing a label. Add a <label htmlFor="..."> or aria-label describing what the user should enter.`,
790
790
  }));
@@ -9,8 +9,8 @@ Given a project summary, decide:
9
9
  - notes: one sentence explaining your reasoning
10
10
 
11
11
  Rules:
12
- - If both marketing/landing routes AND admin/dashboard routes exist → monorepo. Do NOT skip legal/SEO globally; only internal_globs for admin paths.
13
- - Pure admin dashboards with no public marketing → admin-only, skip Legal & Compliance and SEO & Discoverability globally.
12
+ - A project is an 'admin-only' internal tool EVEN IF it has public auth/login pages. Only classify as 'monorepo' if it contains a full public-facing marketing site or consumer product alongside the dashboard.
13
+ - If 'admin-only' or 'internal-tool', skip Legal & Compliance, SEO & Discoverability, and Accessibility globally.
14
14
  - Mobile-only (Flutter/RN/Swift, no web marketing) → mobile-app, skip SEO.
15
15
  - Never skip Security, Runtime Stability, or Runaway Cloud Costs unless library with no runtime.`;
16
16
  const TRIAGE_PROMPT = `You triage scan findings for false positives. Return ONLY valid JSON:
@@ -19,15 +19,17 @@ const INTERNAL_PATH_RE = [
19
19
  /(?:^|[/\\])middleware\.(?:ts|js)/,
20
20
  ];
21
21
  const CONSUMER_PATH_RE = [
22
- /(?:^|[/\\])routes[/\\]index\.(tsx|jsx)$/,
23
- /(?:^|[/\\])routes[/\\]__root\.(tsx|jsx)$/,
24
- /(?:^|[/\\])pages[/\\]index\.(tsx|jsx)$/,
25
- /(?:^|[/\\])app[/\\]page\.(tsx|jsx)$/,
22
+ /(?:^|[/\\])routes[/\\](?:index|__root|\+page)\.(tsx|jsx|svelte|vue)$/i,
23
+ /(?:^|[/\\])pages[/\\]index\.(tsx|jsx|vue|astro)$/i,
24
+ /(?:^|[/\\])app[/\\](?:page|layout|app\.component)\.(tsx|jsx|ts|js)$/i,
25
+ /(?:^|[/\\])(?:App|app)\.(svelte|vue)$/i,
26
+ /(?:^|[/\\])lib[/\\](?:main|screens[/\\]home)\.dart$/i,
27
+ /(?:^|[/\\])(?:ContentView|ViewController)\.swift$/i,
26
28
  /(?:^|[/\\])landing/i,
27
29
  /(?:^|[/\\])marketing/i,
28
- /(?:^|[/\\])routes[/\\]docs\.(tsx|jsx)$/,
29
- /(?:^|[/\\])routes[/\\]privacy\.(tsx|jsx)$/,
30
- /(?:^|[/\\])routes[/\\]terms\.(tsx|jsx)$/,
30
+ /(?:^|[/\\])(?:routes|pages|app)[/\\]docs\./i,
31
+ /(?:^|[/\\])(?:routes|pages|app)[/\\]privacy\./i,
32
+ /(?:^|[/\\])(?:routes|pages|app)[/\\]terms\./i,
31
33
  ];
32
34
  const INTERNAL_ONLY_SKIP = new Set([
33
35
  "Legal & Compliance",
@@ -132,7 +134,7 @@ export async function detectProjectContext(root, files) {
132
134
  stacks.push("swift-ios");
133
135
  reasoning.push("Detected Swift/iOS.");
134
136
  }
135
- if (pkgRaw && /react|vite|next|tanstack|svelte|vue/.test(pkgRaw)) {
137
+ if (pkgRaw && /react|vite|next|tanstack|svelte|vue|angular|astro|nuxt|remix|gatsby/i.test(pkgRaw)) {
136
138
  stacks.push("web-js");
137
139
  reasoning.push("Detected web JavaScript/TypeScript stack.");
138
140
  }
@@ -101,7 +101,21 @@ export async function runRepoChecks(root, _files, ctx) {
101
101
  });
102
102
  }
103
103
  }
104
- if (!skipLegalGlobally) {
104
+ }
105
+ if (!skipLegalGlobally) {
106
+ if (ctx?.profile === "mobile-app") {
107
+ out.push({
108
+ id: "mobile-legal-reminder",
109
+ category: "Legal & Compliance",
110
+ severity: "medium",
111
+ file: "App Stores", line: 1,
112
+ message: "Verify Privacy Policy URL is configured in App Store / Google Play.",
113
+ why: "Mobile apps must link to external legal policies in the app stores. Code scanners cannot verify external links.",
114
+ fix: "Ensure your App Store Connect and Google Play Console entries have valid, accessible URLs to your privacy policy and terms.",
115
+ aiPrompt: "Remind me to update my App Store / Google Play developer console with the Privacy Policy link.",
116
+ });
117
+ }
118
+ else {
105
119
  const legalFilePaths = _files.filter(f => {
106
120
  const rel = path.relative(root, f);
107
121
  return /terms|privacy|cookie|policy|legal|compliance|eula|tos/i.test(rel);
@@ -203,7 +217,7 @@ export async function runRepoChecks(root, _files, ctx) {
203
217
  // "is this dep actually imported anywhere?" and "is this class used?".
204
218
  let importHaystack = "";
205
219
  for (const abs of _files) {
206
- if (!/\.(tsx|jsx|ts|js|mjs|cjs|svelte|vue|astro|mdx?)$/.test(abs))
220
+ if (!/\.(tsx|jsx|ts|js|mjs|cjs|svelte|vue|astro|mdx?|css|scss)$/.test(abs))
207
221
  continue;
208
222
  const chunk = await readMaybe(abs);
209
223
  if (chunk)
@@ -269,7 +283,7 @@ export async function runRepoChecks(root, _files, ctx) {
269
283
  continue;
270
284
  // Sub-path imports still start with the package name
271
285
  const escaped = dep.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
272
- const re = new RegExp(`(?:from\\s+["']|require\\(["']|import\\(\\s*["'])${escaped}(?:["']|/)`);
286
+ const re = new RegExp(`(?:from\\s+["']|require\\(["']|import\\(\\s*["']|import\\s+["']|@import\\s+["'])${escaped}(?:["']|/)`);
273
287
  if (!re.test(importHaystack))
274
288
  unused.push(dep);
275
289
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "periderm-cli",
3
- "version": "0.1.36",
3
+ "version": "0.1.38",
4
4
  "description": "Pre-launch scanner for web and mobile codebases. Context-aware checks for JS, TS, Flutter, React Native, and Swift.",
5
5
  "type": "module",
6
6
  "bin": {