@frontfriend/tailwind 2.5.2 → 2.5.4

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/cli.js CHANGED
@@ -1,73 +1,75 @@
1
1
  #!/usr/bin/env node
2
- var W=(t,n)=>()=>(n||t((n={exports:{}}).exports,n),n.exports);var q=W((K,O)=>{var D=require("fs"),E=require("path");function M(t={}){let n=t.projectRoot||process.cwd(),o=E.join(n,"node_modules",".cache","frontfriend","icons.json"),p=t.outputPath||E.join(n,"types","frontfriend.d.ts");D.existsSync(o)||(console.error('[FrontFriend] Error: icons.json not found. Please run "npx frontfriend init" first.'),process.exit(1));try{let h=function(y){for(let f of Object.values(y))typeof f=="string"?d.add(f):typeof f=="object"&&f!==null&&h(f)},x=function(y,f=" "){let k=[];for(let[S,s]of Object.entries(y))typeof s=="string"?k.push(`${f}${S}: '${s}';`):typeof s=="object"&&s!==null&&(k.push(`${f}${S}: {`),k.push(x(s,f+" ")),k.push(`${f}};`));return k.join(`
3
- `)};var a=h,m=x;let c=JSON.parse(D.readFileSync(o,"utf-8")),d=new Set;h(c);let e=Array.from(d).map(y=>`'${y}'`).join(" | "),i=`// Generated by @frontfriend/tailwind
2
+ var _=(t,i)=>()=>(i||t((i={exports:{}}).exports,i),i.exports);var q=_((K,E)=>{var P=require("fs"),N=require("path");function M(t={}){let i=t.projectRoot||process.cwd(),o=N.join(i,"node_modules",".cache","frontfriend","icons.json"),e=t.outputPath||N.join(i,"types","frontfriend.d.ts");P.existsSync(o)||(console.error('[FrontFriend] Error: icons.json not found. Please run "npx frontfriend init" first.'),process.exit(1));try{let m=function(a){for(let d of Object.values(a))typeof d=="string"?r.add(d):typeof d=="object"&&d!==null&&m(d)},F=function(a,d=" "){let S=[];for(let[D,c]of Object.entries(a))typeof c=="string"?S.push(`${d}${D}: '${c}';`):typeof c=="object"&&c!==null&&(S.push(`${d}${D}: {`),S.push(F(c,d+" ")),S.push(`${d}};`));return S.join(`
3
+ `)};var f=m,g=F;let l=JSON.parse(P.readFileSync(o,"utf-8")),r=new Set;m(l);let n=Array.from(r).map(a=>`'${a}'`).join(" | "),p=`// Generated by @frontfriend/tailwind
4
4
  // DO NOT EDIT THIS FILE MANUALLY
5
5
 
6
6
  import type { IconSetStructure } from '@frontfriend/tailwind';
7
7
 
8
8
  declare module '@frontfriend/tailwind' {
9
9
  // Icon names used in this project
10
- export type ProjectIconName = ${e||"string"};
10
+ export type ProjectIconName = ${n||"string"};
11
11
 
12
12
  // Typed iconSet structure with exact icon names
13
13
  export interface TypedIconSet extends IconSetStructure {
14
- ${x(c)}
14
+ ${F(l)}
15
15
  }
16
16
  }
17
17
 
18
18
  // Augment Vue component types with exact icon names
19
19
  declare module '*/components/ui/icon/*.vue' {
20
- export type IconName = ${e||"string"};
20
+ export type IconName = ${n||"string"};
21
21
  }
22
22
 
23
23
  declare module '@/components/ui/icon/*.vue' {
24
- export type IconName = ${e||"string"};
24
+ export type IconName = ${n||"string"};
25
25
  }
26
26
 
27
27
  declare module '@/components/ui/icon' {
28
- export type IconName = ${e||"string"};
28
+ export type IconName = ${n||"string"};
29
29
  }
30
30
 
31
31
  declare module '@/src/components/ui/icon' {
32
- export type IconName = ${e||"string"};
32
+ export type IconName = ${n||"string"};
33
33
  }
34
34
 
35
35
  declare module '@/src/components/ui/icon/Icon.vue' {
36
- export type IconName = ${e||"string"};
36
+ export type IconName = ${n||"string"};
37
37
  }
38
- `,$=E.dirname(p);D.existsSync($)||D.mkdirSync($,{recursive:!0}),D.writeFileSync(p,i),console.log("[FrontFriend] \u2713 Generated types at",E.relative(n,p));let l=E.join(n,"tsconfig.json");if(D.existsSync(l)){let y=JSON.parse(D.readFileSync(l,"utf-8"));y.include||(y.include=[]);let f="types/**/*.d.ts";y.include.includes(f)||(y.include.push(f),D.writeFileSync(l,JSON.stringify(y,null,2)),console.log("[FrontFriend] \u2713 Updated tsconfig.json to include generated types"))}}catch(c){console.error("[FrontFriend] Error generating icon types:",c.message),process.exit(1)}}require.main===O&&M();O.exports={generateIconTypes:M}});var{Command:G}=require("commander"),N=require("./lib/core/config-loader"),U=require("./lib/core/cache-manager"),{APIClient:J}=require("./lib/core/api-client"),{ComponentDownloader:A}=require("./lib/core/component-downloader"),B=require("./lib/core/token-processor"),{ConfigError:R,APIError:H,CacheError:V}=require("./lib/core/errors"),{loadEnvLocal:Y}=require("./lib/core/env-utils"),L=require("path");Y();var b=new G;b.name("frontfriend").description("FrontFriend Tailwind CLI - Manage design tokens and cache").version("2.4.0");b.command("init").description("Initialize FrontFriend configuration and fetch from API").option("--force","Force refresh even if cache is valid").option("--verbose","Show detailed output including safelist size and token counts").action(async t=>{try{console.log("\u{1F527} FrontFriend Setup"),console.log(`==================
39
- `);let o=await new N().load();if(!o.ffId)throw new R(`ff-id not found in frontfriend.config.js
40
- Please add "ff-id" to your frontfriend.config.js file`,"ff-id");console.log("\u{1F4CB} Configuration loaded"),console.log(` FF_ID: ${o.ffId}`),console.log(` App Root: ${o.appRoot}
41
- `);let p=new U(o.appRoot);!t.force&&p.exists()&&p.isValid()&&(console.log("\u2705 Cache is valid and up to date"),console.log(" Use --force to refresh anyway"),process.exit(0)),console.log("\u{1F50D} Checking cache..."),t.force?console.log(` Force refresh requested
42
- `):p.exists()?console.log(` Cache expired
38
+ `,$=N.dirname(e);P.existsSync($)||P.mkdirSync($,{recursive:!0}),P.writeFileSync(e,p),console.log("[FrontFriend] \u2713 Generated types at",N.relative(i,e));let I=N.join(i,"tsconfig.json");if(P.existsSync(I)){let a=JSON.parse(P.readFileSync(I,"utf-8"));a.include||(a.include=[]);let d="types/**/*.d.ts";a.include.includes(d)||(a.include.push(d),P.writeFileSync(I,JSON.stringify(a,null,2)),console.log("[FrontFriend] \u2713 Updated tsconfig.json to include generated types"))}}catch(l){console.error("[FrontFriend] Error generating icon types:",l.message),process.exit(1)}}require.main===E&&M();E.exports={generateIconTypes:M}});var{Command:G}=require("commander"),O=require("./lib/core/config-loader"),U=require("./lib/core/cache-manager"),{APIClient:J}=require("./lib/core/api-client"),{ComponentDownloader:A}=require("./lib/core/component-downloader"),B=require("./lib/core/token-processor"),{ConfigError:R,APIError:H,CacheError:V}=require("./lib/core/errors"),{loadEnvLocal:Y}=require("./lib/core/env-utils"),L=require("path");Y();var b=new G;b.name("frontfriend").description("FrontFriend Tailwind CLI - Manage design tokens and cache").version("2.4.0");b.command("init").description("Initialize FrontFriend configuration and fetch from API").option("--force","Force refresh even if cache is valid").option("--verbose","Show detailed output including safelist size and token counts").action(async t=>{var i;try{console.log("\u{1F527} FrontFriend Setup"),console.log(`==================
39
+ `);let e=await new O().load();if(!e.ffId)throw new R(`ff-id not found in frontfriend.config.js
40
+ Please add "ff-id" to your frontfriend.config.js file`,"ff-id");console.log("\u{1F4CB} Configuration loaded"),console.log(` FF_ID: ${e.ffId}`),console.log(` App Root: ${e.appRoot}
41
+ `);let f=new U(e.appRoot);!t.force&&f.exists()&&f.isValid()&&(console.log("\u2705 Cache is valid and up to date"),console.log(" Use --force to refresh anyway"),process.exit(0)),console.log("\u{1F50D} Checking cache..."),t.force?console.log(` Force refresh requested
42
+ `):f.exists()?console.log(` Cache expired
43
43
  `):console.log(` No cache found
44
- `),console.log("\u{1F310} Fetching configuration...");let a=new J(o.ffId,{baseURL:o["api-url"]||o.apiUrl});(o["api-url"]||o.apiUrl)&&console.log(` Using API URL: ${o["api-url"]||o.apiUrl}`);let m=null;try{m=await a.fetchProcessedTokens()}catch(s){console.log(` \u26A0\uFE0F Failed to fetch pre-processed tokens: ${s.message}`)}if(m){if(console.log(" \u2713 Pre-processed tokens fetched from server"),console.log(` \u2713 Skipping local processing
45
- `),console.log("\u{1F4BE} Saving cache..."),(process.env.FF_VERBOSE==="true"||t.verbose)&&console.log(` Safelist has ${m.safelist?m.safelist.length:0} items`),p.save(m),console.log(` \u2713 Cache saved successfully
46
- `),console.log("\u2705 Setup complete!"),console.log(" Your FrontFriend configuration has been cached."),console.log(" The Tailwind plugin will now use this cached data."),o.types){console.log(`
47
- \u{1F524} Generating TypeScript types...`);try{let{generateIconTypes:s}=q(),r=o.aliases&&o.aliases.types?L.join(o.appRoot,o.aliases.types,"frontfriend.d.ts"):void 0;s({projectRoot:o.appRoot,outputPath:r})}catch(s){console.log(" \u26A0\uFE0F Type generation failed:",s.message),console.log(' Enable type generation in frontfriend.config.js with "types": true')}}process.exit(0)}console.log(` \u2139\uFE0F Pre-processed tokens not available, falling back to local processing
48
- `);let[c,d,h,x,e,i]=await Promise.all([a.fetchTokens(),a.fetchComponentsConfig(),a.fetchFonts(),a.fetchIcons(),a.fetchVersion(),a.fetchCustomCss()]);if(console.log(" \u2713 Tokens fetched"),c.global||c.colors||c.semantic||c.semanticDark){let s=[c.global?"global":null,c.colors?"colors":null,c.semantic?"semantic":null,c.semanticDark?"semanticDark":null].filter(Boolean).join(", ");console.log(` (Found: ${s})`)}console.log(" \u2713 Components config fetched"),console.log(" \u2713 Fonts fetched"),console.log(" \u2713 Icons fetched"),console.log(" \u2713 Version fetched"),console.log(` \u2713 Custom CSS fetched
49
- `),console.log("\u2699\uFE0F Processing tokens...");let $=new B;console.log(" Processing raw token data...");let l=await $.process({colors:c.colors||c.global,semantic:c.semantic,semanticDark:c.semanticDark,fonts:h,globalTokens:c.global,animations:c.animations,version:e==null?void 0:e.version,ffId:o.ffId,customCss:i});console.log(" \u2713 Colors processed"),console.log(" \u2713 Semantic tokens processed"),l.fontFaces.length>0&&console.log(` \u2713 ${l.fontFaces.length} font faces processed`),Object.keys(l.animations).length>0&&console.log(` \u2713 ${Object.keys(l.animations).length} animations processed`),console.log(`
50
- `);let y=$.extractClassesFromComponentsConfig(d),f=[...l.safelist||[],...y||[]],k=[...new Set(f)].sort(),S={tokens:l.utilities,variables:l.variables,semanticVariables:l.semanticVariables,semanticDarkVariables:l.semanticDarkVariables,fonts:l.fontFaces,icons:x,componentsConfig:d,keyframes:l.keyframes,animations:l.animations,safelist:k,version:e,metadata:l.metadata,custom:l.custom};if(console.log("\u{1F4BE} Saving cache..."),(process.env.FF_VERBOSE==="true"||t.verbose)&&(console.log(" Cache data summary:"),console.log(` - Tokens: ${Object.keys(S.tokens||{}).length} utilities`),console.log(` - Variables: ${Object.keys(S.variables||{}).length} CSS variables`),console.log(` - Semantic variables: ${Object.keys(S.semanticVariables||{}).length} semantic variables`),console.log(` - Font faces: ${(S.fonts||[]).length} fonts`),console.log(` - Safelist: ${(S.safelist||[]).length} safelist classes`)),p.save(S),console.log(` \u2713 Cache saved successfully
51
- `),console.log("\u2705 Setup complete!"),console.log(" Your FrontFriend configuration has been cached."),console.log(" The Tailwind plugin will now use this cached data."),o.types){console.log(`
52
- \u{1F524} Generating TypeScript types...`);try{let{generateIconTypes:s}=q(),r=o.aliases&&o.aliases.types?L.join(o.appRoot,o.aliases.types,"frontfriend.d.ts"):void 0;s({projectRoot:o.appRoot,outputPath:r})}catch(s){console.log(" \u26A0\uFE0F Type generation failed:",s.message),console.log(' Enable type generation in frontfriend.config.js with "types": true')}}process.exit(0)}catch(n){n instanceof R?console.error("\u274C Configuration Error:",n.message):n instanceof H?(console.error("\u274C API Error:",n.message),console.error(` Status: ${n.statusCode}`),console.error(` URL: ${n.url}`)):n instanceof V?(console.error("\u274C Cache Error:",n.message),console.error(` Operation: ${n.operation}`)):console.error("\u274C Setup failed:",n.message),process.exit(1)}});b.command("clean").description("Remove cached configuration").action(async()=>{try{console.log(`\u{1F9F9} Cleaning FrontFriend cache...
53
- `);let n=new N().load(),o=new U(n.appRoot);o.exists()?(o.clear(),console.log("\u2705 Cache cleared successfully")):console.log("\u2139\uFE0F No cache found"),process.exit(0)}catch(t){t instanceof V?(console.error("\u274C Cache Error:",t.message),console.error(` Operation: ${t.operation}`)):console.error("\u274C Clean failed:",t.message),process.exit(1)}});b.command("status").description("Show cache status and configuration").action(async()=>{try{console.log("\u{1F4CA} FrontFriend Status"),console.log(`===================
54
- `),console.log("Package:"),console.log(" Version: 2.4.0"),console.log("");let n=await new N().load();console.log("Configuration:"),console.log(` FF_ID: ${n.ffId||"Not set"}`),console.log(` App Root: ${n.appRoot}
55
- `);let o=new U(n.appRoot),p=o.getCacheDir();if(console.log("Cache:"),console.log(` Directory: ${L.relative(process.cwd(),p)}`),o.exists()){console.log(` Status: ${o.isValid()?"\u2705 Valid":"\u26A0\uFE0F Expired"}`);let a=o.load();if(a&&a.metadata){let m=new Date(a.metadata.timestamp);console.log(` Created: ${m.toLocaleString()}`),console.log(` Format Version: ${a.metadata.version||"Unknown"}`)}}else console.log(" Status: \u274C Not found");process.exit(0)}catch(t){t instanceof R?console.error("\u274C Configuration Error:",t.message):t instanceof V?(console.error("\u274C Cache Error:",t.message),console.error(` Operation: ${t.operation}`)):console.error("\u274C Status check failed:",t.message),process.exit(1)}});b.command("download").description("Download components from registry").argument("<components...>",'component names to download (or "all" to download all components)').option("-f, --framework <framework>","Framework to download components for (react/vue)").option("-o, --output <path>","Output directory for components").option("--overwrite","Overwrite existing files").action(async(t,n)=>{try{console.log(`\u{1F4E6} Downloading components...
56
- `);let p=await new N().load();if(!p.ffId)throw new R(`ff-id not found in frontfriend.config.js
57
- Please add "ff-id" to your frontfriend.config.js file`,"ff-id");let a=new A({appRoot:p.appRoot,config:p,framework:n.framework,outputPath:n.output,overwrite:n.overwrite}),m=t;if(t.length===1&&t[0].toLowerCase()==="all"){let d=await a.getAllComponents(),h=await a.getCustomComponents();process.env.FF_DEBUG&&console.log(`Debug: Found ${h.length} custom components: ${h.join(", ")}`),d.length===0&&(console.error("\u274C Failed to fetch component list"),process.exit(1));let x=new Set(h),e=d.filter(i=>!x.has(i));m=[...h,...e],console.log("\u{1F4CB} Configuration"),console.log(` Framework: ${a.framework}`),console.log(` Output: ${a.outputPath}`),console.log(` Components: All ${m.length} components`),process.env.FF_DEBUG&&h.length>0&&console.log(` Debug: ${h.length} custom components will override standard ones`),console.log("")}else console.log("\u{1F4CB} Configuration"),console.log(` Framework: ${a.framework}`),console.log(` Output: ${a.outputPath}`),console.log(` Components: ${t.join(", ")}
58
- `);let c=await a.downloadComponents(m);c.successful.length>0&&(console.log(`
59
- \u2705 Download complete!`),console.log(` Downloaded: ${c.successful.length} components`)),c.failed.length>0&&(console.log(""),c.failed.forEach(d=>{d.error.includes("not found")?console.log(`\u274C ${d.error}`):console.log(`\u274C Failed to download ${d.component}: ${d.error}`)})),c.successful.length>0&&c.dependencies.length>0&&(console.log(`
60
- \u{1F4E6} Install dependencies:`),console.log(` npm install ${c.dependencies.join(" ")}`)),c.successful.length===0&&c.failed.length>0&&process.exit(1),process.exit(0)}catch(o){o instanceof R?(console.error("\u274C Configuration Error:",o.message),o.missingKey&&console.error(` Missing key: ${o.missingKey}`)):console.error("\u274C Download failed:",o.message),process.exit(1)}});b.command("add").description("Add generated pages from Frontfriend platform").argument("<type>","Type of resource to add (page or project)").argument("<id>","ID of the resource").option("--name <name>","Component name for the page").option("--path <path>","Output path (overrides aliases.pages)").option("--force","Overwrite existing files").option("--pages <ids>","Specific page IDs for project (comma-separated)").option("--all","Add all pages from project").action(async(t,n,o)=>{var p,a,m,c,d,h;try{console.log(`\u{1F680} Frontfriend Add
61
- `);let e=await new N().load();if(!e.ffId)throw new R(`ff-id not found in frontfriend.config.js
62
- Please add "ff-id" to your frontfriend.config.js file`,"ff-id");let i=require("fs"),$=require("path"),l=require("https"),y=require("http"),{URL:f}=require("url"),k=s=>new Promise((r,v)=>{let I=new f(s),C=I.protocol==="https:",T=C?l:y,j={hostname:I.hostname,port:I.port||(C?443:80),path:I.pathname+I.search,method:"GET",headers:{Accept:"application/json"}};T.get(j,w=>{let u="";w.on("data",g=>u+=g),w.on("end",()=>{if(w.statusCode===200)try{r(JSON.parse(u))}catch{v(new Error("Invalid JSON response"))}else try{let g=JSON.parse(u);v(new Error(g.error||`HTTP ${w.statusCode}`))}catch{v(new Error(`HTTP ${w.statusCode}: ${u}`))}})}).on("error",v)}),S=e["api-url"]||e.apiUrl||"https://app.frontfriend.dev";if(t==="page"){console.log("\u{1F4CB} Configuration"),console.log(` FF_ID: ${e.ffId}`),console.log(` Page ID: ${n}`);let s=o.path||((p=e.aliases)==null?void 0:p.pages)||"src/pages";console.log(` Output: ${s}
63
- `),console.log("\u{1F310} Fetching page...");let r=await k(`${S}/api/export/pages/${n}?ffId=${e.ffId}`);if(console.log(` \u2713 Page fetched: ${r.name}`),r.components&&r.components.length>0){console.log(`
64
- \u{1F4E6} Checking UI components...`);let w=new A({appRoot:e.appRoot,config:e,framework:e.framework||"react"}),u=((m=(a=e.aliases)==null?void 0:a.ui)==null?void 0:m.replace("@/",""))||"src/components/ui",g=[];for(let F of r.components){let P=$.join(e.appRoot,u,F);i.existsSync(P)||i.existsSync(P+".tsx")||i.existsSync(P+".jsx")||i.existsSync(P+".vue")||g.push(F)}if(g.length>0){console.log(` Missing components: ${g.join(", ")}`),console.log(" Downloading missing components...");let F=await w.downloadComponents(g);F.successful.length>0&&console.log(` \u2713 Downloaded ${F.successful.length} components`)}else console.log(" \u2713 All required components present")}console.log(`
65
- \u{1F4BE} Writing page file...`);let v=o.name?`${o.name}.tsx`:`${r.componentName}.tsx`,I=s.startsWith("@/")?s.replace("@/",""):s,C=$.join(e.appRoot,I,v);i.existsSync(C)&&!o.force&&(console.error(`
66
- \u274C File already exists: ${C}`),console.error(" Use --force to overwrite"),process.exit(1));let T=$.dirname(C);i.existsSync(T)||i.mkdirSync(T,{recursive:!0}),i.writeFileSync(C,r.code),console.log(` \u2713 Created: ${$.relative(e.appRoot,C)}`),console.log(`
67
- \u2705 Page added successfully!`),console.log(` Component: ${r.componentName}`),console.log(` Location: ${$.relative(e.appRoot,C)}`),console.log(`
68
- \u{1F4DA} Import in your app:`);let j;s.startsWith("@/")?j=`${s}/${r.componentName}`:s.startsWith("src/")?j=`@/${s.substring(4)}/${r.componentName}`:j=`@/${s}/${r.componentName}`,console.log(` import ${r.componentName} from '${j}';`)}else if(t==="project"){!o.all&&!o.pages&&(console.error("\u274C Please specify --all or --pages <ids>"),process.exit(1)),console.log("\u{1F4CB} Configuration"),console.log(` FF_ID: ${e.ffId}`),console.log(` Project ID: ${n}`);let s=o.path||((c=e.aliases)==null?void 0:c.pages)||"src/pages";console.log(` Output: ${s}
69
- `),console.log("\u{1F310} Fetching project pages...");let r=await k(`${S}/api/export/projects/${n}?ffId=${e.ffId}`);console.log(` \u2713 Project fetched: ${r.projectTitle}`),console.log(` \u2713 Found ${r.pages.length} pages`);let v=r.pages;if(o.pages){let w=o.pages.split(",").map(u=>u.trim());v=r.pages.filter(u=>w.includes(u.id)),console.log(` \u2713 Adding ${v.length} specific pages`)}if(r.components&&r.components.length>0){console.log(`
70
- \u{1F4E6} Checking UI components...`);let w=new A({appRoot:e.appRoot,config:e,framework:e.framework||"react"}),u=((h=(d=e.aliases)==null?void 0:d.ui)==null?void 0:h.replace("@/",""))||"src/components/ui",g=[];for(let F of r.components){let P=$.join(e.appRoot,u,F);i.existsSync(P)||i.existsSync(P+".tsx")||i.existsSync(P+".jsx")||i.existsSync(P+".vue")||g.push(F)}if(g.length>0){console.log(` Missing components: ${g.join(", ")}`),console.log(" Downloading missing components...");let F=await w.downloadComponents(g);F.successful.length>0&&console.log(` \u2713 Downloaded ${F.successful.length} components`)}else console.log(" \u2713 All required components present")}console.log(`
71
- \u{1F4BE} Writing page files...`);let I=s.startsWith("@/")?s.replace("@/",""):s,C=$.join(e.appRoot,I);i.existsSync(C)||i.mkdirSync(C,{recursive:!0});let T=0,j=0;for(let w of v){let u=`${w.componentName}.tsx`,g=$.join(C,u);if(i.existsSync(g)&&!o.force){console.log(` \u26A0\uFE0F Skipped (exists): ${u}`),j++;continue}i.writeFileSync(g,w.code),console.log(` \u2713 Created: ${u}`),T++}console.log(`
72
- \u2705 Project pages added!`),console.log(` Added: ${T} pages`),j>0&&(console.log(` Skipped: ${j} pages (already exist)`),console.log(" Use --force to overwrite existing files"))}else console.error(`\u274C Unknown type: ${t}`),console.error(' Use "page" or "project"'),process.exit(1);process.exit(0)}catch(x){x instanceof R?console.error("\u274C Configuration Error:",x.message):console.error("\u274C Failed:",x.message),process.exit(1)}});b.parse(process.argv);process.argv.slice(2).length||(b.outputHelp(),process.exit(0));
44
+ `),console.log("\u{1F310} Fetching configuration...");let g=new J(e.ffId,{baseURL:e["api-url"]||e.apiUrl});(e["api-url"]||e.apiUrl)&&console.log(` Using API URL: ${e["api-url"]||e.apiUrl}`);let l=null;try{l=await g.fetchProcessedTokens()}catch(s){console.log(` \u26A0\uFE0F Failed to fetch pre-processed tokens: ${s.message}`)}if(l){if(console.log(" \u2713 Pre-processed tokens fetched from server"),console.log(` \u2713 Skipping local processing
45
+ `),(!((i=l.tokens)!=null&&i.fontFamily)||Object.keys(l.tokens.fontFamily).length===0)&&(console.log("\u26A0\uFE0F Warning: No font family utilities found"),console.log(" Font classes like font-primary and font-secondary will not be available"),l.globalTokens?console.log(` Global tokens are present - font processor may need to be updated
46
+ `):console.log(` Consider adding font family tokens to your design system
47
+ `)),console.log("\u{1F4BE} Saving cache..."),(process.env.FF_VERBOSE==="true"||t.verbose)&&console.log(` Safelist has ${l.safelist?l.safelist.length:0} items`),f.save(l),console.log(` \u2713 Cache saved successfully
48
+ `),console.log("\u2705 Setup complete!"),console.log(" Your FrontFriend configuration has been cached."),console.log(" The Tailwind plugin will now use this cached data."),e.types){console.log(`
49
+ \u{1F524} Generating TypeScript types...`);try{let{generateIconTypes:s}=q(),w=e.aliases&&e.aliases.types?L.join(e.appRoot,e.aliases.types,"frontfriend.d.ts"):void 0;s({projectRoot:e.appRoot,outputPath:w})}catch(s){console.log(" \u26A0\uFE0F Type generation failed:",s.message),console.log(' Enable type generation in frontfriend.config.js with "types": true')}}process.exit(0)}console.log(` \u2139\uFE0F Pre-processed tokens not available, falling back to local processing
50
+ `);let[r,m,F,n,p,$]=await Promise.all([g.fetchTokens(),g.fetchComponentsConfig(),g.fetchFonts(),g.fetchIcons(),g.fetchVersion(),g.fetchCustomCss()]);if(console.log(" \u2713 Tokens fetched"),r.global||r.colors||r.semantic||r.semanticDark){let s=[r.global?"global":null,r.colors?"colors":null,r.semantic?"semantic":null,r.semanticDark?"semanticDark":null].filter(Boolean).join(", ");console.log(` (Found: ${s})`)}console.log(" \u2713 Components config fetched"),console.log(" \u2713 Fonts fetched"),console.log(" \u2713 Icons fetched"),console.log(" \u2713 Version fetched"),console.log(` \u2713 Custom CSS fetched
51
+ `),console.log("\u2699\uFE0F Processing tokens...");let I=new B;console.log(" Processing raw token data...");let a=await I.process({colors:r.colors||r.global,semantic:r.semantic,semanticDark:r.semanticDark,fonts:F,globalTokens:r.global,animations:r.animations,version:p==null?void 0:p.version,ffId:e.ffId,customCss:$});console.log(" \u2713 Colors processed"),console.log(" \u2713 Semantic tokens processed"),a.fontFaces.length>0&&console.log(` \u2713 ${a.fontFaces.length} font faces processed`),Object.keys(a.animations).length>0&&console.log(` \u2713 ${Object.keys(a.animations).length} animations processed`),console.log(`
52
+ `);let d=I.extractClassesFromComponentsConfig(m),S=[...a.safelist||[],...d||[]],D=[...new Set(S)].sort(),c={tokens:a.utilities,variables:a.variables,semanticVariables:a.semanticVariables,semanticDarkVariables:a.semanticDarkVariables,fonts:a.fontFaces,icons:n,componentsConfig:m,keyframes:a.keyframes,animations:a.animations,safelist:D,version:p,metadata:a.metadata,custom:a.custom};if(console.log("\u{1F4BE} Saving cache..."),(process.env.FF_VERBOSE==="true"||t.verbose)&&(console.log(" Cache data summary:"),console.log(` - Tokens: ${Object.keys(c.tokens||{}).length} utilities`),console.log(` - Variables: ${Object.keys(c.variables||{}).length} CSS variables`),console.log(` - Semantic variables: ${Object.keys(c.semanticVariables||{}).length} semantic variables`),console.log(` - Font faces: ${(c.fonts||[]).length} fonts`),console.log(` - Safelist: ${(c.safelist||[]).length} safelist classes`)),f.save(c),console.log(` \u2713 Cache saved successfully
53
+ `),console.log("\u2705 Setup complete!"),console.log(" Your FrontFriend configuration has been cached."),console.log(" The Tailwind plugin will now use this cached data."),e.types){console.log(`
54
+ \u{1F524} Generating TypeScript types...`);try{let{generateIconTypes:s}=q(),w=e.aliases&&e.aliases.types?L.join(e.appRoot,e.aliases.types,"frontfriend.d.ts"):void 0;s({projectRoot:e.appRoot,outputPath:w})}catch(s){console.log(" \u26A0\uFE0F Type generation failed:",s.message),console.log(' Enable type generation in frontfriend.config.js with "types": true')}}process.exit(0)}catch(o){o instanceof R?console.error("\u274C Configuration Error:",o.message):o instanceof H?(console.error("\u274C API Error:",o.message),console.error(` Status: ${o.statusCode}`),console.error(` URL: ${o.url}`)):o instanceof V?(console.error("\u274C Cache Error:",o.message),console.error(` Operation: ${o.operation}`)):console.error("\u274C Setup failed:",o.message),process.exit(1)}});b.command("clean").description("Remove cached configuration").action(async()=>{try{console.log(`\u{1F9F9} Cleaning FrontFriend cache...
55
+ `);let i=new O().load(),o=new U(i.appRoot);o.exists()?(o.clear(),console.log("\u2705 Cache cleared successfully")):console.log("\u2139\uFE0F No cache found"),process.exit(0)}catch(t){t instanceof V?(console.error("\u274C Cache Error:",t.message),console.error(` Operation: ${t.operation}`)):console.error("\u274C Clean failed:",t.message),process.exit(1)}});b.command("status").description("Show cache status and configuration").action(async()=>{try{console.log("\u{1F4CA} FrontFriend Status"),console.log(`===================
56
+ `),console.log("Package:"),console.log(" Version: 2.4.0"),console.log("");let i=await new O().load();console.log("Configuration:"),console.log(` FF_ID: ${i.ffId||"Not set"}`),console.log(` App Root: ${i.appRoot}
57
+ `);let o=new U(i.appRoot),e=o.getCacheDir();if(console.log("Cache:"),console.log(` Directory: ${L.relative(process.cwd(),e)}`),o.exists()){console.log(` Status: ${o.isValid()?"\u2705 Valid":"\u26A0\uFE0F Expired"}`);let f=o.load();if(f&&f.metadata){let g=new Date(f.metadata.timestamp);console.log(` Created: ${g.toLocaleString()}`),console.log(` Format Version: ${f.metadata.version||"Unknown"}`)}}else console.log(" Status: \u274C Not found");process.exit(0)}catch(t){t instanceof R?console.error("\u274C Configuration Error:",t.message):t instanceof V?(console.error("\u274C Cache Error:",t.message),console.error(` Operation: ${t.operation}`)):console.error("\u274C Status check failed:",t.message),process.exit(1)}});b.command("download").description("Download components from registry").argument("<components...>",'component names to download (or "all" to download all components)').option("-f, --framework <framework>","Framework to download components for (react/vue)").option("-o, --output <path>","Output directory for components").option("--overwrite","Overwrite existing files").action(async(t,i)=>{try{console.log(`\u{1F4E6} Downloading components...
58
+ `);let e=await new O().load();if(!e.ffId)throw new R(`ff-id not found in frontfriend.config.js
59
+ Please add "ff-id" to your frontfriend.config.js file`,"ff-id");let f=new A({appRoot:e.appRoot,config:e,framework:i.framework,outputPath:i.output,overwrite:i.overwrite}),g=t;if(t.length===1&&t[0].toLowerCase()==="all"){let r=await f.getAllComponents(),m=await f.getCustomComponents();process.env.FF_DEBUG&&console.log(`Debug: Found ${m.length} custom components: ${m.join(", ")}`),r.length===0&&(console.error("\u274C Failed to fetch component list"),process.exit(1));let F=new Set(m),n=r.filter(p=>!F.has(p));g=[...m,...n],console.log("\u{1F4CB} Configuration"),console.log(` Framework: ${f.framework}`),console.log(` Output: ${f.outputPath}`),console.log(` Components: All ${g.length} components`),process.env.FF_DEBUG&&m.length>0&&console.log(` Debug: ${m.length} custom components will override standard ones`),console.log("")}else console.log("\u{1F4CB} Configuration"),console.log(` Framework: ${f.framework}`),console.log(` Output: ${f.outputPath}`),console.log(` Components: ${t.join(", ")}
60
+ `);let l=await f.downloadComponents(g);l.successful.length>0&&(console.log(`
61
+ \u2705 Download complete!`),console.log(` Downloaded: ${l.successful.length} components`)),l.failed.length>0&&(console.log(""),l.failed.forEach(r=>{r.error.includes("not found")?console.log(`\u274C ${r.error}`):console.log(`\u274C Failed to download ${r.component}: ${r.error}`)})),l.successful.length>0&&l.dependencies.length>0&&(console.log(`
62
+ \u{1F4E6} Install dependencies:`),console.log(` npm install ${l.dependencies.join(" ")}`)),l.successful.length===0&&l.failed.length>0&&process.exit(1),process.exit(0)}catch(o){o instanceof R?(console.error("\u274C Configuration Error:",o.message),o.missingKey&&console.error(` Missing key: ${o.missingKey}`)):console.error("\u274C Download failed:",o.message),process.exit(1)}});b.command("add").description("Add generated pages from Frontfriend platform").argument("<type>","Type of resource to add (page or project)").argument("<id>","ID of the resource").option("--name <name>","Component name for the page").option("--path <path>","Output path (overrides aliases.pages)").option("--force","Overwrite existing files").option("--pages <ids>","Specific page IDs for project (comma-separated)").option("--all","Add all pages from project").action(async(t,i,o)=>{var e,f,g,l,r,m;try{console.log(`\u{1F680} Frontfriend Add
63
+ `);let n=await new O().load();if(!n.ffId)throw new R(`ff-id not found in frontfriend.config.js
64
+ Please add "ff-id" to your frontfriend.config.js file`,"ff-id");let p=require("fs"),$=require("path"),I=require("https"),a=require("http"),{URL:d}=require("url"),S=c=>new Promise((s,w)=>{let v=new d(c),C=v.protocol==="https:",T=C?I:a,k={hostname:v.hostname,port:v.port||(C?443:80),path:v.pathname+v.search,method:"GET",headers:{Accept:"application/json"}};T.get(k,y=>{let h="";y.on("data",u=>h+=u),y.on("end",()=>{if(y.statusCode===200)try{s(JSON.parse(h))}catch{w(new Error("Invalid JSON response"))}else try{let u=JSON.parse(h);w(new Error(u.error||`HTTP ${y.statusCode}`))}catch{w(new Error(`HTTP ${y.statusCode}: ${h}`))}})}).on("error",w)}),D=n["api-url"]||n.apiUrl||"https://app.frontfriend.dev";if(t==="page"){console.log("\u{1F4CB} Configuration"),console.log(` FF_ID: ${n.ffId}`),console.log(` Page ID: ${i}`);let c=o.path||((e=n.aliases)==null?void 0:e.pages)||"src/pages";console.log(` Output: ${c}
65
+ `),console.log("\u{1F310} Fetching page...");let s=await S(`${D}/api/export/pages/${i}?ffId=${n.ffId}`);if(console.log(` \u2713 Page fetched: ${s.name}`),s.components&&s.components.length>0){console.log(`
66
+ \u{1F4E6} Checking UI components...`);let y=new A({appRoot:n.appRoot,config:n,framework:n.framework||"react"}),h=((g=(f=n.aliases)==null?void 0:f.ui)==null?void 0:g.replace("@/",""))||"src/components/ui",u=[];for(let x of s.components){let j=$.join(n.appRoot,h,x);p.existsSync(j)||p.existsSync(j+".tsx")||p.existsSync(j+".jsx")||p.existsSync(j+".vue")||u.push(x)}if(u.length>0){console.log(` Missing components: ${u.join(", ")}`),console.log(" Downloading missing components...");let x=await y.downloadComponents(u);x.successful.length>0&&console.log(` \u2713 Downloaded ${x.successful.length} components`)}else console.log(" \u2713 All required components present")}console.log(`
67
+ \u{1F4BE} Writing page file...`);let w=o.name?`${o.name}.tsx`:`${s.componentName}.tsx`,v=c.startsWith("@/")?c.replace("@/",""):c,C=$.join(n.appRoot,v,w);p.existsSync(C)&&!o.force&&(console.error(`
68
+ \u274C File already exists: ${C}`),console.error(" Use --force to overwrite"),process.exit(1));let T=$.dirname(C);p.existsSync(T)||p.mkdirSync(T,{recursive:!0}),p.writeFileSync(C,s.code),console.log(` \u2713 Created: ${$.relative(n.appRoot,C)}`),console.log(`
69
+ \u2705 Page added successfully!`),console.log(` Component: ${s.componentName}`),console.log(` Location: ${$.relative(n.appRoot,C)}`),console.log(`
70
+ \u{1F4DA} Import in your app:`);let k;c.startsWith("@/")?k=`${c}/${s.componentName}`:c.startsWith("src/")?k=`@/${c.substring(4)}/${s.componentName}`:k=`@/${c}/${s.componentName}`,console.log(` import ${s.componentName} from '${k}';`)}else if(t==="project"){!o.all&&!o.pages&&(console.error("\u274C Please specify --all or --pages <ids>"),process.exit(1)),console.log("\u{1F4CB} Configuration"),console.log(` FF_ID: ${n.ffId}`),console.log(` Project ID: ${i}`);let c=o.path||((l=n.aliases)==null?void 0:l.pages)||"src/pages";console.log(` Output: ${c}
71
+ `),console.log("\u{1F310} Fetching project pages...");let s=await S(`${D}/api/export/projects/${i}?ffId=${n.ffId}`);console.log(` \u2713 Project fetched: ${s.projectTitle}`),console.log(` \u2713 Found ${s.pages.length} pages`);let w=s.pages;if(o.pages){let y=o.pages.split(",").map(h=>h.trim());w=s.pages.filter(h=>y.includes(h.id)),console.log(` \u2713 Adding ${w.length} specific pages`)}if(s.components&&s.components.length>0){console.log(`
72
+ \u{1F4E6} Checking UI components...`);let y=new A({appRoot:n.appRoot,config:n,framework:n.framework||"react"}),h=((m=(r=n.aliases)==null?void 0:r.ui)==null?void 0:m.replace("@/",""))||"src/components/ui",u=[];for(let x of s.components){let j=$.join(n.appRoot,h,x);p.existsSync(j)||p.existsSync(j+".tsx")||p.existsSync(j+".jsx")||p.existsSync(j+".vue")||u.push(x)}if(u.length>0){console.log(` Missing components: ${u.join(", ")}`),console.log(" Downloading missing components...");let x=await y.downloadComponents(u);x.successful.length>0&&console.log(` \u2713 Downloaded ${x.successful.length} components`)}else console.log(" \u2713 All required components present")}console.log(`
73
+ \u{1F4BE} Writing page files...`);let v=c.startsWith("@/")?c.replace("@/",""):c,C=$.join(n.appRoot,v);p.existsSync(C)||p.mkdirSync(C,{recursive:!0});let T=0,k=0;for(let y of w){let h=`${y.componentName}.tsx`,u=$.join(C,h);if(p.existsSync(u)&&!o.force){console.log(` \u26A0\uFE0F Skipped (exists): ${h}`),k++;continue}p.writeFileSync(u,y.code),console.log(` \u2713 Created: ${h}`),T++}console.log(`
74
+ \u2705 Project pages added!`),console.log(` Added: ${T} pages`),k>0&&(console.log(` Skipped: ${k} pages (already exist)`),console.log(" Use --force to overwrite existing files"))}else console.error(`\u274C Unknown type: ${t}`),console.error(' Use "page" or "project"'),process.exit(1);process.exit(0)}catch(F){F instanceof R?console.error("\u274C Configuration Error:",F.message):console.error("\u274C Failed:",F.message),process.exit(1)}});b.parse(process.argv);process.argv.slice(2).length||(b.outputHelp(),process.exit(0));
73
75
  //# sourceMappingURL=cli-temp.js.map
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- var y=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var D=y((de,F)=>{var m=require("fs");function L(e){try{let t=m.readFileSync(e,"utf8");return JSON.parse(t)}catch(t){if(t.code==="ENOENT")return null;throw t}}function q(e){try{return m.readFileSync(e,"utf8")}catch(t){if(t.code==="ENOENT")return null;throw t}}function P(e,t,i=2){let r=JSON.stringify(t,null,i);m.writeFileSync(e,r,"utf8")}function R(e,t){if(t==null||typeof t=="object"&&Object.keys(t).length===0||Array.isArray(t)&&t.length===0){let r=`module.exports = ${Array.isArray(t)?"[]":"{}"};`;m.writeFileSync(e,r,"utf8")}else{let i=`module.exports = ${JSON.stringify(t,null,2)};`;m.writeFileSync(e,i,"utf8")}}function K(e){return m.existsSync(e)}function Y(e){m.mkdirSync(e,{recursive:!0})}function M(e){m.rmSync(e,{recursive:!0,force:!0})}F.exports={readJsonFileSafe:L,readFileSafe:q,writeJsonFile:P,writeModuleExportsFile:R,fileExists:K,ensureDirectoryExists:Y,removeDirectory:M}});var N=y((pe,W)=>{W.exports={name:"dotenv",version:"16.6.1",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},homepage:"https://github.com/motdotla/dotenv#readme",funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var V=y((ve,v)=>{var _=require("fs"),b=require("path"),J=require("os"),G=require("crypto"),U=N(),E=U.version,B=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Q(e){let t={},i=e.toString();i=i.replace(/\r\n?/mg,`
2
- `);let r;for(;(r=B.exec(i))!=null;){let l=r[1],a=r[2]||"";a=a.trim();let o=a[0];a=a.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),o==='"'&&(a=a.replace(/\\n/g,`
3
- `),a=a.replace(/\\r/g,"\r")),t[l]=a}return t}function z(e){e=e||{};let t=j(e);e.path=t;let i=d.configDotenv(e);if(!i.parsed){let o=new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);throw o.code="MISSING_DATA",o}let r=k(e).split(","),l=r.length,a;for(let o=0;o<l;o++)try{let u=r[o].trim(),n=X(i,u);a=d.decrypt(n.ciphertext,n.key);break}catch(u){if(o+1>=l)throw u}return d.parse(a)}function H(e){console.log(`[dotenv@${E}][WARN] ${e}`)}function w(e){console.log(`[dotenv@${E}][DEBUG] ${e}`)}function $(e){console.log(`[dotenv@${E}] ${e}`)}function k(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function X(e,t){let i;try{i=new URL(t)}catch(u){if(u.code==="ERR_INVALID_URL"){let n=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw n.code="INVALID_DOTENV_KEY",n}throw u}let r=i.password;if(!r){let u=new Error("INVALID_DOTENV_KEY: Missing key part");throw u.code="INVALID_DOTENV_KEY",u}let l=i.searchParams.get("environment");if(!l){let u=new Error("INVALID_DOTENV_KEY: Missing environment part");throw u.code="INVALID_DOTENV_KEY",u}let a=`DOTENV_VAULT_${l.toUpperCase()}`,o=e.parsed[a];if(!o){let u=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${a} in your .env.vault file.`);throw u.code="NOT_FOUND_DOTENV_ENVIRONMENT",u}return{ciphertext:o,key:r}}function j(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let i of e.path)_.existsSync(i)&&(t=i.endsWith(".vault")?i:`${i}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=b.resolve(process.cwd(),".env.vault");return _.existsSync(t)?t:null}function O(e){return e[0]==="~"?b.join(J.homedir(),e.slice(1)):e}function Z(e){let t=!!(e&&e.debug),i=e&&"quiet"in e?e.quiet:!0;(t||!i)&&$("Loading env from encrypted .env.vault");let r=d._parseVault(e),l=process.env;return e&&e.processEnv!=null&&(l=e.processEnv),d.populate(l,r,e),{parsed:r}}function ee(e){let t=b.resolve(process.cwd(),".env"),i="utf8",r=!!(e&&e.debug),l=e&&"quiet"in e?e.quiet:!0;e&&e.encoding?i=e.encoding:r&&w("No encoding is specified. UTF-8 is used by default");let a=[t];if(e&&e.path)if(!Array.isArray(e.path))a=[O(e.path)];else{a=[];for(let s of e.path)a.push(O(s))}let o,u={};for(let s of a)try{let c=d.parse(_.readFileSync(s,{encoding:i}));d.populate(u,c,e)}catch(c){r&&w(`Failed to load ${s} ${c.message}`),o=c}let n=process.env;if(e&&e.processEnv!=null&&(n=e.processEnv),d.populate(n,u,e),r||!l){let s=Object.keys(u).length,c=[];for(let f of a)try{let p=b.relative(process.cwd(),f);c.push(p)}catch(p){r&&w(`Failed to load ${f} ${p.message}`),o=p}$(`injecting env (${s}) from ${c.join(",")}`)}return o?{parsed:u,error:o}:{parsed:u}}function te(e){if(k(e).length===0)return d.configDotenv(e);let t=j(e);return t?d._configVault(e):(H(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),d.configDotenv(e))}function ne(e,t){let i=Buffer.from(t.slice(-64),"hex"),r=Buffer.from(e,"base64"),l=r.subarray(0,12),a=r.subarray(-16);r=r.subarray(12,-16);try{let o=G.createDecipheriv("aes-256-gcm",i,l);return o.setAuthTag(a),`${o.update(r)}${o.final()}`}catch(o){let u=o instanceof RangeError,n=o.message==="Invalid key length",s=o.message==="Unsupported state or unable to authenticate data";if(u||n){let c=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw c.code="INVALID_DOTENV_KEY",c}else if(s){let c=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw c.code="DECRYPTION_FAILED",c}else throw o}}function re(e,t,i={}){let r=!!(i&&i.debug),l=!!(i&&i.override);if(typeof t!="object"){let a=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw a.code="OBJECT_REQUIRED",a}for(let a of Object.keys(t))Object.prototype.hasOwnProperty.call(e,a)?(l===!0&&(e[a]=t[a]),r&&w(l===!0?`"${a}" is already defined and WAS overwritten`:`"${a}" is already defined and was NOT overwritten`)):e[a]=t[a]}var d={configDotenv:ee,_configVault:Z,_parseVault:z,config:te,decrypt:ne,parse:Q,populate:re};v.exports.configDotenv=d.configDotenv;v.exports._configVault=d._configVault;v.exports._parseVault=d._parseVault;v.exports.config=d.config;v.exports.decrypt=d.decrypt;v.exports.parse=d.parse;v.exports.populate=d.populate;v.exports=d});var S=y((ge,T)=>{var oe=require("path"),{fileExists:ie}=D();function ae(e=process.cwd()){let t=oe.join(e,".env.local");return ie(t)?(V().config({path:t}),console.log("\u{1F4C4} Loaded .env.local"),!0):!1}function se(e,t=void 0){return process.env[e]||t}function ce(e){return process.env[e]==="true"}T.exports={loadEnvLocal:ae,getEnvVar:se,isEnvTrue:ce}});var I=y((me,C)=>{C.exports=function(t){if(!t)return{};if(typeof t!="object")throw new Error("Config must be an object");return t}});var le=require("tailwindcss/plugin"),x;try{x=require("postcss")}catch{x=null}var g;if(typeof window>"u"&&typeof process<"u"&&process.versions&&process.versions.node){g=require("./lib/core/cache-manager");let{loadEnvLocal:e}=S();e()}function A(e){return Object.fromEntries(Object.entries(e).filter(([t])=>t!=="DEFAULT"))}var ue=le.withOptions(function(e={}){return function({addBase:t,addUtilities:i,theme:r,matchUtilities:l}){if(!g)return;let a=new g(process.cwd());if(!a.exists()){console.warn('[FrontFriend] No cache found. Please run "npx frontfriend init" first.');return}a.isValid()||console.warn('[FrontFriend] Cache is expired. Please run "npx frontfriend init" to refresh.');let o=a.load();if(!o){console.error("[FrontFriend] Failed to load cache.");return}let u={};if(o.variables)for(let[n,s]of Object.entries(o.variables))n.startsWith("--color-")&&!s.startsWith("hsl(")?u[n]=`hsl(${s})`:u[n]=s;if(o.semanticVariables)for(let[n,s]of Object.entries(o.semanticVariables))u[n]=s;if(t({":root":u}),o.semanticDarkVariables&&Object.keys(o.semanticDarkVariables).length>0&&(t({":root:not(.light)":o.semanticDarkVariables}),t({":root:not(.dark)":o.semanticVariables})),o.semanticVariables){let n={};for(let[s]of Object.entries(o.semanticVariables)){let c=s.match(/^--(bg|text|border|layer|overlay|icon)-(.+)$/);if(c){let[,f,p]=c,h=`.${f}-${p}`;f==="bg"||f==="layer"||f==="overlay"?n[h]={backgroundColor:`var(${s})`}:f==="text"?n[h]={color:`var(${s})`}:f==="border"?n[h]={borderColor:`var(${s})`}:f==="icon"&&(n[`.text-${f}-${p}`]={color:`var(${s})`},n[`.fill-${f}-${p}`]={fill:`var(${s})`})}}i(n)}if(o.tokens){if(o.tokens.backgroundColor){let n={};for(let[s,c]of Object.entries(o.tokens.backgroundColor))n[`.bg-${s}`]={backgroundColor:c};i(n)}if(o.tokens.textColor){let n={};for(let[s,c]of Object.entries(o.tokens.textColor))n[`.text-${s}`]={color:c};i(n)}if(o.tokens.borderColor){let n={};for(let[s,c]of Object.entries(o.tokens.borderColor))n[`.border-${s}`]={borderColor:c};i(n)}if(o.tokens.fill){let n={},s={};for(let[c,f]of Object.entries(o.tokens.fill))n[`.fill-${c}`]={fill:f},c.startsWith("icon-")&&(s[`.text-${c}`]={color:f});i(n),i(s)}if(o.tokens.fontFamily){let n={};for(let[s,c]of Object.entries(o.tokens.fontFamily))n[`.font-${s}`]={fontFamily:c};i(n)}}if(o.fonts&&o.fonts.length>0&&o.fonts.forEach(n=>{t({"@font-face":n})}),i({"@keyframes enter":r("keyframes.enter"),"@keyframes exit":r("keyframes.exit"),".animate-in":{animationName:"enter",animationDuration:r("animationDuration.DEFAULT"),"--tw-enter-opacity":"initial","--tw-enter-scale":"initial","--tw-enter-rotate":"initial","--tw-enter-translate-x":"initial","--tw-enter-translate-y":"initial"},".animate-out":{animationName:"exit",animationDuration:r("animationDuration.DEFAULT"),"--tw-exit-opacity":"initial","--tw-exit-scale":"initial","--tw-exit-rotate":"initial","--tw-exit-translate-x":"initial","--tw-exit-translate-y":"initial"}}),l({"fade-in":n=>({"--tw-enter-opacity":n}),"fade-out":n=>({"--tw-exit-opacity":n})},{values:r("animationOpacity")}),l({"zoom-in":n=>({"--tw-enter-scale":n}),"zoom-out":n=>({"--tw-exit-scale":n})},{values:r("animationScale")}),l({"spin-in":n=>({"--tw-enter-rotate":n}),"spin-out":n=>({"--tw-exit-rotate":n})},{values:r("animationRotate")}),l({"slide-in-from-top":n=>({"--tw-enter-translate-y":`-${n}`}),"slide-in-from-bottom":n=>({"--tw-enter-translate-y":n}),"slide-in-from-left":n=>({"--tw-enter-translate-x":`-${n}`}),"slide-in-from-right":n=>({"--tw-enter-translate-x":n}),"slide-out-to-top":n=>({"--tw-exit-translate-y":`-${n}`}),"slide-out-to-bottom":n=>({"--tw-exit-translate-y":n}),"slide-out-to-left":n=>({"--tw-exit-translate-x":`-${n}`}),"slide-out-to-right":n=>({"--tw-exit-translate-x":n})},{values:r("animationTranslate")}),l({duration:n=>({animationDuration:n})},{values:A(r("animationDuration"))}),l({delay:n=>({animationDelay:n})},{values:r("animationDelay")}),l({ease:n=>({animationTimingFunction:n})},{values:A(r("animationTimingFunction"))}),i({".running":{animationPlayState:"running"},".paused":{animationPlayState:"paused"}}),l({"fill-mode":n=>({animationFillMode:n})},{values:r("animationFillMode")}),l({direction:n=>({animationDirection:n})},{values:r("animationDirection")}),l({repeat:n=>({animationIterationCount:n})},{values:r("animationRepeat")}),o.custom&&o.custom.raw&&typeof o.custom.raw=="string"){let n=o.custom.raw.trim();if(!n){e.verbose&&console.warn("[FrontFriend] Empty custom CSS");return}if(!x){console.warn("[FrontFriend] PostCSS not available - custom CSS will not be added");return}try{let s=x.parse(n),c=[],f=[];s.each(p=>{if(p.type==="atrule"){c.push(p);return}if(p.type==="rule"){typeof p.selector=="string"&&p.selector.trim().startsWith(".")?f.push(p):c.push(p);return}p.type!=="comment"&&c.push(p)}),c.length>0&&t(c),f.length>0&&i(f),e.verbose&&console.log(`[FrontFriend] Added custom CSS: ${c.length} base rules, ${f.length} utility classes`)}catch(s){console.error("[FrontFriend] Failed to parse custom CSS:",s.message)}}e.verbose&&(console.log("[FrontFriend] Plugin loaded successfully"),console.log(`[FrontFriend] Colors: ${Object.keys(o.variables||{}).length}`),console.log(`[FrontFriend] Semantic vars: ${Object.keys(o.semanticVariables||{}).length}`),console.log(`[FrontFriend] Fonts: ${(o.fonts||[]).length}`),console.log(`[FrontFriend] Safelist classes: ${Array.isArray(o.safelist)?o.safelist.length:0}`))}},function(e={}){let t=null;if(g){let r=new g(process.cwd());t=r.exists()?r.load():null}let i=["./pages/**/*.{js,ts,jsx,tsx}","./components/**/*.{js,ts,jsx,tsx}","./app/**/*.{js,ts,jsx,tsx}","./src/**/*.{js,ts,jsx,tsx}","./stories/**/*.{js,ts,jsx,tsx}"];return e.verbose&&t&&(console.log("[FrontFriend] Cache loaded successfully"),t.safelist&&Array.isArray(t.safelist)&&console.log(`[FrontFriend] Loading ${t.safelist.length} classes for safelist`)),{theme:{extend:{colors:e.extendColors||{},animation:e.extendAnimations||{},spacing:{18:"4.5rem",88:"22rem",128:"32rem"},boxShadow:{"top-sm":"0 -1px 1px 0 rgba(0, 0, 0, 0.05)"},borderRadius:{"2xl":"1rem"},animationDelay:({theme:r})=>({...r("transitionDelay")}),animationDuration:({theme:r})=>({0:"0ms",...r("transitionDuration")}),animationTimingFunction:({theme:r})=>({...r("transitionTimingFunction")}),animationFillMode:{none:"none",forwards:"forwards",backwards:"backwards",both:"both"},animationDirection:{normal:"normal",reverse:"reverse",alternate:"alternate","alternate-reverse":"alternate-reverse"},animationOpacity:({theme:r})=>({DEFAULT:0,...r("opacity")}),animationTranslate:({theme:r})=>({DEFAULT:"100%",...r("translate")}),animationScale:({theme:r})=>({DEFAULT:0,...r("scale")}),animationRotate:({theme:r})=>({DEFAULT:"30deg",...r("rotate")}),animationRepeat:{0:"0",1:"1",infinite:"infinite"},keyframes:{enter:{from:{opacity:"var(--tw-enter-opacity, 1)",transform:"translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0) scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))"}},exit:{to:{opacity:"var(--tw-exit-opacity, 1)",transform:"translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))"}}}}},safelist:[...(t==null?void 0:t.safelist)||[],{pattern:/(text|fill)-icon-(neutral|positive|negative|warning|info|highlight|interactive|brand|inverse|onpositive|onnegative|onwarning|oninfo|onhighlight|oninteractive|onbrand)-(mid|strong|subtle|low)(-(neutral|hover|active|selected|disabled))?$/},{pattern:/^(layer-(below|surface|raised|popover|dialog|control)|overlay-(mid|strong|subtle|low))$/}],content:e.content||i}});module.exports=ue;Object.defineProperty(module.exports,"config",{get:function(){if(typeof __FF_CONFIG__<"u")return __FF_CONFIG__;if(typeof window<"u"&&window.__FF_CONFIG__)return window.__FF_CONFIG__;if(g)try{let e=new g(process.cwd());if(e.exists()){let t=e.load();if(t)return t.componentsConfig||null}}catch{}return null}});Object.defineProperty(module.exports,"iconSet",{get:function(){if(typeof __FF_ICONS__<"u")return __FF_ICONS__;if(typeof window<"u"&&window.__FF_ICONS__)return window.__FF_ICONS__;if(g)try{let e=new g(process.cwd());if(e.exists()){let t=e.load();if(t)return t.icons||null}}catch{}return null}});module.exports.ffdc=I();
1
+ var y=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports);var D=y((de,F)=>{var m=require("fs");function L(e){try{let n=m.readFileSync(e,"utf8");return JSON.parse(n)}catch(n){if(n.code==="ENOENT")return null;throw n}}function q(e){try{return m.readFileSync(e,"utf8")}catch(n){if(n.code==="ENOENT")return null;throw n}}function P(e,n,i=2){let r=JSON.stringify(n,null,i);m.writeFileSync(e,r,"utf8")}function R(e,n){if(n==null||typeof n=="object"&&Object.keys(n).length===0||Array.isArray(n)&&n.length===0){let r=`module.exports = ${Array.isArray(n)?"[]":"{}"};`;m.writeFileSync(e,r,"utf8")}else{let i=`module.exports = ${JSON.stringify(n,null,2)};`;m.writeFileSync(e,i,"utf8")}}function K(e){return m.existsSync(e)}function Y(e){m.mkdirSync(e,{recursive:!0})}function M(e){m.rmSync(e,{recursive:!0,force:!0})}F.exports={readJsonFileSafe:L,readFileSafe:q,writeJsonFile:P,writeModuleExportsFile:R,fileExists:K,ensureDirectoryExists:Y,removeDirectory:M}});var N=y((pe,W)=>{W.exports={name:"dotenv",version:"16.6.1",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},homepage:"https://github.com/motdotla/dotenv#readme",funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var V=y((ve,v)=>{var _=require("fs"),b=require("path"),J=require("os"),G=require("crypto"),U=N(),E=U.version,B=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Q(e){let n={},i=e.toString();i=i.replace(/\r\n?/mg,`
2
+ `);let r;for(;(r=B.exec(i))!=null;){let f=r[1],l=r[2]||"";l=l.trim();let o=l[0];l=l.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),o==='"'&&(l=l.replace(/\\n/g,`
3
+ `),l=l.replace(/\\r/g,"\r")),n[f]=l}return n}function z(e){e=e||{};let n=j(e);e.path=n;let i=d.configDotenv(e);if(!i.parsed){let o=new Error(`MISSING_DATA: Cannot parse ${n} for an unknown reason`);throw o.code="MISSING_DATA",o}let r=k(e).split(","),f=r.length,l;for(let o=0;o<f;o++)try{let c=r[o].trim(),t=X(i,c);l=d.decrypt(t.ciphertext,t.key);break}catch(c){if(o+1>=f)throw c}return d.parse(l)}function H(e){console.log(`[dotenv@${E}][WARN] ${e}`)}function h(e){console.log(`[dotenv@${E}][DEBUG] ${e}`)}function $(e){console.log(`[dotenv@${E}] ${e}`)}function k(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function X(e,n){let i;try{i=new URL(n)}catch(c){if(c.code==="ERR_INVALID_URL"){let t=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw t.code="INVALID_DOTENV_KEY",t}throw c}let r=i.password;if(!r){let c=new Error("INVALID_DOTENV_KEY: Missing key part");throw c.code="INVALID_DOTENV_KEY",c}let f=i.searchParams.get("environment");if(!f){let c=new Error("INVALID_DOTENV_KEY: Missing environment part");throw c.code="INVALID_DOTENV_KEY",c}let l=`DOTENV_VAULT_${f.toUpperCase()}`,o=e.parsed[l];if(!o){let c=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${l} in your .env.vault file.`);throw c.code="NOT_FOUND_DOTENV_ENVIRONMENT",c}return{ciphertext:o,key:r}}function j(e){let n=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let i of e.path)_.existsSync(i)&&(n=i.endsWith(".vault")?i:`${i}.vault`);else n=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else n=b.resolve(process.cwd(),".env.vault");return _.existsSync(n)?n:null}function O(e){return e[0]==="~"?b.join(J.homedir(),e.slice(1)):e}function Z(e){let n=!!(e&&e.debug),i=e&&"quiet"in e?e.quiet:!0;(n||!i)&&$("Loading env from encrypted .env.vault");let r=d._parseVault(e),f=process.env;return e&&e.processEnv!=null&&(f=e.processEnv),d.populate(f,r,e),{parsed:r}}function ee(e){let n=b.resolve(process.cwd(),".env"),i="utf8",r=!!(e&&e.debug),f=e&&"quiet"in e?e.quiet:!0;e&&e.encoding?i=e.encoding:r&&h("No encoding is specified. UTF-8 is used by default");let l=[n];if(e&&e.path)if(!Array.isArray(e.path))l=[O(e.path)];else{l=[];for(let s of e.path)l.push(O(s))}let o,c={};for(let s of l)try{let a=d.parse(_.readFileSync(s,{encoding:i}));d.populate(c,a,e)}catch(a){r&&h(`Failed to load ${s} ${a.message}`),o=a}let t=process.env;if(e&&e.processEnv!=null&&(t=e.processEnv),d.populate(t,c,e),r||!f){let s=Object.keys(c).length,a=[];for(let u of l)try{let p=b.relative(process.cwd(),u);a.push(p)}catch(p){r&&h(`Failed to load ${u} ${p.message}`),o=p}$(`injecting env (${s}) from ${a.join(",")}`)}return o?{parsed:c,error:o}:{parsed:c}}function te(e){if(k(e).length===0)return d.configDotenv(e);let n=j(e);return n?d._configVault(e):(H(`You set DOTENV_KEY but you are missing a .env.vault file at ${n}. Did you forget to build it?`),d.configDotenv(e))}function ne(e,n){let i=Buffer.from(n.slice(-64),"hex"),r=Buffer.from(e,"base64"),f=r.subarray(0,12),l=r.subarray(-16);r=r.subarray(12,-16);try{let o=G.createDecipheriv("aes-256-gcm",i,f);return o.setAuthTag(l),`${o.update(r)}${o.final()}`}catch(o){let c=o instanceof RangeError,t=o.message==="Invalid key length",s=o.message==="Unsupported state or unable to authenticate data";if(c||t){let a=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw a.code="INVALID_DOTENV_KEY",a}else if(s){let a=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw a.code="DECRYPTION_FAILED",a}else throw o}}function re(e,n,i={}){let r=!!(i&&i.debug),f=!!(i&&i.override);if(typeof n!="object"){let l=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw l.code="OBJECT_REQUIRED",l}for(let l of Object.keys(n))Object.prototype.hasOwnProperty.call(e,l)?(f===!0&&(e[l]=n[l]),r&&h(f===!0?`"${l}" is already defined and WAS overwritten`:`"${l}" is already defined and was NOT overwritten`)):e[l]=n[l]}var d={configDotenv:ee,_configVault:Z,_parseVault:z,config:te,decrypt:ne,parse:Q,populate:re};v.exports.configDotenv=d.configDotenv;v.exports._configVault=d._configVault;v.exports._parseVault=d._parseVault;v.exports.config=d.config;v.exports.decrypt=d.decrypt;v.exports.parse=d.parse;v.exports.populate=d.populate;v.exports=d});var S=y((ge,T)=>{var oe=require("path"),{fileExists:ie}=D();function se(e=process.cwd()){let n=oe.join(e,".env.local");return ie(n)?(V().config({path:n}),console.log("\u{1F4C4} Loaded .env.local"),!0):!1}function ae(e,n=void 0){return process.env[e]||n}function le(e){return process.env[e]==="true"}T.exports={loadEnvLocal:se,getEnvVar:ae,isEnvTrue:le}});var I=y((me,C)=>{C.exports=function(n){if(!n)return{};if(typeof n!="object")throw new Error("Config must be an object");return n}});var ce=require("tailwindcss/plugin"),x;try{x=require("postcss")}catch{x=null}var g;if(typeof window>"u"&&typeof process<"u"&&process.versions&&process.versions.node){g=require("./lib/core/cache-manager");let{loadEnvLocal:e}=S();e()}function A(e){return Object.fromEntries(Object.entries(e).filter(([n])=>n!=="DEFAULT"))}var fe=ce.withOptions(function(e={}){return function({addBase:n,addUtilities:i,theme:r,matchUtilities:f}){if(!g)return;let l=new g(process.cwd());if(!l.exists()){console.warn('[FrontFriend] No cache found. Please run "npx frontfriend init" first.');return}l.isValid()||console.warn('[FrontFriend] Cache is expired. Please run "npx frontfriend init" to refresh.');let o=l.load();if(!o){console.error("[FrontFriend] Failed to load cache.");return}let c={};if(o.variables)for(let[t,s]of Object.entries(o.variables))t.startsWith("--color-")&&!s.startsWith("hsl(")?c[t]=`hsl(${s})`:c[t]=s;if(o.semanticVariables)for(let[t,s]of Object.entries(o.semanticVariables))typeof s=="string"&&!s.startsWith("var(")&&!s.startsWith("hsl(")&&/^\d+\s+\d+%\s+\d+%/.test(s)?c[t]=`hsl(${s})`:c[t]=s;if(n({":root":c}),o.semanticDarkVariables&&Object.keys(o.semanticDarkVariables).length>0){let t={};for(let[s,a]of Object.entries(o.semanticDarkVariables))typeof a=="string"&&!a.startsWith("var(")&&!a.startsWith("hsl(")&&/^\d+\s+\d+%\s+\d+%/.test(a)?t[s]=`hsl(${a})`:t[s]=a;n({":root:not(.light)":t}),n({":root:not(.dark)":c})}if(o.semanticVariables){let t={};for(let[s]of Object.entries(o.semanticVariables)){let a=s.match(/^--(bg|text|border|layer|overlay|icon)-(.+)$/);if(a){let[,u,p]=a,w=`.${u}-${p}`;u==="bg"||u==="layer"||u==="overlay"?t[w]={backgroundColor:`var(${s})`}:u==="text"?t[w]={color:`var(${s})`}:u==="border"?t[w]={borderColor:`var(${s})`}:u==="icon"&&(t[`.text-${u}-${p}`]={color:`var(${s})`},t[`.fill-${u}-${p}`]={fill:`var(${s})`})}}i(t)}if(o.tokens){if(o.tokens.backgroundColor){let t={};for(let[s,a]of Object.entries(o.tokens.backgroundColor))t[`.bg-${s}`]={backgroundColor:a};i(t)}if(o.tokens.textColor){let t={};for(let[s,a]of Object.entries(o.tokens.textColor))t[`.text-${s}`]={color:a};i(t)}if(o.tokens.borderColor){let t={};for(let[s,a]of Object.entries(o.tokens.borderColor))t[`.border-${s}`]={borderColor:a};i(t)}if(o.tokens.fill){let t={},s={};for(let[a,u]of Object.entries(o.tokens.fill))t[`.fill-${a}`]={fill:u},a.startsWith("icon-")&&(s[`.text-${a}`]={color:u});i(t),i(s)}if(o.tokens.fontFamily){let t={};for(let[s,a]of Object.entries(o.tokens.fontFamily))t[`.font-${s}`]={fontFamily:a};i(t)}}if(o.fonts&&o.fonts.length>0&&o.fonts.forEach(t=>{n({"@font-face":t})}),i({"@keyframes enter":r("keyframes.enter"),"@keyframes exit":r("keyframes.exit"),".animate-in":{animationName:"enter",animationDuration:r("animationDuration.DEFAULT"),"--tw-enter-opacity":"initial","--tw-enter-scale":"initial","--tw-enter-rotate":"initial","--tw-enter-translate-x":"initial","--tw-enter-translate-y":"initial"},".animate-out":{animationName:"exit",animationDuration:r("animationDuration.DEFAULT"),"--tw-exit-opacity":"initial","--tw-exit-scale":"initial","--tw-exit-rotate":"initial","--tw-exit-translate-x":"initial","--tw-exit-translate-y":"initial"}}),f({"fade-in":t=>({"--tw-enter-opacity":t}),"fade-out":t=>({"--tw-exit-opacity":t})},{values:r("animationOpacity")}),f({"zoom-in":t=>({"--tw-enter-scale":t}),"zoom-out":t=>({"--tw-exit-scale":t})},{values:r("animationScale")}),f({"spin-in":t=>({"--tw-enter-rotate":t}),"spin-out":t=>({"--tw-exit-rotate":t})},{values:r("animationRotate")}),f({"slide-in-from-top":t=>({"--tw-enter-translate-y":`-${t}`}),"slide-in-from-bottom":t=>({"--tw-enter-translate-y":t}),"slide-in-from-left":t=>({"--tw-enter-translate-x":`-${t}`}),"slide-in-from-right":t=>({"--tw-enter-translate-x":t}),"slide-out-to-top":t=>({"--tw-exit-translate-y":`-${t}`}),"slide-out-to-bottom":t=>({"--tw-exit-translate-y":t}),"slide-out-to-left":t=>({"--tw-exit-translate-x":`-${t}`}),"slide-out-to-right":t=>({"--tw-exit-translate-x":t})},{values:r("animationTranslate")}),f({duration:t=>({animationDuration:t})},{values:A(r("animationDuration"))}),f({delay:t=>({animationDelay:t})},{values:r("animationDelay")}),f({ease:t=>({animationTimingFunction:t})},{values:A(r("animationTimingFunction"))}),i({".running":{animationPlayState:"running"},".paused":{animationPlayState:"paused"}}),f({"fill-mode":t=>({animationFillMode:t})},{values:r("animationFillMode")}),f({direction:t=>({animationDirection:t})},{values:r("animationDirection")}),f({repeat:t=>({animationIterationCount:t})},{values:r("animationRepeat")}),o.custom&&o.custom.raw&&typeof o.custom.raw=="string"){let t=o.custom.raw.trim();if(!t){e.verbose&&console.warn("[FrontFriend] Empty custom CSS");return}if(!x){console.warn("[FrontFriend] PostCSS not available - custom CSS will not be added");return}try{let s=x.parse(t),a=[],u=[];s.each(p=>{if(p.type==="atrule"){a.push(p);return}if(p.type==="rule"){typeof p.selector=="string"&&p.selector.trim().startsWith(".")?u.push(p):a.push(p);return}p.type!=="comment"&&a.push(p)}),a.length>0&&n(a),u.length>0&&i(u),e.verbose&&console.log(`[FrontFriend] Added custom CSS: ${a.length} base rules, ${u.length} utility classes`)}catch(s){console.error("[FrontFriend] Failed to parse custom CSS:",s.message)}}e.verbose&&(console.log("[FrontFriend] Plugin loaded successfully"),console.log(`[FrontFriend] Colors: ${Object.keys(o.variables||{}).length}`),console.log(`[FrontFriend] Semantic vars: ${Object.keys(o.semanticVariables||{}).length}`),console.log(`[FrontFriend] Fonts: ${(o.fonts||[]).length}`),console.log(`[FrontFriend] Safelist classes: ${Array.isArray(o.safelist)?o.safelist.length:0}`))}},function(e={}){let n=null;if(g){let r=new g(process.cwd());n=r.exists()?r.load():null}let i=["./pages/**/*.{js,ts,jsx,tsx}","./components/**/*.{js,ts,jsx,tsx}","./app/**/*.{js,ts,jsx,tsx}","./src/**/*.{js,ts,jsx,tsx}","./stories/**/*.{js,ts,jsx,tsx}"];return e.verbose&&n&&(console.log("[FrontFriend] Cache loaded successfully"),n.safelist&&Array.isArray(n.safelist)&&console.log(`[FrontFriend] Loading ${n.safelist.length} classes for safelist`)),{theme:{extend:{colors:e.extendColors||{},animation:e.extendAnimations||{},spacing:{18:"4.5rem",88:"22rem",128:"32rem"},boxShadow:{"top-sm":"0 -1px 1px 0 rgba(0, 0, 0, 0.05)"},borderRadius:{"2xl":"1rem"},animationDelay:({theme:r})=>({...r("transitionDelay")}),animationDuration:({theme:r})=>({0:"0ms",...r("transitionDuration")}),animationTimingFunction:({theme:r})=>({...r("transitionTimingFunction")}),animationFillMode:{none:"none",forwards:"forwards",backwards:"backwards",both:"both"},animationDirection:{normal:"normal",reverse:"reverse",alternate:"alternate","alternate-reverse":"alternate-reverse"},animationOpacity:({theme:r})=>({DEFAULT:0,...r("opacity")}),animationTranslate:({theme:r})=>({DEFAULT:"100%",...r("translate")}),animationScale:({theme:r})=>({DEFAULT:0,...r("scale")}),animationRotate:({theme:r})=>({DEFAULT:"30deg",...r("rotate")}),animationRepeat:{0:"0",1:"1",infinite:"infinite"},keyframes:{enter:{from:{opacity:"var(--tw-enter-opacity, 1)",transform:"translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0) scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))"}},exit:{to:{opacity:"var(--tw-exit-opacity, 1)",transform:"translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))"}}}}},safelist:[...(n==null?void 0:n.safelist)||[],{pattern:/(text|fill)-icon-(neutral|positive|negative|warning|info|highlight|interactive|brand|inverse|onpositive|onnegative|onwarning|oninfo|onhighlight|oninteractive|onbrand)-(mid|strong|subtle|low)(-(neutral|hover|active|selected|disabled))?$/},{pattern:/^(layer-(below|surface|raised|popover|dialog|control)|overlay-(mid|strong|subtle|low))$/}],content:e.content||i}});module.exports=fe;Object.defineProperty(module.exports,"config",{get:function(){if(typeof __FF_CONFIG__<"u")return __FF_CONFIG__;if(typeof window<"u"&&window.__FF_CONFIG__)return window.__FF_CONFIG__;if(g)try{let e=new g(process.cwd());if(e.exists()){let n=e.load();if(n)return n.componentsConfig||null}}catch{}return null}});Object.defineProperty(module.exports,"iconSet",{get:function(){if(typeof __FF_ICONS__<"u")return __FF_ICONS__;if(typeof window<"u"&&window.__FF_ICONS__)return window.__FF_ICONS__;if(g)try{let e=new g(process.cwd());if(e.exists()){let n=e.load();if(n)return n.icons||null}}catch{}return null}});module.exports.ffdc=I();
4
4
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../lib/core/file-utils.js", "../../../node_modules/.pnpm/dotenv@16.6.1/node_modules/dotenv/package.json", "../../../node_modules/.pnpm/dotenv@16.6.1/node_modules/dotenv/lib/main.js", "../lib/core/env-utils.js", "../ffdc.js", "../index.js"],
4
- "sourcesContent": ["const fs = require('fs');\n\n/**\n * Read a JSON file safely, returning null if file doesn't exist\n * @param {string} filepath - Path to the JSON file\n * @returns {Object|null} Parsed JSON or null if file not found\n * @throws {Error} If JSON is invalid\n */\nfunction readJsonFileSafe(filepath) {\n try {\n const content = fs.readFileSync(filepath, 'utf8');\n return JSON.parse(content);\n } catch (error) {\n if (error.code === 'ENOENT') {\n return null; // File not found, return null like API would return 404\n }\n throw error;\n }\n}\n\n/**\n * Read a file safely, returning null if file doesn't exist\n * @param {string} filepath - Path to the file\n * @returns {string|null} File content or null if file not found\n * @throws {Error} For other file system errors\n */\nfunction readFileSafe(filepath) {\n try {\n return fs.readFileSync(filepath, 'utf8');\n } catch (error) {\n if (error.code === 'ENOENT') {\n return null; // File not found\n }\n throw error;\n }\n}\n\n/**\n * Write JSON data to a file with proper formatting\n * @param {string} filepath - Path to write the file\n * @param {Object} data - Data to write\n * @param {number} indent - Indentation level (default: 2)\n */\nfunction writeJsonFile(filepath, data, indent = 2) {\n const content = JSON.stringify(data, null, indent);\n fs.writeFileSync(filepath, content, 'utf8');\n}\n\n/**\n * Write module.exports file with JSON data\n * @param {string} filepath - Path to write the file\n * @param {Object} data - Data to export\n */\nfunction writeModuleExportsFile(filepath, data) {\n // Handle empty data cases\n if (data === null || data === undefined || \n (typeof data === 'object' && Object.keys(data).length === 0) ||\n (Array.isArray(data) && data.length === 0)) {\n const emptyContent = Array.isArray(data) ? '[]' : '{}';\n const content = `module.exports = ${emptyContent};`;\n fs.writeFileSync(filepath, content, 'utf8');\n } else {\n const content = `module.exports = ${JSON.stringify(data, null, 2)};`;\n fs.writeFileSync(filepath, content, 'utf8');\n }\n}\n\n/**\n * Check if a file exists\n * @param {string} filepath - Path to check\n * @returns {boolean} True if file exists\n */\nfunction fileExists(filepath) {\n return fs.existsSync(filepath);\n}\n\n/**\n * Create directory recursively\n * @param {string} dirpath - Directory path to create\n */\nfunction ensureDirectoryExists(dirpath) {\n fs.mkdirSync(dirpath, { recursive: true });\n}\n\n/**\n * Remove directory recursively\n * @param {string} dirpath - Directory path to remove\n */\nfunction removeDirectory(dirpath) {\n fs.rmSync(dirpath, { recursive: true, force: true });\n}\n\nmodule.exports = {\n readJsonFileSafe,\n readFileSafe,\n writeJsonFile,\n writeModuleExportsFile,\n fileExists,\n ensureDirectoryExists,\n removeDirectory\n};", "{\n \"name\": \"dotenv\",\n \"version\": \"16.6.1\",\n \"description\": \"Loads environment variables from .env file\",\n \"main\": \"lib/main.js\",\n \"types\": \"lib/main.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./lib/main.d.ts\",\n \"require\": \"./lib/main.js\",\n \"default\": \"./lib/main.js\"\n },\n \"./config\": \"./config.js\",\n \"./config.js\": \"./config.js\",\n \"./lib/env-options\": \"./lib/env-options.js\",\n \"./lib/env-options.js\": \"./lib/env-options.js\",\n \"./lib/cli-options\": \"./lib/cli-options.js\",\n \"./lib/cli-options.js\": \"./lib/cli-options.js\",\n \"./package.json\": \"./package.json\"\n },\n \"scripts\": {\n \"dts-check\": \"tsc --project tests/types/tsconfig.json\",\n \"lint\": \"standard\",\n \"pretest\": \"npm run lint && npm run dts-check\",\n \"test\": \"tap run --allow-empty-coverage --disable-coverage --timeout=60000\",\n \"test:coverage\": \"tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov\",\n \"prerelease\": \"npm test\",\n \"release\": \"standard-version\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git://github.com/motdotla/dotenv.git\"\n },\n \"homepage\": \"https://github.com/motdotla/dotenv#readme\",\n \"funding\": \"https://dotenvx.com\",\n \"keywords\": [\n \"dotenv\",\n \"env\",\n \".env\",\n \"environment\",\n \"variables\",\n \"config\",\n \"settings\"\n ],\n \"readmeFilename\": \"README.md\",\n \"license\": \"BSD-2-Clause\",\n \"devDependencies\": {\n \"@types/node\": \"^18.11.3\",\n \"decache\": \"^4.6.2\",\n \"sinon\": \"^14.0.1\",\n \"standard\": \"^17.0.0\",\n \"standard-version\": \"^9.5.0\",\n \"tap\": \"^19.2.0\",\n \"typescript\": \"^4.8.4\"\n },\n \"engines\": {\n \"node\": \">=12\"\n },\n \"browser\": {\n \"fs\": false\n }\n}\n", "const fs = require('fs')\nconst path = require('path')\nconst os = require('os')\nconst crypto = require('crypto')\nconst packageJson = require('../package.json')\n\nconst version = packageJson.version\n\nconst LINE = /(?:^|^)\\s*(?:export\\s+)?([\\w.-]+)(?:\\s*=\\s*?|:\\s+?)(\\s*'(?:\\\\'|[^'])*'|\\s*\"(?:\\\\\"|[^\"])*\"|\\s*`(?:\\\\`|[^`])*`|[^#\\r\\n]+)?\\s*(?:#.*)?(?:$|$)/mg\n\n// Parse src into an Object\nfunction parse (src) {\n const obj = {}\n\n // Convert buffer to string\n let lines = src.toString()\n\n // Convert line breaks to same format\n lines = lines.replace(/\\r\\n?/mg, '\\n')\n\n let match\n while ((match = LINE.exec(lines)) != null) {\n const key = match[1]\n\n // Default undefined or null to empty string\n let value = (match[2] || '')\n\n // Remove whitespace\n value = value.trim()\n\n // Check if double quoted\n const maybeQuote = value[0]\n\n // Remove surrounding quotes\n value = value.replace(/^(['\"`])([\\s\\S]*)\\1$/mg, '$2')\n\n // Expand newlines if double quoted\n if (maybeQuote === '\"') {\n value = value.replace(/\\\\n/g, '\\n')\n value = value.replace(/\\\\r/g, '\\r')\n }\n\n // Add to object\n obj[key] = value\n }\n\n return obj\n}\n\nfunction _parseVault (options) {\n options = options || {}\n\n const vaultPath = _vaultPath(options)\n options.path = vaultPath // parse .env.vault\n const result = DotenvModule.configDotenv(options)\n if (!result.parsed) {\n const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`)\n err.code = 'MISSING_DATA'\n throw err\n }\n\n // handle scenario for comma separated keys - for use with key rotation\n // example: DOTENV_KEY=\"dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=prod,dotenv://:key_7890@dotenvx.com/vault/.env.vault?environment=prod\"\n const keys = _dotenvKey(options).split(',')\n const length = keys.length\n\n let decrypted\n for (let i = 0; i < length; i++) {\n try {\n // Get full key\n const key = keys[i].trim()\n\n // Get instructions for decrypt\n const attrs = _instructions(result, key)\n\n // Decrypt\n decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key)\n\n break\n } catch (error) {\n // last key\n if (i + 1 >= length) {\n throw error\n }\n // try next key\n }\n }\n\n // Parse decrypted .env string\n return DotenvModule.parse(decrypted)\n}\n\nfunction _warn (message) {\n console.log(`[dotenv@${version}][WARN] ${message}`)\n}\n\nfunction _debug (message) {\n console.log(`[dotenv@${version}][DEBUG] ${message}`)\n}\n\nfunction _log (message) {\n console.log(`[dotenv@${version}] ${message}`)\n}\n\nfunction _dotenvKey (options) {\n // prioritize developer directly setting options.DOTENV_KEY\n if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {\n return options.DOTENV_KEY\n }\n\n // secondary infra already contains a DOTENV_KEY environment variable\n if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {\n return process.env.DOTENV_KEY\n }\n\n // fallback to empty string\n return ''\n}\n\nfunction _instructions (result, dotenvKey) {\n // Parse DOTENV_KEY. Format is a URI\n let uri\n try {\n uri = new URL(dotenvKey)\n } catch (error) {\n if (error.code === 'ERR_INVALID_URL') {\n const err = new Error('INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development')\n err.code = 'INVALID_DOTENV_KEY'\n throw err\n }\n\n throw error\n }\n\n // Get decrypt key\n const key = uri.password\n if (!key) {\n const err = new Error('INVALID_DOTENV_KEY: Missing key part')\n err.code = 'INVALID_DOTENV_KEY'\n throw err\n }\n\n // Get environment\n const environment = uri.searchParams.get('environment')\n if (!environment) {\n const err = new Error('INVALID_DOTENV_KEY: Missing environment part')\n err.code = 'INVALID_DOTENV_KEY'\n throw err\n }\n\n // Get ciphertext payload\n const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`\n const ciphertext = result.parsed[environmentKey] // DOTENV_VAULT_PRODUCTION\n if (!ciphertext) {\n const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`)\n err.code = 'NOT_FOUND_DOTENV_ENVIRONMENT'\n throw err\n }\n\n return { ciphertext, key }\n}\n\nfunction _vaultPath (options) {\n let possibleVaultPath = null\n\n if (options && options.path && options.path.length > 0) {\n if (Array.isArray(options.path)) {\n for (const filepath of options.path) {\n if (fs.existsSync(filepath)) {\n possibleVaultPath = filepath.endsWith('.vault') ? filepath : `${filepath}.vault`\n }\n }\n } else {\n possibleVaultPath = options.path.endsWith('.vault') ? options.path : `${options.path}.vault`\n }\n } else {\n possibleVaultPath = path.resolve(process.cwd(), '.env.vault')\n }\n\n if (fs.existsSync(possibleVaultPath)) {\n return possibleVaultPath\n }\n\n return null\n}\n\nfunction _resolveHome (envPath) {\n return envPath[0] === '~' ? path.join(os.homedir(), envPath.slice(1)) : envPath\n}\n\nfunction _configVault (options) {\n const debug = Boolean(options && options.debug)\n const quiet = options && 'quiet' in options ? options.quiet : true\n\n if (debug || !quiet) {\n _log('Loading env from encrypted .env.vault')\n }\n\n const parsed = DotenvModule._parseVault(options)\n\n let processEnv = process.env\n if (options && options.processEnv != null) {\n processEnv = options.processEnv\n }\n\n DotenvModule.populate(processEnv, parsed, options)\n\n return { parsed }\n}\n\nfunction configDotenv (options) {\n const dotenvPath = path.resolve(process.cwd(), '.env')\n let encoding = 'utf8'\n const debug = Boolean(options && options.debug)\n const quiet = options && 'quiet' in options ? options.quiet : true\n\n if (options && options.encoding) {\n encoding = options.encoding\n } else {\n if (debug) {\n _debug('No encoding is specified. UTF-8 is used by default')\n }\n }\n\n let optionPaths = [dotenvPath] // default, look for .env\n if (options && options.path) {\n if (!Array.isArray(options.path)) {\n optionPaths = [_resolveHome(options.path)]\n } else {\n optionPaths = [] // reset default\n for (const filepath of options.path) {\n optionPaths.push(_resolveHome(filepath))\n }\n }\n }\n\n // Build the parsed data in a temporary object (because we need to return it). Once we have the final\n // parsed data, we will combine it with process.env (or options.processEnv if provided).\n let lastError\n const parsedAll = {}\n for (const path of optionPaths) {\n try {\n // Specifying an encoding returns a string instead of a buffer\n const parsed = DotenvModule.parse(fs.readFileSync(path, { encoding }))\n\n DotenvModule.populate(parsedAll, parsed, options)\n } catch (e) {\n if (debug) {\n _debug(`Failed to load ${path} ${e.message}`)\n }\n lastError = e\n }\n }\n\n let processEnv = process.env\n if (options && options.processEnv != null) {\n processEnv = options.processEnv\n }\n\n DotenvModule.populate(processEnv, parsedAll, options)\n\n if (debug || !quiet) {\n const keysCount = Object.keys(parsedAll).length\n const shortPaths = []\n for (const filePath of optionPaths) {\n try {\n const relative = path.relative(process.cwd(), filePath)\n shortPaths.push(relative)\n } catch (e) {\n if (debug) {\n _debug(`Failed to load ${filePath} ${e.message}`)\n }\n lastError = e\n }\n }\n\n _log(`injecting env (${keysCount}) from ${shortPaths.join(',')}`)\n }\n\n if (lastError) {\n return { parsed: parsedAll, error: lastError }\n } else {\n return { parsed: parsedAll }\n }\n}\n\n// Populates process.env from .env file\nfunction config (options) {\n // fallback to original dotenv if DOTENV_KEY is not set\n if (_dotenvKey(options).length === 0) {\n return DotenvModule.configDotenv(options)\n }\n\n const vaultPath = _vaultPath(options)\n\n // dotenvKey exists but .env.vault file does not exist\n if (!vaultPath) {\n _warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`)\n\n return DotenvModule.configDotenv(options)\n }\n\n return DotenvModule._configVault(options)\n}\n\nfunction decrypt (encrypted, keyStr) {\n const key = Buffer.from(keyStr.slice(-64), 'hex')\n let ciphertext = Buffer.from(encrypted, 'base64')\n\n const nonce = ciphertext.subarray(0, 12)\n const authTag = ciphertext.subarray(-16)\n ciphertext = ciphertext.subarray(12, -16)\n\n try {\n const aesgcm = crypto.createDecipheriv('aes-256-gcm', key, nonce)\n aesgcm.setAuthTag(authTag)\n return `${aesgcm.update(ciphertext)}${aesgcm.final()}`\n } catch (error) {\n const isRange = error instanceof RangeError\n const invalidKeyLength = error.message === 'Invalid key length'\n const decryptionFailed = error.message === 'Unsupported state or unable to authenticate data'\n\n if (isRange || invalidKeyLength) {\n const err = new Error('INVALID_DOTENV_KEY: It must be 64 characters long (or more)')\n err.code = 'INVALID_DOTENV_KEY'\n throw err\n } else if (decryptionFailed) {\n const err = new Error('DECRYPTION_FAILED: Please check your DOTENV_KEY')\n err.code = 'DECRYPTION_FAILED'\n throw err\n } else {\n throw error\n }\n }\n}\n\n// Populate process.env with parsed values\nfunction populate (processEnv, parsed, options = {}) {\n const debug = Boolean(options && options.debug)\n const override = Boolean(options && options.override)\n\n if (typeof parsed !== 'object') {\n const err = new Error('OBJECT_REQUIRED: Please check the processEnv argument being passed to populate')\n err.code = 'OBJECT_REQUIRED'\n throw err\n }\n\n // Set process.env\n for (const key of Object.keys(parsed)) {\n if (Object.prototype.hasOwnProperty.call(processEnv, key)) {\n if (override === true) {\n processEnv[key] = parsed[key]\n }\n\n if (debug) {\n if (override === true) {\n _debug(`\"${key}\" is already defined and WAS overwritten`)\n } else {\n _debug(`\"${key}\" is already defined and was NOT overwritten`)\n }\n }\n } else {\n processEnv[key] = parsed[key]\n }\n }\n}\n\nconst DotenvModule = {\n configDotenv,\n _configVault,\n _parseVault,\n config,\n decrypt,\n parse,\n populate\n}\n\nmodule.exports.configDotenv = DotenvModule.configDotenv\nmodule.exports._configVault = DotenvModule._configVault\nmodule.exports._parseVault = DotenvModule._parseVault\nmodule.exports.config = DotenvModule.config\nmodule.exports.decrypt = DotenvModule.decrypt\nmodule.exports.parse = DotenvModule.parse\nmodule.exports.populate = DotenvModule.populate\n\nmodule.exports = DotenvModule\n", "const path = require('path');\nconst { fileExists } = require('./file-utils');\n\n/**\n * Load .env.local file if it exists in the current working directory\n * @param {string} cwd - Current working directory (defaults to process.cwd())\n * @returns {boolean} True if .env.local was loaded\n */\nfunction loadEnvLocal(cwd = process.cwd()) {\n const envLocalPath = path.join(cwd, '.env.local');\n \n if (fileExists(envLocalPath)) {\n require('dotenv').config({ path: envLocalPath });\n console.log('\uD83D\uDCC4 Loaded .env.local');\n return true;\n }\n \n return false;\n}\n\n/**\n * Get an environment variable with optional default value\n * @param {string} name - Environment variable name\n * @param {string} defaultValue - Default value if not set\n * @returns {string|undefined} Environment variable value or default\n */\nfunction getEnvVar(name, defaultValue = undefined) {\n return process.env[name] || defaultValue;\n}\n\n/**\n * Check if an environment variable is set to 'true'\n * @param {string} name - Environment variable name\n * @returns {boolean} True if the env var is set to 'true'\n */\nfunction isEnvTrue(name) {\n return process.env[name] === 'true';\n}\n\nmodule.exports = {\n loadEnvLocal,\n getEnvVar,\n isEnvTrue\n};", "// ffdc.js - Simple config accessor\n// No base64 decoding, just returns the config object directly\n\nmodule.exports = function ffdc(config) {\n if (!config) {\n return {};\n }\n \n if (typeof config !== 'object') {\n throw new Error('Config must be an object');\n }\n \n return config;\n};", "const plugin = require('tailwindcss/plugin');\n\n// PostCSS is a peer dependency of Tailwind, so it should be available\n// We'll try to require it, but handle the case where it's not available\nlet postcss;\ntry {\n postcss = require('postcss');\n} catch (e) {\n // PostCSS not available - custom CSS parsing will be disabled\n postcss = null;\n}\n\nlet CacheManager;\nif (typeof window === 'undefined' && typeof process !== 'undefined' && process.versions && process.versions.node) {\n CacheManager = require('./lib/core/cache-manager');\n const { loadEnvLocal } = require('./lib/core/env-utils');\n // Load .env.local if it exists\n loadEnvLocal();\n}\n\nfunction filterDefault(values) {\n return Object.fromEntries(\n Object.entries(values).filter(([key]) => key !== \"DEFAULT\"),\n );\n}\n\nconst pluginExport = plugin.withOptions(\n function (options = {}) {\n return function ({ addBase, addUtilities, theme, matchUtilities }) {\n // 1. Load cache with CacheManager\n if (!CacheManager) {\n // should get cache in browser here\n return;\n }\n\n const cacheManager = new CacheManager(process.cwd());\n\n if (!cacheManager.exists()) {\n console.warn('[FrontFriend] No cache found. Please run \"npx frontfriend init\" first.');\n return;\n }\n\n if (!cacheManager.isValid()) {\n console.warn('[FrontFriend] Cache is expired. Please run \"npx frontfriend init\" to refresh.');\n }\n\n const cache = cacheManager.load();\n if (!cache) {\n console.error('[FrontFriend] Failed to load cache.');\n return;\n }\n\n // 2. Add CSS variables to :root\n const rootVars = {};\n\n // Add color variables\n if (cache.variables) {\n // Wrap HSL values in hsl() function\n for (const [key, value] of Object.entries(cache.variables)) {\n // Check if it's a color variable (contains HSL values)\n if (key.startsWith('--color-') && !value.startsWith('hsl(')) {\n rootVars[key] = `hsl(${value})`;\n } else {\n rootVars[key] = value;\n }\n }\n }\n\n // Add semantic variables (light mode)\n if (cache.semanticVariables) {\n for (const [key, value] of Object.entries(cache.semanticVariables)) {\n // Semantic variables point to color variables using var()\n // so we don't need to wrap them in hsl()\n rootVars[key] = value;\n }\n }\n\n // Add root styles\n addBase({\n ':root': rootVars\n });\n\n // 3. Add dark mode support\n if (cache.semanticDarkVariables && Object.keys(cache.semanticDarkVariables).length > 0) {\n addBase({\n ':root:not(.light)': cache.semanticDarkVariables\n });\n addBase({\n ':root:not(.dark)': cache.semanticVariables\n });\n }\n\n\n // 4. Generate semantic color utilities from semantic variables\n if (cache.semanticVariables) {\n const semanticUtilities = {};\n\n // Process semantic variables into utility classes\n for (const [cssVar] of Object.entries(cache.semanticVariables)) {\n // Convert CSS variable to utility class name\n // --bg-brand-mid-default -> bg-brand-mid\n // --text-brand-strong -> text-brand-strong\n // --border-neutral-subtle-hover -> border-neutral-subtle-hover\n\n const match = cssVar.match(/^--(bg|text|border|layer|overlay|icon)-(.+)$/);\n if (match) {\n const [, prefix, name] = match;\n const className = `.${prefix}-${name}`;\n\n if (prefix === 'bg' || prefix === 'layer' || prefix === 'overlay') {\n semanticUtilities[className] = {\n backgroundColor: `var(${cssVar})`\n };\n } else if (prefix === 'text') {\n semanticUtilities[className] = {\n color: `var(${cssVar})`\n };\n } else if (prefix === 'border') {\n semanticUtilities[className] = {\n borderColor: `var(${cssVar})`\n };\n } else if (prefix === 'icon') {\n // Icon tokens map to both text color and fill\n semanticUtilities[`.text-${prefix}-${name}`] = {\n color: `var(${cssVar})`\n };\n semanticUtilities[`.fill-${prefix}-${name}`] = {\n fill: `var(${cssVar})`\n };\n }\n }\n }\n\n addUtilities(semanticUtilities);\n }\n\n // 5. Generate utilities from tokens (semantic-based utilities)\n if (cache.tokens) {\n // Background colors\n if (cache.tokens.backgroundColor) {\n const bgUtilities = {};\n for (const [name, value] of Object.entries(cache.tokens.backgroundColor)) {\n // The value already contains hsl() wrapper from the processor\n bgUtilities[`.bg-${name}`] = {\n backgroundColor: value\n };\n }\n addUtilities(bgUtilities);\n }\n\n // Text colors\n if (cache.tokens.textColor) {\n const textUtilities = {};\n for (const [name, value] of Object.entries(cache.tokens.textColor)) {\n textUtilities[`.text-${name}`] = {\n color: value\n };\n }\n addUtilities(textUtilities);\n }\n\n // Border colors\n if (cache.tokens.borderColor) {\n const borderUtilities = {};\n for (const [name, value] of Object.entries(cache.tokens.borderColor)) {\n borderUtilities[`.border-${name}`] = {\n borderColor: value\n };\n }\n addUtilities(borderUtilities);\n }\n\n // Fill colors (for SVG icons)\n if (cache.tokens.fill) {\n const fillUtilities = {};\n const textIconUtilities = {};\n for (const [name, value] of Object.entries(cache.tokens.fill)) {\n fillUtilities[`.fill-${name}`] = {\n fill: value\n };\n // Also create text-icon utilities for icon color classes\n if (name.startsWith('icon-')) {\n textIconUtilities[`.text-${name}`] = {\n color: value\n };\n }\n }\n addUtilities(fillUtilities);\n addUtilities(textIconUtilities);\n }\n\n // Font family utilities\n if (cache.tokens.fontFamily) {\n const fontUtilities = {};\n for (const [name, value] of Object.entries(cache.tokens.fontFamily)) {\n fontUtilities[`.font-${name}`] = {\n fontFamily: value\n };\n }\n addUtilities(fontUtilities);\n }\n }\n\n // 6. Add font faces\n if (cache.fonts && cache.fonts.length > 0) {\n // Convert font objects to Tailwind-compatible format\n cache.fonts.forEach(fontFace => {\n // Tailwind expects each @font-face as a separate rule\n addBase({\n '@font-face': fontFace\n });\n });\n }\n\n // 7. Add enter/exit animation utilities\n addUtilities({\n \"@keyframes enter\": theme(\"keyframes.enter\"),\n \"@keyframes exit\": theme(\"keyframes.exit\"),\n \".animate-in\": {\n animationName: \"enter\",\n animationDuration: theme(\"animationDuration.DEFAULT\"),\n \"--tw-enter-opacity\": \"initial\",\n \"--tw-enter-scale\": \"initial\",\n \"--tw-enter-rotate\": \"initial\",\n \"--tw-enter-translate-x\": \"initial\",\n \"--tw-enter-translate-y\": \"initial\",\n },\n \".animate-out\": {\n animationName: \"exit\",\n animationDuration: theme(\"animationDuration.DEFAULT\"),\n \"--tw-exit-opacity\": \"initial\",\n \"--tw-exit-scale\": \"initial\",\n \"--tw-exit-rotate\": \"initial\",\n \"--tw-exit-translate-x\": \"initial\",\n \"--tw-exit-translate-y\": \"initial\",\n },\n });\n\n // 10. Add animation match utilities\n matchUtilities(\n {\n \"fade-in\": (value) => ({ \"--tw-enter-opacity\": value }),\n \"fade-out\": (value) => ({ \"--tw-exit-opacity\": value }),\n },\n { values: theme(\"animationOpacity\") }\n );\n\n matchUtilities(\n {\n \"zoom-in\": (value) => ({ \"--tw-enter-scale\": value }),\n \"zoom-out\": (value) => ({ \"--tw-exit-scale\": value }),\n },\n { values: theme(\"animationScale\") }\n );\n\n matchUtilities(\n {\n \"spin-in\": (value) => ({ \"--tw-enter-rotate\": value }),\n \"spin-out\": (value) => ({ \"--tw-exit-rotate\": value }),\n },\n { values: theme(\"animationRotate\") }\n );\n\n matchUtilities(\n {\n \"slide-in-from-top\": (value) => ({\n \"--tw-enter-translate-y\": `-${value}`,\n }),\n \"slide-in-from-bottom\": (value) => ({\n \"--tw-enter-translate-y\": value,\n }),\n \"slide-in-from-left\": (value) => ({\n \"--tw-enter-translate-x\": `-${value}`,\n }),\n \"slide-in-from-right\": (value) => ({\n \"--tw-enter-translate-x\": value,\n }),\n \"slide-out-to-top\": (value) => ({\n \"--tw-exit-translate-y\": `-${value}`,\n }),\n \"slide-out-to-bottom\": (value) => ({\n \"--tw-exit-translate-y\": value,\n }),\n \"slide-out-to-left\": (value) => ({\n \"--tw-exit-translate-x\": `-${value}`,\n }),\n \"slide-out-to-right\": (value) => ({\n \"--tw-exit-translate-x\": value,\n }),\n },\n { values: theme(\"animationTranslate\") }\n );\n\n // 11. Add animation control utilities\n matchUtilities(\n { duration: (value) => ({ animationDuration: value }) },\n { values: filterDefault(theme(\"animationDuration\")) }\n );\n\n matchUtilities(\n { delay: (value) => ({ animationDelay: value }) },\n { values: theme(\"animationDelay\") }\n );\n\n matchUtilities(\n { ease: (value) => ({ animationTimingFunction: value }) },\n { values: filterDefault(theme(\"animationTimingFunction\")) }\n );\n\n addUtilities({\n \".running\": { animationPlayState: \"running\" },\n \".paused\": { animationPlayState: \"paused\" },\n });\n\n matchUtilities(\n { \"fill-mode\": (value) => ({ animationFillMode: value }) },\n { values: theme(\"animationFillMode\") }\n );\n\n matchUtilities(\n { direction: (value) => ({ animationDirection: value }) },\n { values: theme(\"animationDirection\") }\n );\n\n matchUtilities(\n { repeat: (value) => ({ animationIterationCount: value }) },\n { values: theme(\"animationRepeat\") }\n );\n\n // 12. Add custom CSS\n if (cache.custom && cache.custom.raw && typeof cache.custom.raw === 'string') {\n const rawCss = cache.custom.raw.trim();\n \n if (!rawCss) {\n if (options.verbose) {\n console.warn('[FrontFriend] Empty custom CSS');\n }\n return;\n }\n\n // Check if PostCSS is available\n if (!postcss) {\n console.warn('[FrontFriend] PostCSS not available - custom CSS will not be added');\n return;\n }\n\n try {\n // Parse the CSS using PostCSS to get an AST\n const root = postcss.parse(rawCss);\n \n // Split nodes into base and utilities layers\n const baseNodes = [];\n const utilityNodes = [];\n \n root.each((node) => {\n // @keyframes, @font-face, @media, etc. go to base\n if (node.type === 'atrule') {\n // Special handling for @keyframes and other at-rules\n baseNodes.push(node);\n return;\n }\n \n // Regular rules\n if (node.type === 'rule') {\n // Class selectors starting with . go to utilities\n const isClassSelector = \n typeof node.selector === 'string' && \n node.selector.trim().startsWith('.');\n \n if (isClassSelector) {\n utilityNodes.push(node);\n } else {\n // Element selectors, IDs, attribute selectors, etc. go to base\n baseNodes.push(node);\n }\n return;\n }\n \n // Comments and other nodes go to base\n if (node.type !== 'comment') {\n baseNodes.push(node);\n }\n });\n \n // Add nodes to their respective layers\n // Tailwind accepts PostCSS nodes directly\n if (baseNodes.length > 0) {\n addBase(baseNodes);\n }\n \n if (utilityNodes.length > 0) {\n addUtilities(utilityNodes);\n }\n \n if (options.verbose) {\n console.log(`[FrontFriend] Added custom CSS: ${baseNodes.length} base rules, ${utilityNodes.length} utility classes`);\n }\n } catch (error) {\n console.error('[FrontFriend] Failed to parse custom CSS:', error.message);\n // Don't throw - just log the error and continue\n }\n }\n\n // Log success\n if (options.verbose) {\n console.log('[FrontFriend] Plugin loaded successfully');\n console.log(`[FrontFriend] Colors: ${Object.keys(cache.variables || {}).length}`);\n console.log(`[FrontFriend] Semantic vars: ${Object.keys(cache.semanticVariables || {}).length}`);\n console.log(`[FrontFriend] Fonts: ${(cache.fonts || []).length}`);\n console.log(`[FrontFriend] Safelist classes: ${Array.isArray(cache.safelist) ? cache.safelist.length : 0}`);\n }\n };\n },\n function (options = {}) {\n // Return theme configuration\n let cache = null;\n if (CacheManager) {\n const cacheManager = new CacheManager(process.cwd());\n cache = cacheManager.exists() ? cacheManager.load() : null;\n }\n\n // Default content paths matching the current-plugin approach\n const defaultContent = [\n './pages/**/*.{js,ts,jsx,tsx}',\n './components/**/*.{js,ts,jsx,tsx}',\n './app/**/*.{js,ts,jsx,tsx}',\n './src/**/*.{js,ts,jsx,tsx}',\n './stories/**/*.{js,ts,jsx,tsx}'\n ];\n\n // Log cache loading\n if (options.verbose && cache) {\n console.log('[FrontFriend] Cache loaded successfully');\n if (cache.safelist && Array.isArray(cache.safelist)) {\n console.log(`[FrontFriend] Loading ${cache.safelist.length} classes for safelist`);\n }\n }\n\n return {\n theme: {\n extend: {\n // Extend colors if needed\n colors: options.extendColors || {},\n // Extend animations if needed\n animation: options.extendAnimations || {},\n // Add custom spacing values\n spacing: {\n '18': '4.5rem',\n '88': '22rem',\n '128': '32rem'\n },\n // Add custom box shadows\n boxShadow: {\n 'top-sm': '0 -1px 1px 0 rgba(0, 0, 0, 0.05)'\n },\n // Add border radius values\n borderRadius: {\n '2xl': '1rem'\n },\n // Animation extensions\n animationDelay: ({ theme }) => ({\n ...theme(\"transitionDelay\"),\n }),\n animationDuration: ({ theme }) => ({\n 0: \"0ms\",\n ...theme(\"transitionDuration\"),\n }),\n animationTimingFunction: ({ theme }) => ({\n ...theme(\"transitionTimingFunction\"),\n }),\n animationFillMode: {\n none: \"none\",\n forwards: \"forwards\",\n backwards: \"backwards\",\n both: \"both\",\n },\n animationDirection: {\n normal: \"normal\",\n reverse: \"reverse\",\n alternate: \"alternate\",\n \"alternate-reverse\": \"alternate-reverse\",\n },\n animationOpacity: ({ theme }) => ({\n DEFAULT: 0,\n ...theme(\"opacity\"),\n }),\n animationTranslate: ({ theme }) => ({\n DEFAULT: \"100%\",\n ...theme(\"translate\"),\n }),\n animationScale: ({ theme }) => ({\n DEFAULT: 0,\n ...theme(\"scale\"),\n }),\n animationRotate: ({ theme }) => ({\n DEFAULT: \"30deg\",\n ...theme(\"rotate\"),\n }),\n animationRepeat: {\n 0: \"0\",\n 1: \"1\",\n infinite: \"infinite\",\n },\n keyframes: {\n enter: {\n from: {\n opacity: \"var(--tw-enter-opacity, 1)\",\n transform:\n \"translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0) scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))\",\n },\n },\n exit: {\n to: {\n opacity: \"var(--tw-exit-opacity, 1)\",\n transform:\n \"translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))\",\n },\n },\n },\n }\n },\n // Include safelist from cache and additional classes\n safelist: [\n ...(cache?.safelist || []),\n {\n pattern: /(text|fill)-icon-(neutral|positive|negative|warning|info|highlight|interactive|brand|inverse|onpositive|onnegative|onwarning|oninfo|onhighlight|oninteractive|onbrand)-(mid|strong|subtle|low)(-(neutral|hover|active|selected|disabled))?$/,\n },\n {\n pattern: /^(layer-(below|surface|raised|popover|dialog|control)|overlay-(mid|strong|subtle|low))$/,\n },\n ],\n // Set content paths - merge options with defaults\n content: options.content || defaultContent\n };\n }\n);\n\n// Default export is the plugin\nmodule.exports = pluginExport;\n\n// Export components config and icons with getter functions\n// This allows dynamic resolution at runtime\n\n// Create getter for config\nObject.defineProperty(module.exports, 'config', {\n get: function () {\n // Check for webpack-injected global variable\n if (typeof __FF_CONFIG__ !== 'undefined') {\n return __FF_CONFIG__;\n }\n\n // Check if we're in a browser environment\n if (typeof window !== 'undefined' && window.__FF_CONFIG__) {\n return window.__FF_CONFIG__;\n }\n\n // Node.js: load from cache\n if (CacheManager) {\n try {\n const cacheManager = new CacheManager(process.cwd());\n if (cacheManager.exists()) {\n const cache = cacheManager.load();\n if (cache) {\n return cache.componentsConfig || null;\n }\n }\n } catch (error) {\n // Config not available\n }\n }\n\n return null;\n }\n});\n\n// Create getter for iconSet\nObject.defineProperty(module.exports, 'iconSet', {\n get: function () {\n // Check for webpack-injected global variable\n if (typeof __FF_ICONS__ !== 'undefined') {\n return __FF_ICONS__;\n }\n\n // Check if we're in a browser environment\n if (typeof window !== 'undefined' && window.__FF_ICONS__) {\n return window.__FF_ICONS__;\n }\n\n // Node.js: load from cache\n if (CacheManager) {\n try {\n const cacheManager = new CacheManager(process.cwd());\n if (cacheManager.exists()) {\n const cache = cacheManager.load();\n if (cache) {\n return cache.icons || null;\n }\n }\n } catch (error) {\n // Icons not available\n }\n }\n\n return null;\n }\n});\n\n// Export ffdc utility\nmodule.exports.ffdc = require('./ffdc.js');"],
5
- "mappings": "8DAAA,IAAAA,EAAAC,EAAA,CAAAC,GAAAC,IAAA,KAAMC,EAAK,QAAQ,IAAI,EAQvB,SAASC,EAAiBC,EAAU,CAClC,GAAI,CACF,IAAMC,EAAUH,EAAG,aAAaE,EAAU,MAAM,EAChD,OAAO,KAAK,MAAMC,CAAO,CAC3B,OAASC,EAAO,CACd,GAAIA,EAAM,OAAS,SACjB,OAAO,KAET,MAAMA,CACR,CACF,CAQA,SAASC,EAAaH,EAAU,CAC9B,GAAI,CACF,OAAOF,EAAG,aAAaE,EAAU,MAAM,CACzC,OAASE,EAAO,CACd,GAAIA,EAAM,OAAS,SACjB,OAAO,KAET,MAAMA,CAC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C,EAGD,OAAO,QAAQ,KAAO",
6
- "names": ["require_file_utils", "__commonJSMin", "exports", "module", "fs", "readJsonFileSafe", "filepath", "content", "error", "readFileSafe", "writeJsonFile", "data", "indent", "writeModuleExportsFile", "fileExists", "ensureDirectoryExists", "dirpath", "removeDirectory", "require_package", "__commonJSMin", "exports", "module", "require_main", "__commonJSMin", "exports", "module", "fs", "path", "os", "crypto", "packageJson", "version", "LINE", "parse", "src", "obj", "lines", "match", "key", "value", "maybeQuote", "_parseVault", "options", "vaultPath", "_vaultPath", "result", "DotenvModule", "err", "keys", "_dotenvKey", "length", "decrypted", "i", "attrs", "_instructions", "error", "_warn", "message", "_debug", "_log", "dotenvKey", "uri", "environment", "environmentKey", "ciphertext", "possibleVaultPath", "filepath", "_resolveHome", "envPath", "_configVault", "debug", "quiet", "parsed", "processEnv", "configDotenv", "dotenvPath", "encoding", "optionPaths", "lastError", "parsedAll", "e", "keysCount", "shortPaths", "filePath", "relative", "config", "decrypt", "encrypted", "keyStr", "nonce", "authTag", "aesgcm", "isRange", "invalidKeyLength", "decryptionFailed", "populate", "override", "require_env_utils", "__commonJSMin", "exports", "module", "path", "fileExists", "loadEnvLocal", "cwd", "envLocalPath", "getEnvVar", "name", "defaultValue", "isEnvTrue", "require_ffdc", "__commonJSMin", "exports", "module", "config", "plugin", "postcss", "CacheManager", "loadEnvLocal", "filterDefault", "values", "key", "pluginExport", "options", "addBase", "addUtilities", "theme", "matchUtilities", "cacheManager", "cache", "rootVars", "value", "semanticUtilities", "cssVar", "match", "prefix", "name", "className", "bgUtilities", "textUtilities", "borderUtilities", "fillUtilities", "textIconUtilities", "fontUtilities", "fontFace", "rawCss", "root", "baseNodes", "utilityNodes", "node", "error", "defaultContent"]
4
+ "sourcesContent": ["const fs = require('fs');\n\n/**\n * Read a JSON file safely, returning null if file doesn't exist\n * @param {string} filepath - Path to the JSON file\n * @returns {Object|null} Parsed JSON or null if file not found\n * @throws {Error} If JSON is invalid\n */\nfunction readJsonFileSafe(filepath) {\n try {\n const content = fs.readFileSync(filepath, 'utf8');\n return JSON.parse(content);\n } catch (error) {\n if (error.code === 'ENOENT') {\n return null; // File not found, return null like API would return 404\n }\n throw error;\n }\n}\n\n/**\n * Read a file safely, returning null if file doesn't exist\n * @param {string} filepath - Path to the file\n * @returns {string|null} File content or null if file not found\n * @throws {Error} For other file system errors\n */\nfunction readFileSafe(filepath) {\n try {\n return fs.readFileSync(filepath, 'utf8');\n } catch (error) {\n if (error.code === 'ENOENT') {\n return null; // File not found\n }\n throw error;\n }\n}\n\n/**\n * Write JSON data to a file with proper formatting\n * @param {string} filepath - Path to write the file\n * @param {Object} data - Data to write\n * @param {number} indent - Indentation level (default: 2)\n */\nfunction writeJsonFile(filepath, data, indent = 2) {\n const content = JSON.stringify(data, null, indent);\n fs.writeFileSync(filepath, content, 'utf8');\n}\n\n/**\n * Write module.exports file with JSON data\n * @param {string} filepath - Path to write the file\n * @param {Object} data - Data to export\n */\nfunction writeModuleExportsFile(filepath, data) {\n // Handle empty data cases\n if (data === null || data === undefined || \n (typeof data === 'object' && Object.keys(data).length === 0) ||\n (Array.isArray(data) && data.length === 0)) {\n const emptyContent = Array.isArray(data) ? '[]' : '{}';\n const content = `module.exports = ${emptyContent};`;\n fs.writeFileSync(filepath, content, 'utf8');\n } else {\n const content = `module.exports = ${JSON.stringify(data, null, 2)};`;\n fs.writeFileSync(filepath, content, 'utf8');\n }\n}\n\n/**\n * Check if a file exists\n * @param {string} filepath - Path to check\n * @returns {boolean} True if file exists\n */\nfunction fileExists(filepath) {\n return fs.existsSync(filepath);\n}\n\n/**\n * Create directory recursively\n * @param {string} dirpath - Directory path to create\n */\nfunction ensureDirectoryExists(dirpath) {\n fs.mkdirSync(dirpath, { recursive: true });\n}\n\n/**\n * Remove directory recursively\n * @param {string} dirpath - Directory path to remove\n */\nfunction removeDirectory(dirpath) {\n fs.rmSync(dirpath, { recursive: true, force: true });\n}\n\nmodule.exports = {\n readJsonFileSafe,\n readFileSafe,\n writeJsonFile,\n writeModuleExportsFile,\n fileExists,\n ensureDirectoryExists,\n removeDirectory\n};", "{\n \"name\": \"dotenv\",\n \"version\": \"16.6.1\",\n \"description\": \"Loads environment variables from .env file\",\n \"main\": \"lib/main.js\",\n \"types\": \"lib/main.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./lib/main.d.ts\",\n \"require\": \"./lib/main.js\",\n \"default\": \"./lib/main.js\"\n },\n \"./config\": \"./config.js\",\n \"./config.js\": \"./config.js\",\n \"./lib/env-options\": \"./lib/env-options.js\",\n \"./lib/env-options.js\": \"./lib/env-options.js\",\n \"./lib/cli-options\": \"./lib/cli-options.js\",\n \"./lib/cli-options.js\": \"./lib/cli-options.js\",\n \"./package.json\": \"./package.json\"\n },\n \"scripts\": {\n \"dts-check\": \"tsc --project tests/types/tsconfig.json\",\n \"lint\": \"standard\",\n \"pretest\": \"npm run lint && npm run dts-check\",\n \"test\": \"tap run --allow-empty-coverage --disable-coverage --timeout=60000\",\n \"test:coverage\": \"tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov\",\n \"prerelease\": \"npm test\",\n \"release\": \"standard-version\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git://github.com/motdotla/dotenv.git\"\n },\n \"homepage\": \"https://github.com/motdotla/dotenv#readme\",\n \"funding\": \"https://dotenvx.com\",\n \"keywords\": [\n \"dotenv\",\n \"env\",\n \".env\",\n \"environment\",\n \"variables\",\n \"config\",\n \"settings\"\n ],\n \"readmeFilename\": \"README.md\",\n \"license\": \"BSD-2-Clause\",\n \"devDependencies\": {\n \"@types/node\": \"^18.11.3\",\n \"decache\": \"^4.6.2\",\n \"sinon\": \"^14.0.1\",\n \"standard\": \"^17.0.0\",\n \"standard-version\": \"^9.5.0\",\n \"tap\": \"^19.2.0\",\n \"typescript\": \"^4.8.4\"\n },\n \"engines\": {\n \"node\": \">=12\"\n },\n \"browser\": {\n \"fs\": false\n }\n}\n", "const fs = require('fs')\nconst path = require('path')\nconst os = require('os')\nconst crypto = require('crypto')\nconst packageJson = require('../package.json')\n\nconst version = packageJson.version\n\nconst LINE = /(?:^|^)\\s*(?:export\\s+)?([\\w.-]+)(?:\\s*=\\s*?|:\\s+?)(\\s*'(?:\\\\'|[^'])*'|\\s*\"(?:\\\\\"|[^\"])*\"|\\s*`(?:\\\\`|[^`])*`|[^#\\r\\n]+)?\\s*(?:#.*)?(?:$|$)/mg\n\n// Parse src into an Object\nfunction parse (src) {\n const obj = {}\n\n // Convert buffer to string\n let lines = src.toString()\n\n // Convert line breaks to same format\n lines = lines.replace(/\\r\\n?/mg, '\\n')\n\n let match\n while ((match = LINE.exec(lines)) != null) {\n const key = match[1]\n\n // Default undefined or null to empty string\n let value = (match[2] || '')\n\n // Remove whitespace\n value = value.trim()\n\n // Check if double quoted\n const maybeQuote = value[0]\n\n // Remove surrounding quotes\n value = value.replace(/^(['\"`])([\\s\\S]*)\\1$/mg, '$2')\n\n // Expand newlines if double quoted\n if (maybeQuote === '\"') {\n value = value.replace(/\\\\n/g, '\\n')\n value = value.replace(/\\\\r/g, '\\r')\n }\n\n // Add to object\n obj[key] = value\n }\n\n return obj\n}\n\nfunction _parseVault (options) {\n options = options || {}\n\n const vaultPath = _vaultPath(options)\n options.path = vaultPath // parse .env.vault\n const result = DotenvModule.configDotenv(options)\n if (!result.parsed) {\n const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`)\n err.code = 'MISSING_DATA'\n throw err\n }\n\n // handle scenario for comma separated keys - for use with key rotation\n // example: DOTENV_KEY=\"dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=prod,dotenv://:key_7890@dotenvx.com/vault/.env.vault?environment=prod\"\n const keys = _dotenvKey(options).split(',')\n const length = keys.length\n\n let decrypted\n for (let i = 0; i < length; i++) {\n try {\n // Get full key\n const key = keys[i].trim()\n\n // Get instructions for decrypt\n const attrs = _instructions(result, key)\n\n // Decrypt\n decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key)\n\n break\n } catch (error) {\n // last key\n if (i + 1 >= length) {\n throw error\n }\n // try next key\n }\n }\n\n // Parse decrypted .env string\n return DotenvModule.parse(decrypted)\n}\n\nfunction _warn (message) {\n console.log(`[dotenv@${version}][WARN] ${message}`)\n}\n\nfunction _debug (message) {\n console.log(`[dotenv@${version}][DEBUG] ${message}`)\n}\n\nfunction _log (message) {\n console.log(`[dotenv@${version}] ${message}`)\n}\n\nfunction _dotenvKey (options) {\n // prioritize developer directly setting options.DOTENV_KEY\n if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {\n return options.DOTENV_KEY\n }\n\n // secondary infra already contains a DOTENV_KEY environment variable\n if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {\n return process.env.DOTENV_KEY\n }\n\n // fallback to empty string\n return ''\n}\n\nfunction _instructions (result, dotenvKey) {\n // Parse DOTENV_KEY. Format is a URI\n let uri\n try {\n uri = new URL(dotenvKey)\n } catch (error) {\n if (error.code === 'ERR_INVALID_URL') {\n const err = new Error('INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development')\n err.code = 'INVALID_DOTENV_KEY'\n throw err\n }\n\n throw error\n }\n\n // Get decrypt key\n const key = uri.password\n if (!key) {\n const err = new Error('INVALID_DOTENV_KEY: Missing key part')\n err.code = 'INVALID_DOTENV_KEY'\n throw err\n }\n\n // Get environment\n const environment = uri.searchParams.get('environment')\n if (!environment) {\n const err = new Error('INVALID_DOTENV_KEY: Missing environment part')\n err.code = 'INVALID_DOTENV_KEY'\n throw err\n }\n\n // Get ciphertext payload\n const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`\n const ciphertext = result.parsed[environmentKey] // DOTENV_VAULT_PRODUCTION\n if (!ciphertext) {\n const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`)\n err.code = 'NOT_FOUND_DOTENV_ENVIRONMENT'\n throw err\n }\n\n return { ciphertext, key }\n}\n\nfunction _vaultPath (options) {\n let possibleVaultPath = null\n\n if (options && options.path && options.path.length > 0) {\n if (Array.isArray(options.path)) {\n for (const filepath of options.path) {\n if (fs.existsSync(filepath)) {\n possibleVaultPath = filepath.endsWith('.vault') ? filepath : `${filepath}.vault`\n }\n }\n } else {\n possibleVaultPath = options.path.endsWith('.vault') ? options.path : `${options.path}.vault`\n }\n } else {\n possibleVaultPath = path.resolve(process.cwd(), '.env.vault')\n }\n\n if (fs.existsSync(possibleVaultPath)) {\n return possibleVaultPath\n }\n\n return null\n}\n\nfunction _resolveHome (envPath) {\n return envPath[0] === '~' ? path.join(os.homedir(), envPath.slice(1)) : envPath\n}\n\nfunction _configVault (options) {\n const debug = Boolean(options && options.debug)\n const quiet = options && 'quiet' in options ? options.quiet : true\n\n if (debug || !quiet) {\n _log('Loading env from encrypted .env.vault')\n }\n\n const parsed = DotenvModule._parseVault(options)\n\n let processEnv = process.env\n if (options && options.processEnv != null) {\n processEnv = options.processEnv\n }\n\n DotenvModule.populate(processEnv, parsed, options)\n\n return { parsed }\n}\n\nfunction configDotenv (options) {\n const dotenvPath = path.resolve(process.cwd(), '.env')\n let encoding = 'utf8'\n const debug = Boolean(options && options.debug)\n const quiet = options && 'quiet' in options ? options.quiet : true\n\n if (options && options.encoding) {\n encoding = options.encoding\n } else {\n if (debug) {\n _debug('No encoding is specified. UTF-8 is used by default')\n }\n }\n\n let optionPaths = [dotenvPath] // default, look for .env\n if (options && options.path) {\n if (!Array.isArray(options.path)) {\n optionPaths = [_resolveHome(options.path)]\n } else {\n optionPaths = [] // reset default\n for (const filepath of options.path) {\n optionPaths.push(_resolveHome(filepath))\n }\n }\n }\n\n // Build the parsed data in a temporary object (because we need to return it). Once we have the final\n // parsed data, we will combine it with process.env (or options.processEnv if provided).\n let lastError\n const parsedAll = {}\n for (const path of optionPaths) {\n try {\n // Specifying an encoding returns a string instead of a buffer\n const parsed = DotenvModule.parse(fs.readFileSync(path, { encoding }))\n\n DotenvModule.populate(parsedAll, parsed, options)\n } catch (e) {\n if (debug) {\n _debug(`Failed to load ${path} ${e.message}`)\n }\n lastError = e\n }\n }\n\n let processEnv = process.env\n if (options && options.processEnv != null) {\n processEnv = options.processEnv\n }\n\n DotenvModule.populate(processEnv, parsedAll, options)\n\n if (debug || !quiet) {\n const keysCount = Object.keys(parsedAll).length\n const shortPaths = []\n for (const filePath of optionPaths) {\n try {\n const relative = path.relative(process.cwd(), filePath)\n shortPaths.push(relative)\n } catch (e) {\n if (debug) {\n _debug(`Failed to load ${filePath} ${e.message}`)\n }\n lastError = e\n }\n }\n\n _log(`injecting env (${keysCount}) from ${shortPaths.join(',')}`)\n }\n\n if (lastError) {\n return { parsed: parsedAll, error: lastError }\n } else {\n return { parsed: parsedAll }\n }\n}\n\n// Populates process.env from .env file\nfunction config (options) {\n // fallback to original dotenv if DOTENV_KEY is not set\n if (_dotenvKey(options).length === 0) {\n return DotenvModule.configDotenv(options)\n }\n\n const vaultPath = _vaultPath(options)\n\n // dotenvKey exists but .env.vault file does not exist\n if (!vaultPath) {\n _warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`)\n\n return DotenvModule.configDotenv(options)\n }\n\n return DotenvModule._configVault(options)\n}\n\nfunction decrypt (encrypted, keyStr) {\n const key = Buffer.from(keyStr.slice(-64), 'hex')\n let ciphertext = Buffer.from(encrypted, 'base64')\n\n const nonce = ciphertext.subarray(0, 12)\n const authTag = ciphertext.subarray(-16)\n ciphertext = ciphertext.subarray(12, -16)\n\n try {\n const aesgcm = crypto.createDecipheriv('aes-256-gcm', key, nonce)\n aesgcm.setAuthTag(authTag)\n return `${aesgcm.update(ciphertext)}${aesgcm.final()}`\n } catch (error) {\n const isRange = error instanceof RangeError\n const invalidKeyLength = error.message === 'Invalid key length'\n const decryptionFailed = error.message === 'Unsupported state or unable to authenticate data'\n\n if (isRange || invalidKeyLength) {\n const err = new Error('INVALID_DOTENV_KEY: It must be 64 characters long (or more)')\n err.code = 'INVALID_DOTENV_KEY'\n throw err\n } else if (decryptionFailed) {\n const err = new Error('DECRYPTION_FAILED: Please check your DOTENV_KEY')\n err.code = 'DECRYPTION_FAILED'\n throw err\n } else {\n throw error\n }\n }\n}\n\n// Populate process.env with parsed values\nfunction populate (processEnv, parsed, options = {}) {\n const debug = Boolean(options && options.debug)\n const override = Boolean(options && options.override)\n\n if (typeof parsed !== 'object') {\n const err = new Error('OBJECT_REQUIRED: Please check the processEnv argument being passed to populate')\n err.code = 'OBJECT_REQUIRED'\n throw err\n }\n\n // Set process.env\n for (const key of Object.keys(parsed)) {\n if (Object.prototype.hasOwnProperty.call(processEnv, key)) {\n if (override === true) {\n processEnv[key] = parsed[key]\n }\n\n if (debug) {\n if (override === true) {\n _debug(`\"${key}\" is already defined and WAS overwritten`)\n } else {\n _debug(`\"${key}\" is already defined and was NOT overwritten`)\n }\n }\n } else {\n processEnv[key] = parsed[key]\n }\n }\n}\n\nconst DotenvModule = {\n configDotenv,\n _configVault,\n _parseVault,\n config,\n decrypt,\n parse,\n populate\n}\n\nmodule.exports.configDotenv = DotenvModule.configDotenv\nmodule.exports._configVault = DotenvModule._configVault\nmodule.exports._parseVault = DotenvModule._parseVault\nmodule.exports.config = DotenvModule.config\nmodule.exports.decrypt = DotenvModule.decrypt\nmodule.exports.parse = DotenvModule.parse\nmodule.exports.populate = DotenvModule.populate\n\nmodule.exports = DotenvModule\n", "const path = require('path');\nconst { fileExists } = require('./file-utils');\n\n/**\n * Load .env.local file if it exists in the current working directory\n * @param {string} cwd - Current working directory (defaults to process.cwd())\n * @returns {boolean} True if .env.local was loaded\n */\nfunction loadEnvLocal(cwd = process.cwd()) {\n const envLocalPath = path.join(cwd, '.env.local');\n \n if (fileExists(envLocalPath)) {\n require('dotenv').config({ path: envLocalPath });\n console.log('\uD83D\uDCC4 Loaded .env.local');\n return true;\n }\n \n return false;\n}\n\n/**\n * Get an environment variable with optional default value\n * @param {string} name - Environment variable name\n * @param {string} defaultValue - Default value if not set\n * @returns {string|undefined} Environment variable value or default\n */\nfunction getEnvVar(name, defaultValue = undefined) {\n return process.env[name] || defaultValue;\n}\n\n/**\n * Check if an environment variable is set to 'true'\n * @param {string} name - Environment variable name\n * @returns {boolean} True if the env var is set to 'true'\n */\nfunction isEnvTrue(name) {\n return process.env[name] === 'true';\n}\n\nmodule.exports = {\n loadEnvLocal,\n getEnvVar,\n isEnvTrue\n};", "// ffdc.js - Simple config accessor\n// No base64 decoding, just returns the config object directly\n\nmodule.exports = function ffdc(config) {\n if (!config) {\n return {};\n }\n \n if (typeof config !== 'object') {\n throw new Error('Config must be an object');\n }\n \n return config;\n};", "const plugin = require('tailwindcss/plugin');\n\n// PostCSS is a peer dependency of Tailwind, so it should be available\n// We'll try to require it, but handle the case where it's not available\nlet postcss;\ntry {\n postcss = require('postcss');\n} catch (e) {\n // PostCSS not available - custom CSS parsing will be disabled\n postcss = null;\n}\n\nlet CacheManager;\nif (typeof window === 'undefined' && typeof process !== 'undefined' && process.versions && process.versions.node) {\n CacheManager = require('./lib/core/cache-manager');\n const { loadEnvLocal } = require('./lib/core/env-utils');\n // Load .env.local if it exists\n loadEnvLocal();\n}\n\nfunction filterDefault(values) {\n return Object.fromEntries(\n Object.entries(values).filter(([key]) => key !== \"DEFAULT\"),\n );\n}\n\nconst pluginExport = plugin.withOptions(\n function (options = {}) {\n return function ({ addBase, addUtilities, theme, matchUtilities }) {\n // 1. Load cache with CacheManager\n if (!CacheManager) {\n // should get cache in browser here\n return;\n }\n\n const cacheManager = new CacheManager(process.cwd());\n\n if (!cacheManager.exists()) {\n console.warn('[FrontFriend] No cache found. Please run \"npx frontfriend init\" first.');\n return;\n }\n\n if (!cacheManager.isValid()) {\n console.warn('[FrontFriend] Cache is expired. Please run \"npx frontfriend init\" to refresh.');\n }\n\n const cache = cacheManager.load();\n if (!cache) {\n console.error('[FrontFriend] Failed to load cache.');\n return;\n }\n\n // 2. Add CSS variables to :root\n const rootVars = {};\n\n // Add color variables\n if (cache.variables) {\n // Wrap HSL values in hsl() function\n for (const [key, value] of Object.entries(cache.variables)) {\n // Check if it's a color variable (contains HSL values)\n if (key.startsWith('--color-') && !value.startsWith('hsl(')) {\n rootVars[key] = `hsl(${value})`;\n } else {\n rootVars[key] = value;\n }\n }\n }\n\n // Add semantic variables (light mode)\n if (cache.semanticVariables) {\n for (const [key, value] of Object.entries(cache.semanticVariables)) {\n // Check if value contains HSL components (e.g., \"206 92% 5% / 0.9\")\n // These need to be wrapped in hsl() function\n if (typeof value === 'string' &&\n !value.startsWith('var(') &&\n !value.startsWith('hsl(') &&\n /^\\d+\\s+\\d+%\\s+\\d+%/.test(value)) {\n rootVars[key] = `hsl(${value})`;\n } else {\n // Semantic variables that point to other variables using var()\n // don't need wrapping\n rootVars[key] = value;\n }\n }\n }\n\n // Add root styles\n addBase({\n ':root': rootVars\n });\n\n // 3. Add dark mode support\n if (cache.semanticDarkVariables && Object.keys(cache.semanticDarkVariables).length > 0) {\n const darkVars = {};\n for (const [key, value] of Object.entries(cache.semanticDarkVariables)) {\n // Check if value contains HSL components\n if (typeof value === 'string' &&\n !value.startsWith('var(') &&\n !value.startsWith('hsl(') &&\n /^\\d+\\s+\\d+%\\s+\\d+%/.test(value)) {\n darkVars[key] = `hsl(${value})`;\n } else {\n darkVars[key] = value;\n }\n }\n\n addBase({\n ':root:not(.light)': darkVars\n });\n addBase({\n ':root:not(.dark)': rootVars\n });\n }\n\n\n // 4. Generate semantic color utilities from semantic variables\n if (cache.semanticVariables) {\n const semanticUtilities = {};\n\n // Process semantic variables into utility classes\n for (const [cssVar] of Object.entries(cache.semanticVariables)) {\n // Convert CSS variable to utility class name\n // --bg-brand-mid-default -> bg-brand-mid\n // --text-brand-strong -> text-brand-strong\n // --border-neutral-subtle-hover -> border-neutral-subtle-hover\n\n const match = cssVar.match(/^--(bg|text|border|layer|overlay|icon)-(.+)$/);\n if (match) {\n const [, prefix, name] = match;\n const className = `.${prefix}-${name}`;\n\n if (prefix === 'bg' || prefix === 'layer' || prefix === 'overlay') {\n semanticUtilities[className] = {\n backgroundColor: `var(${cssVar})`\n };\n } else if (prefix === 'text') {\n semanticUtilities[className] = {\n color: `var(${cssVar})`\n };\n } else if (prefix === 'border') {\n semanticUtilities[className] = {\n borderColor: `var(${cssVar})`\n };\n } else if (prefix === 'icon') {\n // Icon tokens map to both text color and fill\n semanticUtilities[`.text-${prefix}-${name}`] = {\n color: `var(${cssVar})`\n };\n semanticUtilities[`.fill-${prefix}-${name}`] = {\n fill: `var(${cssVar})`\n };\n }\n }\n }\n\n addUtilities(semanticUtilities);\n }\n\n // 5. Generate utilities from tokens (semantic-based utilities)\n if (cache.tokens) {\n // Background colors\n if (cache.tokens.backgroundColor) {\n const bgUtilities = {};\n for (const [name, value] of Object.entries(cache.tokens.backgroundColor)) {\n // The value already contains hsl() wrapper from the processor\n bgUtilities[`.bg-${name}`] = {\n backgroundColor: value\n };\n }\n addUtilities(bgUtilities);\n }\n\n // Text colors\n if (cache.tokens.textColor) {\n const textUtilities = {};\n for (const [name, value] of Object.entries(cache.tokens.textColor)) {\n textUtilities[`.text-${name}`] = {\n color: value\n };\n }\n addUtilities(textUtilities);\n }\n\n // Border colors\n if (cache.tokens.borderColor) {\n const borderUtilities = {};\n for (const [name, value] of Object.entries(cache.tokens.borderColor)) {\n borderUtilities[`.border-${name}`] = {\n borderColor: value\n };\n }\n addUtilities(borderUtilities);\n }\n\n // Fill colors (for SVG icons)\n if (cache.tokens.fill) {\n const fillUtilities = {};\n const textIconUtilities = {};\n for (const [name, value] of Object.entries(cache.tokens.fill)) {\n fillUtilities[`.fill-${name}`] = {\n fill: value\n };\n // Also create text-icon utilities for icon color classes\n if (name.startsWith('icon-')) {\n textIconUtilities[`.text-${name}`] = {\n color: value\n };\n }\n }\n addUtilities(fillUtilities);\n addUtilities(textIconUtilities);\n }\n\n // Font family utilities\n if (cache.tokens.fontFamily) {\n const fontUtilities = {};\n for (const [name, value] of Object.entries(cache.tokens.fontFamily)) {\n fontUtilities[`.font-${name}`] = {\n fontFamily: value\n };\n }\n addUtilities(fontUtilities);\n }\n }\n\n // 6. Add font faces\n if (cache.fonts && cache.fonts.length > 0) {\n // Convert font objects to Tailwind-compatible format\n cache.fonts.forEach(fontFace => {\n // Tailwind expects each @font-face as a separate rule\n addBase({\n '@font-face': fontFace\n });\n });\n }\n\n // 7. Add enter/exit animation utilities\n addUtilities({\n \"@keyframes enter\": theme(\"keyframes.enter\"),\n \"@keyframes exit\": theme(\"keyframes.exit\"),\n \".animate-in\": {\n animationName: \"enter\",\n animationDuration: theme(\"animationDuration.DEFAULT\"),\n \"--tw-enter-opacity\": \"initial\",\n \"--tw-enter-scale\": \"initial\",\n \"--tw-enter-rotate\": \"initial\",\n \"--tw-enter-translate-x\": \"initial\",\n \"--tw-enter-translate-y\": \"initial\",\n },\n \".animate-out\": {\n animationName: \"exit\",\n animationDuration: theme(\"animationDuration.DEFAULT\"),\n \"--tw-exit-opacity\": \"initial\",\n \"--tw-exit-scale\": \"initial\",\n \"--tw-exit-rotate\": \"initial\",\n \"--tw-exit-translate-x\": \"initial\",\n \"--tw-exit-translate-y\": \"initial\",\n },\n });\n\n // 10. Add animation match utilities\n matchUtilities(\n {\n \"fade-in\": (value) => ({ \"--tw-enter-opacity\": value }),\n \"fade-out\": (value) => ({ \"--tw-exit-opacity\": value }),\n },\n { values: theme(\"animationOpacity\") }\n );\n\n matchUtilities(\n {\n \"zoom-in\": (value) => ({ \"--tw-enter-scale\": value }),\n \"zoom-out\": (value) => ({ \"--tw-exit-scale\": value }),\n },\n { values: theme(\"animationScale\") }\n );\n\n matchUtilities(\n {\n \"spin-in\": (value) => ({ \"--tw-enter-rotate\": value }),\n \"spin-out\": (value) => ({ \"--tw-exit-rotate\": value }),\n },\n { values: theme(\"animationRotate\") }\n );\n\n matchUtilities(\n {\n \"slide-in-from-top\": (value) => ({\n \"--tw-enter-translate-y\": `-${value}`,\n }),\n \"slide-in-from-bottom\": (value) => ({\n \"--tw-enter-translate-y\": value,\n }),\n \"slide-in-from-left\": (value) => ({\n \"--tw-enter-translate-x\": `-${value}`,\n }),\n \"slide-in-from-right\": (value) => ({\n \"--tw-enter-translate-x\": value,\n }),\n \"slide-out-to-top\": (value) => ({\n \"--tw-exit-translate-y\": `-${value}`,\n }),\n \"slide-out-to-bottom\": (value) => ({\n \"--tw-exit-translate-y\": value,\n }),\n \"slide-out-to-left\": (value) => ({\n \"--tw-exit-translate-x\": `-${value}`,\n }),\n \"slide-out-to-right\": (value) => ({\n \"--tw-exit-translate-x\": value,\n }),\n },\n { values: theme(\"animationTranslate\") }\n );\n\n // 11. Add animation control utilities\n matchUtilities(\n { duration: (value) => ({ animationDuration: value }) },\n { values: filterDefault(theme(\"animationDuration\")) }\n );\n\n matchUtilities(\n { delay: (value) => ({ animationDelay: value }) },\n { values: theme(\"animationDelay\") }\n );\n\n matchUtilities(\n { ease: (value) => ({ animationTimingFunction: value }) },\n { values: filterDefault(theme(\"animationTimingFunction\")) }\n );\n\n addUtilities({\n \".running\": { animationPlayState: \"running\" },\n \".paused\": { animationPlayState: \"paused\" },\n });\n\n matchUtilities(\n { \"fill-mode\": (value) => ({ animationFillMode: value }) },\n { values: theme(\"animationFillMode\") }\n );\n\n matchUtilities(\n { direction: (value) => ({ animationDirection: value }) },\n { values: theme(\"animationDirection\") }\n );\n\n matchUtilities(\n { repeat: (value) => ({ animationIterationCount: value }) },\n { values: theme(\"animationRepeat\") }\n );\n\n // 12. Add custom CSS\n if (cache.custom && cache.custom.raw && typeof cache.custom.raw === 'string') {\n const rawCss = cache.custom.raw.trim();\n \n if (!rawCss) {\n if (options.verbose) {\n console.warn('[FrontFriend] Empty custom CSS');\n }\n return;\n }\n\n // Check if PostCSS is available\n if (!postcss) {\n console.warn('[FrontFriend] PostCSS not available - custom CSS will not be added');\n return;\n }\n\n try {\n // Parse the CSS using PostCSS to get an AST\n const root = postcss.parse(rawCss);\n \n // Split nodes into base and utilities layers\n const baseNodes = [];\n const utilityNodes = [];\n \n root.each((node) => {\n // @keyframes, @font-face, @media, etc. go to base\n if (node.type === 'atrule') {\n // Special handling for @keyframes and other at-rules\n baseNodes.push(node);\n return;\n }\n \n // Regular rules\n if (node.type === 'rule') {\n // Class selectors starting with . go to utilities\n const isClassSelector = \n typeof node.selector === 'string' && \n node.selector.trim().startsWith('.');\n \n if (isClassSelector) {\n utilityNodes.push(node);\n } else {\n // Element selectors, IDs, attribute selectors, etc. go to base\n baseNodes.push(node);\n }\n return;\n }\n \n // Comments and other nodes go to base\n if (node.type !== 'comment') {\n baseNodes.push(node);\n }\n });\n \n // Add nodes to their respective layers\n // Tailwind accepts PostCSS nodes directly\n if (baseNodes.length > 0) {\n addBase(baseNodes);\n }\n \n if (utilityNodes.length > 0) {\n addUtilities(utilityNodes);\n }\n \n if (options.verbose) {\n console.log(`[FrontFriend] Added custom CSS: ${baseNodes.length} base rules, ${utilityNodes.length} utility classes`);\n }\n } catch (error) {\n console.error('[FrontFriend] Failed to parse custom CSS:', error.message);\n // Don't throw - just log the error and continue\n }\n }\n\n // Log success\n if (options.verbose) {\n console.log('[FrontFriend] Plugin loaded successfully');\n console.log(`[FrontFriend] Colors: ${Object.keys(cache.variables || {}).length}`);\n console.log(`[FrontFriend] Semantic vars: ${Object.keys(cache.semanticVariables || {}).length}`);\n console.log(`[FrontFriend] Fonts: ${(cache.fonts || []).length}`);\n console.log(`[FrontFriend] Safelist classes: ${Array.isArray(cache.safelist) ? cache.safelist.length : 0}`);\n }\n };\n },\n function (options = {}) {\n // Return theme configuration\n let cache = null;\n if (CacheManager) {\n const cacheManager = new CacheManager(process.cwd());\n cache = cacheManager.exists() ? cacheManager.load() : null;\n }\n\n // Default content paths matching the current-plugin approach\n const defaultContent = [\n './pages/**/*.{js,ts,jsx,tsx}',\n './components/**/*.{js,ts,jsx,tsx}',\n './app/**/*.{js,ts,jsx,tsx}',\n './src/**/*.{js,ts,jsx,tsx}',\n './stories/**/*.{js,ts,jsx,tsx}'\n ];\n\n // Log cache loading\n if (options.verbose && cache) {\n console.log('[FrontFriend] Cache loaded successfully');\n if (cache.safelist && Array.isArray(cache.safelist)) {\n console.log(`[FrontFriend] Loading ${cache.safelist.length} classes for safelist`);\n }\n }\n\n return {\n theme: {\n extend: {\n // Extend colors if needed\n colors: options.extendColors || {},\n // Extend animations if needed\n animation: options.extendAnimations || {},\n // Add custom spacing values\n spacing: {\n '18': '4.5rem',\n '88': '22rem',\n '128': '32rem'\n },\n // Add custom box shadows\n boxShadow: {\n 'top-sm': '0 -1px 1px 0 rgba(0, 0, 0, 0.05)'\n },\n // Add border radius values\n borderRadius: {\n '2xl': '1rem'\n },\n // Animation extensions\n animationDelay: ({ theme }) => ({\n ...theme(\"transitionDelay\"),\n }),\n animationDuration: ({ theme }) => ({\n 0: \"0ms\",\n ...theme(\"transitionDuration\"),\n }),\n animationTimingFunction: ({ theme }) => ({\n ...theme(\"transitionTimingFunction\"),\n }),\n animationFillMode: {\n none: \"none\",\n forwards: \"forwards\",\n backwards: \"backwards\",\n both: \"both\",\n },\n animationDirection: {\n normal: \"normal\",\n reverse: \"reverse\",\n alternate: \"alternate\",\n \"alternate-reverse\": \"alternate-reverse\",\n },\n animationOpacity: ({ theme }) => ({\n DEFAULT: 0,\n ...theme(\"opacity\"),\n }),\n animationTranslate: ({ theme }) => ({\n DEFAULT: \"100%\",\n ...theme(\"translate\"),\n }),\n animationScale: ({ theme }) => ({\n DEFAULT: 0,\n ...theme(\"scale\"),\n }),\n animationRotate: ({ theme }) => ({\n DEFAULT: \"30deg\",\n ...theme(\"rotate\"),\n }),\n animationRepeat: {\n 0: \"0\",\n 1: \"1\",\n infinite: \"infinite\",\n },\n keyframes: {\n enter: {\n from: {\n opacity: \"var(--tw-enter-opacity, 1)\",\n transform:\n \"translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0) scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))\",\n },\n },\n exit: {\n to: {\n opacity: \"var(--tw-exit-opacity, 1)\",\n transform:\n \"translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))\",\n },\n },\n },\n }\n },\n // Include safelist from cache and additional classes\n safelist: [\n ...(cache?.safelist || []),\n {\n pattern: /(text|fill)-icon-(neutral|positive|negative|warning|info|highlight|interactive|brand|inverse|onpositive|onnegative|onwarning|oninfo|onhighlight|oninteractive|onbrand)-(mid|strong|subtle|low)(-(neutral|hover|active|selected|disabled))?$/,\n },\n {\n pattern: /^(layer-(below|surface|raised|popover|dialog|control)|overlay-(mid|strong|subtle|low))$/,\n },\n ],\n // Set content paths - merge options with defaults\n content: options.content || defaultContent\n };\n }\n);\n\n// Default export is the plugin\nmodule.exports = pluginExport;\n\n// Export components config and icons with getter functions\n// This allows dynamic resolution at runtime\n\n// Create getter for config\nObject.defineProperty(module.exports, 'config', {\n get: function () {\n // Check for webpack-injected global variable\n if (typeof __FF_CONFIG__ !== 'undefined') {\n return __FF_CONFIG__;\n }\n\n // Check if we're in a browser environment\n if (typeof window !== 'undefined' && window.__FF_CONFIG__) {\n return window.__FF_CONFIG__;\n }\n\n // Node.js: load from cache\n if (CacheManager) {\n try {\n const cacheManager = new CacheManager(process.cwd());\n if (cacheManager.exists()) {\n const cache = cacheManager.load();\n if (cache) {\n return cache.componentsConfig || null;\n }\n }\n } catch (error) {\n // Config not available\n }\n }\n\n return null;\n }\n});\n\n// Create getter for iconSet\nObject.defineProperty(module.exports, 'iconSet', {\n get: function () {\n // Check for webpack-injected global variable\n if (typeof __FF_ICONS__ !== 'undefined') {\n return __FF_ICONS__;\n }\n\n // Check if we're in a browser environment\n if (typeof window !== 'undefined' && window.__FF_ICONS__) {\n return window.__FF_ICONS__;\n }\n\n // Node.js: load from cache\n if (CacheManager) {\n try {\n const cacheManager = new CacheManager(process.cwd());\n if (cacheManager.exists()) {\n const cache = cacheManager.load();\n if (cache) {\n return cache.icons || null;\n }\n }\n } catch (error) {\n // Icons not available\n }\n }\n\n return null;\n }\n});\n\n// Export ffdc utility\nmodule.exports.ffdc = require('./ffdc.js');"],
5
+ "mappings": "8DAAA,IAAAA,EAAAC,EAAA,CAAAC,GAAAC,IAAA,KAAMC,EAAK,QAAQ,IAAI,EAQvB,SAASC,EAAiBC,EAAU,CAClC,GAAI,CACF,IAAMC,EAAUH,EAAG,aAAaE,EAAU,MAAM,EAChD,OAAO,KAAK,MAAMC,CAAO,CAC3B,OAASC,EAAO,CACd,GAAIA,EAAM,OAAS,SACjB,OAAO,KAET,MAAMA,CACR,CACF,CAQA,SAASC,EAAaH,EAAU,CAC9B,GAAI,CACF,OAAOF,EAAG,aAAaE,EAAU,MAAM,CACzC,OAASE,EAAO,CACd,GAAIA,EAAM,OAAS,SACjB,OAAO,KAET,MAAMA,CACR,CACF,CAQA,SAASE,EAAcJ,EAAUK,EAAMC,EAAS,EAAG,CACjD,IAAML,EAAU,KAAK,UAAUI,EAAM,KAAMC,CAAM,EACjDR,EAAG,cAAcE,EAAUC,EAAS,MAAM,CAC5C,CAOA,SAASM,EAAuBP,EAAUK,EAAM,CAE9C,GAAIA,GAAS,MACR,OAAOA,GAAS,UAAY,OAAO,KAAKA,CAAI,EAAE,SAAW,GACzD,MAAM,QAAQA,CAAI,GAAKA,EAAK,SAAW,EAAI,CAE9C,IAAMJ,EAAU,oBADK,MAAM,QAAQI,CAAI,EAAI,KAAO,IACF,IAChDP,EAAG,cAAcE,EAAUC,EAAS,MAAM,CAC5C,KAAO,CACL,IAAMA,EAAU,oBAAoB,KAAK,UAAUI,EAAM,KAAM,CAAC,CAAC,IACjEP,EAAG,cAAcE,EAAUC,EAAS,MAAM,CAC5C,CACF,CAOA,SAASO,EAAWR,EAAU,CAC5B,OAAOF,EAAG,WAAWE,CAAQ,CAC/B,CAMA,SAASS,EAAsBC,EAAS,CACt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,CACF,EACA,KAAM,CACJ,GAAI,CACF,QAAS,4BACT,UACE,kMACJ,CACF,CACF,CACF,CACF,EAEA,SAAU,CACR,IAAIG,GAAA,YAAAA,EAAO,WAAY,CAAC,EACxB,CACE,QAAS,6OACX,EACA,CACE,QAAS,yFACX,CACF,EAEA,QAASN,EAAQ,SAAW6B,CAC9B,CACF,CACF,EAGA,OAAO,QAAU9B,GAMjB,OAAO,eAAe,OAAO,QAAS,SAAU,CAC9C,IAAK,UAAY,CAEf,GAAI,OAAO,cAAkB,IAC3B,OAAO,cAIT,GAAI,OAAO,OAAW,KAAe,OAAO,cAC1C,OAAO,OAAO,cAIhB,GAAIL,EACF,GAAI,CACF,IAAMW,EAAe,IAAIX,EAAa,QAAQ,IAAI,CAAC,EACnD,GAAIW,EAAa,OAAO,EAAG,CACzB,IAAMC,EAAQD,EAAa,KAAK,EAChC,GAAIC,EACF,OAAOA,EAAM,kBAAoB,IAErC,CACF,MAAgB,CAEhB,CAGF,OAAO,IACT,CACF,CAAC,EAGD,OAAO,eAAe,OAAO,QAAS,UAAW,CAC/C,IAAK,UAAY,CAEf,GAAI,OAAO,aAAiB,IAC1B,OAAO,aAIT,GAAI,OAAO,OAAW,KAAe,OAAO,aAC1C,OAAO,OAAO,aAIhB,GAAIZ,EACF,GAAI,CACF,IAAMW,EAAe,IAAIX,EAAa,QAAQ,IAAI,CAAC,EACnD,GAAIW,EAAa,OAAO,EAAG,CACzB,IAAMC,EAAQD,EAAa,KAAK,EAChC,GAAIC,EACF,OAAOA,EAAM,OAAS,IAE1B,CACF,MAAgB,CAEhB,CAGF,OAAO,IACT,CACF,CAAC,EAGD,OAAO,QAAQ,KAAO",
6
+ "names": ["require_file_utils", "__commonJSMin", "exports", "module", "fs", "readJsonFileSafe", "filepath", "content", "error", "readFileSafe", "writeJsonFile", "data", "indent", "writeModuleExportsFile", "fileExists", "ensureDirectoryExists", "dirpath", "removeDirectory", "require_package", "__commonJSMin", "exports", "module", "require_main", "__commonJSMin", "exports", "module", "fs", "path", "os", "crypto", "packageJson", "version", "LINE", "parse", "src", "obj", "lines", "match", "key", "value", "maybeQuote", "_parseVault", "options", "vaultPath", "_vaultPath", "result", "DotenvModule", "err", "keys", "_dotenvKey", "length", "decrypted", "i", "attrs", "_instructions", "error", "_warn", "message", "_debug", "_log", "dotenvKey", "uri", "environment", "environmentKey", "ciphertext", "possibleVaultPath", "filepath", "_resolveHome", "envPath", "_configVault", "debug", "quiet", "parsed", "processEnv", "configDotenv", "dotenvPath", "encoding", "optionPaths", "lastError", "parsedAll", "e", "keysCount", "shortPaths", "filePath", "relative", "config", "decrypt", "encrypted", "keyStr", "nonce", "authTag", "aesgcm", "isRange", "invalidKeyLength", "decryptionFailed", "populate", "override", "require_env_utils", "__commonJSMin", "exports", "module", "path", "fileExists", "loadEnvLocal", "cwd", "envLocalPath", "getEnvVar", "name", "defaultValue", "isEnvTrue", "require_ffdc", "__commonJSMin", "exports", "module", "config", "plugin", "postcss", "CacheManager", "loadEnvLocal", "filterDefault", "values", "key", "pluginExport", "options", "addBase", "addUtilities", "theme", "matchUtilities", "cacheManager", "cache", "rootVars", "value", "darkVars", "semanticUtilities", "cssVar", "match", "prefix", "name", "className", "bgUtilities", "textUtilities", "borderUtilities", "fillUtilities", "textIconUtilities", "fontUtilities", "fontFace", "rawCss", "root", "baseNodes", "utilityNodes", "node", "error", "defaultContent"]
7
7
  }
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- var o=typeof window<"u"&&typeof window.document<"u",c=typeof process<"u"&&process.versions&&process.versions.node,s=function(){return o&&console.warn("[FrontFriend] The Tailwind plugin cannot be used directly in browser environments"),{}};function d(e){return!e||typeof e!="object"?new Proxy({},{get(n,_){return new Proxy({},{get(i,f){return new Proxy({},{get(){return""}})}})}}):e}var r=null,t=null;function F(){if(typeof __FF_CONFIG__<"u")return __FF_CONFIG__;if(typeof process<"u"&&process.env&&process.env.__FF_CONFIG__)try{return JSON.parse(process.env.__FF_CONFIG__)}catch{console.warn("[FrontFriend] Failed to parse __FF_CONFIG__ from environment")}return o&&window.__FF_CONFIG__?window.__FF_CONFIG__:null}function u(){if(typeof __FF_ICONS__<"u")return __FF_ICONS__;if(typeof process<"u"&&process.env&&process.env.__FF_ICONS__)try{return JSON.parse(process.env.__FF_ICONS__)}catch{console.warn("[FrontFriend] Failed to parse __FF_ICONS__ from environment")}return o&&window.__FF_ICONS__?window.__FF_ICONS__:null}var p=new Proxy({},{get(e,n){return r||(r=F()),r&&n in r?r[n]:new Proxy({},{get(_,i){return new Proxy({},{get(){return""}})}})}}),w=new Proxy({},{get(e,n){return t||(t=u()),t&&n in t?t[n]:null}}),l=s;export{p as config,l as default,d as ffdc,w as iconSet};
1
+ var o=typeof window<"u"&&typeof window.document<"u",u=typeof process<"u"&&process.versions&&process.versions.node,i=function(){return o&&console.warn("[FrontFriend] The Tailwind plugin cannot be used directly in browser environments"),{}};function p(e){return!e||typeof e!="object"?new Proxy({},{get(n,_){return new Proxy({},{get(F,f){return new Proxy({},{get(){return""}})}})}}):e}var r=null,t=null;function s(){if(typeof __FF_CONFIG__<"u")return __FF_CONFIG__;if(typeof process<"u"&&process.env){if(process.env.NEXT_PUBLIC_FF_CONFIG)try{return JSON.parse(process.env.NEXT_PUBLIC_FF_CONFIG)}catch{console.warn("[FrontFriend] Failed to parse NEXT_PUBLIC_FF_CONFIG from environment")}if(process.env.__FF_CONFIG__)try{return JSON.parse(process.env.__FF_CONFIG__)}catch{console.warn("[FrontFriend] Failed to parse __FF_CONFIG__ from environment")}}return o&&window.__FF_CONFIG__?window.__FF_CONFIG__:null}function c(){if(typeof __FF_ICONS__<"u")return __FF_ICONS__;if(typeof process<"u"&&process.env){if(process.env.NEXT_PUBLIC_FF_ICONS)try{return JSON.parse(process.env.NEXT_PUBLIC_FF_ICONS)}catch{console.warn("[FrontFriend] Failed to parse NEXT_PUBLIC_FF_ICONS from environment")}if(process.env.__FF_ICONS__)try{return JSON.parse(process.env.__FF_ICONS__)}catch{console.warn("[FrontFriend] Failed to parse __FF_ICONS__ from environment")}}return o&&window.__FF_ICONS__?window.__FF_ICONS__:null}var d=new Proxy({},{get(e,n){return r||(r=s()),r&&n in r?r[n]:new Proxy({},{get(_,F){return new Proxy({},{get(){return""}})}})}}),N=new Proxy({},{get(e,n){return t||(t=c()),t&&n in t?t[n]:null}}),a=i;export{d as config,a as default,p as ffdc,N as iconSet};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../index.mjs"],
4
- "sourcesContent": ["// ES Module wrapper for frontfriend-tailwind\n// This file provides ES module exports for browser environments\n\n// Determine environment\nconst isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';\nconst isNode = typeof process !== 'undefined' && process.versions && process.versions.node;\n\n// Default plugin stub for browser\nconst plugin = function() {\n if (isBrowser) {\n console.warn('[FrontFriend] The Tailwind plugin cannot be used directly in browser environments');\n }\n return {};\n};\n\n// The ffdc function - with graceful fallback for SSR\nexport function ffdc(config) {\n // During SSR or initial load, config might not be available yet\n // Return a proxy that provides empty objects/strings for any property access\n if (!config || typeof config !== 'object') {\n return new Proxy({}, {\n get(target, prop) {\n // Return another proxy for nested property access\n return new Proxy({}, {\n get(target2, prop2) {\n // For deeply nested properties, return empty string or another proxy\n return new Proxy({}, {\n get() {\n return '';\n }\n });\n }\n });\n }\n });\n }\n \n return config;\n}\n\n// In browser environments, config and iconSet must be provided by the build system\n// (e.g., Vite plugin, webpack plugin, etc.) or loaded from a global variable\nlet _config = null;\nlet _iconSet = null;\n\n// Function to get config - tries multiple sources\nfunction getConfig() {\n // Try global variable first (webpack DefinePlugin)\n if (typeof __FF_CONFIG__ !== 'undefined') {\n return __FF_CONFIG__;\n }\n // Try environment variable (Turbopack compatibility)\n if (typeof process !== 'undefined' && process.env && process.env.__FF_CONFIG__) {\n try {\n return JSON.parse(process.env.__FF_CONFIG__);\n } catch (e) {\n console.warn('[FrontFriend] Failed to parse __FF_CONFIG__ from environment');\n }\n }\n // Try window global\n if (isBrowser && window.__FF_CONFIG__) {\n return window.__FF_CONFIG__;\n }\n return null;\n}\n\n// Function to get icons - tries multiple sources\nfunction getIcons() {\n // Try global variable first (webpack DefinePlugin)\n if (typeof __FF_ICONS__ !== 'undefined') {\n return __FF_ICONS__;\n }\n // Try environment variable (Turbopack compatibility)\n if (typeof process !== 'undefined' && process.env && process.env.__FF_ICONS__) {\n try {\n return JSON.parse(process.env.__FF_ICONS__);\n } catch (e) {\n console.warn('[FrontFriend] Failed to parse __FF_ICONS__ from environment');\n }\n }\n // Try window global\n if (isBrowser && window.__FF_ICONS__) {\n return window.__FF_ICONS__;\n }\n return null;\n}\n\n// Export config - returns empty object if not loaded\nexport const config = new Proxy({}, {\n get(target, prop) {\n // Try to get config if not already loaded\n if (!_config) {\n _config = getConfig();\n }\n \n if (_config && prop in _config) {\n return _config[prop];\n }\n \n // Return a proxy that provides empty objects for any nested access\n // This prevents errors when accessing nested properties during SSR\n return new Proxy({}, {\n get(target2, prop2) {\n return new Proxy({}, {\n get() {\n return '';\n }\n });\n }\n });\n }\n});\n\n// Export iconSet - returns null if not loaded\nexport const iconSet = new Proxy({}, {\n get(target, prop) {\n // Try to get icons if not already loaded\n if (!_iconSet) {\n _iconSet = getIcons();\n }\n \n if (_iconSet && prop in _iconSet) {\n return _iconSet[prop];\n }\n return null;\n }\n});\n\n// Default export\nexport default plugin;"],
5
- "mappings": "AAIA,IAAMA,EAAY,OAAO,OAAW,KAAe,OAAO,OAAO,SAAa,IACxEC,EAAS,OAAO,QAAY,KAAe,QAAQ,UAAY,QAAQ,SAAS,KAGhFC,EAAS,UAAW,CACxB,OAAIF,GACF,QAAQ,KAAK,mFAAmF,EAE3F,CAAC,CACV,EAGO,SAASG,EAAKC,EAAQ,CAG3B,MAAI,CAACA,GAAU,OAAOA,GAAW,SACxB,IAAI,MAAM,CAAC,EAAG,CACnB,IAAIC,EAAQC,EAAM,CAEhB,OAAO,IAAI,MAAM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frontfriend-tailwind\n// This file provides ES module exports for browser environments\n\n// Determine environment\nconst isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';\nconst isNode = typeof process !== 'undefined' && process.versions && process.versions.node;\n\n// Default plugin stub for browser\nconst plugin = function() {\n if (isBrowser) {\n console.warn('[FrontFriend] The Tailwind plugin cannot be used directly in browser environments');\n }\n return {};\n};\n\n// The ffdc function - with graceful fallback for SSR\nexport function ffdc(config) {\n // During SSR or initial load, config might not be available yet\n // Return a proxy that provides empty objects/strings for any property access\n if (!config || typeof config !== 'object') {\n return new Proxy({}, {\n get(target, prop) {\n // Return another proxy for nested property access\n return new Proxy({}, {\n get(target2, prop2) {\n // For deeply nested properties, return empty string or another proxy\n return new Proxy({}, {\n get() {\n return '';\n }\n });\n }\n });\n }\n });\n }\n \n return config;\n}\n\n// In browser environments, config and iconSet must be provided by the build system\n// (e.g., Vite plugin, webpack plugin, etc.) or loaded from a global variable\nlet _config = null;\nlet _iconSet = null;\n\n// Function to get config - tries multiple sources\nfunction getConfig() {\n // Try global variable first (webpack DefinePlugin)\n if (typeof __FF_CONFIG__ !== 'undefined') {\n return __FF_CONFIG__;\n }\n // Try Next.js environment variable (Turbopack compatibility)\n if (typeof process !== 'undefined' && process.env) {\n // Try NEXT_PUBLIC_ prefixed version first (Next.js requirement)\n if (process.env.NEXT_PUBLIC_FF_CONFIG) {\n try {\n return JSON.parse(process.env.NEXT_PUBLIC_FF_CONFIG);\n } catch (e) {\n console.warn('[FrontFriend] Failed to parse NEXT_PUBLIC_FF_CONFIG from environment');\n }\n }\n // Fallback to __ prefixed version for non-Next.js environments\n if (process.env.__FF_CONFIG__) {\n try {\n return JSON.parse(process.env.__FF_CONFIG__);\n } catch (e) {\n console.warn('[FrontFriend] Failed to parse __FF_CONFIG__ from environment');\n }\n }\n }\n // Try window global\n if (isBrowser && window.__FF_CONFIG__) {\n return window.__FF_CONFIG__;\n }\n return null;\n}\n\n// Function to get icons - tries multiple sources\nfunction getIcons() {\n // Try global variable first (webpack DefinePlugin)\n if (typeof __FF_ICONS__ !== 'undefined') {\n return __FF_ICONS__;\n }\n // Try Next.js environment variable (Turbopack compatibility)\n if (typeof process !== 'undefined' && process.env) {\n // Try NEXT_PUBLIC_ prefixed version first (Next.js requirement)\n if (process.env.NEXT_PUBLIC_FF_ICONS) {\n try {\n return JSON.parse(process.env.NEXT_PUBLIC_FF_ICONS);\n } catch (e) {\n console.warn('[FrontFriend] Failed to parse NEXT_PUBLIC_FF_ICONS from environment');\n }\n }\n // Fallback to __ prefixed version for non-Next.js environments\n if (process.env.__FF_ICONS__) {\n try {\n return JSON.parse(process.env.__FF_ICONS__);\n } catch (e) {\n console.warn('[FrontFriend] Failed to parse __FF_ICONS__ from environment');\n }\n }\n }\n // Try window global\n if (isBrowser && window.__FF_ICONS__) {\n return window.__FF_ICONS__;\n }\n return null;\n}\n\n// Export config - returns empty object if not loaded\nexport const config = new Proxy({}, {\n get(target, prop) {\n // Try to get config if not already loaded\n if (!_config) {\n _config = getConfig();\n }\n \n if (_config && prop in _config) {\n return _config[prop];\n }\n \n // Return a proxy that provides empty objects for any nested access\n // This prevents errors when accessing nested properties during SSR\n return new Proxy({}, {\n get(target2, prop2) {\n return new Proxy({}, {\n get() {\n return '';\n }\n });\n }\n });\n }\n});\n\n// Export iconSet - returns null if not loaded\nexport const iconSet = new Proxy({}, {\n get(target, prop) {\n // Try to get icons if not already loaded\n if (!_iconSet) {\n _iconSet = getIcons();\n }\n \n if (_iconSet && prop in _iconSet) {\n return _iconSet[prop];\n }\n return null;\n }\n});\n\n// Default export\nexport default plugin;"],
5
+ "mappings": "AAIA,IAAMA,EAAY,OAAO,OAAW,KAAe,OAAO,OAAO,SAAa,IACxEC,EAAS,OAAO,QAAY,KAAe,QAAQ,UAAY,QAAQ,SAAS,KAGhFC,EAAS,UAAW,CACxB,OAAIF,GACF,QAAQ,KAAK,mFAAmF,EAE3F,CAAC,CACV,EAGO,SAASG,EAAKC,EAAQ,CAG3B,MAAI,C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G,EACdA,EAAQH,CAAI,EAKd,IAAI,MAAM,CAAC,EAAG,CACnB,IAAIC,EAASC,EAAO,CAClB,OAAO,IAAI,MAAM,CAAC,EAAG,CACnB,KAAM,CACJ,MAAO,EACT,CACF,CAAC,CACH,CACF,CAAC,CACH,CACF,CAAC,EAGYK,EAAU,IAAI,MAAM,CAAC,EAAG,CACnC,IAAIR,EAAQC,EAAM,CAMhB,OAJKI,IACHA,EAAWE,EAAS,GAGlBF,GAAYJ,KAAQI,EACfA,EAASJ,CAAI,EAEf,IACT,CACF,CAAC,EAGMQ,EAAQZ",
6
6
  "names": ["isBrowser", "isNode", "plugin", "ffdc", "config", "target", "prop", "target2", "prop2", "_config", "_iconSet", "getConfig", "getIcons", "iconSet", "frontfriend_tailwind_default"]
7
7
  }
