@shohojdhara/atomix 0.5.7 → 0.5.8

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.js CHANGED
@@ -21473,8 +21473,10 @@ function validateConfig$1(config) {
21473
21473
  * Helper function to load config from a specific path
21474
21474
  */ function loadConfigAtPath(path, required, defaultConfig) {
21475
21475
  try {
21476
- // Use dynamic import for ESM compatibility
21477
- const configModule = require(path), config = configModule.default || configModule;
21476
+ // Use dynamic requirement to hide from bundlers
21477
+ const req = "undefined" != typeof require ? require : void 0;
21478
+ if (!req) return defaultConfig;
21479
+ const configModule = req(path), config = configModule.default || configModule;
21478
21480
  // Validate it's an AtomixConfig
21479
21481
  if (config && "object" == typeof config) return config;
21480
21482
  throw new Error("Invalid config format");
@@ -21547,7 +21549,9 @@ function createTheme(input, options) {
21547
21549
  let loadAtomixConfig;
21548
21550
  try {
21549
21551
  // eslint-disable-next-line @typescript-eslint/no-var-requires
21550
- const {loadAtomixConfig: loader} = require("../../config/loader");
21552
+ const req = "undefined" != typeof require ? require : void 0;
21553
+ if (!req) throw new Error("require is not available");
21554
+ const {loadAtomixConfig: loader} = req("../../config/loader");
21551
21555
  loadAtomixConfig = loader;
21552
21556
  } catch (error) {
21553
21557
  throw new Error("Config loader module not available");
@@ -28448,10 +28452,19 @@ function(name, primaryColor, secondaryColor) {
28448
28452
  exports.removeTheme = removeTheme, exports.renderSlot = renderSlot, exports.resolveConfigPath = function(configPath) {
28449
28453
  // In browser environments, config resolution is not possible
28450
28454
  if ("undefined" != typeof window) return null;
28451
- // eslint-disable-next-line @typescript-eslint/no-var-requires
28452
- const {existsSync: existsSync} = require("fs"), {join: join} = require("path");
28453
- // eslint-disable-next-line @typescript-eslint/no-var-requires
28454
- // If a specific config path is provided, check if it exists
28455
+ // Use dynamic requirement to hide from bundlers like Turbopack/Webpack
28456
+ let nodeFs, nodePath;
28457
+ try {
28458
+ // Using a dynamic string and eval-like approach to prevent static analysis
28459
+ // This is safe here because we've already checked for window (browser)
28460
+ const req = "undefined" != typeof require ? require : void 0;
28461
+ req && (nodeFs = req([ "f", "s" ].join("")), nodePath = req([ "p", "a", "t", "h" ].join("")));
28462
+ } catch (e) {
28463
+ return null;
28464
+ }
28465
+ if (!nodeFs || !nodePath) return null;
28466
+ const {existsSync: existsSync} = nodeFs, {join: join} = nodePath;
28467
+ // If a specific config path is provided, check if it exists
28455
28468
  if (configPath) {
28456
28469
  const absPath = join(process.cwd(), configPath);
28457
28470
  return existsSync(absPath) ? absPath : null;