@tailwindcss/postcss 4.0.0-alpha.2 → 4.0.0-alpha.20
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.d.mts +2 -0
- package/dist/index.d.ts +1 -7
- package/dist/index.js +1 -3
- package/dist/index.mjs +1 -0
- package/package.json +20 -8
package/dist/index.d.mts
ADDED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
@@ -1,3 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(
|
2
|
-
|
3
|
-
module.exports = exports.default;
|
1
|
+
"use strict";var N=Object.create;var z=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,L=Object.prototype.hasOwnProperty;var D=(e,i,t,n)=>{if(i&&typeof i=="object"||typeof i=="function")for(let s of B(i))!L.call(e,s)&&s!==t&&z(e,s,{get:()=>i[s],enumerable:!(n=F(i,s))||n.enumerable});return e};var d=(e,i,t)=>(t=e!=null?N(I(e)):{},D(i||!e||!e.__esModule?z(t,"default",{value:e,enumerable:!0}):t,e));var W=require("@tailwindcss/oxide"),O=d(require("fs"));var g=d(require("path"),1);function U(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 n="";if(t>4&&e[3]==="\\"){var s=e[2];(s==="?"||s===".")&&e.slice(0,2)==="\\\\"&&(e=e.slice(2),n="//")}var r=e.split(/[/\\]+/);return i!==!1&&r[r.length-1]===""&&r.pop(),n+r.join("/")}function C(e){let i=U(e);return e.startsWith("\\\\")&&i.startsWith("/")&&!i.startsWith("//")?`/${i}`:i}var x="'",T='"';function R(){let e=new WeakSet;function i(t){let n=t.root().source?.input.file;if(!n)return;let s=t.source?.input.file;if(!s||e.has(t))return;let r=t.params[0],c=r[0]===T&&r[r.length-1]===T?T: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 a=g.default.posix.join(C(g.default.dirname(s)),l),y=g.default.posix.dirname(C(n)),u=g.default.posix.relative(y,a);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}}}var h=require("lightningcss"),M=require("url"),w=d(require("path")),V=d(require("postcss")),E=d(require("postcss-import")),j=require("tailwindcss"),A=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 _(e={}){let i=e.base??process.cwd(),t=e.optimize??process.env.NODE_ENV==="production",n=new A(()=>({mtimes:new Map,compiler:null,css:"",optimizedCss:""})),s,r;return{postcssPlugin:"@tailwindcss/postcss",plugins:[(0,E.default)(),R(),{postcssPlugin:"tailwindcss",Once(){s=!1,r=!1},AtRule(c){c.name==="apply"?s=!0:c.name==="tailwind"&&(s=!0,r=!0)},async OnceExit(c,{result:l}){let f=l.opts.from??"",a=n.get(f),y=w.default.dirname(w.default.resolve(f));function u(){return(0,j.compile)(c.toString(),{loadPlugin:async p=>p[0]==="."?import((0,M.pathToFileURL)(w.default.resolve(y,p)).href).then(o=>o.default??o):import(p).then(o=>o.default??o)})}a.compiler??=await u();let b="incremental";{let p=l.messages.flatMap(o=>o.type!=="dependency"?[]:o.file);p.push(f);for(let o of p){let P=O.default.statSync(o,{throwIfNoEntry:!1})?.mtimeMs??null;if(P===null){o===f&&(b="full");continue}a.mtimes.get(o)!==P&&(b="full",a.mtimes.set(o,P))}}if(!r&&!s)return;let m="",v=new W.Scanner({detectSources:{base:i},sources:a.compiler.globs.map(p=>({base:y,pattern:p}))}),S=v.scan();for(let p of v.files)l.messages.push({type:"dependency",plugin:"@tailwindcss/postcss",file:p,parent:l.opts.from});for(let{base:p,pattern:o}of v.globs)l.messages.push({type:"dir-dependency",plugin:"@tailwindcss/postcss",dir:p,glob:o,parent:l.opts.from});b==="full"?(a.compiler=await u(),m=a.compiler.build(r?S:[])):b==="incremental"&&(m=a.compiler.build(S)),m!==a.css&&t&&(a.optimizedCss=$(m,{minify:typeof t=="object"?t.minify:!0})),a.css=m,c.removeAll(),c.append(V.default.parse(t?a.optimizedCss:a.css,l.opts))}}]}}function $(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()}module.exports=Object.assign(_,{postcss:!0});
|
package/dist/index.mjs
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
var W=(e,t)=>()=>(e&&(t=e(e=0)),t);var O=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);import h from"node:path";function M(e,t){if(typeof e!="string")throw new TypeError("expected path to be a string");if(e==="\\"||e==="/")return"/";var i=e.length;if(i<=1)return e;var l="";if(i>4&&e[3]==="\\"){var p=e[2];(p==="?"||p===".")&&e.slice(0,2)==="\\\\"&&(e=e.slice(2),l="//")}var s=e.split(/[/\\]+/);return t!==!1&&s[s.length-1]===""&&s.pop(),l+s.join("/")}function A(e){let t=M(e);return e.startsWith("\\\\")&&t.startsWith("/")&&!t.startsWith("//")?`/${t}`:t}function S(){let e=new WeakSet;function t(i){let l=i.root().source?.input.file;if(!l)return;let p=i.source?.input.file;if(!p||e.has(i))return;let s=i.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=i.params.slice(1,-1),f="";if(n.startsWith("!")&&(n=n.slice(1),f="!"),!n.startsWith("./")&&!n.startsWith("../"))return;let o=h.posix.join(A(h.dirname(p)),n),d=h.posix.dirname(A(l)),u=h.posix.relative(d,o);u.startsWith(".")||(u="./"+u),i.params=c+f+u+c,e.add(i)}return{postcssPlugin:"tailwindcss-postcss-fix-relative-paths",AtRule:{source:t,plugin:t}}}var w,v,z=W(()=>{"use strict";w="'",v='"'});import{Scanner as V}from"@tailwindcss/oxide";import E from"fs";import{Features as C,transform as j}from"lightningcss";import{pathToFileURL as N}from"node:url";import P from"path";import F from"postcss";import B from"postcss-import";import{compile as I}from"tailwindcss";var U=O((ie,R)=>{z();var x=class extends Map{constructor(i){super();this.factory=i}get(i){let l=super.get(i);return l===void 0&&(l=this.factory(i,this),this.set(i,l)),l}};function L(e={}){let t=e.base??process.cwd(),i=e.optimize??process.env.NODE_ENV==="production",l=new x(()=>({mtimes:new Map,compiler:null,css:"",optimizedCss:""})),p,s;return{postcssPlugin:"@tailwindcss/postcss",plugins:[B(),S(),{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 f=n.opts.from??"",o=l.get(f),d=P.dirname(P.resolve(f));function u(){return I(c.toString(),{loadPlugin:async a=>a[0]==="."?import(N(P.resolve(d,a)).href).then(r=>r.default??r):import(a).then(r=>r.default??r)})}o.compiler??=await u();let g="incremental";{let a=n.messages.flatMap(r=>r.type!=="dependency"?[]:r.file);a.push(f);for(let r of a){let b=E.statSync(r,{throwIfNoEntry:!1})?.mtimeMs??null;if(b===null){r===f&&(g="full");continue}o.mtimes.get(r)!==b&&(g="full",o.mtimes.set(r,b))}}if(!s&&!p)return;let m="",y=new V({detectSources:{base:t},sources:o.compiler.globs.map(a=>({base:d,pattern:a}))}),T=y.scan();for(let a of y.files)n.messages.push({type:"dependency",plugin:"@tailwindcss/postcss",file:a,parent:n.opts.from});for(let{base:a,pattern:r}of y.globs)n.messages.push({type:"dir-dependency",plugin:"@tailwindcss/postcss",dir:a,glob:r,parent:n.opts.from});g==="full"?(o.compiler=await u(),m=o.compiler.build(s?T:[])):g==="incremental"&&(m=o.compiler.build(T)),m!==o.css&&i&&(o.optimizedCss=D(m,{minify:typeof i=="object"?i.minify:!0})),o.css=m,c.removeAll(),c.append(F.parse(i?o.optimizedCss:o.css,n.opts))}}]}}function D(e,{file:t="input.css",minify:i=!1}={}){return j({filename:t,code:Buffer.from(e),minify:i,sourceMap:!1,drafts:{customMedia:!0},nonStandard:{deepSelectorCombinator:!0},include:C.Nesting,exclude:C.LogicalProperties,targets:{safari:16<<16|1024},errorRecovery:!0}).code.toString()}R.exports=Object.assign(L,{postcss:!0})});export default U();
|
package/package.json
CHANGED
@@ -1,33 +1,45 @@
|
|
1
1
|
{
|
2
2
|
"name": "@tailwindcss/postcss",
|
3
|
-
"version": "4.0.0-alpha.
|
3
|
+
"version": "4.0.0-alpha.20",
|
4
4
|
"description": "PostCSS plugin for Tailwind CSS, a utility-first CSS framework for rapidly building custom user interfaces",
|
5
5
|
"license": "MIT",
|
6
|
-
"repository":
|
6
|
+
"repository": {
|
7
|
+
"type": "git",
|
8
|
+
"url": "https://github.com/tailwindlabs/tailwindcss.git",
|
9
|
+
"directory": "packages/@tailwindcss-postcss"
|
10
|
+
},
|
7
11
|
"bugs": "https://github.com/tailwindlabs/tailwindcss/issues",
|
8
12
|
"homepage": "https://tailwindcss.com",
|
9
13
|
"files": [
|
10
14
|
"dist/"
|
11
15
|
],
|
16
|
+
"publishConfig": {
|
17
|
+
"provenance": true,
|
18
|
+
"access": "public"
|
19
|
+
},
|
12
20
|
"exports": {
|
13
21
|
".": {
|
14
22
|
"types": "./dist/index.d.ts",
|
23
|
+
"import": "./dist/index.mjs",
|
15
24
|
"require": "./dist/index.js"
|
16
25
|
}
|
17
26
|
},
|
18
27
|
"dependencies": {
|
19
|
-
"
|
20
|
-
"
|
21
|
-
"tailwindcss": "4.0.0-alpha.
|
28
|
+
"lightningcss": "^1.26.0",
|
29
|
+
"postcss-import": "^16.1.0",
|
30
|
+
"@tailwindcss/oxide": "4.0.0-alpha.20",
|
31
|
+
"tailwindcss": "4.0.0-alpha.20"
|
22
32
|
},
|
23
33
|
"devDependencies": {
|
24
|
-
"@types/node": "^20.
|
34
|
+
"@types/node": "^20.14.8",
|
25
35
|
"@types/postcss-import": "^14.0.3",
|
26
|
-
"postcss": "8.4.
|
36
|
+
"postcss": "^8.4.41",
|
37
|
+
"internal-postcss-fix-relative-paths": "0.0.0",
|
38
|
+
"internal-example-plugin": "0.0.0"
|
27
39
|
},
|
28
40
|
"scripts": {
|
29
41
|
"lint": "tsc --noEmit",
|
30
|
-
"build": "tsup-node
|
42
|
+
"build": "tsup-node",
|
31
43
|
"dev": "pnpm run build -- --watch"
|
32
44
|
}
|
33
45
|
}
|