@tailwindcss/postcss 4.0.0-alpha.21 → 4.0.0-alpha.22

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 B=Object.create;var C=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,q=Object.prototype.hasOwnProperty;var L=(e,i,t,o)=>{if(i&&typeof i=="object"||typeof i=="function")for(let n of F(i))!q.call(e,n)&&n!==t&&C(e,n,{get:()=>i[n],enumerable:!(o=D(i,n))||o.enumerable});return e};var d=(e,i,t)=>(t=e!=null?B(I(e)):{},L(i||!e||!e.__esModule?C(t,"default",{value:e,enumerable:!0}):t,e));var W=require("@tailwindcss/node"),O=require("@tailwindcss/node/require-cache"),M=require("@tailwindcss/oxide"),V=d(require("fs"));var g=d(require("path"),1);function _(e,i){if(typeof e!="string")throw new TypeError("expected path to be a string");if(e==="\\"||e==="/")return"/";var t=e.length;if(t<=1)return e;var o="";if(t>4&&e[3]==="\\"){var n=e[2];(n==="?"||n===".")&&e.slice(0,2)==="\\\\"&&(e=e.slice(2),o="//")}var r=e.split(/[/\\]+/);return i!==!1&&r[r.length-1]===""&&r.pop(),o+r.join("/")}function S(e){let i=_(e);return e.startsWith("\\\\")&&i.startsWith("/")&&!i.startsWith("//")?`/${i}`:i}var v="'",x='"';function z(){let e=new WeakSet;function i(t){let o=t.root().source?.input.file;if(!o)return;let n=t.source?.input.file;if(!n||e.has(t))return;let r=t.params[0],p=r[0]===x&&r[r.length-1]===x?x:r[0]===v&&r[r.length-1]===v?v:null;if(!p)return;let l=t.params.slice(1,-1),f="";if(l.startsWith("!")&&(l=l.slice(1),f="!"),!l.startsWith("./")&&!l.startsWith("../"))return;let s=g.default.posix.join(S(g.default.dirname(n)),l),y=g.default.posix.dirname(S(o)),u=g.default.posix.relative(y,s);u.startsWith(".")||(u="./"+u),t.params=p+f+u+p,e.add(t)}return{postcssPlugin:"tailwindcss-postcss-fix-relative-paths",AtRule:{source:i,plugin:i,config:i}}}var h=require("lightningcss"),R=d(require("path")),E=d(require("postcss")),j=d(require("postcss-import")),T=class extends Map{constructor(t){super();this.factory=t}get(t){let o=super.get(t);return o===void 0&&(o=this.factory(t,this),this.set(t,o)),o}};function $(e={}){let i=e.base??process.cwd(),t=e.optimize??process.env.NODE_ENV==="production",o=new T(()=>({mtimes:new Map,compiler:null,css:"",optimizedCss:"",fullRebuildPaths:[]})),n,r;return{postcssPlugin:"@tailwindcss/postcss",plugins:[(0,j.default)(),z(),{postcssPlugin:"tailwindcss",Once(){n=!1,r=!1},AtRule(p){p.name==="apply"?n=!0:p.name==="tailwind"&&(n=!0,r=!0)},async OnceExit(p,{result:l}){let f=l.opts.from??"",s=o.get(f),y=R.default.dirname(R.default.resolve(f));async function u(){return(0,O.clearRequireCache)(s.fullRebuildPaths),s.fullRebuildPaths=[],(0,W.compile)(p.toString(),{base:y,onDependency:c=>{s.fullRebuildPaths.push(c)}})}s.compiler??=await u();let b="incremental";{for(let a of s.fullRebuildPaths)l.messages.push({type:"dependency",plugin:"@tailwindcss/postcss",file:a,parent:l.opts.from});let c=l.messages.flatMap(a=>a.type!=="dependency"?[]:a.file);c.push(f);for(let a of c){let P=V.default.statSync(a,{throwIfNoEntry:!1})?.mtimeMs??null;if(P===null){a===f&&(b="full");continue}s.mtimes.get(a)!==P&&(b="full",s.mtimes.set(a,P))}}if(!r&&!n)return;let m="",w=new M.Scanner({detectSources:{base:i},sources:s.compiler.globs.map(c=>({base:y,pattern:c}))}),A=w.scan();for(let c of w.files)l.messages.push({type:"dependency",plugin:"@tailwindcss/postcss",file:c,parent:l.opts.from});for(let{base:c,pattern:a}of w.globs)l.messages.push({type:"dir-dependency",plugin:"@tailwindcss/postcss",dir:c,glob:a,parent:l.opts.from});b==="full"?(s.compiler=await u(),m=s.compiler.build(r?A:[])):b==="incremental"&&(m=s.compiler.build(A)),m!==s.css&&t&&(s.optimizedCss=k(m,{minify:typeof t=="object"?t.minify:!0})),s.css=m,p.removeAll(),p.append(E.default.parse(t?s.optimizedCss:s.css,l.opts))}}]}}function k(e,{file:i="input.css",minify:t=!1}={}){return(0,h.transform)({filename:i,code:Buffer.from(e),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 N=Object.assign($,{postcss:!0});module.exports=N;
1
+ "use strict";var B=Object.create;var C=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,q=Object.prototype.hasOwnProperty;var L=(e,i,t,o)=>{if(i&&typeof i=="object"||typeof i=="function")for(let n of F(i))!q.call(e,n)&&n!==t&&C(e,n,{get:()=>i[n],enumerable:!(o=D(i,n))||o.enumerable});return e};var g=(e,i,t)=>(t=e!=null?B(I(e)):{},L(i||!e||!e.__esModule?C(t,"default",{value:e,enumerable:!0}):t,e));var W=require("@tailwindcss/node"),O=require("@tailwindcss/node/require-cache"),M=require("@tailwindcss/oxide"),V=g(require("fs"));var h=g(require("path"),1);function _(e,i){if(typeof e!="string")throw new TypeError("expected path to be a string");if(e==="\\"||e==="/")return"/";var t=e.length;if(t<=1)return e;var o="";if(t>4&&e[3]==="\\"){var n=e[2];(n==="?"||n===".")&&e.slice(0,2)==="\\\\"&&(e=e.slice(2),o="//")}var r=e.split(/[/\\]+/);return i!==!1&&r[r.length-1]===""&&r.pop(),o+r.join("/")}function S(e){let i=_(e);return e.startsWith("\\\\")&&i.startsWith("/")&&!i.startsWith("//")?`/${i}`:i}var x="'",R='"';function z(){let e=new WeakSet;function i(t){let o=t.root().source?.input.file;if(!o)return;let n=t.source?.input.file;if(!n||e.has(t))return;let r=t.params[0],c=r[0]===R&&r[r.length-1]===R?R:r[0]===x&&r[r.length-1]===x?x:null;if(!c)return;let l=t.params.slice(1,-1),f="";if(l.startsWith("!")&&(l=l.slice(1),f="!"),!l.startsWith("./")&&!l.startsWith("../"))return;let s=h.default.posix.join(S(h.default.dirname(n)),l),m=h.default.posix.dirname(S(o)),u=h.default.posix.relative(m,s);u.startsWith(".")||(u="./"+u),t.params=c+f+u+c,e.add(t)}return{postcssPlugin:"tailwindcss-postcss-fix-relative-paths",AtRule:{source:i,plugin:i,config:i}}}var b=require("lightningcss"),y=g(require("path")),E=g(require("postcss")),j=g(require("postcss-import")),T=class extends Map{constructor(t){super();this.factory=t}get(t){let o=super.get(t);return o===void 0&&(o=this.factory(t,this),this.set(t,o)),o}};function $(e={}){let i=e.base??process.cwd(),t=e.optimize??process.env.NODE_ENV==="production",o=new T(()=>({mtimes:new Map,compiler:null,css:"",optimizedCss:"",fullRebuildPaths:[]})),n,r;return{postcssPlugin:"@tailwindcss/postcss",plugins:[(0,j.default)(),z(),{postcssPlugin:"tailwindcss",Once(){n=!1,r=!1},AtRule(c){c.name==="apply"?n=!0:c.name==="tailwind"&&(n=!0,r=!0)},async OnceExit(c,{result:l}){let f=l.opts.from??"",s=o.get(f),m=y.default.dirname(y.default.resolve(f));async function u(){return(0,O.clearRequireCache)(s.fullRebuildPaths),s.fullRebuildPaths=[],(0,W.compile)(c.toString(),{base:m,onDependency:p=>{s.fullRebuildPaths.push(p)}})}s.compiler??=await u();let w="incremental";{for(let a of s.fullRebuildPaths)l.messages.push({type:"dependency",plugin:"@tailwindcss/postcss",file:a,parent:l.opts.from});let p=l.messages.flatMap(a=>a.type!=="dependency"?[]:a.file);p.push(f);for(let a of p){let v=V.default.statSync(a,{throwIfNoEntry:!1})?.mtimeMs??null;if(v===null){a===f&&(w="full");continue}s.mtimes.get(a)!==v&&(w="full",s.mtimes.set(a,v))}}if(!r&&!n)return;let d="",P=new M.Scanner({detectSources:{base:i},sources:s.compiler.globs.map(({origin:p,pattern:a})=>({base:p?y.default.dirname(y.default.resolve(m,p)):m,pattern:a}))}),A=P.scan();for(let p of P.files)l.messages.push({type:"dependency",plugin:"@tailwindcss/postcss",file:p,parent:l.opts.from});for(let{base:p,pattern:a}of P.globs)l.messages.push({type:"dir-dependency",plugin:"@tailwindcss/postcss",dir:p,glob:a,parent:l.opts.from});w==="full"?(s.compiler=await u(),d=s.compiler.build(r?A:[])):w==="incremental"&&(d=s.compiler.build(A)),d!==s.css&&t&&(s.optimizedCss=k(d,{minify:typeof t=="object"?t.minify:!0})),s.css=d,c.removeAll(),c.append(E.default.parse(t?s.optimizedCss:s.css,l.opts))}}]}}function k(e,{file:i="input.css",minify:t=!1}={}){return(0,b.transform)({filename:i,code:Buffer.from(e),minify:t,sourceMap:!1,drafts:{customMedia:!0},nonStandard:{deepSelectorCombinator:!0},include:b.Features.Nesting,exclude:b.Features.LogicalProperties,targets:{safari:16<<16|1024},errorRecovery:!0}).code.toString()}var N=Object.assign($,{postcss:!0});module.exports=N;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{compile as z}from"@tailwindcss/node";import{clearRequireCache as W}from"@tailwindcss/node/require-cache";import{Scanner as O}from"@tailwindcss/oxide";import M from"fs";import h from"node:path";function S(e,r){if(typeof e!="string")throw new TypeError("expected path to be a string");if(e==="\\"||e==="/")return"/";var t=e.length;if(t<=1)return e;var l="";if(t>4&&e[3]==="\\"){var a=e[2];(a==="?"||a===".")&&e.slice(0,2)==="\\\\"&&(e=e.slice(2),l="//")}var s=e.split(/[/\\]+/);return r!==!1&&s[s.length-1]===""&&s.pop(),l+s.join("/")}function R(e){let r=S(e);return e.startsWith("\\\\")&&r.startsWith("/")&&!r.startsWith("//")?`/${r}`:r}var P="'",w='"';function T(){let e=new WeakSet;function r(t){let l=t.root().source?.input.file;if(!l)return;let a=t.source?.input.file;if(!a||e.has(t))return;let s=t.params[0],p=s[0]===w&&s[s.length-1]===w?w:s[0]===P&&s[s.length-1]===P?P:null;if(!p)return;let n=t.params.slice(1,-1),u="";if(n.startsWith("!")&&(n=n.slice(1),u="!"),!n.startsWith("./")&&!n.startsWith("../"))return;let i=h.posix.join(R(h.dirname(a)),n),d=h.posix.dirname(R(l)),f=h.posix.relative(d,i);f.startsWith(".")||(f="./"+f),t.params=p+u+f+p,e.add(t)}return{postcssPlugin:"tailwindcss-postcss-fix-relative-paths",AtRule:{source:r,plugin:r,config:r}}}import{Features as A,transform as V}from"lightningcss";import C from"path";import E from"postcss";import j from"postcss-import";var v=class extends Map{constructor(t){super();this.factory=t}get(t){let l=super.get(t);return l===void 0&&(l=this.factory(t,this),this.set(t,l)),l}};function N(e={}){let r=e.base??process.cwd(),t=e.optimize??process.env.NODE_ENV==="production",l=new v(()=>({mtimes:new Map,compiler:null,css:"",optimizedCss:"",fullRebuildPaths:[]})),a,s;return{postcssPlugin:"@tailwindcss/postcss",plugins:[j(),T(),{postcssPlugin:"tailwindcss",Once(){a=!1,s=!1},AtRule(p){p.name==="apply"?a=!0:p.name==="tailwind"&&(a=!0,s=!0)},async OnceExit(p,{result:n}){let u=n.opts.from??"",i=l.get(u),d=C.dirname(C.resolve(u));async function f(){return W(i.fullRebuildPaths),i.fullRebuildPaths=[],z(p.toString(),{base:d,onDependency:c=>{i.fullRebuildPaths.push(c)}})}i.compiler??=await f();let g="incremental";{for(let o of i.fullRebuildPaths)n.messages.push({type:"dependency",plugin:"@tailwindcss/postcss",file:o,parent:n.opts.from});let c=n.messages.flatMap(o=>o.type!=="dependency"?[]:o.file);c.push(u);for(let o of c){let b=M.statSync(o,{throwIfNoEntry:!1})?.mtimeMs??null;if(b===null){o===u&&(g="full");continue}i.mtimes.get(o)!==b&&(g="full",i.mtimes.set(o,b))}}if(!s&&!a)return;let m="",y=new O({detectSources:{base:r},sources:i.compiler.globs.map(c=>({base:d,pattern:c}))}),x=y.scan();for(let c of y.files)n.messages.push({type:"dependency",plugin:"@tailwindcss/postcss",file:c,parent:n.opts.from});for(let{base:c,pattern:o}of y.globs)n.messages.push({type:"dir-dependency",plugin:"@tailwindcss/postcss",dir:c,glob:o,parent:n.opts.from});g==="full"?(i.compiler=await f(),m=i.compiler.build(s?x:[])):g==="incremental"&&(m=i.compiler.build(x)),m!==i.css&&t&&(i.optimizedCss=B(m,{minify:typeof t=="object"?t.minify:!0})),i.css=m,p.removeAll(),p.append(E.parse(t?i.optimizedCss:i.css,n.opts))}}]}}function B(e,{file:r="input.css",minify:t=!1}={}){return V({filename:r,code:Buffer.from(e),minify:t,sourceMap:!1,drafts:{customMedia:!0},nonStandard:{deepSelectorCombinator:!0},include:A.Nesting,exclude:A.LogicalProperties,targets:{safari:16<<16|1024},errorRecovery:!0}).code.toString()}var U=Object.assign(N,{postcss:!0});export{U as default};
1
+ import{compile as z}from"@tailwindcss/node";import{clearRequireCache as W}from"@tailwindcss/node/require-cache";import{Scanner as O}from"@tailwindcss/oxide";import M from"fs";import h from"node:path";function S(e,r){if(typeof e!="string")throw new TypeError("expected path to be a string");if(e==="\\"||e==="/")return"/";var t=e.length;if(t<=1)return e;var o="";if(t>4&&e[3]==="\\"){var p=e[2];(p==="?"||p===".")&&e.slice(0,2)==="\\\\"&&(e=e.slice(2),o="//")}var s=e.split(/[/\\]+/);return r!==!1&&s[s.length-1]===""&&s.pop(),o+s.join("/")}function T(e){let r=S(e);return e.startsWith("\\\\")&&r.startsWith("/")&&!r.startsWith("//")?`/${r}`:r}var w="'",v='"';function A(){let e=new WeakSet;function r(t){let o=t.root().source?.input.file;if(!o)return;let p=t.source?.input.file;if(!p||e.has(t))return;let s=t.params[0],c=s[0]===v&&s[s.length-1]===v?v:s[0]===w&&s[s.length-1]===w?w:null;if(!c)return;let n=t.params.slice(1,-1),u="";if(n.startsWith("!")&&(n=n.slice(1),u="!"),!n.startsWith("./")&&!n.startsWith("../"))return;let i=h.posix.join(T(h.dirname(p)),n),m=h.posix.dirname(T(o)),f=h.posix.relative(m,i);f.startsWith(".")||(f="./"+f),t.params=c+u+f+c,e.add(t)}return{postcssPlugin:"tailwindcss-postcss-fix-relative-paths",AtRule:{source:r,plugin:r,config:r}}}import{Features as C,transform as V}from"lightningcss";import y from"path";import E from"postcss";import j from"postcss-import";var x=class extends Map{constructor(t){super();this.factory=t}get(t){let o=super.get(t);return o===void 0&&(o=this.factory(t,this),this.set(t,o)),o}};function N(e={}){let r=e.base??process.cwd(),t=e.optimize??process.env.NODE_ENV==="production",o=new x(()=>({mtimes:new Map,compiler:null,css:"",optimizedCss:"",fullRebuildPaths:[]})),p,s;return{postcssPlugin:"@tailwindcss/postcss",plugins:[j(),A(),{postcssPlugin:"tailwindcss",Once(){p=!1,s=!1},AtRule(c){c.name==="apply"?p=!0:c.name==="tailwind"&&(p=!0,s=!0)},async OnceExit(c,{result:n}){let u=n.opts.from??"",i=o.get(u),m=y.dirname(y.resolve(u));async function f(){return W(i.fullRebuildPaths),i.fullRebuildPaths=[],z(c.toString(),{base:m,onDependency:a=>{i.fullRebuildPaths.push(a)}})}i.compiler??=await f();let g="incremental";{for(let l of i.fullRebuildPaths)n.messages.push({type:"dependency",plugin:"@tailwindcss/postcss",file:l,parent:n.opts.from});let a=n.messages.flatMap(l=>l.type!=="dependency"?[]:l.file);a.push(u);for(let l of a){let P=M.statSync(l,{throwIfNoEntry:!1})?.mtimeMs??null;if(P===null){l===u&&(g="full");continue}i.mtimes.get(l)!==P&&(g="full",i.mtimes.set(l,P))}}if(!s&&!p)return;let d="",b=new O({detectSources:{base:r},sources:i.compiler.globs.map(({origin:a,pattern:l})=>({base:a?y.dirname(y.resolve(m,a)):m,pattern:l}))}),R=b.scan();for(let a of b.files)n.messages.push({type:"dependency",plugin:"@tailwindcss/postcss",file:a,parent:n.opts.from});for(let{base:a,pattern:l}of b.globs)n.messages.push({type:"dir-dependency",plugin:"@tailwindcss/postcss",dir:a,glob:l,parent:n.opts.from});g==="full"?(i.compiler=await f(),d=i.compiler.build(s?R:[])):g==="incremental"&&(d=i.compiler.build(R)),d!==i.css&&t&&(i.optimizedCss=B(d,{minify:typeof t=="object"?t.minify:!0})),i.css=d,c.removeAll(),c.append(E.parse(t?i.optimizedCss:i.css,n.opts))}}]}}function B(e,{file:r="input.css",minify:t=!1}={}){return V({filename:r,code:Buffer.from(e),minify:t,sourceMap:!1,drafts:{customMedia:!0},nonStandard:{deepSelectorCombinator:!0},include:C.Nesting,exclude:C.LogicalProperties,targets:{safari:16<<16|1024},errorRecovery:!0}).code.toString()}var U=Object.assign(N,{postcss:!0});export{U as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailwindcss/postcss",
3
- "version": "4.0.0-alpha.21",
3
+ "version": "4.0.0-alpha.22",
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": {
@@ -27,9 +27,9 @@
27
27
  "dependencies": {
28
28
  "lightningcss": "^1.26.0",
29
29
  "postcss-import": "^16.1.0",
30
- "@tailwindcss/node": "4.0.0-alpha.21",
31
- "@tailwindcss/oxide": "4.0.0-alpha.21",
32
- "tailwindcss": "4.0.0-alpha.21"
30
+ "tailwindcss": "4.0.0-alpha.22",
31
+ "@tailwindcss/node": "4.0.0-alpha.22",
32
+ "@tailwindcss/oxide": "4.0.0-alpha.22"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/node": "^20.14.8",