@willbooster/wb 22.7.1 → 22.8.0

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.
package/dist/index.js CHANGED
@@ -105,7 +105,7 @@ dbs:
105
105
  secret-access-key: ${c.CLOUDFLARE_R2_LITESTREAM_SECRET_ACCESS_KEY}
106
106
  sync-interval: 1m
107
107
  `;try{e.writeFileSync(r,l),console.info(`Generated ${r}`)}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Failed to write ${r}: ${t}`,{cause:e})}}function Wc(e,t){return t===`prisma`?`${e.prismaDirName}/restored.sqlite3`:`drizzle/restored.sqlite3`}function Gc(e,t,n){if(t===`prisma`)return`${e.prismaDirName}/mount/prod.sqlite3`;let r=vn(n?{env:n,dirPath:e.dirPath,rootDirPath:e.rootDirPath}:e);if(!r)throw Error(n?`wb db create-litestream-config --env-refs for Drizzle requires a plaintext file: DATABASE_URL default in fnox.toml.`:`wb db create-litestream-config for Drizzle requires file: DATABASE_URL.`);return r}async function Y(e,t){let n=await G(e);n||(console.error(p.red(`No project found.`)),process.exit(1));let r=n.descendants.map(e=>e.databaseOrm?{project:e,orm:e.databaseOrm}:void 0).filter(e=>!!e&&(!t||e.orm===t));return r.length===0&&(console.error(p.red(t?`No ${t} project found.`:`No supported database ORM project found.`)),process.exit(1)),r}function X(e){return e===`prisma`?ui:Br}function*Z(e,t){let n=new Map(t.map(e=>[e.project,e]));for(let r of is(e,t.map(({project:e})=>e))){let e=n.get(r);if(!e)throw Error(`Failed to detect database ORM for ${r.name}.`);yield e}}function Kc(e,t=[]){let n=[],r=Object.keys(Lt),i=Object.values(Lt).flatMap(e=>`alias`in e?Array.isArray(e.alias)?e.alias:[e.alias]:[]).map(String),a=new Set([...t,...r,...i,`--`,`_`,`$0`]);for(let[t,r]of Object.entries(e))if(!a.has(t)){let i=t.replaceAll(/[A-Z]/g,e=>`-${e.toLowerCase()}`);if(i!==t&&e[i]!==void 0)continue;if(typeof r==`boolean`&&r)n.push(`--${t}`);else if(typeof r==`string`||typeof r==`number`)n.push(`--${t}`,String(r));else if(Array.isArray(r))for(let e of r)n.push(`--${t}`,String(e))}let o=Array.isArray(e[`--`])?e[`--`].map(String):[];return H([...n,...o])}const qc=new Set([`CI`]),Jc=[`RAILWAY_`,`NIXPACKS_`];function Yc(e){return qc.has(e)||Jc.some(t=>e.startsWith(t))}function Xc(e){return Object.entries(e).filter(e=>{let[t,n]=e;return typeof n==`string`&&n!==``&&!Yc(t)}).toSorted(([e],[t])=>e.localeCompare(t))}const Zc={command:`railway-env`,describe:`Sync the environment variables declared for the current WB_ENV (resolved from fnox) to the Railway service, keeping fnox the single source of truth. Railway-managed keys (RAILWAY_*, NIXPACKS_*, CI) are never pushed.`,builder:e=>e,async handler(e){let t=W(e);t||(console.error(p.red(`No project found.`)),process.exit(1));let n=t.env.WB_ENV;(!n||n===`development`||n===`test`)&&(console.error(p.red(`WB_ENV must name a deploy environment (e.g. staging or production), but is ${n}.`)),process.exit(1));let[r,i]=he(e,t.dirPath,{ignoreProcessEnv:!0}),a=xt(i);for(let e of Object.keys(r))a.has(e)||delete r[e];for(let e of Object.keys(r)){let n=t.env[e];n!==void 0&&(r[e]=n)}let o=Xc(r);if(o.length===0){console.info(p.yellow(`No environment variables to sync to Railway.`));return}let s=o.map(([e])=>e);if(e.dryRun){console.info(p.cyan(`Would sync ${o.length} variable(s) to Railway (${n}): ${s.join(`, `)}`));return}let c=[`--skip-deploys`];t.env.RAILWAY_PROJECT_ID&&c.push(`--project=${t.env.RAILWAY_PROJECT_ID}`),t.env.RAILWAY_SERVICE_ID&&c.push(`--service=${t.env.RAILWAY_SERVICE_ID}`),c.push(`--environment=${n}`);let l=o.flatMap(([e,t])=>[`--set`,`${e}=${t}`]),u=await Qc(t.dirPath,t.env);if(u.status!==0){let e=(u.stderr||u.stdout).trim();e&&console.error(e),console.error(p.red(`Failed to prepare the Railway CLI (exit ${u.status}).`)),process.exit(u.status??1)}let d=await F(`bunx`,[`@railway/cli`,`variables`,...c,...l],{cwd:t.dirPath,env:t.env,stdio:`pipe`,killOnExit:!0});d.status!==0&&(console.error(p.red(`Failed to sync environment variables to Railway (exit ${d.status}). Keys: ${s.join(`, `)}`)),process.exit(d.status??1)),console.info(p.green(`Synced ${o.length} variable(s) to Railway (${n}): ${s.join(`, `)}`))}};async function Qc(e,t){let n=()=>F(`bunx`,[`@railway/cli`,`--version`],{cwd:e,env:t,stdio:`pipe`,killOnExit:!0}),r=await n();if(r.status!==127)return r;let i=await $c(r.stderr);if(!i)return r;console.warn(p.yellow(`Railway CLI installation is incomplete; trusting its install script once.`));let a=await F(`bun`,[`add`,`--trust`,`@railway/cli`],{cwd:i,env:t,stdio:`pipe`,killOnExit:!0});return a.status===0?n():a}async function $c(e){let n=/could not find the CLI binary at (?<binaryPath>[^\r\n]+)/u.exec(e)?.groups?.binaryPath?.trim();if(!n||!n.endsWith(`/node_modules/@railway/cli/bin/railway`))return;let r=n.slice(0,-38),[i,a]=await Promise.all([D.realpath(r).catch(()=>{}),D.realpath(y.tmpdir())]);if(!i)return;let o=t.join(a,`bunx-${process.getuid()}-@railway`);if(t.dirname(i)===o&&t.basename(i).startsWith(`cli@`))return i}const el={command:`release [args..]`,describe:"Run semantic-release (or multi-semantic-release) so that repositories using Bun isolated installs can publish to npm: reinstall with the hoisted linker (npm cannot walk Bun's isolated node_modules layout), rewrite `workspace:` ranges npm cannot parse, run the release, then restore the modified files. Extra arguments (e.g. `--debug`, after `--`) are forwarded to the release command.",builder:e=>e.parserConfiguration({"populate--":!0}),async handler(e){await tl(e)}};async function tl(e,n){let r=wn(e,!1,n);r||(console.error(p.red(`No project found.`)),process.exit(1));let i=r.root,a=new Map,o,s={current:void 0},c=e=>{o=e;try{s.current?.pid&&P(s.current.pid,e)}catch(t){console.error(p.red(`Failed to terminate the release child process tree: ${String(t)}`)),s.current?.kill(e)}},l=[`SIGINT`,`SIGTERM`];for(let e of l)process.on(e,c);let u=0,d=!1;try{if(await rl(i)?await sl(i,e,a,s):console.info(p.cyan(`Skipping the hoisted reinstall because the semantic-release configuration does not include @semantic-release/npm.`)),o)throw Error(`Aborted by ${o} before running the release.`);u=await gl(i,e,s),d=u===0}catch(e){console.error(p.red(String(e instanceof Error?e.message:e))),u=1}finally{let e=[];for(let[t,n]of a)ul(t,n,d)&&e.push(t);e.length>0&&console.info(p.cyan(`Restored ${e.map(e=>t.relative(i.dirPath,e)).join(`, `)}.`)),[...a.keys()].some(e=>t.basename(e)===`bunfig.toml`)&&!V(i.env.CI)&&console.info(p.yellow("node_modules now uses the hoisted layout; run a clean reinstall (`rm -rf node_modules packages/*/node_modules && bun install`) to restore the isolated layout."));for(let e of l)process.off(e,c)}if(o){process.kill(process.pid,o);return}u!==0&&process.exit(u)}async function nl(e,t,n,r){return await new Promise(i=>{let a=o.spawn(t,n,r);e.current=a,a.on(`error`,t=>{e.current=void 0,console.error(p.red(String(t))),i(1)}),a.on(`exit`,t=>{e.current=void 0,i(t??1)})})}async function rl(e){let t=ol(e.dirPath,e.packageJson);if(!Array.isArray(t)||il(t))return!0;for(let t of await En(e)){let e=ol(t,void 0);if(e===`unknown`||Array.isArray(e)&&il(e))return!0}return!1}function il(e){return e.some(e=>(Array.isArray(e)?e[0]:e)===`@semantic-release/npm`)}const al=[{fileName:`.releaserc`,jsonParseable:!0},{fileName:`.releaserc.json`,jsonParseable:!0},{fileName:`.releaserc.yaml`,jsonParseable:!1},{fileName:`.releaserc.yml`,jsonParseable:!1},{fileName:`.releaserc.js`,jsonParseable:!1},{fileName:`.releaserc.ts`,jsonParseable:!1},{fileName:`.releaserc.mjs`,jsonParseable:!1},{fileName:`.releaserc.cjs`,jsonParseable:!1},{fileName:`.config/releaserc`,jsonParseable:!0},{fileName:`.config/releaserc.json`,jsonParseable:!0},{fileName:`.config/releaserc.yaml`,jsonParseable:!1},{fileName:`.config/releaserc.yml`,jsonParseable:!1},{fileName:`.config/releaserc.js`,jsonParseable:!1},{fileName:`.config/releaserc.ts`,jsonParseable:!1},{fileName:`.config/releaserc.mjs`,jsonParseable:!1},{fileName:`.config/releaserc.cjs`,jsonParseable:!1},{fileName:`release.config.js`,jsonParseable:!1},{fileName:`release.config.ts`,jsonParseable:!1},{fileName:`release.config.mjs`,jsonParseable:!1},{fileName:`release.config.cjs`,jsonParseable:!1}];function ol(n,r){if(r===void 0)try{r=JSON.parse(e.readFileSync(t.join(n,`package.json`),`utf8`))}catch{r=void 0}let i=r?.release;if(i===void 0)for(let{fileName:r,jsonParseable:a}of al){let o=t.join(n,r);if(e.existsSync(o)){if(!a)return`unknown`;try{i=JSON.parse(e.readFileSync(o,`utf8`))}catch{return`unknown`}break}}if(i&&typeof i==`object`)return Array.isArray(i.plugins)?i.plugins:i.extends===void 0?void 0:`unknown`}async function sl(n,r,i,a){let o=t.join(n.dirPath,`bunfig.toml`),s=e.existsSync(o)?e.readFileSync(o,`utf8`):void 0,c=s===void 0?void 0:dl(s);if(s!==void 0&&c!==s&&(console.info(p.cyan(`Clean-reinstalling with the hoisted linker so npm can walk node_modules...`)),!r.dryRun)){i.set(o,Buffer.from(s,`utf8`));for(let r of[`bun.lock`,`bun.lockb`]){let a=t.join(n.dirPath,r);i.set(a,e.existsSync(a)?e.readFileSync(a):void 0)}e.writeFileSync(o,c??``,`utf8`);let r=[n.dirPath,...await En(n)].map(e=>t.join(e,`node_modules`));for(let t of r)e.rmSync(t,{force:!0,recursive:!0});if(await nl(a,`bun`,[`install`,`--ignore-scripts`],{cwd:n.dirPath,env:n.env,stdio:`inherit`})!==0)throw Error(`bun install failed while preparing the release.`);for(let t of r)e.rmSync(t,{force:!0,recursive:!0});if(await nl(a,`bun`,[`install`],{cwd:n.dirPath,env:ll(n.env),stdio:`inherit`})!==0)throw Error(`bun install failed while replaying lifecycle scripts for the release.`)}let l=await En(n);for(let a of[n.packageJsonPath,...l.map(e=>t.join(e,`package.json`))]){if(!e.existsSync(a))continue;let o=e.readFileSync(a,`utf8`);r.dryRun||i.set(a,Buffer.from(o,`utf8`));let s=fl(o);s!==o&&(console.info(p.cyan(`Rewriting workspace: ranges in ${t.relative(n.dirPath,a)}...`)),r.dryRun||e.writeFileSync(a,s,`utf8`))}}const cl=[`VERDACCIO_TOKEN`,`NPM_TOKEN`,`NODE_AUTH_TOKEN`,`GITHUB_TOKEN`,`GH_TOKEN`,`GH_PACKAGES_TOKEN`,`GH_PKG_READ_TOKEN`,`FNOX_AGE_KEY`];function ll(e){let t={...e};for(let e of cl)e in t&&(t[e]=``);return t}function ul(n,r,i){if(r===void 0){let t=e.existsSync(n);return e.rmSync(n,{force:!0}),t}if(i&&t.basename(n)===`package.json`&&e.existsSync(n)){let t=e.readFileSync(n,`utf8`),i=r.toString(`utf8`);if(t!==fl(i)){let r=pl(t,i);return r!==t&&(e.writeFileSync(n,r,`utf8`),!0)}}return!(e.existsSync(n)?e.readFileSync(n):void 0)?.equals(r)&&(e.writeFileSync(n,r),!0)}function dl(e){return e.replace(/^(\s*linker\s*=\s*)["']isolated["']/mu,`$1"hoisted"`).replace(/^\s*globalStore\s*=\s*true[^\n]*\n?/mu,``)}function fl(e){return ml(e,e=>e.replaceAll(/("[^"\n]+"\s*:\s*)"workspace:[^"]*"/gu,`$1"*"`))}function pl(e,t){let n=hl(t);return ml(e,(e,t)=>{let r=e;for(let{section:e,name:i,specifier:a}of n)e===t&&(r=r.replaceAll(RegExp(`("${$e(i)}"\\s*:\\s*)"[^"]*"`,`gu`),(e,t)=>`${t}${JSON.stringify(a)}`));return r})}function ml(e,t){return e.replaceAll(/("(dependencies|devDependencies|optionalDependencies|peerDependencies)"\s*:\s*\{)([^{}]*)(\})/gu,(e,n,r,i,a)=>`${n}${t(i,r)}${a}`)}function hl(e){let t;try{t=JSON.parse(e)}catch{return[]}let n=[];for(let e of[`dependencies`,`devDependencies`,`optionalDependencies`,`peerDependencies`])for(let[r,i]of Object.entries(t[e]??{}))typeof i==`string`&&i.startsWith(`workspace:`)&&n.push({section:e,name:r,specifier:i});return n}async function gl(n,r,i){let a=[...r.args??[],...r[`--`]??[]].map(String),o=[`@anolilab/multi-semantic-release`,`multi-semantic-release`,`@qiwi/multi-semantic-release`].find(e=>n.packageJson.devDependencies?.[e]),s=o?`multi-semantic-release`:`semantic-release`,c={...n.env};vt(n.dirPath,c);let l=e.existsSync(t.join(n.dirPath,`node_modules`,`.bin`,s)),u=o??`semantic-release`,d=l?[s,...a]:n.packageManagerCommand===`bun`?[`bunx`,u,...a]:[`yarn`,`dlx`,u,...a];return console.info(p.cyan(`Running: ${d.join(` `)}`)),r.dryRun?0:await nl(i,d[0],d.slice(1),{cwd:n.dirPath,env:c,stdio:`inherit`})}const _l={command:`retry [command] [args...]`,describe:`Retry the given command until it succeeds`,builder:{retry:{description:`A maximum retry count`,type:`number`,alias:`r`,default:3}},async handler(e){let t=W(e);t||(console.error(p.red(`No project found.`)),process.exit(1));let n=[e.command,...e.args??[],...e._.slice(1)].filter(Boolean),r=0;for(let i=0;i<e.retry;i++)if(i>0&&console.info(`\n${p.yellow(`#${i} Retrying: ${n.join(` `)}`)}`),r=await K(n.join(` `),t,e,{exitIfFailed:!1,onSignal:e=>{e&&process.exit(1)}}),r===0)return;process.exit(r)}},vl={command:`run [args..]`,describe:`Load environment variables and run a script with the project runtime.`,builder:e=>e.parserConfiguration({"parse-positional-numbers":!1,"populate--":!0,"unknown-options-as-args":!0}),async handler(e){let t=qe(process.argv);t.length===0&&(console.error(`Usage: wb run <script> [args...]`),process.exit(1));let n=process.cwd(),r=W(e,!0,n),i=r?.env??xl(e,n),a=yl(n,t,i,r);if(e.dryRun){console.info(`Would run: ${a.join(` `)}`);return}await Vi(n,i),await $r(a,`wb run <script> [args...]`,{cwd:n,env:i})}};function yl(e,t,n,r){if(!St(e))return[`node`,...t];let i=t[0];if(i&&i===n.npm_lifecycle_event){let a=r?r.packageJson.scripts?.[i]:bl(e,i);if(a!==void 0&&a===n.npm_lifecycle_script)return[...t]}return[`bun`,`run`,...t]}function bl(n,r){for(let i=t.resolve(n);;i=t.dirname(i)){let n=t.join(i,`package.json`);if(e.existsSync(n))try{return JSON.parse(e.readFileSync(n,`utf8`)).scripts?.[r]}catch{return}if(t.dirname(i)===i)return}}function xl(e,t){let[n]=yn(e,t);return n.WB_ENV||=me(e),Sl(e,n),n}function Sl(e,t){let n=new Set([`development`,`test`,`staging`,`production`]);t.WB_ENV&&!n.has(t.WB_ENV)&&(console.error(`WB_ENV must be one of development, test, staging, or production, but is "${t.WB_ENV}". Fix the env source or the exported variable.`),process.exit(1));let r=process.env,i=typeof e.cascadeEnv==`string`?e.cascadeEnv:e.cascadeNodeEnv?r.NODE_ENV||`development`:e.autoCascadeEnv===!1?void 0:r.WB_ENV||r.NODE_ENV||`development`;t.WB_ENV&&i&&n.has(i)&&t.WB_ENV!==i&&(console.error(`WB_ENV resolves to "${t.WB_ENV}" although the "${i}" environment was selected. Fix the WB_ENV defined in the env sources.`),process.exit(1))}const Cl={command:`setup`,describe:`Setup development environment. Environment variables are not loaded.`,builder:{},async handler(e){await wl(e)}};async function wl(e,t){let n=await G(e,!1,t);n||(console.error(p.red(`No project found.`)),process.exit(1));for(let t of is(`setup`,n.descendants)){let r=await D.readdir(t.dirPath,{withFileTypes:!0});if(t===n.root&&(y.platform()===`darwin`&&await Xn(`brew install ${[`pstree`].join(` `)}`,t,e),r.some(e=>e.isFile()&&(e.name===`mise.toml`||e.name.includes(`-version`)))&&await K(`mise install`,t,e,{exitIfFailed:!1})),r.some(e=>e.isFile()&&e.name===`pyproject.toml`)){await Xn(`poetry config virtualenvs.in-project true`,t,e);let n=``;try{n=o.execSync(`mise which python`,{cwd:t.dirPath,stdio:[`ignore`,`pipe`,`ignore`]}).toString().trim()}catch{}n&&await Xn(`poetry env use ${U(n)}`,t,e),await Un.promiseAll(),await K(`poetry run pip install --upgrade pip`,t,e),await K(`poetry install --ansi`,t,e)}(t===n.root||!n.root.packageJson.scripts?.[`gen-code`])&&t.packageJson.scripts?.[`gen-code`]&&await K(`${t.packageManagerRunCommand} gen-code`,t,e)}let r=n.descendants.find(e=>e.packageJson.devDependencies?.playwright);r&&await K(`${r.packageManagerRunCommand} playwright install --with-deps`,r,e)}var Q=class extends Error{exitCode;constructor(e){super(`Package command exited with code ${e}.`),this.exitCode=e}};async function Tl(e,t,n,r={}){if(El(e,t.dirPath),n.dryRun)return 0;let i=(await F(e,void 0,{cwd:t.dirPath,env:tr(t.env,{preserveColor:!1}),shell:!0,stdio:`pipe`,mergeOutAndError:!0,killOnExit:!0,printingStdout:!0,printingStderr:!0,verbose:n.verbose})).status??1;if(i!==0&&!r.allowFailure)throw console.info(p.red(p.bold(`Failed (exit code ${i}):`),e)),new Q(i);return i}function El(e,t){console.info(`
108
- `+p.cyan(p.bold(`Command:`),e)+p.gray(` at ${t}`))}const Dl={files:{type:`string`,array:!0,default:[],describe:`Slidev deck files to check`}},Ol={fix:{type:`boolean`,default:!1,describe:`Apply fixes suggested by slidev-check`}},kl={command:`slidev-check [files..]`,describe:`Check selected Slidev decks, or all *.slidev.md decks when no files are given`,builder:e=>e.options(Ol).positional(`files`,Dl.files),async handler(e){let n=W(e,!1);if(!n){console.error(p.red(`No project found.`)),process.exitCode=1;return}let r=[...e.files,...e._.slice(1)],i=r.length>0?r.map(e=>t.resolve(String(e))):Al(n);if(i.length===0){console.info(`No Slidev decks found.`);return}process.exitCode=await jl(n,i,e)}};function Al(e){return n.globSync(`**/*.slidev.md`,{dot:!0,cwd:e.dirPath,ignore:De}).toSorted((e,t)=>e.localeCompare(t))}async function jl(e,n,r){for(let i of n){if(r.dryRun)console.info(`Textlint: ${i} (dry run)`);else{let{lintSlidevText:n}=await import(`./slidevTextlint-DmM7I6XO.js`),r=await n(t.resolve(e.dirPath,i),e.rootDirPath);if(r!==0)return r}let n=U(i),a=await Tl(`${e.packageManagerCommand} slidev-check ${r.fix?`--fix `:``}${n}`,e,r,{allowFailure:!0});if(a!==0)return a}return 0}const Ml={watch:{description:`Whether to watch files`,type:`boolean`},args:{description:`Arguments for core command`,type:`array`,alias:`a`,default:[]},"docker-options":{description:`Arguments for "docker run"`,type:`array`,default:[]}};function Nl(e){e.normalizedArgsText=[...e.args??[],...e._?.slice(1)??[],...e[`--`]??[]].map(e=>U(String(e))).join(` `),e.normalizedDockerOptionsText=(e.dockerOptions??[]).map(e=>U(String(e))).join(` `)}function Pl(e){return e.silent?` > /dev/null`:``}const Fl=new class{buildImage(e,n){let r=e.dockerPackageJson.scripts?.[`docker/build/prepare`]?`YARN run docker/build/prepare && `:``,i=e.env.FNOX_AGE_KEY?`
108
+ `+p.cyan(p.bold(`Command:`),e)+p.gray(` at ${t}`))}const Dl={files:{type:`string`,array:!0,default:[],describe:`Slidev deck files to check`}},Ol={fix:{type:`boolean`,default:!1,describe:`Apply fixes suggested by slidev-check`}},kl={command:`slidev-check [files..]`,describe:`Check selected Slidev decks, or all *.slidev.md decks when no files are given`,builder:e=>e.options(Ol).positional(`files`,Dl.files),async handler(e){let n=W(e,!1);if(!n){console.error(p.red(`No project found.`)),process.exitCode=1;return}let r=[...e.files,...e._.slice(1)],i=r.length>0?r.map(e=>t.resolve(String(e))):Al(n);if(i.length===0){console.info(`No Slidev decks found.`);return}process.exitCode=await jl(n,i,e)}};function Al(e){return n.globSync(`**/*.slidev.md`,{dot:!0,cwd:e.dirPath,ignore:De}).toSorted((e,t)=>e.localeCompare(t))}async function jl(e,n,r){for(let i of n){if(r.dryRun)console.info(`Textlint: ${i} (dry run)`);else{let{lintSlidevText:n}=await import(`./slidevTextlint-B7OBY1Bl.js`),r=await n(t.resolve(e.dirPath,i),e.rootDirPath);if(r!==0)return r}let n=U(i),a=await Tl(`${e.packageManagerCommand} slidev-check ${r.fix?`--fix `:``}${n}`,e,r,{allowFailure:!0});if(a!==0)return a}return 0}const Ml={watch:{description:`Whether to watch files`,type:`boolean`},args:{description:`Arguments for core command`,type:`array`,alias:`a`,default:[]},"docker-options":{description:`Arguments for "docker run"`,type:`array`,default:[]}};function Nl(e){e.normalizedArgsText=[...e.args??[],...e._?.slice(1)??[],...e[`--`]??[]].map(e=>U(String(e))).join(` `),e.normalizedDockerOptionsText=(e.dockerOptions??[]).map(e=>U(String(e))).join(` `)}function Pl(e){return e.silent?` > /dev/null`:``}const Fl=new class{buildImage(e,n){let r=e.dockerPackageJson.scripts?.[`docker/build/prepare`]?`YARN run docker/build/prepare && `:``,i=e.env.FNOX_AGE_KEY?`
109
109
  --secret id=fnox_age_key,env=FNOX_AGE_KEY`:``;return`cd ${t.dirname(e.findFile(`Dockerfile`))}
110
110
  && ${r}YARN wb optimizeForDockerBuild --outside
111
111
  && YARN wb retry -- docker build -t ${e.dockerImageName}