@willbooster/wb 22.9.0 → 22.10.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/README.md +3 -2
- package/dist/index.js +1 -1
- package/dist/slidevTextlint-BWfKLtiS.js +144 -0
- package/package.json +1 -1
- package/dist/slidevTextlint-B75Sxakk.js +0 -144
package/README.md
CHANGED
|
@@ -195,7 +195,7 @@ the working directory (or `--working-dir`). Page selection within a deck is not
|
|
|
195
195
|
decks before running tests, without applying fixes.
|
|
196
196
|
|
|
197
197
|
The bundled textlint rules check half-width kana, invalid control characters,
|
|
198
|
-
|
|
198
|
+
zero-width spaces (U+200B), and Chinese or Korean text mixed into Japanese. Numeric inch marks, sentence fragments, omitted final punctuation, long technical terms,
|
|
199
199
|
polite/plain style, sentence length, and cautious wording are allowed. No local
|
|
200
200
|
textlint configuration or extra textlint installation is needed; repository
|
|
201
201
|
`.textlintrc` files do not affect these slide checks.
|
|
@@ -206,7 +206,8 @@ lines, columns, and rule names. Slidev's parser rejects import paths outside tho
|
|
|
206
206
|
roots before reading them. This check compares paths without resolving symlink
|
|
207
207
|
targets. Slidev frontmatter,
|
|
208
208
|
comments/speaker notes, and code are excluded. Parsing uses the standard Markdown
|
|
209
|
-
textlint plugin; raw HTML blocks and HTML tag attributes are
|
|
209
|
+
textlint plugin; raw HTML blocks and HTML tag attributes are checked only for Chinese
|
|
210
|
+
or Korean text, excluding `<code>`, `<pre>`, `<script>`, and `<style>` elements. Slidev-specific
|
|
210
211
|
syntax is not interpreted: Vue expressions and MDC attributes may be checked
|
|
211
212
|
when the Markdown parser treats their source as prose (for example,
|
|
212
213
|
`{{ "テスト" }}` or `[visible]{title="テスト"}`). Half-width kana is checked in plain paragraph and list text, but not in headings
|
package/dist/index.js
CHANGED
|
@@ -105,7 +105,7 @@ dbs:
|
|
|
105
105
|
secret-access-key: ${l.CLOUDFLARE_R2_LITESTREAM_SECRET_ACCESS_KEY}
|
|
106
106
|
sync-interval: 1m
|
|
107
107
|
`;try{r.writeFileSync(i,u),console.info(`Generated ${i}`)}catch(e){let t=n(e);throw Error(`Failed to write ${i}: ${t}`,{cause:e})}}function Yc(e,t){return t===`prisma`?`${e.prismaDirName}/restored.sqlite3`:`drizzle/restored.sqlite3`}function Xc(e,t,n){if(t===`prisma`)return`${e.prismaDirName}/mount/prod.sqlite3`;let r=wn(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 X(e,t){let n=await K(e);n||(console.error(g.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(g.red(t?`No ${t} project found.`:`No supported database ORM project found.`)),process.exit(1)),r}function Z(e){return e===`prisma`?hi:Gr}function*Q(e,t){let n=new Map(t.map(e=>[e.project,e]));for(let r of ls(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 Zc(e,t=[]){let n=[],r=Object.keys(Ut),i=Object.values(Ut).flatMap(e=>`alias`in e?Array.isArray(e.alias)?e.alias:[e.alias]:[]).map(String),a=/* @__PURE__ */ 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 U([...n,...o])}const Qc=/* @__PURE__ */ new Set([`CI`]),$c=[`RAILWAY_`,`NIXPACKS_`];function el(e){return Qc.has(e)||$c.some(t=>e.startsWith(t))}function tl(e){return Object.entries(e).filter(e=>{let[t,n]=e;return typeof n==`string`&&n!==``&&!el(t)}).toSorted(([e],[t])=>e.localeCompare(t))}const nl={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=G(e);t||(console.error(g.red(`No project found.`)),process.exit(1));let n=t.env.WB_ENV;(!n||n===`development`||n===`test`)&&(console.error(g.red(`WB_ENV must name a deploy environment (e.g. staging or production), but is ${n}.`)),process.exit(1));let[r,i]=Ce(e,t.dirPath,{ignoreProcessEnv:!0}),a=Dt(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=tl(r);if(o.length===0){console.info(g.yellow(`No environment variables to sync to Railway.`));return}let s=o.map(([e])=>e);if(e.dryRun){console.info(g.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 rl(t.dirPath,t.env);if(u.status!==0){let e=(u.stderr||u.stdout).trim();e&&console.error(e),console.error(g.red(`Failed to prepare the Railway CLI (exit ${u.status}).`)),process.exit(u.status??1)}let d=await L(`bunx`,[`@railway/cli`,`variables`,...c,...l],{cwd:t.dirPath,env:t.env,stdio:`pipe`,killOnExit:!0});d.status!==0&&(console.error(g.red(`Failed to sync environment variables to Railway (exit ${d.status}). Keys: ${s.join(`, `)}`)),process.exit(d.status??1)),console.info(g.green(`Synced ${o.length} variable(s) to Railway (${n}): ${s.join(`, `)}`))}};async function rl(e,t){let n=()=>L(`bunx`,[`@railway/cli`,`--version`],{cwd:e,env:t,stdio:`pipe`,killOnExit:!0}),r=await n();if(r.status!==127)return r;let i=await il(r.stderr);if(!i)return r;console.warn(g.yellow(`Railway CLI installation is incomplete; trusting its install script once.`));let a=await L(`bun`,[`add`,`--trust`,`@railway/cli`],{cwd:i,env:t,stdio:`pipe`,killOnExit:!0});return a.status===0?n():a}async function il(e){let t=/could not find the CLI binary at (?<binaryPath>[^\r\n]+)/u.exec(e)?.groups?.binaryPath?.trim();if(!t||!t.endsWith(`/node_modules/@railway/cli/bin/railway`))return;let n=t.slice(0,-38),[r,a]=await Promise.all([A.realpath(n).catch(()=>{}),A.realpath(S.tmpdir())]);if(!r)return;let o=i.join(a,`bunx-${process.getuid()}-@railway`);if(i.dirname(r)===o&&i.basename(r).startsWith(`cli@`))return r}const al={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 ol(e)}};async function ol(e,t){let r=An(e,!1,t);r||(console.error(g.red(`No project found.`)),process.exit(1));let a=r.root,o=/* @__PURE__ */ new Map,s,c={current:void 0},l=e=>{s=e;try{c.current?.pid&&I(c.current.pid,e)}catch(t){console.error(g.red(`Failed to terminate the release child process tree: ${String(t)}`)),c.current?.kill(e)}},u=[`SIGINT`,`SIGTERM`];for(let e of u)process.on(e,l);let d=0,f=!1;try{if(await cl(a)?await fl(a,e,o,c):console.info(g.cyan(`Skipping the hoisted reinstall because the semantic-release configuration does not include @semantic-release/npm.`)),s)throw Error(`Aborted by ${s} before running the release.`);d=await xl(a,e,c),f=d===0}catch(e){console.error(g.red(n(e))),d=1}finally{let e=[];for(let[t,n]of o)hl(t,n,f)&&e.push(t);e.length>0&&console.info(g.cyan(`Restored ${e.map(e=>i.relative(a.dirPath,e)).join(`, `)}.`)),[...o.keys()].some(e=>i.basename(e)===`bunfig.toml`)&&!wt(a.env.CI)&&console.info(g.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 u)process.off(e,l)}if(s){process.kill(process.pid,s);return}d!==0&&process.exit(d)}async function sl(e,t,n,r){return await new Promise(i=>{let a=l.spawn(t,n,r);e.current=a,a.on(`error`,t=>{e.current=void 0,console.error(g.red(String(t))),i(1)}),a.on(`exit`,t=>{e.current=void 0,i(t??1)})})}async function cl(e){let t=dl(e.dirPath,e.packageJson);if(!Array.isArray(t)||ll(t))return!0;for(let t of await Mn(e)){let e=dl(t,void 0);if(e===`unknown`||Array.isArray(e)&&ll(e))return!0}return!1}function ll(e){return e.some(e=>(Array.isArray(e)?e[0]:e)===`@semantic-release/npm`)}const ul=[{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 dl(e,t){if(t===void 0)try{t=JSON.parse(r.readFileSync(i.join(e,`package.json`),`utf8`))}catch{t=void 0}let n=t?.release;if(n===void 0)for(let{fileName:t,jsonParseable:a}of ul){let o=i.join(e,t);if(r.existsSync(o)){if(!a)return`unknown`;try{n=JSON.parse(r.readFileSync(o,`utf8`))}catch{return`unknown`}break}}if(n&&typeof n==`object`)return Array.isArray(n.plugins)?n.plugins:n.extends===void 0?void 0:`unknown`}async function fl(e,t,n,a){let o=i.join(e.dirPath,`bunfig.toml`),s=r.existsSync(o)?r.readFileSync(o,`utf8`):void 0,c=s===void 0?void 0:gl(s);if(s!==void 0&&c!==s&&(console.info(g.cyan(`Clean-reinstalling with the hoisted linker so npm can walk node_modules...`)),!t.dryRun)){n.set(o,Buffer.from(s,`utf8`));for(let t of[`bun.lock`,`bun.lockb`]){let a=i.join(e.dirPath,t);n.set(a,r.existsSync(a)?r.readFileSync(a):void 0)}r.writeFileSync(o,c??``,`utf8`);let t=[e.dirPath,...await Mn(e)].map(e=>i.join(e,`node_modules`));for(let e of t)r.rmSync(e,{force:!0,recursive:!0});if(await sl(a,`bun`,[`install`,`--ignore-scripts`],{cwd:e.dirPath,env:e.env,stdio:`inherit`})!==0)throw Error(`bun install failed while preparing the release.`);for(let e of t)r.rmSync(e,{force:!0,recursive:!0});if(await sl(a,`bun`,[`install`],{cwd:e.dirPath,env:ml(e.env),stdio:`inherit`})!==0)throw Error(`bun install failed while replaying lifecycle scripts for the release.`)}let l=await Mn(e);for(let a of[e.packageJsonPath,...l.map(e=>i.join(e,`package.json`))]){if(!r.existsSync(a))continue;let o=r.readFileSync(a,`utf8`);t.dryRun||n.set(a,Buffer.from(o,`utf8`));let s=_l(o);s!==o&&(console.info(g.cyan(`Rewriting workspace: ranges in ${i.relative(e.dirPath,a)}...`)),t.dryRun||r.writeFileSync(a,s,`utf8`))}}const pl=[`VERDACCIO_TOKEN`,`NPM_TOKEN`,`NODE_AUTH_TOKEN`,`GITHUB_TOKEN`,`GH_TOKEN`,`GH_PACKAGES_TOKEN`,`GH_PKG_READ_TOKEN`,`FNOX_AGE_KEY`];function ml(e){let t={...e};for(let e of pl)e in t&&(t[e]=``);return t}function hl(e,t,n){if(t===void 0){let t=r.existsSync(e);return r.rmSync(e,{force:!0}),t}if(n&&i.basename(e)===`package.json`&&r.existsSync(e)){let n=r.readFileSync(e,`utf8`),i=t.toString(`utf8`);if(n!==_l(i)){let t=vl(n,i);return t!==n&&(r.writeFileSync(e,t,`utf8`),!0)}}return!(r.existsSync(e)?r.readFileSync(e):void 0)?.equals(t)&&(r.writeFileSync(e,t),!0)}function gl(e){return e.replace(/^(\s*linker\s*=\s*)["']isolated["']/mu,`$1"hoisted"`).replace(/^\s*globalStore\s*=\s*true[^\n]*\n?/mu,``)}function _l(e){return yl(e,e=>e.replaceAll(/("[^"\n]+"\s*:\s*)"workspace:[^"]*"/gu,`$1"*"`))}function vl(e,t){let n=bl(t);return yl(e,(e,t)=>{let r=e;for(let{section:e,name:i,specifier:a}of n)e===t&&(r=r.replaceAll(RegExp(`("${it(i)}"\\s*:\\s*)"[^"]*"`,`gu`),(e,t)=>`${t}${JSON.stringify(a)}`));return r})}function yl(e,t){return e.replaceAll(/("(dependencies|devDependencies|optionalDependencies|peerDependencies)"\s*:\s*\{)([^{}]*)(\})/gu,(e,n,r,i,a)=>`${n}${t(i,r)}${a}`)}function bl(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 xl(e,t,n){let a=[...t.args??[],...t[`--`]??[]].map(String),o=[`@anolilab/multi-semantic-release`,`multi-semantic-release`,`@qiwi/multi-semantic-release`].find(t=>e.packageJson.devDependencies?.[t]),s=o?`multi-semantic-release`:`semantic-release`,c={...e.env};Ct(e.dirPath,c);let l=r.existsSync(i.join(e.dirPath,`node_modules`,`.bin`,s)),u=o??`semantic-release`,d=l?[s,...a]:e.packageManagerCommand===`bun`?[`bunx`,u,...a]:[`yarn`,`dlx`,u,...a];return console.info(g.cyan(`Running: ${d.join(` `)}`)),t.dryRun?0:await sl(n,d[0],d.slice(1),{cwd:e.dirPath,env:c,stdio:`inherit`})}const Sl={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=G(e);t||(console.error(g.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${g.yellow(`#${i} Retrying: ${n.join(` `)}`)}`),r=await q(n.join(` `),t,e,{exitIfFailed:!1,onSignal:e=>{e&&process.exit(1)}}),r===0)return;process.exit(r)}},Cl={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=$e(process.argv);t.length===0&&(console.error(`Usage: wb run <script> [args...]`),process.exit(1));let n=process.cwd(),r=G(e,!0,n),i=r?.env??El(e,n),a=wl(n,t,i,r);if(e.dryRun){console.info(`Would run: ${a.join(` `)}`);return}await Ki(n,i),await ii(a,`wb run <script> [args...]`,{cwd:n,env:i})}};function wl(e,t,n,r){if(!Ot(e))return[`node`,...t];let i=t[0];if(i&&i===n.npm_lifecycle_event){let a=r?r.packageJson.scripts?.[i]:Tl(e,i);if(a!==void 0&&a===n.npm_lifecycle_script)return[...t]}return[`bun`,`run`,...t]}function Tl(e,t){for(let n=i.resolve(e);;n=i.dirname(n)){let e=i.join(n,`package.json`);if(r.existsSync(e))try{return JSON.parse(r.readFileSync(e,`utf8`)).scripts?.[t]}catch{return}if(i.dirname(n)===n)return}}function El(e,t){let[n]=Tn(e,t);return n.WB_ENV||=Se(e),Dl(e,n),n}function Dl(e,t){let n=/* @__PURE__ */ 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 Ol={command:`setup`,describe:`Setup development environment. Environment variables are not loaded.`,builder:{},async handler(e){await kl(e)}};async function kl(e,t){let n=await K(e,!1,t);n||(console.error(g.red(`No project found.`)),process.exit(1));for(let t of ls(`setup`,n.descendants)){let r=await A.readdir(t.dirPath,{withFileTypes:!0});if(t===n.root&&(S.platform()===`darwin`&&await nr(`brew install ${[`pstree`].join(` `)}`,t,e),r.some(e=>e.isFile()&&(e.name===`mise.toml`||e.name.includes(`-version`)))&&await q(`mise install`,t,e,{exitIfFailed:!1})),r.some(e=>e.isFile()&&e.name===`pyproject.toml`)){await nr(`poetry config virtualenvs.in-project true`,t,e);let n=``;try{n=l.execSync(`mise which python`,{cwd:t.dirPath,stdio:[`ignore`,`pipe`,`ignore`]}).toString().trim()}catch{}n&&await nr(`poetry env use ${W(n)}`,t,e),await Yn.promiseAll(),await q(`poetry run pip install --upgrade pip`,t,e),await q(`poetry install --ansi`,t,e)}(t===n.root||!n.root.packageJson.scripts?.[`gen-code`])&&t.packageJson.scripts?.[`gen-code`]&&await q(`${t.packageManagerRunCommand} gen-code`,t,e)}let r=n.descendants.find(e=>e.packageJson.devDependencies?.playwright);r&&await q(`${r.packageManagerRunCommand} playwright install --with-deps`,r,e)}var $=class extends Error{exitCode;constructor(e){super(`Package command exited with code ${e}.`),this.exitCode=e}};async function Al(e,t,n,r={}){if(jl(e,t.dirPath),n.dryRun)return 0;let i=(await L(e,void 0,{cwd:t.dirPath,env:sr(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(g.red(g.bold(`Failed (exit code ${i}):`),e)),new $(i);return i}function jl(e,t){console.info(`
|
|
108
|
-
`+g.cyan(g.bold(`Command:`),e)+g.gray(` at ${t}`))}const Ml={files:{type:`string`,array:!0,default:[],describe:`Slidev deck files to check`}},Nl={fix:{type:`boolean`,default:!1,describe:`Apply fixes suggested by slidev-check`}},Pl={command:`slidev-check [files..]`,describe:`Check selected Slidev decks, or all *.slidev.md decks when no files are given`,builder:e=>e.options(Nl).positional(`files`,Ml.files),async handler(e){let t=G(e,!1);if(!t){console.error(g.red(`No project found.`)),process.exitCode=1;return}let n=[...e.files,...e._.slice(1)],r=n.length>0?n.map(e=>i.resolve(String(e))):Fl(t);if(r.length===0){console.info(`No Slidev decks found.`);return}process.exitCode=await Il(t,r,e)}};function Fl(e){return a.globSync(`**/*.slidev.md`,{dot:!0,cwd:e.dirPath,ignore:Pe}).toSorted((e,t)=>e.localeCompare(t))}async function Il(e,t,n){for(let r of t){if(n.dryRun)console.info(`Textlint: ${r} (dry run)`);else{let{lintSlidevText:t}=await import(`./slidevTextlint-
|
|
108
|
+
`+g.cyan(g.bold(`Command:`),e)+g.gray(` at ${t}`))}const Ml={files:{type:`string`,array:!0,default:[],describe:`Slidev deck files to check`}},Nl={fix:{type:`boolean`,default:!1,describe:`Apply fixes suggested by slidev-check`}},Pl={command:`slidev-check [files..]`,describe:`Check selected Slidev decks, or all *.slidev.md decks when no files are given`,builder:e=>e.options(Nl).positional(`files`,Ml.files),async handler(e){let t=G(e,!1);if(!t){console.error(g.red(`No project found.`)),process.exitCode=1;return}let n=[...e.files,...e._.slice(1)],r=n.length>0?n.map(e=>i.resolve(String(e))):Fl(t);if(r.length===0){console.info(`No Slidev decks found.`);return}process.exitCode=await Il(t,r,e)}};function Fl(e){return a.globSync(`**/*.slidev.md`,{dot:!0,cwd:e.dirPath,ignore:Pe}).toSorted((e,t)=>e.localeCompare(t))}async function Il(e,t,n){for(let r of t){if(n.dryRun)console.info(`Textlint: ${r} (dry run)`);else{let{lintSlidevText:t}=await import(`./slidevTextlint-BWfKLtiS.js`),n=await t(i.resolve(e.dirPath,r),e.rootDirPath);if(n!==0)return n}let t=W(r),a=await Al(`${e.packageManagerCommand} slidev-check ${n.fix?`--fix `:``}${t}`,e,n,{allowFailure:!0});if(a!==0)return a}return 0}const Ll={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 Rl(e){e.normalizedArgsText=[...e.args??[],...e._?.slice(1)??[],...e[`--`]??[]].map(e=>W(String(e))).join(` `),e.normalizedDockerOptionsText=(e.dockerOptions??[]).map(e=>W(String(e))).join(` `)}function zl(e){return e.silent?` > /dev/null`:``}const Bl=new class{buildImage(e,t){let n=e.dockerPackageJson.scripts?.[`docker/build/prepare`]?`YARN run docker/build/prepare && `:``,r=e.env.FNOX_AGE_KEY?`
|
|
109
109
|
--secret id=fnox_age_key,env=FNOX_AGE_KEY`:``;return`cd ${i.dirname(e.findFile(`Dockerfile`))}
|
|
110
110
|
&& ${n}YARN wb optimizeForDockerBuild --outside
|
|
111
111
|
&& YARN wb retry -- docker build -t ${e.dockerImageName}
|