dinou 2.3.2 → 2.3.3

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/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/).
7
7
 
8
+ ## [2.3.3]
9
+
10
+ ### Fixed
11
+
12
+ - babel-esm-loader: check filePath is a file when resolving. This avoids crash when you have a file named equal than a folder in the same directory.
13
+
8
14
  ## [2.3.2]
9
15
 
10
16
  ### Fixed
@@ -68,17 +68,18 @@ const aliasMap = loadTsconfigAliases();
68
68
 
69
69
  // Añadir extensiones si no existen
70
70
  function tryExtensions(filePath) {
71
- if (fs.existsSync(filePath)) return filePath;
71
+ if (fs.existsSync(filePath) && fs.statSync(filePath).isFile())
72
+ return filePath;
72
73
  const exts = [".js", ".ts", ".jsx", ".tsx"];
73
74
  for (const ext of exts) {
74
75
  const f = filePath + ext;
75
- if (fs.existsSync(f)) return f;
76
+ if (fs.existsSync(f) && fs.statSync(f).isFile()) return f;
76
77
  }
77
78
  // Si es carpeta, probar index.*
78
79
  if (fs.existsSync(filePath) && fs.statSync(filePath).isDirectory()) {
79
80
  for (const ext of exts) {
80
81
  const f = path.join(filePath, "index" + ext);
81
- if (fs.existsSync(f)) return f;
82
+ if (fs.existsSync(f) && fs.statSync(f).isFile()) return f;
82
83
  }
83
84
  }
84
85
  return null;
@@ -142,6 +143,7 @@ exports.load = async function load(url, context, defaultLoad) {
142
143
  const source = `export default ${JSON.stringify(mod)};`;
143
144
  return { format: "module", source, shortCircuit: true, url };
144
145
  }
146
+
145
147
  if (/\.(jsx|tsx|ts|js)$/.test(url)) {
146
148
  let filename;
147
149
  try {
package/dinou/server.js CHANGED
@@ -296,7 +296,7 @@ app.post("/____server_function____", async (req, res) => {
296
296
  res.json(result);
297
297
  }
298
298
  } catch (err) {
299
- console.error("Server function error:", err);
299
+ console.error(`Server function error [${req.body.id}]:`, err);
300
300
  res.status(500).json({ error: err.message });
301
301
  }
302
302
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dinou",
3
- "version": "2.3.2",
3
+ "version": "2.3.3",
4
4
  "description": "Minimal React 19 Framework",
5
5
  "main": "index.js",
6
6
  "bin": {