@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/dist/vite.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../lib/core/constants.js", "../lib/core/errors.js", "../lib/core/cache-manager.js", "../vite.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 fs = require('fs');\nconst path = require('path');\nconst { CACHE_DIR_NAME, CACHE_TTL_MS, CACHE_FILES } = require('./constants');\nconst { CacheError } = require('./errors');\n\nclass CacheManager {\n constructor(appRoot = process.cwd()) {\n this.appRoot = appRoot;\n this.cacheDir = path.join(appRoot, 'node_modules', CACHE_DIR_NAME);\n this.metadataFile = path.join(this.cacheDir, 'metadata.json');\n this.maxAge = CACHE_TTL_MS;\n }\n\n /**\n * Get the cache directory path\n * @returns {string} Cache directory path\n */\n getCacheDir() {\n return this.cacheDir;\n }\n\n /**\n * Check if cache directory exists\n * @returns {boolean} True if cache exists\n */\n exists() {\n return fs.existsSync(this.cacheDir);\n }\n\n /**\n * Check if cache is valid (exists and not expired)\n * @returns {boolean} True if cache is valid\n */\n isValid() {\n if (!this.exists()) {\n return false;\n }\n\n try {\n if (!fs.existsSync(this.metadataFile)) {\n return false;\n }\n\n const metadata = JSON.parse(fs.readFileSync(this.metadataFile, 'utf-8'));\n const timestamp = new Date(metadata.timestamp).getTime();\n const now = Date.now();\n \n return (now - timestamp) < this.maxAge;\n } catch (error) {\n return false;\n }\n }\n\n /**\n * Load all cached data\n * @returns {Object|null} Cached data object or null if not found\n */\n load() {\n if (!this.exists()) {\n return null;\n }\n\n try {\n const data = {};\n \n // Load all .js files\n for (const file of CACHE_FILES.JS) {\n const filePath = path.join(this.cacheDir, file);\n if (fs.existsSync(filePath)) {\n // Remove .js extension for key\n const key = file.replace('.js', '');\n try {\n // Use a more secure approach - parse the exported data\n const content = fs.readFileSync(filePath, 'utf-8');\n // Create a safe evaluation context\n const moduleExports = {};\n const fakeModule = { exports: moduleExports };\n \n // Use Function constructor to evaluate in isolated scope\n const evalFunc = new Function('module', 'exports', content);\n evalFunc(fakeModule, moduleExports);\n \n data[key] = fakeModule.exports;\n } catch (e) {\n // Skip files that can't be parsed\n }\n }\n }\n\n // Load all .json files\n for (const file of CACHE_FILES.JSON) {\n const filePath = path.join(this.cacheDir, file);\n if (fs.existsSync(filePath)) {\n const key = file.replace('.json', '');\n const content = fs.readFileSync(filePath, 'utf-8');\n data[key] = JSON.parse(content);\n }\n }\n\n // Rename components-config to componentsConfig for consistency\n if (data['components-config']) {\n data.componentsConfig = data['components-config'];\n delete data['components-config'];\n }\n\n return data;\n } catch (error) {\n throw new CacheError(`Failed to load cache: ${error.message}`, 'read');\n }\n }\n\n /**\n * Save data to cache\n * @param {Object} data - Data object to save\n * @throws {Error} If save operation fails\n */\n save(data) {\n try {\n // Create cache directory\n fs.mkdirSync(this.cacheDir, { recursive: true });\n\n // Save metadata first\n const metadata = {\n timestamp: new Date().toISOString(),\n version: data.metadata?.version || '2.0.0',\n ffId: data.metadata?.ffId\n };\n fs.writeFileSync(\n this.metadataFile,\n JSON.stringify(metadata, null, 2)\n );\n\n // Save .js files\n const jsFiles = [\n 'tokens',\n 'variables',\n 'semanticVariables',\n 'semanticDarkVariables',\n 'cls',\n 'custom'\n ];\n\n for (const key of jsFiles) {\n if (data[key] !== undefined) {\n const filePath = path.join(this.cacheDir, `${key}.js`);\n const content = `module.exports = ${JSON.stringify(
|
|
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", "require_cache_manager", "__commonJSMin", "exports", "module", "fs", "path", "CACHE_DIR_NAME", "CACHE_TTL_MS", "CACHE_FILES", "CacheError", "CacheManager", "appRoot", "metadata", "timestamp", "data", "file", "filePath", "key", "content", "moduleExports", "fakeModule", "error", "_a", "_b", "jsFiles", "
|
|
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 fs = require('fs');\nconst path = require('path');\nconst { CACHE_DIR_NAME, CACHE_TTL_MS, CACHE_FILES } = require('./constants');\nconst { CacheError } = require('./errors');\n\nclass CacheManager {\n constructor(appRoot = process.cwd()) {\n this.appRoot = appRoot;\n this.cacheDir = path.join(appRoot, 'node_modules', CACHE_DIR_NAME);\n this.metadataFile = path.join(this.cacheDir, 'metadata.json');\n this.maxAge = CACHE_TTL_MS;\n }\n\n /**\n * Get the cache directory path\n * @returns {string} Cache directory path\n */\n getCacheDir() {\n return this.cacheDir;\n }\n\n /**\n * Check if cache directory exists\n * @returns {boolean} True if cache exists\n */\n exists() {\n return fs.existsSync(this.cacheDir);\n }\n\n /**\n * Check if cache is valid (exists and not expired)\n * @returns {boolean} True if cache is valid\n */\n isValid() {\n if (!this.exists()) {\n return false;\n }\n\n try {\n if (!fs.existsSync(this.metadataFile)) {\n return false;\n }\n\n const metadata = JSON.parse(fs.readFileSync(this.metadataFile, 'utf-8'));\n const timestamp = new Date(metadata.timestamp).getTime();\n const now = Date.now();\n \n return (now - timestamp) < this.maxAge;\n } catch (error) {\n return false;\n }\n }\n\n /**\n * Load all cached data\n * @returns {Object|null} Cached data object or null if not found\n */\n load() {\n if (!this.exists()) {\n return null;\n }\n\n try {\n const data = {};\n \n // Load all .js files\n for (const file of CACHE_FILES.JS) {\n const filePath = path.join(this.cacheDir, file);\n if (fs.existsSync(filePath)) {\n // Remove .js extension for key\n const key = file.replace('.js', '');\n try {\n // Use a more secure approach - parse the exported data\n const content = fs.readFileSync(filePath, 'utf-8');\n // Create a safe evaluation context\n const moduleExports = {};\n const fakeModule = { exports: moduleExports };\n \n // Use Function constructor to evaluate in isolated scope\n const evalFunc = new Function('module', 'exports', content);\n evalFunc(fakeModule, moduleExports);\n \n data[key] = fakeModule.exports;\n } catch (e) {\n // Skip files that can't be parsed\n }\n }\n }\n\n // Load all .json files\n for (const file of CACHE_FILES.JSON) {\n const filePath = path.join(this.cacheDir, file);\n if (fs.existsSync(filePath)) {\n const key = file.replace('.json', '');\n const content = fs.readFileSync(filePath, 'utf-8');\n data[key] = JSON.parse(content);\n }\n }\n\n // Rename components-config to componentsConfig for consistency\n if (data['components-config']) {\n data.componentsConfig = data['components-config'];\n delete data['components-config'];\n }\n\n return data;\n } catch (error) {\n throw new CacheError(`Failed to load cache: ${error.message}`, 'read');\n }\n }\n\n /**\n * Save data to cache\n * @param {Object} data - Data object to save\n * @throws {Error} If save operation fails\n */\n save(data) {\n try {\n // Create cache directory\n fs.mkdirSync(this.cacheDir, { recursive: true });\n\n // Save metadata first\n const metadata = {\n timestamp: new Date().toISOString(),\n version: data.metadata?.version || '2.0.0',\n ffId: data.metadata?.ffId\n };\n fs.writeFileSync(\n this.metadataFile,\n JSON.stringify(metadata, null, 2)\n );\n\n // Save .js files\n const jsFiles = [\n 'tokens',\n 'variables',\n 'semanticVariables',\n 'semanticDarkVariables',\n 'cls',\n 'custom'\n ];\n\n for (const key of jsFiles) {\n if (data[key] !== undefined) {\n const filePath = path.join(this.cacheDir, `${key}.js`);\n const value = data[key];\n \n // Ensure we have actual data to save\n if (value === null || value === undefined || \n (typeof value === 'object' && Object.keys(value).length === 0) ||\n (Array.isArray(value) && value.length === 0)) {\n // For empty objects/arrays, save a proper empty structure\n const emptyContent = Array.isArray(value) ? '[]' : '{}';\n const content = `module.exports = ${emptyContent};`;\n fs.writeFileSync(filePath, content);\n } else {\n const content = `module.exports = ${JSON.stringify(value, null, 2)};`;\n fs.writeFileSync(filePath, content);\n }\n }\n }\n\n // Save .json files\n const jsonData = {\n fonts: data.fonts,\n icons: data.icons || data.iconSet,\n 'components-config': data.componentsConfig,\n version: data.version\n };\n\n for (const [key, value] of Object.entries(jsonData)) {\n if (value !== undefined) {\n const filePath = path.join(this.cacheDir, `${key}.json`);\n fs.writeFileSync(filePath, JSON.stringify(value, null, 2));\n }\n }\n } catch (error) {\n throw new CacheError(`Failed to save cache: ${error.message}`, 'write');\n }\n }\n\n /**\n * Clear the cache directory\n */\n clear() {\n if (this.exists()) {\n fs.rmSync(this.cacheDir, { recursive: true, force: true });\n }\n }\n}\n\nmodule.exports = CacheManager;", "// CommonJS wrapper for vite.mjs to support Jest testing\nmodule.exports = function vitePlugin() {\n // Return a mock plugin for testing\n let config;\n \n return {\n name: 'frontfriend-tailwind',\n configResolved(resolvedConfig) {\n config = resolvedConfig;\n },\n load(id) {\n if (id === 'virtual:frontfriend-config') {\n // Mock implementation for testing\n try {\n const CacheManager = require('./lib/core/cache-manager');\n const cacheManager = new CacheManager(config?.root || process.cwd());\n \n if (!cacheManager.exists()) {\n console.warn('[FrontFriend Vite] No cache found. Please run \"npx frontfriend init\" first.');\n return `\n globalThis.__FF_CONFIG__ = null;\n globalThis.__FF_ICONS__ = null;\n `;\n }\n \n let cache;\n try {\n cache = cacheManager.load();\n } catch (error) {\n console.error('[FrontFriend Vite] Failed to load cache.');\n return `\n globalThis.__FF_CONFIG__ = null;\n globalThis.__FF_ICONS__ = null;\n `;\n }\n \n if (!cache) {\n console.error('[FrontFriend Vite] Failed to load cache.');\n return `\n globalThis.__FF_CONFIG__ = null;\n globalThis.__FF_ICONS__ = null;\n `;\n }\n \n const componentsConfig = cache.componentsConfig || null;\n const icons = cache.icons || null;\n \n if (config?.command === 'serve') {\n console.log('[FrontFriend Vite] Injected configuration and icons into build');\n }\n \n return `\n globalThis.__FF_CONFIG__ = ${JSON.stringify(componentsConfig)};\n globalThis.__FF_ICONS__ = ${JSON.stringify(icons)};\n `;\n } catch (error) {\n // Handle any errors gracefully\n return `\n globalThis.__FF_CONFIG__ = null;\n globalThis.__FF_ICONS__ = null;\n `;\n }\n }\n \n return null;\n }\n };\n};"],
|
|
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,CAC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AAe,IACfC,EAAe,IAAID,GAAaH,GAAA,YAAAA,EAAQ,OAAQ,QAAQ,IAAI,CAAC,EAEnE,GAAI,CAACI,EAAa,OAAO,EACvB,eAAQ,KAAK,6EAA6E,EACnF;AAAA;AAAA;AAAA,cAMT,IAAIC,EACJ,GAAI,CACFA,EAAQD,EAAa,KAAK,CAC5B,MAAgB,CACd,eAAQ,MAAM,0CAA0C,EACjD;AAAA;AAAA;AAAA,aAIT,CAEA,GAAI,CAACC,EACH,eAAQ,MAAM,0CAA0C,EACjD;AAAA;AAAA;AAAA,cAMT,IAAMC,EAAmBD,EAAM,kBAAoB,KAC7CE,EAAQF,EAAM,OAAS,KAE7B,OAAIL,GAAA,YAAAA,EAAQ,WAAY,SACtB,QAAQ,IAAI,gEAAgE,EAGvE;AAAA,yCACwB,KAAK,UAAUM,CAAgB,CAAC;AAAA,wCACjC,KAAK,UAAUC,CAAK,CAAC;AAAA,WAErD,MAAgB,CAEd,MAAO;AAAA;AAAA;AAAA,WAIT,CAGF,OAAO,IACT,CACF,CACF",
|
|
6
|
+
"names": ["require_constants", "__commonJSMin", "exports", "module", "DEFAULT_API_URL", "LEGACY_API_URL", "CACHE_DIR_NAME", "CACHE_FILES", "ENV_VARS", "require_errors", "__commonJSMin", "exports", "module", "APIError", "message", "statusCode", "url", "CacheError", "operation", "ConfigError", "field", "ProcessingError", "token", "require_cache_manager", "__commonJSMin", "exports", "module", "fs", "path", "CACHE_DIR_NAME", "CACHE_TTL_MS", "CACHE_FILES", "CacheError", "CacheManager", "appRoot", "metadata", "timestamp", "data", "file", "filePath", "key", "content", "moduleExports", "fakeModule", "error", "_a", "_b", "jsFiles", "value", "jsonData", "config", "resolvedConfig", "id", "CacheManager", "cacheManager", "cache", "componentsConfig", "icons"]
|
|
7
7
|
}
|
package/dist/vite.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"fs";import o from"path";function
|
|
1
|
+
import e from"fs";import o from"path";function c(){let i=null,r=null;return{name:"vite-plugin-frontfriend",config(){try{let n=o.join(process.cwd(),"node_modules",".cache","frontfriend");if(!e.existsSync(n))return console.warn('[FrontFriend Vite] No cache found. Please run "npx frontfriend init" first.'),{define:{__FF_CONFIG__:JSON.stringify({}),__FF_ICONS__:JSON.stringify({})}};let t=o.join(n,"components-config.json");e.existsSync(t)&&(i=JSON.parse(e.readFileSync(t,"utf-8")));let s=o.join(n,"icons.json");e.existsSync(s)&&(r=JSON.parse(e.readFileSync(s,"utf-8"))),!i&&!r&&console.warn('[FrontFriend Vite] Cache directory exists but no cache files found. Please run "npx frontfriend init" to refresh.')}catch(n){console.error("[FrontFriend Vite] Failed to load cache:",n.message)}return{define:{__FF_CONFIG__:JSON.stringify(i||{}),__FF_ICONS__:JSON.stringify(r||{})}}}}}var d=c;export{d as default,c as frontfriend};
|
|
2
2
|
//# sourceMappingURL=vite.mjs.map
|
package/dist/vite.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../vite.mjs"],
|
|
4
|
-
"sourcesContent": ["// Vite plugin for FrontFriend Tailwind\nimport fs from 'fs';\nimport path from 'path';\n\nexport function
|
|
5
|
-
"mappings": "AACA,OAAOA,MAAQ,KACf,OAAOC,MAAU,OAEV,SAASC,
|
|
6
|
-
"names": ["fs", "path", "
|
|
4
|
+
"sourcesContent": ["// Vite plugin for FrontFriend Tailwind\nimport fs from 'fs';\nimport path from 'path';\n\nexport function frontfriend() {\n let config = null;\n let icons = null;\n\n return {\n name: 'vite-plugin-frontfriend',\n \n config() {\n // Load cache during config phase\n try {\n const cacheDir = path.join(process.cwd(), 'node_modules', '.cache', 'frontfriend');\n \n // Check if cache directory exists\n if (!fs.existsSync(cacheDir)) {\n console.warn('[FrontFriend Vite] No cache found. Please run \"npx frontfriend init\" first.');\n return {\n define: {\n __FF_CONFIG__: JSON.stringify({}),\n __FF_ICONS__: JSON.stringify({})\n }\n };\n }\n \n const configPath = path.join(cacheDir, 'components-config.json');\n if (fs.existsSync(configPath)) {\n config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));\n }\n \n const iconsPath = path.join(cacheDir, 'icons.json');\n if (fs.existsSync(iconsPath)) {\n icons = JSON.parse(fs.readFileSync(iconsPath, 'utf-8'));\n }\n \n // Warn if cache files don't exist\n if (!config && !icons) {\n console.warn('[FrontFriend Vite] Cache directory exists but no cache files found. Please run \"npx frontfriend init\" to refresh.');\n }\n } catch (error) {\n console.error('[FrontFriend Vite] Failed to load cache:', error.message);\n }\n\n // Define global constants\n return {\n define: {\n __FF_CONFIG__: JSON.stringify(config || {}),\n __FF_ICONS__: JSON.stringify(icons || {})\n }\n };\n }\n };\n}\n\n// Default export for compatibility\nexport default frontfriend;"],
|
|
5
|
+
"mappings": "AACA,OAAOA,MAAQ,KACf,OAAOC,MAAU,OAEV,SAASC,GAAc,CAC5B,IAAIC,EAAS,KACTC,EAAQ,KAEZ,MAAO,CACL,KAAM,0BAEN,QAAS,CAEP,GAAI,CACF,IAAMC,EAAWJ,EAAK,KAAK,QAAQ,IAAI,EAAG,eAAgB,SAAU,aAAa,EAGjF,GAAI,CAACD,EAAG,WAAWK,CAAQ,EACzB,eAAQ,KAAK,6EAA6E,EACnF,CACL,OAAQ,CACN,cAAe,KAAK,UAAU,CAAC,CAAC,EAChC,aAAc,KAAK,UAAU,CAAC,CAAC,CACjC,CACF,EAGF,IAAMC,EAAaL,EAAK,KAAKI,EAAU,wBAAwB,EAC3DL,EAAG,WAAWM,CAAU,IAC1BH,EAAS,KAAK,MAAMH,EAAG,aAAaM,EAAY,OAAO,CAAC,GAG1D,IAAMC,EAAYN,EAAK,KAAKI,EAAU,YAAY,EAC9CL,EAAG,WAAWO,CAAS,IACzBH,EAAQ,KAAK,MAAMJ,EAAG,aAAaO,EAAW,OAAO,CAAC,GAIpD,CAACJ,GAAU,CAACC,GACd,QAAQ,KAAK,mHAAmH,CAEpI,OAASI,EAAO,CACd,QAAQ,MAAM,2CAA4CA,EAAM,OAAO,CACzE,CAGA,MAAO,CACL,OAAQ,CACN,cAAe,KAAK,UAAUL,GAAU,CAAC,CAAC,EAC1C,aAAc,KAAK,UAAUC,GAAS,CAAC,CAAC,CAC1C,CACF,CACF,CACF,CACF,CAGA,IAAOK,EAAQP",
|
|
6
|
+
"names": ["fs", "path", "frontfriend", "config", "icons", "cacheDir", "configPath", "iconsPath", "error", "vite_default"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontfriend/tailwind",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Design token management for Tailwind CSS",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
@@ -9,16 +9,35 @@
|
|
|
9
9
|
},
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
|
+
"types": "./dist/types/index.d.ts",
|
|
12
13
|
"import": "./dist/index.mjs",
|
|
13
14
|
"require": "./dist/index.js",
|
|
14
15
|
"default": "./dist/index.js"
|
|
15
16
|
},
|
|
16
|
-
"./runtime":
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"./
|
|
21
|
-
|
|
17
|
+
"./runtime": {
|
|
18
|
+
"types": "./dist/runtime.d.ts",
|
|
19
|
+
"default": "./dist/runtime.js"
|
|
20
|
+
},
|
|
21
|
+
"./next": {
|
|
22
|
+
"types": "./dist/next.d.ts",
|
|
23
|
+
"default": "./dist/next.js"
|
|
24
|
+
},
|
|
25
|
+
"./vite": {
|
|
26
|
+
"types": "./dist/vite.d.ts",
|
|
27
|
+
"default": "./dist/vite.mjs"
|
|
28
|
+
},
|
|
29
|
+
"./lib/react/utils": {
|
|
30
|
+
"types": "./dist/lib/react/utils.d.ts",
|
|
31
|
+
"default": "./dist/lib/react/utils.mjs"
|
|
32
|
+
},
|
|
33
|
+
"./lib/vue/utils": {
|
|
34
|
+
"types": "./dist/lib/vue/utils.d.ts",
|
|
35
|
+
"default": "./dist/lib/vue/utils.mjs"
|
|
36
|
+
},
|
|
37
|
+
"./ffdc": {
|
|
38
|
+
"types": "./dist/ffdc.d.ts",
|
|
39
|
+
"default": "./dist/ffdc.js"
|
|
40
|
+
}
|
|
22
41
|
},
|
|
23
42
|
"scripts": {
|
|
24
43
|
"test": "jest",
|
|
@@ -32,14 +51,6 @@
|
|
|
32
51
|
],
|
|
33
52
|
"author": "Donux",
|
|
34
53
|
"license": "SEE LICENSE IN LICENSE",
|
|
35
|
-
"repository": {
|
|
36
|
-
"type": "git",
|
|
37
|
-
"url": "git+https://github.com/frontfriend/tailwind.git"
|
|
38
|
-
},
|
|
39
|
-
"homepage": "https://github.com/frontfriend/tailwind#readme",
|
|
40
|
-
"bugs": {
|
|
41
|
-
"url": "https://github.com/frontfriend/tailwind/issues"
|
|
42
|
-
},
|
|
43
54
|
"files": [
|
|
44
55
|
"dist/",
|
|
45
56
|
"README.md",
|