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