package/dist/next.js CHANGED
@@ -1,2 +1,2 @@
1
- var u=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports);var S=u((X,m)=>{var L="https://app.frontfriend.dev",k="https://tokens-studio-donux.up.railway.app/api",T=".cache/frontfriend",J={JS:["tokens.js","variables.js","semanticVariables.js","semanticDarkVariables.js","safelist.js","custom.js"],JSON:["fonts.json","icons.json","components-config.json","version.json","metadata.json"]},b={FF_ID:"FF_ID",FF_API_URL:"FF_API_URL",FF_USE_LOCAL:"FF_USE_LOCAL"};m.exports={DEFAULT_API_URL:L,LEGACY_API_URL:k,CACHE_DIR_NAME:T,CACHE_TTL_DAYS:7,CACHE_TTL_MS:6048e5,CACHE_FILES:J,ENV_VARS:b}});var C=u((Z,y)=>{var h=class extends Error{constructor(e,t,n){super(e),this.name="APIError",this.statusCode=t,this.url=n,this.code=`API_${t}`}},_=class extends Error{constructor(e,t){super(e),this.name="CacheError",this.operation=t,this.code=`CACHE_${t.toUpperCase()}`}},p=class extends Error{constructor(e,t){super(e),this.name="ConfigError",this.field=t,this.code=`CONFIG_${t.toUpperCase()}`}},d=class extends Error{constructor(e,t){super(e),this.name="ProcessingError",this.token=t,this.code="PROCESSING_ERROR"}};y.exports={APIError:h,CacheError:_,ConfigError:p,ProcessingError:d}});var A=u((ee,E)=>{var c=require("fs");function P(s){try{let e=c.readFileSync(s,"utf8");return JSON.parse(e)}catch(e){if(e.code==="ENOENT")return null;throw e}}function H(s){try{return c.readFileSync(s,"utf8")}catch(e){if(e.code==="ENOENT")return null;throw e}}function R(s,e,t=2){let n=JSON.stringify(e,null,t);c.writeFileSync(s,n,"utf8")}function M(s,e){if(e==null||typeof e=="object"&&Object.keys(e).length===0||Array.isArray(e)&&e.length===0){let n=`module.exports = ${Array.isArray(e)?"[]":"{}"};`;c.writeFileSync(s,n,"utf8")}else{let t=`module.exports = ${JSON.stringify(e,null,2)};`;c.writeFileSync(s,t,"utf8")}}function U(s){return c.existsSync(s)}function $(s){c.mkdirSync(s,{recursive:!0})}function V(s){c.rmSync(s,{recursive:!0,force:!0})}E.exports={readJsonFileSafe:P,readFileSafe:H,writeJsonFile:R,writeModuleExportsFile:M,fileExists:U,ensureDirectoryExists:$,removeDirectory:V}});var v=u((te,O)=>{var a=require("path"),{CACHE_DIR_NAME:q,CACHE_TTL_MS:G,CACHE_FILES:j}=S(),{CacheError:D}=C(),{readJsonFileSafe:w,readFileSafe:Y,writeJsonFile:x,writeModuleExportsFile:N,fileExists:g,ensureDirectoryExists:z,removeDirectory:B}=A(),F=class{constructor(e=process.cwd()){this.appRoot=e,this.cacheDir=a.join(e,"node_modules",q),this.metadataFile=a.join(this.cacheDir,"metadata.json"),this.maxAge=G}getCacheDir(){return this.cacheDir}exists(){return g(this.cacheDir)}isValid(){if(!this.exists())return!1;try{let e=w(this.metadataFile);if(!e)return!1;let t=new Date(e.timestamp).getTime();return Date.now()-t<this.maxAge}catch{return!1}}load(){if(!this.exists())return null;try{let e={};for(let t of j.JS){let n=a.join(this.cacheDir,t);if(g(n)){let r=t.replace(".js","");try{let o=Y(n);if(o!==null){let l={},i={exports:l};new Function("module","exports",o)(i,l),e[r]=i.exports}}catch{}}}for(let t of j.JSON){let n=a.join(this.cacheDir,t),r=t.replace(".json",""),o=w(n);o!==null&&(e[r]=o)}return e["components-config"]&&(e.componentsConfig=e["components-config"],delete e["components-config"]),e.cls&&!e.safelist&&(e.safelist=e.cls,delete e.cls),e}catch(e){throw new D(`Failed to load cache: ${e.message}`,"read")}}save(e){var t,n;try{z(this.cacheDir);let r={timestamp:new Date().toISOString(),version:((t=e.metadata)==null?void 0:t.version)||"2.0.0",ffId:(n=e.metadata)==null?void 0:n.ffId};x(this.metadataFile,r);let o=["tokens","variables","semanticVariables","semanticDarkVariables","safelist","custom"];for(let i of o)if(e[i]!==void 0){let f=a.join(this.cacheDir,`${i}.js`);N(f,e[i])}if(e.safelist&&Array.isArray(e.safelist)){let i=a.join(this.cacheDir,"safelist.js");N(i,e.safelist)}let l={fonts:e.fonts,icons:e.icons||e.iconSet,"components-config":e.componentsConfig,version:e.version};for(let[i,f]of Object.entries(l))if(f!==void 0){let I=a.join(this.cacheDir,`${i}.json`);x(I,f)}}catch(r){throw new D(`Failed to save cache: ${r.message}`,"write")}}clear(){this.exists()&&B(this.cacheDir)}};O.exports=F});var K=v();function Q(s={}){let e=new K(process.cwd()),t=null;return e.exists()?t=e.load():console.warn('[FrontFriend Next.js] No cache found. Please run "npx frontfriend init" first.'),{...s,env:{...s.env,__FF_CONFIG__:t?JSON.stringify(t.componentsConfig||null):"null",__FF_ICONS__:t?JSON.stringify(t.icons||null):"null"},webpack:(n,r)=>{if(typeof s.webpack=="function"&&(n=s.webpack(n,r)),!t)return n;let{webpack:o}=r,l=o.DefinePlugin,i={__FF_CONFIG__:JSON.stringify(t.componentsConfig||null),__FF_ICONS__:JSON.stringify(t.icons||null)};return n.plugins=n.plugins||[],n.plugins.push(new l(i)),r.dev&&!r.isServer&&console.log("[FrontFriend Next.js] Injected configuration and icons into client build"),n}}}module.exports=Q;
1
+ var u=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports);var S=u((W,m)=>{var L="https://app.frontfriend.dev",T="https://tokens-studio-donux.up.railway.app/api",k=".cache/frontfriend",P={JS:["tokens.js","variables.js","semanticVariables.js","semanticDarkVariables.js","safelist.js","custom.js"],JSON:["fonts.json","icons.json","components-config.json","version.json","metadata.json"]},J={FF_ID:"FF_ID",FF_API_URL:"FF_API_URL",FF_USE_LOCAL:"FF_USE_LOCAL"};m.exports={DEFAULT_API_URL:L,LEGACY_API_URL:T,CACHE_DIR_NAME:k,CACHE_TTL_DAYS:7,CACHE_TTL_MS:6048e5,CACHE_FILES:P,ENV_VARS:J}});var C=u((Z,y)=>{var h=class extends Error{constructor(e,t,n){super(e),this.name="APIError",this.statusCode=t,this.url=n,this.code=`API_${t}`}},p=class extends Error{constructor(e,t){super(e),this.name="CacheError",this.operation=t,this.code=`CACHE_${t.toUpperCase()}`}},_=class extends Error{constructor(e,t){super(e),this.name="ConfigError",this.field=t,this.code=`CONFIG_${t.toUpperCase()}`}},d=class extends Error{constructor(e,t){super(e),this.name="ProcessingError",this.token=t,this.code="PROCESSING_ERROR"}};y.exports={APIError:h,CacheError:p,ConfigError:_,ProcessingError:d}});var A=u((ee,E)=>{var c=require("fs");function b(s){try{let e=c.readFileSync(s,"utf8");return JSON.parse(e)}catch(e){if(e.code==="ENOENT")return null;throw e}}function H(s){try{return c.readFileSync(s,"utf8")}catch(e){if(e.code==="ENOENT")return null;throw e}}function R(s,e,t=2){let n=JSON.stringify(e,null,t);c.writeFileSync(s,n,"utf8")}function U(s,e){if(e==null||typeof e=="object"&&Object.keys(e).length===0||Array.isArray(e)&&e.length===0){let n=`module.exports = ${Array.isArray(e)?"[]":"{}"};`;c.writeFileSync(s,n,"utf8")}else{let t=`module.exports = ${JSON.stringify(e,null,2)};`;c.writeFileSync(s,t,"utf8")}}function M(s){return c.existsSync(s)}function $(s){c.mkdirSync(s,{recursive:!0})}function V(s){c.rmSync(s,{recursive:!0,force:!0})}E.exports={readJsonFileSafe:b,readFileSafe:H,writeJsonFile:R,writeModuleExportsFile:U,fileExists:M,ensureDirectoryExists:$,removeDirectory:V}});var O=u((te,I)=>{var a=require("path"),{CACHE_DIR_NAME:q,CACHE_TTL_MS:G,CACHE_FILES:j}=S(),{CacheError:D}=C(),{readJsonFileSafe:w,readFileSafe:Y,writeJsonFile:x,writeModuleExportsFile:N,fileExists:g,ensureDirectoryExists:B,removeDirectory:X}=A(),F=class{constructor(e=process.cwd()){this.appRoot=e,this.cacheDir=a.join(e,"node_modules",q),this.metadataFile=a.join(this.cacheDir,"metadata.json"),this.maxAge=G}getCacheDir(){return this.cacheDir}exists(){return g(this.cacheDir)}isValid(){if(!this.exists())return!1;try{let e=w(this.metadataFile);if(!e)return!1;let t=new Date(e.timestamp).getTime();return Date.now()-t<this.maxAge}catch{return!1}}load(){if(!this.exists())return null;try{let e={};for(let t of j.JS){let n=a.join(this.cacheDir,t);if(g(n)){let r=t.replace(".js","");try{let o=Y(n);if(o!==null){let l={},i={exports:l};new Function("module","exports",o)(i,l),e[r]=i.exports}}catch{}}}for(let t of j.JSON){let n=a.join(this.cacheDir,t),r=t.replace(".json",""),o=w(n);o!==null&&(e[r]=o)}return e["components-config"]&&(e.componentsConfig=e["components-config"],delete e["components-config"]),e.cls&&!e.safelist&&(e.safelist=e.cls,delete e.cls),e}catch(e){throw new D(`Failed to load cache: ${e.message}`,"read")}}save(e){var t,n;try{B(this.cacheDir);let r={timestamp:new Date().toISOString(),version:((t=e.metadata)==null?void 0:t.version)||"2.0.0",ffId:(n=e.metadata)==null?void 0:n.ffId};x(this.metadataFile,r);let o=["tokens","variables","semanticVariables","semanticDarkVariables","safelist","custom"];for(let i of o)if(e[i]!==void 0){let f=a.join(this.cacheDir,`${i}.js`);N(f,e[i])}if(e.safelist&&Array.isArray(e.safelist)){let i=a.join(this.cacheDir,"safelist.js");N(i,e.safelist)}let l={fonts:e.fonts,icons:e.icons||e.iconSet,"components-config":e.componentsConfig,version:e.version};for(let[i,f]of Object.entries(l))if(f!==void 0){let v=a.join(this.cacheDir,`${i}.json`);x(v,f)}}catch(r){throw new D(`Failed to save cache: ${r.message}`,"write")}}clear(){this.exists()&&X(this.cacheDir)}};I.exports=F});var z=O();function K(s={}){let e=new z(process.cwd()),t=null;return e.exists()?t=e.load():console.warn('[FrontFriend Next.js] No cache found. Please run "npx frontfriend init" first.'),{...s,env:{...s.env,NEXT_PUBLIC_FF_CONFIG:t?JSON.stringify(t.componentsConfig||null):"null",NEXT_PUBLIC_FF_ICONS:t?JSON.stringify(t.icons||null):"null"},webpack:(n,r)=>{if(typeof s.webpack=="function"&&(n=s.webpack(n,r)),!t)return n;let{webpack:o}=r,l=o.DefinePlugin,i={__FF_CONFIG__:JSON.stringify(t.componentsConfig||null),__FF_ICONS__:JSON.stringify(t.icons||null)};return n.plugins=n.plugins||[],n.plugins.push(new l(i)),r.dev&&!r.isServer&&console.log("[FrontFriend Next.js] Injected configuration and icons into client build"),n}}}module.exports=K;
2
2
  //# sourceMappingURL=next.js.map
