@tailwindcss/cli 0.0.0-insiders.4455048 → 0.0.0-insiders.44818a6

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 CHANGED
@@ -13,10 +13,10 @@
13
13
  </p>
14
14
 
15
15
  <p align="center">
16
- <a href="https://github.com/tailwindlabs/tailwindcss/actions"><img src="https://img.shields.io/github/actions/workflow/status/tailwindlabs/tailwindcss/ci.yml?branch=next" alt="Build Status"></a>
16
+ <a href="https://github.com/tailwindlabs/tailwindcss/actions"><img src="https://img.shields.io/github/actions/workflow/status/tailwindlabs/tailwindcss/ci.yml?branch=main" alt="Build Status"></a>
17
17
  <a href="https://www.npmjs.com/package/tailwindcss"><img src="https://img.shields.io/npm/dt/tailwindcss.svg" alt="Total Downloads"></a>
18
- <a href="https://github.com/tailwindcss/tailwindcss/releases"><img src="https://img.shields.io/npm/v/tailwindcss.svg" alt="Latest Release"></a>
19
- <a href="https://github.com/tailwindcss/tailwindcss/blob/master/LICENSE"><img src="https://img.shields.io/npm/l/tailwindcss.svg" alt="License"></a>
18
+ <a href="https://github.com/tailwindlabs/tailwindcss/releases"><img src="https://img.shields.io/npm/v/tailwindcss.svg" alt="Latest Release"></a>
19
+ <a href="https://github.com/tailwindlabs/tailwindcss/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/tailwindcss.svg" alt="License"></a>
20
20
  </p>
21
21
 
22
22
  ---
