@frontfriend/tailwind 2.1.5 → 2.2.0

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,62 +1,61 @@
1
1
  #!/usr/bin/env node
2
- var O=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports);var x=O((V,I)=>{var u=require("fs"),F=require("path");function D(){let e=process.cwd(),n=F.join(e,"node_modules",".cache","frontfriend","icons.json"),o=F.join(e,"types","frontfriend-icons.d.ts");u.existsSync(n)||(console.error('[FrontFriend] Error: icons.json not found. Please run "npx frontfriend setup" first.'),process.exit(1));try{let r=function(t){for(let i of Object.values(t))typeof i=="string"?s.add(i):typeof i=="object"&&i!==null&&r(i)},g=function(t,i=" "){let f=[];for(let[k,h]of Object.entries(t))typeof h=="string"?f.push(`${i}${k}: '${h}';`):typeof h=="object"&&h!==null&&(f.push(`${i}${k}: {`),f.push(g(h,i+" ")),f.push(`${i}};`));return f.join(`
3
- `)};var a=r,c=g;let l=JSON.parse(u.readFileSync(n,"utf-8")),s=new Set;r(l);let p=Array.from(s).map(t=>`'${t}'`).join(" | "),y=`// Generated by @frontfriend/tailwind
2
+ var D=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports);var x=D((A,v)=>{var u=require("fs"),$=require("path");function P(s={}){let e=s.projectRoot||process.cwd(),o=$.join(e,"node_modules",".cache","frontfriend","icons.json"),a=s.outputPath||$.join(e,"types","frontfriend.d.ts");u.existsSync(o)||(console.error('[FrontFriend] Error: icons.json not found. Please run "npx frontfriend setup" first.'),process.exit(1));try{let p=function(f){for(let c of Object.values(f))typeof c=="string"?l.add(c):typeof c=="object"&&c!==null&&p(c)},y=function(f,c=" "){let i=[];for(let[h,C]of Object.entries(f))typeof C=="string"?i.push(`${c}${h}: '${C}';`):typeof C=="object"&&C!==null&&(i.push(`${c}${h}: {`),i.push(y(C,c+" ")),i.push(`${c}};`));return i.join(`
3
+ `)};var t=p,d=y;let n=JSON.parse(u.readFileSync(o,"utf-8")),l=new Set;p(n);let g=Array.from(l).map(f=>`'${f}'`).join(" | "),S=`// 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 = ${p||"string"};
10
+ export type ProjectIconName = ${g||"string"};
11
11
 
12
12
  // Typed iconSet structure with exact icon names
13
13
  export interface TypedIconSet extends IconSetStructure {
14
- ${g(l)}
14
+ ${y(n)}
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 = ${p||"string"};
20
+ export type IconName = ${g||"string"};
21
21
  }
22
22
 
23
23
  declare module '@/components/ui/icon/*.vue' {
24
- export type IconName = ${p||"string"};
24
+ export type IconName = ${g||"string"};
25
25
  }
26
26
 
27
27
  declare module '@/components/ui/icon' {
28
- export type IconName = ${p||"string"};
28
+ export type IconName = ${g||"string"};
29
29
  }
30
30
 
31
31
  declare module '@/src/components/ui/icon' {
32
- export type IconName = ${p||"string"};
32
+ export type IconName = ${g||"string"};
33
33
  }
34
34
 
35
35
  declare module '@/src/components/ui/icon/Icon.vue' {
36
- export type IconName = ${p||"string"};
36
+ export type IconName = ${g||"string"};
37
37
  }
38
- `,$=F.dirname(o);u.existsSync($)||u.mkdirSync($,{recursive:!0}),u.writeFileSync(o,y),console.log("[FrontFriend] \u2713 Generated icon types at types/frontfriend-icons.d.ts");let w=F.join(e,"tsconfig.json");if(u.existsSync(w)){let t=JSON.parse(u.readFileSync(w,"utf-8"));t.include||(t.include=[]);let i="types/**/*.d.ts";t.include.includes(i)||(t.include.push(i),u.writeFileSync(w,JSON.stringify(t,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===I&&D();I.exports={generateIconTypes:D}});var{Command:L}=require("commander"),S=require("./lib/config/config-loader"),j=require("./lib/config/cache-manager"),{APIClient:R}=require("./lib/core/api-client"),{ComponentDownloader:q}=require("./lib/core/component-downloader"),N=require("./lib/core/token-processor"),{ConfigError:C,APIError:E,CacheError:T}=require("./lib/core/errors"),b=require("path"),m=new L;m.name("frontfriend").description("FrontFriend Tailwind CLI - Manage design tokens and cache").version("2.0.0");m.command("init").description("Initialize FrontFriend configuration and fetch from API").option("--force","Force refresh even if cache is valid").action(async e=>{try{console.log("\u{1F527} FrontFriend Setup"),console.log(`==================
39
- `);let o=await new S().load();if(!o.ffId)throw new C(`ff-id not found in frontfriend.config.js
38
+ `,w=$.dirname(a);u.existsSync(w)||u.mkdirSync(w,{recursive:!0}),u.writeFileSync(a,S),console.log("[FrontFriend] \u2713 Generated types at",$.relative(e,a));let r=$.join(e,"tsconfig.json");if(u.existsSync(r)){let f=JSON.parse(u.readFileSync(r,"utf-8"));f.include||(f.include=[]);let c="types/**/*.d.ts";f.include.includes(c)||(f.include.push(c),u.writeFileSync(r,JSON.stringify(f,null,2)),console.log("[FrontFriend] \u2713 Updated tsconfig.json to include generated types"))}}catch(n){console.error("[FrontFriend] Error generating icon types:",n.message),process.exit(1)}}require.main===v&&P();v.exports={generateIconTypes:P}});var{Command:T}=require("commander"),F=require("./lib/core/config-loader"),b=require("./lib/core/cache-manager"),{APIClient:R}=require("./lib/core/api-client"),{ComponentDownloader:E}=require("./lib/core/component-downloader"),L=require("./lib/core/token-processor"),{ConfigError:k,APIError:O,CacheError:j}=require("./lib/core/errors"),{loadEnvLocal:N}=require("./lib/core/env-utils"),I=require("path");N();var m=new T;m.name("frontfriend").description("FrontFriend Tailwind CLI - Manage design tokens and cache").version("2.0.0");m.command("init").description("Initialize FrontFriend configuration and fetch from API").option("--force","Force refresh even if cache is valid").action(async s=>{try{console.log("\u{1F527} FrontFriend Setup"),console.log(`==================
39
+ `);let o=await new F().load();if(!o.ffId)throw new k(`ff-id not found in frontfriend.config.js
40
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 a=new j(o.appRoot);!e.force&&a.exists()&&a.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..."),e.force?console.log(` Force refresh requested
41
+ `);let a=new b(o.appRoot);!s.force&&a.exists()&&a.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..."),s.force?console.log(` Force refresh requested
42
42
  `):a.exists()?console.log(` Cache expired
43
43
  `):console.log(` No cache found
44
- `),console.log("\u{1F310} Fetching configuration...");let c=new R(o.ffId,{baseURL:o["api-url"]||o.apiUrl});(o["api-url"]||o.apiUrl)&&console.log(` Using API URL: ${o["api-url"]||o.apiUrl}`);let l=null;try{l=await c.fetchProcessedTokens()}catch(d){console.log(` \u26A0\uFE0F Failed to fetch pre-processed tokens: ${d.message}`)}if(l){console.log(" \u2713 Pre-processed tokens fetched from server"),console.log(` \u2713 Skipping local processing
45
- `),console.log("\u{1F4BE} Saving cache..."),a.save(l),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.");let d=require("fs"),P=b.join(o.appRoot,"tsconfig.json");if(d.existsSync(P)){console.log(`
47
- \u{1F524} Generating TypeScript types...`);try{let{generateIconTypes:v}=x();v()}catch(v){console.log(" \u26A0\uFE0F Type generation failed:",v.message),console.log(' Run "npx frontfriend generate-types" manually to retry')}}process.exit(0)}console.log(` \u2139\uFE0F Pre-processed tokens not available, falling back to local processing
48
- `);let[s,r,g,p,y,$]=await Promise.all([c.fetchTokens(),c.fetchComponentsConfig(),c.fetchFonts(),c.fetchIcons(),c.fetchVersion(),c.fetchCustomCss()]);if(console.log(" \u2713 Tokens fetched"),s.global||s.colors||s.semantic||s.semanticDark){let d=[s.global?"global":null,s.colors?"colors":null,s.semantic?"semantic":null,s.semanticDark?"semanticDark":null].filter(Boolean).join(", ");console.log(` (Found: ${d})`)}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 w=new N;console.log(" Processing raw token data...");let t=await w.process({colors:s.colors||s.global,semantic:s.semantic,semanticDark:s.semanticDark,fonts:g,globalTokens:s.global,animations:s.animations,version:y==null?void 0:y.version,ffId:o.ffId,customCss:$});console.log(" \u2713 Colors processed"),console.log(" \u2713 Semantic tokens processed"),t.fontFaces.length>0&&console.log(` \u2713 ${t.fontFaces.length} font faces processed`),Object.keys(t.animations).length>0&&console.log(` \u2713 ${Object.keys(t.animations).length} animations processed`),console.log(`
50
- `);let i=w.extractClassesFromComponentsConfig(r),f={tokens:t.utilities,variables:t.variables,semanticVariables:t.semanticVariables,semanticDarkVariables:t.semanticDarkVariables,fonts:t.fontFaces,icons:p,componentsConfig:r,keyframes:t.keyframes,animations:t.animations,safelist:t.safelist,version:y,metadata:t.metadata,cls:i||[],custom:t.custom};console.log("\u{1F4BE} Saving cache..."),console.log(" Cache data summary:"),console.log(` - Tokens: ${Object.keys(f.tokens||{}).length} utilities`),console.log(` - Variables: ${Object.keys(f.variables||{}).length} CSS variables`),console.log(` - Semantic variables: ${Object.keys(f.semanticVariables||{}).length} semantic variables`),console.log(` - Font faces: ${(f.fonts||[]).length} fonts`),console.log(` - Classes: ${(f.cls||[]).length} extracted classes`),a.save(f),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.");let k=require("fs"),h=b.join(o.appRoot,"tsconfig.json");if(k.existsSync(h)){console.log(`
52
- \u{1F524} Generating TypeScript types...`);try{let{generateIconTypes:d}=x();d()}catch(d){console.log(" \u26A0\uFE0F Type generation failed:",d.message),console.log(' Run "npx frontfriend generate-types" manually to retry')}}process.exit(0)}catch(n){n instanceof C?console.error("\u274C Configuration Error:",n.message):n instanceof E?(console.error("\u274C API Error:",n.message),console.error(` Status: ${n.statusCode}`),console.error(` URL: ${n.url}`)):n instanceof T?(console.error("\u274C Cache Error:",n.message),console.error(` Operation: ${n.operation}`)):console.error("\u274C Setup failed:",n.message),process.exit(1)}});m.command("clean").description("Remove cached configuration").action(async()=>{try{console.log(`\u{1F9F9} Cleaning FrontFriend cache...
53
- `);let n=new S().load(),o=new j(n.appRoot);o.exists()?(o.clear(),console.log("\u2705 Cache cleared successfully")):console.log("\u2139\uFE0F No cache found"),process.exit(0)}catch(e){e instanceof T?(console.error("\u274C Cache Error:",e.message),console.error(` Operation: ${e.operation}`)):console.error("\u274C Clean failed:",e.message),process.exit(1)}});m.command("generate-types").description("Generate TypeScript types from cached icons.json").action(async()=>{try{console.log(`\u{1F524} Generating TypeScript types...
54
- `);let{generateIconTypes:e}=x();e(),process.exit(0)}catch(e){console.error("\u274C Type generation failed:",e.message),process.exit(1)}});m.command("status").description("Show cache status and configuration").action(async()=>{try{console.log("\u{1F4CA} FrontFriend Status"),console.log(`===================
55
- `);let n=await new S().load();console.log("Configuration:"),console.log(` FF_ID: ${n.ffId||"Not set"}`),console.log(` App Root: ${n.appRoot}
56
- `);let o=new j(n.appRoot),a=o.getCacheDir();if(console.log("Cache:"),console.log(` Directory: ${b.relative(process.cwd(),a)}`),o.exists()){console.log(` Status: ${o.isValid()?"\u2705 Valid":"\u26A0\uFE0F Expired"}`);let c=o.load();if(c&&c.metadata){let l=new Date(c.metadata.timestamp);console.log(` Created: ${l.toLocaleString()}`),console.log(` Version: ${c.metadata.version||"Unknown"}`)}}else console.log(" Status: \u274C Not found");process.exit(0)}catch(e){e instanceof C?console.error("\u274C Configuration Error:",e.message):e instanceof T?(console.error("\u274C Cache Error:",e.message),console.error(` Operation: ${e.operation}`)):console.error("\u274C Status check failed:",e.message),process.exit(1)}});m.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(e,n)=>{try{console.log(`\u{1F4E6} Downloading components...
57
- `);let a=await new S().load();if(!a.ffId)throw new C(`ff-id not found in frontfriend.config.js
58
- Please add "ff-id" to your frontfriend.config.js file`,"ff-id");let c=new q({appRoot:a.appRoot,config:a,framework:n.framework,outputPath:n.output,overwrite:n.overwrite}),l=e;if(e.length===1&&e[0].toLowerCase()==="all"){let r=await c.getAllComponents(),g=await c.getCustomComponents();r.length===0&&(console.error("\u274C Failed to fetch component list"),process.exit(1)),l=[...r,...g],console.log("\u{1F4CB} Configuration"),console.log(` Framework: ${c.framework}`),console.log(` Output: ${c.outputPath}`),console.log(` Components: All ${r.length} standard components`),g.length>0&&console.log(` Custom: ${g.length} custom components for ff-id: ${a.ffId||a["ff-id"]}`),console.log("")}else console.log("\u{1F4CB} Configuration"),console.log(` Framework: ${c.framework}`),console.log(` Output: ${c.outputPath}`),console.log(` Components: ${e.join(", ")}
59
- `);let s=await c.downloadComponents(l);s.successful.length>0&&(console.log(`
60
- \u2705 Download complete!`),console.log(` Downloaded: ${s.successful.length} components`)),s.failed.length>0&&(console.log(""),s.failed.forEach(r=>{r.error.includes("not found")?console.log(`\u274C ${r.error}`):console.log(`\u274C Failed to download ${r.component}: ${r.error}`)})),s.successful.length>0&&s.dependencies.length>0&&(console.log(`
61
- \u{1F4E6} Install dependencies:`),console.log(` npm install ${s.dependencies.join(" ")}`)),s.successful.length===0&&s.failed.length>0&&process.exit(1),process.exit(0)}catch(o){o instanceof C?(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)}});m.parse(process.argv);process.argv.slice(2).length||(m.outputHelp(),process.exit(0));
44
+ `),console.log("\u{1F310} Fetching configuration...");let t=new R(o.ffId,{baseURL:o["api-url"]||o.apiUrl});(o["api-url"]||o.apiUrl)&&console.log(` Using API URL: ${o["api-url"]||o.apiUrl}`);let d=null;try{d=await t.fetchProcessedTokens()}catch(i){console.log(` \u26A0\uFE0F Failed to fetch pre-processed tokens: ${i.message}`)}if(d){if(console.log(" \u2713 Pre-processed tokens fetched from server"),console.log(` \u2713 Skipping local processing
45
+ `),console.log("\u{1F4BE} Saving cache..."),a.save(d),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:i}=x(),h=o.aliases&&o.aliases.types?I.join(o.appRoot,o.aliases.types,"frontfriend.d.ts"):void 0;i({projectRoot:o.appRoot,outputPath:h})}catch(i){console.log(" \u26A0\uFE0F Type generation failed:",i.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[n,l,p,y,g,S]=await Promise.all([t.fetchTokens(),t.fetchComponentsConfig(),t.fetchFonts(),t.fetchIcons(),t.fetchVersion(),t.fetchCustomCss()]);if(console.log(" \u2713 Tokens fetched"),n.global||n.colors||n.semantic||n.semanticDark){let i=[n.global?"global":null,n.colors?"colors":null,n.semantic?"semantic":null,n.semanticDark?"semanticDark":null].filter(Boolean).join(", ");console.log(` (Found: ${i})`)}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 w=new L;console.log(" Processing raw token data...");let r=await w.process({colors:n.colors||n.global,semantic:n.semantic,semanticDark:n.semanticDark,fonts:p,globalTokens:n.global,animations:n.animations,version:g==null?void 0:g.version,ffId:o.ffId,customCss:S});console.log(" \u2713 Colors processed"),console.log(" \u2713 Semantic tokens processed"),r.fontFaces.length>0&&console.log(` \u2713 ${r.fontFaces.length} font faces processed`),Object.keys(r.animations).length>0&&console.log(` \u2713 ${Object.keys(r.animations).length} animations processed`),console.log(`
50
+ `);let f=w.extractClassesFromComponentsConfig(l),c={tokens:r.utilities,variables:r.variables,semanticVariables:r.semanticVariables,semanticDarkVariables:r.semanticDarkVariables,fonts:r.fontFaces,icons:y,componentsConfig:l,keyframes:r.keyframes,animations:r.animations,safelist:r.safelist,version:g,metadata:r.metadata,cls:f||[],custom:r.custom};if(console.log("\u{1F4BE} Saving cache..."),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(` - Classes: ${(c.cls||[]).length} extracted classes`),a.save(c),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:i}=x(),h=o.aliases&&o.aliases.types?I.join(o.appRoot,o.aliases.types,"frontfriend.d.ts"):void 0;i({projectRoot:o.appRoot,outputPath:h})}catch(i){console.log(" \u26A0\uFE0F Type generation failed:",i.message),console.log(' Enable type generation in frontfriend.config.js with "types": true')}}process.exit(0)}catch(e){e instanceof k?console.error("\u274C Configuration Error:",e.message):e instanceof O?(console.error("\u274C API Error:",e.message),console.error(` Status: ${e.statusCode}`),console.error(` URL: ${e.url}`)):e instanceof j?(console.error("\u274C Cache Error:",e.message),console.error(` Operation: ${e.operation}`)):console.error("\u274C Setup failed:",e.message),process.exit(1)}});m.command("clean").description("Remove cached configuration").action(async()=>{try{console.log(`\u{1F9F9} Cleaning FrontFriend cache...
53
+ `);let e=new F().load(),o=new b(e.appRoot);o.exists()?(o.clear(),console.log("\u2705 Cache cleared successfully")):console.log("\u2139\uFE0F No cache found"),process.exit(0)}catch(s){s instanceof j?(console.error("\u274C Cache Error:",s.message),console.error(` Operation: ${s.operation}`)):console.error("\u274C Clean failed:",s.message),process.exit(1)}});m.command("status").description("Show cache status and configuration").action(async()=>{try{console.log("\u{1F4CA} FrontFriend Status"),console.log(`===================
54
+ `);let e=await new F().load();console.log("Configuration:"),console.log(` FF_ID: ${e.ffId||"Not set"}`),console.log(` App Root: ${e.appRoot}
55
+ `);let o=new b(e.appRoot),a=o.getCacheDir();if(console.log("Cache:"),console.log(` Directory: ${I.relative(process.cwd(),a)}`),o.exists()){console.log(` Status: ${o.isValid()?"\u2705 Valid":"\u26A0\uFE0F Expired"}`);let t=o.load();if(t&&t.metadata){let d=new Date(t.metadata.timestamp);console.log(` Created: ${d.toLocaleString()}`),console.log(` Version: ${t.metadata.version||"Unknown"}`)}}else console.log(" Status: \u274C Not found");process.exit(0)}catch(s){s instanceof k?console.error("\u274C Configuration Error:",s.message):s instanceof j?(console.error("\u274C Cache Error:",s.message),console.error(` Operation: ${s.operation}`)):console.error("\u274C Status check failed:",s.message),process.exit(1)}});m.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(s,e)=>{try{console.log(`\u{1F4E6} Downloading components...
56
+ `);let a=await new F().load();if(!a.ffId)throw new k(`ff-id not found in frontfriend.config.js
57
+ Please add "ff-id" to your frontfriend.config.js file`,"ff-id");let t=new E({appRoot:a.appRoot,config:a,framework:e.framework,outputPath:e.output,overwrite:e.overwrite}),d=s;if(s.length===1&&s[0].toLowerCase()==="all"){let l=await t.getAllComponents(),p=await t.getCustomComponents();l.length===0&&(console.error("\u274C Failed to fetch component list"),process.exit(1)),d=[...l,...p],console.log("\u{1F4CB} Configuration"),console.log(` Framework: ${t.framework}`),console.log(` Output: ${t.outputPath}`),console.log(` Components: All ${l.length} standard components`),p.length>0&&console.log(` Custom: ${p.length} custom components for ff-id: ${a.ffId||a["ff-id"]}`),console.log("")}else console.log("\u{1F4CB} Configuration"),console.log(` Framework: ${t.framework}`),console.log(` Output: ${t.outputPath}`),console.log(` Components: ${s.join(", ")}
58
+ `);let n=await t.downloadComponents(d);n.successful.length>0&&(console.log(`
59
+ \u2705 Download complete!`),console.log(` Downloaded: ${n.successful.length} components`)),n.failed.length>0&&(console.log(""),n.failed.forEach(l=>{l.error.includes("not found")?console.log(`\u274C ${l.error}`):console.log(`\u274C Failed to download ${l.component}: ${l.error}`)})),n.successful.length>0&&n.dependencies.length>0&&(console.log(`
60
+ \u{1F4E6} Install dependencies:`),console.log(` npm install ${n.dependencies.join(" ")}`)),n.successful.length===0&&n.failed.length>0&&process.exit(1),process.exit(0)}catch(o){o instanceof k?(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)}});m.parse(process.argv);process.argv.slice(2).length||(m.outputHelp(),process.exit(0));
62
61
  //# sourceMappingURL=cli-temp.js.map
