ultracite 6.4.0 → 6.4.1
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 +31 -31
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var
|
|
2
|
+
var ie=Object.defineProperty;var lt=Object.getOwnPropertyDescriptor;var dt=Object.getOwnPropertyNames;var ft=Object.prototype.hasOwnProperty;var re=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),Pe=e=>t=>{var n=e[t];if(n)return n();throw new Error("Module not found in bundle: "+t)};var U=(e,t)=>()=>(e&&(t=e(e=0)),t);var ae=(e,t)=>{for(var n in t)ie(e,n,{get:t[n],enumerable:!0})},mt=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of dt(t))!ft.call(e,o)&&o!==n&&ie(e,o,{get:()=>t[o],enumerable:!(s=lt(t,o))||s.enumerable});return e};var ce=e=>mt(ie({},"__esModule",{value:!0}),e);import{access as xt,readFile as $e,writeFile as vt}from"fs/promises";import{parse as Ct}from"jsonc-parser";var f,C,H,v,jt,Pt,z,h=U(()=>{"use strict";f=async e=>{try{return await xt(e),!0}catch{return!1}},C=async()=>{if(await f("pnpm-workspace.yaml"))return!0;try{let e=Ct(await $e("package.json","utf-8"));return e?!!e.workspaces||!!e.workspace:!1}catch{return!1}},H=`
|
|
3
3
|
888 888 888 88888888888 8888888b. d8888 .d8888b. 8888888 88888888888 8888888888
|
|
4
4
|
888 888 888 888 888 Y88b d88888 d88P Y88b 888 888 888
|
|
5
5
|
888 888 888 888 888 888 d88P888 888 888 888 888 888
|
|
@@ -8,7 +8,7 @@ var re=Object.defineProperty;var at=Object.getOwnPropertyDescriptor;var ct=Objec
|
|
|
8
8
|
888 888 888 888 888 T88b d88P 888 888 888 888 888 888
|
|
9
9
|
Y88b. .d88P 888 888 888 T88b d8888888888 Y88b d88P 888 888 888
|
|
10
10
|
"Y88888P" 88888888 888 888 T88b d88P 888 "Y8888P" 8888888 888 8888888888
|
|
11
|
-
`,v=async({dependencies:
|
|
11
|
+
`,v=async({dependencies:e,devDependencies:t,scripts:n})=>{let s=await $e("package.json","utf8"),o=JSON.parse(s),i={...o};(o.devDependencies||t)&&(i.devDependencies={...o.devDependencies,...t}),(o.dependencies||e)&&(i.dependencies={...o.dependencies,...e}),(o.scripts||n)&&(i.scripts={...o.scripts,...n}),await vt("package.json",JSON.stringify(i,null,2))},jt=/[ $(){}[\]&|;<>!"'`*?#~]/,Pt=/'/g,z=e=>e.map(t=>jt.test(t)?`'${t.replace(Pt,"'\\''")}' `:t)});var Ze={};ae(Ze,{husky:()=>$});import{execSync as Pn}from"child_process";import{mkdir as Sn,readFile as $n,writeFile as Xe}from"fs/promises";import{addDevDependency as Rn,dlxCommand as ye}from"nypm";var Qe,te,$,we=U(()=>{"use strict";h();Qe=e=>`#!/bin/sh
|
|
12
12
|
# Exit on any error
|
|
13
13
|
set -e
|
|
14
14
|
|
|
@@ -31,7 +31,7 @@ git stash push --quiet --keep-index --message "pre-commit-stash" || true
|
|
|
31
31
|
STASHED=$?
|
|
32
32
|
|
|
33
33
|
# Run formatter on the staged files
|
|
34
|
-
${
|
|
34
|
+
${e}
|
|
35
35
|
FORMAT_EXIT_CODE=$?
|
|
36
36
|
|
|
37
37
|
# Restore working directory state
|
|
@@ -76,10 +76,10 @@ if [ "$STAGED_HASH" != "$NEW_STAGED_HASH" ]; then
|
|
|
76
76
|
fi
|
|
77
77
|
|
|
78
78
|
exit $FORMAT_EXIT_CODE
|
|
79
|
-
`,
|
|
80
|
-
${s}`)}}});var
|
|
79
|
+
`,te="./.husky/pre-commit",$={exists:()=>f(te),install:async e=>{await Rn("husky",{packageManager:e,workspace:await C()}),await v({scripts:{prepare:"husky"}})},init:e=>{let t=ye(e,"husky",{args:["init"]});try{Pn(t,{stdio:"inherit"})}catch{}},create:async e=>{await Sn(".husky",{recursive:!0});let t=ye(e,"ultracite",{args:["fix"],short:e==="npm"}),n=Qe(t);await Xe(te,n)},update:async e=>{let t=await $n(te,"utf-8"),n=ye(e,"ultracite",{args:["fix"],short:e==="npm"}),s=Qe(n);await Xe(te,`${t}
|
|
80
|
+
${s}`)}}});var nt={};ae(nt,{lefthook:()=>D});import{execSync as En}from"child_process";import{readFile as An,writeFile as B}from"fs/promises";import{addDevDependency as Fn,dlxCommand as et}from"nypm";var Dn,Nn,tt,R,qe,D,ke=U(()=>{"use strict";h();Dn=/(pre-commit:\s*\n\s*jobs:\s*\n)/,Nn=/(pre-commit:\s*\n)/,tt=e=>et(e,"ultracite",{args:["fix"],short:e==="npm"}),R="./lefthook.yml",qe=e=>`pre-commit:
|
|
81
81
|
jobs:
|
|
82
|
-
- run: ${
|
|
82
|
+
- run: ${tt(e)}
|
|
83
83
|
glob:
|
|
84
84
|
- "*.js"
|
|
85
85
|
- "*.jsx"
|
|
@@ -89,7 +89,7 @@ ${s}`)}}});var et={};ce(et,{lefthook:()=>D});import{execSync as $n}from"child_pr
|
|
|
89
89
|
- "*.jsonc"
|
|
90
90
|
- "*.css"
|
|
91
91
|
stage_fixed: true
|
|
92
|
-
`,D={exists:()=>f(
|
|
92
|
+
`,D={exists:()=>f(R),install:async e=>{await Fn("lefthook",{packageManager:e,workspace:await C()}),await v({scripts:{prepare:"lefthook install"}});let t=et(e,"lefthook",{args:["install"],short:e==="npm"});En(t,{stdio:"inherit"})},create:async e=>{let t=qe(e);await B(R,t)},update:async e=>{let t=await An(R,"utf-8"),n=tt(e),s=qe(e);if(t.includes(n))return;if(t.startsWith("# EXAMPLE USAGE:")){await B(R,s);return}if(t.includes("pre-commit:"))if(t.includes("jobs:")){let i=` - run: ${n}
|
|
93
93
|
glob:
|
|
94
94
|
- "*.js"
|
|
95
95
|
- "*.jsx"
|
|
@@ -98,8 +98,8 @@ ${s}`)}}});var et={};ce(et,{lefthook:()=>D});import{execSync as $n}from"child_pr
|
|
|
98
98
|
- "*.json"
|
|
99
99
|
- "*.jsonc"
|
|
100
100
|
- "*.css"
|
|
101
|
-
stage_fixed: true`,
|
|
102
|
-
`);await
|
|
101
|
+
stage_fixed: true`,a=t.replace(Dn,`$1${i}
|
|
102
|
+
`);await B(R,a)}else{let i=` jobs:
|
|
103
103
|
- run: ${n}
|
|
104
104
|
glob:
|
|
105
105
|
- "*.js"
|
|
@@ -109,37 +109,37 @@ ${s}`)}}});var et={};ce(et,{lefthook:()=>D});import{execSync as $n}from"child_pr
|
|
|
109
109
|
- "*.json"
|
|
110
110
|
- "*.jsonc"
|
|
111
111
|
- "*.css"
|
|
112
|
-
stage_fixed: true`,
|
|
113
|
-
`);await
|
|
114
|
-
${s}`)}}});var
|
|
115
|
-
`).filter(i=>i.trim()&&!i.trim().startsWith("#")),n={},s=null,o=[];for(let i of
|
|
116
|
-
`;for(let o of s)
|
|
117
|
-
`}else
|
|
118
|
-
`;return
|
|
119
|
-
`;await
|
|
120
|
-
`;await
|
|
121
|
-
`);return{line:s.length,column:(s.at(-1)?.length??0)+1}},
|
|
122
|
-
`),{line:s,column:o}
|
|
123
|
-
${m.red("Error:")} No output received from Biome. The command may have failed silently.`,hasErrors:!0};try{let n=JSON.parse(
|
|
124
|
-
`),hasErrors:s.errors>0}}catch{return{output:`${b("Ultracite")} ${b(`v${k.version}`)} ${m.magenta(
|
|
112
|
+
stage_fixed: true`,a=t.replace(Nn,`$1${i}
|
|
113
|
+
`);await B(R,a)}else await B(R,`${t}
|
|
114
|
+
${s}`)}}});var On,be=U(()=>{On=Pe({"./husky.ts":()=>(we(),ce(Ze)),"./lefthook.ts":()=>(ke(),ce(nt)),"./lint-staged.ts":()=>(xe(),ce(st))})});var st={};ae(st,{lintStaged:()=>N});import{readFile as ne,writeFile as E}from"fs/promises";import{pathToFileURL as Mn}from"url";import L from"deepmerge";import{parse as Ce}from"jsonc-parser";import{addDevDependency as Tn,dlxCommand as Un}from"nypm";var P,ot,In,Jn,_n,Bn,Ln,Wn,Hn,zn,Gn,ve,Vn,N,xe=U(()=>{"use strict";h();be();P=e=>({"*.{js,jsx,ts,tsx,json,jsonc,css,scss,md,mdx}":[Un(e,"ultracite",{args:["fix"],short:e==="npm"})]}),ot=["./package.json","./.lintstagedrc.json","./.lintstagedrc.js","./.lintstagedrc.cjs","./.lintstagedrc.mjs","./lint-staged.config.js","./lint-staged.config.cjs","./lint-staged.config.mjs","./.lintstagedrc.yaml","./.lintstagedrc.yml","./.lintstagedrc"],In=(e,t,n,s)=>{let o=e.trim();if(o.includes(":")&&!o.startsWith("-")){n&&s.length>0&&(t[n]=s);let[i,...a]=o.split(":"),r=a.join(":").trim(),c=i.trim().replace(/['"]/g,"");return r&&r!==""?(r.startsWith("[")&&r.endsWith("]")?t[c]=r.slice(1,-1).split(",").map(p=>p.trim().replace(/['"]/g,"")):t[c]=r.replace(/['"]/g,""),{newCurrentKey:null,newCurrentArray:[]}):{newCurrentKey:c,newCurrentArray:[]}}if(o.startsWith("-")&&n){let i=[...s,o.slice(1).trim().replace(/['"]/g,"")];return{newCurrentKey:n,newCurrentArray:i}}return{newCurrentKey:n,newCurrentArray:s}},Jn=e=>{let t=e.split(`
|
|
115
|
+
`).filter(i=>i.trim()&&!i.trim().startsWith("#")),n={},s=null,o=[];for(let i of t){let a=In(i,n,s,o);s=a.newCurrentKey,o=a.newCurrentArray}return s&&o.length>0&&(n[s]=o),n},_n=e=>{let t="";for(let[n,s]of Object.entries(e))if(Array.isArray(s)){t+=`${n}:
|
|
116
|
+
`;for(let o of s)t+=` - '${o}'
|
|
117
|
+
`}else t+=`${n}: '${s}'
|
|
118
|
+
`;return t},Bn=async()=>{try{let e=Ce(await ne("./package.json","utf-8"));return e?e.type==="module":!1}catch{return!1}},Ln=async e=>{let t=Ce(await ne("./package.json","utf-8"));t&&(t["lint-staged"]?t["lint-staged"]=L(t["lint-staged"],P(e)):t["lint-staged"]=P(e),await E("./package.json",JSON.stringify(t,null,2)))},Wn=async(e,t)=>{let n=await ne(e,"utf-8"),s=Ce(n);if(!s)return;let o=L(s,P(t));await E(e,JSON.stringify(o,null,2))},Hn=async(e,t)=>{let n=await ne(e,"utf-8"),s=Jn(n);if(!s)return;let o=L(s,P(t));await E(e,_n(o))},zn=async(e,t)=>{let o=(await import(Mn(e).href)).default||{},i=L(o,P(t)),a=`export default ${JSON.stringify(i,null,2)};
|
|
119
|
+
`;await E(e,a)},Gn=async(e,t)=>{delete re.cache[re.resolve(`./${e}`)];let n=On(`./${e}`),s=L(n,P(t)),o=`module.exports = ${JSON.stringify(s,null,2)};
|
|
120
|
+
`;await E(e,o)},ve=async e=>{await E(".lintstagedrc.json",JSON.stringify(P(e),null,2))},Vn=async(e,t)=>{if(e==="./package.json"){await Ln(t);return}if(e.endsWith(".json")||e==="./.lintstagedrc"){await Wn(e,t);return}if(e.endsWith(".yaml")||e.endsWith(".yml")){await Hn(e,t);return}let n=await Bn();if(e.endsWith(".mjs")||e.endsWith(".js")&&n){try{await zn(e,t)}catch{await ve(t)}return}if(e.endsWith(".cjs")||e.endsWith(".js")&&!n)try{await Gn(e,t)}catch{await ve(t)}},N={exists:async()=>{for(let e of ot)if(await f(e))return!0;return!1},install:async e=>{await Tn("lint-staged",{packageManager:e,workspace:await C()})},create:async e=>{await E(".lintstagedrc.json",JSON.stringify(P(e),null,2))},update:async e=>{let t=null;for(let n of ot)if(await f(n)){t=n;break}if(!t){await ve(e);return}await Vn(t,e)}}});import{initTRPC as ys}from"@trpc/server";import{createCli as ws}from"trpc-cli";import l from"zod";var k={name:"ultracite",description:"The AI-ready formatter that helps you write and generate code faster.",version:"6.4.1",type:"module",bin:{ultracite:"dist/index.js"},files:["config","dist","README.md"],scripts:{build:"tsup",test:"bun test","test:coverage":"bun test --coverage"},exports:{"./*":"./config/*/biome.jsonc"},author:"Hayden Bleasel <hello@haydenbleasel.com>",bugs:{url:"https://github.com/haydenbleasel/ultracite/issues"},homepage:"https://www.ultracite.ai/",keywords:["ultracite","biome","linter","formatter","fixer"],license:"MIT",publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},repository:{type:"git",url:"git+https://github.com/haydenbleasel/ultracite.git"},devDependencies:{"@biomejs/biome":"2.3.8","@types/node":"^25.0.0",tsup:"^8.5.1",turbo:"^2.6.3"},dependencies:{"@clack/prompts":"^0.11.0","@trpc/server":"^11.7.2",deepmerge:"^4.3.1",glob:"^13.0.0","jsonc-parser":"^3.3.1",nypm:"^0.6.2",picocolors:"^1.1.1","trpc-cli":"^0.12.1",zod:"^4.1.13"},packageManager:"bun@1.3.4"};import{spawnSync as St}from"child_process";import $t from"process";import{detectPackageManager as Rt,dlxCommand as Et}from"nypm";import m from"picocolors";var b=e=>`\x1B[38;5;208m${e}\x1B[39m`,Se=(e,t)=>{let s=e.slice(0,t[0]).split(`
|
|
121
|
+
`);return{line:s.length,column:(s.at(-1)?.length??0)+1}},ut=(e,t)=>{let n=e.split(`
|
|
122
|
+
`),{line:s,column:o}=Se(e,t),i=[],a=Math.max(1,s-1),r=Math.min(n.length,s+2);for(let c=a;c<=r;c++){let p=String(c).padStart(5," "),u=n[c-1]||"";if(c===s){i.push(`${b(">")}${m.dim(p)} ${m.gray("\u2502")} ${u}`);let x=" ".repeat(o-1),y=Math.min(t[1]-t[0],u.length-o+1),d="^".repeat(Math.max(1,y));i.push(`${m.dim(" ")} ${m.gray("\u2502")} ${x}${b(d)}`)}else i.push(` ${m.dim(p)} ${m.gray("\u2502")} ${u}`)}return i},gt=e=>{let t=e.secs*1e3+e.nanos/1e6;return t<1e3?`${Math.round(t)}ms`:`${(t/1e3).toFixed(2)}s`},ht=m.dim("\u2500".repeat(60)),yt=e=>["",`${b("Ultracite")} ${b(`v${k.version}`)} ${e}`],wt=(e,t)=>{let n=[],s=e.changed+e.unchanged,o=e.errors+e.warnings,i=gt(e.duration);if(o>0){let r=o!==1?"errors":"error";n.push(`${m.dim("Found")} ${o} ${r}${m.dim(".")}`)}let a=s!==1?"files":"file";if(n.push(`${m.green("\u2713")} ${m.dim("Finished in")} ${i} ${m.dim("on")} ${s} ${a}${m.dim(".")}`),t==="fix"&&e.changed>0){let r=e.changed!==1?"files":"file";n.push(`${m.dim("Fixed")} ${e.changed} ${r}${m.dim(".")}`)}return n},kt=e=>{let t=[],{location:n,category:s,description:o,advices:i}=e,a=n.path.file,r=a;if(n.span&&n.sourceCode){let{line:c,column:p}=Se(n.sourceCode,n.span);r=`${a}:${c}:${p}`}if(t.push(`${b(r)} ${m.dim(s)}`),t.push(m.dim(o)),n.span&&n.sourceCode){t.push("");let c=ut(n.sourceCode,n.span);for(let p of c)t.push(` ${p}`)}for(let c of i.advices)if(c.log){let[p,u]=c.log,x=b(p==="info"?"i":"!"),y=m.dim(u.map(d=>d.content).join(""));t.push(""),t.push(` ${x} ${y}`)}return t.push(""),t.push(`${ht}`),t.push(""),t},bt=(e,t)=>{let n=t==="fix"?e.filter(i=>!i.tags.includes("fixable")):e;if(n.length===0)return[];let s=[""],o=t==="fix"?"Here are the issues we couldn't fix automatically:":"Issues found:";s.push(`${m.yellow(o)}`),s.push("");for(let i of n)s.push(...kt(i));return s},W=(e,t)=>{if(!e.trim())return{output:`${b("Ultracite")} ${b(`v${k.version}`)} ${m.magenta(t)}
|
|
123
|
+
${m.red("Error:")} No output received from Biome. The command may have failed silently.`,hasErrors:!0};try{let n=JSON.parse(e),{summary:s,diagnostics:o}=n;return{output:[...yt(t),...wt(s,t),...bt(o,t)].join(`
|
|
124
|
+
`),hasErrors:s.errors>0}}catch{return{output:`${b("Ultracite")} ${b(`v${k.version}`)} ${m.magenta(t)}
|
|
125
125
|
${m.red("Error:")} Failed to parse Biome output.
|
|
126
126
|
|
|
127
127
|
Raw output:
|
|
128
|
-
${
|
|
128
|
+
${e}`,hasErrors:!0}}};h();var le=async e=>{let t=e?.[0]||[],n=e?.[1]["diagnostic-level"],s=["check","--no-errors-on-unmatched","--reporter=json"];n&&s.push(`--diagnostic-level=${n}`),t.length>0?s.push(...z(t)):s.push("./");let i=(await Rt($t.cwd()))?.name||"npm",a=Et(i,"@biomejs/biome",{args:s,short:i==="npm"}),r=St(a,{stdio:"pipe",shell:!0,maxBuffer:100*1024*1024});if(r.error)throw new Error(`Failed to run Ultracite: ${r.error.message}`);let c=r.stdout?.toString()||"",p=r.stderr?.toString()||"",u=c.trim().startsWith("{")?c:p,{output:x,hasErrors:y}=W(u,"check");return console.log(x),{hasErrors:y}};import{spawnSync as Ht}from"child_process";import{existsSync as I}from"fs";import{readFile as Oe}from"fs/promises";import{join as J}from"path";import S from"process";import{intro as zt,log as Y,outro as me,spinner as Gt}from"@clack/prompts";import{parse as Vt}from"jsonc-parser";import{detectPackageManager as Me,dlxCommand as Te}from"nypm";h();import{readFile as Re,unlink as At,writeFile as Ft}from"fs/promises";import{parse as Ee}from"jsonc-parser";import{removeDependency as Dt}from"nypm";var G=[".eslintrc",".eslintrc.js",".eslintrc.json",".eslintrc.yml",".eslintrc.yaml",".eslintrc.config.js","eslint.config.js","eslint.config.mjs","eslint.config.cjs",".eslintignore"],Ae=async()=>{try{let e=await Re("package.json","utf-8"),t=Ee(e);if(!t||typeof t!="object")return[];let n=t.dependencies||{},s=t.devDependencies||{},o={...n,...s};return Object.keys(o).filter(i=>i.includes("eslint"))}catch{return[]}},Nt=async(e,t)=>{if(t.length!==0)try{for(let n of t)await Dt(n,{packageManager:e})}catch(n){console.warn(n)}},Ot=async()=>{let e=[];for(let t of G)if(await f(t))try{await At(t),e.push(t)}catch(n){console.warn(n)}return e},Mt=async()=>{let e="./.vscode/settings.json";if(!await f(e))return!1;try{let t=await Re(e,"utf-8"),n=Ee(t);if(!n||typeof n!="object")return!1;let s=!1,o={...n},i=["eslint.enable","eslint.format.enable","eslint.validate","eslint.workingDirectories","eslint.codeAction.showDocumentation","eslint.run","eslint.autoFixOnSave","eslint.quiet","eslint.packageManager","eslint.options","eslint.trace.server"];for(let a of i)a in o&&(delete o[a],s=!0);if("editor.codeActionsOnSave"in o){let a=o["editor.codeActionsOnSave"];if(a&&typeof a=="object"){let r=["source.fixAll.eslint","source.organizeImports.eslint"];for(let c of r)c in a&&(delete a[c],s=!0);Object.keys(a).length===0&&(o["editor.codeActionsOnSave"]=void 0)}}return s?(await Ft(e,JSON.stringify(o,null,2)),!0):!1}catch(t){return console.warn(t),!1}},Tt=async()=>{if((await Ae()).length>0)return!0;for(let t of G)if(await f(t))return!0;return!1},de={hasEsLint:Tt,remove:async e=>{let t=await Ae();await Nt(e,t);let n=await Ot(),s=await Mt();return{packagesRemoved:t,filesRemoved:n,vsCodeCleaned:s}}};h();import{readFile as Fe,unlink as Ut,writeFile as It}from"fs/promises";import{parse as De}from"jsonc-parser";import{removeDependency as Jt}from"nypm";var V=[".prettierrc",".prettierrc.js",".prettierrc.json",".prettierrc.yml",".prettierrc.yaml",".prettierrc.config.js","prettier.config.js","prettier.config.mjs",".prettierignore"],Ne=async()=>{try{let e=await Fe("package.json","utf-8"),t=De(e);if(!t||typeof t!="object")return[];let n=t.dependencies||{},s=t.devDependencies||{},o={...n,...s};return Object.keys(o).filter(i=>i.includes("prettier"))}catch{return[]}},_t=async(e,t)=>{if(t.length!==0)try{for(let n of t)await Jt(n,{packageManager:e})}catch(n){console.warn(n)}},Bt=async()=>{let e=[];for(let t of V)if(await f(t))try{await Ut(t),e.push(t)}catch(n){console.warn(n)}return e},Lt=async()=>{let e="./.vscode/settings.json";if(!await f(e))return!1;try{let t=await Fe(e,"utf-8"),n=De(t);if(!n||typeof n!="object")return!1;let s=!1,o={...n},i=["editor.defaultFormatter","prettier.enable","prettier.requireConfig","prettier.configPath","prettier.printWidth","prettier.tabWidth","prettier.useTabs","prettier.semi","prettier.singleQuote","prettier.quoteProps","prettier.trailingComma","prettier.bracketSpacing","prettier.arrowParens","prettier.endOfLine"];for(let r of i)r in o&&(r==="editor.defaultFormatter"&&o[r]==="esbenp.prettier-vscode"||r!=="editor.defaultFormatter")&&(delete o[r],s=!0);let a=Object.keys(o).filter(r=>r.startsWith("[")&&r.includes("javascript"));for(let r of a){let c=o[r];c&&typeof c=="object"&&"editor.defaultFormatter"in c&&c["editor.defaultFormatter"]==="esbenp.prettier-vscode"&&(delete c["editor.defaultFormatter"],s=!0,Object.keys(c).length===0&&delete o[r])}return s?(await It(e,JSON.stringify(o,null,2)),!0):!1}catch(t){return console.warn(t),!1}},Wt=async()=>{if((await Ne()).length>0)return!0;for(let t of V)if(await f(t))return!0;return!1},fe={hasPrettier:Wt,remove:async e=>{let t=await Ne();await _t(e,t);let n=await Bt(),s=await Lt();return{packagesRemoved:t,filesRemoved:n,vsCodeCleaned:s}}};h();var Yt=async()=>{let t=(await Me(S.cwd()))?.name||"npm",n=Te(t,"@biomejs/biome",{args:["--version"],short:t==="npm"}),s=Ht(n,{shell:!0,encoding:"utf-8"});return s.status===0&&s.stdout?{name:"Biome installation",status:"pass",message:`Biome is installed (${s.stdout.trim()})`}:{name:"Biome installation",status:"fail",message:"Biome is not installed or not accessible"}},Kt=async()=>{let e=J(S.cwd(),"biome.json"),t=J(S.cwd(),"biome.jsonc"),n=null;if(I(e)?n=e:I(t)&&(n=t),!n)return{name:"Biome configuration",status:"fail",message:"No biome.json or biome.jsonc file found"};try{let s=await Oe(n,"utf-8"),o=Vt(s);return Array.isArray(o?.extends)&&o.extends.includes("ultracite/core")?{name:"Biome configuration",status:"pass",message:"biome.json(c) extends ultracite/core"}:{name:"Biome configuration",status:"warn",message:"biome.json(c) exists but doesn't extend ultracite/core"}}catch{return{name:"Biome configuration",status:"fail",message:"Could not parse biome.json(c) file"}}},Xt=async()=>{let e=J(S.cwd(),"package.json");if(!I(e))return{name:"Ultracite dependency",status:"warn",message:"No package.json found"};try{let t=JSON.parse(await Oe(e,"utf-8")),n=t.dependencies?.ultracite||t.devDependencies?.ultracite||t.peerDependencies?.ultracite;return n?{name:"Ultracite dependency",status:"pass",message:`Ultracite is in package.json (${n})`}:{name:"Ultracite dependency",status:"warn",message:"Ultracite not found in package.json dependencies"}}catch{return{name:"Ultracite dependency",status:"warn",message:"Could not parse package.json"}}},Qt=()=>{let e=V.some(n=>I(J(S.cwd(),n))),t=G.some(n=>I(J(S.cwd(),n)));if(e||t){let n=[];return e&&n.push("Prettier"),t&&n.push("ESLint"),{name:"Conflicting tools",status:"warn",message:`Found potentially conflicting tools: ${n.join(", ")}`}}return{name:"Conflicting tools",status:"pass",message:"No conflicting formatting/linting tools found"}},K=async(e,t)=>{let n=Gt();n.start(`Checking ${t}...`);let s=await e();return s.status==="pass"||s.status,n.stop(s.message),s},Ue=async()=>{zt(H);let t=(await Me(S.cwd()))?.name||"npm",n=Te(t,"ultracite",{args:["init"],short:t==="npm"}),s=[];s.push(await K(Yt,"Biome installation")),s.push(await K(Kt,"Biome configuration")),s.push(await K(Xt,"Ultracite dependency")),s.push(await K(Qt,"conflicting tools"));let o=s.filter(r=>r.status==="pass").length,i=s.filter(r=>r.status==="fail").length,a=s.filter(r=>r.status==="warn").length;if(Y.info(`Summary: ${o} passed, ${a} warnings, ${i} failed`),i>0)throw Y.error(`Some checks failed. Run '${n}' to fix issues.`),me("Doctor complete"),new Error("Doctor checks failed");if(a>0){Y.warn(`Some optional improvements available. Run '${n}' to configure.`),me("Doctor complete");return}Y.success("Everything looks good!"),me("Doctor complete")};import{spawnSync as Zt}from"child_process";import qt from"process";import{detectPackageManager as en,dlxCommand as tn}from"nypm";h();var pe=async(e,t={})=>{let n=["check","--write","--no-errors-on-unmatched","--reporter=json"];t.unsafe&&n.push("--unsafe"),e.length>0?n.push(...z(e)):n.push("./");let o=(await en(qt.cwd()))?.name||"npm",i=tn(o,"@biomejs/biome",{args:n,short:o==="npm"}),a=Zt(i,{stdio:"pipe",shell:!0,maxBuffer:100*1024*1024});if(a.error)throw new Error(`Failed to run Ultracite: ${a.error.message}`);let r=a.stdout?.toString()||"",c=a.stderr?.toString()||"",p=r.trim().startsWith("{")?r:c,{output:u,hasErrors:x}=W(p,"fix");return console.log(u),{hasErrors:x}};import{packageManagers as nn}from"nypm";var j={packageManagers:nn.map(e=>e.name),editorConfigs:["vscode","zed"],agents:["vscode-copilot","cursor","windsurf","zed","claude","codex","kiro","cline","amp","aider","firebase-studio","open-hands","gemini-cli","junie","augmentcode","kilo-code","goose","roo-code","warp","droid"],integrations:["husky","lefthook","lint-staged"],hooks:["cursor","claude"],frameworks:["react","next","solid","vue","svelte","qwik","remix","angular","astro"],migrations:["eslint","prettier"]};import ts from"process";import{cancel as O,intro as ns,isCancel as M,log as se,multiselect as T,spinner as w}from"@clack/prompts";import{addDevDependency as ss,detectPackageManager as os}from"nypm";import{mkdir as sn,readFile as on,writeFile as X}from"fs/promises";import{dirname as rn}from"path";import{dlxCommand as an}from"nypm";var Ie={"vscode-copilot":{path:"./.github/copilot-instructions.md",header:`---
|
|
129
129
|
applyTo: "**/*.{ts,tsx,js,jsx}"
|
|
130
130
|
---`,appendMode:!0},cursor:{path:"./.cursor/rules/ultracite.mdc",header:`---
|
|
131
131
|
description: Ultracite Rules - AI-Ready Formatter and Linter
|
|
132
132
|
globs: "**/*.{ts,tsx,js,jsx,json,jsonc,html,vue,svelte,astro,css,yaml,yml,graphql,gql,md,mdx,grit}"
|
|
133
133
|
alwaysApply: false
|
|
134
|
-
---`},windsurf:{path:"./.windsurf/rules/ultracite.md"},zed:{path:"./.rules",appendMode:!0},claude:{path:"./.claude/CLAUDE.md",appendMode:!0},codex:{path:"./AGENTS.md",appendMode:!0},kiro:{path:"./.kiro/steering/ultracite.md"},cline:{path:"./.clinerules",appendMode:!0},amp:{path:"./AGENT.md",appendMode:!0},aider:{path:"./ultracite.md"},"firebase-studio":{path:"./.idx/airules.md",appendMode:!0},"open-hands":{path:"./.openhands/microagents/repo.md",appendMode:!0},"gemini-cli":{path:"./GEMINI.md",appendMode:!0},junie:{path:"./.junie/guidelines.md",appendMode:!0},augmentcode:{path:"./.augment/rules/ultracite.md"},"kilo-code":{path:"./.kilocode/rules/ultracite.md"},goose:{path:"./.goosehints",appendMode:!0},"roo-code":{path:"./.roo/rules/ultracite.md",appendMode:!0},warp:{path:"./WARP.md",appendMode:!0},droid:{path:"./AGENTS.md",appendMode:!0}},
|
|
134
|
+
---`},windsurf:{path:"./.windsurf/rules/ultracite.md"},zed:{path:"./.rules",appendMode:!0},claude:{path:"./.claude/CLAUDE.md",appendMode:!0},codex:{path:"./AGENTS.md",appendMode:!0},kiro:{path:"./.kiro/steering/ultracite.md"},cline:{path:"./.clinerules",appendMode:!0},amp:{path:"./AGENT.md",appendMode:!0},aider:{path:"./ultracite.md"},"firebase-studio":{path:"./.idx/airules.md",appendMode:!0},"open-hands":{path:"./.openhands/microagents/repo.md",appendMode:!0},"gemini-cli":{path:"./GEMINI.md",appendMode:!0},junie:{path:"./.junie/guidelines.md",appendMode:!0},augmentcode:{path:"./.augment/rules/ultracite.md"},"kilo-code":{path:"./.kilocode/rules/ultracite.md"},goose:{path:"./.goosehints",appendMode:!0},"roo-code":{path:"./.roo/rules/ultracite.md",appendMode:!0},warp:{path:"./WARP.md",appendMode:!0},droid:{path:"./AGENTS.md",appendMode:!0}},Je={cursor:{path:"./.cursor/hooks.json"},claude:{path:"./.claude/settings.json"}};h();var _e=e=>`# Ultracite Code Standards
|
|
135
135
|
|
|
136
136
|
This project uses **Ultracite**, a zero-config Biome preset that enforces strict code quality standards through automated formatting and linting.
|
|
137
137
|
|
|
138
138
|
## Quick Reference
|
|
139
139
|
|
|
140
|
-
- **Format code**:
|
|
141
|
-
- **Check for issues**:
|
|
142
|
-
- **Diagnose setup**:
|
|
140
|
+
- **Format code**: \`${e} ultracite fix\`
|
|
141
|
+
- **Check for issues**: \`${e} ultracite check\`
|
|
142
|
+
- **Diagnose setup**: \`${e} ultracite doctor\`
|
|
143
143
|
|
|
144
144
|
Biome (the underlying engine) provides extremely fast Rust-based linting and formatting. Most issues are automatically fixable.
|
|
145
145
|
|
|
@@ -253,9 +253,9 @@ Biome's linter will catch most issues automatically. Focus your attention on:
|
|
|
253
253
|
|
|
254
254
|
---
|
|
255
255
|
|
|
256
|
-
Most formatting and common issues are automatically fixed by Biome. Run
|
|
257
|
-
`;var
|
|
256
|
+
Most formatting and common issues are automatically fixed by Biome. Run \`${e} ultracite fix\` before committing to ensure compliance.
|
|
257
|
+
`;var Be=(e,t)=>{let n=Ie[e],s=an(t,""),o=_e(s),i=n.header?`${n.header}
|
|
258
258
|
|
|
259
|
-
${
|
|
259
|
+
${o}`:o,a=async()=>{let r=rn(n.path);if(r!=="."){let c=r.startsWith("./")?r.slice(2):r;await sn(c,{recursive:!0})}};return{exists:()=>f(n.path),create:async()=>{await a(),await X(n.path,i)},update:async()=>{if(await a(),n.appendMode){if(!await f(n.path)){await X(n.path,i);return}let r=await on(n.path,"utf-8");if(r.includes(o.trim()))return;await X(n.path,`${r}
|
|
260
260
|
|
|
261
|
-
${_}`)}else await Q(e.path,n)}}};h();import{readFile as an,writeFile as _e}from"fs/promises";import cn from"deepmerge";import{parse as ln}from"jsonc-parser";var Be={$schema:"./node_modules/@biomejs/biome/configuration_schema.json",extends:["ultracite/core"]},ge=async()=>await f("./biome.json")?"./biome.json":"./biome.jsonc",Z={exists:async()=>{let t=await ge();return f(t)},create:async t=>{let e=await ge(),n=["ultracite/core"];if(t?.frameworks&&t.frameworks.length>0)for(let o of t.frameworks)n.push(`ultracite/${o}`);let s={...Be,extends:n};return _e(e,JSON.stringify(s,null,2))},update:async t=>{let e=await ge(),n=await an(e,"utf-8"),o=ln(n)||{},r=[...o.extends&&Array.isArray(o.extends)?o.extends:[]];if(r.includes("ultracite/core")||r.push("ultracite/core"),t?.frameworks&&t.frameworks.length>0)for(let p of t.frameworks){let u=`ultracite/${p}`;r.includes(u)||r.push(u)}o.extends=r;let a={$schema:Be.$schema},c=cn(o,a);await _e(e,JSON.stringify(c,null,2))}};h();import{spawnSync as dn}from"child_process";import{mkdir as fn,readFile as mn,writeFile as Le}from"fs/promises";import pn from"deepmerge";import{parse as un}from"jsonc-parser";var he={"editor.defaultFormatter":"esbenp.prettier-vscode","[javascript]":{"editor.defaultFormatter":"biomejs.biome"},"[typescript]":{"editor.defaultFormatter":"biomejs.biome"},"[javascriptreact]":{"editor.defaultFormatter":"biomejs.biome"},"[typescriptreact]":{"editor.defaultFormatter":"biomejs.biome"},"[json]":{"editor.defaultFormatter":"biomejs.biome"},"[jsonc]":{"editor.defaultFormatter":"biomejs.biome"},"[css]":{"editor.defaultFormatter":"biomejs.biome"},"[graphql]":{"editor.defaultFormatter":"biomejs.biome"},"typescript.tsdk":"node_modules/typescript/lib","editor.formatOnSave":!0,"editor.formatOnPaste":!0,"emmet.showExpandedAbbreviation":"never","editor.codeActionsOnSave":{"source.fixAll.biome":"explicit","source.organizeImports.biome":"explicit"}};var q="./.vscode/settings.json",B={exists:()=>f(q),create:async()=>{await fn(".vscode",{recursive:!0}),await Le(q,JSON.stringify(he,null,2))},update:async()=>{let t=await mn(q,"utf-8"),n=un(t)||{},s=pn(n,he);await Le(q,JSON.stringify(s,null,2))},extension:()=>dn("code --install-extension biomejs.biome",{stdio:"inherit",shell:!0})};h();import{mkdir as gn,readFile as hn,writeFile as We}from"fs/promises";import yn from"deepmerge";import{parse as wn}from"jsonc-parser";var ye={formatter:"language_server",format_on_save:"on",languages:{JavaScript:{formatter:{language_server:{name:"biome"}},code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0}},TypeScript:{formatter:{language_server:{name:"biome"}},code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0}},TSX:{formatter:{language_server:{name:"biome"}},code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0}}},lsp:{"typescript-language-server":{settings:{typescript:{preferences:{includePackageJsonAutoImports:"on"}}}}}};var ee="./.zed/settings.json",te={exists:()=>f(ee),create:async()=>{await gn(".zed",{recursive:!0}),await We(ee,JSON.stringify(ye,null,2))},update:async()=>{let t=await hn(ee,"utf-8"),n=wn(t)||{},s=yn(n,ye);await We(ee,JSON.stringify(s,null,2))}};import{mkdir as kn,readFile as He,writeFile as F}from"fs/promises";import{dirname as bn}from"path";h();var ze=t=>({version:1,hooks:{afterFileEdit:[{command:t}]}}),Ge=t=>({hooks:{PostToolUse:[{matcher:"Edit|Write",hooks:[{type:"command",command:t}]}]}}),xn=async(t,e)=>{if(!await f(t)){await F(t,JSON.stringify(ze(e),null,2));return}let n=await He(t,"utf-8"),s=JSON.parse(n);s.hooks.afterFileEdit.some(i=>i.command.includes("ultracite"))||(s.hooks.afterFileEdit.push({command:e}),await F(t,JSON.stringify(s,null,2)))},vn=async(t,e)=>{if(!await f(t)){await F(t,JSON.stringify(Ge(e),null,2));return}let n=await He(t,"utf-8"),s=JSON.parse(n);s.hooks||(s.hooks={}),s.hooks.PostToolUse||(s.hooks.PostToolUse=[]),s.hooks.PostToolUse.some(i=>i.hooks?.some(r=>r.command.includes("ultracite")))||(s.hooks.PostToolUse.push({matcher:"Edit|Write",hooks:[{type:"command",command:e}]}),await F(t,JSON.stringify(s,null,2)))},Ve=t=>{let e=Ie[t],n=async()=>{let s=bn(e.path);if(s!=="."){let o=s.startsWith("./")?s.slice(2):s;await kn(o,{recursive:!0})}};return{exists:()=>f(e.path),create:async()=>{await n(),t==="cursor"?await F(e.path,JSON.stringify(ze(e.command),null,2)):t==="claude"&&await F(e.path,JSON.stringify(Ge(e.command),null,2))},update:async()=>{await n(),t==="cursor"?await xn(e.path,e.command):t==="claude"&&await vn(e.path,e.command)}}};ke();be();ve();import{readFile as Gn,writeFile as Vn}from"fs/promises";import Yn from"deepmerge";import{glob as Kn}from"glob";import{parse as Xn}from"jsonc-parser";var Qn={compilerOptions:{strictNullChecks:!0}},st=async()=>{try{return await Kn("**/tsconfig*.json",{ignore:["**/node_modules/**","**/dist/**","**/build/**","**/.next/**"],absolute:!1})}catch{return[]}},Zn=async t=>{try{let e=await Gn(t,"utf-8"),s=Xn(e)||{},o=Yn(s,Qn);await Vn(t,JSON.stringify(o,null,2))}catch(e){console.warn(`Failed to update ${t}:`,e)}},Se={exists:async()=>(await st()).length>0,update:async()=>{let t=await st();if(t.length===0){console.warn("No tsconfig.json files found in the project");return}await Promise.all(t.map(e=>Zn(e)))}};h();var ot=k.devDependencies["@biomejs/biome"],it=k.version,ss=async(t,e=!0,n=!1)=>{let s=w();n||s.start("Installing dependencies...");let o=[`ultracite@${it}`,`@biomejs/biome@${ot}`];if(e)for(let i of o)await ts(i,{packageManager:t,workspace:await C(),silent:n});else await v({devDependencies:{"@biomejs/biome":ot,ultracite:it}});n||s.stop("Dependencies installed.")},os=async(t=!1)=>{let e=w();if(t||e.start("Checking for tsconfig.json files..."),await Se.exists()){t||e.message("Found tsconfig.json files, updating with strictNullChecks..."),await Se.update(),t||e.stop("tsconfig.json files updated.");return}t||e.stop("No tsconfig.json files found, skipping.")},is=async(t=!1)=>{let e=w();if(t||e.start("Checking for .vscode/settings.json..."),await B.exists()){t||e.message("settings.json found, updating..."),await B.update(),t||e.stop("settings.json updated.");return}t||e.message("settings.json not found, creating..."),await B.create(),t||(e.message("settings.json created."),e.message("Installing Biome extension..."));try{B.extension(),t||e.stop("settings.json created.")}catch(n){t||e.stop(`Failed to install Biome extension (${n}), but continuing...`)}},rs=async(t=!1)=>{let e=w();if(t||e.start("Checking for .zed/settings.json..."),await te.exists()){t||e.message("settings.json found, updating..."),await te.update(),t||e.stop("settings.json updated.");return}t||e.message("settings.json not found, creating..."),await te.create(),t||e.message("settings.json created. Install the Biome extension: https://biomejs.dev/reference/zed/")},as=async(t,e=!1)=>{let n=w();if(e||n.start("Checking for Biome configuration..."),await Z.exists()){e||n.message("Biome configuration found, updating..."),await Z.update({frameworks:t}),e||n.stop("Biome configuration updated.");return}e||n.message("Biome configuration not found, creating..."),await Z.create({frameworks:t}),e||n.stop("Biome configuration created.")},cs=async(t,e=!0,n=!1)=>{let s=w();if(n||(s.start("Initializing pre-commit hooks..."),s.message("Installing Husky...")),e?await P.install(t):await v({devDependencies:{husky:"latest"},scripts:{prepare:"husky"}}),n||s.message("Initializing Husky..."),P.init(t),await P.exists()){n||s.message("Pre-commit hook found, updating..."),await P.update(t),n||s.stop("Pre-commit hook updated.");return}n||s.message("Pre-commit hook not found, creating..."),await P.create(t),n||s.stop("Pre-commit hook created.")},ls=async(t,e=!0,n=!1)=>{let s=w();if(n||(s.start("Initializing lefthook..."),s.message("Installing lefthook...")),e?await D.install(t):await v({devDependencies:{lefthook:"latest"}}),await D.exists()){n||s.message("lefthook.yml found, updating..."),await D.update(t),n||s.stop("lefthook.yml updated.");return}n||s.message("lefthook.yml not found, creating..."),await D.create(t),n||s.stop("lefthook.yml created.")},ds=async(t,e=!0,n=!1)=>{let s=w();if(n||(s.start("Initializing lint-staged..."),s.message("Installing lint-staged...")),e?await O.install(t):await v({devDependencies:{"lint-staged":"latest"}}),await O.exists()){n||s.message("lint-staged found, updating..."),await O.update(t),n||s.stop("lint-staged updated.");return}n||s.message("lint-staged not found, creating..."),await O.create(t),n||s.stop("lint-staged created.")},fs=async(t,e,n=!1)=>{let s=w();n||s.start(`Checking for ${e}...`);let o=Je(t);if(await o.exists()){n||s.message(`${e} found, updating...`),await o.update(),n||s.stop(`${e} updated.`);return}n||s.message(`${e} not found, creating...`),await o.create(),n||s.stop(`${e} created.`)},ms=async(t,e,n=!1)=>{let s=w();n||s.start(`Checking for ${e} hooks...`);let o=Ve(t);if(await o.exists()){n||s.message(`${e} hooks found, updating...`),await o.update(),n||s.stop(`${e} hooks updated.`);return}n||s.message(`${e} hooks not found, creating...`),await o.create(),n||s.stop(`${e} hooks created.`)},ps=async(t,e=!1)=>{let n=w();e||n.start("Removing Prettier dependencies and configuration...");try{let s=await me.remove(t);e||(s.packagesRemoved.length>0&&n.message(`Removed Prettier packages: ${s.packagesRemoved.join(", ")}`),s.filesRemoved.length>0&&n.message(`Removed config files: ${s.filesRemoved.join(", ")}`),s.vsCodeCleaned&&n.message("Cleaned VS Code settings"),n.stop("Prettier removed successfully."))}catch{e||n.stop("Failed to remove Prettier completely, but continuing...")}},us=async(t,e=!1)=>{let n=w();e||n.start("Removing ESLint dependencies and configuration...");try{let s=await fe.remove(t);e||(s.packagesRemoved.length>0&&n.message(`Removed ESLint packages: ${s.packagesRemoved.join(", ")}`),s.filesRemoved.length>0&&n.message(`Removed config files: ${s.filesRemoved.join(", ")}`),s.vsCodeCleaned&&n.message("Cleaned VS Code settings"),n.stop("ESLint removed successfully."))}catch{e||n.stop("Failed to remove ESLint completely, but continuing...")}},rt=async t=>{let e=t??{},n=e.quiet??!1;n||es(z);try{let{pm:s}=e;if(!s){let d=await ns(qn.cwd());if(!d)throw new Error("No package manager specified or detected");if(!n&&d.warnings)for(let g of d.warnings)oe.warn(g);n||oe.info(`Detected lockfile, using ${d.name}`),s=d.name}let o=e.migrate?.includes("prettier"),i=e.migrate?.includes("eslint");if(!n&&(o===void 0||i===void 0)){let d=[];if(o===void 0&&await me.hasPrettier()&&d.push({label:"Remove Prettier (dependencies, config files, VS Code settings)",value:"prettier"}),i===void 0&&await fe.hasEsLint()&&d.push({label:"Remove ESLint (dependencies, config files, VS Code settings)",value:"eslint"}),d.length>0){let g=await T({message:"Remove existing formatters/linters (recommended for clean migration)?",options:d,required:!1});if(M(g)){N("Operation cancelled.");return}o===void 0&&(o=g.includes("prettier")),i===void 0&&(i=g.includes("eslint"))}}n&&(o===void 0&&(o=!1),i===void 0&&(i=!1));let r=e.frameworks;if(r===void 0)if(n||e.pm||e.editors||e.agents||e.hooks||e.integrations!==void 0||e.migrate!==void 0)r=[];else{let g=await T({message:"Which frameworks are you using (optional)?",options:[{label:"React",value:"react"},{label:"Next.js",value:"next"},{label:"Solid",value:"solid"},{label:"Vue",value:"vue"},{label:"Svelte",value:"svelte"},{label:"Qwik",value:"qwik"},{label:"Angular",value:"angular"},{label:"Remix / TanStack Router / React Router",value:"remix"},{label:"Astro",value:"astro"}],required:!1});if(M(g)){N("Operation cancelled.");return}r=g}let a=e.editors;if(!a)if(n)a=[];else{let d=await T({message:"Which editors do you want to configure (recommended)?",options:[{label:"VSCode / Cursor / Windsurf",value:"vscode"},{label:"Zed",value:"zed"}],required:!1});if(M(d)){N("Operation cancelled.");return}a=d}let c=e.agents,p=e.hooks,u={"vscode-copilot":"GitHub Copilot (VSCode)",cursor:"Cursor",windsurf:"Windsurf",zed:"Zed",claude:"Claude Code",codex:"OpenAI Codex / Jules / OpenCode",kiro:"Kiro IDE",cline:"Cline",amp:"AMP",aider:"Aider","firebase-studio":"Firebase Studio","open-hands":"Open Hands","gemini-cli":"Gemini CLI",junie:"Junie",augmentcode:"Augment Code","kilo-code":"Kilo Code",goose:"Codename Goose","roo-code":"Roo Code",warp:"Warp",droid:"Droid"};if(!c)if(n)c=[];else{let d=await T({message:"Which agents do you want to enable (optional)?",options:Object.entries(u).map(([g,ie])=>({value:g,label:ie})),required:!1});if(M(d)){N("Operation cancelled.");return}c=d}let x={cursor:"Cursor",claude:"Claude Code"};if(!p)if(n)p=[];else{let d=await T({message:"Which agent hooks do you want to enable (optional)?",options:Object.entries(x).map(([g,ie])=>({value:g,label:ie})),required:!1});if(M(d)){N("Operation cancelled.");return}p=d}let y=e.integrations;if(y===void 0)if(n||e.pm||e.editors||e.agents||e.hooks||e.migrate!==void 0)y=[];else{let g=await T({message:"Would you like any of the following (optional)?",options:[{label:"Husky pre-commit hook",value:"husky"},{label:"Lefthook pre-commit hook",value:"lefthook"},{label:"Lint-staged",value:"lint-staged"}],required:!1});if(M(g)){N("Operation cancelled.");return}y=g}o&&await ps(s,n),i&&await us(s,n),await ss(s,!e.skipInstall,n),await os(n),await as(r,n),a?.includes("vscode")&&await is(n),a?.includes("zed")&&await rs(n);for(let d of c??[])await fs(d,u[d],n);for(let d of p??[])await ms(d,x[d],n);y?.includes("husky")&&await cs(s,!e.skipInstall,n),y?.includes("lefthook")&&await ls(s,!e.skipInstall,n),y?.includes("lint-staged")&&await ds(s,!e.skipInstall,n),n||oe.success("Successfully initialized Ultracite configuration!")}catch(s){let o=s instanceof Error?s.message:"Unknown error";throw n||oe.error(`Failed to initialize Ultracite configuration: ${o}`),s}};var E=gs.meta().create(),ys=E.router({init:E.procedure.meta({description:"Initialize Ultracite in the current directory"}).input(l.object({pm:l.enum(j.packageManagers).optional().describe("Package manager to use"),editors:l.array(l.enum(j.editorConfigs)).optional().describe("Editors to configure"),agents:l.array(l.enum(j.agents)).optional().describe("Agents to enable"),hooks:l.array(l.enum(j.hooks)).optional().describe("Hooks to enable"),frameworks:l.array(l.enum(j.frameworks)).optional().describe("Frameworks being used"),integrations:l.array(l.enum(j.integrations)).optional().describe("Additional integrations to enable"),migrate:l.array(l.enum(j.migrations)).optional().describe("Migration tools to remove (e.g., eslint, prettier). Removes dependencies, config files, and editor settings."),skipInstall:l.boolean().default(!1).describe("Skip installing dependencies"),quiet:l.boolean().default(process.env.CI==="true"||process.env.CI==="1").describe("Suppress all interactive prompts and visual output. Automatically enabled in CI environments.")})).mutation(async({input:t})=>{await rt(t)}),check:E.procedure.meta({description:"Run Biome linter without fixing files"}).input(l.tuple([l.array(l.string()).optional().default([]).describe("specific files to lint"),l.object({"diagnostic-level":l.enum(["info","warn","error"]).optional().describe("level of diagnostics to show. In order, from the lowest to the most important: info, warn, error.")})]).optional()).query(async({input:t})=>{await de(t)}),fix:E.procedure.meta({description:"Run Biome linter and fixes files"}).input(l.tuple([l.array(l.string()).optional().default([]).describe("specific files to format"),l.object({unsafe:l.boolean().optional().describe("apply unsafe fixes")})])).mutation(async({input:t})=>{let[e,n]=t;await ue(e,{unsafe:n.unsafe})}),doctor:E.procedure.meta({description:"Verify your Ultracite setup and check for issues"}).query(async()=>{await Te()}),lint:E.procedure.meta({description:"\u26A0\uFE0F DEPRECATED: Use 'check' instead - Run Biome linter without fixing files"}).input(l.array(l.string()).optional().default([]).describe("specific files to lint")).query(async({input:t})=>{console.warn("\u26A0\uFE0F Warning: 'lint' command is deprecated. Please use 'check' instead."),await de([t,{}])}),format:E.procedure.meta({description:"\u26A0\uFE0F DEPRECATED: Use 'fix' instead - Run Biome linter and fixes files"}).input(l.tuple([l.array(l.string()).optional().default([]).describe("specific files to format"),l.object({unsafe:l.boolean().optional().describe("apply unsafe fixes")})])).mutation(async({input:t})=>{let[e,n]=t;console.warn("\u26A0\uFE0F Warning: 'format' command is deprecated. Please use 'fix' instead."),await ue(e,{unsafe:n.unsafe})})}),ws=hs({router:ys,name:k.name,version:k.version,description:k.description});process.env.TEST||ws.run();export{ys as router};
|
|
261
|
+
${o}`)}else await X(n.path,i)}}};h();import{readFile as cn,writeFile as Le}from"fs/promises";import ln from"deepmerge";import{parse as dn}from"jsonc-parser";var We={$schema:"./node_modules/@biomejs/biome/configuration_schema.json",extends:["ultracite/core"]},ue=async()=>await f("./biome.json")?"./biome.json":"./biome.jsonc",Q={exists:async()=>{let e=await ue();return f(e)},create:async e=>{let t=await ue(),n=["ultracite/core"];if(e?.frameworks&&e.frameworks.length>0)for(let o of e.frameworks)n.push(`ultracite/${o}`);let s={...We,extends:n};return Le(t,JSON.stringify(s,null,2))},update:async e=>{let t=await ue(),n=await cn(t,"utf-8"),o=dn(n)||{},a=[...o.extends&&Array.isArray(o.extends)?o.extends:[]];if(a.includes("ultracite/core")||a.push("ultracite/core"),e?.frameworks&&e.frameworks.length>0)for(let p of e.frameworks){let u=`ultracite/${p}`;a.includes(u)||a.push(u)}o.extends=a;let r={$schema:We.$schema},c=ln(o,r);await Le(t,JSON.stringify(c,null,2))}};h();import{spawnSync as fn}from"child_process";import{mkdir as mn,readFile as pn,writeFile as He}from"fs/promises";import un from"deepmerge";import{parse as gn}from"jsonc-parser";var ge={"editor.defaultFormatter":"esbenp.prettier-vscode","[javascript]":{"editor.defaultFormatter":"biomejs.biome"},"[typescript]":{"editor.defaultFormatter":"biomejs.biome"},"[javascriptreact]":{"editor.defaultFormatter":"biomejs.biome"},"[typescriptreact]":{"editor.defaultFormatter":"biomejs.biome"},"[json]":{"editor.defaultFormatter":"biomejs.biome"},"[jsonc]":{"editor.defaultFormatter":"biomejs.biome"},"[css]":{"editor.defaultFormatter":"biomejs.biome"},"[graphql]":{"editor.defaultFormatter":"biomejs.biome"},"typescript.tsdk":"node_modules/typescript/lib","editor.formatOnSave":!0,"editor.formatOnPaste":!0,"emmet.showExpandedAbbreviation":"never","editor.codeActionsOnSave":{"source.fixAll.biome":"explicit","source.organizeImports.biome":"explicit"}};var Z="./.vscode/settings.json",_={exists:()=>f(Z),create:async()=>{await mn(".vscode",{recursive:!0}),await He(Z,JSON.stringify(ge,null,2))},update:async()=>{let e=await pn(Z,"utf-8"),n=gn(e)||{},s=un(n,ge);await He(Z,JSON.stringify(s,null,2))},extension:()=>fn("code --install-extension biomejs.biome",{stdio:"inherit",shell:!0})};h();import{mkdir as hn,readFile as yn,writeFile as ze}from"fs/promises";import wn from"deepmerge";import{parse as kn}from"jsonc-parser";var he={formatter:"language_server",format_on_save:"on",languages:{JavaScript:{formatter:{language_server:{name:"biome"}},code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0}},TypeScript:{formatter:{language_server:{name:"biome"}},code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0}},TSX:{formatter:{language_server:{name:"biome"}},code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0}}},lsp:{"typescript-language-server":{settings:{typescript:{preferences:{includePackageJsonAutoImports:"on"}}}}}};var q="./.zed/settings.json",ee={exists:()=>f(q),create:async()=>{await hn(".zed",{recursive:!0}),await ze(q,JSON.stringify(he,null,2))},update:async()=>{let e=await yn(q,"utf-8"),n=kn(e)||{},s=wn(n,he);await ze(q,JSON.stringify(s,null,2))}};import{mkdir as bn,readFile as Ge,writeFile as F}from"fs/promises";import{dirname as xn}from"path";import{dlxCommand as vn}from"nypm";h();var Ve=e=>({version:1,hooks:{afterFileEdit:[{command:e}]}}),Ye=e=>({hooks:{PostToolUse:[{matcher:"Edit|Write",hooks:[{type:"command",command:e}]}]}}),Cn=async(e,t)=>{if(!await f(e)){await F(e,JSON.stringify(Ve(t),null,2));return}let n=await Ge(e,"utf-8"),s=JSON.parse(n);s.hooks.afterFileEdit.some(i=>i.command.includes("ultracite"))||(s.hooks.afterFileEdit.push({command:t}),await F(e,JSON.stringify(s,null,2)))},jn=async(e,t)=>{if(!await f(e)){await F(e,JSON.stringify(Ye(t),null,2));return}let n=await Ge(e,"utf-8"),s=JSON.parse(n);s.hooks||(s.hooks={}),s.hooks.PostToolUse||(s.hooks.PostToolUse=[]),s.hooks.PostToolUse.some(i=>i.hooks?.some(a=>a.command.includes("ultracite")))||(s.hooks.PostToolUse.push({matcher:"Edit|Write",hooks:[{type:"command",command:t}]}),await F(e,JSON.stringify(s,null,2)))},Ke=(e,t)=>{let n=Je[e],s=vn(t,"ultracite",{args:["fix"],short:t==="npm"}),o=async()=>{let i=xn(n.path);if(i!=="."){let a=i.startsWith("./")?i.slice(2):i;await bn(a,{recursive:!0})}};return{exists:()=>f(n.path),create:async()=>{await o(),e==="cursor"?await F(n.path,JSON.stringify(Ve(s),null,2)):e==="claude"&&await F(n.path,JSON.stringify(Ye(s),null,2))},update:async()=>{await o(),e==="cursor"?await Cn(n.path,s):e==="claude"&&await jn(n.path,s)}}};we();ke();xe();import{readFile as Yn,writeFile as Kn}from"fs/promises";import Xn from"deepmerge";import{glob as Qn}from"glob";import{parse as Zn}from"jsonc-parser";var qn={compilerOptions:{strictNullChecks:!0}},it=async()=>{try{return await Qn("**/tsconfig*.json",{ignore:["**/node_modules/**","**/dist/**","**/build/**","**/.next/**"],absolute:!1})}catch{return[]}},es=async e=>{try{let t=await Yn(e,"utf-8"),s=Zn(t)||{},o=Xn(s,qn);await Kn(e,JSON.stringify(o,null,2))}catch(t){console.warn(`Failed to update ${e}:`,t)}},je={exists:async()=>(await it()).length>0,update:async()=>{let e=await it();if(e.length===0){console.warn("No tsconfig.json files found in the project");return}await Promise.all(e.map(t=>es(t)))}};h();var rt=k.devDependencies["@biomejs/biome"],at=k.version,is=async(e,t=!0,n=!1)=>{let s=w();n||s.start("Installing dependencies...");let o=[`ultracite@${at}`,`@biomejs/biome@${rt}`];if(t)for(let i of o)await ss(i,{packageManager:e,workspace:await C(),silent:n});else await v({devDependencies:{"@biomejs/biome":rt,ultracite:at}});n||s.stop("Dependencies installed.")},rs=async(e=!1)=>{let t=w();if(e||t.start("Checking for tsconfig.json files..."),await je.exists()){e||t.message("Found tsconfig.json files, updating with strictNullChecks..."),await je.update(),e||t.stop("tsconfig.json files updated.");return}e||t.stop("No tsconfig.json files found, skipping.")},as=async(e=!1)=>{let t=w();if(e||t.start("Checking for .vscode/settings.json..."),await _.exists()){e||t.message("settings.json found, updating..."),await _.update(),e||t.stop("settings.json updated.");return}e||t.message("settings.json not found, creating..."),await _.create(),e||(t.message("settings.json created."),t.message("Installing Biome extension..."));try{_.extension(),e||t.stop("settings.json created.")}catch(n){e||t.stop(`Failed to install Biome extension (${n}), but continuing...`)}},cs=async(e=!1)=>{let t=w();if(e||t.start("Checking for .zed/settings.json..."),await ee.exists()){e||t.message("settings.json found, updating..."),await ee.update(),e||t.stop("settings.json updated.");return}e||t.message("settings.json not found, creating..."),await ee.create(),e||t.message("settings.json created. Install the Biome extension: https://biomejs.dev/reference/zed/")},ls=async(e,t=!1)=>{let n=w();if(t||n.start("Checking for Biome configuration..."),await Q.exists()){t||n.message("Biome configuration found, updating..."),await Q.update({frameworks:e}),t||n.stop("Biome configuration updated.");return}t||n.message("Biome configuration not found, creating..."),await Q.create({frameworks:e}),t||n.stop("Biome configuration created.")},ds=async(e,t=!0,n=!1)=>{let s=w();if(n||(s.start("Initializing pre-commit hooks..."),s.message("Installing Husky...")),t?await $.install(e):await v({devDependencies:{husky:"latest"},scripts:{prepare:"husky"}}),n||s.message("Initializing Husky..."),$.init(e),await $.exists()){n||s.message("Pre-commit hook found, updating..."),await $.update(e),n||s.stop("Pre-commit hook updated.");return}n||s.message("Pre-commit hook not found, creating..."),await $.create(e),n||s.stop("Pre-commit hook created.")},fs=async(e,t=!0,n=!1)=>{let s=w();if(n||(s.start("Initializing lefthook..."),s.message("Installing lefthook...")),t?await D.install(e):await v({devDependencies:{lefthook:"latest"}}),await D.exists()){n||s.message("lefthook.yml found, updating..."),await D.update(e),n||s.stop("lefthook.yml updated.");return}n||s.message("lefthook.yml not found, creating..."),await D.create(e),n||s.stop("lefthook.yml created.")},ms=async(e,t=!0,n=!1)=>{let s=w();if(n||(s.start("Initializing lint-staged..."),s.message("Installing lint-staged...")),t?await N.install(e):await v({devDependencies:{"lint-staged":"latest"}}),await N.exists()){n||s.message("lint-staged found, updating..."),await N.update(e),n||s.stop("lint-staged updated.");return}n||s.message("lint-staged not found, creating..."),await N.create(e),n||s.stop("lint-staged created.")},ps=async(e,t,n,s=!1)=>{let o=w();s||o.start(`Checking for ${t}...`);let i=Be(e,n);if(await i.exists()){s||o.message(`${t} found, updating...`),await i.update(),s||o.stop(`${t} updated.`);return}s||o.message(`${t} not found, creating...`),await i.create(),s||o.stop(`${t} created.`)},us=async(e,t,n,s=!1)=>{let o=w();s||o.start(`Checking for ${t} hooks...`);let i=Ke(e,n);if(await i.exists()){s||o.message(`${t} hooks found, updating...`),await i.update(),s||o.stop(`${t} hooks updated.`);return}s||o.message(`${t} hooks not found, creating...`),await i.create(),s||o.stop(`${t} hooks created.`)},gs=async(e,t=!1)=>{let n=w();t||n.start("Removing Prettier dependencies and configuration...");try{let s=await fe.remove(e);t||(s.packagesRemoved.length>0&&n.message(`Removed Prettier packages: ${s.packagesRemoved.join(", ")}`),s.filesRemoved.length>0&&n.message(`Removed config files: ${s.filesRemoved.join(", ")}`),s.vsCodeCleaned&&n.message("Cleaned VS Code settings"),n.stop("Prettier removed successfully."))}catch{t||n.stop("Failed to remove Prettier completely, but continuing...")}},hs=async(e,t=!1)=>{let n=w();t||n.start("Removing ESLint dependencies and configuration...");try{let s=await de.remove(e);t||(s.packagesRemoved.length>0&&n.message(`Removed ESLint packages: ${s.packagesRemoved.join(", ")}`),s.filesRemoved.length>0&&n.message(`Removed config files: ${s.filesRemoved.join(", ")}`),s.vsCodeCleaned&&n.message("Cleaned VS Code settings"),n.stop("ESLint removed successfully."))}catch{t||n.stop("Failed to remove ESLint completely, but continuing...")}},ct=async e=>{let t=e??{},n=t.quiet??!1;n||ns(H);try{let{pm:s}=t;if(!s){let d=await os(ts.cwd());if(!d)throw new Error("No package manager specified or detected");if(!n&&d.warnings)for(let g of d.warnings)se.warn(g);n||se.info(`Detected lockfile, using ${d.name}`),s=d.name}let o=t.migrate?.includes("prettier"),i=t.migrate?.includes("eslint");if(!n&&(o===void 0||i===void 0)){let d=[];if(o===void 0&&await fe.hasPrettier()&&d.push({label:"Remove Prettier (dependencies, config files, VS Code settings)",value:"prettier"}),i===void 0&&await de.hasEsLint()&&d.push({label:"Remove ESLint (dependencies, config files, VS Code settings)",value:"eslint"}),d.length>0){let g=await T({message:"Remove existing formatters/linters (recommended for clean migration)?",options:d,required:!1});if(M(g)){O("Operation cancelled.");return}o===void 0&&(o=g.includes("prettier")),i===void 0&&(i=g.includes("eslint"))}}n&&(o===void 0&&(o=!1),i===void 0&&(i=!1));let a=t.frameworks;if(a===void 0)if(n||t.pm||t.editors||t.agents||t.hooks||t.integrations!==void 0||t.migrate!==void 0)a=[];else{let g=await T({message:"Which frameworks are you using (optional)?",options:[{label:"React",value:"react"},{label:"Next.js",value:"next"},{label:"Solid",value:"solid"},{label:"Vue",value:"vue"},{label:"Svelte",value:"svelte"},{label:"Qwik",value:"qwik"},{label:"Angular",value:"angular"},{label:"Remix / TanStack Router / React Router",value:"remix"},{label:"Astro",value:"astro"}],required:!1});if(M(g)){O("Operation cancelled.");return}a=g}let r=t.editors;if(!r)if(n)r=[];else{let d=await T({message:"Which editors do you want to configure (recommended)?",options:[{label:"VSCode / Cursor / Windsurf",value:"vscode"},{label:"Zed",value:"zed"}],required:!1});if(M(d)){O("Operation cancelled.");return}r=d}let c=t.agents,p=t.hooks,u={"vscode-copilot":"GitHub Copilot (VSCode)",cursor:"Cursor",windsurf:"Windsurf",zed:"Zed",claude:"Claude Code",codex:"OpenAI Codex / Jules / OpenCode",kiro:"Kiro IDE",cline:"Cline",amp:"AMP",aider:"Aider","firebase-studio":"Firebase Studio","open-hands":"Open Hands","gemini-cli":"Gemini CLI",junie:"Junie",augmentcode:"Augment Code","kilo-code":"Kilo Code",goose:"Codename Goose","roo-code":"Roo Code",warp:"Warp",droid:"Droid"};if(!c)if(n)c=[];else{let d=await T({message:"Which agents do you want to enable (optional)?",options:Object.entries(u).map(([g,oe])=>({value:g,label:oe})),required:!1});if(M(d)){O("Operation cancelled.");return}c=d}let x={cursor:"Cursor",claude:"Claude Code"};if(!p)if(n)p=[];else{let d=await T({message:"Which agent hooks do you want to enable (optional)?",options:Object.entries(x).map(([g,oe])=>({value:g,label:oe})),required:!1});if(M(d)){O("Operation cancelled.");return}p=d}let y=t.integrations;if(y===void 0)if(n||t.pm||t.editors||t.agents||t.hooks||t.migrate!==void 0)y=[];else{let g=await T({message:"Would you like any of the following (optional)?",options:[{label:"Husky pre-commit hook",value:"husky"},{label:"Lefthook pre-commit hook",value:"lefthook"},{label:"Lint-staged",value:"lint-staged"}],required:!1});if(M(g)){O("Operation cancelled.");return}y=g}o&&await gs(s,n),i&&await hs(s,n),await is(s,!t.skipInstall,n),await rs(n),await ls(a,n),r?.includes("vscode")&&await as(n),r?.includes("zed")&&await cs(n);for(let d of c??[])await ps(d,u[d],s,n);for(let d of p??[])await us(d,x[d],s,n);y?.includes("husky")&&await ds(s,!t.skipInstall,n),y?.includes("lefthook")&&await fs(s,!t.skipInstall,n),y?.includes("lint-staged")&&await ms(s,!t.skipInstall,n),n||se.success("Successfully initialized Ultracite configuration!")}catch(s){let o=s instanceof Error?s.message:"Unknown error";throw n||se.error(`Failed to initialize Ultracite configuration: ${o}`),s}};var A=ys.meta().create(),ks=A.router({init:A.procedure.meta({description:"Initialize Ultracite in the current directory"}).input(l.object({pm:l.enum(j.packageManagers).optional().describe("Package manager to use"),editors:l.array(l.enum(j.editorConfigs)).optional().describe("Editors to configure"),agents:l.array(l.enum(j.agents)).optional().describe("Agents to enable"),hooks:l.array(l.enum(j.hooks)).optional().describe("Hooks to enable"),frameworks:l.array(l.enum(j.frameworks)).optional().describe("Frameworks being used"),integrations:l.array(l.enum(j.integrations)).optional().describe("Additional integrations to enable"),migrate:l.array(l.enum(j.migrations)).optional().describe("Migration tools to remove (e.g., eslint, prettier). Removes dependencies, config files, and editor settings."),skipInstall:l.boolean().default(!1).describe("Skip installing dependencies"),quiet:l.boolean().default(process.env.CI==="true"||process.env.CI==="1").describe("Suppress all interactive prompts and visual output. Automatically enabled in CI environments.")})).mutation(async({input:e})=>{await ct(e)}),check:A.procedure.meta({description:"Run Biome linter without fixing files"}).input(l.tuple([l.array(l.string()).optional().default([]).describe("specific files to lint"),l.object({"diagnostic-level":l.enum(["info","warn","error"]).optional().describe("level of diagnostics to show. In order, from the lowest to the most important: info, warn, error.")})]).optional()).query(async({input:e})=>{await le(e)}),fix:A.procedure.meta({description:"Run Biome linter and fixes files"}).input(l.tuple([l.array(l.string()).optional().default([]).describe("specific files to format"),l.object({unsafe:l.boolean().optional().describe("apply unsafe fixes")})])).mutation(async({input:e})=>{let[t,n]=e;await pe(t,{unsafe:n.unsafe})}),doctor:A.procedure.meta({description:"Verify your Ultracite setup and check for issues"}).query(async()=>{await Ue()}),lint:A.procedure.meta({description:"\u26A0\uFE0F DEPRECATED: Use 'check' instead - Run Biome linter without fixing files"}).input(l.array(l.string()).optional().default([]).describe("specific files to lint")).query(async({input:e})=>{console.warn("\u26A0\uFE0F Warning: 'lint' command is deprecated. Please use 'check' instead."),await le([e,{}])}),format:A.procedure.meta({description:"\u26A0\uFE0F DEPRECATED: Use 'fix' instead - Run Biome linter and fixes files"}).input(l.tuple([l.array(l.string()).optional().default([]).describe("specific files to format"),l.object({unsafe:l.boolean().optional().describe("apply unsafe fixes")})])).mutation(async({input:e})=>{let[t,n]=e;console.warn("\u26A0\uFE0F Warning: 'format' command is deprecated. Please use 'fix' instead."),await pe(t,{unsafe:n.unsafe})})}),bs=ws({router:ks,name:k.name,version:k.version,description:k.description});process.env.TEST||bs.run();export{ks as router};
|