mirror of
https://github.com/browseros-ai/BrowserOS.git
synced 2026-05-19 03:26:28 +00:00
* feat: build prod server resource artifacts with cloudflare r2 * fix: address PR review comments for prod_server_resources_cloudflare * feat: fix prod server build setup and CLI ergonomics * fix: prevent build env secret inlining and template fallback * fix: read from fileenv * feat: add ripgrep * feat: upload prod artifacts to latest and version prefixes
37 lines
1002 B
TypeScript
37 lines
1002 B
TypeScript
import { Command } from 'commander'
|
|
|
|
import { resolveTargets } from './targets'
|
|
import type { BuildArgs } from './types'
|
|
|
|
const DEFAULT_MANIFEST_PATH = 'scripts/build/config/server-prod-resources.json'
|
|
|
|
export function parseBuildArgs(argv: string[]): BuildArgs {
|
|
const program = new Command()
|
|
program
|
|
.allowUnknownOption(false)
|
|
.allowExcessArguments(false)
|
|
.exitOverride((error) => {
|
|
throw new Error(error.message)
|
|
})
|
|
.option('--target <targets>', 'Build target ids or "all"', 'all')
|
|
.option(
|
|
'--manifest <path>',
|
|
'Resource manifest path',
|
|
DEFAULT_MANIFEST_PATH,
|
|
)
|
|
.option('--upload', 'Upload artifact zips to R2')
|
|
.option('--no-upload', 'Skip zip upload to R2')
|
|
program.parse(argv, { from: 'user' })
|
|
const options = program.opts<{
|
|
target: string
|
|
manifest: string
|
|
upload: boolean
|
|
}>()
|
|
|
|
return {
|
|
targets: resolveTargets(options.target),
|
|
manifestPath: options.manifest,
|
|
upload: options.upload ?? true,
|
|
}
|
|
}
|