react-responsive-tools 2.0.9 → 2.0.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-responsive-tools",
3
- "version": "2.0.9",
3
+ "version": "2.0.10",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -9,7 +9,7 @@ const __filename = fileURLToPath(import.meta.url);
9
9
  const __dirname = path.dirname(__filename);
10
10
 
11
11
  // Путь к пользовательскому конфигурационному файлу
12
- const userConfigPath = path.resolve(__dirname, '../../breakpoints.config.js');
12
+ const userConfigPath = path.resolve(__dirname, '../../../../breakpoints.config.js');
13
13
 
14
14
  // Функция объединения значений по умолчанию с пользовательскими значениями
15
15
  const mergeConfigs = (defaultConfig, userConfig) => ({
@@ -24,6 +24,7 @@ const mergeBreakpointConfigs = async () => {
24
24
  // Проверяем, существует ли пользовательский конфигурационный файл
25
25
  if (fs.existsSync(userConfigPath)) {
26
26
  try {
27
+ console.log(`User config file found at: ${userConfigPath}`);
27
28
  const userConfig = await import(userConfigPath);
28
29
  horizontalBreakpoints = mergeConfigs(defaultHorizontalBreakpoints, userConfig.HORIZONTAL_BREAKPOINTS || {});
29
30
  verticalBreakpoints = mergeConfigs(defaultVerticalBreakpoints, userConfig.VERTICAL_BREAKPOINTS || {});
@@ -32,7 +33,7 @@ const mergeBreakpointConfigs = async () => {
32
33
  console.error('Error loading user config:', error);
33
34
  }
34
35
  } else {
35
- console.log('User config file not found, using default breakpoints.');
36
+ console.log(`User config file not found at: ${userConfigPath}. Using default breakpoints.`);
36
37
  }
37
38
 
38
39
  const mergedConfigContent = `
@@ -45,9 +46,9 @@ export { HORIZONTAL_BREAKPOINTS, VERTICAL_BREAKPOINTS };
45
46
  `;
46
47
 
47
48
  try {
48
- // Создаем новый файл с именем breakpoints.config.js
49
- fs.writeFileSync('../breakpoints.config.mjs', mergedConfigContent);
50
- console.log('Config file have been generated successfully.');
49
+ // Создаем новый файл с именем breakpoints.config.mjs
50
+ fs.writeFileSync(path.resolve(__dirname, '../breakpoints.config.mjs'), mergedConfigContent);
51
+ console.log('Config file has been generated successfully.');
51
52
  } catch (error) {
52
53
  console.error('Error writing merged config file:', error);
53
54
  }