@tailwindcss/postcss 4.0.0-alpha.17 → 4.0.0-alpha.18

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 CHANGED
@@ -1,4 +1,4 @@
1
- import { PluginCreator } from 'postcss';
1
+ import postcss from 'postcss';
2
2
 
3
3
  type PluginOptions = {
4
4
  base?: string;
@@ -6,6 +6,6 @@ type PluginOptions = {
6
6
  minify?: boolean;
7
7
  };
8
8
  };
9
- declare const _default: PluginCreator<PluginOptions>;
9
+ declare const _default: postcss.PluginCreator<PluginOptions>;
10
10
 
11
11
  export { _default as default };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { PluginCreator } from 'postcss';
1
+ import postcss from 'postcss';
2
2
 
3
3
  type PluginOptions = {
4
4
  base?: string;
@@ -6,6 +6,6 @@ type PluginOptions = {
6
6
  minify?: boolean;
7
7
  };
8
8
  };
9
- declare const _default: PluginCreator<PluginOptions>;
9
+ declare const _default: postcss.PluginCreator<PluginOptions>;
10
10
 
11
11
  export = _default;
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _oxide = require('@tailwindcss/oxide');var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);var _lightningcss = require('lightningcss');var _postcss = require('postcss'); var _postcss2 = _interopRequireDefault(_postcss);var _postcssimport = require('postcss-import'); var _postcssimport2 = _interopRequireDefault(_postcssimport);var _tailwindcss = require('tailwindcss');var g=class extends Map{constructor(t){super();this.factory=t}get(t){let l=super.get(t);return l===void 0&&(l=this.factory(t,this),this.set(t,l)),l}};function S(r={}){let p=_nullishCoalesce(r.base, () => (process.cwd())),t=_nullishCoalesce(r.optimize, () => (process.env.NODE_ENV==="production")),l=new g(()=>({mtimes:new Map,build:null,css:"",optimizedCss:""}));return{postcssPlugin:"@tailwindcss/postcss",plugins:[_postcssimport2.default.call(void 0, ),(a,n)=>{let c=_nullishCoalesce(n.opts.from, () => ("")),i=l.get(c),f="incremental";{let e=n.messages.flatMap(s=>s.type!=="dependency"?[]:s.file);e.push(c);for(let s of e){let d=_nullishCoalesce(_optionalChain([_fs2.default, 'access', _ => _.statSync, 'call', _2 => _2(s,{throwIfNoEntry:!1}), 'optionalAccess', _3 => _3.mtimeMs]), () => (null));if(d===null){s===c&&(f="full");continue}i.mtimes.get(s)!==d&&(f="full",i.mtimes.set(s,d))}}let u=!1,m=!1;if(a.walkAtRules(e=>{if(e.name==="apply")u=!0;else if(e.name==="tailwind")return u=!0,m=!0,!1}),!m&&!u)return;let o="",{candidates:y,files:h,globs:w}=_oxide.scanDir.call(void 0, {base:p,globs:!0});for(let e of h)n.messages.push({type:"dependency",plugin:"@tailwindcss/postcss",file:e,parent:n.opts.from});for(let{base:e,glob:s}of w)n.messages.push({type:"dir-dependency",plugin:"@tailwindcss/postcss",dir:e,glob:s,parent:n.opts.from});if(f==="full"){let{build:e}=_tailwindcss.compile.call(void 0, a.toString());i.build=e,o=e(m?y:[])}else f==="incremental"&&(o=i.build(y));o!==i.css&&t&&(i.optimizedCss=V(o,{minify:typeof t=="object"?t.minify:!0})),i.css=o,a.removeAll(),a.append(_postcss2.default.parse(t?i.optimizedCss:i.css,n.opts))}]}}function V(r,{file:p="input.css",minify:t=!1}={}){return _lightningcss.transform.call(void 0, {filename:p,code:Buffer.from(r),minify:t,sourceMap:!1,drafts:{customMedia:!0},nonStandard:{deepSelectorCombinator:!0},include:_lightningcss.Features.Nesting,exclude:_lightningcss.Features.LogicalProperties,targets:{safari:16<<16|1024},errorRecovery:!0}).code.toString()}var D=Object.assign(S,{postcss:!0});exports.default = D;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var g=(s=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(s,{get:(o,e)=>(typeof require<"u"?require:o)[e]}):s)(function(s){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+s+'" is not supported')});var _oxide = require('@tailwindcss/oxide');var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);var _lightningcss = require('lightningcss');var _path = require('path'); var _path2 = _interopRequireDefault(_path);var _postcss = require('postcss'); var _postcss2 = _interopRequireDefault(_postcss);var _postcssimport = require('postcss-import'); var _postcssimport2 = _interopRequireDefault(_postcssimport);var _tailwindcss = require('tailwindcss');var b=class extends Map{constructor(e){super();this.factory=e}get(e){let p=super.get(e);return p===void 0&&(p=this.factory(e,this),this.set(e,p)),p}};function A(s={}){let o=_nullishCoalesce(s.base, () => (process.cwd())),e=_nullishCoalesce(s.optimize, () => (process.env.NODE_ENV==="production")),p=new b(()=>({mtimes:new Map,build:null,css:"",optimizedCss:""}));return{postcssPlugin:"@tailwindcss/postcss",plugins:[_postcssimport2.default.call(void 0, ),(f,n)=>{let u=_nullishCoalesce(n.opts.from, () => ("")),r=p.get(u),c="incremental";{let i=n.messages.flatMap(t=>t.type!=="dependency"?[]:t.file);i.push(u);for(let t of i){let l=_nullishCoalesce(_optionalChain([_fs2.default, 'access', _ => _.statSync, 'call', _2 => _2(t,{throwIfNoEntry:!1}), 'optionalAccess', _3 => _3.mtimeMs]), () => (null));if(l===null){t===u&&(c="full");continue}r.mtimes.get(t)!==l&&(c="full",r.mtimes.set(t,l))}}let m=!1,d=!1;if(f.walkAtRules(i=>{if(i.name==="apply")m=!0;else if(i.name==="tailwind")return m=!0,d=!0,!1}),!d&&!m)return;let a="",{candidates:h,files:T,globs:v}=_oxide.scanDir.call(void 0, {base:o,globs:!0});for(let i of T)n.messages.push({type:"dependency",plugin:"@tailwindcss/postcss",file:i,parent:n.opts.from});for(let{base:i,glob:t}of v)n.messages.push({type:"dir-dependency",plugin:"@tailwindcss/postcss",dir:i,glob:t,parent:n.opts.from});if(c==="full"){let i=_path2.default.dirname(_path2.default.resolve(u)),{build:t}=_tailwindcss.compile.call(void 0, f.toString(),{loadPlugin:l=>l[0]==="."?g(_path2.default.resolve(i,l)):g(l)});r.build=t,a=t(d?h:[])}else c==="incremental"&&(a=r.build(h));a!==r.css&&e&&(r.optimizedCss=O(a,{minify:typeof e=="object"?e.minify:!0})),r.css=a,f.removeAll(),f.append(_postcss2.default.parse(e?r.optimizedCss:r.css,n.opts))}]}}function O(s,{file:o="input.css",minify:e=!1}={}){return _lightningcss.transform.call(void 0, {filename:o,code:Buffer.from(s),minify:e,sourceMap:!1,drafts:{customMedia:!0},nonStandard:{deepSelectorCombinator:!0},include:_lightningcss.Features.Nesting,exclude:_lightningcss.Features.LogicalProperties,targets:{safari:16<<16|1024},errorRecovery:!0}).code.toString()}var B=Object.assign(A,{postcss:!0});exports.default = B;
2
2
 
