@tailwindcss/cli 0.0.0-insiders.df96ea5 → 0.0.0-insiders.dfc449c

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
  ---
@@ -29,8 +29,8 @@ For full documentation, visit [tailwindcss.com](https://tailwindcss.com).
29
29
 
30
30
  For help, discussion about best practices, or feature ideas:
31
31
 
32
- [Discuss Tailwind CSS on GitHub](https://github.com/tailwindcss/tailwindcss/discussions)
32
+ [Discuss Tailwind CSS on GitHub](https://github.com/tailwindlabs/tailwindcss/discussions)
33
33
 
34
34
  ## Contributing
35
35
 
36
- 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,10 +1,17 @@
1
1
  #!/usr/bin/env node
2
- var ae=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),ue=e=>{throw TypeError(e)};var J=(e,t,i)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&ue("Object expected");var r,o;i&&(r=t[ae("asyncDispose")]),r===void 0&&(r=t[ae("dispose")],i&&(o=r)),typeof r!="function"&&ue("Object not disposable"),o&&(r=function(){try{o.call(this)}catch(n){return Promise.reject(n)}}),e.push([i,r,t])}else i&&e.push([i]);return t},Q=(e,t,i)=>{var r=typeof SuppressedError=="function"?SuppressedError:function(u,s,l,p){return p=Error(l),p.name="SuppressedError",p.error=u,p.suppressed=s,p},o=u=>t=i?new r(u,t,"An error was suppressed during disposal"):(i=!0,u),n=u=>{for(;u=e.pop();)try{var s=u[1]&&u[1].call(u[2]);if(u[0])return Promise.resolve(s).then(n,l=>(o(l),n()))}catch(l){o(l)}if(i)throw t};return n()};import ke from"mri";function ce(e,t=process.argv.slice(2)){for(let[o,n]of t.entries())n==="-"&&(t[o]="__IO_DEFAULT_VALUE__");let i=ke(t);for(let o in i){let n=i[o];o!=="_"&&Array.isArray(n)&&(n=n[n.length-1]),n==="__IO_DEFAULT_VALUE__"&&(n="-"),i[o]=n}let r={_:i._};for(let[o,{type:n,alias:u,default:s=n==="boolean"?!1:null}]of Object.entries(e)){if(r[o]=s,u){let l=u.slice(1);i[l]!==void 0&&(r[o]=pe(i[l],n))}{let l=o.slice(2);i[l]!==void 0&&(r[o]=pe(i[l],n))}}return r}function pe(e,t){switch(t){case"string":return D(e);case"boolean":return O(e);case"number":return R(e);case"boolean | string":return O(e)??D(e);case"number | string":return R(e)??D(e);case"boolean | number":return O(e)??R(e);case"boolean | number | string":return O(e)??R(e)??D(e);default:throw new Error(`Unhandled type: ${t}`)}}function O(e){if(e===!0||e===!1)return e;if(e==="true")return!0;if(e==="false")return!1}function R(e){if(typeof e=="number")return e;{let t=Number(e);if(!Number.isNaN(t))return t}}function D(e){return`${e}`}import Ne from"@parcel/watcher";import{compile as We,env as Ee,Instrumentation as ye,optimize as Ue,toSourceMap as U}from"@tailwindcss/node";import{clearRequireCache as Ie}from"@tailwindcss/node/require-cache";import{Scanner as Le}from"@tailwindcss/oxide";import{existsSync as je}from"fs";import ee from"fs/promises";import T from"path";var A=class{#e=new Set([]);queueMacrotask(t){let i=setTimeout(t,0);return this.add(()=>{clearTimeout(i)})}add(t){return this.#e.add(t),()=>{this.#e.delete(t),t()}}async dispose(){for(let t of this.#e)await t();this.#e.clear()}};import Re from"fs";import he from"path";import{stripVTControlCharacters as De}from"util";import b from"picocolors";import fe from"enhanced-resolve";import Me from"fs";import{createRequire as Be}from"module";var Oe=Be(import.meta.url).resolve;function de(e){if(typeof globalThis.__tw_resolve=="function"){let t=globalThis.__tw_resolve(e);if(t)return t}return Oe(e)}var Xe=fe.ResolverFactory.createResolver({fileSystem:new fe.CachedInputFileSystem(Me,4e3),useSyncFileSystemCalls:!0,extensions:[".css"],mainFields:["style"],conditionNames:["style"]});function me(e){let t=typeof e=="number"?BigInt(e):e;return t<1000n?`${t}ns`:(t/=1000n,t<1000n?`${t}\xB5s`:(t/=1000n,t<1000n?`${t}ms`:(t/=1000n,t<60n?`${t}s`:(t/=60n,t<60n?`${t}m`:(t/=60n,t<24n?`${t}h`:(t/=24n,`${t}d`))))))}var P={indent:2};function z(){return`${b.italic(b.bold(b.blue("\u2248")))} tailwindcss ${b.blue(`v${Pe()}`)}`}function F(e){return`${b.dim(b.blue("`"))}${b.blue(e)}${b.dim(b.blue("`"))}`}function N(e,t=process.cwd(),{preferAbsoluteIfShorter:i=!0}={}){let r=he.relative(t,e);return r.startsWith("..")||(r=`.${he.sep}${r}`),i&&r.length>e.length?e:r}function Y(e,t){let i=e.split(" "),r=[],o="",n=0;for(let u of i){let s=De(u).length;n+s+1>t&&(r.push(o),o="",n=0),o+=(n?" ":"")+u,n+=s+(n?1:0)}return n&&r.push(o),r}function W(e){let t=me(e);return e<=50*1e6?b.green(t):e<=300*1e6?b.blue(t):e<=1e3*1e6?b.yellow(t):b.red(t)}function k(e,t=0){return`${" ".repeat(t+P.indent)}${e}`}function $(e=""){process.stderr.write(`${e}
3
- `)}function h(e=""){process.stdout.write(`${e}
4
- `)}function Pe(){if(typeof globalThis.__tw_version=="string")return globalThis.__tw_version;let{version:e}=JSON.parse(Re.readFileSync(de("tailwindcss/package.json"),"utf-8"));return e}import E from"fs/promises";import ze from"path";function H(){return new Promise((e,t)=>{let i="";process.stdin.on("data",r=>{i+=r}),process.stdin.on("end",()=>e(i)),process.stdin.on("error",r=>t(r))})}async function X(e,t){if(!await E.stat(e).then(r=>r.isCharacterDevice()||r.isFIFO()).catch(()=>!1))try{if(await E.readFile(e,"utf8")===t)return}catch{}await E.mkdir(ze.dirname(e),{recursive:!0}),await E.writeFile(e,t,"utf8")}var we=String.raw,a=Ee.DEBUG;function I(){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}}}async function Z(e){try{return await e()}catch(t){t instanceof Error&&$(t.toString()),process.exit(1)}}async function Se(e){var re=[];try{$(z());$();let t=J(re,new ye);a&&t.start("[@tailwindcss/cli] (initial build)");let i=T.resolve(e["--cwd"]);e["--output"]&&e["--output"]!=="-"&&(e["--output"]=T.resolve(i,e["--output"]));e["--input"]&&e["--input"]!=="-"&&(e["--input"]=T.resolve(i,e["--input"]),je(e["--input"])||($(`Specified input file ${F(N(e["--input"]))} does not exist.`),process.exit(1)));e["--input"]===e["--output"]&&e["--input"]!=="-"&&($(`Specified input file ${F(N(e["--input"]))} and output file ${F(N(e["--output"]))} are identical.`),process.exit(1));e["--map"]==="-"&&($("Use --map without a value to inline the source map"),process.exit(1));e["--map"]&&e["--map"]!==!0&&(e["--map"]=T.resolve(i,e["--map"]));let r=process.hrtime.bigint();let o=e["--input"]?e["--input"]==="-"?await H():await ee.readFile(e["--input"],"utf-8"):we`
2
+ var ht=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),gt=t=>{throw TypeError(t)};var et=(t,e,n)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&gt("Object expected");var i,s;n&&(i=e[ht("asyncDispose")]),i===void 0&&(i=e[ht("dispose")],n&&(s=i)),typeof i!="function"&&gt("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},nt=(t,e,n)=>{var i=typeof SuppressedError=="function"?SuppressedError:function(l,o,a,c){return c=Error(a),c.name="SuppressedError",c.error=l,c.suppressed=o,c},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 Mt 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=Mt(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]=wt(n[a],r))}{let a=s.slice(2);n[a]!==void 0&&(i[s]=wt(n[a],r))}}return i}function wt(t,e){switch(e){case"string":return I(t);case"boolean":return U(t);case"number":return z(t);case"boolean | string":return U(t)??I(t);case"number | string":return z(t)??I(t);case"boolean | number":return U(t)??z(t);case"boolean | number | string":return U(t)??z(t)??I(t);default:throw new Error(`Unhandled type: ${e}`)}}function U(t){if(t===!0||t===!1)return t;if(t==="true")return!0;if(t==="false")return!1}function z(t){if(typeof t=="number")return t;{let e=Number(t);if(!Number.isNaN(e))return e}}function I(t){return`${t}`}import qt from"@parcel/watcher";import{compile as Qt,env as Ht,Instrumentation as xt,optimize as Jt,toSourceMap as Y}from"@tailwindcss/node";import{clearRequireCache as Zt}from"@tailwindcss/node/require-cache";import{Scanner as Xt}from"@tailwindcss/oxide";import{existsSync as te}from"fs";import lt from"fs/promises";import T from"path";var P=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 Kt from"fs";import Ct from"path";import{stripVTControlCharacters as Gt}from"util";import w from"picocolors";import bt from"enhanced-resolve";import jt from"fs";import{createRequire as Dt}from"module";var Wt=Dt(import.meta.url).resolve;function yt(t){if(typeof globalThis.__tw_resolve=="function"){let e=globalThis.__tw_resolve(t);if(e)return e}return Wt(t)}var Ee=bt.ResolverFactory.createResolver({fileSystem:new bt.CachedInputFileSystem(jt,4e3),useSyncFileSystemCalls:!0,extensions:[".css"],mainFields:["style"],conditionNames:["style"]});function St(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 M={indent:2};function j(){return`${w.italic(w.bold(w.blue("\u2248")))} tailwindcss ${w.blue(`v${Yt()}`)}`}function A(t){return`${w.dim(w.blue("`"))}${w.blue(t)}${w.dim(w.blue("`"))}`}function D(t,e=process.cwd(),{preferAbsoluteIfShorter:n=!0}={}){let i=Ct.relative(e,t);return i.startsWith("..")||(i=`.${Ct.sep}${i}`),n&&i.length>t.length?t:i}function it(t,e){let n=t.split(" "),i=[],s="",r=0;for(let l of n){let o=Gt(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 W(t){let e=St(t);return t<=50*1e6?w.green(e):t<=300*1e6?w.blue(e):t<=1e3*1e6?w.yellow(e):w.red(e)}function B(t,e=0){return`${" ".repeat(e+M.indent)}${t}`}function _(t=""){process.stderr.write(`${t}
3
+ `)}function K(t=""){process.stdout.write(`${t}
4
+ `)}function Yt(){if(typeof globalThis.__tw_version=="string")return globalThis.__tw_version;let{version:t}=JSON.parse(Kt.readFileSync(yt("tailwindcss/package.json"),"utf-8"));return t}import G from"fs/promises";import Vt from"path";function rt(){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 ot(t,e){if(!await G.stat(t).then(i=>i.isCharacterDevice()||i.isFIFO()).catch(()=>!1))try{if(await G.readFile(t,"utf8")===e)return}catch{}await G.mkdir(Vt.dirname(t),{recursive:!0}),await G.writeFile(t,e,"utf8")}var _t=String.raw,u=Ht.DEBUG;function $(){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}}}async function st(t){try{return await t()}catch(e){e instanceof Error&&_(e.toString()),process.exit(1)}}async function at(t){var L=[];try{_(j());_();let e=et(L,new xt);u&&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"]),te(t["--input"])||(_(`Specified input file ${A(D(t["--input"]))} does not exist.`),process.exit(1)));t["--input"]===t["--output"]&&t["--input"]!=="-"&&(_(`Specified input file ${A(D(t["--input"]))} and output file ${A(D(t["--output"]))} are identical.`),process.exit(1));t["--map"]==="-"&&(_("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 rt():await lt.readFile(t["--input"],"utf-8"):_t`
5
5
  @import 'tailwindcss';
6
- `;let n={css:"",optimizedCss:""};async function u(S,w,c,x){let g=S;if(c["--minify"]||c["--optimize"])if(S!==n.css){a&&x.start("Optimize CSS");let _=Ue(S,{file:c["--input"]??"input.css",minify:c["--minify"]??!1,map:w?.raw??void 0});a&&x.end("Optimize CSS"),n.css=S,n.optimizedCss=_.code,_.map&&(w=U(_.map)),g=_.code}else g=n.optimizedCss;if(w){if(c["--map"]===!0)g+=`
7
- `,g+=w.inline;else if(typeof c["--map"]=="string"){let _=c["--output"]&&c["--output"]!=="-"?T.dirname(T.resolve(c["--output"])):process.cwd(),j=T.resolve(c["--map"]),f=T.relative(_,j);g+=`
8
- `,g+=w.comment(f),a&&x.start("Write source map"),await X(c["--map"],w.raw),a&&x.end("Write source map")}}a&&x.start("Write output"),c["--output"]&&c["--output"]!=="-"?await X(c["--output"],g):h(g),a&&x.end("Write output")}let s=e["--input"]&&e["--input"]!=="-"?T.resolve(e["--input"]):null;let l=s?T.dirname(s):process.cwd();let p=s?[s]:[];async function m(S,w){a&&w.start("Setup compiler");let c=await We(S,{from:e["--output"]?s??"stdin.css":void 0,base:l,onDependency(_){p.push(_)}}),x=(c.root==="none"?[]:c.root===null?[{base:i,pattern:"**/*",negated:!1}]:[{...c.root,negated:!1}]).concat(c.sources),g=new Le({sources:x});return a&&w.end("Setup compiler"),[c,g]}let[d,y]=await Z(()=>m(o,t));if(e["--watch"]){let S=[];S.push(await be(ge(y),async function w(c){try{var x=[];try{if(c.length===1&&c[0]===e["--output"])return;let f=J(x,new ye);a&&f.start("[@tailwindcss/cli] (watcher)");let oe=process.hrtime.bigint();let se=[];let V="incremental";let le=p;for(let v of c){if(le.includes(v)){V="full";break}se.push({file:v,extension:T.extname(v).slice(1)})}let q="";let K=null;if(V==="full"){let v=e["--input"]?e["--input"]==="-"?await H():await ee.readFile(e["--input"],"utf-8"):we`
6
+ `;let r={css:"",optimizedCss:""};async function l(C,g,f,x){let y=C;if(f["--minify"]||f["--optimize"])if(C!==r.css){u&&x.start("Optimize CSS");let E=Jt(C,{file:f["--input"]??"input.css",minify:f["--minify"]??!1,map:g?.raw??void 0});u&&x.end("Optimize CSS"),r.css=C,r.optimizedCss=E.code,E.map&&(g=Y(E.map)),y=E.code}else y=r.optimizedCss;if(g){if(f["--map"]===!0)y+=`
7
+ `,y+=g.inline;else if(typeof f["--map"]=="string"){let E=f["--output"]&&f["--output"]!=="-"?T.dirname(T.resolve(f["--output"])):process.cwd(),H=T.resolve(f["--map"]),m=T.relative(E,H);y+=`
8
+ `,y+=g.comment(m),u&&x.start("Write source map"),await ot(f["--map"],g.raw),u&&x.end("Write source map")}}u&&x.start("Write output"),f["--output"]&&f["--output"]!=="-"?await ot(f["--output"],y):K(y),u&&x.end("Write output")}let o=t["--input"]&&t["--input"]!=="-"?T.resolve(t["--input"]):null;let a=o?T.dirname(o):process.cwd();let c=o?[o]:[];async function b(C,g){u&&g.start("Setup compiler");let f=await Qt(C,{from:t["--output"]?o??"stdin.css":void 0,base:a,onDependency(E){c.push(E)}}),x=(f.root==="none"?[]:f.root===null?[{base:n,pattern:"**/*",negated:!1}]:[{...f.root,negated:!1}]).concat(f.sources),y=new Xt({sources:x});return u&&g.end("Setup compiler"),[f,y]}let[p,d]=await st(()=>b(s,e));if(t["--watch"]){let C=[];C.push(await Tt(Et(d),async function g(f){try{var x=[];try{if(f.length===1&&f[0]===t["--output"])return;let m=et(x,new xt);u&&m.start("[@tailwindcss/cli] (watcher)");let dt=process.hrtime.bigint();let ft=[];let J="incremental";let mt=c;for(let O of f){if(mt.includes(O)){J="full";break}ft.push({file:O,extension:T.extname(O).slice(1)})}let Z="";let X=null;if(J==="full"){let O=t["--input"]?t["--input"]==="-"?await rt():await lt.readFile(t["--input"],"utf-8"):_t`
9
9
  @import 'tailwindcss';
10
- `;Ie(le),p=s?[s]:[],[d,y]=await m(v,f),a&&f.start("Scan for candidates");let G=y.scan();a&&f.end("Scan for candidates"),a&&f.start("Setup new watchers");let Fe=await be(ge(y),w);a&&f.end("Setup new watchers"),a&&f.start("Cleanup old watchers"),await Promise.all(S.splice(0).map(Ae=>Ae())),a&&f.end("Cleanup old watchers"),S.push(Fe),a&&f.start("Build CSS"),q=d.build(G),a&&f.end("Build CSS"),e["--map"]&&(a&&f.start("Build Source Map"),K=U(d.buildSourceMap()),a&&f.end("Build Source Map"))}else if(V==="incremental"){a&&f.start("Scan for candidates");let v=y.scanFiles(se);if(a&&f.end("Scan for candidates"),v.length<=0){let G=process.hrtime.bigint();$(`Done in ${W(G-oe)}`);return}a&&f.start("Build CSS"),q=d.build(v),a&&f.end("Build CSS"),e["--map"]&&(a&&f.start("Build Source Map"),K=U(d.buildSourceMap()),a&&f.end("Build Source Map"))}await u(q,K,e,f);let Ce=process.hrtime.bigint();$(`Done in ${W(Ce-oe)}`)}catch(g){var _=g,j=!0}finally{Q(x,_,j)}}catch(f){f instanceof Error&&$(f.toString())}})),e["--watch"]!=="always"&&process.stdin.on("end",()=>{Promise.all(S.map(w=>w())).then(()=>process.exit(0),()=>process.exit(1))}),process.stdin.resume()}a&&t.start("Scan for candidates");let L=y.scan();a&&t.end("Scan for candidates");a&&t.start("Build CSS");let M=await Z(()=>d.build(L));a&&t.end("Build CSS");let B=null;e["--map"]&&(a&&t.start("Build Source Map"),B=await Z(()=>U(d.buildSourceMap())),a&&t.end("Build Source Map"));await u(M,B,e,t);let $e=process.hrtime.bigint();$(`Done in ${W($e-r)}`)}catch(Te){var _e=Te,ve=!0}finally{Q(re,_e,ve)}}async function be(e,t){e=e.sort((s,l)=>s.length-l.length);let i=[];for(let s=0;s<e.length;++s)for(let l=0;l<s;++l)e[s].startsWith(`${e[l]}/`)&&i.push(e[s]);e=e.filter(s=>!i.includes(s));let r=new A,o=new Set,n=new A;async function u(){await n.dispose(),n.queueMacrotask(()=>{t(Array.from(o)),o.clear()})}for(let s of e){let{unsubscribe:l}=await Ne.subscribe(s,async(p,m)=>{if(p){console.error(p);return}await Promise.all(m.map(async d=>{if(d.type==="delete")return;let y=null;try{y=await ee.lstat(d.path)}catch{}!y?.isFile()&&!y?.isSymbolicLink()||o.add(d.path)})),await u()});r.add(l)}return async()=>{await r.dispose(),await n.dispose()}}function ge(e){return[...new Set(e.normalizedSources.flatMap(t=>t.base))]}import C from"picocolors";function te({invalid:e,usage:t,options:i}){let r=process.stdout.columns;if(h(z()),e&&(h(),h(`${C.dim("Invalid command:")} ${e}`)),t&&t.length>0){h(),h(C.dim("Usage:"));for(let[o,n]of t.entries()){let u=n.slice(0,n.indexOf("[")),s=n.slice(n.indexOf("["));s=s.replace(/\[.*?\]/g,m=>C.dim(m));let p=Y(s,r-P.indent-u.length-1);p.length>1&&o!==0&&h(),h(k(`${u}${p.shift()}`));for(let m of p)h(k(m,u.length))}}if(i){let o=0;for(let{alias:l}of Object.values(i))l&&(o=Math.max(o,l.length));let n=[],u=0;for(let[l,{alias:p,values:m}]of Object.entries(i)){m?.length&&(l+=`[=${m.join(", ")}]`);let d=[p&&`${p.padStart(o)}`,p?l:" ".repeat(o+2)+l].filter(Boolean).join(", ");n.push(d),u=Math.max(u,d.length)}h(),h(C.dim("Options:"));let s=8;for(let{description:l,default:p=null}of Object.values(i)){let m=n.shift(),d=s+(u-m.length),y=2,L=r-m.length-d-y-P.indent,M=Y(p!==null?`${l} ${C.dim(`[default:\u202F${F(`${p}`)}]`)}`:l,L);h(k(`${C.blue(m)} ${C.dim(C.gray("\xB7")).repeat(d)} ${M.shift()}`));for(let B of M)h(k(`${" ".repeat(m.length+d+y)}${B}`))}}}var ne={"--help":{type:"boolean",description:"Display usage information",alias:"-h"}},ie=ce({...I(),...ne}),xe=ie._[0];xe&&(te({invalid:xe,usage:["tailwindcss [options]"],options:{...I(),...ne}}),process.exit(1));(process.stdout.isTTY&&process.argv[2]===void 0||ie["--help"])&&(te({usage:["tailwindcss [--input input.css] [--output output.css] [--watch] [options\u2026]"],options:{...I(),...ne}}),process.exit(0));Se(ie);
10
+ `;Zt(mt),c=o?[o]:[],[p,d]=await b(O,m),u&&m.start("Scan for candidates");let tt=d.scan();u&&m.end("Scan for candidates"),u&&m.start("Setup new watchers");let zt=await Tt(Et(d),g);u&&m.end("Setup new watchers"),u&&m.start("Cleanup old watchers"),await Promise.all(C.splice(0).map(It=>It())),u&&m.end("Cleanup old watchers"),C.push(zt),u&&m.start("Build CSS"),Z=p.build(tt),u&&m.end("Build CSS"),t["--map"]&&(u&&m.start("Build Source Map"),X=Y(p.buildSourceMap()),u&&m.end("Build Source Map"))}else if(J==="incremental"){u&&m.start("Scan for candidates");let O=d.scanFiles(ft);if(u&&m.end("Scan for candidates"),O.length<=0){let tt=process.hrtime.bigint();_(`Done in ${W(tt-dt)}`);return}u&&m.start("Build CSS"),Z=p.build(O),u&&m.end("Build CSS"),t["--map"]&&(u&&m.start("Build Source Map"),X=Y(p.buildSourceMap()),u&&m.end("Build Source Map"))}await l(Z,X,t,m);let Ut=process.hrtime.bigint();_(`Done in ${W(Ut-dt)}`)}catch(y){var E=y,H=!0}finally{nt(x,E,H)}}catch(m){m instanceof Error&&_(m.toString())}})),t["--watch"]!=="always"&&process.stdin.on("end",()=>{Promise.all(C.map(g=>g())).then(()=>process.exit(0),()=>process.exit(1))}),process.stdin.resume()}u&&e.start("Scan for candidates");let h=d.scan();u&&e.end("Scan for candidates");u&&e.start("Build CSS");let S=await st(()=>p.build(h));u&&e.end("Build CSS");let N=null;t["--map"]&&(u&&e.start("Build Source Map"),N=await st(()=>Y(p.buildSourceMap())),u&&e.end("Build Source Map"));await l(S,N,t,e);let q=process.hrtime.bigint();_(`Done in ${W(q-i)}`)}catch(Q){var Ft=Q,kt=!0}finally{nt(L,Ft,kt)}}async function Tt(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 P,s=new Set,r=new P;async function l(){await r.dispose(),r.queueMacrotask(()=>{e(Array.from(s)),s.clear()})}for(let o of t){let{unsubscribe:a}=await qt.subscribe(o,async(c,b)=>{if(c){console.error(c);return}await Promise.all(b.map(async p=>{if(p.type==="delete")return;let d=null;try{d=await lt.lstat(p.path)}catch{}!d?.isFile()&&!d?.isSymbolicLink()||s.add(p.path)})),await l()});i.add(a)}return async()=>{await i.dispose(),await r.dispose()}}function Et(t){return[...new Set(t.normalizedSources.flatMap(e=>e.base))]}import{__unstable__loadDesignSystem as vt}from"@tailwindcss/node";import ne from"fs/promises";import Rt from"path";function ut(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,c=r+1,b=r,p=r+1;for(l=t.charCodeAt(c);l>=48&&l<=57;)l=t.charCodeAt(++c);for(o=e.charCodeAt(p);o>=48&&o<=57;)o=e.charCodeAt(++p);let d=t.slice(a,c),h=e.slice(b,p),S=Number(d)-Number(h);if(S)return S;if(d<h)return-1;if(d>h)return 1;continue}if(l!==o)return l-o}return t.length-e.length}var V=new Uint8Array(256);function Ot(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 c=t.charCodeAt(o);if(c===92){o+=1;continue}if(c===a)break}break;case 40:V[n]=41,n++;break;case 91:V[n]=93,n++;break;case 123:V[n]=125,n++;break;case 93:case 125:case 41:n>0&&a===V[n-1]&&n--;break}}return i.push(t.slice(s)),i}import v from"picocolors";function F({render:t=!0,invalid:e,usage:n,options:i}){let s=process.stdout.columns??80,r=[],l=t?K:(o="")=>void r.push(o);if(l(j()),e&&(l(),l(`${v.dim("Invalid command:")} ${e}`)),n&&n.length>0){l(),l(v.dim("Usage:"));for(let[o,a]of n.entries()){let c=a.slice(0,a.indexOf("[")),b=a.slice(a.indexOf("["));b=b.replace(/\[.*?\]/g,h=>v.dim(h));let d=it(b,s-M.indent-c.length-1);d.length>1&&o!==0&&l(),l(B(`${c}${d.shift()}`));for(let h of d)l(B(h,c.length))}}if(i){let o=0;for(let{alias:p}of Object.values(i))p&&(o=Math.max(o,p.length));let a=[],c=0;for(let[p,{alias:d,values:h}]of Object.entries(i)){h?.length&&(p+=`[=${h.join(", ")}]`);let S=[d&&`${d.padStart(o)}`,d?p:" ".repeat(o+2)+p].filter(Boolean).join(", ");a.push(S),c=Math.max(c,S.length)}l(),l(v.dim("Options:"));let b=8;for(let{description:p,default:d=null}of Object.values(i)){let h=a.shift(),S=b+(c-h.length),N=2,q=s-h.length-S-N-M.indent,L=it(d!==null?`${p} ${v.dim(`[default:\u202F${A(`${d}`)}]`)}`:p,q);l(B(`${v.blue(h)} ${v.dim(v.gray("\xB7")).repeat(S)} ${L.shift()}`));for(let Q of L)l(B(`${" ".repeat(h.length+S+N)}${Q}`))}}if(!t)return r.join(`
11
+ `)}var ie=String.raw;function ct(){return"tailwindcss canonicalize [classes...]"}function re(){return"tailwindcss canonicalize --css input.css [classes...]"}function $t(){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"]}}}var Nt={"--help":{type:"boolean",description:"Display usage information",alias:"-h",default:!1}};async function Lt({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({...$t(),...Nt},t);if(s&&t.length===0||r["--help"])return{exitCode:0,stdout:Pt(),stderr:""};let l=ce(r["--format"]),o=r._.length>0?r._:await oe({stdin:n,stdinIsTTY:i});if(o.length===0)return pe("No candidate groups provided");let a=await le({css:r["--css"],cwd:e,inputs:o});return{exitCode:0,stdout:ae(a,l),stderr:""}}catch(r){return{exitCode:1,stdout:"",stderr:r instanceof Error?r.message:String(r)}}}function oe({stdin:t,stdinIsTTY:e}){return t!==null?Promise.resolve(At(t)):e?Promise.resolve([]):se().then(At)}async function se(){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 le({css:t,cwd:e=process.cwd(),inputs:n}){let i=await ue(t,e);return n.map(s=>{let r=de(s),o=fe(i,i.canonicalizeCandidates(r,{collapse:!0,logicalToPhysical:!0})).join(" ");return{input:s,output:o,changed:o!==s}})}function ae(t,e){switch(e){case"json":return JSON.stringify(t,null,2);case"jsonl":return t.map(n=>JSON.stringify(n)).join(`
12
+ `);case"text":return t.map(n=>n.output).join(`
13
+ `)}}function Pt(){return F({render:!1,usage:[ct(),re()],options:{...$t(),...Nt}})}async function ue(t,e){if(t===null)return vt(ie`
14
+ @import 'tailwindcss';
15
+ `,{base:e});let n=Rt.resolve(e,t),i=await ne.readFile(n,"utf8");return vt(i,{base:Rt.dirname(n)})}function At(t){return t.split(/\r?\n/g).map(e=>e.trim()).filter(e=>e.length>0)}function ce(t){if(t==="text"||t==="json"||t==="jsonl")return t;throw new Error(`Invalid value for --format: ${t}`)}function pe(t){return{exitCode:1,stdout:Pt(),stderr:t}}function de(t){let e=t.trim();return e.length===0?[]:Ot(e," ").map(n=>n.trim()).filter(n=>n.length>0)}function fe(t,e){return me(t.getClassOrder(e))}function me(t){return t.slice().sort(([e,n],[i,s])=>n===s?ut(e,i):n===null?-1:s===null?1:he(n-s)||ut(e,i)).map(([e])=>e)}function he(t){return t>0n?1:t===0n?0:-1}var k={"--help":{type:"boolean",description:"Display usage information",alias:"-h"}};function pt(t="tailwindcss"){return`${t} [--input input.css] [--output output.css] [--watch] [options\u2026]`}function Bt({invalid:t}={}){F({invalid:t,usage:[pt("tailwindcss"),pt("tailwindcss build"),ct()],commands:{build:"Build your CSS",canonicalize:"Canonicalize candidate lists"},options:{...$(),...k}})}async function we(){let t=process.argv.slice(2),e=t[0],n=R({...$(),...k},t);if(e==="build"){let s=R({...$(),...k},t.slice(1));(process.stdout.isTTY&&t.length===1||s["--help"])&&(F({usage:[pt("tailwindcss build")],options:{...$(),...k}}),process.exit(0)),await at(s);return}if(e==="canonicalize"){let s=await Lt({argv:t.slice(1)});s.stdout.length>0&&process.stdout.write(`${s.stdout}
16
+ `),s.stderr.length>0&&process.stderr.write(`${s.stderr}
17
+ `),process.exitCode=s.exitCode;return}(process.stdout.isTTY&&e===void 0||n["--help"])&&(Bt(),process.exit(0)),e&&!e.startsWith("-")&&(Bt({invalid:e}),process.exit(1));let i=R({...$(),...k});await at(i)}await we();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailwindcss/cli",
3
- "version": "0.0.0-insiders.df96ea5",
3
+ "version": "0.0.0-insiders.dfc449c",
4
4
  "description": "A utility-first CSS framework for rapidly building custom user interfaces.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -25,12 +25,12 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@parcel/watcher": "^2.5.1",
28
- "enhanced-resolve": "^5.18.4",
28
+ "enhanced-resolve": "^5.19.0",
29
29
  "mri": "^1.2.0",
30
30
  "picocolors": "^1.1.1",
31
- "@tailwindcss/node": "0.0.0-insiders.df96ea5",
32
- "@tailwindcss/oxide": "0.0.0-insiders.df96ea5",
33
- "tailwindcss": "0.0.0-insiders.df96ea5"
31
+ "@tailwindcss/node": "0.0.0-insiders.dfc449c",
32
+ "tailwindcss": "0.0.0-insiders.dfc449c",
33
+ "@tailwindcss/oxide": "0.0.0-insiders.dfc449c"
34
34
  },
35
35
  "scripts": {
36
36
  "lint": "tsc --noEmit",