@tailwindcss/postcss 4.0.0-alpha.25 → 4.0.0-alpha.26

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 CHANGED
@@ -1 +1 @@
1
- "use strict";var W=Object.create;var R=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var B=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty;var F=(i,s,e,r)=>{if(s&&typeof s=="object"||typeof s=="function")for(let o of j(s))!D.call(i,o)&&o!==e&&R(i,o,{get:()=>s[o],enumerable:!(r=N(s,o))||r.enumerable});return i};var h=(i,s,e)=>(e=i!=null?W(B(i)):{},F(s||!i||!i.__esModule?R(e,"default",{value:i,enumerable:!0}):e,i));var C=require("@tailwindcss/node"),O=require("@tailwindcss/node/require-cache"),z=require("@tailwindcss/oxide"),A=h(require("fs")),m=require("lightningcss"),S=h(require("path")),E=h(require("postcss"));var x=require("@tailwindcss/node"),u=h(require("path")),b="'",w='"';function v(){let i=new WeakSet;function s(e){let r=e.root().source?.input.file;if(!r)return;let o=e.source?.input.file;if(!o||i.has(e))return;let n=e.params[0],p=n[0]===w&&n[n.length-1]===w?w:n[0]===b&&n[n.length-1]===b?b:null;if(!p)return;let t=e.params.slice(1,-1),d="";if(t.startsWith("!")&&(t=t.slice(1),d="!"),!t.startsWith("./")&&!t.startsWith("../"))return;let g=u.default.posix.join((0,x.normalizePath)(u.default.dirname(o)),t),f=u.default.posix.dirname((0,x.normalizePath)(r)),a=u.default.posix.relative(f,g);a.startsWith(".")||(a="./"+a),e.params=p+d+a+p,i.add(e)}return{postcssPlugin:"tailwindcss-postcss-fix-relative-paths",AtRule:{source:s,plugin:s,config:s}}}var T=class extends Map{constructor(e){super();this.factory=e}get(e){let r=super.get(e);return r===void 0&&(r=this.factory(e,this),this.set(e,r)),r}};function L(i={}){let s=i.base??process.cwd(),e=i.optimize??process.env.NODE_ENV==="production",r=new T(()=>({mtimes:new Map,compiler:null,css:"",optimizedCss:"",fullRebuildPaths:[]}));return{postcssPlugin:"@tailwindcss/postcss",plugins:[v(),{postcssPlugin:"tailwindcss",async OnceExit(o,{result:n}){let p=n.opts.from??"",t=r.get(p),d=S.default.dirname(S.default.resolve(p));async function g(){return(0,O.clearRequireCache)(t.fullRebuildPaths),t.fullRebuildPaths=[],(0,C.compile)(o.toString(),{base:d,onDependency:c=>{t.fullRebuildPaths.push(c)}})}t.compiler??=await g();let f="incremental";{for(let l of t.fullRebuildPaths)n.messages.push({type:"dependency",plugin:"@tailwindcss/postcss",file:l,parent:n.opts.from});let c=n.messages.flatMap(l=>l.type!=="dependency"?[]:l.file);c.push(p);for(let l of c){let y=A.default.statSync(l,{throwIfNoEntry:!1})?.mtimeMs??null;if(y===null){l===p&&(f="full");continue}t.mtimes.get(l)!==y&&(f="full",t.mtimes.set(l,y))}}let a="",P=new z.Scanner({detectSources:{base:s},sources:t.compiler.globs}),V=P.scan();for(let c of P.files)n.messages.push({type:"dependency",plugin:"@tailwindcss/postcss",file:c,parent:n.opts.from});for(let{base:c,pattern:l}of P.globs)n.messages.push({type:"dir-dependency",plugin:"@tailwindcss/postcss",dir:c,glob:l,parent:n.opts.from});f==="full"&&(t.compiler=await g()),a=t.compiler.build(V),a!==t.css&&e&&(t.optimizedCss=U(a,{minify:typeof e=="object"?e.minify:!0})),t.css=a,o.removeAll(),o.append(E.default.parse(e?t.optimizedCss:t.css,n.opts))}}]}}function U(i,{file:s="input.css",minify:e=!1}={}){return(0,m.transform)({filename:s,code:Buffer.from(i),minify:e,sourceMap:!1,drafts:{customMedia:!0},nonStandard:{deepSelectorCombinator:!0},include:m.Features.Nesting,exclude:m.Features.LogicalProperties,targets:{safari:16<<16|1024},errorRecovery:!0}).code.toString()}var M=Object.assign(L,{postcss:!0});module.exports=M;
1
+ "use strict";var A=Object.create;var B=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var W=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var k=(s,i,t,r)=>{if(i&&typeof i=="object"||typeof i=="function")for(let n of M(i))!N.call(s,n)&&n!==t&&B(s,n,{get:()=>i[n],enumerable:!(r=T(i,n))||r.enumerable});return s};var d=(s,i,t)=>(t=s!=null?A(W(s)):{},k(i||!s||!s.__esModule?B(t,"default",{value:s,enumerable:!0}):t,s));var U=d(require("@alloc/quick-lru")),o=require("@tailwindcss/node"),v=require("@tailwindcss/node/require-cache"),D=require("@tailwindcss/oxide"),G=d(require("fs")),h=require("lightningcss"),x=d(require("path")),z=d(require("postcss"));var b=require("@tailwindcss/node"),g=d(require("path")),y="'",S='"';function E(){let s=new WeakSet;function i(t){let r=t.root().source?.input.file;if(!r)return;let n=t.source?.input.file;if(!n||s.has(t))return;let c=t.params[0],e=c[0]===S&&c[c.length-1]===S?S:c[0]===y&&c[c.length-1]===y?y:null;if(!e)return;let p=t.params.slice(1,-1),f="";if(p.startsWith("!")&&(p=p.slice(1),f="!"),!p.startsWith("./")&&!p.startsWith("../"))return;let P=g.default.posix.join((0,b.normalizePath)(g.default.dirname(n)),p),u=g.default.posix.dirname((0,b.normalizePath)(r)),a=g.default.posix.relative(u,P);a.startsWith(".")||(a="./"+a),t.params=e+f+a+e,s.add(t)}return{postcssPlugin:"tailwindcss-postcss-fix-relative-paths",AtRule:{source:i,plugin:i,config:i}}}var C=new U.default({maxSize:50});function F(s,i){let t=`${s}:${i.base??""}:${i.optimize??""}`;if(C.has(t))return C.get(t);let r={mtimes:new Map,compiler:null,scanner:null,css:"",optimizedCss:"",fullRebuildPaths:[]};return C.set(t,r),r}function L(s={}){let i=s.base??process.cwd(),t=s.optimize??process.env.NODE_ENV==="production";return{postcssPlugin:"@tailwindcss/postcss",plugins:[E(),{postcssPlugin:"tailwindcss",async OnceExit(r,{result:n}){o.env.DEBUG&&console.time("[@tailwindcss/postcss] Total time in @tailwindcss/postcss");let c=n.opts.from??"",e=F(c,s),p=x.default.dirname(x.default.resolve(c));async function f(){o.env.DEBUG&&console.time("[@tailwindcss/postcss] Setup compiler"),(0,v.clearRequireCache)(e.fullRebuildPaths),e.fullRebuildPaths=[];let m=await(0,o.compile)(r.toString(),{base:p,onDependency:l=>{e.fullRebuildPaths.push(l)}});return o.env.DEBUG&&console.timeEnd("[@tailwindcss/postcss] Setup compiler"),m}let P=e.compiler===null;e.compiler??=await f();let u="incremental";{for(let l of e.fullRebuildPaths)n.messages.push({type:"dependency",plugin:"@tailwindcss/postcss",file:l,parent:n.opts.from});let m=n.messages.flatMap(l=>l.type!=="dependency"?[]:l.file);m.push(c);for(let l of m){let w=G.default.statSync(l,{throwIfNoEntry:!1})?.mtimeMs??null;if(w===null){l===c&&(u="full");continue}e.mtimes.get(l)!==w&&(u="full",e.mtimes.set(l,w))}}let a="";u==="full"&&!P&&(e.compiler=await f()),(e.scanner===null||u==="full")&&(e.scanner=new D.Scanner({detectSources:{base:i},sources:e.compiler.globs})),o.env.DEBUG&&console.time("[@tailwindcss/postcss] Scan for candidates");let R=e.scanner.scan();o.env.DEBUG&&console.timeEnd("[@tailwindcss/postcss] Scan for candidates");for(let m of e.scanner.files)n.messages.push({type:"dependency",plugin:"@tailwindcss/postcss",file:m,parent:n.opts.from});for(let{base:m,pattern:l}of e.scanner.globs)n.messages.push({type:"dir-dependency",plugin:"@tailwindcss/postcss",dir:m,glob:l,parent:n.opts.from});o.env.DEBUG&&console.time("[@tailwindcss/postcss] Build CSS"),a=e.compiler.build(R),o.env.DEBUG&&console.timeEnd("[@tailwindcss/postcss] Build CSS"),a!==e.css&&t&&(o.env.DEBUG&&console.time("[@tailwindcss/postcss] Optimize CSS"),e.optimizedCss=j(a,{minify:typeof t=="object"?t.minify:!0}),o.env.DEBUG&&console.timeEnd("[@tailwindcss/postcss] Optimize CSS")),e.css=a,o.env.DEBUG&&console.time("[@tailwindcss/postcss] Update PostCSS AST"),r.removeAll(),r.append(z.default.parse(t?e.optimizedCss:e.css,n.opts)),o.env.DEBUG&&console.timeEnd("[@tailwindcss/postcss] Update PostCSS AST"),o.env.DEBUG&&console.timeEnd("[@tailwindcss/postcss] Total time in @tailwindcss/postcss")}}]}}function j(s,{file:i="input.css",minify:t=!1}={}){return(0,h.transform)({filename:i,code:Buffer.from(s),minify:t,sourceMap:!1,drafts:{customMedia:!0},nonStandard:{deepSelectorCombinator:!0},include:h.Features.Nesting,exclude:h.Features.LogicalProperties,targets:{safari:16<<16|1024},errorRecovery:!0}).code.toString()}var O=Object.assign(L,{postcss:!0});module.exports=O;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{compile as R}from"@tailwindcss/node";import{clearRequireCache as C}from"@tailwindcss/node/require-cache";import{Scanner as O}from"@tailwindcss/oxide";import z from"fs";import{Features as x,transform as A}from"lightningcss";import S from"path";import E from"postcss";import{normalizePath as w}from"@tailwindcss/node";import d from"node:path";var P="'",y='"';function b(){let o=new WeakSet;function l(t){let n=t.root().source?.input.file;if(!n)return;let c=t.source?.input.file;if(!c||o.has(t))return;let i=t.params[0],a=i[0]===y&&i[i.length-1]===y?y:i[0]===P&&i[i.length-1]===P?P:null;if(!a)return;let e=t.params.slice(1,-1),f="";if(e.startsWith("!")&&(e=e.slice(1),f="!"),!e.startsWith("./")&&!e.startsWith("../"))return;let m=d.posix.join(w(d.dirname(c)),e),u=d.posix.dirname(w(n)),r=d.posix.relative(u,m);r.startsWith(".")||(r="./"+r),t.params=a+f+r+a,o.add(t)}return{postcssPlugin:"tailwindcss-postcss-fix-relative-paths",AtRule:{source:l,plugin:l,config:l}}}var v=class extends Map{constructor(t){super();this.factory=t}get(t){let n=super.get(t);return n===void 0&&(n=this.factory(t,this),this.set(t,n)),n}};function M(o={}){let l=o.base??process.cwd(),t=o.optimize??process.env.NODE_ENV==="production",n=new v(()=>({mtimes:new Map,compiler:null,css:"",optimizedCss:"",fullRebuildPaths:[]}));return{postcssPlugin:"@tailwindcss/postcss",plugins:[b(),{postcssPlugin:"tailwindcss",async OnceExit(c,{result:i}){let a=i.opts.from??"",e=n.get(a),f=S.dirname(S.resolve(a));async function m(){return C(e.fullRebuildPaths),e.fullRebuildPaths=[],R(c.toString(),{base:f,onDependency:p=>{e.fullRebuildPaths.push(p)}})}e.compiler??=await m();let u="incremental";{for(let s of e.fullRebuildPaths)i.messages.push({type:"dependency",plugin:"@tailwindcss/postcss",file:s,parent:i.opts.from});let p=i.messages.flatMap(s=>s.type!=="dependency"?[]:s.file);p.push(a);for(let s of p){let h=z.statSync(s,{throwIfNoEntry:!1})?.mtimeMs??null;if(h===null){s===a&&(u="full");continue}e.mtimes.get(s)!==h&&(u="full",e.mtimes.set(s,h))}}let r="",g=new O({detectSources:{base:l},sources:e.compiler.globs}),T=g.scan();for(let p of g.files)i.messages.push({type:"dependency",plugin:"@tailwindcss/postcss",file:p,parent:i.opts.from});for(let{base:p,pattern:s}of g.globs)i.messages.push({type:"dir-dependency",plugin:"@tailwindcss/postcss",dir:p,glob:s,parent:i.opts.from});u==="full"&&(e.compiler=await m()),r=e.compiler.build(T),r!==e.css&&t&&(e.optimizedCss=V(r,{minify:typeof t=="object"?t.minify:!0})),e.css=r,c.removeAll(),c.append(E.parse(t?e.optimizedCss:e.css,i.opts))}}]}}function V(o,{file:l="input.css",minify:t=!1}={}){return A({filename:l,code:Buffer.from(o),minify:t,sourceMap:!1,drafts:{customMedia:!0},nonStandard:{deepSelectorCombinator:!0},include:x.Nesting,exclude:x.LogicalProperties,targets:{safari:16<<16|1024},errorRecovery:!0}).code.toString()}var Q=Object.assign(M,{postcss:!0});export{Q as default};
1
+ import U from"@alloc/quick-lru";import{compile as x,env as n}from"@tailwindcss/node";import{clearRequireCache as v}from"@tailwindcss/node/require-cache";import{Scanner as D}from"@tailwindcss/oxide";import G from"fs";import{Features as E,transform as z}from"lightningcss";import C from"path";import O from"postcss";import{normalizePath as b}from"@tailwindcss/node";import d from"node:path";var P="'",w='"';function y(){let l=new WeakSet;function r(t){let c=t.root().source?.input.file;if(!c)return;let i=t.source?.input.file;if(!i||l.has(t))return;let o=t.params[0],e=o[0]===w&&o[o.length-1]===w?w:o[0]===P&&o[o.length-1]===P?P:null;if(!e)return;let p=t.params.slice(1,-1),f="";if(p.startsWith("!")&&(p=p.slice(1),f="!"),!p.startsWith("./")&&!p.startsWith("../"))return;let g=d.posix.join(b(d.dirname(i)),p),u=d.posix.dirname(b(c)),a=d.posix.relative(u,g);a.startsWith(".")||(a="./"+a),t.params=e+f+a+e,l.add(t)}return{postcssPlugin:"tailwindcss-postcss-fix-relative-paths",AtRule:{source:r,plugin:r,config:r}}}var S=new U({maxSize:50});function R(l,r){let t=`${l}:${r.base??""}:${r.optimize??""}`;if(S.has(t))return S.get(t);let c={mtimes:new Map,compiler:null,scanner:null,css:"",optimizedCss:"",fullRebuildPaths:[]};return S.set(t,c),c}function A(l={}){let r=l.base??process.cwd(),t=l.optimize??process.env.NODE_ENV==="production";return{postcssPlugin:"@tailwindcss/postcss",plugins:[y(),{postcssPlugin:"tailwindcss",async OnceExit(c,{result:i}){n.DEBUG&&console.time("[@tailwindcss/postcss] Total time in @tailwindcss/postcss");let o=i.opts.from??"",e=R(o,l),p=C.dirname(C.resolve(o));async function f(){n.DEBUG&&console.time("[@tailwindcss/postcss] Setup compiler"),v(e.fullRebuildPaths),e.fullRebuildPaths=[];let m=await x(c.toString(),{base:p,onDependency:s=>{e.fullRebuildPaths.push(s)}});return n.DEBUG&&console.timeEnd("[@tailwindcss/postcss] Setup compiler"),m}let g=e.compiler===null;e.compiler??=await f();let u="incremental";{for(let s of e.fullRebuildPaths)i.messages.push({type:"dependency",plugin:"@tailwindcss/postcss",file:s,parent:i.opts.from});let m=i.messages.flatMap(s=>s.type!=="dependency"?[]:s.file);m.push(o);for(let s of m){let h=G.statSync(s,{throwIfNoEntry:!1})?.mtimeMs??null;if(h===null){s===o&&(u="full");continue}e.mtimes.get(s)!==h&&(u="full",e.mtimes.set(s,h))}}let a="";u==="full"&&!g&&(e.compiler=await f()),(e.scanner===null||u==="full")&&(e.scanner=new D({detectSources:{base:r},sources:e.compiler.globs})),n.DEBUG&&console.time("[@tailwindcss/postcss] Scan for candidates");let B=e.scanner.scan();n.DEBUG&&console.timeEnd("[@tailwindcss/postcss] Scan for candidates");for(let m of e.scanner.files)i.messages.push({type:"dependency",plugin:"@tailwindcss/postcss",file:m,parent:i.opts.from});for(let{base:m,pattern:s}of e.scanner.globs)i.messages.push({type:"dir-dependency",plugin:"@tailwindcss/postcss",dir:m,glob:s,parent:i.opts.from});n.DEBUG&&console.time("[@tailwindcss/postcss] Build CSS"),a=e.compiler.build(B),n.DEBUG&&console.timeEnd("[@tailwindcss/postcss] Build CSS"),a!==e.css&&t&&(n.DEBUG&&console.time("[@tailwindcss/postcss] Optimize CSS"),e.optimizedCss=T(a,{minify:typeof t=="object"?t.minify:!0}),n.DEBUG&&console.timeEnd("[@tailwindcss/postcss] Optimize CSS")),e.css=a,n.DEBUG&&console.time("[@tailwindcss/postcss] Update PostCSS AST"),c.removeAll(),c.append(O.parse(t?e.optimizedCss:e.css,i.opts)),n.DEBUG&&console.timeEnd("[@tailwindcss/postcss] Update PostCSS AST"),n.DEBUG&&console.timeEnd("[@tailwindcss/postcss] Total time in @tailwindcss/postcss")}}]}}function T(l,{file:r="input.css",minify:t=!1}={}){return z({filename:r,code:Buffer.from(l),minify:t,sourceMap:!1,drafts:{customMedia:!0},nonStandard:{deepSelectorCombinator:!0},include:E.Nesting,exclude:E.LogicalProperties,targets:{safari:16<<16|1024},errorRecovery:!0}).code.toString()}var H=Object.assign(A,{postcss:!0});export{H as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailwindcss/postcss",
3
- "version": "4.0.0-alpha.25",
3
+ "version": "4.0.0-alpha.26",
4
4
  "description": "PostCSS plugin for Tailwind CSS, a utility-first CSS framework for rapidly building custom user interfaces",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -25,16 +25,17 @@
25
25
  }
26
26
  },
27
27
  "dependencies": {
28
+ "@alloc/quick-lru": "^5.2.0",
28
29
  "lightningcss": "^1.26.0",
29
- "@tailwindcss/oxide": "4.0.0-alpha.25",
30
- "tailwindcss": "4.0.0-alpha.25",
31
- "@tailwindcss/node": "4.0.0-alpha.25"
30
+ "@tailwindcss/node": "4.0.0-alpha.26",
31
+ "@tailwindcss/oxide": "4.0.0-alpha.26",
32
+ "tailwindcss": "4.0.0-alpha.26"
32
33
  },
33
34
  "devDependencies": {
34
35
  "@types/node": "^20.14.8",
36
+ "@types/postcss-import": "14.0.3",
35
37
  "postcss": "^8.4.41",
36
38
  "postcss-import": "^16.1.0",
37
- "@types/postcss-import": "14.0.3",
38
39
  "internal-example-plugin": "0.0.0"
39
40
  },
40
41
  "scripts": {