@reticlehq/babel-plugin 2.3.0 → 2.4.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.
Files changed (2) hide show
  1. package/dist/index.js +6 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -34,7 +34,12 @@ function reticleSourcePlugin({ types: t }) {
34
34
  if (loc === null || loc === undefined)
35
35
  return;
36
36
  const filename = state.filename ?? 'unknown';
37
- const rel = (0, node_path_1.relative)(process.cwd(), filename);
37
+ // Forward slashes always. `relative` returns the PLATFORM separator, so on Windows this
38
+ // stamped `src\Foo.tsx:42:8` — the `file:line` the whole product hands back, with a
39
+ // separator that matches neither the repo-relative paths every other Reticle surface emits
40
+ // nor the ones the agent then greps for. Nothing failed loudly; the pointers were just
41
+ // subtly the wrong string on one OS.
42
+ const rel = (0, node_path_1.relative)(process.cwd(), filename).replace(/\\/g, '/');
38
43
  const value = `${rel}:${String(loc.start.line)}:${String(loc.start.column)}`;
39
44
  node.attributes.push(t.jsxAttribute(t.jsxIdentifier(SOURCE_ATTR), t.stringLiteral(value)));
40
45
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reticlehq/babel-plugin",
3
- "version": "2.3.0",
3
+ "version": "2.4.0",
4
4
  "description": "Babel plugin that stamps data-reticle-source=\"file:line:col\" on JSX host elements so @reticlehq/react can map a DOM node to its source (works on React 19, which dropped _debugSource).",
5
5
  "type": "commonjs",
6
6
  "license": "Apache-2.0",