package/dist/next.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../lib/core/constants.js", "../lib/core/errors.js", "../lib/core/file-utils.js", "../lib/core/cache-manager.js", "../next.js"],
4
- "sourcesContent": ["/**\n * Configuration constants for FrontFriend Tailwind v2\n */\n\n// API Configuration\nconst DEFAULT_API_URL = 'https://app.frontfriend.dev';\nconst LEGACY_API_URL = 'https://tokens-studio-donux.up.railway.app/api';\n\n// Cache Configuration\nconst CACHE_DIR_NAME = '.cache/frontfriend';\nconst CACHE_TTL_DAYS = 7;\nconst CACHE_TTL_MS = CACHE_TTL_DAYS * 24 * 60 * 60 * 1000;\n\n// File names\nconst CACHE_FILES = {\n JS: [\n 'tokens.js',\n 'variables.js',\n 'semanticVariables.js',\n 'semanticDarkVariables.js',\n 'safelist.js',\n 'custom.js'\n ],\n JSON: [\n 'fonts.json',\n 'icons.json',\n 'components-config.json',\n 'version.json',\n 'metadata.json'\n ]\n};\n\n// Environment variables\nconst ENV_VARS = {\n FF_ID: 'FF_ID',\n FF_API_URL: 'FF_API_URL',\n FF_USE_LOCAL: 'FF_USE_LOCAL'\n};\n\nmodule.exports = {\n DEFAULT_API_URL,\n LEGACY_API_URL,\n CACHE_DIR_NAME,\n CACHE_TTL_DAYS,\n CACHE_TTL_MS,\n CACHE_FILES,\n ENV_VARS\n};", "class APIError extends Error {\n constructor(message, statusCode, url) {\n super(message);\n this.name = 'APIError';\n this.statusCode = statusCode;\n this.url = url;\n this.code = `API_${statusCode}`;\n }\n}\n\nclass CacheError extends Error {\n constructor(message, operation) {\n super(message);\n this.name = 'CacheError';\n this.operation = operation;\n this.code = `CACHE_${operation.toUpperCase()}`;\n }\n}\n\nclass ConfigError extends Error {\n constructor(message, field) {\n super(message);\n this.name = 'ConfigError';\n this.field = field;\n this.code = `CONFIG_${field.toUpperCase()}`;\n }\n}\n\nclass ProcessingError extends Error {\n constructor(message, token) {\n super(message);\n this.name = 'ProcessingError';\n this.token = token;\n this.code = 'PROCESSING_ERROR';\n }\n}\n\nmodule.exports = {\n APIError,\n CacheError,\n ConfigError,\n ProcessingError\n};", "const fs = require('fs');\n\n/**\n * Read a JSON file safely, returning null if file doesn't exist\n * @param {string} filepath - Path to the JSON file\n * @returns {Object|null} Parsed JSON or null if file not found\n * @throws {Error} If JSON is invalid\n */\nfunction readJsonFileSafe(filepath) {\n try {\n const content = fs.readFileSync(filepath, 'utf8');\n return JSON.parse(content);\n } catch (error) {\n if (error.code === 'ENOENT') {\n return null; // File not found, return null like API would return 404\n }\n throw error;\n }\n}\n\n/**\n * Read a file safely, returning null if file doesn't exist\n * @param {string} filepath - Path to the file\n * @returns {string|null} File content or null if file not found\n * @throws {Error} For other file system errors\n */\nfunction readFileSafe(filepath) {\n try {\n return fs.readFileSync(filepath, 'utf8');\n } catch (error) {\n if (error.code === 'ENOENT') {\n return null; // File not found\n }\n throw error;\n }\n}\n\n/**\n * Write JSON data to a file with proper formatting\n * @param {string} filepath - Path to write the file\n * @param {Object} data - Data to write\n * @param {number} indent - Indentation level (default: 2)\n */\nfunction writeJsonFile(filepath, data, indent = 2) {\n const content = JSON.stringify(data, null, indent);\n fs.writeFileSync(filepath, content, 'utf8');\n}\n\n/**\n * Write module.exports file with JSON data\n * @param {string} filepath - Path to write the file\n * @param {Object} data - Data to export\n */\nfunction writeModuleExportsFile(filepath, data) {\n // Handle empty data cases\n if (data === null || data === undefined || \n (typeof data === 'object' && Object.keys(data).length === 0) ||\n (Array.isArray(data) && data.length === 0)) {\n const emptyContent = Array.isArray(data) ? '[]' : '{}';\n const content = `module.exports = ${emptyContent};`;\n fs.writeFileSync(filepath, content, 'utf8');\n } else {\n const content = `module.exports = ${JSON.stringify(data, null, 2)};`;\n fs.writeFileSync(filepath, content, 'utf8');\n }\n}\n\n/**\n * Check if a file exists\n * @param {string} filepath - Path to check\n * @returns {boolean} True if file exists\n */\nfunction fileExists(filepath) {\n return fs.existsSync(filepath);\n}\n\n/**\n * Create directory recursively\n * @param {string} dirpath - Directory path to create\n */\nfunction ensureDirectoryExists(dirpath) {\n fs.mkdirSync(dirpath, { recursive: true });\n}\n\n/**\n * Remove directory recursively\n * @param {string} dirpath - Directory path to remove\n */\nfunction removeDirectory(dirpath) {\n fs.rmSync(dirpath, { recursive: true, force: true });\n}\n\nmodule.exports = {\n readJsonFileSafe,\n readFileSafe,\n writeJsonFile,\n writeModuleExportsFile,\n fileExists,\n ensureDirectoryExists,\n removeDirectory\n};", "const path = require('path');\nconst { CACHE_DIR_NAME, CACHE_TTL_MS, CACHE_FILES } = require('./constants');\nconst { CacheError } = require('./errors');\nconst { readJsonFileSafe, readFileSafe, writeJsonFile, writeModuleExportsFile, fileExists, ensureDirectoryExists, removeDirectory } = require('./file-utils');\n\nclass CacheManager {\n constructor(appRoot = process.cwd()) {\n this.appRoot = appRoot;\n this.cacheDir = path.join(appRoot, 'node_modules', CACHE_DIR_NAME);\n this.metadataFile = path.join(this.cacheDir, 'metadata.json');\n this.maxAge = CACHE_TTL_MS;\n }\n\n /**\n * Get the cache directory path\n * @returns {string} Cache directory path\n */\n getCacheDir() {\n return this.cacheDir;\n }\n\n /**\n * Check if cache directory exists\n * @returns {boolean} True if cache exists\n */\n exists() {\n return fileExists(this.cacheDir);\n }\n\n /**\n * Check if cache is valid (exists and not expired)\n * @returns {boolean} True if cache is valid\n */\n isValid() {\n if (!this.exists()) {\n return false;\n }\n\n try {\n const metadata = readJsonFileSafe(this.metadataFile);\n if (!metadata) {\n return false;\n }\n\n const timestamp = new Date(metadata.timestamp).getTime();\n const now = Date.now();\n \n return (now - timestamp) < this.maxAge;\n } catch (error) {\n return false;\n }\n }\n\n /**\n * Load all cached data\n * @returns {Object|null} Cached data object or null if not found\n */\n load() {\n if (!this.exists()) {\n return null;\n }\n\n try {\n const data = {};\n \n // Load all .js files\n for (const file of CACHE_FILES.JS) {\n const filePath = path.join(this.cacheDir, file);\n if (fileExists(filePath)) {\n // Remove .js extension for key\n const key = file.replace('.js', '');\n try {\n // Use a more secure approach - parse the exported data\n const content = readFileSafe(filePath);\n if (content !== null) {\n // Create a safe evaluation context\n const moduleExports = {};\n const fakeModule = { exports: moduleExports };\n \n // Use Function constructor to evaluate in isolated scope\n const evalFunc = new Function('module', 'exports', content);\n evalFunc(fakeModule, moduleExports);\n \n data[key] = fakeModule.exports;\n }\n } catch (e) {\n // Skip files that can't be parsed\n }\n }\n }\n\n // Load all .json files\n for (const file of CACHE_FILES.JSON) {\n const filePath = path.join(this.cacheDir, file);\n const key = file.replace('.json', '');\n const content = readJsonFileSafe(filePath);\n if (content !== null) {\n data[key] = content;\n }\n }\n\n // Rename components-config to componentsConfig for consistency\n if (data['components-config']) {\n data.componentsConfig = data['components-config'];\n delete data['components-config'];\n }\n\n // Backward compatibility: rename cls to safelist if present\n if (data.cls && !data.safelist) {\n data.safelist = data.cls;\n delete data.cls;\n }\n\n return data;\n } catch (error) {\n throw new CacheError(`Failed to load cache: ${error.message}`, 'read');\n }\n }\n\n /**\n * Save data to cache\n * @param {Object} data - Data object to save\n * @throws {Error} If save operation fails\n */\n save(data) {\n try {\n // Create cache directory\n ensureDirectoryExists(this.cacheDir);\n\n // Save metadata first\n const metadata = {\n timestamp: new Date().toISOString(),\n version: data.metadata?.version || '2.0.0',\n ffId: data.metadata?.ffId\n };\n writeJsonFile(this.metadataFile, metadata);\n\n // Save .js files\n const jsFiles = [\n 'tokens',\n 'variables',\n 'semanticVariables',\n 'semanticDarkVariables',\n 'safelist',\n 'custom'\n ];\n\n for (const key of jsFiles) {\n if (data[key] !== undefined) {\n const filePath = path.join(this.cacheDir, `${key}.js`);\n writeModuleExportsFile(filePath, data[key]);\n }\n }\n \n // Also check for safelist specifically since it might be an array\n if (data.safelist && Array.isArray(data.safelist)) {\n const safelistPath = path.join(this.cacheDir, 'safelist.js');\n writeModuleExportsFile(safelistPath, data.safelist);\n }\n\n // Save .json files\n const jsonData = {\n fonts: data.fonts,\n icons: data.icons || data.iconSet,\n 'components-config': data.componentsConfig,\n version: data.version\n };\n\n for (const [key, value] of Object.entries(jsonData)) {\n if (value !== undefined) {\n const filePath = path.join(this.cacheDir, `${key}.json`);\n writeJsonFile(filePath, value);\n }\n }\n } catch (error) {\n throw new CacheError(`Failed to save cache: ${error.message}`, 'write');\n }\n }\n\n /**\n * Clear the cache directory\n */\n clear() {\n if (this.exists()) {\n removeDirectory(this.cacheDir);\n }\n }\n}\n\nmodule.exports = CacheManager;", "const CacheManager = require('./lib/core/cache-manager');\n\nfunction frontfriend(nextConfig = {}) {\n // Load cache once at config time\n const cacheManager = new CacheManager(process.cwd());\n let cache = null;\n\n if (cacheManager.exists()) {\n cache = cacheManager.load();\n } else {\n console.warn('[FrontFriend Next.js] No cache found. Please run \"npx frontfriend init\" first.');\n }\n\n return {\n ...nextConfig,\n // Environment variables work with both webpack and Turbopack\n env: {\n ...nextConfig.env,\n // Inject config as environment variables for Turbopack compatibility\n __FF_CONFIG__: cache ? JSON.stringify(cache.componentsConfig || null) : 'null',\n __FF_ICONS__: cache ? JSON.stringify(cache.icons || null) : 'null',\n },\n webpack: (config, options) => {\n // 1. Call existing webpack config if provided\n if (typeof nextConfig.webpack === 'function') {\n config = nextConfig.webpack(config, options);\n }\n\n if (!cache) {\n return config;\n }\n\n // 4. Use webpack.DefinePlugin from options (works with both webpack 4 and 5)\n // This is for webpack - Turbopack will use the env vars above\n const { webpack } = options;\n const DefinePlugin = webpack.DefinePlugin;\n\n // 5. Inject __FF_CONFIG__ and __FF_ICONS__ as globals for webpack\n const definitions = {\n __FF_CONFIG__: JSON.stringify(cache.componentsConfig || null),\n __FF_ICONS__: JSON.stringify(cache.icons || null)\n };\n\n // Add DefinePlugin to plugins array\n config.plugins = config.plugins || [];\n config.plugins.push(new DefinePlugin(definitions));\n\n // Log success in development\n if (options.dev && !options.isServer) {\n console.log('[FrontFriend Next.js] Injected configuration and icons into client build');\n }\n\n // 6. Return modified config\n return config;\n }\n };\n}\n\nmodule.exports = frontfriend;"],
5
- "mappings": "8DAAA,IAAAA,EAAAC,EAAA,CAAAC,EAAAC,IAAA,CAKA,IAAMC,EAAkB,8BAClBC,EAAiB,iDAGjBC,EAAiB,qBAKjBC,EAAc,CAClB,GAAI,CACF,YACA,eACA,uBACA,2BACA,cACA,WACF,EACA,KAAM,CACJ,aACA,aACA,yBACA,eACA,eACF,CACF,EAGMC,EAAW,CACf,MAAO,QACP,WAAY,aACZ,aAAc,cAChB,EAEAL,EAAO,QAAU,CACf,gBAAAC,EACA,eAAAC,EACA,eAAAC,EACA,iBACA,oBACA,YAAAC,EACA,SAAAC,CACF,IC/CA,IAAAC,EAAAC,EAAA,CAAAC,EAAAC,IAAA,KAAMC,EAAN,cAAuB,KAAM,CAC3B,YAAYC,EAASC,EAAYC,EAAK,CACpC,MAAMF,CAAO,EACb,KAAK,KAAO,WACZ,KAAK,WAAaC,EAClB,KAAK,IAAMC,EACX,KAAK,KAAO,OAAOD,CAAU,EAC/B,CACF,EAEME,EAAN,cAAyB,KAAM,CAC7B,YAAYH,EAASI,EAAW,CAC9B,MAAMJ,CAAO,EACb,KAAK,KAAO,aACZ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,QAAQ,KAAK,gFAAgF,EAGxF,CACL,GAAGD,EAEH,IAAK,CACH,GAAGA,EAAW,IAEd,cAAeE,EAAQ,KAAK,UAAUA,EAAM,kBAAoB,IAAI,EAAI,OACxE,aAAcA,EAAQ,KAAK,UAAUA,EAAM,OAAS,IAAI,EAAI,MAC9D,EACA,QAAS,CAACC,EAAQC,IAAY,CAM5B,GAJI,OAAOJ,EAAW,SAAY,aAChCG,EAASH,EAAW,QAAQG,EAAQC,CAAO,GAGzC,CAACF,EACH,OAAOC,EAKT,GAAM,CAAE,QAAAE,CAAQ,EAAID,EACdE,EAAeD,EAAQ,aAGvBE,EAAc,CAClB,cAAe,KAAK,UAAUL,EAAM,kBAAoB,IAAI,EAC5D,aAAc,KAAK,UAAUA,EAAM,OAAS,IAAI,CAClD,EAGA,OAAAC,EAAO,QAAUA,EAAO,SAAW,CAAC,EACpCA,EAAO,QAAQ,KAAK,IAAIG,EAAaC,CAAW,CAAC,EAG7CH,EAAQ,KAAO,CAACA,EAAQ,UAC1B,QAAQ,IAAI,0EAA0E,EAIjFD,CACT,CACF,CACF,CAEA,OAAO,QAAUJ",
4
+ "sourcesContent": ["/**\n * Configuration constants for FrontFriend Tailwind v2\n */\n\n// API Configuration\nconst DEFAULT_API_URL = 'https://app.frontfriend.dev';\nconst LEGACY_API_URL = 'https://tokens-studio-donux.up.railway.app/api';\n\n// Cache Configuration\nconst CACHE_DIR_NAME = '.cache/frontfriend';\nconst CACHE_TTL_DAYS = 7;\nconst CACHE_TTL_MS = CACHE_TTL_DAYS * 24 * 60 * 60 * 1000;\n\n// File names\nconst CACHE_FILES = {\n JS: [\n 'tokens.js',\n 'variables.js',\n 'semanticVariables.js',\n 'semanticDarkVariables.js',\n 'safelist.js',\n 'custom.js'\n ],\n JSON: [\n 'fonts.json',\n 'icons.json',\n 'components-config.json',\n 'version.json',\n 'metadata.json'\n ]\n};\n\n// Environment variables\nconst ENV_VARS = {\n FF_ID: 'FF_ID',\n FF_API_URL: 'FF_API_URL',\n FF_USE_LOCAL: 'FF_USE_LOCAL'\n};\n\nmodule.exports = {\n DEFAULT_API_URL,\n LEGACY_API_URL,\n CACHE_DIR_NAME,\n CACHE_TTL_DAYS,\n CACHE_TTL_MS,\n CACHE_FILES,\n ENV_VARS\n};", "class APIError extends Error {\n constructor(message, statusCode, url) {\n super(message);\n this.name = 'APIError';\n this.statusCode = statusCode;\n this.url = url;\n this.code = `API_${statusCode}`;\n }\n}\n\nclass CacheError extends Error {\n constructor(message, operation) {\n super(message);\n this.name = 'CacheError';\n this.operation = operation;\n this.code = `CACHE_${operation.toUpperCase()}`;\n }\n}\n\nclass ConfigError extends Error {\n constructor(message, field) {\n super(message);\n this.name = 'ConfigError';\n this.field = field;\n this.code = `CONFIG_${field.toUpperCase()}`;\n }\n}\n\nclass ProcessingError extends Error {\n constructor(message, token) {\n super(message);\n this.name = 'ProcessingError';\n this.token = token;\n this.code = 'PROCESSING_ERROR';\n }\n}\n\nmodule.exports = {\n APIError,\n CacheError,\n ConfigError,\n ProcessingError\n};", "const fs = require('fs');\n\n/**\n * Read a JSON file safely, returning null if file doesn't exist\n * @param {string} filepath - Path to the JSON file\n * @returns {Object|null} Parsed JSON or null if file not found\n * @throws {Error} If JSON is invalid\n */\nfunction readJsonFileSafe(filepath) {\n try {\n const content = fs.readFileSync(filepath, 'utf8');\n return JSON.parse(content);\n } catch (error) {\n if (error.code === 'ENOENT') {\n return null; // File not found, return null like API would return 404\n }\n throw error;\n }\n}\n\n/**\n * Read a file safely, returning null if file doesn't exist\n * @param {string} filepath - Path to the file\n * @returns {string|null} File content or null if file not found\n * @throws {Error} For other file system errors\n */\nfunction readFileSafe(filepath) {\n try {\n return fs.readFileSync(filepath, 'utf8');\n } catch (error) {\n if (error.code === 'ENOENT') {\n return null; // File not found\n }\n throw error;\n }\n}\n\n/**\n * Write JSON data to a file with proper formatting\n * @param {string} filepath - Path to write the file\n * @param {Object} data - Data to write\n * @param {number} indent - Indentation level (default: 2)\n */\nfunction writeJsonFile(filepath, data, indent = 2) {\n const content = JSON.stringify(data, null, indent);\n fs.writeFileSync(filepath, content, 'utf8');\n}\n\n/**\n * Write module.exports file with JSON data\n * @param {string} filepath - Path to write the file\n * @param {Object} data - Data to export\n */\nfunction writeModuleExportsFile(filepath, data) {\n // Handle empty data cases\n if (data === null || data === undefined || \n (typeof data === 'object' && Object.keys(data).length === 0) ||\n (Array.isArray(data) && data.length === 0)) {\n const emptyContent = Array.isArray(data) ? '[]' : '{}';\n const content = `module.exports = ${emptyContent};`;\n fs.writeFileSync(filepath, content, 'utf8');\n } else {\n const content = `module.exports = ${JSON.stringify(data, null, 2)};`;\n fs.writeFileSync(filepath, content, 'utf8');\n }\n}\n\n/**\n * Check if a file exists\n * @param {string} filepath - Path to check\n * @returns {boolean} True if file exists\n */\nfunction fileExists(filepath) {\n return fs.existsSync(filepath);\n}\n\n/**\n * Create directory recursively\n * @param {string} dirpath - Directory path to create\n */\nfunction ensureDirectoryExists(dirpath) {\n fs.mkdirSync(dirpath, { recursive: true });\n}\n\n/**\n * Remove directory recursively\n * @param {string} dirpath - Directory path to remove\n */\nfunction removeDirectory(dirpath) {\n fs.rmSync(dirpath, { recursive: true, force: true });\n}\n\nmodule.exports = {\n readJsonFileSafe,\n readFileSafe,\n writeJsonFile,\n writeModuleExportsFile,\n fileExists,\n ensureDirectoryExists,\n removeDirectory\n};", "const path = require('path');\nconst { CACHE_DIR_NAME, CACHE_TTL_MS, CACHE_FILES } = require('./constants');\nconst { CacheError } = require('./errors');\nconst { readJsonFileSafe, readFileSafe, writeJsonFile, writeModuleExportsFile, fileExists, ensureDirectoryExists, removeDirectory } = require('./file-utils');\n\nclass CacheManager {\n constructor(appRoot = process.cwd()) {\n this.appRoot = appRoot;\n this.cacheDir = path.join(appRoot, 'node_modules', CACHE_DIR_NAME);\n this.metadataFile = path.join(this.cacheDir, 'metadata.json');\n this.maxAge = CACHE_TTL_MS;\n }\n\n /**\n * Get the cache directory path\n * @returns {string} Cache directory path\n */\n getCacheDir() {\n return this.cacheDir;\n }\n\n /**\n * Check if cache directory exists\n * @returns {boolean} True if cache exists\n */\n exists() {\n return fileExists(this.cacheDir);\n }\n\n /**\n * Check if cache is valid (exists and not expired)\n * @returns {boolean} True if cache is valid\n */\n isValid() {\n if (!this.exists()) {\n return false;\n }\n\n try {\n const metadata = readJsonFileSafe(this.metadataFile);\n if (!metadata) {\n return false;\n }\n\n const timestamp = new Date(metadata.timestamp).getTime();\n const now = Date.now();\n \n return (now - timestamp) < this.maxAge;\n } catch (error) {\n return false;\n }\n }\n\n /**\n * Load all cached data\n * @returns {Object|null} Cached data object or null if not found\n */\n load() {\n if (!this.exists()) {\n return null;\n }\n\n try {\n const data = {};\n \n // Load all .js files\n for (const file of CACHE_FILES.JS) {\n const filePath = path.join(this.cacheDir, file);\n if (fileExists(filePath)) {\n // Remove .js extension for key\n const key = file.replace('.js', '');\n try {\n // Use a more secure approach - parse the exported data\n const content = readFileSafe(filePath);\n if (content !== null) {\n // Create a safe evaluation context\n const moduleExports = {};\n const fakeModule = { exports: moduleExports };\n \n // Use Function constructor to evaluate in isolated scope\n const evalFunc = new Function('module', 'exports', content);\n evalFunc(fakeModule, moduleExports);\n \n data[key] = fakeModule.exports;\n }\n } catch (e) {\n // Skip files that can't be parsed\n }\n }\n }\n\n // Load all .json files\n for (const file of CACHE_FILES.JSON) {\n const filePath = path.join(this.cacheDir, file);\n const key = file.replace('.json', '');\n const content = readJsonFileSafe(filePath);\n if (content !== null) {\n data[key] = content;\n }\n }\n\n // Rename components-config to componentsConfig for consistency\n if (data['components-config']) {\n data.componentsConfig = data['components-config'];\n delete data['components-config'];\n }\n\n // Backward compatibility: rename cls to safelist if present\n if (data.cls && !data.safelist) {\n data.safelist = data.cls;\n delete data.cls;\n }\n\n return data;\n } catch (error) {\n throw new CacheError(`Failed to load cache: ${error.message}`, 'read');\n }\n }\n\n /**\n * Save data to cache\n * @param {Object} data - Data object to save\n * @throws {Error} If save operation fails\n */\n save(data) {\n try {\n // Create cache directory\n ensureDirectoryExists(this.cacheDir);\n\n // Save metadata first\n const metadata = {\n timestamp: new Date().toISOString(),\n version: data.metadata?.version || '2.0.0',\n ffId: data.metadata?.ffId\n };\n writeJsonFile(this.metadataFile, metadata);\n\n // Save .js files\n const jsFiles = [\n 'tokens',\n 'variables',\n 'semanticVariables',\n 'semanticDarkVariables',\n 'safelist',\n 'custom'\n ];\n\n for (const key of jsFiles) {\n if (data[key] !== undefined) {\n const filePath = path.join(this.cacheDir, `${key}.js`);\n writeModuleExportsFile(filePath, data[key]);\n }\n }\n \n // Also check for safelist specifically since it might be an array\n if (data.safelist && Array.isArray(data.safelist)) {\n const safelistPath = path.join(this.cacheDir, 'safelist.js');\n writeModuleExportsFile(safelistPath, data.safelist);\n }\n\n // Save .json files\n const jsonData = {\n fonts: data.fonts,\n icons: data.icons || data.iconSet,\n 'components-config': data.componentsConfig,\n version: data.version\n };\n\n for (const [key, value] of Object.entries(jsonData)) {\n if (value !== undefined) {\n const filePath = path.join(this.cacheDir, `${key}.json`);\n writeJsonFile(filePath, value);\n }\n }\n } catch (error) {\n throw new CacheError(`Failed to save cache: ${error.message}`, 'write');\n }\n }\n\n /**\n * Clear the cache directory\n */\n clear() {\n if (this.exists()) {\n removeDirectory(this.cacheDir);\n }\n }\n}\n\nmodule.exports = CacheManager;", "const CacheManager = require('./lib/core/cache-manager');\n\nfunction frontfriend(nextConfig = {}) {\n // Load cache once at config time\n const cacheManager = new CacheManager(process.cwd());\n let cache = null;\n\n if (cacheManager.exists()) {\n cache = cacheManager.load();\n } else {\n console.warn('[FrontFriend Next.js] No cache found. Please run \"npx frontfriend init\" first.');\n }\n\n return {\n ...nextConfig,\n // Environment variables work with both webpack and Turbopack\n env: {\n ...nextConfig.env,\n // Inject config as environment variables for Turbopack compatibility\n // Using NEXT_PUBLIC_ prefix as Next.js doesn't allow __ prefixed keys\n NEXT_PUBLIC_FF_CONFIG: cache ? JSON.stringify(cache.componentsConfig || null) : 'null',\n NEXT_PUBLIC_FF_ICONS: cache ? JSON.stringify(cache.icons || null) : 'null',\n },\n webpack: (config, options) => {\n // 1. Call existing webpack config if provided\n if (typeof nextConfig.webpack === 'function') {\n config = nextConfig.webpack(config, options);\n }\n\n if (!cache) {\n return config;\n }\n\n // 4. Use webpack.DefinePlugin from options (works with both webpack 4 and 5)\n // This is for webpack - Turbopack will use the env vars above\n const { webpack } = options;\n const DefinePlugin = webpack.DefinePlugin;\n\n // 5. Inject __FF_CONFIG__ and __FF_ICONS__ as globals for webpack\n const definitions = {\n __FF_CONFIG__: JSON.stringify(cache.componentsConfig || null),\n __FF_ICONS__: JSON.stringify(cache.icons || null)\n };\n\n // Add DefinePlugin to plugins array\n config.plugins = config.plugins || [];\n config.plugins.push(new DefinePlugin(definitions));\n\n // Log success in development\n if (options.dev && !options.isServer) {\n console.log('[FrontFriend Next.js] Injected configuration and icons into client build');\n }\n\n // 6. Return modified config\n return config;\n }\n };\n}\n\nmodule.exports = frontfriend;"],
5
+ "mappings": "8DAAA,IAAAA,EAAAC,EAAA,CAAAC,EAAAC,IAAA,CAKA,IAAMC,EAAkB,8BAClBC,EAAiB,iDAGjBC,EAAiB,qBAKjBC,EAAc,CAClB,GAAI,CACF,YACA,eACA,uBACA,2BACA,cACA,WACF,EACA,KAAM,CACJ,aACA,aACA,yBACA,eACA,eACF,CACF,EAGMC,EAAW,CACf,MAAO,QACP,WAAY,aACZ,aAAc,cAChB,EAEAL,EAAO,QAAU,CACf,gBAAAC,EACA,eAAAC,EACA,eAAAC,EACA,iBACA,oBACA,YAAAC,EACA,SAAAC,CACF,IC/CA,IAAAC,EAAAC,EAAA,CAAAC,EAAAC,IAAA,KAAMC,EAAN,cAAuB,KAAM,CAC3B,YAAYC,EAASC,EAAYC,EAAK,CACpC,MAAMF,CAAO,EACb,KAAK,KAAO,WACZ,KAAK,WAAaC,EAClB,KAAK,IAAMC,EACX,KAAK,KAAO,OAAOD,CAAU,EAC/B,CACF,EAEME,EAAN,cAAyB,KA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AC/CI,EAAQ,KAEZ,OAAID,EAAa,OAAO,EACtBC,EAAQD,EAAa,KAAK,EAE1B,QAAQ,KAAK,gFAAgF,EAGxF,CACL,GAAGD,EAEH,IAAK,CACH,GAAGA,EAAW,IAGd,sBAAuBE,EAAQ,KAAK,UAAUA,EAAM,kBAAoB,IAAI,EAAI,OAChF,qBAAsBA,EAAQ,KAAK,UAAUA,EAAM,OAAS,IAAI,EAAI,MACtE,EACA,QAAS,CAACC,EAAQC,IAAY,CAM5B,GAJI,OAAOJ,EAAW,SAAY,aAChCG,EAASH,EAAW,QAAQG,EAAQC,CAAO,GAGzC,CAACF,EACH,OAAOC,EAKT,GAAM,CAAE,QAAAE,CAAQ,EAAID,EACdE,EAAeD,EAAQ,aAGvBE,EAAc,CAClB,cAAe,KAAK,UAAUL,EAAM,kBAAoB,IAAI,EAC5D,aAAc,KAAK,UAAUA,EAAM,OAAS,IAAI,CAClD,EAGA,OAAAC,EAAO,QAAUA,EAAO,SAAW,CAAC,EACpCA,EAAO,QAAQ,KAAK,IAAIG,EAAaC,CAAW,CAAC,EAG7CH,EAAQ,KAAO,CAACA,EAAQ,UAC1B,QAAQ,IAAI,0EAA0E,EAIjFD,CACT,CACF,CACF,CAEA,OAAO,QAAUJ",
6
6
  "names": ["require_constants", "__commonJSMin", "exports", "module", "DEFAULT_API_URL", "LEGACY_API_URL", "CACHE_DIR_NAME", "CACHE_FILES", "ENV_VARS", "require_errors", "__commonJSMin", "exports", "module", "APIError", "message", "statusCode", "url", "CacheError", "operation", "ConfigError", "field", "ProcessingError", "token", "require_file_utils", "__commonJSMin", "exports", "module", "fs", "readJsonFileSafe", "filepath", "content", "error", "readFileSafe", "writeJsonFile", "data", "indent", "writeModuleExportsFile", "fileExists", "ensureDirectoryExists", "dirpath", "removeDirectory", "require_cache_manager", "__commonJSMin", "exports", "module", "path", "CACHE_DIR_NAME", "CACHE_TTL_MS", "CACHE_FILES", "CacheError", "readJsonFileSafe", "readFileSafe", "writeJsonFile", "writeModuleExportsFile", "fileExists", "ensureDirectoryExists", "removeDirectory", "CacheManager", "appRoot", "metadata", "timestamp", "data", "file", "filePath", "key", "content", "moduleExports", "fakeModule", "error", "_a", "_b", "jsFiles", "safelistPath", "jsonData", "value", "CacheManager", "frontfriend", "nextConfig", "cacheManager", "cache", "config", "options", "webpack", "DefinePlugin", "definitions"]
