Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: widen JSX-text apostrophe detection to Unicode letters (#12794)

[._.]/ Adam Eivy7c4df8ccf811
diff --git a/scripts/lib/mockContractScan.js b/scripts/lib/mockContractScan.js
index af37078b36..9b97373f73 100644
--- a/scripts/lib/mockContractScan.js
+++ b/scripts/lib/mockContractScan.js
@@ -30,7 +30,7 @@ const KEYWORD_BEFORE_STRING = /(?:^|[^\w$.])(?:return|case|typeof|in|of|yield|aw
* is JSX text or prose (`scene's`), not code. Keywords legitimately precede strings.
*/
function isTextApostrophe(source, at) {
- if (!/[\w$]/.test(source[at - 1] ?? '')) return false;
+ if (!/[\p{L}\p{N}_$]/u.test(source[at - 1] ?? '')) return false;
return !KEYWORD_BEFORE_STRING.test(source.slice(Math.max(0, at - 12), at));
}
diff --git a/server/mockContractConventions.test.js b/server/mockContractConventions.test.js
index 6d3361e6ea..0e70506ca0 100644
--- a/server/mockContractConventions.test.js
+++ b/server/mockContractConventions.test.js
@@ -45,13 +45,14 @@ describe('vi.mock factory contract conventions', () => {
'export default Panel;',
].join('\n');
expect(mask(src)).toContain('export default Panel');
+ expect(mask('export const a = <i>Zoë\'s</i>;\nexport const b = 1;')).toContain('export const b');
expect(mask("export const a = 'x';\nexport const b = 1;")).toContain('export const b');
expect(mask("export const c = 'don\\'t';")).not.toContain('don');
});
it('collects the default export of a component with an apostrophe in JSX text (#12794)', () => {
const file = join(ROOT, 'client/src/components/writers-room/StoryboardConfigTab.jsx');
- expect([...exportNames(file)]).toEqual(['default']);
+ expect(exportNames(file).has('default')).toBe(true);
});
it('follows export * when collecting real exports', () => {