next-tongue 0.9.0 → 0.9.2

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 (272) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +86 -0
  3. package/dist/cli/check-types.d.ts +0 -1
  4. package/dist/cli/check-types.js +0 -1
  5. package/dist/cli/check.d.ts +0 -1
  6. package/dist/cli/check.js +0 -1
  7. package/dist/cli/export-import.d.ts +0 -1
  8. package/dist/cli/export-import.js +0 -1
  9. package/dist/cli/extract.d.ts +0 -1
  10. package/dist/cli/extract.js +0 -1
  11. package/dist/cli/index.d.ts +0 -1
  12. package/dist/cli/index.js +0 -1
  13. package/dist/cli/init.d.ts +0 -1
  14. package/dist/cli/init.js +0 -1
  15. package/dist/cli/migrate.d.ts +0 -1
  16. package/dist/cli/migrate.js +0 -1
  17. package/dist/cli/report.d.ts +0 -1
  18. package/dist/cli/report.js +0 -1
  19. package/dist/cli/reporters.d.ts +0 -1
  20. package/dist/cli/reporters.js +0 -1
  21. package/dist/cli/safe-path.d.ts +0 -1
  22. package/dist/cli/safe-path.js +0 -1
  23. package/dist/cli/translate.d.ts +0 -1
  24. package/dist/cli/translate.js +0 -1
  25. package/dist/client/dev-overlay-gate.d.ts +0 -1
  26. package/dist/client/dev-overlay-gate.js +0 -1
  27. package/dist/client/dev-overlay.d.ts +0 -1
  28. package/dist/client/dev-overlay.js +0 -1
  29. package/dist/client/dev-registry.d.ts +0 -1
  30. package/dist/client/dev-registry.js +0 -1
  31. package/dist/client/editor-url.d.ts +0 -1
  32. package/dist/client/editor-url.js +0 -1
  33. package/dist/client/index.d.ts +0 -1
  34. package/dist/client/index.js +0 -1
  35. package/dist/compiler/ast.d.ts +0 -1
  36. package/dist/compiler/ast.js +0 -1
  37. package/dist/compiler/build.d.ts +0 -1
  38. package/dist/compiler/build.js +0 -1
  39. package/dist/compiler/codegen/emit-js.d.ts +0 -1
  40. package/dist/compiler/codegen/emit-js.js +0 -1
  41. package/dist/compiler/codegen/emit-types.d.ts +0 -1
  42. package/dist/compiler/codegen/emit-types.js +0 -1
  43. package/dist/compiler/fallback.d.ts +0 -1
  44. package/dist/compiler/fallback.js +0 -1
  45. package/dist/compiler/index.d.ts +0 -1
  46. package/dist/compiler/index.js +0 -1
  47. package/dist/compiler/json-locations.d.ts +0 -1
  48. package/dist/compiler/json-locations.js +0 -1
  49. package/dist/compiler/load-messages.d.ts +0 -1
  50. package/dist/compiler/load-messages.js +0 -1
  51. package/dist/compiler/parse/icu-parser.d.ts +0 -1
  52. package/dist/compiler/parse/icu-parser.js +0 -1
  53. package/dist/compiler/pseudo.d.ts +0 -1
  54. package/dist/compiler/pseudo.js +0 -1
  55. package/dist/compiler/scan-keys.d.ts +0 -1
  56. package/dist/compiler/scan-keys.js +0 -1
  57. package/dist/compiler/scan-routes.d.ts +0 -1
  58. package/dist/compiler/scan-routes.js +0 -1
  59. package/dist/compiler/sources.d.ts +0 -1
  60. package/dist/compiler/sources.js +0 -1
  61. package/dist/compiler/validate/a11y.d.ts +0 -1
  62. package/dist/compiler/validate/a11y.js +0 -1
  63. package/dist/compiler/validate/bidi.d.ts +0 -1
  64. package/dist/compiler/validate/bidi.js +0 -1
  65. package/dist/compiler/validate/catalog.d.ts +0 -1
  66. package/dist/compiler/validate/catalog.js +0 -1
  67. package/dist/compiler/validate/length.d.ts +0 -1
  68. package/dist/compiler/validate/length.js +0 -1
  69. package/dist/compiler/validate/plurals.d.ts +0 -1
  70. package/dist/compiler/validate/plurals.js +0 -1
  71. package/dist/compiler/validate/usage.d.ts +0 -1
  72. package/dist/compiler/validate/usage.js +0 -1
  73. package/dist/config/define-config.d.ts +0 -1
  74. package/dist/config/define-config.js +0 -1
  75. package/dist/config/index.d.ts +0 -1
  76. package/dist/config/index.js +0 -1
  77. package/dist/config/load-config.d.ts +0 -1
  78. package/dist/config/load-config.js +0 -1
  79. package/dist/config/types.d.ts +0 -1
  80. package/dist/config/types.js +0 -1
  81. package/dist/config/validate.d.ts +0 -1
  82. package/dist/config/validate.js +0 -1
  83. package/dist/errors.d.ts +0 -1
  84. package/dist/errors.js +0 -1
  85. package/dist/index.d.ts +0 -1
  86. package/dist/index.js +0 -1
  87. package/dist/navigation/index.d.ts +0 -1
  88. package/dist/navigation/index.js +0 -1
  89. package/dist/navigation/locale-switcher.d.ts +0 -1
  90. package/dist/navigation/locale-switcher.js +0 -1
  91. package/dist/navigation/pathname.d.ts +0 -1
  92. package/dist/navigation/pathname.js +0 -1
  93. package/dist/next/index.d.ts +0 -1
  94. package/dist/next/index.js +0 -1
  95. package/dist/next/loader.d.ts +0 -1
  96. package/dist/next/loader.js +0 -1
  97. package/dist/next/watcher.d.ts +0 -1
  98. package/dist/next/watcher.js +0 -1
  99. package/dist/next/with-tongue.d.ts +0 -1
  100. package/dist/next/with-tongue.js +0 -1
  101. package/dist/proxy/index.d.ts +0 -1
  102. package/dist/proxy/index.js +0 -1
  103. package/dist/proxy/locale-matcher.d.ts +0 -1
  104. package/dist/proxy/locale-matcher.js +0 -1
  105. package/dist/runtime/create-t.d.ts +0 -1
  106. package/dist/runtime/create-t.js +0 -1
  107. package/dist/runtime/format-message.d.ts +0 -1
  108. package/dist/runtime/format-message.js +0 -1
  109. package/dist/runtime/format.d.ts +0 -1
  110. package/dist/runtime/format.js +0 -1
  111. package/dist/runtime/locale-preference.d.ts +0 -1
  112. package/dist/runtime/locale-preference.js +0 -1
  113. package/dist/runtime/locale.d.ts +0 -1
  114. package/dist/runtime/locale.js +0 -1
  115. package/dist/runtime/lru.d.ts +0 -1
  116. package/dist/runtime/lru.js +0 -1
  117. package/dist/runtime/rich.d.ts +0 -1
  118. package/dist/runtime/rich.js +0 -1
  119. package/dist/runtime/sanctioned-units.d.ts +0 -1
  120. package/dist/runtime/sanctioned-units.js +0 -1
  121. package/dist/runtime/translate-issues.d.ts +0 -1
  122. package/dist/runtime/translate-issues.js +0 -1
  123. package/dist/server/alternates.d.ts +0 -1
  124. package/dist/server/alternates.js +0 -1
  125. package/dist/server/index.d.ts +0 -1
  126. package/dist/server/index.js +9 -2
  127. package/dist/server/locale-preference.d.ts +0 -1
  128. package/dist/server/locale-preference.js +0 -1
  129. package/dist/testing/index.d.ts +0 -1
  130. package/dist/testing/index.js +0 -1
  131. package/package.json +34 -5
  132. package/dist/cli/check-types.d.ts.map +0 -1
  133. package/dist/cli/check-types.js.map +0 -1
  134. package/dist/cli/check.d.ts.map +0 -1
  135. package/dist/cli/check.js.map +0 -1
  136. package/dist/cli/export-import.d.ts.map +0 -1
  137. package/dist/cli/export-import.js.map +0 -1
  138. package/dist/cli/extract.d.ts.map +0 -1
  139. package/dist/cli/extract.js.map +0 -1
  140. package/dist/cli/index.d.ts.map +0 -1
  141. package/dist/cli/index.js.map +0 -1
  142. package/dist/cli/init.d.ts.map +0 -1
  143. package/dist/cli/init.js.map +0 -1
  144. package/dist/cli/migrate.d.ts.map +0 -1
  145. package/dist/cli/migrate.js.map +0 -1
  146. package/dist/cli/report.d.ts.map +0 -1
  147. package/dist/cli/report.js.map +0 -1
  148. package/dist/cli/reporters.d.ts.map +0 -1
  149. package/dist/cli/reporters.js.map +0 -1
  150. package/dist/cli/safe-path.d.ts.map +0 -1
  151. package/dist/cli/safe-path.js.map +0 -1
  152. package/dist/cli/translate.d.ts.map +0 -1
  153. package/dist/cli/translate.js.map +0 -1
  154. package/dist/client/dev-overlay-gate.d.ts.map +0 -1
  155. package/dist/client/dev-overlay-gate.js.map +0 -1
  156. package/dist/client/dev-overlay.d.ts.map +0 -1
  157. package/dist/client/dev-overlay.js.map +0 -1
  158. package/dist/client/dev-registry.d.ts.map +0 -1
  159. package/dist/client/dev-registry.js.map +0 -1
  160. package/dist/client/editor-url.d.ts.map +0 -1
  161. package/dist/client/editor-url.js.map +0 -1
  162. package/dist/client/index.d.ts.map +0 -1
  163. package/dist/client/index.js.map +0 -1
  164. package/dist/compiler/ast.d.ts.map +0 -1
  165. package/dist/compiler/ast.js.map +0 -1
  166. package/dist/compiler/build.d.ts.map +0 -1
  167. package/dist/compiler/build.js.map +0 -1
  168. package/dist/compiler/codegen/emit-js.d.ts.map +0 -1
  169. package/dist/compiler/codegen/emit-js.js.map +0 -1
  170. package/dist/compiler/codegen/emit-types.d.ts.map +0 -1
  171. package/dist/compiler/codegen/emit-types.js.map +0 -1
  172. package/dist/compiler/fallback.d.ts.map +0 -1
  173. package/dist/compiler/fallback.js.map +0 -1
  174. package/dist/compiler/index.d.ts.map +0 -1
  175. package/dist/compiler/index.js.map +0 -1
  176. package/dist/compiler/json-locations.d.ts.map +0 -1
  177. package/dist/compiler/json-locations.js.map +0 -1
  178. package/dist/compiler/load-messages.d.ts.map +0 -1
  179. package/dist/compiler/load-messages.js.map +0 -1
  180. package/dist/compiler/parse/icu-parser.d.ts.map +0 -1
  181. package/dist/compiler/parse/icu-parser.js.map +0 -1
  182. package/dist/compiler/pseudo.d.ts.map +0 -1
  183. package/dist/compiler/pseudo.js.map +0 -1
  184. package/dist/compiler/scan-keys.d.ts.map +0 -1
  185. package/dist/compiler/scan-keys.js.map +0 -1
  186. package/dist/compiler/scan-routes.d.ts.map +0 -1
  187. package/dist/compiler/scan-routes.js.map +0 -1
  188. package/dist/compiler/sources.d.ts.map +0 -1
  189. package/dist/compiler/sources.js.map +0 -1
  190. package/dist/compiler/validate/a11y.d.ts.map +0 -1
  191. package/dist/compiler/validate/a11y.js.map +0 -1
  192. package/dist/compiler/validate/bidi.d.ts.map +0 -1
  193. package/dist/compiler/validate/bidi.js.map +0 -1
  194. package/dist/compiler/validate/catalog.d.ts.map +0 -1
  195. package/dist/compiler/validate/catalog.js.map +0 -1
  196. package/dist/compiler/validate/length.d.ts.map +0 -1
  197. package/dist/compiler/validate/length.js.map +0 -1
  198. package/dist/compiler/validate/plurals.d.ts.map +0 -1
  199. package/dist/compiler/validate/plurals.js.map +0 -1
  200. package/dist/compiler/validate/usage.d.ts.map +0 -1
  201. package/dist/compiler/validate/usage.js.map +0 -1
  202. package/dist/config/define-config.d.ts.map +0 -1
  203. package/dist/config/define-config.js.map +0 -1
  204. package/dist/config/index.d.ts.map +0 -1
  205. package/dist/config/index.js.map +0 -1
  206. package/dist/config/load-config.d.ts.map +0 -1
  207. package/dist/config/load-config.js.map +0 -1
  208. package/dist/config/types.d.ts.map +0 -1
  209. package/dist/config/types.js.map +0 -1
  210. package/dist/config/validate.d.ts.map +0 -1
  211. package/dist/config/validate.js.map +0 -1
  212. package/dist/errors.d.ts.map +0 -1
  213. package/dist/errors.js.map +0 -1
  214. package/dist/index.d.ts.map +0 -1
  215. package/dist/index.js.map +0 -1
  216. package/dist/navigation/index.d.ts.map +0 -1
  217. package/dist/navigation/index.js.map +0 -1
  218. package/dist/navigation/locale-switcher.d.ts.map +0 -1
  219. package/dist/navigation/locale-switcher.js.map +0 -1
  220. package/dist/navigation/pathname.d.ts.map +0 -1
  221. package/dist/navigation/pathname.js.map +0 -1
  222. package/dist/next/index.d.ts.map +0 -1
  223. package/dist/next/index.js.map +0 -1
  224. package/dist/next/loader.d.ts.map +0 -1
  225. package/dist/next/loader.js.map +0 -1
  226. package/dist/next/watcher.d.ts.map +0 -1
  227. package/dist/next/watcher.js.map +0 -1
  228. package/dist/next/with-tongue.d.ts.map +0 -1
  229. package/dist/next/with-tongue.js.map +0 -1
  230. package/dist/proxy/index.d.ts.map +0 -1
  231. package/dist/proxy/index.js.map +0 -1
  232. package/dist/proxy/locale-matcher.d.ts.map +0 -1
  233. package/dist/proxy/locale-matcher.js.map +0 -1
  234. package/dist/runtime/create-t.d.ts.map +0 -1
  235. package/dist/runtime/create-t.js.map +0 -1
  236. package/dist/runtime/create-t.rich.test.d.ts +0 -2
  237. package/dist/runtime/create-t.rich.test.d.ts.map +0 -1
  238. package/dist/runtime/create-t.rich.test.js +0 -90
  239. package/dist/runtime/create-t.rich.test.js.map +0 -1
  240. package/dist/runtime/format-message.d.ts.map +0 -1
  241. package/dist/runtime/format-message.js.map +0 -1
  242. package/dist/runtime/format.d.ts.map +0 -1
  243. package/dist/runtime/format.js.map +0 -1
  244. package/dist/runtime/locale-preference.d.ts.map +0 -1
  245. package/dist/runtime/locale-preference.js.map +0 -1
  246. package/dist/runtime/locale.d.ts.map +0 -1
  247. package/dist/runtime/locale.js.map +0 -1
  248. package/dist/runtime/lru.d.ts.map +0 -1
  249. package/dist/runtime/lru.js.map +0 -1
  250. package/dist/runtime/rich.d.ts.map +0 -1
  251. package/dist/runtime/rich.js.map +0 -1
  252. package/dist/runtime/rich.test.d.ts +0 -2
  253. package/dist/runtime/rich.test.d.ts.map +0 -1
  254. package/dist/runtime/rich.test.js +0 -22
  255. package/dist/runtime/rich.test.js.map +0 -1
  256. package/dist/runtime/sanctioned-units.d.ts.map +0 -1
  257. package/dist/runtime/sanctioned-units.js.map +0 -1
  258. package/dist/runtime/translate-issues.d.ts.map +0 -1
  259. package/dist/runtime/translate-issues.js.map +0 -1
  260. package/dist/server/alternates.d.ts.map +0 -1
  261. package/dist/server/alternates.js.map +0 -1
  262. package/dist/server/index.d.ts.map +0 -1
  263. package/dist/server/index.js.map +0 -1
  264. package/dist/server/locale-preference.d.ts.map +0 -1
  265. package/dist/server/locale-preference.js.map +0 -1
  266. package/dist/testing/index.d.ts.map +0 -1
  267. package/dist/testing/index.js.map +0 -1
  268. package/dist/tsconfig.type-tests.tsbuildinfo +0 -1
  269. package/dist/types/type-safety.test-d.d.ts +0 -28
  270. package/dist/types/type-safety.test-d.d.ts.map +0 -1
  271. package/dist/types/type-safety.test-d.js +0 -31
  272. package/dist/types/type-safety.test-d.js.map +0 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Louis Wright
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,86 @@
1
+ # next-tongue
2
+
3
+ **Compiler-first, type-safe i18n for the Next.js 16 App Router.** Works with Turbopack, keeps the locale in route params, zero dependencies beyond `next` and `react`.
4
+
5
+ [![npm](https://img.shields.io/npm/v/next-tongue.svg)](https://www.npmjs.com/package/next-tongue)
6
+ [![license: MIT](https://img.shields.io/badge/license-MIT-blue)](./LICENSE)
7
+
8
+ > **Beta 0.9** — public API is frozen. See [API freeze](https://github.com/MrLouisWright/next-tongue/blob/main/docs/api-freeze.md).
9
+
10
+ ## Install
11
+
12
+ ```bash
13
+ npm install next-tongue
14
+ npx tongue init
15
+ ```
16
+
17
+ Requires **Next.js ≥ 16** (App Router) and **React ≥ 19**.
18
+
19
+ ## Quick start
20
+
21
+ ```ts
22
+ // tongue.config.ts
23
+ import { defineConfig } from 'next-tongue/config';
24
+
25
+ export default defineConfig({
26
+ locales: ['en', 'de'],
27
+ defaultLocale: 'en',
28
+ messages: './messages/{locale}.json',
29
+ });
30
+ ```
31
+
32
+ ```ts
33
+ // next.config.ts
34
+ import { withTongue } from 'next-tongue/next';
35
+
36
+ export default withTongue({ cacheComponents: true });
37
+ ```
38
+
39
+ ```ts
40
+ // proxy.ts
41
+ import { createProxy } from 'next-tongue/proxy';
42
+
43
+ export const proxy = createProxy();
44
+ export const config = { matcher: ['/((?!api|_next|.*\\..*).*)'] };
45
+ ```
46
+
47
+ ```tsx
48
+ // app/[locale]/page.tsx
49
+ import { getT } from 'next-tongue/server';
50
+
51
+ export default async function Page({
52
+ params,
53
+ }: {
54
+ params: Promise<{ locale: string }>;
55
+ }) {
56
+ const { locale } = await params;
57
+ const t = await getT(locale, 'home');
58
+ return <h1>{t('title')}</h1>;
59
+ }
60
+ ```
61
+
62
+ ## Package exports
63
+
64
+ | Import | Use |
65
+ |---|---|
66
+ | `next-tongue/config` | `defineConfig` |
67
+ | `next-tongue/next` | `withTongue` |
68
+ | `next-tongue/server` | `getT`, `getFormat`, `localeParams`, … |
69
+ | `next-tongue/client` | `TongueProvider`, `useT`, … |
70
+ | `next-tongue/proxy` | `createProxy` |
71
+ | `next-tongue/navigation` | `createNavigation` |
72
+ | `next-tongue/testing` | test helpers |
73
+
74
+ CLI: `tongue build | check | extract | init | export | import | report | translate | migrate`
75
+
76
+ ## Docs
77
+
78
+ - [Getting started](https://github.com/MrLouisWright/next-tongue/blob/main/docs/getting-started.md)
79
+ - [Configuration](https://github.com/MrLouisWright/next-tongue/blob/main/docs/configuration.md)
80
+ - [CLI](https://github.com/MrLouisWright/next-tongue/blob/main/docs/cli.md)
81
+ - [Migration from next-intl](https://github.com/MrLouisWright/next-tongue/blob/main/docs/migration/next-intl.md)
82
+ - [Roadmap](https://github.com/MrLouisWright/next-tongue/blob/main/ROADMAP.md)
83
+
84
+ ## License
85
+
86
+ MIT © Louis Wright
@@ -14,4 +14,3 @@ export type CheckResult = {
14
14
  errorCount: number;
15
15
  warningCount: number;
16
16
  };
17
- //# sourceMappingURL=check-types.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=check-types.js.map
@@ -7,4 +7,3 @@ export type CheckCliOptions = {
7
7
  quiet?: boolean;
8
8
  };
9
9
  export declare function cmdCheck(opts: CheckCliOptions): Promise<void>;
10
- //# sourceMappingURL=check.d.ts.map
package/dist/cli/check.js CHANGED
@@ -57,4 +57,3 @@ export async function cmdCheck(opts) {
57
57
  process.exitCode = 1;
58
58
  }
59
59
  }
60
- //# sourceMappingURL=check.js.map
@@ -29,4 +29,3 @@ export declare function csvToUnits(raw: string): Unit[];
29
29
  export declare function unitsToXliff(units: Unit[], srcLang: string, trgLang: string): string;
30
30
  export declare function xliffToUnits(raw: string): Unit[];
31
31
  export {};
32
- //# sourceMappingURL=export-import.d.ts.map
@@ -420,4 +420,3 @@ function unescapeXml(s) {
420
420
  .replace(/&quot;/g, '"')
421
421
  .replace(/&amp;/g, '&');
422
422
  }
423
- //# sourceMappingURL=export-import.js.map
@@ -10,4 +10,3 @@ export type ExtractCliOptions = {
10
10
  quiet?: boolean;
11
11
  };
12
12
  export declare function cmdExtract(opts: ExtractCliOptions): Promise<void>;
13
- //# sourceMappingURL=extract.d.ts.map
@@ -157,4 +157,3 @@ function confirm(prompt) {
157
157
  });
158
158
  });
159
159
  }
160
- //# sourceMappingURL=extract.js.map
@@ -1,2 +1 @@
1
1
  export declare function runCli(argv: string[]): Promise<void>;
2
- //# sourceMappingURL=index.d.ts.map
package/dist/cli/index.js CHANGED
@@ -280,4 +280,3 @@ Usage:
280
280
  Exit codes: 0 ok, 1 check/build failures, 2 usage/config error
281
281
  `);
282
282
  }
283
- //# sourceMappingURL=index.js.map
@@ -10,4 +10,3 @@ export type InitCliOptions = {
10
10
  quiet?: boolean;
11
11
  };
12
12
  export declare function cmdInit(opts: InitCliOptions): Promise<void>;
13
- //# sourceMappingURL=init.d.ts.map
package/dist/cli/init.js CHANGED
@@ -280,4 +280,3 @@ function ask(prompt, fallback) {
280
280
  });
281
281
  });
282
282
  }
283
- //# sourceMappingURL=init.js.map
@@ -33,4 +33,3 @@ export declare function transformNextIntl(source: string, _file: string): {
33
33
  };
34
34
  /** Heuristic: `locale` is a binding from params, props, or a nearby const. */
35
35
  export declare function hasLocaleInScope(source: string): boolean;
36
- //# sourceMappingURL=migrate.d.ts.map
@@ -200,4 +200,3 @@ async function walkSource(dir) {
200
200
  await walk(dir);
201
201
  return out;
202
202
  }
203
- //# sourceMappingURL=migrate.js.map
@@ -15,4 +15,3 @@ export type RouteReport = {
15
15
  };
16
16
  export declare function cmdReport(opts: ReportCliOptions): Promise<void>;
17
17
  export declare function parseMaxBytes(raw: string): number;
18
- //# sourceMappingURL=report.d.ts.map
@@ -140,4 +140,3 @@ export function parseMaxBytes(raw) {
140
140
  return Math.round(n * 1024 * 1024);
141
141
  return Math.round(n);
142
142
  }
143
- //# sourceMappingURL=report.js.map
@@ -4,4 +4,3 @@ export declare function reportPretty(result: CheckResult): void;
4
4
  export declare function reportJson(result: CheckResult): void;
5
5
  /** GitHub Actions workflow commands. */
6
6
  export declare function reportGithub(result: CheckResult): void;
7
- //# sourceMappingURL=reporters.d.ts.map
@@ -53,4 +53,3 @@ function escapeProp(s) {
53
53
  function escapeData(s) {
54
54
  return s.replace(/%/g, '%25').replace(/\r/g, '%0D').replace(/\n/g, '%0A');
55
55
  }
56
- //# sourceMappingURL=reporters.js.map
@@ -3,4 +3,3 @@
3
3
  * Used by every CLI write path (ADR threat model / v0.9 CLI security review).
4
4
  */
5
5
  export declare function resolveInsideProject(cwd: string, target: string): string;
6
- //# sourceMappingURL=safe-path.d.ts.map
@@ -13,4 +13,3 @@ export function resolveInsideProject(cwd, target) {
13
13
  }
14
14
  return abs;
15
15
  }
16
- //# sourceMappingURL=safe-path.js.map
@@ -23,4 +23,3 @@ export declare function maskIcu(source: string): {
23
23
  export declare function estimateTokens(text: string): number;
24
24
  export declare function cmdTranslate(opts: TranslateCliOptions): Promise<void>;
25
25
  export declare function validateParity(source: string, target: string, locale: string): void;
26
- //# sourceMappingURL=translate.d.ts.map
@@ -409,4 +409,3 @@ function setNested(root, fullKey, value) {
409
409
  }
410
410
  cur[parts[parts.length - 1]] = value;
411
411
  }
412
- //# sourceMappingURL=translate.js.map
@@ -8,4 +8,3 @@ export declare function DevOverlayGate({ locale, timeZone, editor, }: {
8
8
  timeZone: string;
9
9
  editor?: string;
10
10
  }): ReactNode;
11
- //# sourceMappingURL=dev-overlay-gate.d.ts.map
@@ -11,4 +11,3 @@ installTongueDevReporter();
11
11
  export function DevOverlayGate({ locale, timeZone, editor, }) {
12
12
  return (_jsx(DevOverlay, { locale: locale, timeZone: timeZone, ...(editor != null ? { editor } : {}) }));
13
13
  }
14
- //# sourceMappingURL=dev-overlay-gate.js.map
@@ -10,4 +10,3 @@ export type DevOverlayProps = {
10
10
  * Toggle with Alt+Shift+T.
11
11
  */
12
12
  export declare function DevOverlay({ locale, timeZone, editor, }: DevOverlayProps): ReactNode;
13
- //# sourceMappingURL=dev-overlay.d.ts.map
@@ -116,4 +116,3 @@ function Section({ title, children, }) {
116
116
  function Empty() {
117
117
  return _jsx("p", { style: { margin: 0, opacity: 0.55 }, children: "\u2014" });
118
118
  }
119
- //# sourceMappingURL=dev-overlay.js.map
@@ -46,4 +46,3 @@ export declare function getTongueDevSnapshot(): Snapshot;
46
46
  export declare function __resetTongueDev(): void;
47
47
  export declare function lookupRenderedByText(text: string): DevRendered | undefined;
48
48
  export {};
49
- //# sourceMappingURL=dev-registry.d.ts.map
@@ -99,4 +99,3 @@ export function lookupRenderedByText(text) {
99
99
  }
100
100
  return undefined;
101
101
  }
102
- //# sourceMappingURL=dev-registry.js.map
@@ -8,4 +8,3 @@ export declare function parseSourceRef(src: string | undefined): {
8
8
  file: string;
9
9
  line: number;
10
10
  } | null;
11
- //# sourceMappingURL=editor-url.d.ts.map
@@ -30,4 +30,3 @@ export function parseSourceRef(src) {
30
30
  return null;
31
31
  return { file: m[1], line: Number(m[2]) };
32
32
  }
33
- //# sourceMappingURL=editor-url.js.map
@@ -41,4 +41,3 @@ export type { SanctionedUnit, SimpleUnit, DisplayNameType, } from '../runtime/fo
41
41
  export { isSanctionedUnit, SIMPLE_UNITS } from '../runtime/format.js';
42
42
  export { translateIssues, defaultFormatPath, } from '../runtime/translate-issues.js';
43
43
  export type { TranslateIssue, TranslateIssuesOptions, IssuePathSegment, } from '../runtime/translate-issues.js';
44
- //# sourceMappingURL=index.d.ts.map
@@ -96,4 +96,3 @@ export const defaultLocale = {
96
96
  };
97
97
  export { isSanctionedUnit, SIMPLE_UNITS } from '../runtime/format.js';
98
98
  export { translateIssues, defaultFormatPath, } from '../runtime/translate-issues.js';
99
- //# sourceMappingURL=index.js.map
@@ -96,4 +96,3 @@ export type ArgKind = {
96
96
  };
97
97
  export type InferredArgs = Record<string, ArgKind>;
98
98
  export declare function collectArgs(ast: MessageAst, into?: InferredArgs): InferredArgs;
99
- //# sourceMappingURL=ast.d.ts.map
@@ -63,4 +63,3 @@ function mergeArg(into, name, next) {
63
63
  if (rank[next.kind] > rank[prev.kind])
64
64
  into[name] = next;
65
65
  }
66
- //# sourceMappingURL=ast.js.map
@@ -16,4 +16,3 @@ export declare function buildMessages(options: BuildOptions): Promise<BuildResul
16
16
  /** Locales written into message modules / types (includes pseudo when enabled). */
17
17
  export declare function localesForEmit(config: ResolvedTongueConfig): readonly string[];
18
18
  export declare function ensureDir(path: string): Promise<void>;
19
- //# sourceMappingURL=build.d.ts.map
@@ -434,4 +434,3 @@ function summarizeConfig(config) {
434
434
  export async function ensureDir(path) {
435
435
  await mkdir(dirname(path), { recursive: true });
436
436
  }
437
- //# sourceMappingURL=build.js.map
@@ -28,4 +28,3 @@ export declare function emitRichMessageFunction(exportName: string, ast: Message
28
28
  export declare function hasTags(ast: MessageAst): boolean;
29
29
  /** Safe JS identifier from a message key. */
30
30
  export declare function safeIdent(key: string): string;
31
- //# sourceMappingURL=emit-js.d.ts.map
@@ -349,4 +349,3 @@ export function safeIdent(key) {
349
349
  return `_${cleaned}`;
350
350
  return cleaned || '_';
351
351
  }
352
- //# sourceMappingURL=emit-js.js.map
@@ -5,4 +5,3 @@ export declare function emitTypesFile(opts: {
5
5
  namespaces: NamespaceTypes;
6
6
  pathnames?: string[];
7
7
  }): string;
8
- //# sourceMappingURL=emit-types.d.ts.map
@@ -52,4 +52,3 @@ function argsToType(args) {
52
52
  });
53
53
  return `{ ${fields.join('; ')} }`;
54
54
  }
55
- //# sourceMappingURL=emit-types.js.map
@@ -4,4 +4,3 @@
4
4
  */
5
5
  export declare function cldrParents(locale: string): string[];
6
6
  export declare function resolveFallbackChain(locale: string, defaultLocale: string, explicit: Partial<Record<string, string>>): string[];
7
- //# sourceMappingURL=fallback.d.ts.map
@@ -40,4 +40,3 @@ export function resolveFallbackChain(locale, defaultLocale, explicit) {
40
40
  }
41
41
  return chain;
42
42
  }
43
- //# sourceMappingURL=fallback.js.map
@@ -8,4 +8,3 @@ export { resolveFallbackChain, cldrParents } from './fallback.js';
8
8
  export { pluralCategoriesFor, checkPluralCategories } from './validate/plurals.js';
9
9
  export { emitMessageFunction, safeIdent } from './codegen/emit-js.js';
10
10
  export { emitTypesFile } from './codegen/emit-types.js';
11
- //# sourceMappingURL=index.d.ts.map
@@ -6,4 +6,3 @@ export { resolveFallbackChain, cldrParents } from './fallback.js';
6
6
  export { pluralCategoriesFor, checkPluralCategories } from './validate/plurals.js';
7
7
  export { emitMessageFunction, safeIdent } from './codegen/emit-js.js';
8
8
  export { emitTypesFile } from './codegen/emit-types.js';
9
- //# sourceMappingURL=index.js.map
@@ -3,4 +3,3 @@
3
3
  * Used for overlay click-to-key (`file:line`).
4
4
  */
5
5
  export declare function locateMessageKeys(raw: string, flatKeys: Iterable<string>): Record<string, number>;
6
- //# sourceMappingURL=json-locations.d.ts.map
@@ -119,4 +119,3 @@ export function locateMessageKeys(raw, flatKeys) {
119
119
  parseObject();
120
120
  return out;
121
121
  }
122
- //# sourceMappingURL=json-locations.js.map
@@ -13,4 +13,3 @@ export declare function groupByNamespace(flat: FlatMessages): Record<string, Fla
13
13
  export declare function loadLocaleMessages(config: ResolvedTongueConfig, cwd: string): Promise<LocaleCatalogs>;
14
14
  export declare function resolveMessagePath(cwd: string, pattern: string, locale: string): string;
15
15
  export { dirname, join };
16
- //# sourceMappingURL=load-messages.d.ts.map
@@ -98,4 +98,3 @@ export function resolveMessagePath(cwd, pattern, locale) {
98
98
  return resolve(cwd, messagesPath(pattern, locale));
99
99
  }
100
100
  export { dirname, join };
101
- //# sourceMappingURL=load-messages.js.map
@@ -8,4 +8,3 @@ export declare function offsetToLineCol(source: string, offset: number): {
8
8
  line: number;
9
9
  column: number;
10
10
  };
11
- //# sourceMappingURL=icu-parser.d.ts.map
@@ -404,4 +404,3 @@ export function offsetToLineCol(source, offset) {
404
404
  }
405
405
  return { line, column };
406
406
  }
407
- //# sourceMappingURL=icu-parser.js.map
@@ -11,4 +11,3 @@ export type PseudoOptions = {
11
11
  export declare function pseudoLocalizeString(input: string, options?: PseudoOptions): string;
12
12
  /** Deep-clone AST, transforming only `literal` nodes. */
13
13
  export declare function pseudoLocalizeAst(ast: MessageAst, options?: PseudoOptions): MessageAst;
14
- //# sourceMappingURL=pseudo.d.ts.map
@@ -111,4 +111,3 @@ function mapElement(el, options) {
111
111
  return el;
112
112
  }
113
113
  }
114
- //# sourceMappingURL=pseudo.js.map
@@ -11,4 +11,3 @@ export type ReferencedKey = {
11
11
  */
12
12
  export declare function scanReferencedKeys(cwd: string, roots?: string[]): Promise<ReferencedKey[]>;
13
13
  export declare function extractFromSource(source: string, file: string): ReferencedKey[];
14
- //# sourceMappingURL=scan-keys.d.ts.map
@@ -93,4 +93,3 @@ function lineAt(source, index) {
93
93
  function escapeRegExp(s) {
94
94
  return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
95
95
  }
96
- //# sourceMappingURL=scan-keys.js.map
@@ -3,4 +3,3 @@
3
3
  * Returns internal pathnames like `/`, `/about`, `/blog/[slug]`.
4
4
  */
5
5
  export declare function scanAppRoutes(cwd: string): Promise<string[]>;
6
- //# sourceMappingURL=scan-routes.d.ts.map
@@ -54,4 +54,3 @@ async function walk(dir, localeRoot, routes) {
54
54
  }
55
55
  }
56
56
  }
57
- //# sourceMappingURL=scan-routes.js.map
@@ -19,4 +19,3 @@ export declare function writeSourcesCache(cwd: string, outDir: string, payloads:
19
19
  /** Keys that appear in more than one origin (file + source, or multiple sources). */
20
20
  export declare function duplicateSourceKeys(origins: SourceOrigin[]): string[];
21
21
  export declare function sourcesCachePath(cwd: string, outDir: string): string;
22
- //# sourceMappingURL=sources.d.ts.map
@@ -119,4 +119,3 @@ export function duplicateSourceKeys(origins) {
119
119
  export function sourcesCachePath(cwd, outDir) {
120
120
  return join(resolve(cwd, outDir), 'sources.json');
121
121
  }
122
- //# sourceMappingURL=sources.js.map
@@ -5,4 +5,3 @@ import type { CheckIssue } from '../../cli/check-types.js';
5
5
  * `dir={getDir(locale)}` (or equivalent) for RTL locales.
6
6
  */
7
7
  export declare function validateA11y(config: ResolvedTongueConfig, cwd: string): Promise<CheckIssue[]>;
8
- //# sourceMappingURL=a11y.d.ts.map
@@ -77,4 +77,3 @@ async function findLocaleLayouts(cwd) {
77
77
  }
78
78
  return out;
79
79
  }
80
- //# sourceMappingURL=a11y.js.map
@@ -13,4 +13,3 @@ export declare function checkMessageBidi(text: string, ctx: {
13
13
  rtl: boolean;
14
14
  severity: CheckSeverity;
15
15
  }): CheckIssue[];
16
- //# sourceMappingURL=bidi.d.ts.map
@@ -99,4 +99,3 @@ export function checkMessageBidi(text, ctx) {
99
99
  }
100
100
  return issues;
101
101
  }
102
- //# sourceMappingURL=bidi.js.map
@@ -20,4 +20,3 @@ export type TongueLock = {
20
20
  export declare function validateStale(config: ResolvedTongueConfig, cwd: string, opts?: {
21
21
  locales?: readonly string[];
22
22
  }): Promise<CheckIssue[]>;
23
- //# sourceMappingURL=catalog.d.ts.map
@@ -224,4 +224,3 @@ export async function validateStale(config, cwd, opts) {
224
224
  }
225
225
  return issues;
226
226
  }
227
- //# sourceMappingURL=catalog.js.map
@@ -6,4 +6,3 @@ import type { CheckIssue } from '../../cli/check-types.js';
6
6
  export declare function validateLength(config: ResolvedTongueConfig, cwd: string, opts?: {
7
7
  locales?: readonly string[];
8
8
  }): Promise<CheckIssue[]>;
9
- //# sourceMappingURL=length.d.ts.map
@@ -71,4 +71,3 @@ function collectLengthIssues(node, prefix, locale, file, severity, issues) {
71
71
  }
72
72
  }
73
73
  }
74
- //# sourceMappingURL=length.js.map
@@ -7,4 +7,3 @@ export type PluralIssue = {
7
7
  locale: string;
8
8
  };
9
9
  export declare function checkPluralCategories(ast: MessageAst, locale: string): PluralIssue[];
10
- //# sourceMappingURL=plurals.d.ts.map
@@ -59,4 +59,3 @@ export function checkPluralCategories(ast, locale) {
59
59
  }
60
60
  return issues;
61
61
  }
62
- //# sourceMappingURL=plurals.js.map
@@ -2,4 +2,3 @@ import type { ResolvedTongueConfig } from '../../config/types.js';
2
2
  import type { CheckIssue } from '../../cli/check-types.js';
3
3
  /** unused + undefined checks against scanned source references. */
4
4
  export declare function validateUsage(config: ResolvedTongueConfig, cwd: string): Promise<CheckIssue[]>;
5
- //# sourceMappingURL=usage.d.ts.map
@@ -51,4 +51,3 @@ export async function validateUsage(config, cwd) {
51
51
  }
52
52
  return issues;
53
53
  }
54
- //# sourceMappingURL=usage.js.map
@@ -1,4 +1,3 @@
1
1
  import type { TongueConfig } from './types.js';
2
2
  /** Identity helper for typed `tongue.config.ts`. Build-time only. */
3
3
  export declare function defineConfig<const C extends TongueConfig>(config: C): C;
4
- //# sourceMappingURL=define-config.d.ts.map
@@ -2,4 +2,3 @@
2
2
  export function defineConfig(config) {
3
3
  return config;
4
4
  }
5
- //# sourceMappingURL=define-config.js.map
@@ -2,4 +2,3 @@ export { defineConfig } from './define-config.js';
2
2
  export { loadConfig, loadConfigFromObject } from './load-config.js';
3
3
  export { resolveConfig, isValidBcp47 } from './validate.js';
4
4
  export type { TongueConfig, ResolvedTongueConfig, StrictLevel, LocaleCookieConfig, DomainConfig, PseudoConfig, DevOverlayOption, ResolvedDevOverlay, } from './types.js';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,3 @@
1
1
  export { defineConfig } from './define-config.js';
2
2
  export { loadConfig, loadConfigFromObject } from './load-config.js';
3
3
  export { resolveConfig, isValidBcp47 } from './validate.js';
4
- //# sourceMappingURL=index.js.map
@@ -15,4 +15,3 @@ export declare function loadConfig(options?: LoadConfigOptions): Promise<{
15
15
  /** Sync-ish helper for tests: validate an in-memory config object. */
16
16
  export declare function loadConfigFromObject(input: TongueConfig): ResolvedTongueConfig;
17
17
  export declare function readJsonFile(path: string): Promise<unknown>;
18
- //# sourceMappingURL=load-config.d.ts.map
@@ -75,4 +75,3 @@ export async function readJsonFile(path) {
75
75
  const text = await readFile(path, 'utf8');
76
76
  return JSON.parse(text);
77
77
  }
78
- //# sourceMappingURL=load-config.js.map
@@ -113,4 +113,3 @@ export type ResolvedTongueConfig = {
113
113
  };
114
114
  translate: TongueConfig['translate'];
115
115
  };
116
- //# sourceMappingURL=types.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=types.js.map
@@ -3,4 +3,3 @@ export declare function isValidBcp47(tag: string): boolean;
3
3
  /** IANA time zone id — validated via `Intl.DateTimeFormat`. */
4
4
  export declare function isValidTimeZone(timeZone: string): boolean;
5
5
  export declare function resolveConfig(input: TongueConfig): ResolvedTongueConfig;
6
- //# sourceMappingURL=validate.d.ts.map
@@ -139,4 +139,3 @@ export function resolveConfig(input) {
139
139
  translate: input.translate,
140
140
  };
141
141
  }
142
- //# sourceMappingURL=validate.js.map
package/dist/errors.d.ts CHANGED
@@ -12,4 +12,3 @@ export declare class TongueError extends Error {
12
12
  column?: number;
13
13
  });
14
14
  }
15
- //# sourceMappingURL=errors.d.ts.map
package/dist/errors.js CHANGED
@@ -35,4 +35,3 @@ function formatLocation(loc) {
35
35
  }
36
36
  return parts.length ? parts.join(':') : undefined;
37
37
  }
38
- //# sourceMappingURL=errors.js.map