@@ -27,14 +27,10 @@ For full documentation, visit [tailwindcss.com](https://tailwindcss.com).
27
27
 
28
28
  ## Community
29
29
 
30
- For help, discussion about best practices, or any other conversation that would benefit from being searchable:
30
+ For help, discussion about best practices, or feature ideas:
31
31
 
32
- [Discuss Tailwind CSS on GitHub](https://github.com/tailwindcss/tailwindcss/discussions)
33
-
34
- For chatting with others using the framework:
35
-
36
- [Join the Tailwind CSS Discord Server](https://discord.gg/7NF8GNe)
32
+ [Discuss Tailwind CSS on GitHub](https://github.com/tailwindlabs/tailwindcss/discussions)
37
33
 
38
34
  ## Contributing
39
35
 
40
- If you're interested in contributing to Tailwind CSS, please read our [contributing docs](https://github.com/tailwindcss/tailwindcss/blob/next/.github/CONTRIBUTING.md) **before submitting a pull request**.
36
+ If you're interested in contributing to Tailwind CSS, please read our [contributing docs](https://github.com/tailwindlabs/tailwindcss/blob/main/.github/CONTRIBUTING.md) **before submitting a pull request**.
package/dist/index.mjs CHANGED
@@ -1,8 +1,28 @@
1
1
  #!/usr/bin/env node
2
- var it=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),rt=t=>{throw TypeError(t)};var V=(t,e,n)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&rt("Object expected");var i,r;n&&(i=e[it("asyncDispose")]),i===void 0&&(i=e[it("dispose")],n&&(r=i)),typeof i!="function"&&rt("Object not disposable"),r&&(i=function(){try{r.call(this)}catch(o){return Promise.reject(o)}}),t.push([n,i,e])}else n&&t.push([n]);return e},q=(t,e,n)=>{var i=typeof SuppressedError=="function"?SuppressedError:function(a,s,l,u){return u=Error(l),u.name="SuppressedError",u.error=a,u.suppressed=s,u},r=a=>e=n?new i(a,e,"An error was suppressed during disposal"):(n=!0,a),o=a=>{for(;a=t.pop();)try{var s=a[1]&&a[1].call(a[2]);if(a[0])return Promise.resolve(s).then(o,l=>(r(l),o()))}catch(l){r(l)}if(n)throw e};return o()};import vt from"mri";function st(t,e=process.argv.slice(2)){for(let[r,o]of e.entries())o==="-"&&(e[r]="__IO_DEFAULT_VALUE__");let n=vt(e);for(let r in n)n[r]==="__IO_DEFAULT_VALUE__"&&(n[r]="-");let i={_:n._};for(let[r,{type:o,alias:a,default:s=o==="boolean"?!1:null}]of Object.entries(t)){if(i[r]=s,a){let l=a.slice(1);n[l]!==void 0&&(i[r]=ot(n[l],o))}{let l=r.slice(2);n[l]!==void 0&&(i[r]=ot(n[l],o))}}return i}function ot(t,e){switch(e){case"string":return B(t);case"boolean":return R(t);case"number":return O(t);case"boolean | string":return R(t)??B(t);case"number | string":return O(t)??B(t);case"boolean | number":return R(t)??O(t);case"boolean | number | string":return R(t)??O(t)??B(t);default:throw new Error(`Unhandled type: ${e}`)}}function R(t){if(t===!0||t===!1)return t;if(t==="true")return!0;if(t==="false")return!1}function O(t){if(typeof t=="number")return t;{let e=Number(t);if(!Number.isNaN(e))return e}}function B(t){return`${t}`}import Nt from"@parcel/watcher";import{compile as zt,env as Lt,Instrumentation as dt}from"@tailwindcss/node";import{clearRequireCache as Ut}from"@tailwindcss/node/require-cache";import{Scanner as Wt}from"@tailwindcss/oxide";import{Features as L,transform as It}from"lightningcss";import{existsSync as Et}from"node:fs";import Q from"node:fs/promises";import C from"node:path";var v=class{#t=new Set([]);queueMacrotask(e){let n=setTimeout(e,0);return this.add(()=>{clearTimeout(n)})}add(e){return this.#t.add(e),()=>{this.#t.delete(e),e()}}async dispose(){for(let e of this.#t)await e();this.#t.clear()}};import Rt from"node:fs";import pt from"node:path";import{stripVTControlCharacters as Ot}from"node:util";import g from"picocolors";import lt from"enhanced-resolve";import At from"node:fs";import{createRequire as Ft}from"node:module";var kt=Ft(import.meta.url).resolve;function at(t){if(typeof globalThis.__tw_resolve=="function"){let e=globalThis.__tw_resolve(t);if(e)return e}return kt(t)}var Yt=lt.ResolverFactory.createResolver({fileSystem:new lt.CachedInputFileSystem(At,4e3),useSyncFileSystemCalls:!0,extensions:[".css"],mainFields:["style"],conditionNames:["style"]});function ut(t){let e=typeof t=="number"?BigInt(t):t;return e<1000n?`${e}ns`:(e/=1000n,e<1000n?`${e}\xB5s`:(e/=1000n,e<1000n?`${e}ms`:(e/=1000n,e<60n?`${e}s`:(e/=60n,e<60n?`${e}m`:(e/=60n,e<24n?`${e}h`:(e/=24n,`${e}d`))))))}var D={indent:2};function A(){return`${g.italic(g.bold(g.blue("\u2248")))} tailwindcss ${g.blue(`v${Bt()}`)}`}function N(t){return`${g.dim(g.blue("`"))}${g.blue(t)}${g.dim(g.blue("`"))}`}function ct(t,e=process.cwd(),{preferAbsoluteIfShorter:n=!0}={}){let i=pt.relative(e,t);return i.startsWith("..")||(i=`.${pt.sep}${i}`),n&&i.length>t.length?t:i}function K(t,e){let n=t.split(" "),i=[],r="",o=0;for(let a of n){let s=Ot(a).length;o+s+1>e&&(i.push(r),r="",o=0),r+=(o?" ":"")+a,o+=s+(o?1:0)}return o&&i.push(r),i}function z(t){let e=ut(t);return t<=50*1e6?g.green(e):t<=300*1e6?g.blue(e):t<=1e3*1e6?g.yellow(e):g.red(e)}function F(t,e=0){return`${" ".repeat(e+D.indent)}${t}`}function w(t=""){process.stderr.write(`${t}
3
- `)}function d(t=""){process.stdout.write(`${t}
4
- `)}function Bt(){if(typeof globalThis.__tw_version=="string")return globalThis.__tw_version;let{version:t}=JSON.parse(Rt.readFileSync(at("tailwindcss/package.json"),"utf-8"));return t}import G from"node:fs/promises";import Dt from"node:path";function J(){return new Promise((t,e)=>{let n="";process.stdin.on("data",i=>{n+=i}),process.stdin.on("end",()=>t(n)),process.stdin.on("error",i=>e(i))})}async function ft(t,e){try{if(await G.readFile(t,"utf8")===e)return}catch{}await G.mkdir(Dt.dirname(t),{recursive:!0}),await G.writeFile(t,e,"utf8")}var mt=String.raw,p=Lt.DEBUG;function U(){return{"--input":{type:"string",description:"Input file",alias:"-i"},"--output":{type:"string",description:"Output file",alias:"-o",default:"-"},"--watch":{type:"boolean | string",description:"Watch for changes and rebuild as needed",alias:"-w"},"--minify":{type:"boolean",description:"Optimize and minify the output",alias:"-m"},"--optimize":{type:"boolean",description:"Optimize the output without minifying"},"--cwd":{type:"string",description:"The current working directory",default:"."}}}async function ht(t){try{return await t()}catch(e){e instanceof Error&&w(e.toString()),process.exit(1)}}async function bt(t){var Z=[];try{let e=V(Z,new dt);p&&e.start("[@tailwindcss/cli] (initial build)");let n=C.resolve(t["--cwd"]);t["--output"]&&t["--output"]!=="-"&&(t["--output"]=C.resolve(n,t["--output"]));t["--input"]&&t["--input"]!=="-"&&(t["--input"]=C.resolve(n,t["--input"]),Et(t["--input"])||(w(A()),w(),w(`Specified input file ${N(ct(t["--input"]))} does not exist.`),process.exit(1)));let i=process.hrtime.bigint();let r=t["--input"]?t["--input"]==="-"?await J():await Q.readFile(t["--input"],"utf-8"):mt`
2
+ var gt=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),wt=t=>{throw TypeError(t)};var rt=(t,e,n)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&wt("Object expected");var i,s;n&&(i=e[gt("asyncDispose")]),i===void 0&&(i=e[gt("dispose")],n&&(s=i)),typeof i!="function"&&wt("Object not disposable"),s&&(i=function(){try{s.call(this)}catch(r){return Promise.reject(r)}}),t.push([n,i,e])}else n&&t.push([n]);return e},st=(t,e,n)=>{var i=typeof SuppressedError=="function"?SuppressedError:function(l,o,a,u){return u=Error(a),u.name="SuppressedError",u.error=l,u.suppressed=o,u},s=l=>e=n?new i(l,e,"An error was suppressed during disposal"):(n=!0,l),r=l=>{for(;l=t.pop();)try{var o=l[1]&&l[1].call(l[2]);if(l[0])return Promise.resolve(o).then(r,a=>(s(a),r()))}catch(a){s(a)}if(n)throw e};return r()};import Kt from"mri";function R(t,e=process.argv.slice(2)){for(let[s,r]of e.entries())r==="-"&&(e[s]="__IO_DEFAULT_VALUE__");let n=Kt(e);for(let s in n){let r=n[s];s!=="_"&&Array.isArray(r)&&(r=r[r.length-1]),r==="__IO_DEFAULT_VALUE__"&&(r="-"),n[s]=r}let i={_:n._};for(let[s,{type:r,alias:l,default:o=r==="boolean"?!1:null}]of Object.entries(t)){if(i[s]=o,l){let a=l.slice(1);n[a]!==void 0&&(i[s]=bt(n[a],r))}{let a=s.slice(2);n[a]!==void 0&&(i[s]=bt(n[a],r))}}return i}function bt(t,e){switch(e){case"string":return K(t);case"boolean":return W(t);case"number":return G(t);case"boolean | string":return W(t)??K(t);case"number | string":return G(t)??K(t);case"boolean | number":return W(t)??G(t);case"boolean | number | string":return W(t)??G(t)??K(t);default:throw new Error(`Unhandled type: ${e}`)}}function W(t){if(t===!0||t===!1)return t;if(t==="true")return!0;if(t==="false")return!1}function G(t){if(typeof t=="number")return t;{let e=Number(t);if(!Number.isNaN(e))return e}}function K(t){return`${t}`}import Xt from"@parcel/watcher";import{compile as te,env as ee,Instrumentation as _t,optimize as ne,toSourceMap as H}from"@tailwindcss/node";import{clearRequireCache as ie}from"@tailwindcss/node/require-cache";import{Scanner as re}from"@tailwindcss/oxide";import{existsSync as se}from"fs";import ct from"fs/promises";import T from"path";var L=class{#t=new Set([]);queueMacrotask(e){let n=setTimeout(e,0);return this.add(()=>{clearTimeout(n)})}add(e){return this.#t.add(e),()=>{this.#t.delete(e),e()}}async dispose(){for(let e of this.#t)await e();this.#t.clear()}};import Jt from"fs";import xt from"path";import{stripVTControlCharacters as Qt}from"util";import b from"picocolors";import yt from"enhanced-resolve";import Yt from"fs";import{createRequire as Vt}from"module";var qt=Vt(import.meta.url).resolve;function St(t){if(typeof globalThis.__tw_resolve=="function"){let e=globalThis.__tw_resolve(t);if(e)return e}return qt(t)}var Be=yt.ResolverFactory.createResolver({fileSystem:new yt.CachedInputFileSystem(Yt,4e3),useSyncFileSystemCalls:!0,extensions:[".css"],mainFields:["style"],conditionNames:["style"]});function Ct(t){let e=typeof t=="number"?BigInt(t):t;return e<1000n?`${e}ns`:(e/=1000n,e<1000n?`${e}\xB5s`:(e/=1000n,e<1000n?`${e}ms`:(e/=1000n,e<60n?`${e}s`:(e/=60n,e<60n?`${e}m`:(e/=60n,e<24n?`${e}h`:(e/=24n,`${e}d`))))))}var Y={indent:2};function V(){return`${b.italic(b.bold(b.blue("\u2248")))} tailwindcss ${b.blue(`v${Ht()}`)}`}function v(t){return`${b.dim(b.blue("`"))}${b.blue(t)}${b.dim(b.blue("`"))}`}function q(t,e=process.cwd(),{preferAbsoluteIfShorter:n=!0}={}){let i=xt.relative(e,t);return i.startsWith("..")||(i=`.${xt.sep}${i}`),n&&i.length>t.length?t:i}function ot(t,e){let n=t.split(" "),i=[],s="",r=0;for(let l of n){let o=Qt(l).length;r+o+1>e&&(i.push(s),s="",r=0),s+=(r?" ":"")+l,r+=o+(r?1:0)}return r&&i.push(s),i}function B(t){let e=Ct(t);return t<=50*1e6?b.green(e):t<=300*1e6?b.blue(e):t<=1e3*1e6?b.yellow(e):b.red(e)}function k(t,e=0){return`${" ".repeat(e+Y.indent)}${t}`}function S(t=""){process.stderr.write(`${t}
3
+ `)}function J(t=""){process.stdout.write(`${t}
4
+ `)}function Ht(){if(typeof globalThis.__tw_version=="string")return globalThis.__tw_version;let{version:t}=JSON.parse(Jt.readFileSync(St("tailwindcss/package.json"),"utf-8"));return t}import Q from"fs/promises";import Zt from"path";function lt(){return new Promise((t,e)=>{let n="";process.stdin.on("data",i=>{n+=i}),process.stdin.on("end",()=>t(n)),process.stdin.on("error",i=>e(i))})}async function at(t,e){if(!await Q.stat(t).then(i=>i.isCharacterDevice()||i.isFIFO()).catch(()=>!1))try{if(await Q.readFile(t,"utf8")===e)return}catch{}await Q.mkdir(Zt.dirname(t),{recursive:!0}),await Q.writeFile(t,e,"utf8")}var Tt=String.raw,c=ee.DEBUG;function N(){return{"--input":{type:"string",description:"Input file",alias:"-i"},"--output":{type:"string",description:"Output file",alias:"-o",default:"-"},"--watch":{type:"boolean | string",description:"Watch for changes and rebuild as needed, and use `always` to keep watching when stdin is closed",alias:"-w",values:["always"]},"--minify":{type:"boolean",description:"Optimize and minify the output",alias:"-m"},"--optimize":{type:"boolean",description:"Optimize the output without minifying"},"--cwd":{type:"string",description:"The current working directory",default:"."},"--map":{type:"boolean | string",description:"Generate a source map",default:!1},"--silent":{type:"boolean",description:"Suppress non-error output"}}}async function ut(t){try{return await t()}catch(e){S([Ot("Error:"),A("\u250C")].concat(`${e}`.split(`
5
+ `).map(n=>`${A("\u2502")} ${n}`)).concat(A("\u2514")).join(`
6
+ `)),process.exit(1)}}async function pt(t){var I=[];try{t["--silent"]||S(V());t["--silent"]||S();let e=rt(I,new _t);c&&e.start("[@tailwindcss/cli] (initial build)");let n=T.resolve(t["--cwd"]);t["--output"]&&t["--output"]!=="-"&&(t["--output"]=T.resolve(n,t["--output"]));t["--input"]&&t["--input"]!=="-"&&(t["--input"]=T.resolve(n,t["--input"]),se(t["--input"])||(S(`Specified input file ${v(q(t["--input"]))} does not exist.`),process.exit(1)));t["--input"]===t["--output"]&&t["--input"]!=="-"&&(S(`Specified input file ${v(q(t["--input"]))} and output file ${v(q(t["--output"]))} are identical.`),process.exit(1));t["--map"]==="-"&&(S("Use --map without a value to inline the source map"),process.exit(1));t["--map"]&&t["--map"]!==!0&&(t["--map"]=T.resolve(n,t["--map"]));let i=process.hrtime.bigint();let s=t["--input"]?t["--input"]==="-"?await lt():await ct.readFile(t["--input"],"utf-8"):Tt`
5
7
  @import 'tailwindcss';
6
- `;let o={css:"",optimizedCss:""};async function a(S,b,m){let x=S;if(b["--minify"]||b["--optimize"])if(S!==o.css){p&&m.start("Optimize CSS");let $=Pt(S,{file:b["--input"]??"input.css",minify:b["--minify"]??!1});p&&m.end("Optimize CSS"),o.css=S,o.optimizedCss=$,x=$}else x=o.optimizedCss;p&&m.start("Write output"),b["--output"]&&b["--output"]!=="-"?await ft(b["--output"],x):d(x),p&&m.end("Write output")}let s=t["--input"]&&t["--input"]!=="-"?C.resolve(t["--input"]):null;let l=s?C.dirname(s):process.cwd();let u=s?[s]:[];async function f(S,b){p&&b.start("Setup compiler");let m=await zt(S,{base:l,onDependency(E){u.push(E)}}),x=(m.root==="none"?[]:m.root===null?[{base:n,pattern:"**/*"}]:[m.root]).concat(m.globs),$=new Wt({sources:x});return p&&b.end("Setup compiler"),[m,$]}let[y,h]=await ht(()=>f(r,e));if(t["--watch"]){let S=await yt(gt(h),async function b(m){try{var x=[];try{if(m.length===1&&m[0]===t["--output"])return;let c=V(x,new dt);p&&c.start("[@tailwindcss/cli] (watcher)");let tt=process.hrtime.bigint();let et=[];let P="incremental";let nt=u;for(let T of m){if(nt.includes(T)){P="full";break}et.push({file:T,extension:C.extname(T).slice(1)})}let j="";if(P==="full"){let T=t["--input"]?t["--input"]==="-"?await J():await Q.readFile(t["--input"],"utf-8"):mt`
8
+ `;let r={css:"",optimizedCss:""};async function l(x,w,d,_){let y=x;if(d["--minify"]||d["--optimize"])if(x!==r.css){c&&_.start("Optimize CSS");let E=ne(x,{file:d["--input"]??"input.css",minify:d["--minify"]??!1,map:w?.raw??void 0});c&&_.end("Optimize CSS"),r.css=x,r.optimizedCss=E.code,E.map&&(w=H(E.map)),y=E.code}else y=r.optimizedCss;if(w){if(d["--map"]===!0)y+=`
9
+ `,y+=w.inline;else if(typeof d["--map"]=="string"){let E=d["--output"]&&d["--output"]!=="-"?T.dirname(T.resolve(d["--output"])):process.cwd(),X=T.resolve(d["--map"]),f=T.relative(E,X);y+=`
10
+ `,y+=w.comment(f),c&&_.start("Write source map"),await at(d["--map"],w.raw),c&&_.end("Write source map")}}c&&_.start("Write output"),d["--output"]&&d["--output"]!=="-"?await at(d["--output"],y):J(y),c&&_.end("Write output")}let o=t["--input"]&&t["--input"]!=="-"?T.resolve(t["--input"]):null;let a=o?T.dirname(o):process.cwd();let u=o?[o]:[];let g=u;async function m(x,w){c&&w.start("Setup compiler");let d=await te(x,{from:t["--output"]?o??"stdin.css":void 0,base:a,onDependency(E){u.push(E)}}),_=(d.root==="none"?[]:d.root===null?[{base:n,pattern:"**/*",negated:!1}]:[{...d.root,negated:!1}]).concat(d.sources),y=new re({sources:_});return c&&w.end("Setup compiler"),[d,y]}let[p,h]=await ut(()=>m(s,e));if(t["--watch"]){let x=[];x.push(await Et($t(h),async function w(d){try{var _=[];try{if(d.length===1&&d[0]===t["--output"])return;let f=rt(_,new _t);c&&f.start("[@tailwindcss/cli] (watcher)");let D=process.hrtime.bigint();let M=[];let tt="incremental";let ht=u;for(let $ of d){if(ht.includes($)){tt="full";break}M.push({file:$,extension:T.extname($).slice(1)})}let et="";let nt=null;if(tt==="full"){let $=t["--input"]?t["--input"]==="-"?await lt():await ct.readFile(t["--input"],"utf-8"):Tt`
7
11
  @import 'tailwindcss';
8
- `;Ut(nt),u=s?[s]:[],[y,h]=await f(T,c),p&&c.start("Scan for candidates");let M=h.scan();p&&c.end("Scan for candidates"),p&&c.start("Setup new watchers");let Ct=await yt(gt(h),b);p&&c.end("Setup new watchers"),p&&c.start("Cleanup old watchers"),await S(),p&&c.end("Cleanup old watchers"),S=Ct,p&&c.start("Build CSS"),j=y.build(M),p&&c.end("Build CSS")}else if(P==="incremental"){p&&c.start("Scan for candidates");let T=h.scanFiles(et);if(p&&c.end("Scan for candidates"),T.length<=0){let M=process.hrtime.bigint();w(`Done in ${z(M-tt)}`);return}p&&c.start("Build CSS"),j=y.build(T),p&&c.end("Build CSS")}await a(j,t,c);let $t=process.hrtime.bigint();w(`Done in ${z($t-tt)}`)}catch($){var E=$,_t=!0}finally{q(x,E,_t)}}catch(c){c instanceof Error&&w(c.toString())}});t["--watch"]!=="always"&&process.stdin.on("end",()=>{S().then(()=>process.exit(0),()=>process.exit(1))}),process.stdin.resume()}p&&e.start("Scan for candidates");let W=h.scan();p&&e.end("Scan for candidates");p&&e.start("Build CSS");let k=await ht(()=>y.build(W));p&&e.end("Build CSS");await a(k,t,e);let I=process.hrtime.bigint();w(A());w();w(`Done in ${z(I-i)}`)}catch(St){var xt=St,Tt=!0}finally{q(Z,xt,Tt)}}function gt(t){return t.globs.flatMap(e=>e.pattern[0]==="!"?[]:e.pattern===""?[]:e.base)}async function yt(t,e){t=t.sort((s,l)=>s.length-l.length);let n=[];for(let s=0;s<t.length;++s)for(let l=0;l<s;++l)t[s].startsWith(`${t[l]}/`)&&n.push(t[s]);t=t.filter(s=>!n.includes(s));let i=new v,r=new Set,o=new v;async function a(){await o.dispose(),o.queueMacrotask(()=>{e(Array.from(r)),r.clear()})}for(let s of t){let{unsubscribe:l}=await Nt.subscribe(s,async(u,f)=>{if(u){console.error(u);return}await Promise.all(f.map(async y=>{if(y.type==="delete")return;let h=null;try{h=await Q.lstat(y.path)}catch{}!h?.isFile()&&!h?.isSymbolicLink()||r.add(y.path)})),await a()});i.add(l)}return async()=>{await i.dispose(),await o.dispose()}}function Pt(t,{file:e="input.css",minify:n=!1}={}){function i(r){return It({filename:e,code:r,minify:n,sourceMap:!1,drafts:{customMedia:!0},nonStandard:{deepSelectorCombinator:!0},include:L.Nesting,exclude:L.LogicalProperties|L.DirSelector|L.LightDark,targets:{safari:16<<16|1024,ios_saf:16<<16|1024,firefox:8388608,chrome:7274496},errorRecovery:!0}).code}return i(i(Buffer.from(t))).toString()}import _ from"picocolors";function Y({invalid:t,usage:e,options:n}){let i=process.stdout.columns;if(d(A()),t&&(d(),d(`${_.dim("Invalid command:")} ${t}`)),e&&e.length>0){d(),d(_.dim("Usage:"));for(let[r,o]of e.entries()){let a=o.slice(0,o.indexOf("[")),s=o.slice(o.indexOf("["));s=s.replace(/\[.*?\]/g,f=>_.dim(f));let u=K(s,i-D.indent-a.length-1);u.length>1&&r!==0&&d(),d(F(`${a}${u.shift()}`));for(let f of u)d(F(f,a.length))}}if(n){let r=0;for(let{alias:l}of Object.values(n))l&&(r=Math.max(r,l.length));let o=[],a=0;for(let[l,{alias:u}]of Object.entries(n)){let f=[u&&`${u.padStart(r)}`,u?l:" ".repeat(r+2)+l].filter(Boolean).join(", ");o.push(f),a=Math.max(a,f.length)}d(),d(_.dim("Options:"));let s=8;for(let{description:l,default:u=null}of Object.values(n)){let f=o.shift(),y=s+(a-f.length),h=2,W=i-f.length-y-h-D.indent,k=K(u!==null?`${l} ${_.dim(`[default:\u202F${N(`${u}`)}]`)}`:l,W);d(F(`${_.blue(f)} ${_.dim(_.gray("\xB7")).repeat(y)} ${k.shift()}`));for(let I of k)d(F(`${" ".repeat(f.length+y+h)}${I}`))}}}var H={"--help":{type:"boolean",description:"Display usage information",alias:"-h"}},X=st({...U(),...H}),wt=X._[0];wt&&(Y({invalid:wt,usage:["tailwindcss [options]"],options:{...U(),...H}}),process.exit(1));(process.stdout.isTTY&&process.argv[2]===void 0||X["--help"])&&(Y({usage:["tailwindcss [--input input.css] [--output output.css] [--watch] [options\u2026]"],options:{...U(),...H}}),process.exit(0));bt(X);
12
+ `;ie(ht),g=u.slice(),u=o?[o]:[],[p,h]=await m($,f),g=u.slice(),c&&f.start("Scan for candidates");let it=h.scan();c&&f.end("Scan for candidates"),c&&f.start("Setup new watchers");let Wt=await Et($t(h),w);c&&f.end("Setup new watchers"),c&&f.start("Cleanup old watchers"),await Promise.all(x.splice(0).map(Gt=>Gt())),c&&f.end("Cleanup old watchers"),x.push(Wt),c&&f.start("Build CSS"),et=p.build(it),c&&f.end("Build CSS"),t["--map"]&&(c&&f.start("Build Source Map"),nt=H(p.buildSourceMap()),c&&f.end("Build Source Map"))}else if(tt==="incremental"){c&&f.start("Scan for candidates");let $=h.scanFiles(M);if(c&&f.end("Scan for candidates"),$.length<=0){let it=process.hrtime.bigint();t["--silent"]||S(`Done in ${B(it-D)}`);return}c&&f.start("Build CSS"),et=p.build($),c&&f.end("Build CSS"),t["--map"]&&(c&&f.start("Build Source Map"),nt=H(p.buildSourceMap()),c&&f.end("Build Source Map"))}await l(et,nt,t,f);let Mt=process.hrtime.bigint();t["--silent"]||S(`Done in ${B(Mt-D)}`)}catch(y){var E=y,X=!0}finally{st(_,E,X)}}catch(f){u=g,S([Ot("Error:"),A("\u250C")].concat(`${f}`.split(`
13
+ `).map(M=>`${A("\u2502")} ${M}`)).concat(A("\u2514")).join(`
14
+ `));let D=process.hrtime.bigint();t["--silent"]||S(`Done in ${B(D-i)}`)}})),t["--watch"]!=="always"&&process.stdin.on("end",()=>{Promise.all(x.map(w=>w())).then(()=>process.exit(0),()=>process.exit(1))}),process.stdin.resume()}c&&e.start("Scan for candidates");let C=h.scan();c&&e.end("Scan for candidates");c&&e.start("Build CSS");let j=await ut(()=>p.build(C));c&&e.end("Build CSS");let U=null;t["--map"]&&(c&&e.start("Build Source Map"),U=await ut(()=>H(p.buildSourceMap())),c&&e.end("Build Source Map"));await l(j,U,t,e);let z=process.hrtime.bigint();t["--silent"]||S(`Done in ${B(z-i)}`)}catch(zt){var It=zt,Dt=!0}finally{st(I,It,Dt)}}async function Et(t,e){t=t.sort((o,a)=>o.length-a.length);let n=[];for(let o=0;o<t.length;++o)for(let a=0;a<o;++a)t[o].startsWith(`${t[a]}/`)&&n.push(t[o]);t=t.filter(o=>!n.includes(o));let i=new L,s=new Set,r=new L;async function l(){await r.dispose(),r.queueMacrotask(()=>{e(Array.from(s)),s.clear()})}for(let o of t){let{unsubscribe:a}=await Xt.subscribe(o,async(u,g)=>{if(u){console.error(u);return}await Promise.all(g.map(async m=>{if(m.type==="delete"){s.add(m.path);return}let p=null;try{p=await ct.lstat(m.path)}catch{}!p?.isFile()&&!p?.isSymbolicLink()||s.add(m.path)})),await l()});i.add(a)}return async()=>{await i.dispose(),await r.dispose()}}function $t(t){return[...new Set(t.normalizedSources.flatMap(e=>e.base))]}function A(t){return`\x1B[2m${t}\x1B[22m`}function Ot(t){return`\x1B[31m${t}\x1B[39m`}import{__unstable__loadDesignSystem as vt}from"@tailwindcss/node";import le from"fs/promises";import At from"path";import{createInterface as ae}from"readline";function dt(t,e){let n=t.length,i=e.length,s=n<i?n:i;for(let r=0;r<s;r++){let l=t.charCodeAt(r),o=e.charCodeAt(r);if(l>=48&&l<=57&&o>=48&&o<=57){let a=r,u=r+1,g=r,m=r+1;for(l=t.charCodeAt(u);l>=48&&l<=57;)l=t.charCodeAt(++u);for(o=e.charCodeAt(m);o>=48&&o<=57;)o=e.charCodeAt(++m);let p=t.slice(a,u),h=e.slice(g,m),C=Number(p)-Number(h);if(C)return C;if(p<h)return-1;if(p>h)return 1;continue}if(l!==o)return l-o}return t.length-e.length}var Z=new Uint8Array(256);function Rt(t,e){let n=0,i=[],s=0,r=t.length,l=e.charCodeAt(0);for(let o=0;o<r;o++){let a=t.charCodeAt(o);if(n===0&&a===l){i.push(t.slice(s,o)),s=o+1;continue}switch(a){case 92:o+=1;break;case 39:case 34:for(;++o<r;){let u=t.charCodeAt(o);if(u===92){o+=1;continue}if(u===a)break}break;case 40:Z[n]=41,n++;break;case 91:Z[n]=93,n++;break;case 123:Z[n]=125,n++;break;case 93:case 125:case 41:n>0&&a===Z[n-1]&&n--;break}}return i.push(t.slice(s)),i}import O from"picocolors";function P({render:t=!0,invalid:e,usage:n,options:i}){let s=process.stdout.columns??80,r=[],l=t?J:(o="")=>{r.push(o)};if(l(V()),e&&(l(),l(`${O.dim("Invalid command:")} ${e}`)),n&&n.length>0){l(),l(O.dim("Usage:"));for(let[o,a]of n.entries()){let u=a.slice(0,a.indexOf("[")),g=a.slice(a.indexOf("["));g=g.replace(/\[.*?\]/g,h=>O.dim(h));let p=ot(g,s-Y.indent-u.length-1);p.length>1&&o!==0&&l(),l(k(`${u}${p.shift()}`));for(let h of p)l(k(h,u.length))}}if(i){let o=0;for(let{alias:m}of Object.values(i))m&&(o=Math.max(o,m.length));let a=[],u=0;for(let[m,{alias:p,values:h}]of Object.entries(i)){h?.length&&(m+=`[=${h.join(", ")}]`);let C=[p&&`${p.padStart(o)}`,p?m:" ".repeat(o+2)+m].filter(Boolean).join(", ");a.push(C),u=Math.max(u,C.length)}l(),l(O.dim("Options:"));let g=8;for(let{description:m,default:p=null}of Object.values(i)){let h=a.shift(),C=g+(u-h.length),j=2,U=s-h.length-C-j-Y.indent,z=ot(p!==null?`${m} ${O.dim(`[default:\u202F${v(`${p}`)}]`)}`:m,U);l(k(`${O.blue(h)} ${O.dim(O.gray("\xB7")).repeat(C)} ${z.shift()}`));for(let I of z)l(k(`${" ".repeat(h.length+C+j)}${I}`))}}if(!t)return r.join(`
15
+ `)}var ue=String.raw;function ft(){return"tailwindcss canonicalize [classes...]"}function ce(){return"tailwindcss canonicalize --css input.css [classes...]"}function pe(){return"tailwindcss canonicalize --stream [--css input.css]"}function Lt(){return{"--css":{type:"string",description:'CSS entry file used to load the Tailwind design system (defaults to `@import "tailwindcss";`)'},"--format":{type:"string",description:"Output format",default:"text",values:["text","json","jsonl"]},"--stream":{type:"boolean",description:"Read candidate groups from stdin line by line and write results to stdout",default:!1}}}var Bt={"--help":{type:"boolean",description:"Display usage information",alias:"-h",default:!1}};async function kt({argv:t=process.argv.slice(2),cwd:e=process.cwd(),stdin:n=null,stdinIsTTY:i=process.stdin.isTTY,stdoutIsTTY:s=process.stdout.isTTY}={}){try{let r=R({...Lt(),...Bt},t),l=we(r["--format"]??"text");if(s&&t.length===0||r["--help"])return{exitCode:0,stdout:Pt()??"",stderr:""};if(r["--stream"])return await de({css:r["--css"],cwd:e,format:l,input:process.stdin,output:process.stdout}),{exitCode:0,stdout:"",stderr:""};let o=r._.length>0?r._:await fe({stdin:n,stdinIsTTY:i});if(o.length===0)return be("No candidate groups provided");let a=await he({css:r["--css"],cwd:e,inputs:o});return{exitCode:0,stdout:ge(a,l),stderr:""}}catch(r){return{exitCode:1,stdout:"",stderr:r instanceof Error?r.message:String(r)}}}async function de({css:t,cwd:e,format:n,input:i,output:s}){let r=await Ft(t,e),l=ae({input:i}),o=!0;n==="json"&&s.write("[");for await(let a of l){let u=jt(r,a);switch(n){case"text":{s.write(u.output+`
16
+ `);break}case"jsonl":{s.write(JSON.stringify(u)+`
17
+ `);break}case"json":{o?s.write(`
18
+ `):s.write(`,
19
+ `),s.write(Ce(JSON.stringify(u,null,2),2)),o=!1;break}}}n==="json"&&s.write(o?"]":`
20
+ ]`)}function fe({stdin:t,stdinIsTTY:e}){return t!==null?Promise.resolve(Nt(t)):e?Promise.resolve([]):me().then(Nt)}async function me(){return new Promise((t,e)=>{let n="";process.stdin.on("data",i=>{n+=i}),process.stdin.on("end",()=>t(n)),process.stdin.on("error",i=>e(i))})}async function he({css:t,cwd:e=process.cwd(),inputs:n}){let i=await Ft(t,e);return n.map(s=>jt(i,s))}function ge(t,e){switch(e){case"json":return JSON.stringify(t,null,2);case"jsonl":return t.map(n=>JSON.stringify(n)).join(`
21
+ `);case"text":return t.map(n=>n.output).join(`
22
+ `)}}function Pt(){return P({render:!1,usage:[ft(),ce(),pe()],options:{...Lt(),...Bt}})}async function Ft(t,e){if(t===null)return vt(ue`
23
+ @import 'tailwindcss';
24
+ `,{base:e});let n=At.resolve(e,t),i=await le.readFile(n,"utf8");return vt(i,{base:At.dirname(n)})}function Nt(t){return t.split(/\r?\n/g).map(e=>e.trim()).filter(e=>e.length>0)}function we(t){if(t==="text"||t==="json"||t==="jsonl")return t;throw new Error(`Invalid value for --format: ${t}`)}function be(t){return{exitCode:1,stdout:Pt()??"",stderr:t}}function ye(t){let e=t.trim();return e.length===0?[]:Rt(e," ").map(n=>n.trim()).filter(n=>n.length>0)}function Se(t,e){let n=ye(e);return n=t.canonicalizeCandidates(n,{collapse:!0,logicalToPhysical:!0}),xe(t.getClassOrder(n)).join(" ")}function jt(t,e){let n=Se(t,e);return{input:e,output:n,changed:n!==e}}function Ce(t,e){let n=" ".repeat(e);return t.split(`
25
+ `).map(i=>n+i).join(`
26
+ `)}function xe(t){return t.slice().sort(([e,n],[i,s])=>n===s?dt(e,i):n===null?-1:s===null?1:_e(n-s)||dt(e,i)).map(([e])=>e)}function _e(t){return t>0n?1:t===0n?0:-1}var F={"--help":{type:"boolean",description:"Display usage information",alias:"-h"}};function mt(t="tailwindcss"){return`${t} [--input input.css] [--output output.css] [--watch] [options\u2026]`}function Ut({invalid:t}={}){P({invalid:t,usage:[mt("tailwindcss"),mt("tailwindcss build"),ft()],commands:{build:"Build your CSS",canonicalize:"Canonicalize candidate lists"},options:{...N(),...F}})}async function Ee(){let t=process.argv.slice(2),e=t[0],n=R({...N(),...F},t);if(e==="build"){let s=R({...N(),...F},t.slice(1));(process.stdout.isTTY&&t.length===1||s["--help"])&&(P({usage:[mt("tailwindcss build")],options:{...N(),...F}}),process.exit(0)),await pt(s);return}if(e==="canonicalize"){let s=await kt({argv:t.slice(1)});s.stdout.length>0&&process.stdout.write(`${s.stdout}
27
+ `),s.stderr.length>0&&process.stderr.write(`${s.stderr}
28
+ `),process.exitCode=s.exitCode;return}(process.stdout.isTTY&&e===void 0||n["--help"])&&(Ut(),process.exit(0)),e&&!e.startsWith("-")&&(Ut({invalid:e}),process.exit(1));let i=R({...N(),...F});await pt(i)}await Ee();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailwindcss/cli",
3
- "version": "0.0.0-insiders.4455048",
3
+ "version": "0.0.0-insiders.44818a6",
4
4
  "description": "A utility-first CSS framework for rapidly building custom user interfaces.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -24,14 +24,13 @@
24
24
  "access": "public"
25
25
  },
26
26
  "dependencies": {
27
- "@parcel/watcher": "^2.5.1",
28
- "enhanced-resolve": "^5.18.1",
29
- "lightningcss": "1.29.2",
27
+ "@parcel/watcher": "2.5.1",
28
+ "enhanced-resolve": "5.21.6",
30
29
  "mri": "^1.2.0",
31
30
  "picocolors": "^1.1.1",
32
- "@tailwindcss/node": "0.0.0-insiders.4455048",
33
- "tailwindcss": "0.0.0-insiders.4455048",
34
- "@tailwindcss/oxide": "0.0.0-insiders.4455048"
31
+ "@tailwindcss/node": "0.0.0-insiders.44818a6",
32
+ "@tailwindcss/oxide": "0.0.0-insiders.44818a6",
33
+ "tailwindcss": "0.0.0-insiders.44818a6"
35
34
  },
36
35
  "scripts": {
37
36
  "lint": "tsc --noEmit",