@tailwindcss/cli 0.0.0-insiders.ed45952 → 0.0.0-insiders.ed52d3e

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
@@ -15,8 +15,8 @@
15
15
  <p align="center">
16
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>
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,10 @@
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 q=(t,e,n)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&rt("Object expected");var i,o;n&&(i=e[it("asyncDispose")]),i===void 0&&(i=e[it("dispose")],n&&(o=i)),typeof i!="function"&&rt("Object not disposable"),o&&(i=function(){try{o.call(this)}catch(r){return Promise.reject(r)}}),t.push([n,i,e])}else n&&t.push([n]);return e},K=(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},o=a=>e=n?new i(a,e,"An error was suppressed during disposal"):(n=!0,a),r=a=>{for(;a=t.pop();)try{var s=a[1]&&a[1].call(a[2]);if(a[0])return Promise.resolve(s).then(r,l=>(o(l),r()))}catch(l){o(l)}if(n)throw e};return r()};import Ct from"mri";function st(t,e=process.argv.slice(2)){for(let[o,r]of e.entries())r==="-"&&(e[o]="__IO_DEFAULT_VALUE__");let n=Ct(e);for(let o in n)n[o]==="__IO_DEFAULT_VALUE__"&&(n[o]="-");let i={_:n._};for(let[o,{type:r,alias:a,default:s=r==="boolean"?!1:null}]of Object.entries(t)){if(i[o]=s,a){let l=a.slice(1);n[l]!==void 0&&(i[o]=ot(n[l],r))}{let l=o.slice(2);n[l]!==void 0&&(i[o]=ot(n[l],r))}}return i}function ot(t,e){switch(e){case"string":return z(t);case"boolean":return R(t);case"number":return B(t);case"boolean | string":return R(t)??z(t);case"number | string":return B(t)??z(t);case"boolean | number":return R(t)??B(t);case"boolean | number | string":return R(t)??B(t)??z(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 B(t){if(typeof t=="number")return t;{let e=Number(t);if(!Number.isNaN(e))return e}}function z(t){return`${t}`}import zt from"@parcel/watcher";import{compile as Dt,env as Nt,Instrumentation as ft,optimize as Et}from"@tailwindcss/node";import{clearRequireCache as Wt}from"@tailwindcss/node/require-cache";import{Scanner as It}from"@tailwindcss/oxide";import{existsSync as Ut}from"node:fs";import Q from"node:fs/promises";import A from"node:path";var F=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"node:fs";import pt from"node:path";import{stripVTControlCharacters as Ot}from"node:util";import y from"picocolors";import lt from"enhanced-resolve";import vt from"node:fs";import{createRequire as At}from"node:module";var Ft=At(import.meta.url).resolve;function at(t){if(typeof globalThis.__tw_resolve=="function"){let e=globalThis.__tw_resolve(t);if(e)return e}return Ft(t)}var Jt=lt.ResolverFactory.createResolver({fileSystem:new lt.CachedInputFileSystem(vt,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 C(){return`${y.italic(y.bold(y.blue("\u2248")))} tailwindcss ${y.blue(`v${Rt()}`)}`}function v(t){return`${y.dim(y.blue("`"))}${y.blue(t)}${y.dim(y.blue("`"))}`}function N(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 M(t,e){let n=t.split(" "),i=[],o="",r=0;for(let a of n){let s=Ot(a).length;r+s+1>e&&(i.push(o),o="",r=0),o+=(r?" ":"")+a,r+=s+(r?1:0)}return r&&i.push(o),i}function E(t){let e=ut(t);return t<=50*1e6?y.green(e):t<=300*1e6?y.blue(e):t<=1e3*1e6?y.yellow(e):y.red(e)}function k(t,e=0){return`${" ".repeat(e+D.indent)}${t}`}function h(t=""){process.stderr.write(`${t}
3
- `)}function d(t=""){process.stdout.write(`${t}
4
- `)}function Rt(){if(typeof globalThis.__tw_version=="string")return globalThis.__tw_version;let{version:t}=JSON.parse(kt.readFileSync(at("tailwindcss/package.json"),"utf-8"));return t}import G from"node:fs/promises";import Bt 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 ct(t,e){try{if(await G.readFile(t,"utf8")===e)return}catch{}await G.mkdir(Bt.dirname(t),{recursive:!0}),await G.writeFile(t,e,"utf8")}var dt=String.raw,p=Nt.DEBUG;function W(){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 mt(t){try{return await t()}catch(e){e instanceof Error&&h(e.toString()),process.exit(1)}}async function yt(t){var Z=[];try{let e=q(Z,new ft);p&&e.start("[@tailwindcss/cli] (initial build)");let n=A.resolve(t["--cwd"]);t["--output"]&&t["--output"]!=="-"&&(t["--output"]=A.resolve(n,t["--output"]));t["--input"]&&t["--input"]!=="-"&&(t["--input"]=A.resolve(n,t["--input"]),Ut(t["--input"])||(h(C()),h(),h(`Specified input file ${v(N(t["--input"]))} does not exist.`),process.exit(1)));t["--input"]===t["--output"]&&t["--input"]!=="-"&&(h(C()),h(),h(`Specified input file ${v(N(t["--input"]))} and output file ${v(N(t["--output"]))} are identical.`),process.exit(1));let i=process.hrtime.bigint();let o=t["--input"]?t["--input"]==="-"?await J():await Q.readFile(t["--input"],"utf-8"):dt`
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`
5
5
  @import 'tailwindcss';
6
- `;let r={css:"",optimizedCss:""};async function a(S,w,m){let x=S;if(w["--minify"]||w["--optimize"])if(S!==r.css){p&&m.start("Optimize CSS");let _=Et(S,{file:w["--input"]??"input.css",minify:w["--minify"]??!1});p&&m.end("Optimize CSS"),r.css=S,r.optimizedCss=_,x=_}else x=r.optimizedCss;p&&m.start("Write output"),w["--output"]&&w["--output"]!=="-"?await ct(w["--output"],x):d(x),p&&m.end("Write output")}let s=t["--input"]&&t["--input"]!=="-"?A.resolve(t["--input"]):null;let l=s?A.dirname(s):process.cwd();let u=s?[s]:[];async function f(S,w){p&&w.start("Setup compiler");let m=await Dt(S,{base:l,onDependency(L){u.push(L)}}),x=(m.root==="none"?[]:m.root===null?[{base:n,pattern:"**/*",negated:!1}]:[{...m.root,negated:!1}]).concat(m.sources),_=new It({sources:x});return p&&w.end("Setup compiler"),[m,_]}let[b,g]=await mt(()=>f(o,e));if(t["--watch"]){let S=await ht(gt(g),async function w(m){try{var x=[];try{if(m.length===1&&m[0]===t["--output"])return;let c=q(x,new ft);p&&c.start("[@tailwindcss/cli] (watcher)");let tt=process.hrtime.bigint();let et=[];let j="incremental";let nt=u;for(let $ of m){if(nt.includes($)){j="full";break}et.push({file:$,extension:A.extname($).slice(1)})}let P="";if(j==="full"){let $=t["--input"]?t["--input"]==="-"?await J():await Q.readFile(t["--input"],"utf-8"):dt`
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`
7
9
  @import 'tailwindcss';
8
- `;Wt(nt),u=s?[s]:[],[b,g]=await f($,c),p&&c.start("Scan for candidates");let V=g.scan();p&&c.end("Scan for candidates"),p&&c.start("Setup new watchers");let _t=await ht(gt(g),w);p&&c.end("Setup new watchers"),p&&c.start("Cleanup old watchers"),await S(),p&&c.end("Cleanup old watchers"),S=_t,p&&c.start("Build CSS"),P=b.build(V),p&&c.end("Build CSS")}else if(j==="incremental"){p&&c.start("Scan for candidates");let $=g.scanFiles(et);if(p&&c.end("Scan for candidates"),$.length<=0){let V=process.hrtime.bigint();h(`Done in ${E(V-tt)}`);return}p&&c.start("Build CSS"),P=b.build($),p&&c.end("Build CSS")}await a(P,t,c);let Tt=process.hrtime.bigint();h(`Done in ${E(Tt-tt)}`)}catch(_){var L=_,$t=!0}finally{K(x,L,$t)}}catch(c){c instanceof Error&&h(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 I=g.scan();p&&e.end("Scan for candidates");p&&e.start("Build CSS");let O=await mt(()=>b.build(I));p&&e.end("Build CSS");await a(O,t,e);let U=process.hrtime.bigint();h(C());h();h(`Done in ${E(U-i)}`)}catch(wt){var St=wt,xt=!0}finally{K(Z,St,xt)}}async function ht(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 F,o=new Set,r=new F;async function a(){await r.dispose(),r.queueMacrotask(()=>{e(Array.from(o)),o.clear()})}for(let s of t){let{unsubscribe:l}=await zt.subscribe(s,async(u,f)=>{if(u){console.error(u);return}await Promise.all(f.map(async b=>{if(b.type==="delete")return;let g=null;try{g=await Q.lstat(b.path)}catch{}!g?.isFile()&&!g?.isSymbolicLink()||o.add(b.path)})),await a()});i.add(l)}return async()=>{await i.dispose(),await r.dispose()}}function gt(t){return[...new Set(t.normalizedSources.flatMap(e=>e.base))]}import T from"picocolors";function Y({invalid:t,usage:e,options:n}){let i=process.stdout.columns;if(d(C()),t&&(d(),d(`${T.dim("Invalid command:")} ${t}`)),e&&e.length>0){d(),d(T.dim("Usage:"));for(let[o,r]of e.entries()){let a=r.slice(0,r.indexOf("[")),s=r.slice(r.indexOf("["));s=s.replace(/\[.*?\]/g,f=>T.dim(f));let u=M(s,i-D.indent-a.length-1);u.length>1&&o!==0&&d(),d(k(`${a}${u.shift()}`));for(let f of u)d(k(f,a.length))}}if(n){let o=0;for(let{alias:l}of Object.values(n))l&&(o=Math.max(o,l.length));let r=[],a=0;for(let[l,{alias:u}]of Object.entries(n)){let f=[u&&`${u.padStart(o)}`,u?l:" ".repeat(o+2)+l].filter(Boolean).join(", ");r.push(f),a=Math.max(a,f.length)}d(),d(T.dim("Options:"));let s=8;for(let{description:l,default:u=null}of Object.values(n)){let f=r.shift(),b=s+(a-f.length),g=2,I=i-f.length-b-g-D.indent,O=M(u!==null?`${l} ${T.dim(`[default:\u202F${v(`${u}`)}]`)}`:l,I);d(k(`${T.blue(f)} ${T.dim(T.gray("\xB7")).repeat(b)} ${O.shift()}`));for(let U of O)d(k(`${" ".repeat(f.length+b+g)}${U}`))}}}var H={"--help":{type:"boolean",description:"Display usage information",alias:"-h"}},X=st({...W(),...H}),bt=X._[0];bt&&(Y({invalid:bt,usage:["tailwindcss [options]"],options:{...W(),...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:{...W(),...H}}),process.exit(0));yt(X);
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailwindcss/cli",
3
- "version": "0.0.0-insiders.ed45952",
3
+ "version": "0.0.0-insiders.ed52d3e",
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.1",
28
+ "enhanced-resolve": "^5.18.4",
29
29
  "mri": "^1.2.0",
30
30
  "picocolors": "^1.1.1",
31
- "tailwindcss": "0.0.0-insiders.ed45952",
32
- "@tailwindcss/oxide": "0.0.0-insiders.ed45952",
33
- "@tailwindcss/node": "0.0.0-insiders.ed45952"
31
+ "@tailwindcss/node": "0.0.0-insiders.ed52d3e",
32
+ "tailwindcss": "0.0.0-insiders.ed52d3e",
33
+ "@tailwindcss/oxide": "0.0.0-insiders.ed52d3e"
34
34
  },
35
35
  "scripts": {
36
36
  "lint": "tsc --noEmit",