@tailwindcss/postcss 0.0.0-insiders.229121d → 0.0.0-insiders.22c0618

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/README.md CHANGED
@@ -49,7 +49,7 @@ import tailwindcss from "@tailwindcss/postcss"
49
49
  export default {
50
50
  plugins: [
51
51
  tailwindcss({
52
- base: path.resolve(__dirname, "./path)
52
+ base: path.resolve(__dirname, "./path")
53
53
  })
54
54
  ]
55
55
  }
package/dist/index.mjs CHANGED
@@ -7,4 +7,4 @@ var pe=(e,r)=>(r=Symbol[e])?r:Symbol.for("Symbol."+e),de=e=>{throw TypeError(e)}
7
7
  `;if(r){t+=s.length;let c=t;t+=i.name.length,t+=1,t+=i.params.length;let m=t;t+=2,i.dst=[o,c,m]}return f}if(u+=`${s}${i.name}${i.params?` ${i.params} `:" "}{
8
8
  `,r){t+=s.length;let f=t;t+=i.name.length,i.params&&(t+=1,t+=i.params.length),t+=1;let c=t;i.dst=[o,f,c],t+=2}for(let f of i.nodes)u+=a(f,l+1);u+=`${s}}
9
9
  `,r&&(t+=s.length,t+=2)}else if(i.kind==="comment"){if(u+=`${s}/*${i.value}*/
10
- `,r){t+=s.length;let f=t;t+=2+i.value.length+2;let c=t;i.dst=[o,f,c],t+=1}}else if(i.kind==="context"||i.kind==="at-root")return"";return u}let n="";for(let i of e)n+=a(i,0);return o.code=n,n}var Lt=33;function Me(e,r,t){let o=new d(s=>new e.Input(s.code,{map:t?.input.map,from:s.file??void 0})),a=new d(s=>q(s.code)),n=e.root();n.source=t;function i(s){if(!s||!s[0])return;let f=a.get(s[0]),c=f.find(s[1]),m=f.find(s[2]);return{input:o.get(s[0]),start:{line:c.line,column:c.column+1,offset:s[1]},end:{line:m.line,column:m.column+1,offset:s[2]}}}function l(s,f){let c=i(f);c?s.source=c:delete s.source}function u(s,f){if(s.kind==="declaration"){let c=e.decl({prop:s.property,value:s.value??"",important:s.important});l(c,s.src),f.append(c)}else if(s.kind==="rule"){let c=e.rule({selector:s.selector});l(c,s.src),c.raws.semicolon=!0,f.append(c);for(let m of s.nodes)u(m,c)}else if(s.kind==="at-rule"){let c=e.atRule({name:s.name.slice(1),params:s.params});l(c,s.src),c.raws.semicolon=!0,f.append(c);for(let m of s.nodes)u(m,c)}else if(s.kind==="comment"){let c=e.comment({text:s.value});c.raws.left="",c.raws.right="",l(c,s.src),f.append(c)}else s.kind==="at-root"||s.kind}for(let s of r)u(s,n);return n}function Fe(e){let r=new d(n=>({file:n.file??n.id??null,code:n.css}));function t(n){let i=n.source;if(!i)return;let l=i.input;if(l&&i.start!==void 0&&i.end!==void 0)return[r.get(l),i.start.offset,i.end.offset]}function o(n,i){if(n.type==="decl"){let l=$(n.prop,n.value,n.important);l.src=t(n),i.push(l)}else if(n.type==="rule"){let l=P(n.selector);l.src=t(n),n.each(u=>o(u,l.nodes)),i.push(l)}else if(n.type==="atrule"){let l=x(`@${n.name}`,n.params);l.src=t(n),n.each(u=>o(u,l.nodes)),i.push(l)}else if(n.type==="comment"){if(n.text.charCodeAt(0)!==Lt)return;let l=Z(n.text);l.src=t(n),i.push(l)}}let a=[];return e.each(n=>o(n,a)),a}import{normalizePath as je}from"@tailwindcss/node";import J from"path";var le="'",ae='"';function se(){let e=new WeakSet;function r(t){let o=t.root().source?.input.file;if(!o)return;let a=t.source?.input.file;if(!a||e.has(t))return;let n=t.params[0],i=n[0]===ae&&n[n.length-1]===ae?ae:n[0]===le&&n[n.length-1]===le?le:null;if(!i)return;let l=t.params.slice(1,-1),u="";if(l.startsWith("!")&&(l=l.slice(1),u="!"),!l.startsWith("./")&&!l.startsWith("../"))return;let s=J.posix.join(je(J.dirname(a)),l),f=J.posix.dirname(je(o)),c=J.posix.relative(f,s);c.startsWith(".")||(c="./"+c),t.params=i+u+c+i,e.add(t)}return{postcssPlugin:"tailwindcss-postcss-fix-relative-paths",Once(t){t.walkAtRules(/source|plugin|config/,r)}}}var p=Mt.DEBUG,ce=new Kt({maxSize:50});function Gt(e,r,t){let o=`${r}:${t.base??""}:${JSON.stringify(t.optimize)}`;if(ce.has(o))return ce.get(o);let a={mtimes:new Map,compiler:null,scanner:null,tailwindCssAst:[],cachedPostCssAst:e.root(),optimizedPostCssAst:e.root(),fullRebuildPaths:[]};return ce.set(o,a),a}function Ht(e={}){let r=e.base??process.cwd(),t=e.optimize??process.env.NODE_ENV==="production",o=e.transformAssetUrls??!0;return{postcssPlugin:"@tailwindcss/postcss",plugins:[se(),{postcssPlugin:"tailwindcss",async Once(a,{result:n,postcss:i}){var T=[];try{let l=me(T,new Ft);let u=n.opts.from??"";let s=u.endsWith(".module.css");p&&l.start(`[@tailwindcss/postcss] ${We(r,u)}`);{p&&l.start("Quick bail check");let y=!0;if(a.walkAtRules(g=>{if(g.name==="import"||g.name==="reference"||g.name==="theme"||g.name==="variant"||g.name==="config"||g.name==="plugin"||g.name==="apply"||g.name==="tailwind")return y=!1,!1}),y)return;p&&l.end("Quick bail check")}let f=Gt(i,u,e);let c=D.dirname(D.resolve(u));let m=f.compiler===null;async function O(){p&&l.start("Setup compiler"),f.fullRebuildPaths.length>0&&!m&&Wt(f.fullRebuildPaths),f.fullRebuildPaths=[],p&&l.start("PostCSS AST -> Tailwind CSS AST");let y=Fe(a);p&&l.end("PostCSS AST -> Tailwind CSS AST"),p&&l.start("Create compiler");let g=await zt(y,{from:n.opts.from,base:c,shouldRewriteUrls:o,onDependency:X=>f.fullRebuildPaths.push(X),polyfills:s?fe.All^fe.AtProperty:fe.All});return p&&l.end("Create compiler"),p&&l.end("Setup compiler"),g}try{if(f.compiler??=O(),(await f.compiler).features===ue.None)return;let y="incremental";p&&l.start("Register full rebuild paths");{for(let k of f.fullRebuildPaths)n.messages.push({type:"dependency",plugin:"@tailwindcss/postcss",file:D.resolve(k),parent:n.opts.from});let _=n.messages.flatMap(k=>k.type!=="dependency"?[]:k.file);_.push(u);for(let k of _){let E=Yt.statSync(k,{throwIfNoEntry:!1})?.mtimeMs??null;if(E===null){k===u&&(y="full");continue}f.mtimes.get(k)!==E&&(y="full",f.mtimes.set(k,E))}}p&&l.end("Register full rebuild paths"),y==="full"&&!m&&(f.compiler=O());let g=await f.compiler;if(f.scanner===null||y==="full"){p&&l.start("Setup scanner");let _=(g.root==="none"?[]:g.root===null?[{base:r,pattern:"**/*",negated:!1}]:[{...g.root,negated:!1}]).concat(g.sources);f.scanner=new Bt({sources:_}),p&&l.end("Setup scanner")}p&&l.start("Scan for candidates");let X=g.features&ue.Utilities?f.scanner.scan():[];if(p&&l.end("Scan for candidates"),g.features&ue.Utilities){p&&l.start("Register dependency messages");let _=D.resolve(r,u);for(let k of f.scanner.files){let E=D.resolve(k);E!==_&&n.messages.push({type:"dependency",plugin:"@tailwindcss/postcss",file:E,parent:n.opts.from})}for(let{base:k,pattern:E}of f.scanner.globs)E==="*"&&r===k||(E===""?n.messages.push({type:"dependency",plugin:"@tailwindcss/postcss",file:D.resolve(k),parent:n.opts.from}):n.messages.push({type:"dir-dependency",plugin:"@tailwindcss/postcss",dir:D.resolve(k),glob:E,parent:n.opts.from}));p&&l.end("Register dependency messages")}p&&l.start("Build utilities");let Y=g.build(X);if(p&&l.end("Build utilities"),f.tailwindCssAst!==Y)if(t){p&&l.start("Optimization"),p&&l.start("AST -> CSS");let _=K(Y);p&&l.end("AST -> CSS"),p&&l.start("Lightning CSS");let k=jt(_,{minify:typeof t=="object"?t.minify:!0});p&&l.end("Lightning CSS"),p&&l.start("CSS -> PostCSS AST"),f.optimizedPostCssAst=i.parse(k.code,n.opts),p&&l.end("CSS -> PostCSS AST"),p&&l.end("Optimization")}else p&&l.start("Transform Tailwind CSS AST into PostCSS AST"),f.cachedPostCssAst=Me(i,Y,a.source),p&&l.end("Transform Tailwind CSS AST into PostCSS AST");f.tailwindCssAst=Y,p&&l.start("Update PostCSS AST"),a.removeAll(),a.append(t?f.optimizedPostCssAst.clone().nodes:f.cachedPostCssAst.clone().nodes),a.raws.indent=" ",p&&l.end("Update PostCSS AST"),p&&l.end(`[@tailwindcss/postcss] ${We(r,u)}`)}catch(y){f.compiler=null;for(let g of f.fullRebuildPaths)n.messages.push({type:"dependency",plugin:"@tailwindcss/postcss",file:D.resolve(g),parent:n.opts.from});throw console.error(y),y&&typeof y=="object"&&"message"in y?a.error(`${y.message}`):a.error(`${y}`)}}catch(Be){var Ye=Be,Ge=!0}finally{ge(T,Ye,Ge)}}}]}}var Qa=Object.assign(Ht,{postcss:!0});export{Qa as default};
10
+ `,r){t+=s.length;let f=t;t+=2+i.value.length+2;let c=t;i.dst=[o,f,c],t+=1}}else if(i.kind==="context"||i.kind==="at-root")return"";return u}let n="";for(let i of e)n+=a(i,0);return o.code=n,n}var Lt=33;function Me(e,r,t){let o=new d(s=>new e.Input(s.code,{map:t?.input.map,from:s.file??void 0})),a=new d(s=>q(s.code)),n=e.root();n.source=t;function i(s){if(!s||!s[0])return;let f=a.get(s[0]),c=f.find(s[1]),m=f.find(s[2]);return{input:o.get(s[0]),start:{line:c.line,column:c.column+1,offset:s[1]},end:{line:m.line,column:m.column+1,offset:s[2]}}}function l(s,f){let c=i(f);c?s.source=c:delete s.source}function u(s,f){if(s.kind==="declaration"){let c=e.decl({prop:s.property,value:s.value??"",important:s.important});l(c,s.src),f.append(c)}else if(s.kind==="rule"){let c=e.rule({selector:s.selector});l(c,s.src),c.raws.semicolon=!0,f.append(c);for(let m of s.nodes)u(m,c)}else if(s.kind==="at-rule"){let c=e.atRule({name:s.name.slice(1),params:s.params});l(c,s.src),c.raws.semicolon=!0,f.append(c);for(let m of s.nodes)u(m,c)}else if(s.kind==="comment"){let c=e.comment({text:s.value});c.raws.left="",c.raws.right="",l(c,s.src),f.append(c)}else s.kind==="at-root"||s.kind}for(let s of r)u(s,n);return n}function Fe(e){let r=new d(n=>({file:n.file??n.id??null,code:n.css}));function t(n){let i=n.source;if(!i)return;let l=i.input;if(l&&i.start!==void 0&&i.end!==void 0)return[r.get(l),i.start.offset,i.end.offset]}function o(n,i){if(n.type==="decl"){let l=$(n.prop,n.value,n.important);l.src=t(n),i.push(l)}else if(n.type==="rule"){let l=P(n.selector);l.src=t(n),n.each(u=>o(u,l.nodes)),i.push(l)}else if(n.type==="atrule"){let l=x(`@${n.name}`,n.params);l.src=t(n),n.each(u=>o(u,l.nodes)),i.push(l)}else if(n.type==="comment"){if(n.text.charCodeAt(0)!==Lt)return;let l=Z(n.text);l.src=t(n),i.push(l)}}let a=[];return e.each(n=>o(n,a)),a}import{normalizePath as je}from"@tailwindcss/node";import J from"path";var le="'",ae='"';function se(){let e=new WeakSet;function r(t){let o=t.root().source?.input.file;if(!o)return;let a=t.source?.input.file;if(!a||e.has(t))return;let n=t.params[0],i=n[0]===ae&&n[n.length-1]===ae?ae:n[0]===le&&n[n.length-1]===le?le:null;if(!i)return;let l=t.params.slice(1,-1),u="";if(l.startsWith("!")&&(l=l.slice(1),u="!"),!l.startsWith("./")&&!l.startsWith("../"))return;let s=J.posix.join(je(J.dirname(a)),l),f=J.posix.dirname(je(o)),c=J.posix.relative(f,s);c.startsWith(".")||(c="./"+c),t.params=i+u+c+i,e.add(t)}return{postcssPlugin:"tailwindcss-postcss-fix-relative-paths",Once(t){t.walkAtRules(/source|plugin|config/,r)}}}var p=Mt.DEBUG,ce=new Kt({maxSize:50});function Gt(e,r,t){let o=`${r}:${t.base??""}:${JSON.stringify(t.optimize)}`;if(ce.has(o))return ce.get(o);let a={mtimes:new Map,compiler:null,scanner:null,tailwindCssAst:[],cachedPostCssAst:e.root(),optimizedPostCssAst:e.root(),fullRebuildPaths:[]};return ce.set(o,a),a}function Ht(e={}){let r=e.base??process.cwd(),t=e.optimize??process.env.NODE_ENV==="production",o=e.transformAssetUrls??!0;return{postcssPlugin:"@tailwindcss/postcss",plugins:[se(),{postcssPlugin:"tailwindcss",async Once(a,{result:n,postcss:i}){var T=[];try{let l=me(T,new Ft);let u=n.opts.from??"";let s=u.endsWith(".module.css");p&&l.start(`[@tailwindcss/postcss] ${We(r,u)}`);{p&&l.start("Quick bail check");let y=!0;if(a.walkAtRules(g=>{if(g.name==="import"||g.name==="reference"||g.name==="theme"||g.name==="variant"||g.name==="config"||g.name==="plugin"||g.name==="apply"||g.name==="tailwind")return y=!1,!1}),y)return;p&&l.end("Quick bail check")}let f=Gt(i,u,e);let c=D.dirname(D.resolve(u));let m=f.compiler===null;async function O(){p&&l.start("Setup compiler"),f.fullRebuildPaths.length>0&&!m&&Wt(f.fullRebuildPaths),f.fullRebuildPaths=[],p&&l.start("PostCSS AST -> Tailwind CSS AST");let y=Fe(a);p&&l.end("PostCSS AST -> Tailwind CSS AST"),p&&l.start("Create compiler");let g=await zt(y,{from:n.opts.from,base:c,shouldRewriteUrls:o,onDependency:X=>f.fullRebuildPaths.push(X),polyfills:s?fe.All^fe.AtProperty:fe.All});return p&&l.end("Create compiler"),p&&l.end("Setup compiler"),g}try{if(f.compiler??=O(),(await f.compiler).features===ue.None)return;let y="incremental";p&&l.start("Register full rebuild paths");{for(let k of f.fullRebuildPaths)n.messages.push({type:"dependency",plugin:"@tailwindcss/postcss",file:D.resolve(k),parent:n.opts.from});let _=n.messages.flatMap(k=>k.type!=="dependency"?[]:k.file);_.push(u);for(let k of _){let E=Yt.statSync(k,{throwIfNoEntry:!1})?.mtimeMs??null;if(E===null){k===u&&(y="full");continue}f.mtimes.get(k)!==E&&(y="full",f.mtimes.set(k,E))}}p&&l.end("Register full rebuild paths"),y==="full"&&!m&&(f.compiler=O());let g=await f.compiler;if(f.scanner===null||y==="full"){p&&l.start("Setup scanner");let _=(g.root==="none"?[]:g.root===null?[{base:r,pattern:"**/*",negated:!1}]:[{...g.root,negated:!1}]).concat(g.sources);f.scanner=new Bt({sources:_}),p&&l.end("Setup scanner")}p&&l.start("Scan for candidates");let X=g.features&ue.Utilities?f.scanner.scan():[];if(p&&l.end("Scan for candidates"),g.features&ue.Utilities){p&&l.start("Register dependency messages");let _=D.resolve(r,u);for(let k of f.scanner.files){let E=D.resolve(k);E!==_&&n.messages.push({type:"dependency",plugin:"@tailwindcss/postcss",file:E,parent:n.opts.from})}for(let{base:k,pattern:E}of f.scanner.globs)E==="*"&&r===k||(E===""?n.messages.push({type:"dependency",plugin:"@tailwindcss/postcss",file:D.resolve(k),parent:n.opts.from}):n.messages.push({type:"dir-dependency",plugin:"@tailwindcss/postcss",dir:D.resolve(k),glob:E,parent:n.opts.from}));p&&l.end("Register dependency messages")}p&&l.start("Build utilities");let Y=g.build(X);if(p&&l.end("Build utilities"),f.tailwindCssAst!==Y)if(t){p&&l.start("Optimization"),p&&l.start("AST -> CSS");let _=K(Y);p&&l.end("AST -> CSS"),p&&l.start("Lightning CSS");let k=jt(_,{minify:typeof t=="object"?t.minify:!0});p&&l.end("Lightning CSS"),p&&l.start("CSS -> PostCSS AST"),f.optimizedPostCssAst=i.parse(k.code,n.opts),p&&l.end("CSS -> PostCSS AST"),p&&l.end("Optimization")}else p&&l.start("Transform Tailwind CSS AST into PostCSS AST"),f.cachedPostCssAst=Me(i,Y,a.source),p&&l.end("Transform Tailwind CSS AST into PostCSS AST");f.tailwindCssAst=Y,p&&l.start("Update PostCSS AST"),a.removeAll(),a.append(t?f.optimizedPostCssAst.clone().nodes:f.cachedPostCssAst.clone().nodes),a.raws.indent=" ",p&&l.end("Update PostCSS AST"),p&&l.end(`[@tailwindcss/postcss] ${We(r,u)}`)}catch(y){f.compiler=null;for(let g of f.fullRebuildPaths)n.messages.push({type:"dependency",plugin:"@tailwindcss/postcss",file:D.resolve(g),parent:n.opts.from});throw console.error(y),y&&typeof y=="object"&&"message"in y?a.error(`${y.message}`):a.error(`${y}`)}}catch(Be){var Ye=Be,Ge=!0}finally{ge(T,Ye,Ge)}}}]}}var Ja=Object.assign(Ht,{postcss:!0});export{Ja as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailwindcss/postcss",
3
- "version": "0.0.0-insiders.229121d",
3
+ "version": "0.0.0-insiders.22c0618",
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,14 +27,14 @@
27
27
  "dependencies": {
28
28
  "@alloc/quick-lru": "^5.2.0",
29
29
  "postcss": "^8.4.41",
30
- "@tailwindcss/node": "0.0.0-insiders.229121d",
31
- "tailwindcss": "0.0.0-insiders.229121d",
32
- "@tailwindcss/oxide": "0.0.0-insiders.229121d"
30
+ "@tailwindcss/oxide": "0.0.0-insiders.22c0618",
31
+ "@tailwindcss/node": "0.0.0-insiders.22c0618",
32
+ "tailwindcss": "0.0.0-insiders.22c0618"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/node": "^20.19.0",
36
36
  "@types/postcss-import": "14.0.3",
37
- "dedent": "1.7.0",
37
+ "dedent": "1.7.1",
38
38
  "postcss-import": "^16.1.1",
39
39
  "internal-example-plugin": "0.0.0"
40
40
  },