@tailwindcss/postcss 4.0.0-alpha.7 → 4.0.0-alpha.9

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.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +4 -3
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(); } }var _oxide = require('@tailwindcss/oxide');var _postcss = require('postcss'); var _postcss2 = _interopRequireDefault(_postcss);var _postcssimport = require('postcss-import'); var _postcssimport2 = _interopRequireDefault(_postcssimport);var _tailwindcss = require('tailwindcss');function w(l={}){let f=_nullishCoalesce(l.base, () => (process.cwd())),n=_nullishCoalesce(l.optimize, () => (process.env.NODE_ENV==="production"));return{postcssPlugin:"tailwindcss-v4",plugins:[_postcssimport2.default.call(void 0, ),(i,s)=>{let p=!1,o=!1;if(i.walkAtRules(e=>{if(e.name==="apply")p=!0;else if(e.name==="tailwind")return p=!0,o=!0,!1}),!o&&!p)return;function a(e){i.removeAll();let t=e;n&&(t=_tailwindcss.optimizeCss.call(void 0, t,{minify:typeof n=="object"?n.minify:!1})),i.append(_postcss2.default.parse(t,s.opts))}if(!o){a(_tailwindcss.compile.call(void 0, i.toString(),[]));return}let{candidates:c,files:m,globs:u}=_oxide.scanDir.call(void 0, {base:f,globs:!0});for(let e of m)s.messages.push({type:"dependency",plugin:"tailwindcss-v4",file:e,parent:s.opts.from});for(let{base:e,glob:t}of u)s.messages.push({type:"dir-dependency",plugin:"tailwindcss-v4",dir:e,glob:t,parent:s.opts.from});a(_tailwindcss.compile.call(void 0, i.toString(),c))}]}}var h=Object.assign(w,{postcss:!0});exports.default = h;
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;
2
2
 
3
3
  module.exports = exports.default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailwindcss/postcss",
3
- "version": "4.0.0-alpha.7",
3
+ "version": "4.0.0-alpha.9",
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": {
@@ -24,9 +24,10 @@
24
24
  }
25
25
  },
26
26
  "dependencies": {
27
+ "lightningcss": "^1.24.0",
27
28
  "postcss-import": "^16.0.0",
28
- "@tailwindcss/oxide": "4.0.0-alpha.7",
29
- "tailwindcss": "4.0.0-alpha.7"
29
+ "tailwindcss": "4.0.0-alpha.9",
30
+ "@tailwindcss/oxide": "4.0.0-alpha.9"
30
31
  },
31
32
  "devDependencies": {
32
33
  "@types/node": "^20.11.17",