-
Notifications
You must be signed in to change notification settings - Fork 0
Dev #37
Changes from all commits
dcae9a6
b410798
6e6b5ad
96d18b5
d04c054
53417f8
a4be154
2a97e98
06eb1d2
60270fc
fb0e09b
ec02ad9
6013fc9
db00fa7
9cc42ae
4d0b56e
97e9022
9553316
9b0c77b
34dd3fd
87b8e57
8b47b20
161ec81
f6d96f5
e73fb2b
d64e181
95655ee
8a18d7c
9922d47
6df926a
8e74de2
9e0e216
5c4b864
1f6ce42
1943293
2a9012e
5a964a0
738be5c
a067e5f
2e11791
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,35 @@ | ||||||||||||||||||
| #!/usr/bin/env node | ||||||||||||||||||
| import fs from 'fs' | ||||||||||||||||||
| import path from 'path' | ||||||||||||||||||
|
|
||||||||||||||||||
| const root = path.resolve(__dirname, '..', 'src') | ||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Line 5 uses Apply this diff to fix: +import { fileURLToPath } from 'url'
+import { dirname } from 'path'
+
+const __filename = fileURLToPath(import.meta.url)
+const __dirname = dirname(__filename)
+
-const root = path.resolve(__dirname, '..', 'src')
+const root = path.resolve(__dirname, '..', 'src')📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
|
|
||||||||||||||||||
| const hexRe = /#[0-9a-fA-F]{3,6}/g | ||||||||||||||||||
| const rgbRe = /rgba?\(/gi | ||||||||||||||||||
|
|
||||||||||||||||||
| function walk(dir) { | ||||||||||||||||||
| const entries = fs.readdirSync(dir, { withFileTypes: true }) | ||||||||||||||||||
| for (const e of entries) { | ||||||||||||||||||
| const full = path.join(dir, e.name) | ||||||||||||||||||
| if (e.isDirectory()) { | ||||||||||||||||||
| walk(full) | ||||||||||||||||||
| } else if (e.isFile()) { | ||||||||||||||||||
| if (full.endsWith('globals.css')) continue | ||||||||||||||||||
| if (!full.endsWith('.css') && !full.endsWith('.tsx') && !full.endsWith('.ts') && !full.endsWith('.jsx') && !full.endsWith('.js') && !full.endsWith('.svg')) continue | ||||||||||||||||||
| const content = fs.readFileSync(full, 'utf8') | ||||||||||||||||||
| const hex = content.match(hexRe) | ||||||||||||||||||
| const rgb = content.match(rgbRe) | ||||||||||||||||||
| if ((hex && hex.length) || (rgb && rgb.length)) { | ||||||||||||||||||
| console.log(`Found in ${path.relative(process.cwd(), full)} -> hex:${hex ? hex.join(',') : '0'} rgb:${rgb ? rgb.length : 0}`) | ||||||||||||||||||
| } | ||||||||||||||||||
| } | ||||||||||||||||||
| } | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| try { | ||||||||||||||||||
| walk(root) | ||||||||||||||||||
| console.log('\nSearch complete — open the above files and replace hardcoded colors with theme variables in src/app/globals.css.') | ||||||||||||||||||
| } catch (err) { | ||||||||||||||||||
| console.error(err) | ||||||||||||||||||
| process.exit(1) | ||||||||||||||||||
| } | ||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| #!/usr/bin/env node | ||
| import fs from 'fs' | ||
| import path from 'path' | ||
|
|
||
| const globals = fs.readFileSync(path.resolve(__dirname, '../src/app/globals.css'), 'utf8') | ||
| const themeContext = fs.readFileSync(path.resolve(__dirname, '../src/app/contexts/ThemeContext.tsx'), 'utf8') | ||
|
|
||
|
Comment on lines
+1
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix ESM With Define -#!/usr/bin/env node
-import fs from 'fs'
-import path from 'path'
-
-const globals = fs.readFileSync(path.resolve(__dirname, '../src/app/globals.css'), 'utf8')
-const themeContext = fs.readFileSync(path.resolve(__dirname, '../src/app/contexts/ThemeContext.tsx'), 'utf8')
+#!/usr/bin/env node
+import fs from 'fs';
+import path from 'path';
+import { fileURLToPath } from 'url';
+
+const __filename = fileURLToPath(import.meta.url);
+const __dirname = path.dirname(__filename);
+
+const globals = fs.readFileSync(path.resolve(__dirname, '../src/app/globals.css'), 'utf8');
+const themeContext = fs.readFileSync(path.resolve(__dirname, '../src/app/contexts/ThemeContext.tsx'), 'utf8');🤖 Prompt for AI Agents |
||
| let ok = true | ||
|
|
||
| function assert(cond, msg) { | ||
| if (!cond) { | ||
| console.error('FAIL:', msg) | ||
| ok = false | ||
| } else { | ||
| console.log('OK:', msg) | ||
| } | ||
| } | ||
|
|
||
| assert(globals.includes(':root'), 'globals.css has :root declarations') | ||
| assert(globals.includes('html.dark'), 'globals.css has html.dark overrides') | ||
| assert(globals.includes('--accent-primary'), 'globals.css defines --accent-primary var') | ||
|
|
||
| assert(themeContext.includes("localStorage.getItem('theme')"), 'ThemeContext reads localStorage') | ||
| assert(themeContext.includes("document.documentElement.classList"), 'ThemeContext manipulates document.documentElement classList') | ||
|
|
||
| if (!ok) process.exit(1) | ||
| console.log('\nTheme setup basic checks passed — globals.css + ThemeContext look correctly configured.') | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix markdown list indentation.
The nested list items use 3-space indentation but should use 2 spaces per Markdown best practices.
Apply this diff to fix the indentation:
Based on static analysis hints.
Also applies to: 70-71
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
63-63: Unordered list indentation
Expected: 2; Actual: 3
(MD007, ul-indent)
64-64: Unordered list indentation
Expected: 2; Actual: 3
(MD007, ul-indent)
65-65: Unordered list indentation
Expected: 2; Actual: 3
(MD007, ul-indent)
🤖 Prompt for AI Agents