@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 +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +7 -8
package/dist/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";var
|
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
|
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.
|
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
|
-
"
|
30
|
-
"
|
31
|
-
"@tailwindcss/
|
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
|
-
"
|
39
|
-
"
|
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",
|