@frontfriend/tailwind 3.0.0 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +3 -3
- package/package.json +1 -1
- package/scripts/build.js +3 -1
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var u=typeof window<"u"&&typeof window.document<"u",
|
|
1
|
+
var _=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var s=typeof window<"u"&&typeof window.document<"u",i=typeof process<"u"&&process.versions&&process.versions.node,o=null;var u=i?function(...t){if(!o)try{o=_("module").createRequire(import.meta.url)("./index.js")}catch(e){return console.error("[FrontFriend] Failed to load plugin:",e),{}}return typeof o=="function"?o(...t):o}:function(){return s&&console.warn("[FrontFriend] The Tailwind plugin cannot be used directly in browser environments"),{}};function c(){let t=new Map,e={get(r,n){return n===Symbol.toPrimitive||n==="valueOf"?()=>"":n==="toString"||n===Symbol.toStringTag?()=>"":n==="constructor"?Object:(t.has(n)||t.set(n,c()),t.get(n))},has(r,n){return!(typeof n=="symbol"&&n.toString().includes("nodejs.util.inspect"))},ownKeys(r){return[]},getOwnPropertyDescriptor(r,n){return{enumerable:!0,configurable:!0}}};return new Proxy({},e)}function f(t){return!t||typeof t!="object"?c():t}var l=new Proxy({},{_cjsConfig:null,_proxyCache:new Map,get(t,e){if(e===Symbol.toPrimitive||e==="valueOf")return()=>"";if(e==="toString"||e===Symbol.toStringTag)return()=>"[object Object]";if(e==="constructor")return Object;if(i&&!this._cjsConfig&&o&&(this._cjsConfig=o.config),i&&this._cjsConfig&&e in this._cjsConfig)return this._cjsConfig[e];let r=null;if(typeof __FF_CONFIG__<"u")r=__FF_CONFIG__;else if(typeof process<"u"&&process.env){if(process.env.NEXT_PUBLIC_FF_CONFIG)try{r=JSON.parse(process.env.NEXT_PUBLIC_FF_CONFIG)}catch{console.warn("[FrontFriend] Failed to parse NEXT_PUBLIC_FF_CONFIG")}else if(process.env.__FF_CONFIG__)try{r=JSON.parse(process.env.__FF_CONFIG__)}catch{console.warn("[FrontFriend] Failed to parse __FF_CONFIG__")}}else s&&window.__FF_CONFIG__&&(r=window.__FF_CONFIG__);return r&&e in r?r[e]:(this._proxyCache.has(e)||this._proxyCache.set(e,c()),this._proxyCache.get(e))},has(t,e){return!0},ownKeys(t){return[]},getOwnPropertyDescriptor(t,e){return{enumerable:!0,configurable:!0}}}),F=new Proxy({},{_cjsIconSet:null,get(t,e){if(e===Symbol.toPrimitive||e==="valueOf")return()=>"";if(e==="toString"||e===Symbol.toStringTag)return()=>"[object Object]";if(e==="constructor")return Object;if(i&&!this._cjsIconSet&&o&&(this._cjsIconSet=o.iconSet),i&&this._cjsIconSet&&e in this._cjsIconSet)return this._cjsIconSet[e];let r=null;if(typeof __FF_ICONS__<"u")r=__FF_ICONS__;else if(typeof process<"u"&&process.env){if(process.env.NEXT_PUBLIC_FF_ICONS)try{r=JSON.parse(process.env.NEXT_PUBLIC_FF_ICONS)}catch{console.warn("[FrontFriend] Failed to parse NEXT_PUBLIC_FF_ICONS")}else if(process.env.__FF_ICONS__)try{r=JSON.parse(process.env.__FF_ICONS__)}catch{console.warn("[FrontFriend] Failed to parse __FF_ICONS__")}}else s&&window.__FF_ICONS__&&(r=window.__FF_ICONS__);return r&&e in r?r[e]:null},has(t,e){return!1},ownKeys(t){return[]},getOwnPropertyDescriptor(t,e){}}),d=u;export{l as config,d as default,f as ffdc,F as iconSet};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../index.mjs"],
|
|
4
|
-
"sourcesContent": ["// ES Module wrapper for frontfriend-tailwind\n// This file provides ES module exports for browser environments\n\n// Determine environment\nconst isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';\nconst isNode = typeof process !== 'undefined' && process.versions && process.versions.node;\n\n// Default plugin stub for browser\nconst plugin = function() {\n if (isBrowser) {\n console.warn('[FrontFriend] The Tailwind plugin cannot be used directly in browser environments');\n }\n return {};\n};\n\n/**\n * Creates a deep proxy that gracefully handles arbitrary nested property access\n * without throwing errors. This is essential for SSR and build-time scenarios\n * where configuration might not be loaded yet.\n *\n * Features:\n * - Infinite depth access: config.a.b.c.d.e never crashes\n * - Referential equality: config.a === config.a (memoized)\n * - Iteration support: Object.keys(), spread operator, for...in\n * - Type coercion: Works with toString, valueOf, Symbol.toPrimitive\n * - 'in' operator: 'property' in config returns true\n *\n * @returns {Proxy} A proxy object that handles any property access safely\n *\n * @example\n * const config = createDeepProxy();\n * const value = config.sidebar.root.wrapper.base; // Never crashes\n * config.a === config.a; // true (referential equality)\n * 'anything' in config; // true\n * Object.keys(config); // []\n */\nfunction createDeepProxy() {\n // Cache for memoization - ensures referential equality\n // This is critical for React dependency arrays and equality checks\n const cache = new Map();\n\n const handler = {\n /**\n * Handles property access with memoization\n * Ensures config.a === config.a for referential equality\n */\n get(target, prop) {\n // Handle special cases for type coercion and inspection\n if (prop === Symbol.toPrimitive || prop === 'valueOf') {\n return () => '';\n }\n if (prop === 'toString' || prop === Symbol.toStringTag) {\n return () => '';\n }\n if (prop === 'constructor') {\n return Object;\n }\n\n // Return cached proxy for same property to maintain referential equality\n // This prevents issues with React hooks and memoization\n if (!cache.has(prop)) {\n cache.set(prop, createDeepProxy());\n }\n return cache.get(prop);\n },\n\n /**\n * Handles 'in' operator\n * Makes 'property' in config return true for any property\n */\n has(target, prop) {\n // Return true for all properties except internal symbols\n if (typeof prop === 'symbol' && prop.toString().includes('nodejs.util.inspect')) {\n return false;\n }\n return true;\n },\n\n /**\n * Handles Object.keys(), Object.getOwnPropertyNames(), for...in\n * Returns empty array since proxy represents missing/unknown config\n */\n ownKeys(target) {\n return [];\n },\n\n /**\n * Handles Object.getOwnPropertyDescriptor()\n * Required for proper iteration support with ownKeys\n */\n getOwnPropertyDescriptor(target, prop) {\n return {\n enumerable: true,\n configurable: true,\n };\n },\n };\n\n return new Proxy({}, handler);\n}\n\n/**\n * FrontFriend Design Config (ffdc) - Safe config wrapper with SSR support\n *\n * Wraps configuration objects to prevent crashes during SSR or when config\n * is not yet loaded. Returns actual config if valid, or a deep proxy fallback.\n *\n * This is the recommended way to access config in components to ensure\n * they work during both build-time (SSR) and runtime.\n *\n * @param {Object|null|undefined} config - The configuration object to wrap\n * @returns {Object|Proxy} The config object or a safe deep proxy\n *\n * @example\n * import { config, ffdc } from '@frontfriend/tailwind';\n *\n * // Safe access during SSR - never crashes\n * const sidebarConfig = ffdc(config || {}).sidebar;\n * const className = sidebarConfig.root.wrapper.base; // Always safe\n *\n * @example\n * // In a React component\n * function Sidebar() {\n * const cfg = ffdc(config).sidebar;\n * return <div className={cfg.root.base}>...</div>;\n * }\n */\nexport function ffdc(config) {\n // During SSR or initial load, config might not be available yet\n // Return a deep proxy that handles any property access without crashing\n if (!config || typeof config !== 'object') {\n return createDeepProxy();\n }\n\n return config;\n}\n\n// In browser environments, config and iconSet must be provided by the build system\n// (e.g., Vite plugin, webpack plugin, etc.) or loaded from a global variable\nlet _config = null;\nlet _iconSet = null;\n\n// Function to get config - tries multiple sources\nfunction getConfig() {\n // Try global variable first (webpack DefinePlugin)\n if (typeof __FF_CONFIG__ !== 'undefined') {\n return __FF_CONFIG__;\n }\n // Try Next.js environment variable (Turbopack compatibility)\n if (typeof process !== 'undefined' && process.env) {\n // Try NEXT_PUBLIC_ prefixed version first (Next.js requirement)\n if (process.env.NEXT_PUBLIC_FF_CONFIG) {\n try {\n return JSON.parse(process.env.NEXT_PUBLIC_FF_CONFIG);\n } catch (e) {\n console.warn('[FrontFriend] Failed to parse NEXT_PUBLIC_FF_CONFIG from environment');\n }\n }\n // Fallback to __ prefixed version for non-Next.js environments\n if (process.env.__FF_CONFIG__) {\n try {\n return JSON.parse(process.env.__FF_CONFIG__);\n } catch (e) {\n console.warn('[FrontFriend] Failed to parse __FF_CONFIG__ from environment');\n }\n }\n }\n // Try window global\n if (isBrowser && window.__FF_CONFIG__) {\n return window.__FF_CONFIG__;\n }\n return null;\n}\n\n// Function to get icons - tries multiple sources\nfunction getIcons() {\n // Try global variable first (webpack DefinePlugin)\n if (typeof __FF_ICONS__ !== 'undefined') {\n return __FF_ICONS__;\n }\n // Try Next.js environment variable (Turbopack compatibility)\n if (typeof process !== 'undefined' && process.env) {\n // Try NEXT_PUBLIC_ prefixed version first (Next.js requirement)\n if (process.env.NEXT_PUBLIC_FF_ICONS) {\n try {\n return JSON.parse(process.env.NEXT_PUBLIC_FF_ICONS);\n } catch (e) {\n console.warn('[FrontFriend] Failed to parse NEXT_PUBLIC_FF_ICONS from environment');\n }\n }\n // Fallback to __ prefixed version for non-Next.js environments\n if (process.env.__FF_ICONS__) {\n try {\n return JSON.parse(process.env.__FF_ICONS__);\n } catch (e) {\n console.warn('[FrontFriend] Failed to parse __FF_ICONS__ from environment');\n }\n }\n }\n // Try window global\n if (isBrowser && window.__FF_ICONS__) {\n return window.__FF_ICONS__;\n }\n return null;\n}\n\n/**\n * Main config export with lazy loading and memoization\n *\n * This proxy:\n * - Lazily loads config from multiple sources (globals, env vars, window)\n * - Returns actual config values when available\n * - Falls back to deep proxy for missing properties\n * - Maintains referential equality for the same property access\n * - Supports 'in' operator and iteration\n *\n * @example\n * import { config } from '@frontfriend/tailwind';\n * const sidebarConfig = config.sidebar; // Loads config lazily\n * config.sidebar === config.sidebar; // true (memoized)\n */\nexport const config = new Proxy({}, {\n // Cache for memoized deep proxies\n _proxyCache: new Map(),\n\n get(target, prop) {\n // Handle special cases for console.log, JSON.stringify, etc.\n if (prop === Symbol.toPrimitive || prop === 'valueOf') {\n return () => '';\n }\n if (prop === 'toString' || prop === Symbol.toStringTag) {\n return () => '[object Object]';\n }\n if (prop === 'constructor') {\n return Object;\n }\n\n // Try to get config if not already loaded\n if (!_config) {\n _config = getConfig();\n }\n\n // Return actual config value if it exists\n if (_config && prop in _config) {\n return _config[prop];\n }\n\n // Return memoized deep proxy for missing properties\n // This ensures config.missing === config.missing (referential equality)\n if (!this._proxyCache.has(prop)) {\n this._proxyCache.set(prop, createDeepProxy());\n }\n return this._proxyCache.get(prop);\n },\n\n /**\n * Handles 'in' operator\n * Returns true if property exists in loaded config, or true for any property\n * to prevent crashes during property checks\n */\n has(target, prop) {\n // Try to load config first\n if (!_config) {\n _config = getConfig();\n }\n\n // If config is loaded, check if property exists\n if (_config) {\n return prop in _config;\n }\n\n // If config not loaded, return true to allow safe access\n return true;\n },\n\n /**\n * Handles Object.keys(), Object.getOwnPropertyNames()\n * Returns actual config keys if loaded, empty array otherwise\n */\n ownKeys(target) {\n if (!_config) {\n _config = getConfig();\n }\n\n return _config ? Object.keys(_config) : [];\n },\n\n /**\n * Handles Object.getOwnPropertyDescriptor()\n * Required for proper iteration support\n */\n getOwnPropertyDescriptor(target, prop) {\n if (!_config) {\n _config = getConfig();\n }\n\n if (_config && prop in _config) {\n return Object.getOwnPropertyDescriptor(_config, prop);\n }\n\n return {\n enumerable: true,\n configurable: true,\n };\n },\n});\n\n/**\n * Icon set export with lazy loading\n *\n * This proxy:\n * - Lazily loads icons from multiple sources (globals, env vars, window)\n * - Returns actual icon values when available\n * - Returns null for missing icons (allowing graceful fallbacks)\n * - Supports 'in' operator to check icon availability\n *\n * @example\n * import { iconSet } from '@frontfriend/tailwind';\n * const closeIcon = iconSet.sidebar?.close; // Safely access with optional chaining\n * if ('close' in iconSet.sidebar) { ... } // Check if icon exists\n */\nexport const iconSet = new Proxy({}, {\n get(target, prop) {\n // Handle special cases for type coercion\n if (prop === Symbol.toPrimitive || prop === 'valueOf') {\n return () => '';\n }\n if (prop === 'toString' || prop === Symbol.toStringTag) {\n return () => '[object Object]';\n }\n if (prop === 'constructor') {\n return Object;\n }\n\n // Try to get icons if not already loaded\n if (!_iconSet) {\n _iconSet = getIcons();\n }\n\n // Return actual icon value if it exists\n if (_iconSet && prop in _iconSet) {\n return _iconSet[prop];\n }\n\n // Return null for missing icons (allows graceful fallbacks)\n return null;\n },\n\n /**\n * Handles 'in' operator for icon existence checks\n */\n has(target, prop) {\n if (!_iconSet) {\n _iconSet = getIcons();\n }\n\n return _iconSet ? prop in _iconSet : false;\n },\n\n /**\n * Handles Object.keys() for iconSet\n */\n ownKeys(target) {\n if (!_iconSet) {\n _iconSet = getIcons();\n }\n\n return _iconSet ? Object.keys(_iconSet) : [];\n },\n\n /**\n * Handles Object.getOwnPropertyDescriptor() for iconSet\n */\n getOwnPropertyDescriptor(target, prop) {\n if (!_iconSet) {\n _iconSet = getIcons();\n }\n\n if (_iconSet && prop in _iconSet) {\n return Object.getOwnPropertyDescriptor(_iconSet, prop);\n }\n\n return undefined;\n },\n});\n\n// Default export\nexport default plugin;"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["isBrowser", "isNode", "plugin", "
|
|
4
|
+
"sourcesContent": ["// ES Module wrapper for frontfriend-tailwind\n// This file provides ES module exports for both Node.js and browser environments\n\n// Determine environment\nconst isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';\nconst isNode = typeof process !== 'undefined' && process.versions && process.versions.node;\n\n// Lazy-loaded CJS module reference\nlet cjsModule = null;\nlet cjsModulePromise = null;\n\n// Lazy loader for CJS module (only loads when needed)\nasync function loadCjsModule() {\n if (cjsModule) return cjsModule;\n if (cjsModulePromise) return cjsModulePromise;\n\n cjsModulePromise = (async () => {\n try {\n const { createRequire } = await import('module');\n const require = createRequire(import.meta.url);\n cjsModule = require('./index.js');\n return cjsModule;\n } catch (error) {\n console.error('[FrontFriend] Failed to load CommonJS module:', error);\n throw error;\n }\n })();\n\n return cjsModulePromise;\n}\n\n// Create plugin function that loads CJS module on demand\nconst plugin = isNode\n ? function(...args) {\n // Synchronous require - this works because Node.js supports it\n if (!cjsModule) {\n try {\n // Use dynamic require - only available in Node.js\n const module = require('module');\n const req = module.createRequire(import.meta.url);\n cjsModule = req('./index.js');\n } catch (error) {\n console.error('[FrontFriend] Failed to load plugin:', error);\n return {};\n }\n }\n return typeof cjsModule === 'function' ? cjsModule(...args) : cjsModule;\n }\n : function() {\n // Browser: Use stub function\n if (isBrowser) {\n console.warn('[FrontFriend] The Tailwind plugin cannot be used directly in browser environments');\n }\n return {};\n };\n\n/**\n * Creates a deep proxy that gracefully handles arbitrary nested property access\n * without throwing errors. This is essential for SSR and build-time scenarios\n * where configuration might not be loaded yet.\n *\n * Features:\n * - Infinite depth access: config.a.b.c.d.e never crashes\n * - Referential equality: config.a === config.a (memoized)\n * - Iteration support: Object.keys(), spread operator, for...in\n * - Type coercion: Works with toString, valueOf, Symbol.toPrimitive\n * - 'in' operator: 'property' in config returns true\n *\n * @returns {Proxy} A proxy object that handles any property access safely\n *\n * @example\n * const config = createDeepProxy();\n * const value = config.sidebar.root.wrapper.base; // Never crashes\n * config.a === config.a; // true (referential equality)\n * 'anything' in config; // true\n * Object.keys(config); // []\n */\nfunction createDeepProxy() {\n // Cache for memoization - ensures referential equality\n // This is critical for React dependency arrays and equality checks\n const cache = new Map();\n\n const handler = {\n /**\n * Handles property access with memoization\n * Ensures config.a === config.a for referential equality\n */\n get(target, prop) {\n // Handle special cases for type coercion and inspection\n if (prop === Symbol.toPrimitive || prop === 'valueOf') {\n return () => '';\n }\n if (prop === 'toString' || prop === Symbol.toStringTag) {\n return () => '';\n }\n if (prop === 'constructor') {\n return Object;\n }\n\n // Return cached proxy for same property to maintain referential equality\n // This prevents issues with React hooks and memoization\n if (!cache.has(prop)) {\n cache.set(prop, createDeepProxy());\n }\n return cache.get(prop);\n },\n\n /**\n * Handles 'in' operator\n * Makes 'property' in config return true for any property\n */\n has(target, prop) {\n // Return true for all properties except internal symbols\n if (typeof prop === 'symbol' && prop.toString().includes('nodejs.util.inspect')) {\n return false;\n }\n return true;\n },\n\n /**\n * Handles Object.keys(), Object.getOwnPropertyNames(), for...in\n * Returns empty array since proxy represents missing/unknown config\n */\n ownKeys(target) {\n return [];\n },\n\n /**\n * Handles Object.getOwnPropertyDescriptor()\n * Required for proper iteration support with ownKeys\n */\n getOwnPropertyDescriptor(target, prop) {\n return {\n enumerable: true,\n configurable: true,\n };\n },\n };\n\n return new Proxy({}, handler);\n}\n\n/**\n * FrontFriend Design Config (ffdc) - Safe config wrapper with SSR support\n *\n * Wraps configuration objects to prevent crashes during SSR or when config\n * is not yet loaded. Returns actual config if valid, or a deep proxy fallback.\n *\n * This is the recommended way to access config in components to ensure\n * they work during both build-time (SSR) and runtime.\n *\n * @param {Object|null|undefined} config - The configuration object to wrap\n * @returns {Object|Proxy} The config object or a safe deep proxy\n *\n * @example\n * import { config, ffdc } from '@frontfriend/tailwind';\n *\n * // Safe access during SSR - never crashes\n * const sidebarConfig = ffdc(config || {}).sidebar;\n * const className = sidebarConfig.root.wrapper.base; // Always safe\n *\n * @example\n * // In a React component\n * function Sidebar() {\n * const cfg = ffdc(config).sidebar;\n * return <div className={cfg.root.base}>...</div>;\n * }\n */\nexport function ffdc(config) {\n // During SSR or initial load, config might not be available yet\n // Return a deep proxy that handles any property access without crashing\n if (!config || typeof config !== 'object') {\n return createDeepProxy();\n }\n\n return config;\n}\n\n// Export config and iconSet with lazy getters\n// In Node.js, load CJS module on first access\n// In browser, use proxies with global variable fallbacks\nexport const config = new Proxy({}, {\n // Cache for the loaded CJS module config\n _cjsConfig: null,\n // Cache for memoized deep proxies\n _proxyCache: new Map(),\n\n get(target, prop) {\n // Handle special cases for console.log, JSON.stringify, etc.\n if (prop === Symbol.toPrimitive || prop === 'valueOf') {\n return () => '';\n }\n if (prop === 'toString' || prop === Symbol.toStringTag) {\n return () => '[object Object]';\n }\n if (prop === 'constructor') {\n return Object;\n }\n\n // In Node.js, try to get config from CJS module first\n if (isNode && !this._cjsConfig && cjsModule) {\n this._cjsConfig = cjsModule.config;\n }\n\n if (isNode && this._cjsConfig && prop in this._cjsConfig) {\n return this._cjsConfig[prop];\n }\n\n // Try to get config from globals\n let _config = null;\n if (typeof __FF_CONFIG__ !== 'undefined') {\n _config = __FF_CONFIG__;\n } else if (typeof process !== 'undefined' && process.env) {\n if (process.env.NEXT_PUBLIC_FF_CONFIG) {\n try {\n _config = JSON.parse(process.env.NEXT_PUBLIC_FF_CONFIG);\n } catch (e) {\n console.warn('[FrontFriend] Failed to parse NEXT_PUBLIC_FF_CONFIG');\n }\n } else if (process.env.__FF_CONFIG__) {\n try {\n _config = JSON.parse(process.env.__FF_CONFIG__);\n } catch (e) {\n console.warn('[FrontFriend] Failed to parse __FF_CONFIG__');\n }\n }\n } else if (isBrowser && window.__FF_CONFIG__) {\n _config = window.__FF_CONFIG__;\n }\n\n // Return actual config value if it exists\n if (_config && prop in _config) {\n return _config[prop];\n }\n\n // Return memoized deep proxy for missing properties\n if (!this._proxyCache.has(prop)) {\n this._proxyCache.set(prop, createDeepProxy());\n }\n return this._proxyCache.get(prop);\n },\n\n has(target, prop) {\n return true;\n },\n\n ownKeys(target) {\n return [];\n },\n\n getOwnPropertyDescriptor(target, prop) {\n return {\n enumerable: true,\n configurable: true,\n };\n },\n });\n\nexport const iconSet = new Proxy({}, {\n // Cache for the loaded CJS module iconSet\n _cjsIconSet: null,\n\n get(target, prop) {\n if (prop === Symbol.toPrimitive || prop === 'valueOf') {\n return () => '';\n }\n if (prop === 'toString' || prop === Symbol.toStringTag) {\n return () => '[object Object]';\n }\n if (prop === 'constructor') {\n return Object;\n }\n\n // In Node.js, try to get iconSet from CJS module first\n if (isNode && !this._cjsIconSet && cjsModule) {\n this._cjsIconSet = cjsModule.iconSet;\n }\n\n if (isNode && this._cjsIconSet && prop in this._cjsIconSet) {\n return this._cjsIconSet[prop];\n }\n\n // Try to get icons from globals\n let _iconSet = null;\n if (typeof __FF_ICONS__ !== 'undefined') {\n _iconSet = __FF_ICONS__;\n } else if (typeof process !== 'undefined' && process.env) {\n if (process.env.NEXT_PUBLIC_FF_ICONS) {\n try {\n _iconSet = JSON.parse(process.env.NEXT_PUBLIC_FF_ICONS);\n } catch (e) {\n console.warn('[FrontFriend] Failed to parse NEXT_PUBLIC_FF_ICONS');\n }\n } else if (process.env.__FF_ICONS__) {\n try {\n _iconSet = JSON.parse(process.env.__FF_ICONS__);\n } catch (e) {\n console.warn('[FrontFriend] Failed to parse __FF_ICONS__');\n }\n }\n } else if (isBrowser && window.__FF_ICONS__) {\n _iconSet = window.__FF_ICONS__;\n }\n\n if (_iconSet && prop in _iconSet) {\n return _iconSet[prop];\n }\n\n return null;\n },\n\n has(target, prop) {\n return false;\n },\n\n ownKeys(target) {\n return [];\n },\n\n getOwnPropertyDescriptor(target, prop) {\n return undefined;\n },\n });\n\n// Default export is the plugin\nexport default plugin;\n"],
|
|
5
|
+
"mappings": "yPAIA,IAAMA,EAAY,OAAO,OAAW,KAAe,OAAO,OAAO,SAAa,IACxEC,EAAS,OAAO,QAAY,KAAe,QAAQ,UAAY,QAAQ,SAAS,KAGlFC,EAAY,KAwBhB,IAAMC,EAASC,EACX,YAAYC,EAAM,CAEhB,GAAI,CAACC,EACH,GAAI,CAIFA,EAFe,EAAQ,QAAQ,EACZ,cAAc,YAAY,GAAG,EAChC,YAAY,CAC9B,OAASC,EAAO,CACd,eAAQ,MAAM,uCAAwCA,CAAK,EACpD,CAAC,CACV,CAEF,OAAO,OAAOD,GAAc,WAAaA,EAAU,GAAGD,CAAI,EAAIC,CAChE,EACA,UAAW,CAET,OAAIE,GACF,QAAQ,KAAK,mFAAmF,EAE3F,CAAC,CACV,EAuBJ,SAASC,GAAkB,CAGzB,IAAMC,EAAQ,IAAI,IAEZC,EAAU,CAKd,IAAIC,EAAQC,EAAM,CAEhB,OAAIA,IAAS,OAAO,aAAeA,IAAS,UACnC,IAAM,GAEXA,IAAS,YAAcA,IAAS,OAAO,YAClC,IAAM,GAEXA,IAAS,cACJ,QAKJH,EAAM,IAAIG,CAAI,GACjBH,EAAM,IAAIG,EA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
6
|
+
"names": ["isBrowser", "isNode", "cjsModule", "plugin", "isNode", "args", "cjsModule", "error", "isBrowser", "createDeepProxy", "cache", "handler", "target", "prop", "ffdc", "config", "_config", "iconSet", "_iconSet", "frontfriend_tailwind_default"]
|
|
7
7
|
}
|
package/package.json
CHANGED
package/scripts/build.js
CHANGED
|
@@ -330,12 +330,14 @@ async function build() {
|
|
|
330
330
|
sourcemap: true,
|
|
331
331
|
format: 'esm',
|
|
332
332
|
platform: 'node',
|
|
333
|
-
target: '
|
|
333
|
+
target: 'node16', // Node 16+ for top-level await support
|
|
334
334
|
outfile: path.join(distDir, 'index.mjs'),
|
|
335
335
|
external: [
|
|
336
336
|
'tailwindcss',
|
|
337
337
|
'./lib/core/cache-manager.js',
|
|
338
338
|
'./ffdc.js',
|
|
339
|
+
'./index.js',
|
|
340
|
+
'module',
|
|
339
341
|
'fs',
|
|
340
342
|
'path'
|
|
341
343
|
],
|