3
3
  module.exports = exports.default;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{scanDir as T}from"@tailwindcss/oxide";import P from"fs";import{Features as b,transform as v}from"lightningcss";import z from"postcss";import C from"postcss-import";import{compile as M}from"tailwindcss";var g=class extends Map{constructor(t){super();this.factory=t}get(t){let l=super.get(t);return l===void 0&&(l=this.factory(t,this),this.set(t,l)),l}};function S(r={}){let p=r.base??process.cwd(),t=r.optimize??process.env.NODE_ENV==="production",l=new g(()=>({mtimes:new Map,build:null,css:"",optimizedCss:""}));return{postcssPlugin:"@tailwindcss/postcss",plugins:[C(),(a,n)=>{let c=n.opts.from??"",i=l.get(c),f="incremental";{let e=n.messages.flatMap(s=>s.type!=="dependency"?[]:s.file);e.push(c);for(let s of e){let d=P.statSync(s,{throwIfNoEntry:!1})?.mtimeMs??null;if(d===null){s===c&&(f="full");continue}i.mtimes.get(s)!==d&&(f="full",i.mtimes.set(s,d))}}let u=!1,m=!1;if(a.walkAtRules(e=>{if(e.name==="apply")u=!0;else if(e.name==="tailwind")return u=!0,m=!0,!1}),!m&&!u)return;let o="",{candidates:y,files:h,globs:w}=T({base:p,globs:!0});for(let e of h)n.messages.push({type:"dependency",plugin:"@tailwindcss/postcss",file:e,parent:n.opts.from});for(let{base:e,glob:s}of w)n.messages.push({type:"dir-dependency",plugin:"@tailwindcss/postcss",dir:e,glob:s,parent:n.opts.from});if(f==="full"){let{build:e}=M(a.toString());i.build=e,o=e(m?y:[])}else f==="incremental"&&(o=i.build(y));o!==i.css&&t&&(i.optimizedCss=V(o,{minify:typeof t=="object"?t.minify:!0})),i.css=o,a.removeAll(),a.append(z.parse(t?i.optimizedCss:i.css,n.opts))}]}}function V(r,{file:p="input.css",minify:t=!1}={}){return v({filename:p,code:Buffer.from(r),minify:t,sourceMap:!1,drafts:{customMedia:!0},nonStandard:{deepSelectorCombinator:!0},include:b.Nesting,exclude:b.LogicalProperties,targets:{safari:16<<16|1024},errorRecovery:!0}).code.toString()}var D=Object.assign(S,{postcss:!0});export{D as default};
