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

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 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;
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;
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 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};
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};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailwindcss/postcss",
3
- "version": "4.0.0-alpha.23",
3
+ "version": "4.0.0-alpha.25",
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": {
@@ -26,17 +26,16 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "lightningcss": "^1.26.0",
29
- "postcss-import": "^16.1.0",
30
- "@tailwindcss/node": "4.0.0-alpha.23",
31
- "@tailwindcss/oxide": "4.0.0-alpha.23",
32
- "tailwindcss": "4.0.0-alpha.23"
29
+ "@tailwindcss/oxide": "4.0.0-alpha.25",
30
+ "tailwindcss": "4.0.0-alpha.25",
31
+ "@tailwindcss/node": "4.0.0-alpha.25"
33
32
  },
34
33
  "devDependencies": {
35
34
  "@types/node": "^20.14.8",
36
- "@types/postcss-import": "^14.0.3",
37
35
  "postcss": "^8.4.41",
38
- "internal-example-plugin": "0.0.0",
39
- "internal-postcss-fix-relative-paths": "0.0.0"
36
+ "postcss-import": "^16.1.0",
37
+ "@types/postcss-import": "14.0.3",
38
+ "internal-example-plugin": "0.0.0"
40
39
  },
41
40
  "scripts": {
42
41
  "lint": "tsc --noEmit",