7
7
  }
@@ -141,21 +141,63 @@ declare module '@frontfriend/tailwind/lib/react/utils.mjs' {
141
141
  }
142
142
 
143
143
  declare module '@frontfriend/tailwind/lib/vue/utils' {
144
+ import type { Ref, ComputedRef } from 'vue';
145
+
144
146
  /**
145
147
  * Combines class names with tailwind-merge
146
148
  * @param inputs - Class names to combine
147
149
  * @returns Merged class string
148
150
  */
149
151
  export function cn(...inputs: any[]): string;
152
+
153
+ /**
154
+ * Vue composable for media query matching
155
+ * @param query - Media query string
156
+ * @returns Ref with boolean value indicating if query matches
157
+ */
158
+ export function useMediaQuery(query: string): Ref<boolean>;
159
+
160
+ /**
161
+ * Vue composable for responsive breakpoints
162
+ * @returns Object with breakpoint state refs and active breakpoint
163
+ */
164
+ export function useBreakpoints(): {
165
+ isXs: Ref<boolean>;
166
+ isSm: Ref<boolean>;
167
+ isMd: Ref<boolean>;
168
+ isLg: Ref<boolean>;
169
+ active: ComputedRef<'xs' | 'sm' | 'md' | 'lg'>;
170
+ };
150
171
  }
