@frontfriend/tailwind 2.0.0 → 2.1.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/README.md +2 -2
- package/dist/cli.js +19 -16
- package/dist/ffdc.d.ts +6 -0
- package/dist/ffdc.js +1 -1
- package/dist/ffdc.js.map +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +2 -2
- package/dist/lib/config/cache-manager.js +14 -2
- package/dist/lib/core/api-client.js +1 -1
- package/dist/lib/core/api-client.js.map +3 -3
- package/dist/lib/core/component-downloader.js +2 -1
- package/dist/lib/core/component-downloader.js.map +3 -3
- package/dist/lib/core/constants.js +1 -1
- package/dist/lib/core/constants.js.map +3 -3
- package/dist/lib/core/token-processor.js +1 -1
- package/dist/lib/core/token-processor.js.map +3 -3
- package/dist/lib/react/utils.d.ts +25 -0
- package/dist/lib/vue/utils.d.ts +25 -0
- package/dist/next.d.ts +8 -0
- package/dist/next.js +1 -1
- package/dist/next.js.map +3 -3
- package/dist/runtime.d.ts +13 -0
- package/dist/types/index.d.ts +13 -2
- package/dist/vite.d.ts +7 -0
- package/dist/vite.js +3 -3
- package/dist/vite.js.map +3 -3
- package/dist/vite.mjs +1 -1
- package/dist/vite.mjs.map +3 -3
- package/package.json +26 -15
package/README.md
CHANGED
|
@@ -76,9 +76,9 @@ For Next.js projects:
|
|
|
76
76
|
|
|
77
77
|
```js
|
|
78
78
|
// next.config.js
|
|
79
|
-
const
|
|
79
|
+
const frontfriend = require('@frontfriend/tailwind/next');
|
|
80
80
|
|
|
81
|
-
module.exports =
|
|
81
|
+
module.exports = frontfriend({
|
|
82
82
|
// Your Next.js config
|
|
83
83
|
});
|
|
84
84
|
```
|
package/dist/cli.js
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var{Command:
|
|
3
|
-
`);let
|
|
4
|
-
Please add "ff-id" to your frontfriend.config.js file`,"ff-id");console.log("\u{1F4CB} Configuration loaded"),console.log(` FF_ID: ${
|
|
5
|
-
`);let l=new
|
|
2
|
+
var{Command:v}=require("commander"),m=require("./lib/config/config-loader"),h=require("./lib/config/cache-manager"),{APIClient:y}=require("./lib/core/api-client"),{ComponentDownloader:b}=require("./lib/core/component-downloader"),x=require("./lib/core/token-processor"),{ConfigError:d,APIError:D,CacheError:w}=require("./lib/core/errors"),I=require("path"),i=new v;i.name("frontfriend").description("FrontFriend Tailwind CLI - Manage design tokens and cache").version("2.0.0");i.command("init").description("Initialize FrontFriend configuration and fetch from API").option("--force","Force refresh even if cache is valid").action(async n=>{try{console.log("\u{1F527} FrontFriend Setup"),console.log(`==================
|
|
3
|
+
`);let o=await new m().load();if(!o.ffId)throw new d(`ff-id not found in frontfriend.config.js
|
|
4
|
+
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}
|
|
5
|
+
`);let l=new h(o.appRoot);!n.force&&l.exists()&&l.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..."),n.force?console.log(` Force refresh requested
|
|
6
6
|
`):l.exists()?console.log(` Cache expired
|
|
7
7
|
`):console.log(` No cache found
|
|
8
|
-
`),console.log("\u{1F310} Fetching configuration...");let c=new
|
|
9
|
-
`),console.log("\
|
|
10
|
-
`)
|
|
11
|
-
`),
|
|
12
|
-
`);let
|
|
13
|
-
`);let a=
|
|
14
|
-
`)
|
|
15
|
-
`);let
|
|
16
|
-
|
|
17
|
-
`);let
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
`),console.log("\u{1F310} Fetching configuration...");let c=new y(o.ffId,{baseURL:o["api-url"]||o.apiUrl});(o["api-url"]||o.apiUrl)&&console.log(` Using API URL: ${o["api-url"]||o.apiUrl}`);let r=null;try{r=await c.fetchProcessedTokens()}catch(u){console.log(` \u26A0\uFE0F Failed to fetch pre-processed tokens: ${u.message}`)}r&&(console.log(" \u2713 Pre-processed tokens fetched from server"),console.log(` \u2713 Skipping local processing
|
|
9
|
+
`),console.log("\u{1F4BE} Saving cache..."),l.save(r),console.log(` \u2713 Cache saved successfully
|
|
10
|
+
`),console.log("\u2705 Setup complete!"),console.log(" Your FrontFriend configuration has been cached."),console.log(" The Tailwind plugin will now use this cached data."),process.exit(0)),console.log(` \u2139\uFE0F Pre-processed tokens not available, falling back to local processing
|
|
11
|
+
`);let[e,a,g,k,p,$]=await Promise.all([c.fetchTokens(),c.fetchComponentsConfig(),c.fetchFonts(),c.fetchIcons(),c.fetchVersion(),c.fetchCustomCss()]);if(console.log(" \u2713 Tokens fetched"),e.global||e.colors||e.semantic||e.semanticDark){let u=[e.global?"global":null,e.colors?"colors":null,e.semantic?"semantic":null,e.semanticDark?"semanticDark":null].filter(Boolean).join(", ");console.log(` (Found: ${u})`)}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
|
|
12
|
+
`),console.log("\u2699\uFE0F Processing tokens...");let C=new x;console.log(" Processing raw token data...");let t=await C.process({colors:e.colors||e.global,semantic:e.semantic,semanticDark:e.semanticDark,fonts:g,globalTokens:e.global,animations:e.animations,version:p==null?void 0:p.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(`
|
|
13
|
+
`);let F=C.extractClassesFromComponentsConfig(a),f={tokens:t.utilities,variables:t.variables,semanticVariables:t.semanticVariables,semanticDarkVariables:t.semanticDarkVariables,fonts:t.fontFaces,icons:k,componentsConfig:a,keyframes:t.keyframes,animations:t.animations,safelist:t.safelist,version:p,metadata:t.metadata,cls:F||[],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`),l.save(f),console.log(` \u2713 Cache saved successfully
|
|
14
|
+
`),console.log("\u2705 Setup complete!"),console.log(" Your FrontFriend configuration has been cached."),console.log(" The Tailwind plugin will now use this cached data."),process.exit(0)}catch(s){s instanceof d?console.error("\u274C Configuration Error:",s.message):s instanceof D?(console.error("\u274C API Error:",s.message),console.error(` Status: ${s.statusCode}`),console.error(` URL: ${s.url}`)):s instanceof w?(console.error("\u274C Cache Error:",s.message),console.error(` Operation: ${s.operation}`)):console.error("\u274C Setup failed:",s.message),process.exit(1)}});i.command("clean").description("Remove cached configuration").action(async()=>{try{console.log(`\u{1F9F9} Cleaning FrontFriend cache...
|
|
15
|
+
`);let s=new m().load(),o=new h(s.appRoot);o.exists()?(o.clear(),console.log("\u2705 Cache cleared successfully")):console.log("\u2139\uFE0F No cache found"),process.exit(0)}catch(n){n instanceof w?(console.error("\u274C Cache Error:",n.message),console.error(` Operation: ${n.operation}`)):console.error("\u274C Clean failed:",n.message),process.exit(1)}});i.command("status").description("Show cache status and configuration").action(async()=>{try{console.log("\u{1F4CA} FrontFriend Status"),console.log(`===================
|
|
16
|
+
`);let s=await new m().load();console.log("Configuration:"),console.log(` FF_ID: ${s.ffId||"Not set"}`),console.log(` App Root: ${s.appRoot}
|
|
17
|
+
`);let o=new h(s.appRoot),l=o.getCacheDir();if(console.log("Cache:"),console.log(` Directory: ${I.relative(process.cwd(),l)}`),o.exists()){console.log(` Status: ${o.isValid()?"\u2705 Valid":"\u26A0\uFE0F Expired"}`);let c=o.load();if(c&&c.metadata){let r=new Date(c.metadata.timestamp);console.log(` Created: ${r.toLocaleString()}`),console.log(` Version: ${c.metadata.version||"Unknown"}`)}}else console.log(" Status: \u274C Not found");process.exit(0)}catch(n){n instanceof d?console.error("\u274C Configuration Error:",n.message):n instanceof w?(console.error("\u274C Cache Error:",n.message),console.error(` Operation: ${n.operation}`)):console.error("\u274C Status check failed:",n.message),process.exit(1)}});i.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(n,s)=>{try{console.log(`\u{1F4E6} Downloading components...
|
|
18
|
+
`);let l=await new m().load();if(!l.ffId)throw new d(`ff-id not found in frontfriend.config.js
|
|
19
|
+
Please add "ff-id" to your frontfriend.config.js file`,"ff-id");let c=new b({appRoot:l.appRoot,config:l,framework:s.framework,outputPath:s.output,overwrite:s.overwrite}),r=n;if(n.length===1&&n[0].toLowerCase()==="all"){let a=await c.getAllComponents(),g=await c.getCustomComponents();a.length===0&&(console.error("\u274C Failed to fetch component list"),process.exit(1)),r=[...a,...g],console.log("\u{1F4CB} Configuration"),console.log(` Framework: ${c.framework}`),console.log(` Output: ${c.outputPath}`),console.log(` Components: All ${a.length} standard components`),g.length>0&&console.log(` Custom: ${g.length} custom components for ff-id: ${l.ffId||l["ff-id"]}`),console.log("")}else console.log("\u{1F4CB} Configuration"),console.log(` Framework: ${c.framework}`),console.log(` Output: ${c.outputPath}`),console.log(` Components: ${n.join(", ")}
|
|
20
|
+
`);let e=await c.downloadComponents(r);e.successful.length>0&&(console.log(`
|
|
21
|
+
\u2705 Download complete!`),console.log(` Downloaded: ${e.successful.length} components`)),e.failed.length>0&&(console.log(""),e.failed.forEach(a=>{a.error.includes("not found")?console.log(`\u274C ${a.error}`):console.log(`\u274C Failed to download ${a.component}: ${a.error}`)})),e.successful.length>0&&e.dependencies.length>0&&(console.log(`
|
|
22
|
+
\u{1F4E6} Install dependencies:`),console.log(` npm install ${e.dependencies.join(" ")}`)),e.successful.length===0&&e.failed.length>0&&process.exit(1),process.exit(0)}catch(o){o instanceof d?(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)}});i.parse(process.argv);process.argv.slice(2).length||(i.outputHelp(),process.exit(0));
|
|
20
23
|
//# sourceMappingURL=cli-temp.js.map
|
package/dist/ffdc.d.ts
ADDED
package/dist/ffdc.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
module.exports=function(r){if(!r)
|
|
1
|
+
module.exports=function(r){if(!r)return{};if(typeof r!="object")throw new Error("Config must be an object");return r};
|
|
2
2
|
//# sourceMappingURL=ffdc.js.map
|
package/dist/ffdc.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../ffdc.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
|
|
5
|
-
"mappings": "AAGA,OAAO,QAAU,SAAcA,EAAQ,CACrC,GAAI,CAACA,EACH,
|
|
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};"],
|
|
5
|
+
"mappings": "AAGA,OAAO,QAAU,SAAcA,EAAQ,CACrC,GAAI,CAACA,EACH,MAAO,CAAC,EAGV,GAAI,OAAOA,GAAW,SACpB,MAAM,IAAI,MAAM,0BAA0B,EAG5C,OAAOA,CACT",
|
|
6
6
|
"names": ["config"]
|
|
7
7
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var k=(s,o)=>()=>(o||s((o={exports:{}}).exports,o),o.exports);var g=k(($,x)=>{x.exports=function(o){if(!o)
|
|
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();
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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 throw new Error('Config is required');\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,
|
|
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,GAAI,OAAOA,GAAW,SACpB,MAAM,IAAI,MAAM,0BAA0B,EAG5C,OAAOA,CACT,ICbA,IAAMC,EAAS,QAAQ,oBAAoB,EACrCC,EAAe,QAAQ,4BAA4B,EAEzD,SAASC,EAAcC,EAAQ,CAC7B,OAAO,OAAO,YACZ,OAAO,QAAQA,CAAM,EAAE,OAAO,CAAC,CAACC,CAAG,IAAMA,IAAQ,SAAS,CAC5D,CACF,CAEA,IAAMC,EAAeL,EAAO,YAC1B,SAASM,EAAU,CAAC,EAAG,CACrB,OAAO,SAAS,CAAE,QAAAC,EAAS,aAAAC,EAAc,MAAAC,EAAO,eAAAC,CAAe,EAAG,CAEhE,IAAMC,EAAe,IAAIV,EAAa,QAAQ,IAAI,CAAC,EAEnD,GAAI,CAACU,EAAa,OAAO,EAAG,CAC1B,QAAQ,KAAK,yEAAyE,EACtF,MACF,CAEKA,EAAa,QAAQ,GACxB,QAAQ,KAAK,gFAAgF,EAG/F,IAAMC,EAAQD,EAAa,KAAK,EAChC,GAAI,CAACC,EAAO,CAC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AIC,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
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"]
|
|
7
7
|
}
|
|
@@ -143,8 +143,20 @@ class CacheManager {
|
|
|
143
143
|
for (const key of jsFiles) {
|
|
144
144
|
if (data[key] !== undefined) {
|
|
145
145
|
const filePath = path.join(this.cacheDir, `${key}.js`);
|
|
146
|
-
const
|
|
147
|
-
|
|
146
|
+
const value = data[key];
|
|
147
|
+
|
|
148
|
+
// Ensure we have actual data to save
|
|
149
|
+
if (value === null || value === undefined ||
|
|
150
|
+
(typeof value === 'object' && Object.keys(value).length === 0) ||
|
|
151
|
+
(Array.isArray(value) && value.length === 0)) {
|
|
152
|
+
// For empty objects/arrays, save a proper empty structure
|
|
153
|
+
const emptyContent = Array.isArray(value) ? '[]' : '{}';
|
|
154
|
+
const content = `module.exports = ${emptyContent};`;
|
|
155
|
+
fs.writeFileSync(filePath, content);
|
|
156
|
+
} else {
|
|
157
|
+
const content = `module.exports = ${JSON.stringify(value, null, 2)};`;
|
|
158
|
+
fs.writeFileSync(filePath, content);
|
|
159
|
+
}
|
|
148
160
|
}
|
|
149
161
|
}
|
|
150
162
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
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};
|
|
2
2
|
//# sourceMappingURL=api-client.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../lib/core/constants.js", "../../../lib/core/errors.js", "../../../lib/core/api-client.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * Configuration constants for FrontFriend Tailwind v2\n */\n\n// API Configuration\nconst DEFAULT_API_URL = 'https://tokens-studio-donux.up.railway.app/api';\n\n// Cache Configuration\nconst CACHE_DIR_NAME = '.cache/frontfriend';\nconst CACHE_TTL_DAYS = 7;\nconst CACHE_TTL_MS = CACHE_TTL_DAYS * 24 * 60 * 60 * 1000;\n\n// File names\nconst CACHE_FILES = {\n JS: [\n 'tokens.js',\n 'variables.js',\n 'semanticVariables.js',\n 'semanticDarkVariables.js',\n 'cls.js',\n 'custom.js'\n ],\n JSON: [\n 'fonts.json',\n 'icons.json',\n 'components-config.json',\n 'version.json',\n 'metadata.json'\n ]\n};\n\n// Environment variables\nconst ENV_VARS = {\n FF_ID: 'FF_ID',\n FF_API_URL: 'FF_API_URL'\n};\n\nmodule.exports = {\n DEFAULT_API_URL,\n CACHE_DIR_NAME,\n CACHE_TTL_DAYS,\n CACHE_TTL_MS,\n CACHE_FILES,\n ENV_VARS\n};", "class APIError extends Error {\n constructor(message, statusCode, url) {\n super(message);\n this.name = 'APIError';\n this.statusCode = statusCode;\n this.url = url;\n this.code = `API_${statusCode}`;\n }\n}\n\nclass CacheError extends Error {\n constructor(message, operation) {\n super(message);\n this.name = 'CacheError';\n this.operation = operation;\n this.code = `CACHE_${operation.toUpperCase()}`;\n }\n}\n\nclass ConfigError extends Error {\n constructor(message, field) {\n super(message);\n this.name = 'ConfigError';\n this.field = field;\n this.code = `CONFIG_${field.toUpperCase()}`;\n }\n}\n\nclass ProcessingError extends Error {\n constructor(message, token) {\n super(message);\n this.name = 'ProcessingError';\n this.token = token;\n this.code = 'PROCESSING_ERROR';\n }\n}\n\nmodule.exports = {\n APIError,\n CacheError,\n ConfigError,\n ProcessingError\n};", "const https = require('https');\nconst { URL } = require('url');\nconst { DEFAULT_API_URL, ENV_VARS } = require('./constants');\nconst { APIError } = require('./errors');\n\nclass APIClient {\n constructor(ffId, options = {}) {\n this.ffId = ffId;\n this.baseURL = options.baseURL || process.env[ENV_VARS.FF_API_URL] || DEFAULT_API_URL;\n }\n\n /**\n * Fetch JSON data from a URL using native https module\n * @param {string} url - The URL to fetch\n * @returns {Promise<any>} Parsed JSON data\n */\n fetchJson(url) {\n return new Promise((resolve, reject) => {\n https.get(url, (response) => {\n let data = '';\n \n // Check for HTTP errors\n if (response.statusCode >= 400) {\n reject(new APIError(\n `HTTP ${response.statusCode}: ${response.statusMessage}`,\n response.statusCode,\n url\n ));\n return;\n }\n\n // Collect response chunks\n response.on('data', (chunk) => {\n data += chunk;\n });\n\n // Parse JSON when complete\n response.on('end', () => {\n try {\n const parsed = JSON.parse(data);\n resolve(parsed);\n } catch (error) {\n reject(new APIError(\n `Invalid JSON response: ${error.message}`,\n response.statusCode,\n url\n ));\n }\n });\n\n // Handle response errors\n response.on('error', (error) => {\n reject(new APIError(\n `Response error: ${error.message}`,\n response.statusCode,\n url\n ));\n });\n }).on('error', (error) => {\n // Handle network errors\n reject(new APIError(\n `Network error: ${error.message}`,\n 0,\n url\n ));\n });\n });\n }\n\n /**\n * Fetch raw content from a URL\n * @param {string} url - The URL to fetch\n * @returns {Promise<string>} Raw text content\n */\n fetchRaw(url) {\n return new Promise((resolve, reject) => {\n https.get(url, (response) => {\n let data = '';\n \n // Check for HTTP errors\n if (response.statusCode >= 400) {\n reject(new APIError(\n `HTTP ${response.statusCode}: ${response.statusMessage}`,\n response.statusCode,\n url\n ));\n return;\n }\n\n // Collect response chunks\n response.on('data', (chunk) => {\n data += chunk;\n });\n\n // Return raw data when complete\n response.on('end', () => {\n resolve(data);\n });\n\n // Handle response errors\n response.on('error', (error) => {\n reject(new APIError(\n `Response error: ${error.message}`,\n response.statusCode,\n url\n ));\n });\n }).on('error', (error) => {\n // Handle network errors\n reject(new APIError(\n `Network error: ${error.message}`,\n 0,\n url\n ));\n });\n });\n }\n\n /**\n * Fetch all token files (global, colors, semantic)\n * @returns {Promise<Object>} Object with all token data\n */\n async fetchTokens() {\n const urls = {\n global: `${this.baseURL}/${this.ffId}/global-tokens/default.json`,\n colors: `${this.baseURL}/${this.ffId}/global-colors/default.json`,\n semantic: `${this.baseURL}/${this.ffId}/semantic/light.json`,\n semanticDark: `${this.baseURL}/${this.ffId}/semantic/dark.json`\n };\n\n const results = await Promise.all([\n this.fetchJson(urls.global).catch(err => err.statusCode === 404 ? null : Promise.reject(err)),\n this.fetchJson(urls.colors).catch(err => err.statusCode === 404 ? null : Promise.reject(err)),\n this.fetchJson(urls.semantic).catch(err => err.statusCode === 404 ? null : Promise.reject(err)),\n this.fetchJson(urls.semanticDark).catch(err => err.statusCode === 404 ? null : Promise.reject(err))\n ]);\n\n return {\n global: results[0],\n colors: results[1],\n semantic: results[2],\n semanticDark: results[3]\n };\n }\n\n /**\n * Fetch components configuration\n * @returns {Promise<Object|null>} Components config or null if not found\n */\n async fetchComponentsConfig() {\n const url = `${this.baseURL}/${this.ffId}/components-config.json`;\n try {\n return await this.fetchJson(url);\n } catch (error) {\n if (error.statusCode === 404) {\n return null;\n }\n throw error;\n }\n }\n\n /**\n * Fetch fonts configuration\n * @returns {Promise<Object|null>} Fonts object with font1, font2, etc. URLs or null\n */\n async fetchFonts() {\n const url = `${this.baseURL}/${this.ffId}/font.json`;\n try {\n return await this.fetchJson(url);\n } catch (error) {\n if (error.statusCode === 404) {\n return null;\n }\n throw error;\n }\n }\n\n /**\n * Fetch icons configuration\n * @returns {Promise<Object|null>} Icons data or null if not found\n */\n async fetchIcons() {\n const url = `${this.baseURL}/${this.ffId}/icons.json`;\n try {\n return await this.fetchJson(url);\n } catch (error) {\n if (error.statusCode === 404) {\n return null;\n }\n throw error;\n }\n }\n\n /**\n * Fetch version information\n * @returns {Promise<Object|null>} Version data or null if not found\n */\n async fetchVersion() {\n const url = `${this.baseURL}/${this.ffId}/version.json`;\n try {\n return await this.fetchJson(url);\n } catch (error) {\n if (error.statusCode === 404) {\n return null;\n }\n throw error;\n }\n }\n\n /**\n * Fetch custom CSS\n * @returns {Promise<string|null>} Custom CSS string or null if not found\n */\n async fetchCustomCss() {\n const url = `${this.baseURL}/${this.ffId}/custom.css`;\n try {\n return await this.fetchRaw(url);\n } catch (error) {\n if (error.statusCode === 404) {\n return null;\n }\n throw error;\n }\n }\n}\n\nmodule.exports = { APIClient };"],
|
|
5
|
-
"mappings": "8DAAA,IAAAA,EAAAC,EAAA,CAAAC,EAAAC,IAAA,CAKA,IAAMC,EAAkB,
|
|
6
|
-
"names": ["require_constants", "__commonJSMin", "exports", "module", "DEFAULT_API_URL", "CACHE_DIR_NAME", "CACHE_FILES", "ENV_VARS", "require_errors", "__commonJSMin", "exports", "module", "APIError", "message", "statusCode", "url", "CacheError", "operation", "ConfigError", "field", "ProcessingError", "token", "https", "URL", "DEFAULT_API_URL", "ENV_VARS", "APIError", "APIClient", "ffId", "options", "url", "resolve", "reject", "response", "data", "chunk", "parsed", "error", "urls", "results", "
|
|
4
|
+
"sourcesContent": ["/**\n * Configuration constants for FrontFriend Tailwind v2\n */\n\n// API Configuration\nconst DEFAULT_API_URL = 'https://app.frontfriend.dev';\nconst LEGACY_API_URL = 'https://tokens-studio-donux.up.railway.app/api';\n\n// Cache Configuration\nconst CACHE_DIR_NAME = '.cache/frontfriend';\nconst CACHE_TTL_DAYS = 7;\nconst CACHE_TTL_MS = CACHE_TTL_DAYS * 24 * 60 * 60 * 1000;\n\n// File names\nconst CACHE_FILES = {\n JS: [\n 'tokens.js',\n 'variables.js',\n 'semanticVariables.js',\n 'semanticDarkVariables.js',\n 'cls.js',\n 'custom.js'\n ],\n JSON: [\n 'fonts.json',\n 'icons.json',\n 'components-config.json',\n 'version.json',\n 'metadata.json'\n ]\n};\n\n// Environment variables\nconst ENV_VARS = {\n FF_ID: 'FF_ID',\n FF_API_URL: 'FF_API_URL'\n};\n\nmodule.exports = {\n DEFAULT_API_URL,\n LEGACY_API_URL,\n CACHE_DIR_NAME,\n CACHE_TTL_DAYS,\n CACHE_TTL_MS,\n CACHE_FILES,\n ENV_VARS\n};", "class APIError extends Error {\n constructor(message, statusCode, url) {\n super(message);\n this.name = 'APIError';\n this.statusCode = statusCode;\n this.url = url;\n this.code = `API_${statusCode}`;\n }\n}\n\nclass CacheError extends Error {\n constructor(message, operation) {\n super(message);\n this.name = 'CacheError';\n this.operation = operation;\n this.code = `CACHE_${operation.toUpperCase()}`;\n }\n}\n\nclass ConfigError extends Error {\n constructor(message, field) {\n super(message);\n this.name = 'ConfigError';\n this.field = field;\n this.code = `CONFIG_${field.toUpperCase()}`;\n }\n}\n\nclass ProcessingError extends Error {\n constructor(message, token) {\n super(message);\n this.name = 'ProcessingError';\n this.token = token;\n this.code = 'PROCESSING_ERROR';\n }\n}\n\nmodule.exports = {\n APIError,\n CacheError,\n ConfigError,\n ProcessingError\n};", "const https = require('https');\nconst http = require('http');\nconst { URL } = require('url');\nconst { DEFAULT_API_URL, LEGACY_API_URL, ENV_VARS } = require('./constants');\nconst { APIError } = require('./errors');\n\nclass APIClient {\n constructor(ffId, options = {}) {\n this.ffId = ffId;\n this.baseURL = options.baseURL || process.env[ENV_VARS.FF_API_URL] || DEFAULT_API_URL;\n }\n\n /**\n * Fetch JSON data from a URL using native https module\n * @param {string} url - The URL to fetch\n * @returns {Promise<any>} Parsed JSON data\n */\n fetchJson(url) {\n return new Promise((resolve, reject) => {\n // Determine if we should use http or https\n const protocol = url.startsWith('https') ? https : http;\n \n protocol.get(url, (response) => {\n let data = '';\n \n // Check for HTTP errors\n if (response.statusCode >= 400) {\n reject(new APIError(\n `HTTP ${response.statusCode}: ${response.statusMessage}`,\n response.statusCode,\n url\n ));\n return;\n }\n\n // Collect response chunks\n response.on('data', (chunk) => {\n data += chunk;\n });\n\n // Parse JSON when complete\n response.on('end', () => {\n try {\n const parsed = JSON.parse(data);\n resolve(parsed);\n } catch (error) {\n reject(new APIError(\n `Invalid JSON response: ${error.message}`,\n response.statusCode,\n url\n ));\n }\n });\n\n // Handle response errors\n response.on('error', (error) => {\n reject(new APIError(\n `Response error: ${error.message}`,\n response.statusCode,\n url\n ));\n });\n }).on('error', (error) => {\n // Handle network errors\n reject(new APIError(\n `Network error: ${error.message}`,\n 0,\n url\n ));\n });\n });\n }\n\n /**\n * Fetch raw content from a URL\n * @param {string} url - The URL to fetch\n * @returns {Promise<string>} Raw text content\n */\n fetchRaw(url) {\n return new Promise((resolve, reject) => {\n // Determine if we should use http or https\n const protocol = url.startsWith('https') ? https : http;\n \n protocol.get(url, (response) => {\n let data = '';\n \n // Check for HTTP errors\n if (response.statusCode >= 400) {\n reject(new APIError(\n `HTTP ${response.statusCode}: ${response.statusMessage}`,\n response.statusCode,\n url\n ));\n return;\n }\n\n // Collect response chunks\n response.on('data', (chunk) => {\n data += chunk;\n });\n\n // Return raw data when complete\n response.on('end', () => {\n resolve(data);\n });\n\n // Handle response errors\n response.on('error', (error) => {\n reject(new APIError(\n `Response error: ${error.message}`,\n response.statusCode,\n url\n ));\n });\n }).on('error', (error) => {\n // Handle network errors\n reject(new APIError(\n `Network error: ${error.message}`,\n 0,\n url\n ));\n });\n });\n }\n\n /**\n * Fetch all token files (global, colors, semantic)\n * @returns {Promise<Object>} Object with all token data\n */\n async fetchTokens() {\n // First try the new design system endpoint\n try {\n const designSystemUrl = `${this.baseURL}/api/design-systems/${this.ffId}/tokens`;\n const tokensData = await this.fetchJson(designSystemUrl);\n \n // If we have the new format, parse it\n if (tokensData && tokensData.tokens) {\n const tokens = tokensData.tokens;\n \n // Extract specific token sets from the new format\n return {\n global: tokens['Global Tokens/Default'] || tokens['global'] || null,\n colors: tokens['Global Colors/Default'] || tokens['colors'] || null,\n semantic: tokens['Semantic/Light'] || tokens['semantic/light'] || null,\n semanticDark: tokens['Semantic/Dark'] || tokens['semantic/dark'] || null\n };\n }\n } catch (err) {\n // If design system is not synced (400 error), throw with clear message\n if (err.statusCode === 400) {\n throw new APIError(\n 'Design system not synced with Figma. Please sync tokens from Figma before using this design system.',\n 400,\n `${this.baseURL}/api/design-systems/${this.ffId}/tokens`\n );\n }\n // Failed to fetch from design system endpoint, falling back to legacy URLs\n }\n \n // Fall back to legacy token URLs\n // Use legacy API URL for backward compatibility\n const legacyBaseURL = LEGACY_API_URL;\n const urls = {\n global: `${legacyBaseURL}/${this.ffId}/global-tokens/default.json`,\n colors: `${legacyBaseURL}/${this.ffId}/global-colors/default.json`,\n semantic: `${legacyBaseURL}/${this.ffId}/semantic/light.json`,\n semanticDark: `${legacyBaseURL}/${this.ffId}/semantic/dark.json`\n };\n\n const results = await Promise.all([\n this.fetchJson(urls.global).catch(err => err.statusCode === 404 ? null : Promise.reject(err)),\n this.fetchJson(urls.colors).catch(err => err.statusCode === 404 ? null : Promise.reject(err)),\n this.fetchJson(urls.semantic).catch(err => err.statusCode === 404 ? null : Promise.reject(err)),\n this.fetchJson(urls.semanticDark).catch(err => err.statusCode === 404 ? null : Promise.reject(err))\n ]);\n\n return {\n global: results[0],\n colors: results[1],\n semantic: results[2],\n semanticDark: results[3]\n };\n }\n\n /**\n * Fetch pre-processed tokens from the design system endpoint\n * @returns {Promise<Object|null>} Processed tokens ready for caching or null if not found\n */\n async fetchProcessedTokens() {\n const processedUrl = `${this.baseURL}/api/design-systems/${this.ffId}/processed-tokens`;\n try {\n return await this.fetchJson(processedUrl);\n } catch (error) {\n if (error.statusCode === 404) {\n return null;\n }\n // If design system is not synced (400 error), throw with clear message\n if (error.statusCode === 400) {\n throw new APIError(\n 'Design system not synced with Figma. Please sync tokens from Figma before using this design system.',\n 400,\n processedUrl\n );\n }\n throw error;\n }\n }\n\n /**\n * Fetch components configuration\n * @returns {Promise<Object|null>} Components config or null if not found\n */\n async fetchComponentsConfig() {\n // Always use legacy URL for these endpoints\n const url = `${LEGACY_API_URL}/${this.ffId}/components-config.json`;\n try {\n return await this.fetchJson(url);\n } catch (error) {\n if (error.statusCode === 404) {\n return null;\n }\n throw error;\n }\n }\n\n /**\n * Fetch fonts configuration\n * @returns {Promise<Object|null>} Fonts object with font1, font2, etc. URLs or null\n */\n async fetchFonts() {\n // Always use legacy URL for these endpoints\n const url = `${LEGACY_API_URL}/${this.ffId}/font.json`;\n try {\n return await this.fetchJson(url);\n } catch (error) {\n if (error.statusCode === 404) {\n return null;\n }\n throw error;\n }\n }\n\n /**\n * Fetch icons configuration\n * @returns {Promise<Object|null>} Icons data or null if not found\n */\n async fetchIcons() {\n // Always use legacy URL for these endpoints\n const url = `${LEGACY_API_URL}/${this.ffId}/icons.json`;\n try {\n return await this.fetchJson(url);\n } catch (error) {\n if (error.statusCode === 404) {\n return null;\n }\n throw error;\n }\n }\n\n /**\n * Fetch version information\n * @returns {Promise<Object|null>} Version data or null if not found\n */\n async fetchVersion() {\n // Always use legacy URL for these endpoints\n const url = `${LEGACY_API_URL}/${this.ffId}/version.json`;\n try {\n return await this.fetchJson(url);\n } catch (error) {\n if (error.statusCode === 404) {\n return null;\n }\n throw error;\n }\n }\n\n /**\n * Fetch custom CSS\n * @returns {Promise<string|null>} Custom CSS string or null if not found\n */\n async fetchCustomCss() {\n // Always use legacy URL for these endpoints\n const url = `${LEGACY_API_URL}/${this.ffId}/custom.css`;\n try {\n return await this.fetchRaw(url);\n } catch (error) {\n if (error.statusCode === 404) {\n return null;\n }\n throw error;\n }\n }\n}\n\nmodule.exports = { APIClient };"],
|
|
5
|
+
"mappings": "8DAAA,IAAAA,EAAAC,EAAA,CAAAC,EAAAC,IAAA,CAKA,IAAMC,EAAkB,8BAClBC,EAAiB,iDAGjBC,EAAiB,qBAKjBC,EAAc,CAClB,GAAI,CACF,YACA,eACA,uBACA,2BACA,SACA,WACF,EACA,KAAM,CACJ,aACA,aACA,yBACA,eACA,eACF,CACF,EAGMC,EAAW,CACf,MAAO,QACP,WAAY,YACd,EAEAL,EAAO,QAAU,CACf,gBAAAC,EACA,eAAAC,EACA,eAAAC,EACA,iBACA,oBACA,YAAAC,EACA,SAAAC,CACF,IC9CA,IAAAC,EAAAC,EAAA,CAAAC,EAAAC,IAAA,KAAMC,EAAN,cAAuB,KAAM,CAC3B,YAAYC,EAASC,EAAYC,EAAK,CACpC,MAAMF,CAAO,EACb,KAAK,KAAO,WACZ,KAAK,WAAaC,EAClB,KAAK,IAAMC,EACX,KAAK,KAAO,OAAOD,CAAU,EAC/B,CACF,EAEME,EAAN,cAAyB,KAAM,CAC7B,YAAYH,EAASI,EAAW,CAC9B,MAAMJ,CAAO,EACb,KAAK,KAAO,aACZ,KAAK,UAAYI,EACjB,KAAK,KAAO,SAASA,EAAU,YAAY,CAAC,EAC9C,CACF,EAEMC,EAAN,cAA0B,KAAM,CAC9B,YAAYL,EAASM,EAAO,CAC1B,MAAMN,CAAO,EACb,KAAK,KAAO,cACZ,KAAK,MAAQM,EACb,KAAK,KAAO,UAAUA,EAAM,YAAY,CAAC,EAC3C,CACF,EAEMC,EAAN,cAA8B,KAAM,CAClC,YAAYP,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F,OAAO,MAAM,KAAK,UAAUM,CAAG,CACjC,OAASO,EAAO,CACd,GAAIA,EAAM,aAAe,IACvB,OAAO,KAET,MAAMA,CACR,CACF,CAMA,MAAM,YAAa,CAEjB,IAAMP,EAAM,GAAGN,CAAc,IAAI,KAAK,IAAI,aAC1C,GAAI,CACF,OAAO,MAAM,KAAK,UAAUM,CAAG,CACjC,OAASO,EAAO,CACd,GAAIA,EAAM,aAAe,IACvB,OAAO,KAET,MAAMA,CACR,CACF,CAMA,MAAM,YAAa,CAEjB,IAAMP,EAAM,GAAGN,CAAc,IAAI,KAAK,IAAI,cAC1C,GAAI,CACF,OAAO,MAAM,KAAK,UAAUM,CAAG,CACjC,OAASO,EAAO,CACd,GAAIA,EAAM,aAAe,IACvB,OAAO,KAET,MAAMA,CACR,CACF,CAMA,MAAM,cAAe,CAEnB,IAAMP,EAAM,GAAGN,CAAc,IAAI,KAAK,IAAI,gBAC1C,GAAI,CACF,OAAO,MAAM,KAAK,UAAUM,CAAG,CACjC,OAASO,EAAO,CACd,GAAIA,EAAM,aAAe,IACvB,OAAO,KAET,MAAMA,CACR,CACF,CAMA,MAAM,gBAAiB,CAErB,IAAMP,EAAM,GAAGN,CAAc,IAAI,KAAK,IAAI,cAC1C,GAAI,CACF,OAAO,MAAM,KAAK,SAASM,CAAG,CAChC,OAASO,EAAO,CACd,GAAIA,EAAM,aAAe,IACvB,OAAO,KAET,MAAMA,CACR,CACF,CACF,EAEA,OAAO,QAAU,CAAE,UAAAV,CAAU",
|
|
6
|
+
"names": ["require_constants", "__commonJSMin", "exports", "module", "DEFAULT_API_URL", "LEGACY_API_URL", "CACHE_DIR_NAME", "CACHE_FILES", "ENV_VARS", "require_errors", "__commonJSMin", "exports", "module", "APIError", "message", "statusCode", "url", "CacheError", "operation", "ConfigError", "field", "ProcessingError", "token", "https", "http", "URL", "DEFAULT_API_URL", "LEGACY_API_URL", "ENV_VARS", "APIError", "APIClient", "ffId", "options", "url", "resolve", "reject", "response", "data", "chunk", "parsed", "error", "designSystemUrl", "tokensData", "tokens", "err", "legacyBaseURL", "urls", "results", "processedUrl"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var u=require("https"),a=require("fs"),i=require("path"),{URL:w}=require("url"),l=require("os"),c=process.env.FF_REGISTRY_URL||"https://ff-registry.up.railway.app",p=process.env.FF_USE_LOCAL_REGISTRY==="true",d=class{constructor(e={}){this.appRoot=e.appRoot||process.cwd(),this.framework=e.framework||this.detectFramework(),this.config=e.config||{},this.outputPath=e.outputPath||this.getDefaultOutputPath(),this.overwrite=e.overwrite||!1,this.downloadedComponents=new Set,this.ffId=this.config.ffId||this.config["ff-id"]||null}detectFramework(){let e=i.join(this.appRoot,"package.json");if(a.existsSync(e)){let t=JSON.parse(a.readFileSync(e,"utf8")),s={...t.dependencies,...t.devDependencies};if(s.vue)return"vue";if(s.react)return"react"}return"react"}getDefaultOutputPath(){if(this.config.aliases&&this.config.aliases.ui){let t=this.config.aliases.ui.replace(/^@\//,"");return i.join(this.appRoot,t)}return this.framework==="vue"?i.join(this.appRoot,"src/components/ui"):i.join(this.appRoot,"components/ui")}fetchJson(e){if(p){let t,s=[i.join(process.cwd(),"../../packages/registry"),i.join(process.cwd(),"../../../packages/registry"),i.join(process.cwd(),"../../../../packages/registry"),i.join(__dirname,"../../../registry"),i.join(process.cwd(),"packages/registry")];if(t=s.find(n=>a.existsSync(n)),!t)return Promise.reject(new Error(`Local registry not found. Tried paths: ${s.join(", ")}`));let r=e.replace(c,"").replace(/^\//,""),o=i.join(t,...r.split("/"));try{let n=a.readFileSync(o,"utf8");return Promise.resolve(JSON.parse(n))}catch(n){return n.code==="ENOENT"?Promise.reject(new Error("HTTP 404: Not Found")):Promise.reject(new Error(`Failed to read local file: ${n.message}`))}}return new Promise((t,s)=>{u.get(e,r=>{let o="";if(r.statusCode>=400){s(new Error(`HTTP ${r.statusCode}: ${r.statusMessage}`));return}r.on("data",n=>{o+=n}),r.on("end",()=>{try{t(JSON.parse(o))}catch(n){s(new Error(`Invalid JSON response: ${n.message}`))}})}).on("error",r=>{s(r)})})}async getAllComponents(){try{let e=`${c}/components/${this.framework}/index.json`;return(await this.fetchJson(e)).components||[]}catch(e){return console.error("Failed to fetch component index:",e.message),[]}}async getCustomComponents(){if(!this.ffId)return[];try{let e=`${c}/custom/${this.ffId}/${this.framework}/index.json`;return(await this.fetchJson(e)).components||[]}catch{return[]}}async downloadComponents(e){let t={successful:[],failed:[],dependencies:new Set};for(let s of e)try{let r=await this.downloadComponent(s);t.successful.push(s),r.forEach(o=>t.dependencies.add(o))}catch(r){t.failed.push({component:s,error:r.message})}return{successful:t.successful,failed:t.failed,dependencies:Array.from(t.dependencies)}}async downloadComponent(e){if(this.downloadedComponents.has(e))return[];console.log(`\u{1F4E5} Downloading ${e}...`);let t,s=!1;if(this.ffId){let o=`${c}/custom/${this.ffId}/${this.framework}/${e}.json`;try{t=await this.fetchJson(o),s=!0}catch{}}if(!t){let o=`${c}/components/${this.framework}/${e}.json`;try{t=await this.fetchJson(o)}catch(n){throw n.message.includes("404")?new Error(`Component "${e}" not found`):new Error(`Failed to fetch ${e}: ${n.message}`)}}if(!t.files||!Array.isArray(t.files))throw new Error(`Invalid component data for ${e}`);for(let o of t.files)await this.writeComponentFile(o);this.downloadedComponents.add(e),console.log(` \u2713 ${e} downloaded`);let r=[...t.dependencies||[]];if(t.registryDependencies&&t.registryDependencies.length>0){console.log(` \u{1F4E6} Installing registry dependencies: ${t.registryDependencies.join(", ")}`);for(let o of t.registryDependencies)try{(await this.downloadComponent(o)).forEach(f=>r.push(f))}catch(n){console.warn(` \u26A0\uFE0F Failed to download dependency ${o}: ${n.message}`)}}return r}async writeComponentFile(e){let t=e.name.split("/").join(i.sep),s=i.join(this.outputPath,t),r=i.dirname(s);if(a.existsSync(r)||a.mkdirSync(r,{recursive:!0}),a.existsSync(s)&&!this.overwrite){console.log(` \u26A0\uFE0F Skipping ${e.name} (already exists)`);return}let o=e.content;l.EOL!==`
|
|
2
|
+
`&&(o=e.content.replace(/\n/g,l.EOL)),a.writeFileSync(s,o,"utf8")}};module.exports={ComponentDownloader:d};
|
|
2
3
|
//# sourceMappingURL=component-downloader.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../lib/core/component-downloader.js"],
|
|
4
|
-
"sourcesContent": ["const https = require('https');\nconst fs = require('fs');\nconst path = require('path');\nconst { URL } = require('url');\n\nconst REGISTRY_URL = process.env.FF_REGISTRY_URL || 'https://ff-registry.up.railway.app';\nconst USE_LOCAL_REGISTRY = process.env.FF_USE_LOCAL_REGISTRY === 'true';\n\nclass ComponentDownloader {\n constructor(options = {}) {\n this.appRoot = options.appRoot || process.cwd();\n this.framework = options.framework || this.detectFramework();\n this.config = options.config || {};\n this.outputPath = options.outputPath || this.getDefaultOutputPath();\n this.overwrite = options.overwrite || false;\n this.downloadedComponents = new Set();\n this.ffId = this.config.ffId || this.config['ff-id'] || null;\n }\n\n /**\n * Detect framework from package.json\n */\n detectFramework() {\n const packageJsonPath = path.join(this.appRoot, 'package.json');\n \n if (fs.existsSync(packageJsonPath)) {\n const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));\n const deps = { ...packageJson.dependencies, ...packageJson.devDependencies };\n \n if (deps.vue) {\n return 'vue';\n } else if (deps.react) {\n return 'react';\n }\n }\n \n // Default to React if can't detect\n return 'react';\n }\n\n /**\n * Get default output path based on framework and config\n */\n getDefaultOutputPath() {\n // Check if config has ui alias\n if (this.config.aliases && this.config.aliases.ui) {\n const uiAlias = this.config.aliases.ui;\n // Convert alias to actual path (e.g., @/components/ui -> components/ui)\n const cleanPath = uiAlias.replace(/^@\\//, '');\n return path.join(this.appRoot, cleanPath);\n }\n \n // Fallback to default paths\n if (this.framework === 'vue') {\n return path.join(this.appRoot, 'src/components/ui');\n }\n return path.join(this.appRoot, 'components/ui');\n }\n\n /**\n * Fetch JSON from URL or local file\n */\n fetchJson(url) {\n // If using local registry, read from file system\n if (USE_LOCAL_REGISTRY) {\n const
|
|
5
|
-
"mappings": "AAAA,IAAMA,EAAQ,QAAQ,OAAO,EACvBC,EAAK,QAAQ,IAAI,EACjBC,EAAO,QAAQ,MAAM,EACrB,CAAE,IAAAC,CAAI,EAAI,QAAQ,KAAK,
|
|
6
|
-
"names": ["https", "fs", "path", "URL", "REGISTRY_URL", "USE_LOCAL_REGISTRY", "ComponentDownloader", "options", "packageJsonPath", "packageJson", "deps", "cleanPath", "url", "localPath", "content", "error", "resolve", "reject", "response", "data", "chunk", "components", "results", "component", "dep", "componentName", "componentData", "isCustom", "customUrl", "file", "allDependencies", "d", "filePath", "dir"]
|
|
4
|
+
"sourcesContent": ["const https = require('https');\nconst fs = require('fs');\nconst path = require('path');\nconst { URL } = require('url');\nconst os = require('os');\n\nconst REGISTRY_URL = process.env.FF_REGISTRY_URL || 'https://ff-registry.up.railway.app';\nconst USE_LOCAL_REGISTRY = process.env.FF_USE_LOCAL_REGISTRY === 'true';\n\nclass ComponentDownloader {\n constructor(options = {}) {\n this.appRoot = options.appRoot || process.cwd();\n this.framework = options.framework || this.detectFramework();\n this.config = options.config || {};\n this.outputPath = options.outputPath || this.getDefaultOutputPath();\n this.overwrite = options.overwrite || false;\n this.downloadedComponents = new Set();\n this.ffId = this.config.ffId || this.config['ff-id'] || null;\n }\n\n /**\n * Detect framework from package.json\n */\n detectFramework() {\n const packageJsonPath = path.join(this.appRoot, 'package.json');\n \n if (fs.existsSync(packageJsonPath)) {\n const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));\n const deps = { ...packageJson.dependencies, ...packageJson.devDependencies };\n \n if (deps.vue) {\n return 'vue';\n } else if (deps.react) {\n return 'react';\n }\n }\n \n // Default to React if can't detect\n return 'react';\n }\n\n /**\n * Get default output path based on framework and config\n */\n getDefaultOutputPath() {\n // Check if config has ui alias\n if (this.config.aliases && this.config.aliases.ui) {\n const uiAlias = this.config.aliases.ui;\n // Convert alias to actual path (e.g., @/components/ui -> components/ui)\n const cleanPath = uiAlias.replace(/^@\\//, '');\n return path.join(this.appRoot, cleanPath);\n }\n \n // Fallback to default paths\n if (this.framework === 'vue') {\n return path.join(this.appRoot, 'src/components/ui');\n }\n return path.join(this.appRoot, 'components/ui');\n }\n\n /**\n * Fetch JSON from URL or local file\n */\n fetchJson(url) {\n // If using local registry, read from file system\n if (USE_LOCAL_REGISTRY) {\n // Try to find the registry in the monorepo structure\n let registryPath;\n \n // Try multiple paths to find the registry\n const possiblePaths = [\n // From apps/prj to packages/registry\n path.join(process.cwd(), '../../packages/registry'),\n // From any deep directory in monorepo\n path.join(process.cwd(), '../../../packages/registry'),\n path.join(process.cwd(), '../../../../packages/registry'),\n // From the package itself\n path.join(__dirname, '../../../registry'),\n // Direct path if running from monorepo root\n path.join(process.cwd(), 'packages/registry')\n ];\n \n registryPath = possiblePaths.find(p => fs.existsSync(p));\n \n if (!registryPath) {\n return Promise.reject(new Error(`Local registry not found. Tried paths: ${possiblePaths.join(', ')}`));\n }\n \n // Extract the path from the URL and construct proper local path\n const urlPath = url.replace(REGISTRY_URL, '').replace(/^\\//, '');\n const localPath = path.join(registryPath, ...urlPath.split('/'));\n \n try {\n const content = fs.readFileSync(localPath, 'utf8');\n return Promise.resolve(JSON.parse(content));\n } catch (error) {\n // Return 404-like error for missing files\n if (error.code === 'ENOENT') {\n return Promise.reject(new Error('HTTP 404: Not Found'));\n }\n return Promise.reject(new Error(`Failed to read local file: ${error.message}`));\n }\n }\n\n return new Promise((resolve, reject) => {\n https.get(url, (response) => {\n let data = '';\n \n if (response.statusCode >= 400) {\n reject(new Error(`HTTP ${response.statusCode}: ${response.statusMessage}`));\n return;\n }\n\n response.on('data', (chunk) => {\n data += chunk;\n });\n\n response.on('end', () => {\n try {\n resolve(JSON.parse(data));\n } catch (error) {\n reject(new Error(`Invalid JSON response: ${error.message}`));\n }\n });\n\n }).on('error', (error) => {\n reject(error);\n });\n });\n }\n\n /**\n * Get all available components from registry\n */\n async getAllComponents() {\n try {\n const url = `${REGISTRY_URL}/components/${this.framework}/index.json`;\n const index = await this.fetchJson(url);\n return index.components || [];\n } catch (error) {\n console.error('Failed to fetch component index:', error.message);\n return [];\n }\n }\n\n /**\n * Get all custom components for this ff-id\n */\n async getCustomComponents() {\n if (!this.ffId) {\n return [];\n }\n \n try {\n const url = `${REGISTRY_URL}/custom/${this.ffId}/${this.framework}/index.json`;\n const index = await this.fetchJson(url);\n return index.components || [];\n } catch (error) {\n // Custom components might not exist, that's ok\n return [];\n }\n }\n\n /**\n * Download multiple components\n */\n async downloadComponents(components) {\n const results = {\n successful: [],\n failed: [],\n dependencies: new Set()\n };\n\n for (const component of components) {\n try {\n const deps = await this.downloadComponent(component);\n results.successful.push(component);\n \n // Add dependencies\n deps.forEach(dep => results.dependencies.add(dep));\n } catch (error) {\n results.failed.push({\n component,\n error: error.message\n });\n }\n }\n\n return {\n successful: results.successful,\n failed: results.failed,\n dependencies: Array.from(results.dependencies)\n };\n }\n\n /**\n * Download a single component and its registry dependencies\n */\n async downloadComponent(componentName) {\n // Avoid downloading the same component twice\n if (this.downloadedComponents.has(componentName)) {\n return [];\n }\n\n console.log(`\uD83D\uDCE5 Downloading ${componentName}...`);\n\n // Try to fetch from custom components first if ff-id is available\n let componentData;\n let isCustom = false;\n \n if (this.ffId) {\n const customUrl = `${REGISTRY_URL}/custom/${this.ffId}/${this.framework}/${componentName}.json`;\n try {\n componentData = await this.fetchJson(customUrl);\n isCustom = true;\n } catch (error) {\n // Custom component not found, try standard registry\n }\n }\n \n // If not found in custom, try standard registry\n if (!componentData) {\n const url = `${REGISTRY_URL}/components/${this.framework}/${componentName}.json`;\n \n try {\n componentData = await this.fetchJson(url);\n } catch (error) {\n // Check if it's a 404 (component not found)\n if (error.message.includes('404')) {\n throw new Error(`Component \"${componentName}\" not found`);\n }\n throw new Error(`Failed to fetch ${componentName}: ${error.message}`);\n }\n }\n\n // Validate component data\n if (!componentData.files || !Array.isArray(componentData.files)) {\n throw new Error(`Invalid component data for ${componentName}`);\n }\n\n // Write component files\n for (const file of componentData.files) {\n await this.writeComponentFile(file);\n }\n\n this.downloadedComponents.add(componentName);\n console.log(` \u2713 ${componentName} downloaded`);\n\n // Download registry dependencies\n const allDependencies = [...(componentData.dependencies || [])];\n \n if (componentData.registryDependencies && componentData.registryDependencies.length > 0) {\n console.log(` \uD83D\uDCE6 Installing registry dependencies: ${componentData.registryDependencies.join(', ')}`);\n \n for (const dep of componentData.registryDependencies) {\n try {\n const depDeps = await this.downloadComponent(dep);\n depDeps.forEach(d => allDependencies.push(d));\n } catch (error) {\n console.warn(` \u26A0\uFE0F Failed to download dependency ${dep}: ${error.message}`);\n }\n }\n }\n\n return allDependencies;\n }\n\n /**\n * Write component file to disk\n */\n async writeComponentFile(file) {\n // Normalize the file path for the current platform\n // Convert forward slashes to the platform-specific separator\n const normalizedFileName = file.name.split('/').join(path.sep);\n const filePath = path.join(this.outputPath, normalizedFileName);\n const dir = path.dirname(filePath);\n\n // Create directory if it doesn't exist\n if (!fs.existsSync(dir)) {\n fs.mkdirSync(dir, { recursive: true });\n }\n\n // Check if file exists and overwrite setting\n if (fs.existsSync(filePath) && !this.overwrite) {\n console.log(` \u26A0\uFE0F Skipping ${file.name} (already exists)`);\n return;\n }\n\n // Normalize line endings to match the platform\n // This prevents git from showing every line as changed\n let normalizedContent = file.content;\n if (os.EOL !== '\\n') {\n // On Windows, replace LF with CRLF\n normalizedContent = file.content.replace(/\\n/g, os.EOL);\n }\n\n // Write file\n fs.writeFileSync(filePath, normalizedContent, 'utf8');\n }\n}\n\nmodule.exports = { ComponentDownloader };"],
|
|
5
|
+
"mappings": "AAAA,IAAMA,EAAQ,QAAQ,OAAO,EACvBC,EAAK,QAAQ,IAAI,EACjBC,EAAO,QAAQ,MAAM,EACrB,CAAE,IAAAC,CAAI,EAAI,QAAQ,KAAK,EACvBC,EAAK,QAAQ,IAAI,EAEjBC,EAAe,QAA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,EAAG,UAAUsC,EAAK,CAAE,UAAW,EAAK,CAAC,EAInCtC,EAAG,WAAWqC,CAAQ,GAAK,CAAC,KAAK,UAAW,CAC9C,QAAQ,IAAI,6BAAmBJ,EAAK,IAAI,mBAAmB,EAC3D,MACF,CAIA,IAAIM,EAAoBN,EAAK,QACzB9B,EAAG,MAAQ;AAAA,IAEboC,EAAoBN,EAAK,QAAQ,QAAQ,MAAO9B,EAAG,GAAG,GAIxDH,EAAG,cAAcqC,EAAUE,EAAmB,MAAM,CACtD,CACF,EAEA,OAAO,QAAU,CAAE,oBAAAjC,CAAoB",
|
|
6
|
+
"names": ["https", "fs", "path", "URL", "os", "REGISTRY_URL", "USE_LOCAL_REGISTRY", "ComponentDownloader", "options", "packageJsonPath", "packageJson", "deps", "cleanPath", "url", "registryPath", "possiblePaths", "p", "urlPath", "localPath", "content", "error", "resolve", "reject", "response", "data", "chunk", "components", "results", "component", "dep", "componentName", "componentData", "isCustom", "customUrl", "file", "allDependencies", "d", "normalizedFileName", "filePath", "dir", "normalizedContent"]
|
|
7
7
|
}
|