@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 +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +4 -4
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
|
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
|
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.
|
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
|
-
"
|
31
|
-
"@tailwindcss/
|
32
|
-
"tailwindcss": "4.0.0-alpha.
|
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",
|