151
172
 
152
173
  declare module '@frontfriend/tailwind/lib/vue/utils.mjs' {
174
+ import type { Ref, ComputedRef } from 'vue';
175
+
153
176
  /**
154
177
  * Combines class names with tailwind-merge
155
178
  * @param inputs - Class names to combine
156
179
  * @returns Merged class string
157
180
  */
158
181
  export function cn(...inputs: any[]): string;
182
+
183
+ /**
184
+ * Vue composable for media query matching
185
+ * @param query - Media query string
186
+ * @returns Ref with boolean value indicating if query matches
187
+ */
188
+ export function useMediaQuery(query: string): Ref<boolean>;
189
+
190
+ /**
191
+ * Vue composable for responsive breakpoints
192
+ * @returns Object with breakpoint state refs and active breakpoint
193
+ */
194
+ export function useBreakpoints(): {
195
+ isXs: Ref<boolean>;
196
+ isSm: Ref<boolean>;
197
+ isMd: Ref<boolean>;
198
+ isLg: Ref<boolean>;
199
+ active: ComputedRef<'xs' | 'sm' | 'md' | 'lg'>;
200
+ };
159
201
  }
160
202
 
161
203
  // Internal modules (for advanced usage)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontfriend/tailwind",
3
- "version": "2.5.2",
3
+ "version": "2.5.4",
4
4
  "description": "Design token management for Tailwind CSS",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/types/index.d.ts",