@ryuxdsgn/design-intelligence 2.19.0 → 2.19.1

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/dist/scan.js +8 -3
  2. package/package.json +1 -1
package/dist/scan.js CHANGED
@@ -2,6 +2,8 @@
2
2
  // contents, returns findings, no LLM and no network. Each detector names the RX rule it checks; the
3
3
  // rule text stays in intelligence/content.ts. "fail" is for a pattern that is wrong wherever it
4
4
  // appears; "warn" is for a signal a person or agent should look at.
5
+ const INDONESIAN = /\blang=["']id\b|\bid-ID\b|\blocale\s*[:=]\s*["'`]id\b|\bRp\.?\s?\d|\b(?:yang|untuk|tidak|silakan|pesanan|belum)\b/;
6
+ const TEST_FILE = /(?:^|\/)(?:tests?|__tests__)\/|\.(?:test|spec)\.[cm]?[jt]sx?$/;
5
7
  /** What `ryux scan <url>` measures on the rendered page (cli/page-probe.ts), for --list-rules and the
6
8
  * rule text. */
7
9
  export const RENDER_CHECKS = [
@@ -92,9 +94,9 @@ export const DETECTORS = [
92
94
  {
93
95
  rule: "RX-CD-09",
94
96
  level: "warn",
95
- looksFor: "dates as 10/02/2026 and times as 2:30 PM in copy",
97
+ looksFor: "dates as 10/02/2026 and times as 2:30 PM in Indonesian copy (lang id, id-ID, Rupiah, or Indonesian words in the folder); test files are skipped",
96
98
  exts: CODE,
97
- find: ({ text }) => matches(text, [
99
+ find: ({ path, text }, ctx) => TEST_FILE.test(path) || !(ctx.indonesian ?? INDONESIAN.test(text)) ? [] : matches(text, [
98
100
  [/(?<![\d/])\d{1,2}\/\d{1,2}\/\d{4}(?![\d/])/, (m) => `"${m[0]}": in Indonesian copy write 2 Okt 2026 (other markets follow their locale)`],
99
101
  [/\b\d{1,2}[:.]\d{2}\s?(?:AM|PM|am|pm)\b/, (m) => `"${m[0]}": in Indonesian copy write 14.30 in 24-hour form (other markets follow their locale)`],
100
102
  ]),
@@ -318,7 +320,10 @@ function lineCol(raw, index) {
318
320
  /** Run every detector over the sources. Findings are ordered by file, then line. */
319
321
  export function scanSources(sources, opts) {
320
322
  const ctx = opts.folder
321
- ? { reducedMotion: sources.some((s) => /prefers-reduced-motion|motion-(?:reduce|safe):|useReducedMotion|reducedMotion/.test(s.text)) }
323
+ ? {
324
+ reducedMotion: sources.some((s) => /prefers-reduced-motion|motion-(?:reduce|safe):|useReducedMotion|reducedMotion/.test(s.text)),
325
+ indonesian: sources.some((s) => !TEST_FILE.test(s.path) && INDONESIAN.test(s.text)),
326
+ }
322
327
  : {};
323
328
  const findings = [];
324
329
  for (const src of sources) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryuxdsgn/design-intelligence",
3
- "version": "2.19.0",
3
+ "version": "2.19.1",
4
4
  "description": "RYUX: design intelligence for AI agents and designers. One skill, five entry points: Analyze, Design, Build, Critique, and QA, for Claude Code, Codex, Cursor, Gemini CLI, OpenCode, Cline, Copilot, and more.",
5
5
  "type": "module",
6
6
  "bin": {