1
+ var g=(s=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(s,{get:(o,e)=>(typeof require<"u"?require:o)[e]}):s)(function(s){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+s+'" is not supported')});import{scanDir as P}from"@tailwindcss/oxide";import z from"fs";import{Features as w,transform as C}from"lightningcss";import y from"path";import M from"postcss";import S from"postcss-import";import{compile as V}from"tailwindcss";var b=class extends Map{constructor(e){super();this.factory=e}get(e){let p=super.get(e);return p===void 0&&(p=this.factory(e,this),this.set(e,p)),p}};function A(s={}){let o=s.base??process.cwd(),e=s.optimize??process.env.NODE_ENV==="production",p=new b(()=>({mtimes:new Map,build:null,css:"",optimizedCss:""}));return{postcssPlugin:"@tailwindcss/postcss",plugins:[S(),(f,n)=>{let u=n.opts.from??"",r=p.get(u),c="incremental";{let i=n.messages.flatMap(t=>t.type!=="dependency"?[]:t.file);i.push(u);for(let t of i){let l=z.statSync(t,{throwIfNoEntry:!1})?.mtimeMs??null;if(l===null){t===u&&(c="full");continue}r.mtimes.get(t)!==l&&(c="full",r.mtimes.set(t,l))}}let m=!1,d=!1;if(f.walkAtRules(i=>{if(i.name==="apply")m=!0;else if(i.name==="tailwind")return m=!0,d=!0,!1}),!d&&!m)return;let a="",{candidates:h,files:T,globs:v}=P({base:o,globs:!0});for(let i of T)n.messages.push({type:"dependency",plugin:"@tailwindcss/postcss",file:i,parent:n.opts.from});for(let{base:i,glob:t}of v)n.messages.push({type:"dir-dependency",plugin:"@tailwindcss/postcss",dir:i,glob:t,parent:n.opts.from});if(c==="full"){let i=y.dirname(y.resolve(u)),{build:t}=V(f.toString(),{loadPlugin:l=>l[0]==="."?g(y.resolve(i,l)):g(l)});r.build=t,a=t(d?h:[])}else c==="incremental"&&(a=r.build(h));a!==r.css&&e&&(r.optimizedCss=O(a,{minify:typeof e=="object"?e.minify:!0})),r.css=a,f.removeAll(),f.append(M.parse(e?r.optimizedCss:r.css,n.opts))}]}}function O(s,{file:o="input.css",minify:e=!1}={}){return C({filename:o,code:Buffer.from(s),minify:e,sourceMap:!1,drafts:{customMedia:!0},nonStandard:{deepSelectorCombinator:!0},include:w.Nesting,exclude:w.LogicalProperties,targets:{safari:16<<16|1024},errorRecovery:!0}).code.toString()}var B=Object.assign(A,{postcss:!0});export{B as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailwindcss/postcss",
3
- "version": "4.0.0-alpha.17",
3
+ "version": "4.0.0-alpha.18",
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,13 +27,14 @@
27
27
  "dependencies": {
28
28
  "lightningcss": "^1.25.1",
29
29
  "postcss-import": "^16.1.0",
30
- "@tailwindcss/oxide": "4.0.0-alpha.17",
31
- "tailwindcss": "4.0.0-alpha.17"
30
+ "tailwindcss": "4.0.0-alpha.18",
31
+ "@tailwindcss/oxide": "4.0.0-alpha.18"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/node": "^20.12.12",
35
35
  "@types/postcss-import": "^14.0.3",
36
- "postcss": "8.4.24"
36
+ "postcss": "8.4.24",
37
+ "tailwindcss-test-utils": "0.0.0"
37
38
  },
38
39
  "scripts": {
39
40
  "lint": "tsc --noEmit",