@tsrx/content-mapper 0.1.5 → 0.1.6

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/mapper.js CHANGED
@@ -1,3 +1,3 @@
1
- import { i as validate_options, n as require, r as to_diagnostic, t as create_tsrx_content_mapper } from "./mapper-CsFz-OPS.js";
1
+ import { i as validate_options, n as require, r as to_diagnostic, t as create_tsrx_content_mapper } from "./mapper-CiYVAopk.js";
2
2
 
3
3
  export { create_tsrx_content_mapper, require, to_diagnostic, validate_options };
package/dist/server.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as create_tsrx_content_mapper } from "./mapper-CsFz-OPS.js";
2
+ import { t as create_tsrx_content_mapper } from "./mapper-CiYVAopk.js";
3
3
  import { redirect_console_to_stderr, run_mapper_server } from "./rpc.js";
4
4
 
5
5
  //#region src/server.js
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tsrx/content-mapper",
3
3
  "description": "TypeScript 7 content mapper for .tsrx files",
4
- "version": "0.1.5",
4
+ "version": "0.1.6",
5
5
  "license": "MIT",
6
6
  "author": "Dominic Gannaway",
7
7
  "type": "module",
@@ -50,12 +50,12 @@
50
50
  "tsdown": "^0.23.0",
51
51
  "typescript": "^5.9.3",
52
52
  "vue": "3.6.0-rc.14",
53
- "@tsrx/solid": "0.4.12",
54
- "@tsrx/typescript-plugin": "0.7.12",
55
- "@tsrx/core": "0.8.0",
56
- "@tsrx/preact": "0.4.12",
57
- "@tsrx/vue": "0.4.12",
58
- "@tsrx/react": "0.5.12"
53
+ "@tsrx/core": "0.9.0",
54
+ "@tsrx/preact": "0.4.14",
55
+ "@tsrx/react": "0.5.14",
56
+ "@tsrx/typescript-plugin": "0.7.14",
57
+ "@tsrx/solid": "0.4.14",
58
+ "@tsrx/vue": "0.4.14"
59
59
  },
60
60
  "publishConfig": {
61
61
  "access": "public"
@@ -2,7 +2,7 @@
2
2
  /** @import {CodeMapping, CompileError} from '@tsrx/core/types' */
3
3
  /** @import {DiagnosticDirectives} from './protocol.js' */
4
4
 
5
- import { DIAGNOSTIC_CODES } from '@tsrx/core/diagnostics';
5
+ import { DIAGNOSTIC_CODES, TS_ERRORS } from '@tsrx/core/diagnostics';
6
6
  import { DiagnosticDirectivePolicy } from './protocol.js';
7
7
 
8
8
  /**
@@ -13,6 +13,8 @@ import { DiagnosticDirectivePolicy } from './protocol.js';
13
13
  const HOLDER_TYPE =
14
14
  /(?:Statement|Declaration|Definition|Signature)$|^(?:StaticBlock|AccessorProperty|JSXElement|JSXFragment|JSXStyleElement)$/;
15
15
 
16
+ const JSX_NAME_ESCAPE_CODE = TS_ERRORS.JSX_NAME_UNICODE_ESCAPE.code;
17
+
16
18
  /** Keys of a tree node that hold no child nodes, or nodes that aren't its children. */
17
19
  const NOT_CHILDREN = new Set([
18
20
  'metadata',
@@ -77,7 +79,13 @@ export function ignore_directives(errors, source_ast, mappings, original_length,
77
79
  }
78
80
  const on_tag = reported_on_tag(error);
79
81
  const position = on_tag ? /** @type {number} */ (error.raisedAt) - 1 : error.pos;
80
- const holder = source_ast ? holder_at(source_ast, position) : null;
82
+ // An escape in a JSX name (TS17021) only misspells the name, which the
83
+ // output has the right way: TypeScript's errors elsewhere in the element,
84
+ // such as a wrong attribute value, stay. Only the name's own code is
85
+ // covered, so TypeScript's error on the name itself (TS2304 on
86
+ // `<Missin\u0067 />`) shows once.
87
+ const holder =
88
+ source_ast && error.code !== JSX_NAME_ESCAPE_CODE ? holder_at(source_ast, position) : null;
81
89
  const start = holder ? /** @type {number} */ (holder.start) : error.pos;
82
90
  const end = holder
83
91
  ? /** @type {number} */ (holder.end)