Skip to content

Commit 82da41e

Browse files
committed
refactor(cli): inline logo copying into build script
- Remove standalone copy-logos.mjs script - Inline logo copying directly into build.mjs after build steps - Consistent with cli-with-sentry build approach
1 parent c7d2b76 commit 82da41e

File tree

2 files changed

+20
-25
lines changed

2 files changed

+20
-25
lines changed

packages/cli/scripts/build.mjs

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,18 @@
1212
* --no-minify Build without minification for debugging
1313
*/
1414

15+
import { promises as fs } from 'node:fs'
16+
import path from 'node:path'
17+
import { fileURLToPath } from 'node:url'
18+
1519
import { WIN32 } from '@socketsecurity/lib/constants/platform'
1620
import { logger } from '@socketsecurity/lib/logger'
1721
import { spawn } from '@socketsecurity/lib/spawn'
1822

23+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
24+
const packageRoot = path.resolve(__dirname, '..')
25+
const repoRoot = path.resolve(__dirname, '../../..')
26+
1927
// Simple CLI helpers without registry dependencies.
2028
const isQuiet = () => process.argv.includes('--quiet')
2129
const isVerbose = () => process.argv.includes('--verbose')
@@ -114,11 +122,6 @@ async function main() {
114122
command: 'node',
115123
args: ['scripts/compress-cli.mjs'],
116124
},
117-
{
118-
name: 'Copy Logos',
119-
command: 'node',
120-
args: ['scripts/copy-logos.mjs'],
121-
},
122125
]
123126

124127
// Run build steps sequentially.
@@ -152,6 +155,18 @@ async function main() {
152155
}
153156
}
154157

158+
// Copy logo images from repo root.
159+
if (!quiet && verbose) {
160+
log.info('Copying logo images from repo root...')
161+
}
162+
const images = ['logo-dark.png', 'logo-light.png']
163+
for (const image of images) {
164+
await fs.cp(path.join(repoRoot, image), path.join(packageRoot, image))
165+
}
166+
if (!quiet && verbose) {
167+
log.success('Logo images copied')
168+
}
169+
155170
if (!quiet) {
156171
printSuccess('Build completed')
157172
printFooter()

packages/cli/scripts/copy-logos.mjs

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)