Skip to content

Commit 057555e

Browse files
committed
docs: improve local CLI development instructions
- Update "Running the CLI locally" to use direct node execution - Add warning about global socket installation conflicts - Align root package.json Node.js requirement to >=25.8.0
1 parent f99e388 commit 057555e

File tree

7 files changed

+26
-58
lines changed

7 files changed

+26
-58
lines changed

CLAUDE.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,10 @@ All shared standards (git, testing, code style, cross-platform, CI) defined in s
113113

114114
### Running the CLI locally
115115
- **Watch mode**: `pnpm dev` (auto-rebuilds on file changes)
116-
- **Build and run**: `pnpm build && pnpm exec socket`
117-
- **Run built version**: `pnpm exec socket <args>` (requires prior build)
116+
- **Build and run**: `pnpm build:cli && node packages/cli/dist/index.js`
117+
- **Run built version**: `node packages/cli/dist/index.js <args>` (requires prior build)
118+
119+
**Note**: Avoid `pnpm exec socket` if you have a global `socket` installation, as it may conflict with the local package.
118120

119121
### Package Management
120122
- **Package Manager**: This project uses pnpm (v10.22+)

LICENSE

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

logo-dark.png

-4.6 KB
Binary file not shown.

logo-light.png

-4.51 KB
Binary file not shown.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"packageManager": "pnpm@10.31.0",
55
"private": true,
66
"engines": {
7-
"node": ">=25.5.0",
87
"pnpm": ">=10.22.0"
98
},
109
"scripts": {

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
"zod": "catalog:"
130130
},
131131
"engines": {
132-
"node": ">=25.8.0",
132+
"node": ">=24.14.0",
133133
"pnpm": ">=10.22.0"
134134
},
135135
"repository": {

packages/cli/scripts/build.mjs

Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,7 @@ const NODE_MEMORY_FLAGS = ['--max-old-space-size=8192']
2323
// Simple CLI helpers without registry dependencies.
2424
const isQuiet = () => process.argv.includes('--quiet')
2525
const isVerbose = () => process.argv.includes('--verbose')
26-
const log = {
27-
info: msg => logger.info(msg),
28-
step: msg => logger.step(msg),
29-
success: msg => logger.success(msg),
30-
error: msg => logger.error(msg),
31-
}
26+
3227
const printHeader = title => {
3328
logger.log('')
3429
logger.log(title)
@@ -83,7 +78,7 @@ async function fixNodeGypStrings(dir, options = {}) {
8378
await fs.writeFile(filePath, fixed, 'utf8')
8479

8580
if (!quiet && verbose) {
86-
log.info(
81+
logger.info(
8782
`Fixed node-gyp string in ${path.relative(packageRoot, filePath)}`,
8883
)
8984
}
@@ -106,7 +101,7 @@ async function main() {
106101
// Delegate to watch mode.
107102
if (watch) {
108103
if (!quiet) {
109-
log.info('Starting watch mode...')
104+
logger.info('Starting watch mode...')
110105
}
111106

112107
// First download yoga WASM (only needed asset for CLI bundle).
@@ -164,28 +159,28 @@ async function main() {
164159
// Phase 1: Clean (if needed).
165160
if (shouldClean) {
166161
if (!quiet) {
167-
log.step('Phase 1: Cleaning...')
162+
logger.step('Phase 1: Cleaning...')
168163
}
169164
const result = await spawn('pnpm', ['run', 'clean:dist'], {
170165
shell: WIN32,
171166
stdio: 'inherit',
172167
})
173168
if (result.code !== 0) {
174169
if (!quiet) {
175-
log.error(`Clean failed (exit code: ${result.code})`)
170+
logger.error(`Clean failed (exit code: ${result.code})`)
176171
printError('Build failed')
177172
}
178173
process.exitCode = 1
179174
return
180175
}
181176
if (!quiet && verbose) {
182-
log.success('Clean completed')
177+
logger.success('Clean completed')
183178
}
184179
}
185180

186181
// Phase 2: Generate packages and download assets in parallel.
187182
if (!quiet) {
188-
log.step('Phase 2: Preparing build (parallel)...')
183+
logger.step('Phase 2: Preparing build (parallel)...')
189184
}
190185

191186
const parallelPrep = await Promise.all([
@@ -205,7 +200,7 @@ async function main() {
205200
// Check for null spawn result.
206201
if (!result) {
207202
if (!quiet) {
208-
log.error(`${stepName} failed to start`)
203+
logger.error(`${stepName} failed to start`)
209204
printError('Build failed')
210205
}
211206
process.exitCode = 1
@@ -214,21 +209,21 @@ async function main() {
214209

215210
if (result.code !== 0) {
216211
if (!quiet) {
217-
log.error(`${stepName} failed (exit code: ${result.code})`)
212+
logger.error(`${stepName} failed (exit code: ${result.code})`)
218213
printError('Build failed')
219214
}
220215
process.exitCode = result.code ?? 1
221216
return
222217
}
223218

224219
if (!quiet && verbose) {
225-
log.success(`${stepName} completed`)
220+
logger.success(`${stepName} completed`)
226221
}
227222
}
228223

229224
// Phase 3: Build all variants.
230225
if (!quiet) {
231-
log.step('Phase 3: Building variants...')
226+
logger.step('Phase 3: Building variants...')
232227
}
233228

234229
// Ensure dist directory exists before building variants.
@@ -245,28 +240,28 @@ async function main() {
245240

246241
if (buildResult.code !== 0) {
247242
if (!quiet) {
248-
log.error(`Build failed (exit code: ${buildResult.code})`)
243+
logger.error(`Build failed (exit code: ${buildResult.code})`)
249244
printError('Build failed')
250245
}
251246
process.exitCode = 1
252247
return
253248
}
254249

255250
if (!quiet && verbose) {
256-
log.success('Build completed')
251+
logger.success('Build completed')
257252
}
258253

259254
// Phase 4: Post-processing (parallel).
260255
if (!quiet) {
261-
log.step('Phase 4: Post-processing (parallel)...')
256+
logger.step('Phase 4: Post-processing (parallel)...')
262257
}
263258

264259
await Promise.all([
265260
// Copy CLI bundle to dist (required for dist/index.js to work).
266261
(async () => {
267262
copyFileSync('build/cli.js', 'dist/cli.js')
268263
if (!quiet && verbose) {
269-
log.success('CLI bundle copied')
264+
logger.success('CLI bundle copied')
270265
}
271266
})(),
272267

@@ -277,25 +272,18 @@ async function main() {
277272
verbose,
278273
})
279274
if (!quiet && verbose) {
280-
log.success('Build output post-processed')
275+
logger.success('Build output post-processed')
281276
}
282277
})(),
283278

284-
// Copy files from repo root.
279+
// Copy CHANGELOG.md from repo root (LICENSE and logos are already in cli package).
285280
(async () => {
286-
const filesToCopy = [
287-
'CHANGELOG.md',
288-
'LICENSE',
289-
'logo-dark.png',
290-
'logo-light.png',
291-
]
292-
await Promise.all(
293-
filesToCopy.map(file =>
294-
fs.cp(path.join(repoRoot, file), path.join(packageRoot, file)),
295-
),
281+
await fs.cp(
282+
path.join(repoRoot, 'CHANGELOG.md'),
283+
path.join(packageRoot, 'CHANGELOG.md'),
296284
)
297285
if (!quiet && verbose) {
298-
log.success('Files copied from repo root')
286+
logger.success('CHANGELOG.md copied from repo root')
299287
}
300288
})(),
301289
])

0 commit comments

Comments
 (0)