@reticlehq/babel-plugin 2.2.1 → 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.
- package/dist/index.d.ts +0 -1
- package/dist/index.js +6 -2
- package/package.json +1 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
package/dist/index.d.ts
CHANGED
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
|
-
|
|
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
|
},
|
|
@@ -42,4 +47,3 @@ function reticleSourcePlugin({ types: t }) {
|
|
|
42
47
|
};
|
|
43
48
|
}
|
|
44
49
|
module.exports = reticleSourcePlugin;
|
|
45
|
-
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reticlehq/babel-plugin",
|
|
3
|
-
"version": "2.
|
|
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",
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,aAAa,CAAC;AAK9E,UAAU,SAAS;IACjB,KAAK,EAAE,OAAO,UAAU,CAAC;CAC1B;AAED;;;;;;;;;;GAUG;AACH,iBAAS,mBAAmB,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,SAAS,GAAG,SAAS,CAAC,UAAU,CAAC,CA8B3E;AAED,SAAS,mBAAmB,CAAC"}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,yCAAqC;AAGrC,8FAA8F;AAC9F,MAAM,WAAW,GAAG,qBAAqB,CAAC;AAM1C;;;;;;;;;;GAUG;AACH,SAAS,mBAAmB,CAAC,EAAE,KAAK,EAAE,CAAC,EAAa;IAClD,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE;YACP,iBAAiB,CAAC,IAAI,EAAE,KAAiB;gBACvC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;gBACvB,yEAAyE;gBACzE,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,eAAe;oBAAE,OAAO;gBAC/C,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBAChC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,KAAK,CAAC,WAAW,EAAE;oBAAE,OAAO;gBAEjE,MAAM,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CACzC,CAAC,IAAI,EAAE,EAAE,CACP,IAAI,CAAC,IAAI,KAAK,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