@tailwindcss/vite 0.0.0-insiders.f8d7623 → 0.0.0-insiders.f945c3d

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
@@ -27,14 +27,10 @@ For full documentation, visit [tailwindcss.com](https://tailwindcss.com).
27
27
 
28
28
  ## Community
29
29
 
30
- For help, discussion about best practices, or any other conversation that would benefit from being searchable:
30
+ For help, discussion about best practices, or feature ideas:
31
31
 
32
32
  [Discuss Tailwind CSS on GitHub](https://github.com/tailwindcss/tailwindcss/discussions)
33
33
 
34
- For chatting with others using the framework:
35
-
36
- [Join the Tailwind CSS Discord Server](https://discord.gg/7NF8GNe)
37
-
38
34
  ## Contributing
39
35
 
40
36
  If you're interested in contributing to Tailwind CSS, please read our [contributing docs](https://github.com/tailwindcss/tailwindcss/blob/next/.github/CONTRIBUTING.md) **before submitting a pull request**.
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- var D=(i,e)=>(e=Symbol[i])?e:Symbol.for("Symbol."+i),P=i=>{throw TypeError(i)};var b=(i,e,s)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&P("Object expected");var t,c;s&&(t=e[D("asyncDispose")]),t===void 0&&(t=e[D("dispose")],s&&(c=t)),typeof t!="function"&&P("Object not disposable"),c&&(t=function(){try{c.call(this)}catch(o){return Promise.reject(o)}}),i.push([s,t,e])}else s&&i.push([s]);return e},w=(i,e,s)=>{var t=typeof SuppressedError=="function"?SuppressedError:function(a,u,r,n){return n=Error(r),n.name="SuppressedError",n.error=a,n.suppressed=u,n},c=a=>e=s?new t(a,e,"An error was suppressed during disposal"):(s=!0,a),o=a=>{for(;a=i.pop();)try{var u=a[1]&&a[1].call(a[2]);if(a[0])return Promise.resolve(u).then(o,r=>(c(r),o()))}catch(r){c(r)}if(s)throw e};return o()};import{compile as F,env as U,Features as m,Instrumentation as B,normalizePath as x}from"@tailwindcss/node";import{clearRequireCache as V}from"@tailwindcss/node/require-cache";import{Scanner as A}from"@tailwindcss/oxide";import{Features as h,transform as G}from"lightningcss";import y from"node:fs/promises";import p from"node:path";var d=U.DEBUG,J=/[?&](?:worker|sharedworker|raw|url)\b/,L=/\?commonjs-proxy/,z=/[?&]index\=\d+\.css$/;function K(){let i=[],e=null,s=!1,t=!1,c=new R(o=>{let a=e.createResolver({...e.resolve,extensions:[".css"],mainFields:["style"],conditions:["style","development|production"],tryIndex:!1,preferRelative:!0});function u(l,f){return a(l,f,!0,s)}let r=e.createResolver(e.resolve);function n(l,f){return r(l,f,!0,s)}return new C(o,e.root,u,n)});return[{name:"@tailwindcss/vite:scan",enforce:"pre",configureServer(o){i.push(o)},async configResolved(o){e=o,t=e.build.cssMinify!==!1,s=e.build.ssr!==!1&&e.build.ssr!==void 0}},{name:"@tailwindcss/vite:generate:serve",apply:"serve",enforce:"pre",async transform(o,a,u){var f=[];try{if(!E(a))return;let r=b(f,new B);d&&r.start("[@tailwindcss/vite] Generate CSS (serve)");let n=c.get(a);let l=await n.generate(o,_=>this.addWatchFile(_),r);if(!l)return c.delete(a),o;d&&r.end("[@tailwindcss/vite] Generate CSS (serve)");return{code:l}}catch(g){var v=g,S=!0}finally{w(f,v,S)}}},{name:"@tailwindcss/vite:generate:build",apply:"build",enforce:"pre",async transform(o,a){var l=[];try{if(!E(a))return;let u=b(l,new B);d&&u.start("[@tailwindcss/vite] Generate CSS (build)");let r=c.get(a);let n=await r.generate(o,S=>this.addWatchFile(S),u);if(!n)return c.delete(a),o;d&&u.end("[@tailwindcss/vite] Generate CSS (build)");d&&u.start("[@tailwindcss/vite] Optimize CSS");n=T(n,{minify:t});d&&u.end("[@tailwindcss/vite] Optimize CSS");return{code:n}}catch(f){var g=f,v=!0}finally{w(l,g,v)}}}]}function O(i){let[e]=i.split("?",2);return p.extname(e).slice(1)}function E(i){return i.includes("/.vite/")?void 0:(O(i)==="css"||i.includes("&lang.css")||i.match(z))&&!J.test(i)&&!L.test(i)}function T(i,{file:e="input.css",minify:s=!1}={}){function t(c){return G({filename:e,code:c,minify:s,sourceMap:!1,drafts:{customMedia:!0},nonStandard:{deepSelectorCombinator:!0},include:h.Nesting,exclude:h.LogicalProperties|h.DirSelector|h.LightDark,targets:{safari:16<<16|1024,ios_saf:16<<16|1024,firefox:8388608,chrome:7274496},errorRecovery:!0}).code}return t(t(Buffer.from(i))).toString()}function M(i){return p.resolve(i.replace(/\?.*$/,""))}var R=class extends Map{constructor(s){super();this.factory=s}get(s){let t=super.get(s);return t===void 0&&(t=this.factory(s,this),this.set(s,t)),t}},C=class{constructor(e,s,t,c){this.id=e;this.base=s;this.customCssResolver=t;this.customJsResolver=c}compiler;scanner;candidates=new Set;buildDependencies=new Map;async generate(e,s,t){let c=this.requiresBuild(),o=M(this.id),a=p.dirname(p.resolve(o));if(!this.compiler||!this.scanner||await c){V(Array.from(this.buildDependencies.keys())),this.buildDependencies.clear(),this.addBuildDependency(M(o)),d&&t.start("Setup compiler");let r=[];this.compiler=await F(e,{base:a,shouldRewriteUrls:!0,onDependency:l=>{s(l),r.push(this.addBuildDependency(l))},customCssResolver:this.customCssResolver,customJsResolver:this.customJsResolver}),await Promise.all(r),d&&t.end("Setup compiler"),d&&t.start("Setup scanner");let n=(this.compiler.root==="none"?[]:this.compiler.root===null?[{base:this.base,pattern:"**/*"}]:[this.compiler.root]).concat(this.compiler.globs);this.scanner=new A({sources:n}),d&&t.end("Setup scanner")}if(!(this.compiler.features&(m.AtApply|m.JsPluginCompat|m.ThemeFunction|m.Utilities)))return!1;if(this.compiler.features&m.Utilities){d&&t.start("Scan for candidates");for(let r of this.scanner.scan())this.candidates.add(r);d&&t.end("Scan for candidates")}if(this.compiler.features&m.Utilities){for(let r of this.scanner.files)s(r);for(let r of this.scanner.globs){if(r.pattern[0]==="!")continue;let n=p.relative(this.base,r.base);n[0]!=="."&&(n="./"+n),n=x(n),s(p.posix.join(n,r.pattern));let l=this.compiler.root;if(l!=="none"&&l!==null){let f=x(p.resolve(l.base,l.pattern));if(!await y.stat(f).then(v=>v.isDirectory(),()=>!1))throw new Error(`The path given to \`source(\u2026)\` must be a directory but got \`source(${f})\` instead.`)}}}d&&t.start("Build CSS");let u=this.compiler.build([...this.candidates]);return d&&t.end("Build CSS"),u}async addBuildDependency(e){let s=await y.stat(e);this.buildDependencies.set(e,s.mtimeMs)}async requiresBuild(){for(let[e,s]of this.buildDependencies)if((await y.stat(e)).mtimeMs>s)return!0;return!1}};export{K as default};
1
+ var D=(r,e)=>(e=Symbol[r])?e:Symbol.for("Symbol."+r),P=r=>{throw TypeError(r)};var b=(r,e,s)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&P("Object expected");var t,u;s&&(t=e[D("asyncDispose")]),t===void 0&&(t=e[D("dispose")],s&&(u=t)),typeof t!="function"&&P("Object not disposable"),u&&(t=function(){try{u.call(this)}catch(n){return Promise.reject(n)}}),r.push([s,t,e])}else s&&r.push([s]);return e},w=(r,e,s)=>{var t=typeof SuppressedError=="function"?SuppressedError:function(a,p,d,l){return l=Error(d),l.name="SuppressedError",l.error=a,l.suppressed=p,l},u=a=>e=s?new t(a,e,"An error was suppressed during disposal"):(s=!0,a),n=a=>{for(;a=r.pop();)try{var p=a[1]&&a[1].call(a[2]);if(a[0])return Promise.resolve(p).then(n,d=>(u(d),n()))}catch(d){u(d)}if(s)throw e};return n()};import{compile as F,env as _,Features as h,Instrumentation as M,normalizePath as B,optimize as U,toSourceMap as V}from"@tailwindcss/node";import{clearRequireCache as G}from"@tailwindcss/node/require-cache";import{Scanner as J}from"@tailwindcss/oxide";import y from"fs/promises";import m from"path";var c=_.DEBUG,A=/[?&](?:worker|sharedworker|raw|url)\b/,K=/\?commonjs-proxy/,O=/[?&]index\=\d+\.css$/;function T(){let r=[],e=null,s=!1,t=!1,u=new R(n=>{let a=e.createResolver({...e.resolve,extensions:[".css"],mainFields:["style"],conditions:["style","development|production"],tryIndex:!1,preferRelative:!0});function p(i,o){return a(i,o,!0,s)}let d=e.createResolver(e.resolve);function l(i,o){return d(i,o,!0,s)}return new C(n,e.root,e?.css.devSourcemap??!1,p,l)});return[{name:"@tailwindcss/vite:scan",enforce:"pre",configureServer(n){r.push(n)},async configResolved(n){e=n,t=e.build.cssMinify!==!1,s=e.build.ssr!==!1&&e.build.ssr!==void 0}},{name:"@tailwindcss/vite:generate:serve",apply:"serve",enforce:"pre",async transform(n,a,p){var o=[];try{if(!x(a))return;let d=b(o,new M);c&&d.start("[@tailwindcss/vite] Generate CSS (serve)");let l=u.get(a);let i=await l.generate(n,S=>this.addWatchFile(S),d);if(!i)return u.delete(a),n;c&&d.end("[@tailwindcss/vite] Generate CSS (serve)");return i}catch(f){var v=f,g=!0}finally{w(o,v,g)}}},{name:"@tailwindcss/vite:generate:build",apply:"build",enforce:"pre",async transform(n,a){var i=[];try{if(!x(a))return;let p=b(i,new M);c&&p.start("[@tailwindcss/vite] Generate CSS (build)");let d=u.get(a);let l=await d.generate(n,g=>this.addWatchFile(g),p);if(!l)return u.delete(a),n;c&&p.end("[@tailwindcss/vite] Generate CSS (build)");c&&p.start("[@tailwindcss/vite] Optimize CSS");l=U(l.code,{minify:t,map:l.map});c&&p.end("[@tailwindcss/vite] Optimize CSS");return l}catch(o){var f=o,v=!0}finally{w(i,f,v)}}}]}function q(r){let[e]=r.split("?",2);return m.extname(e).slice(1)}function x(r){return r.includes("/.vite/")?void 0:(q(r)==="css"||r.includes("&lang.css")||r.match(O))&&!A.test(r)&&!K.test(r)}function E(r){return m.resolve(r.replace(/\?.*$/,""))}var R=class extends Map{constructor(s){super();this.factory=s}get(s){let t=super.get(s);return t===void 0&&(t=this.factory(s,this),this.set(s,t)),t}},C=class{constructor(e,s,t,u,n){this.id=e;this.base=s;this.enableSourceMaps=t;this.customCssResolver=u;this.customJsResolver=n}compiler;scanner;candidates=new Set;buildDependencies=new Map;async generate(e,s,t){let u=E(this.id);function n(i){i!==u&&(/[\#\?].*\.svg$/.test(i)||s(i))}let a=this.requiresBuild(),p=m.dirname(m.resolve(u));if(!this.compiler||!this.scanner||await a){G(Array.from(this.buildDependencies.keys())),this.buildDependencies.clear(),this.addBuildDependency(E(u)),c&&t.start("Setup compiler");let i=[];this.compiler=await F(e,{from:this.enableSourceMaps?this.id:void 0,base:p,shouldRewriteUrls:!0,onDependency:f=>{n(f),i.push(this.addBuildDependency(f))},customCssResolver:this.customCssResolver,customJsResolver:this.customJsResolver}),await Promise.all(i),c&&t.end("Setup compiler"),c&&t.start("Setup scanner");let o=(this.compiler.root==="none"?[]:this.compiler.root===null?[{base:this.base,pattern:"**/*",negated:!1}]:[{...this.compiler.root,negated:!1}]).concat(this.compiler.sources);this.scanner=new J({sources:o}),c&&t.end("Setup scanner")}else for(let i of this.buildDependencies.keys())n(i);if(!(this.compiler.features&(h.AtApply|h.JsPluginCompat|h.ThemeFunction|h.Utilities)))return!1;if(this.compiler.features&h.Utilities){c&&t.start("Scan for candidates");for(let i of this.scanner.scan())this.candidates.add(i);c&&t.end("Scan for candidates")}if(this.compiler.features&h.Utilities){for(let i of this.scanner.files)n(i);for(let i of this.scanner.globs){if(i.pattern[0]==="!")continue;let o=m.relative(this.base,i.base);o[0]!=="."&&(o="./"+o),o=B(o),n(m.posix.join(o,i.pattern));let f=this.compiler.root;if(f!=="none"&&f!==null){let v=B(m.resolve(f.base,f.pattern));if(!await y.stat(v).then(S=>S.isDirectory(),()=>!1))throw new Error(`The path given to \`source(\u2026)\` must be a directory but got \`source(${v})\` instead.`)}}}c&&t.start("Build CSS");let d=this.compiler.build([...this.candidates]);c&&t.end("Build CSS"),c&&t.start("Build Source Map");let l=this.enableSourceMaps?V(this.compiler.buildSourceMap()).raw:void 0;return c&&t.end("Build Source Map"),{code:d,map:l}}async addBuildDependency(e){let s=null;try{s=(await y.stat(e)).mtimeMs}catch{}this.buildDependencies.set(e,s)}async requiresBuild(){for(let[e,s]of this.buildDependencies){if(s===null)return!0;try{if((await y.stat(e)).mtimeMs>s)return!0}catch{return!0}}return!1}};export{T as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailwindcss/vite",
3
- "version": "0.0.0-insiders.f8d7623",
3
+ "version": "0.0.0-insiders.f945c3d",
4
4
  "description": "A utility-first CSS framework for rapidly building custom user interfaces.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -20,21 +20,20 @@
20
20
  "exports": {
21
21
  ".": {
22
22
  "types": "./dist/index.d.mts",
23
- "import": "./dist/index.mjs"
23
+ "default": "./dist/index.mjs"
24
24
  }
25
25
  },
26
26
  "dependencies": {
27
- "lightningcss": "^1.29.1",
28
- "@tailwindcss/node": "0.0.0-insiders.f8d7623",
29
- "@tailwindcss/oxide": "0.0.0-insiders.f8d7623",
30
- "tailwindcss": "0.0.0-insiders.f8d7623"
27
+ "@tailwindcss/node": "0.0.0-insiders.f945c3d",
28
+ "@tailwindcss/oxide": "0.0.0-insiders.f945c3d",
29
+ "tailwindcss": "0.0.0-insiders.f945c3d"
31
30
  },
32
31
  "devDependencies": {
33
- "@types/node": "^20.14.8",
34
- "vite": "^6.0.0"
32
+ "@types/node": "^20.19.0",
33
+ "vite": "^7.0.0"
35
34
  },
36
35
  "peerDependencies": {
37
- "vite": "^5.2.0 || ^6"
36
+ "vite": "^5.2.0 || ^6 || ^7"
38
37
  },
39
38
  "scripts": {
40
39
  "build": "tsup-node",