package/dist/index.js CHANGED
@@ -1,2 +1,4 @@
1
- var k=(s,o)=>()=>(o||s((o={exports:{}}).exports,o),o.exports);var g=k(($,x)=>{x.exports=function(o){if(!o)return{};if(typeof o!="object")throw new Error("Config must be an object");return o}});var _=require("tailwindcss/plugin"),d=require("./lib/config/cache-manager");function v(s){return Object.fromEntries(Object.entries(s).filter(([o])=>o!=="DEFAULT"))}var j=_.withOptions(function(s={}){return function({addBase:o,addUtilities:i,theme:l,matchUtilities:a}){let w=new d(process.cwd());if(!w.exists()){console.warn('[FrontFriend] No cache found. Please run "npx frontfriend setup" first.');return}w.isValid()||console.warn('[FrontFriend] Cache is expired. Please run "npx frontfriend setup" to refresh.');let e=w.load();if(!e){console.error("[FrontFriend] Failed to load cache.");return}let m={};if(e.variables)for(let[t,n]of Object.entries(e.variables))t.startsWith("--color-")&&!n.startsWith("hsl(")?m[t]=`hsl(${n})`:m[t]=n;if(e.semanticVariables)for(let[t,n]of Object.entries(e.semanticVariables))m[t]=n;if(o({":root":m}),e.semanticDarkVariables&&Object.keys(e.semanticDarkVariables).length>0&&(o({":root:not(.light)":e.semanticDarkVariables}),o({":root:not(.dark)":e.semanticVariables})),e.semanticVariables){let t={};for(let[n]of Object.entries(e.semanticVariables)){let r=n.match(/^--(bg|text|border|layer|overlay|icon)-(.+)$/);if(r){let[,c,f]=r,u=`.${c}-${f}`;c==="bg"||c==="layer"||c==="overlay"?t[u]={backgroundColor:`var(${n})`}:c==="text"?t[u]={color:`var(${n})`}:c==="border"?t[u]={borderColor:`var(${n})`}:c==="icon"&&(t[`.text-${c}-${f}`]={color:`var(${n})`},t[`.fill-${c}-${f}`]={fill:`var(${n})`})}}i(t)}if(e.tokens){if(e.tokens.backgroundColor){let t={};for(let[n,r]of Object.entries(e.tokens.backgroundColor))t[`.bg-${n}`]={backgroundColor:r};i(t)}if(e.tokens.textColor){let t={};for(let[n,r]of Object.entries(e.tokens.textColor))t[`.text-${n}`]={color:r};i(t)}if(e.tokens.borderColor){let t={};for(let[n,r]of Object.entries(e.tokens.borderColor))t[`.border-${n}`]={borderColor:r};i(t)}if(e.tokens.fill){let t={};for(let[n,r]of Object.entries(e.tokens.fill))t[`.fill-${n}`]={fill:r};i(t)}if(e.tokens.fontFamily){let t={};for(let[n,r]of Object.entries(e.tokens.fontFamily))t[`.font-${n}`]={fontFamily:r};i(t)}}if(e.fonts&&e.fonts.length>0&&e.fonts.forEach(t=>{o({"@font-face":t})}),e.keyframes&&Object.keys(e.keyframes).length>0){let t={};for(let[n,r]of Object.entries(e.keyframes))t[`@keyframes ${n}`]=r;o(t)}if(e.animations&&Object.keys(e.animations).length>0){let t={};for(let[n,r]of Object.entries(e.animations))t[`.animate-${n}`]={animation:r};i(t)}if(i({"@keyframes enter":l("keyframes.enter"),"@keyframes exit":l("keyframes.exit"),".animate-in":{animationName:"enter",animationDuration:l("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:l("animationDuration.DEFAULT"),"--tw-exit-opacity":"initial","--tw-exit-scale":"initial","--tw-exit-rotate":"initial","--tw-exit-translate-x":"initial","--tw-exit-translate-y":"initial"}}),a({"fade-in":t=>({"--tw-enter-opacity":t}),"fade-out":t=>({"--tw-exit-opacity":t})},{values:l("animationOpacity")}),a({"zoom-in":t=>({"--tw-enter-scale":t}),"zoom-out":t=>({"--tw-exit-scale":t})},{values:l("animationScale")}),a({"spin-in":t=>({"--tw-enter-rotate":t}),"spin-out":t=>({"--tw-exit-rotate":t})},{values:l("animationRotate")}),a({"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:l("animationTranslate")}),a({duration:t=>({animationDuration:t})},{values:v(l("animationDuration"))}),a({delay:t=>({animationDelay:t})},{values:l("animationDelay")}),a({ease:t=>({animationTimingFunction:t})},{values:v(l("animationTimingFunction"))}),i({".running":{animationPlayState:"running"},".paused":{animationPlayState:"paused"}}),a({"fill-mode":t=>({animationFillMode:t})},{values:l("animationFillMode")}),a({direction:t=>({animationDirection:t})},{values:l("animationDirection")}),a({repeat:t=>({animationIterationCount:t})},{values:l("animationRepeat")}),e.custom)if(e.custom.raw&&typeof e.custom.raw=="string"){let t=e.custom.raw.replace(/theme\(['"](.*?)['"]\)/g,(n,r)=>{let c=r.split("."),f=l(c[0]);for(let u=1;u<c.length;u++)if(f&&f[c[u]])f=f[c[u]];else{f=null;break}return f||n});o({...t.split("}").filter(n=>n.trim().length>0).map(n=>{let r=n.split("{");if(r.length===2){let c=r[0].trim(),f=r[1].trim(),u={};return f.split(";").filter(y=>y.trim().length>0).forEach(y=>{let[b,p]=y.split(":").map(F=>F.trim());b&&p&&(u[b]=p)}),{[c]:u}}return{}}).reduce((n,r)=>({...n,...r}),{})})}else typeof e.custom=="object"&&o(e.custom);s.verbose&&(console.log("[FrontFriend] Plugin loaded successfully"),console.log(`[FrontFriend] Colors: ${Object.keys(e.variables||{}).length}`),console.log(`[FrontFriend] Semantic vars: ${Object.keys(e.semanticVariables||{}).length}`),console.log(`[FrontFriend] Fonts: ${(e.fonts||[]).length}`),console.log(`[FrontFriend] Animations: ${Object.keys(e.animations||{}).length}`),console.log(`[FrontFriend] Additional classes: ${Array.isArray(e.cls)?e.cls.length:0}`))}},function(s={}){let o=new d(process.cwd()),i=o.exists()?o.load():null,l=["./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 s.verbose&&i&&(console.log("[FrontFriend] Cache loaded successfully"),i.cls&&Array.isArray(i.cls)&&console.log(`[FrontFriend] Loading ${i.cls.length} additional classes for safelist`)),{theme:{extend:{colors:s.extendColors||{},animation:s.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:a})=>({...a("transitionDelay")}),animationDuration:({theme:a})=>({0:"0ms",...a("transitionDuration")}),animationTimingFunction:({theme:a})=>({...a("transitionTimingFunction")}),animationFillMode:{none:"none",forwards:"forwards",backwards:"backwards",both:"both"},animationDirection:{normal:"normal",reverse:"reverse",alternate:"alternate","alternate-reverse":"alternate-reverse"},animationOpacity:({theme:a})=>({DEFAULT:0,...a("opacity")}),animationTranslate:({theme:a})=>({DEFAULT:"100%",...a("translate")}),animationScale:({theme:a})=>({DEFAULT:0,...a("scale")}),animationRotate:({theme:a})=>({DEFAULT:"30deg",...a("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:[...(i==null?void 0:i.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))$/},...(i==null?void 0:i.cls)||[]],content:s.content||l}});module.exports=j;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__;try{let s=new d(process.cwd());if(s.exists()){let o=s.load();if(o)return o.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__;try{let s=new d(process.cwd());if(s.exists()){let o=s.load();if(o)return o.icons||null}}catch{}return null}});module.exports.ffdc=g();
1
+ var y=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports);var k=y((ge,O)=>{var g=require("fs");function P(e){try{let n=g.readFileSync(e,"utf8");return JSON.parse(n)}catch(n){if(n.code==="ENOENT")return null;throw n}}function K(e){try{return g.readFileSync(e,"utf8")}catch(n){if(n.code==="ENOENT")return null;throw n}}function Y(e,n,o=2){let a=JSON.stringify(n,null,o);g.writeFileSync(e,a,"utf8")}function M(e,n){if(n==null||typeof n=="object"&&Object.keys(n).length===0||Array.isArray(n)&&n.length===0){let a=`module.exports = ${Array.isArray(n)?"[]":"{}"};`;g.writeFileSync(e,a,"utf8")}else{let o=`module.exports = ${JSON.stringify(n,null,2)};`;g.writeFileSync(e,o,"utf8")}}function J(e){return g.existsSync(e)}function U(e){g.mkdirSync(e,{recursive:!0})}function G(e){g.rmSync(e,{recursive:!0,force:!0})}O.exports={readJsonFileSafe:P,readFileSafe:K,writeJsonFile:Y,writeModuleExportsFile:M,fileExists:J,ensureDirectoryExists:U,removeDirectory:G}});var N=y((ye,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 A=y((we,v)=>{var _=require("fs"),b=require("path"),B=require("os"),Q=require("crypto"),z=N(),E=z.version,H=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function X(e){let n={},o=e.toString();o=o.replace(/\r\n?/mg,`
2
+ `);let a;for(;(a=H.exec(o))!=null;){let s=a[1],c=a[2]||"";c=c.trim();let r=c[0];c=c.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),r==='"'&&(c=c.replace(/\\n/g,`
3
+ `),c=c.replace(/\\r/g,"\r")),n[s]=c}return n}function Z(e){e=e||{};let n=T(e);e.path=n;let o=d.configDotenv(e);if(!o.parsed){let r=new Error(`MISSING_DATA: Cannot parse ${n} for an unknown reason`);throw r.code="MISSING_DATA",r}let a=V(e).split(","),s=a.length,c;for(let r=0;r<s;r++)try{let f=a[r].trim(),t=te(o,f);c=d.decrypt(t.ciphertext,t.key);break}catch(f){if(r+1>=s)throw f}return d.parse(c)}function ee(e){console.log(`[dotenv@${E}][WARN] ${e}`)}function w(e){console.log(`[dotenv@${E}][DEBUG] ${e}`)}function $(e){console.log(`[dotenv@${E}] ${e}`)}function V(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 te(e,n){let o;try{o=new URL(n)}catch(f){if(f.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 f}let a=o.password;if(!a){let f=new Error("INVALID_DOTENV_KEY: Missing key part");throw f.code="INVALID_DOTENV_KEY",f}let s=o.searchParams.get("environment");if(!s){let f=new Error("INVALID_DOTENV_KEY: Missing environment part");throw f.code="INVALID_DOTENV_KEY",f}let c=`DOTENV_VAULT_${s.toUpperCase()}`,r=e.parsed[c];if(!r){let f=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${c} in your .env.vault file.`);throw f.code="NOT_FOUND_DOTENV_ENVIRONMENT",f}return{ciphertext:r,key:a}}function T(e){let n=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let o of e.path)_.existsSync(o)&&(n=o.endsWith(".vault")?o:`${o}.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 j(e){return e[0]==="~"?b.join(B.homedir(),e.slice(1)):e}function ne(e){let n=!!(e&&e.debug),o=e&&"quiet"in e?e.quiet:!0;(n||!o)&&$("Loading env from encrypted .env.vault");let a=d._parseVault(e),s=process.env;return e&&e.processEnv!=null&&(s=e.processEnv),d.populate(s,a,e),{parsed:a}}function re(e){let n=b.resolve(process.cwd(),".env"),o="utf8",a=!!(e&&e.debug),s=e&&"quiet"in e?e.quiet:!0;e&&e.encoding?o=e.encoding:a&&w("No encoding is specified. UTF-8 is used by default");let c=[n];if(e&&e.path)if(!Array.isArray(e.path))c=[j(e.path)];else{c=[];for(let i of e.path)c.push(j(i))}let r,f={};for(let i of c)try{let l=d.parse(_.readFileSync(i,{encoding:o}));d.populate(f,l,e)}catch(l){a&&w(`Failed to load ${i} ${l.message}`),r=l}let t=process.env;if(e&&e.processEnv!=null&&(t=e.processEnv),d.populate(t,f,e),a||!s){let i=Object.keys(f).length,l=[];for(let u of c)try{let p=b.relative(process.cwd(),u);l.push(p)}catch(p){a&&w(`Failed to load ${u} ${p.message}`),r=p}$(`injecting env (${i}) from ${l.join(",")}`)}return r?{parsed:f,error:r}:{parsed:f}}function oe(e){if(V(e).length===0)return d.configDotenv(e);let n=T(e);return n?d._configVault(e):(ee(`You set DOTENV_KEY but you are missing a .env.vault file at ${n}. Did you forget to build it?`),d.configDotenv(e))}function ae(e,n){let o=Buffer.from(n.slice(-64),"hex"),a=Buffer.from(e,"base64"),s=a.subarray(0,12),c=a.subarray(-16);a=a.subarray(12,-16);try{let r=Q.createDecipheriv("aes-256-gcm",o,s);return r.setAuthTag(c),`${r.update(a)}${r.final()}`}catch(r){let f=r instanceof RangeError,t=r.message==="Invalid key length",i=r.message==="Unsupported state or unable to authenticate data";if(f||t){let l=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw l.code="INVALID_DOTENV_KEY",l}else if(i){let l=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw l.code="DECRYPTION_FAILED",l}else throw r}}function ie(e,n,o={}){let a=!!(o&&o.debug),s=!!(o&&o.override);if(typeof n!="object"){let c=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw c.code="OBJECT_REQUIRED",c}for(let c of Object.keys(n))Object.prototype.hasOwnProperty.call(e,c)?(s===!0&&(e[c]=n[c]),a&&w(s===!0?`"${c}" is already defined and WAS overwritten`:`"${c}" is already defined and was NOT overwritten`)):e[c]=n[c]}var d={configDotenv:re,_configVault:ne,_parseVault:Z,config:oe,decrypt:ae,parse:X,populate:ie};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 C=y((be,I)=>{var se=require("path"),{fileExists:ce}=k();function le(e=process.cwd()){let n=se.join(e,".env.local");return ce(n)?(A().config({path:n}),console.log("\u{1F4C4} Loaded .env.local"),!0):!1}function fe(e,n=void 0){return process.env[e]||n}function ue(e){return process.env[e]==="true"}I.exports={loadEnvLocal:le,getEnvVar:fe,isEnvTrue:ue}});var L=y((he,S)=>{S.exports=function(n){if(!n)return{};if(typeof n!="object")throw new Error("Config must be an object");return n}});var de=require("tailwindcss/plugin"),h=require("./lib/core/cache-manager"),{loadEnvLocal:pe}=C();pe();function R(e){return Object.fromEntries(Object.entries(e).filter(([n])=>n!=="DEFAULT"))}var me=de.withOptions(function(e={}){return function({addBase:n,addUtilities:o,theme:a,matchUtilities:s}){let c=new h(process.cwd());if(!c.exists()){console.warn('[FrontFriend] No cache found. Please run "npx frontfriend setup" first.');return}c.isValid()||console.warn('[FrontFriend] Cache is expired. Please run "npx frontfriend setup" to refresh.');let r=c.load();if(!r){console.error("[FrontFriend] Failed to load cache.");return}let f={};if(r.variables)for(let[t,i]of Object.entries(r.variables))t.startsWith("--color-")&&!i.startsWith("hsl(")?f[t]=`hsl(${i})`:f[t]=i;if(r.semanticVariables)for(let[t,i]of Object.entries(r.semanticVariables))f[t]=i;if(n({":root":f}),r.semanticDarkVariables&&Object.keys(r.semanticDarkVariables).length>0&&(n({":root:not(.light)":r.semanticDarkVariables}),n({":root:not(.dark)":r.semanticVariables})),r.semanticVariables){let t={};for(let[i]of Object.entries(r.semanticVariables)){let l=i.match(/^--(bg|text|border|layer|overlay|icon)-(.+)$/);if(l){let[,u,p]=l,m=`.${u}-${p}`;u==="bg"||u==="layer"||u==="overlay"?t[m]={backgroundColor:`var(${i})`}:u==="text"?t[m]={color:`var(${i})`}:u==="border"?t[m]={borderColor:`var(${i})`}:u==="icon"&&(t[`.text-${u}-${p}`]={color:`var(${i})`},t[`.fill-${u}-${p}`]={fill:`var(${i})`})}}o(t)}if(r.tokens){if(r.tokens.backgroundColor){let t={};for(let[i,l]of Object.entries(r.tokens.backgroundColor))t[`.bg-${i}`]={backgroundColor:l};o(t)}if(r.tokens.textColor){let t={};for(let[i,l]of Object.entries(r.tokens.textColor))t[`.text-${i}`]={color:l};o(t)}if(r.tokens.borderColor){let t={};for(let[i,l]of Object.entries(r.tokens.borderColor))t[`.border-${i}`]={borderColor:l};o(t)}if(r.tokens.fill){let t={};for(let[i,l]of Object.entries(r.tokens.fill))t[`.fill-${i}`]={fill:l};o(t)}if(r.tokens.fontFamily){let t={};for(let[i,l]of Object.entries(r.tokens.fontFamily))t[`.font-${i}`]={fontFamily:l};o(t)}}if(r.fonts&&r.fonts.length>0&&r.fonts.forEach(t=>{n({"@font-face":t})}),r.keyframes&&Object.keys(r.keyframes).length>0){let t={};for(let[i,l]of Object.entries(r.keyframes))t[`@keyframes ${i}`]=l;n(t)}if(r.animations&&Object.keys(r.animations).length>0){let t={};for(let[i,l]of Object.entries(r.animations))t[`.animate-${i}`]={animation:l};o(t)}if(o({"@keyframes enter":a("keyframes.enter"),"@keyframes exit":a("keyframes.exit"),".animate-in":{animationName:"enter",animationDuration:a("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:a("animationDuration.DEFAULT"),"--tw-exit-opacity":"initial","--tw-exit-scale":"initial","--tw-exit-rotate":"initial","--tw-exit-translate-x":"initial","--tw-exit-translate-y":"initial"}}),s({"fade-in":t=>({"--tw-enter-opacity":t}),"fade-out":t=>({"--tw-exit-opacity":t})},{values:a("animationOpacity")}),s({"zoom-in":t=>({"--tw-enter-scale":t}),"zoom-out":t=>({"--tw-exit-scale":t})},{values:a("animationScale")}),s({"spin-in":t=>({"--tw-enter-rotate":t}),"spin-out":t=>({"--tw-exit-rotate":t})},{values:a("animationRotate")}),s({"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:a("animationTranslate")}),s({duration:t=>({animationDuration:t})},{values:R(a("animationDuration"))}),s({delay:t=>({animationDelay:t})},{values:a("animationDelay")}),s({ease:t=>({animationTimingFunction:t})},{values:R(a("animationTimingFunction"))}),o({".running":{animationPlayState:"running"},".paused":{animationPlayState:"paused"}}),s({"fill-mode":t=>({animationFillMode:t})},{values:a("animationFillMode")}),s({direction:t=>({animationDirection:t})},{values:a("animationDirection")}),s({repeat:t=>({animationIterationCount:t})},{values:a("animationRepeat")}),r.custom)if(r.custom.raw&&typeof r.custom.raw=="string"){let t=r.custom.raw.replace(/theme\(['"](.*?)['"]\)/g,(i,l)=>{let u=l.split("."),p=a(u[0]);for(let m=1;m<u.length;m++)if(p&&p[u[m]])p=p[u[m]];else{p=null;break}return p||i});n({...t.split("}").filter(i=>i.trim().length>0).map(i=>{let l=i.split("{");if(l.length===2){let u=l[0].trim(),p=l[1].trim(),m={};return p.split(";").filter(x=>x.trim().length>0).forEach(x=>{let[F,D]=x.split(":").map(q=>q.trim());F&&D&&(m[F]=D)}),{[u]:m}}return{}}).reduce((i,l)=>({...i,...l}),{})})}else typeof r.custom=="object"&&n(r.custom);e.verbose&&(console.log("[FrontFriend] Plugin loaded successfully"),console.log(`[FrontFriend] Colors: ${Object.keys(r.variables||{}).length}`),console.log(`[FrontFriend] Semantic vars: ${Object.keys(r.semanticVariables||{}).length}`),console.log(`[FrontFriend] Fonts: ${(r.fonts||[]).length}`),console.log(`[FrontFriend] Animations: ${Object.keys(r.animations||{}).length}`),console.log(`[FrontFriend] Additional classes: ${Array.isArray(r.cls)?r.cls.length:0}`))}},function(e={}){let n=new h(process.cwd()),o=n.exists()?n.load():null,a=["./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&&o&&(console.log("[FrontFriend] Cache loaded successfully"),o.cls&&Array.isArray(o.cls)&&console.log(`[FrontFriend] Loading ${o.cls.length} additional 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:s})=>({...s("transitionDelay")}),animationDuration:({theme:s})=>({0:"0ms",...s("transitionDuration")}),animationTimingFunction:({theme:s})=>({...s("transitionTimingFunction")}),animationFillMode:{none:"none",forwards:"forwards",backwards:"backwards",both:"both"},animationDirection:{normal:"normal",reverse:"reverse",alternate:"alternate","alternate-reverse":"alternate-reverse"},animationOpacity:({theme:s})=>({DEFAULT:0,...s("opacity")}),animationTranslate:({theme:s})=>({DEFAULT:"100%",...s("translate")}),animationScale:({theme:s})=>({DEFAULT:0,...s("scale")}),animationRotate:({theme:s})=>({DEFAULT:"30deg",...s("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:[...(o==null?void 0:o.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))$/},...(o==null?void 0:o.cls)||[]],content:e.content||a}});module.exports=me;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__;try{let e=new h(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__;try{let e=new h(process.cwd());if(e.exists()){let n=e.load();if(n)return n.icons||null}}catch{}return null}});module.exports.ffdc=L();
2
4
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../ffdc.js", "../index.js"],
4
- "sourcesContent": ["// 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');\nconst CacheManager = require('./lib/config/cache-manager');\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 const cacheManager = new CacheManager(process.cwd());\n \n if (!cacheManager.exists()) {\n console.warn('[FrontFriend] No cache found. Please run \"npx frontfriend setup\" first.');\n return;\n }\n\n if (!cacheManager.isValid()) {\n console.warn('[FrontFriend] Cache is expired. Please run \"npx frontfriend setup\" 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 for (const [name, value] of Object.entries(cache.tokens.fill)) {\n fillUtilities[`.fill-${name}`] = {\n fill: value\n };\n }\n addUtilities(fillUtilities);\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 keyframes\n if (cache.keyframes && Object.keys(cache.keyframes).length > 0) {\n const keyframeRules = {};\n for (const [name, frames] of Object.entries(cache.keyframes)) {\n keyframeRules[`@keyframes ${name}`] = frames;\n }\n addBase(keyframeRules);\n }\n\n // 8. Add animation utilities\n if (cache.animations && Object.keys(cache.animations).length > 0) {\n const animationUtilities = {};\n for (const [name, value] of Object.entries(cache.animations)) {\n animationUtilities[`.animate-${name}`] = {\n animation: value\n };\n }\n addUtilities(animationUtilities);\n }\n\n // 9. 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) {\n if (cache.custom.raw && typeof cache.custom.raw === 'string') {\n // Process the raw CSS string\n const processedCss = cache.custom.raw.replace(\n /theme\\(['\"](.*?)['\"]\\)/g, \n (match, themePath) => {\n // Split the theme path (e.g., 'colors.orange.300' -> ['colors', 'orange', '300'])\n const parts = themePath.split('.');\n \n // Get the value from theme\n let value = theme(parts[0]);\n for (let i = 1; i < parts.length; i++) {\n if (value && value[parts[i]]) {\n value = value[parts[i]];\n } else {\n value = null;\n break;\n }\n }\n \n return value || match; // Return the theme value or original if not found\n }\n );\n \n // Add the processed CSS\n addBase({\n // Using a style object with selectors\n ...processedCss.split('}')\n .filter(rule => rule.trim().length > 0)\n .map(rule => {\n const parts = rule.split('{');\n if (parts.length === 2) {\n const selector = parts[0].trim();\n const styles = parts[1].trim();\n \n // Convert CSS properties to object\n const styleObj = {};\n styles.split(';')\n .filter(prop => prop.trim().length > 0)\n .forEach(prop => {\n const [key, value] = prop.split(':').map(p => p.trim());\n if (key && value) {\n styleObj[key] = value;\n }\n });\n \n return { [selector]: styleObj };\n }\n return {};\n })\n .reduce((acc, item) => ({ ...acc, ...item }), {})\n });\n } else if (typeof cache.custom === 'object') {\n // Handle object format\n addBase(cache.custom);\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] Animations: ${Object.keys(cache.animations || {}).length}`);\n console.log(`[FrontFriend] Additional classes: ${Array.isArray(cache.cls) ? cache.cls.length : 0}`);\n }\n };\n },\n function(options = {}) {\n // Return theme configuration\n const cacheManager = new CacheManager(process.cwd());\n const cache = cacheManager.exists() ? cacheManager.load() : null;\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.cls && Array.isArray(cache.cls)) {\n console.log(`[FrontFriend] Loading ${cache.cls.length} additional 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 ...(cache?.cls || []),\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 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 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 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 return null;\n }\n});\n\n// Export ffdc utility\nmodule.exports.ffdc = require('./ffdc.js');"],
5
- "mappings": "8DAAA,IAAAA,EAAAC,EAAA,CAAAC,EAAAC,IAAA,CAGAA,EAAO,QAAU,SAAcC,EAAQ,CACrC,GAAI,CAACA,EACH,MAAO,CAAC,EAGV,GAA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UACZ,EACA,UAAW,CACT,MAAO,CACL,KAAM,CACJ,QAAS,6BACT,UACE,wMACJ,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,EACA,IAAIA,GAAA,YAAAA,EAAO,MAAO,CAAC,CACrB,EAEA,QAASN,EAAQ,SAAWoC,CAC9B,CACF,CACF,EAGA,OAAO,QAAUrC,EAMjB,OAAO,eAAe,OAAO,QAAS,SAAU,CAC9C,IAAK,UAAW,CAEd,GAAI,OAAO,cAAkB,IAC3B,OAAO,cAIT,GAAI,OAAO,OAAW,KAAe,OAAO,cAC1C,OAAO,OAAO,cAIhB,GAAI,CACF,IAAMM,EAAe,IAAIV,EAAa,QAAQ,IAAI,CAAC,EACnD,GAAIU,EAAa,OAAO,EAAG,CACzB,IAAMC,EAAQD,EAAa,KAAK,EAChC,GAAIC,EACF,OAAOA,EAAM,kBAAoB,IAErC,CACF,MAAgB,CAEhB,CAEA,OAAO,IACT,CACF,CAAC,EAGD,OAAO,eAAe,OAAO,QAAS,UAAW,CAC/C,IAAK,UAAW,CAEd,GAAI,OAAO,aAAiB,IAC1B,OAAO,aAIT,GAAI,OAAO,OAAW,KAAe,OAAO,aAC1C,OAAO,OAAO,aAIhB,GAAI,CACF,IAAMD,EAAe,IAAIV,EAAa,QAAQ,IAAI,CAAC,EACnD,GAAIU,EAAa,OAAO,EAAG,CACzB,IAAMC,EAAQD,EAAa,KAAK,EAChC,GAAIC,EACF,OAAOA,EAAM,OAAS,IAE1B,CACF,MAAgB,CAEhB,CAEA,OAAO,IACT,CACF,CAAC,EAGD,OAAO,QAAQ,KAAO",
6
- "names": ["require_ffdc", "__commonJSMin", "exports", "module", "config", "plugin", "CacheManager", "filterDefault", "values", "key", "pluginExport", "options", "addBase", "addUtilities", "theme", "matchUtilities", "cacheManager", "cache", "rootVars", "value", "semanticUtilities", "cssVar", "match", "prefix", "name", "className", "bgUtilities", "textUtilities", "borderUtilities", "fillUtilities", "fontUtilities", "fontFace", "keyframeRules", "frames", "animationUtilities", "processedCss", "themePath", "parts", "i", "rule", "selector", "styles", "styleObj", "prop", "p", "acc", "item", "defaultContent"]
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');\nconst CacheManager = require('./lib/core/cache-manager');\nconst { loadEnvLocal } = require('./lib/core/env-utils');\n\n// Load .env.local if it exists\nloadEnvLocal();\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 const cacheManager = new CacheManager(process.cwd());\n \n if (!cacheManager.exists()) {\n console.warn('[FrontFriend] No cache found. Please run \"npx frontfriend setup\" first.');\n return;\n }\n\n if (!cacheManager.isValid()) {\n console.warn('[FrontFriend] Cache is expired. Please run \"npx frontfriend setup\" 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 for (const [name, value] of Object.entries(cache.tokens.fill)) {\n fillUtilities[`.fill-${name}`] = {\n fill: value\n };\n }\n addUtilities(fillUtilities);\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 keyframes\n if (cache.keyframes && Object.keys(cache.keyframes).length > 0) {\n const keyframeRules = {};\n for (const [name, frames] of Object.entries(cache.keyframes)) {\n keyframeRules[`@keyframes ${name}`] = frames;\n }\n addBase(keyframeRules);\n }\n\n // 8. Add animation utilities\n if (cache.animations && Object.keys(cache.animations).length > 0) {\n const animationUtilities = {};\n for (const [name, value] of Object.entries(cache.animations)) {\n animationUtilities[`.animate-${name}`] = {\n animation: value\n };\n }\n addUtilities(animationUtilities);\n }\n\n // 9. 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) {\n if (cache.custom.raw && typeof cache.custom.raw === 'string') {\n // Process the raw CSS string\n const processedCss = cache.custom.raw.replace(\n /theme\\(['\"](.*?)['\"]\\)/g, \n (match, themePath) => {\n // Split the theme path (e.g., 'colors.orange.300' -> ['colors', 'orange', '300'])\n const parts = themePath.split('.');\n \n // Get the value from theme\n let value = theme(parts[0]);\n for (let i = 1; i < parts.length; i++) {\n if (value && value[parts[i]]) {\n value = value[parts[i]];\n } else {\n value = null;\n break;\n }\n }\n \n return value || match; // Return the theme value or original if not found\n }\n );\n \n // Add the processed CSS\n addBase({\n // Using a style object with selectors\n ...processedCss.split('}')\n .filter(rule => rule.trim().length > 0)\n .map(rule => {\n const parts = rule.split('{');\n if (parts.length === 2) {\n const selector = parts[0].trim();\n const styles = parts[1].trim();\n \n // Convert CSS properties to object\n const styleObj = {};\n styles.split(';')\n .filter(prop => prop.trim().length > 0)\n .forEach(prop => {\n const [key, value] = prop.split(':').map(p => p.trim());\n if (key && value) {\n styleObj[key] = value;\n }\n });\n \n return { [selector]: styleObj };\n }\n return {};\n })\n .reduce((acc, item) => ({ ...acc, ...item }), {})\n });\n } else if (typeof cache.custom === 'object') {\n // Handle object format\n addBase(cache.custom);\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] Animations: ${Object.keys(cache.animations || {}).length}`);\n console.log(`[FrontFriend] Additional classes: ${Array.isArray(cache.cls) ? cache.cls.length : 0}`);\n }\n };\n },\n function(options = {}) {\n // Return theme configuration\n const cacheManager = new CacheManager(process.cwd());\n const cache = cacheManager.exists() ? cacheManager.load() : null;\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.cls && Array.isArray(cache.cls)) {\n console.log(`[FrontFriend] Loading ${cache.cls.length} additional 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 ...(cache?.cls || []),\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 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 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 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 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,CACtCZ,EAAG,UAAUY,EAAS,CAAE,UAAW,EAAK,CAAC,CAC3C,CAMA,SAASC,EAAgBD,EAAS,CAChCZ,EA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,CACF,CACF,EAEA,SAAU,CACR,IAAIG,GAAA,YAAAA,EAAO,WAAY,CAAC,EACxB,CACE,QAAS,6OACX,EACA,CACE,QAAS,yFACX,EACA,IAAIA,GAAA,YAAAA,EAAO,MAAO,CAAC,CACrB,EAEA,QAASN,EAAQ,SAAWoC,CAC9B,CACF,CACF,EAGA,OAAO,QAAUrC,GAMjB,OAAO,eAAe,OAAO,QAAS,SAAU,CAC9C,IAAK,UAAW,CAEd,GAAI,OAAO,cAAkB,IAC3B,OAAO,cAIT,GAAI,OAAO,OAAW,KAAe,OAAO,cAC1C,OAAO,OAAO,cAIhB,GAAI,CACF,IAAMM,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,CAEA,OAAO,IACT,CACF,CAAC,EAGD,OAAO,eAAe,OAAO,QAAS,UAAW,CAC/C,IAAK,UAAW,CAEd,GAAI,OAAO,aAAiB,IAC1B,OAAO,aAIT,GAAI,OAAO,OAAW,KAAe,OAAO,aAC1C,OAAO,OAAO,aAIhB,GAAI,CACF,IAAMD,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,CAEA,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", "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", "fontUtilities", "fontFace", "keyframeRules", "frames", "animationUtilities", "processedCss", "themePath", "parts", "i", "rule", "selector", "styles", "styleObj", "prop", "p", "acc", "item", "defaultContent"]
7
7
  }
@@ -1,2 +1,2 @@
1
- var C=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports);var $=C((b,g)=>{var k="https://app.frontfriend.dev",p="https://tokens-studio-donux.up.railway.app/api",A=".cache/frontfriend",L={JS:["tokens.js","variables.js","semanticVariables.js","semanticDarkVariables.js","cls.js","custom.js"],JSON:["fonts.json","icons.json","components-config.json","version.json","metadata.json"]},R={FF_ID:"FF_ID",FF_API_URL:"FF_API_URL"};g.exports={DEFAULT_API_URL:k,LEGACY_API_URL:p,CACHE_DIR_NAME:A,CACHE_TTL_DAYS:7,CACHE_TTL_MS:6048e5,CACHE_FILES:L,ENV_VARS:R}});var w=C((D,_)=>{var l=class extends Error{constructor(t,s,n){super(t),this.name="APIError",this.statusCode=s,this.url=n,this.code=`API_${s}`}},u=class extends Error{constructor(t,s){super(t),this.name="CacheError",this.operation=s,this.code=`CACHE_${s.toUpperCase()}`}},f=class extends Error{constructor(t,s){super(t),this.name="ConfigError",this.field=s,this.code=`CONFIG_${s.toUpperCase()}`}},d=class extends Error{constructor(t,s){super(t),this.name="ProcessingError",this.token=s,this.code="PROCESSING_ERROR"}};_.exports={APIError:l,CacheError:u,ConfigError:f,ProcessingError:d}});var y=require("https"),I=require("http"),{URL:F}=require("url"),{DEFAULT_API_URL:E,LEGACY_API_URL:h,ENV_VARS:P}=$(),{APIError:c}=w(),m=class{constructor(t,s={}){this.ffId=t,this.baseURL=s.baseURL||process.env[P.FF_API_URL]||E}fetchJson(t){return new Promise((s,n)=>{(t.startsWith("https")?y:I).get(t,e=>{let r="";if(e.statusCode>=400){n(new c(`HTTP ${e.statusCode}: ${e.statusMessage}`,e.statusCode,t));return}e.on("data",a=>{r+=a}),e.on("end",()=>{try{let a=JSON.parse(r);s(a)}catch(a){n(new c(`Invalid JSON response: ${a.message}`,e.statusCode,t))}}),e.on("error",a=>{n(new c(`Response error: ${a.message}`,e.statusCode,t))})}).on("error",e=>{n(new c(`Network error: ${e.message}`,0,t))})})}fetchRaw(t){return new Promise((s,n)=>{(t.startsWith("https")?y:I).get(t,e=>{let r="";if(e.statusCode>=400){n(new c(`HTTP ${e.statusCode}: ${e.statusMessage}`,e.statusCode,t));return}e.on("data",a=>{r+=a}),e.on("end",()=>{s(r)}),e.on("error",a=>{n(new c(`Response error: ${a.message}`,e.statusCode,t))})}).on("error",e=>{n(new c(`Network error: ${e.message}`,0,t))})})}async fetchTokens(){try{let o=`${this.baseURL}/api/design-systems/${this.ffId}/tokens`,e=await this.fetchJson(o);if(e&&e.tokens){let r=e.tokens;return{global:r["Global Tokens/Default"]||r.global||null,colors:r["Global Colors/Default"]||r.colors||null,semantic:r["Semantic/Light"]||r["semantic/light"]||null,semanticDark:r["Semantic/Dark"]||r["semantic/dark"]||null}}}catch(o){if(o.statusCode===400)throw new c("Design system not synced with Figma. Please sync tokens from Figma before using this design system.",400,`${this.baseURL}/api/design-systems/${this.ffId}/tokens`)}let t=h,s={global:`${t}/${this.ffId}/global-tokens/default.json`,colors:`${t}/${this.ffId}/global-colors/default.json`,semantic:`${t}/${this.ffId}/semantic/light.json`,semanticDark:`${t}/${this.ffId}/semantic/dark.json`},n=await Promise.all([this.fetchJson(s.global).catch(o=>o.statusCode===404?null:Promise.reject(o)),this.fetchJson(s.colors).catch(o=>o.statusCode===404?null:Promise.reject(o)),this.fetchJson(s.semantic).catch(o=>o.statusCode===404?null:Promise.reject(o)),this.fetchJson(s.semanticDark).catch(o=>o.statusCode===404?null:Promise.reject(o))]);return{global:n[0],colors:n[1],semantic:n[2],semanticDark:n[3]}}async fetchProcessedTokens(){let t=`${this.baseURL}/api/design-systems/${this.ffId}/processed-tokens`;try{return await this.fetchJson(t)}catch(s){if(s.statusCode===404)return null;throw s.statusCode===400?new c("Design system not synced with Figma. Please sync tokens from Figma before using this design system.",400,t):s}}async fetchComponentsConfig(){let t=`${h}/${this.ffId}/components-config.json`;try{return await this.fetchJson(t)}catch(s){if(s.statusCode===404)return null;throw s}}async fetchFonts(){let t=`${h}/${this.ffId}/font.json`;try{return await this.fetchJson(t)}catch(s){if(s.statusCode===404)return null;throw s}}async fetchIcons(){let t=`${h}/${this.ffId}/icons.json`;try{return await this.fetchJson(t)}catch(s){if(s.statusCode===404)return null;throw s}}async fetchVersion(){let t=`${h}/${this.ffId}/version.json`;try{return await this.fetchJson(t)}catch(s){if(s.statusCode===404)return null;throw s}}async fetchCustomCss(){let t=`${h}/${this.ffId}/custom.css`;try{return await this.fetchRaw(t)}catch(s){if(s.statusCode===404)return null;throw s}}};module.exports={APIClient:m};
1
+ var j=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var R=j((et,_)=>{var O="https://app.frontfriend.dev",N="https://tokens-studio-donux.up.railway.app/api",M=".cache/frontfriend",v={JS:["tokens.js","variables.js","semanticVariables.js","semanticDarkVariables.js","cls.js","custom.js"],JSON:["fonts.json","icons.json","components-config.json","version.json","metadata.json"]},V={FF_ID:"FF_ID",FF_API_URL:"FF_API_URL",FF_USE_LOCAL:"FF_USE_LOCAL",FF_USE_LOCAL_REGISTRY:"FF_USE_LOCAL_REGISTRY"};_.exports={DEFAULT_API_URL:O,LEGACY_API_URL:N,CACHE_DIR_NAME:M,CACHE_TTL_DAYS:7,CACHE_TTL_MS:6048e5,CACHE_FILES:v,ENV_VARS:V}});var S=j((ot,E)=>{var m=class extends Error{constructor(t,s,e){super(t),this.name="APIError",this.statusCode=s,this.url=e,this.code=`API_${s}`}},p=class extends Error{constructor(t,s){super(t),this.name="CacheError",this.operation=s,this.code=`CACHE_${s.toUpperCase()}`}},C=class extends Error{constructor(t,s){super(t),this.name="ConfigError",this.field=s,this.code=`CONFIG_${s.toUpperCase()}`}},w=class extends Error{constructor(t,s){super(t),this.name="ProcessingError",this.token=s,this.code="PROCESSING_ERROR"}};E.exports={APIError:m,CacheError:p,ConfigError:C,ProcessingError:w}});var y=j((nt,b)=>{var f=require("fs");function q(n){try{let t=f.readFileSync(n,"utf8");return JSON.parse(t)}catch(t){if(t.code==="ENOENT")return null;throw t}}function G(n){try{return f.readFileSync(n,"utf8")}catch(t){if(t.code==="ENOENT")return null;throw t}}function H(n,t,s=2){let e=JSON.stringify(t,null,s);f.writeFileSync(n,e,"utf8")}function Y(n,t){if(t==null||typeof t=="object"&&Object.keys(t).length===0||Array.isArray(t)&&t.length===0){let e=`module.exports = ${Array.isArray(t)?"[]":"{}"};`;f.writeFileSync(n,e,"utf8")}else{let s=`module.exports = ${JSON.stringify(t,null,2)};`;f.writeFileSync(n,s,"utf8")}}function B(n){return f.existsSync(n)}function W(n){f.mkdirSync(n,{recursive:!0})}function z(n){f.rmSync(n,{recursive:!0,force:!0})}b.exports={readJsonFileSafe:q,readFileSafe:G,writeJsonFile:H,writeModuleExportsFile:Y,fileExists:B,ensureDirectoryExists:W,removeDirectory:z}});var $=j((rt,L)=>{var l=require("path"),{fileExists:k}=y();function K(n,t=process.cwd()){let s=t;for(;s!==l.parse(s).root;){let e=l.join(s,n);if(k(e))return e;s=l.dirname(s)}return null}function Q(n,t=process.cwd(),s=null){let e=[],r=t,o=10;for(let i=0;i<o;i++){e.push(l.join(r,n)),i<3&&e.push(l.join(r,"../".repeat(i+1)+n));let c=l.dirname(r);if(c===r)break;r=c}e.push(l.join(__dirname,"../../../",n));for(let i of e)if(k(i)&&(!s||s(i)))return i;return null}function X(n,t=process.cwd()){let s=n.map(e=>l.isAbsolute(e)?e:l.join(t,e));for(let e of s)if(k(e))return e;return null}L.exports={findFileUpward:K,findDirectoryUpward:Q,findDirectoryWithPaths:X}});var I=j((it,T)=>{var a=require("path"),{findDirectoryUpward:D}=$(),{readJsonFileSafe:u,readFileSafe:A,fileExists:g}=y(),F=class{constructor(t,s={}){if(this.ffId=t,this.tokensBasePath=s.tokensBasePath||this.findTokensPath(),this.folderMap=this.loadFolderMap(),this.projectFolder=this.folderMap[t],!this.projectFolder)throw new Error(`No folder mapping found for ff-id: ${t}`);this.projectPath=a.join(this.tokensBasePath,this.projectFolder)}findTokensPath(){let t=D("apps/tokens",process.cwd(),s=>g(a.join(s,"folderMap.json")));if(t||(t=D("tokens",process.cwd(),s=>g(a.join(s,"folderMap.json")))),!t)throw new Error("Could not find tokens directory with folderMap.json");return t}loadFolderMap(){let t=a.join(this.tokensBasePath,"folderMap.json"),s=u(t);if(!s)throw new Error("Failed to load folderMap.json: File not found");return s}async fetchTokens(){let t=a.join(this.projectPath,"figma"),s={global:[a.join(t,"Global Tokens","Default.json"),a.join(t,"global.json")],colors:[a.join(t,"Global Colors","Default.json"),a.join(t,"Global Colors","Light.json")],semantic:[a.join(t,"Semantic","Light.json"),a.join(t,"Semantic","Default.json")],semanticDark:[a.join(t,"Semantic","Dark.json")]},e={};for(let[r,o]of Object.entries(s)){for(let i of o){let c=u(i);if(c!==null){e[r]=c;break}}e[r]||(e[r]=null)}return e}async fetchProcessedTokens(){let t=a.join(this.projectPath,"cache");if(!g(t))return null;let s={"tokens.js":"hashedTokens.js","variables.js":"hashedVariables.js","semanticVariables.js":"hashedSemanticVariables.js","semanticDarkVariables.js":"hashedSemanticDarkVariables.js","cls.js":"cls.js","custom.js":"custom.js","fonts.json":"fonts.json","icons.json":"icons.json","components-config.json":"encoded-config.json","version.json":"version.json"},e={};for(let[o,i]of Object.entries(s)){let c=a.join(t,i);o.endsWith(".js")?e[o]=A(c):e[o]=u(c)}return Object.values(e).some(o=>o!==null)?e:null}async fetchComponentsConfig(){return u(a.join(this.projectPath,"components-config.json"))}async fetchFonts(){return u(a.join(this.projectPath,"font.json"))}async fetchIcons(){return u(a.join(this.projectPath,"icons.json"))}async fetchVersion(){return u(a.join(this.projectPath,"version.json"))}async fetchCustomCss(){return A(a.join(this.projectPath,"custom.css"))}fetchJson(){throw new Error("fetchJson is not implemented in LocalTokenReader. Use specific fetch methods.")}fetchRaw(){throw new Error("fetchRaw is not implemented in LocalTokenReader. Use specific fetch methods.")}};T.exports={LocalTokenReader:F}});var U=require("https"),J=require("http"),{URL:ct}=require("url"),{DEFAULT_API_URL:Z,LEGACY_API_URL:d,ENV_VARS:x}=R(),{APIError:h}=S(),{LocalTokenReader:tt}=I(),P=class{constructor(t,s={}){this.ffId=t,this.baseURL=s.baseURL||process.env[x.FF_API_URL]||Z,process.env[x.FF_USE_LOCAL]==="true"&&(console.log(" \u{1F3E0} Using local token reader"),this.localReader=new tt(t,s))}fetchJson(t){return new Promise((s,e)=>{(t.startsWith("https")?U:J).get(t,o=>{let i="";if(o.statusCode>=400){e(new h(`HTTP ${o.statusCode}: ${o.statusMessage}`,o.statusCode,t));return}o.on("data",c=>{i+=c}),o.on("end",()=>{try{let c=JSON.parse(i);s(c)}catch(c){e(new h(`Invalid JSON response: ${c.message}`,o.statusCode,t))}}),o.on("error",c=>{e(new h(`Response error: ${c.message}`,o.statusCode,t))})}).on("error",o=>{e(new h(`Network error: ${o.message}`,0,t))})})}fetchRaw(t){return new Promise((s,e)=>{(t.startsWith("https")?U:J).get(t,o=>{let i="";if(o.statusCode>=400){e(new h(`HTTP ${o.statusCode}: ${o.statusMessage}`,o.statusCode,t));return}o.on("data",c=>{i+=c}),o.on("end",()=>{s(i)}),o.on("error",c=>{e(new h(`Response error: ${c.message}`,o.statusCode,t))})}).on("error",o=>{e(new h(`Network error: ${o.message}`,0,t))})})}async fetchTokens(){if(this.localReader)return this.localReader.fetchTokens();try{let r=`${this.baseURL}/api/design-systems/${this.ffId}/tokens`,o=await this.fetchJson(r);if(o&&o.tokens){let i=o.tokens;return{global:i["Global Tokens/Default"]||i.global||null,colors:i["Global Colors/Default"]||i.colors||null,semantic:i["Semantic/Light"]||i["semantic/light"]||null,semanticDark:i["Semantic/Dark"]||i["semantic/dark"]||null}}}catch(r){if(r.statusCode===400)throw new h("Design system not synced with Figma. Please sync tokens from Figma before using this design system.",400,`${this.baseURL}/api/design-systems/${this.ffId}/tokens`)}let t=d,s={global:`${t}/${this.ffId}/global-tokens/default.json`,colors:`${t}/${this.ffId}/global-colors/default.json`,semantic:`${t}/${this.ffId}/semantic/light.json`,semanticDark:`${t}/${this.ffId}/semantic/dark.json`},e=await Promise.all([this.fetchJson(s.global).catch(r=>r.statusCode===404?null:Promise.reject(r)),this.fetchJson(s.colors).catch(r=>r.statusCode===404?null:Promise.reject(r)),this.fetchJson(s.semantic).catch(r=>r.statusCode===404?null:Promise.reject(r)),this.fetchJson(s.semanticDark).catch(r=>r.statusCode===404?null:Promise.reject(r))]);return{global:e[0],colors:e[1],semantic:e[2],semanticDark:e[3]}}async fetchProcessedTokens(){if(this.localReader)return this.localReader.fetchProcessedTokens();let t=`${this.baseURL}/api/design-systems/${this.ffId}/processed-tokens`;try{return await this.fetchJson(t)}catch(s){if(s.statusCode===404)return null;throw s.statusCode===400?new h("Design system not synced with Figma. Please sync tokens from Figma before using this design system.",400,t):s}}async fetchComponentsConfig(){if(this.localReader)return this.localReader.fetchComponentsConfig();let t=`${d}/${this.ffId}/components-config.json`;try{return await this.fetchJson(t)}catch(s){if(s.statusCode===404)return null;throw s}}async fetchFonts(){if(this.localReader)return this.localReader.fetchFonts();let t=`${d}/${this.ffId}/font.json`;try{return await this.fetchJson(t)}catch(s){if(s.statusCode===404)return null;throw s}}async fetchIcons(){if(this.localReader)return this.localReader.fetchIcons();let t=`${d}/${this.ffId}/icons.json`;try{return await this.fetchJson(t)}catch(s){if(s.statusCode===404)return null;throw s}}async fetchVersion(){if(this.localReader)return this.localReader.fetchVersion();let t=`${d}/${this.ffId}/version.json`;try{return await this.fetchJson(t)}catch(s){if(s.statusCode===404)return null;throw s}}async fetchCustomCss(){if(this.localReader)return this.localReader.fetchCustomCss();let t=`${d}/${this.ffId}/custom.css`;try{return await this.fetchRaw(t)}catch(s){if(s.statusCode===404)return null;throw s}}};module.exports={APIClient:P};
2
2
  //# sourceMappingURL=api-client.js.map