@puzzle-ui/i18n 0.0.0-stage → 0.14.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 (152) hide show
  1. package/README.md +91 -2
  2. package/ai/instructions.md +141 -0
  3. package/ai/manifest.json +10 -0
  4. package/dist/LICENSE +21 -0
  5. package/dist/_virtual/_rolldown/runtime.cjs +22 -0
  6. package/dist/adapters/next.cjs +11 -0
  7. package/dist/adapters/next.cjs.map +1 -0
  8. package/dist/adapters/next.d.cts +7 -0
  9. package/dist/adapters/next.d.ts +7 -0
  10. package/dist/adapters/next.js +10 -0
  11. package/dist/adapters/next.js.map +1 -0
  12. package/dist/adapters/react-router.cjs +13 -0
  13. package/dist/adapters/react-router.cjs.map +1 -0
  14. package/dist/adapters/react-router.d.cts +10 -0
  15. package/dist/adapters/react-router.d.ts +10 -0
  16. package/dist/adapters/react-router.js +12 -0
  17. package/dist/adapters/react-router.js.map +1 -0
  18. package/dist/adapters/request.cjs +67 -0
  19. package/dist/adapters/request.cjs.map +1 -0
  20. package/dist/adapters/request.d.cts +16 -0
  21. package/dist/adapters/request.d.ts +16 -0
  22. package/dist/adapters/request.js +65 -0
  23. package/dist/adapters/request.js.map +1 -0
  24. package/dist/adapters/tanstack.cjs +13 -0
  25. package/dist/adapters/tanstack.cjs.map +1 -0
  26. package/dist/adapters/tanstack.d.cts +10 -0
  27. package/dist/adapters/tanstack.d.ts +10 -0
  28. package/dist/adapters/tanstack.js +12 -0
  29. package/dist/adapters/tanstack.js.map +1 -0
  30. package/dist/ai/index.cjs +205 -0
  31. package/dist/ai/index.cjs.map +1 -0
  32. package/dist/ai/index.d.cts +75 -0
  33. package/dist/ai/index.d.ts +75 -0
  34. package/dist/ai/index.js +195 -0
  35. package/dist/ai/index.js.map +1 -0
  36. package/dist/ai/review.cjs +319 -0
  37. package/dist/ai/review.cjs.map +1 -0
  38. package/dist/ai/review.d.cts +91 -0
  39. package/dist/ai/review.d.ts +91 -0
  40. package/dist/ai/review.js +315 -0
  41. package/dist/ai/review.js.map +1 -0
  42. package/dist/cli/bin.cjs +10 -0
  43. package/dist/cli/bin.cjs.map +1 -0
  44. package/dist/cli/bin.d.cts +1 -0
  45. package/dist/cli/bin.d.ts +1 -0
  46. package/dist/cli/bin.js +12 -0
  47. package/dist/cli/bin.js.map +1 -0
  48. package/dist/cli/index.cjs +310 -0
  49. package/dist/cli/index.cjs.map +1 -0
  50. package/dist/cli/index.d.cts +7 -0
  51. package/dist/cli/index.d.ts +7 -0
  52. package/dist/cli/index.js +309 -0
  53. package/dist/cli/index.js.map +1 -0
  54. package/dist/compiler/index.cjs +218 -0
  55. package/dist/compiler/index.cjs.map +1 -0
  56. package/dist/compiler/index.d.cts +18 -0
  57. package/dist/compiler/index.d.ts +18 -0
  58. package/dist/compiler/index.js +210 -0
  59. package/dist/compiler/index.js.map +1 -0
  60. package/dist/compiler/typescript.cjs +251 -0
  61. package/dist/compiler/typescript.cjs.map +1 -0
  62. package/dist/compiler/typescript.d.cts +27 -0
  63. package/dist/compiler/typescript.d.ts +27 -0
  64. package/dist/compiler/typescript.js +247 -0
  65. package/dist/compiler/typescript.js.map +1 -0
  66. package/dist/compiler/vite.cjs +94 -0
  67. package/dist/compiler/vite.cjs.map +1 -0
  68. package/dist/compiler/vite.d.cts +13 -0
  69. package/dist/compiler/vite.d.ts +13 -0
  70. package/dist/compiler/vite.js +92 -0
  71. package/dist/compiler/vite.js.map +1 -0
  72. package/dist/content/index.cjs +156 -0
  73. package/dist/content/index.cjs.map +1 -0
  74. package/dist/content/index.d.cts +75 -0
  75. package/dist/content/index.d.ts +75 -0
  76. package/dist/content/index.js +151 -0
  77. package/dist/content/index.js.map +1 -0
  78. package/dist/content/sanity.cjs +74 -0
  79. package/dist/content/sanity.cjs.map +1 -0
  80. package/dist/content/sanity.d.cts +19 -0
  81. package/dist/content/sanity.d.ts +19 -0
  82. package/dist/content/sanity.js +73 -0
  83. package/dist/content/sanity.js.map +1 -0
  84. package/dist/devtools/index.cjs +77 -0
  85. package/dist/devtools/index.cjs.map +1 -0
  86. package/dist/devtools/index.d.cts +29 -0
  87. package/dist/devtools/index.d.ts +29 -0
  88. package/dist/devtools/index.js +75 -0
  89. package/dist/devtools/index.js.map +1 -0
  90. package/dist/format.cjs +17 -0
  91. package/dist/format.cjs.map +1 -0
  92. package/dist/format.d.cts +9 -0
  93. package/dist/format.d.ts +9 -0
  94. package/dist/format.js +13 -0
  95. package/dist/format.js.map +1 -0
  96. package/dist/index.cjs +20 -0
  97. package/dist/index.d.cts +5 -0
  98. package/dist/index.d.ts +5 -0
  99. package/dist/index.js +5 -0
  100. package/dist/locale.cjs +158 -0
  101. package/dist/locale.cjs.map +1 -0
  102. package/dist/locale.d.cts +42 -0
  103. package/dist/locale.d.ts +42 -0
  104. package/dist/locale.js +155 -0
  105. package/dist/locale.js.map +1 -0
  106. package/dist/react/index.cjs +239 -0
  107. package/dist/react/index.cjs.map +1 -0
  108. package/dist/react/index.d.cts +105 -0
  109. package/dist/react/index.d.ts +105 -0
  110. package/dist/react/index.js +238 -0
  111. package/dist/react/index.js.map +1 -0
  112. package/dist/routing/index.cjs +381 -0
  113. package/dist/routing/index.cjs.map +1 -0
  114. package/dist/routing/index.d.cts +44 -0
  115. package/dist/routing/index.d.ts +44 -0
  116. package/dist/routing/index.js +380 -0
  117. package/dist/routing/index.js.map +1 -0
  118. package/dist/runtime.cjs +261 -0
  119. package/dist/runtime.cjs.map +1 -0
  120. package/dist/runtime.d.cts +74 -0
  121. package/dist/runtime.d.ts +74 -0
  122. package/dist/runtime.js +257 -0
  123. package/dist/runtime.js.map +1 -0
  124. package/dist/seo/index.cjs +212 -0
  125. package/dist/seo/index.cjs.map +1 -0
  126. package/dist/seo/index.d.cts +52 -0
  127. package/dist/seo/index.d.ts +52 -0
  128. package/dist/seo/index.js +209 -0
  129. package/dist/seo/index.js.map +1 -0
  130. package/dist/seo/origin.cjs +27 -0
  131. package/dist/seo/origin.cjs.map +1 -0
  132. package/dist/seo/origin.js +26 -0
  133. package/dist/seo/origin.js.map +1 -0
  134. package/dist/seo/sitemap.cjs +74 -0
  135. package/dist/seo/sitemap.cjs.map +1 -0
  136. package/dist/seo/sitemap.d.cts +16 -0
  137. package/dist/seo/sitemap.d.ts +16 -0
  138. package/dist/seo/sitemap.js +72 -0
  139. package/dist/seo/sitemap.js.map +1 -0
  140. package/dist/sources/index.cjs +227 -0
  141. package/dist/sources/index.cjs.map +1 -0
  142. package/dist/sources/index.d.cts +41 -0
  143. package/dist/sources/index.d.ts +41 -0
  144. package/dist/sources/index.js +222 -0
  145. package/dist/sources/index.js.map +1 -0
  146. package/dist/sources/node.cjs +50 -0
  147. package/dist/sources/node.cjs.map +1 -0
  148. package/dist/sources/node.d.cts +5 -0
  149. package/dist/sources/node.d.ts +5 -0
  150. package/dist/sources/node.js +49 -0
  151. package/dist/sources/node.js.map +1 -0
  152. package/package.json +256 -4
@@ -0,0 +1,50 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_sources_index = require("./index.cjs");
3
+ let node_fs_promises = require("node:fs/promises");
4
+ let node_path = require("node:path");
5
+ // src/sources/node.ts
6
+ const canonicalize = (locale) => {
7
+ try {
8
+ const [canonical] = Intl.getCanonicalLocales(locale);
9
+ if (!canonical) throw new Error();
10
+ return canonical;
11
+ } catch {
12
+ throw new require_sources_index.CatalogSourceError(`Invalid BCP 47 catalog locale "${locale}".`);
13
+ }
14
+ };
15
+ const namespaceSegments = (namespace) => {
16
+ if (!namespace) return [];
17
+ const segments = namespace.split(".");
18
+ if (segments.some((segment) => !segment || !/^[A-Za-z0-9_-]+$/.test(segment) || segment === "." || segment === "..")) throw new require_sources_index.CatalogSourceError(`Invalid catalog namespace "${namespace}".`);
19
+ return segments;
20
+ };
21
+ const createFileCatalogSource = (options) => {
22
+ if (!(0, node_path.isAbsolute)(options.rootDir)) throw new require_sources_index.CatalogSourceError("File catalog rootDir must be an absolute path.");
23
+ const rootDir = (0, node_path.resolve)(options.rootDir);
24
+ return Object.freeze({ async load(inputLocale, namespace, signal) {
25
+ const locale = canonicalize(inputLocale);
26
+ const segments = namespaceSegments(namespace);
27
+ const filePath = segments.length ? (0, node_path.join)(rootDir, locale, ...segments.slice(0, -1), `${segments.at(-1)}.json`) : (0, node_path.join)(rootDir, `${locale}.json`);
28
+ let realRoot;
29
+ let realFile;
30
+ let contents;
31
+ try {
32
+ realRoot = await (0, node_fs_promises.realpath)(rootDir);
33
+ realFile = await (0, node_fs_promises.realpath)(filePath);
34
+ const relativePath = (0, node_path.relative)(realRoot, realFile);
35
+ if (relativePath === ".." || relativePath.startsWith(`..${node_path.sep}`) || (0, node_path.isAbsolute)(relativePath)) throw new require_sources_index.CatalogSourceError(`Catalog path for "${locale}" escapes its configured root.`);
36
+ contents = await (0, node_fs_promises.readFile)(realFile, {
37
+ encoding: "utf8",
38
+ signal
39
+ });
40
+ } catch (error) {
41
+ if (error instanceof require_sources_index.CatalogSourceError) throw error;
42
+ if (signal?.aborted) throw signal.reason ?? error;
43
+ throw new require_sources_index.CatalogSourceError(`Could not read the catalog for "${locale}"${namespace ? ` namespace "${namespace}"` : ""}.`, { cause: error });
44
+ }
45
+ return require_sources_index.parseJsonCatalog(contents, locale);
46
+ } });
47
+ };
48
+ exports.createFileCatalogSource = createFileCatalogSource;
49
+
50
+ //# sourceMappingURL=node.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.cjs","names":["CatalogSourceError","isAbsolute","resolve","join","realpath","relative","sep","readFile","parseJsonCatalog"],"sources":["../../src/sources/node.ts"],"sourcesContent":["import { readFile, realpath } from \"node:fs/promises\";\nimport { isAbsolute, join, relative, resolve, sep } from \"node:path\";\n\nimport type { CatalogSource } from \"./index\";\nimport { CatalogSourceError, parseJsonCatalog } from \"./index\";\n\nconst canonicalize = (locale: string): string => {\n try {\n const [canonical] = Intl.getCanonicalLocales(locale);\n\n if (!canonical) {\n throw new Error();\n }\n\n return canonical;\n } catch {\n throw new CatalogSourceError(`Invalid BCP 47 catalog locale \"${locale}\".`);\n }\n};\n\nconst namespaceSegments = (namespace: string | undefined): string[] => {\n if (!namespace) {\n return [];\n }\n\n const segments = namespace.split(\".\");\n\n if (\n segments.some(\n (segment) =>\n !segment || !/^[A-Za-z0-9_-]+$/.test(segment) || segment === \".\" || segment === \"..\",\n )\n ) {\n throw new CatalogSourceError(\n `Invalid catalog namespace \"${namespace}\".`,\n );\n }\n\n return segments;\n};\n\nexport interface FileCatalogSourceOptions {\n rootDir: string;\n}\n\nexport const createFileCatalogSource = (\n options: FileCatalogSourceOptions,\n): CatalogSource => {\n if (!isAbsolute(options.rootDir)) {\n throw new CatalogSourceError(\"File catalog rootDir must be an absolute path.\");\n }\n\n const rootDir = resolve(options.rootDir);\n\n return Object.freeze({\n async load(\n inputLocale: string,\n namespace?: string,\n signal?: AbortSignal,\n ) {\n const locale = canonicalize(inputLocale);\n const segments = namespaceSegments(namespace);\n const filePath = segments.length\n ? join(rootDir, locale, ...segments.slice(0, -1), `${segments.at(-1)}.json`)\n : join(rootDir, `${locale}.json`);\n\n let realRoot: string;\n let realFile: string;\n let contents: string;\n\n try {\n realRoot = await realpath(rootDir);\n realFile = await realpath(filePath);\n const relativePath = relative(realRoot, realFile);\n\n if (\n relativePath === \"..\" ||\n relativePath.startsWith(`..${sep}`) ||\n isAbsolute(relativePath)\n ) {\n throw new CatalogSourceError(\n `Catalog path for \"${locale}\" escapes its configured root.`,\n );\n }\n\n contents = await readFile(realFile, {\n encoding: \"utf8\",\n signal,\n });\n } catch (error) {\n if (error instanceof CatalogSourceError) {\n throw error;\n }\n\n if (signal?.aborted) {\n throw signal.reason ?? error;\n }\n\n throw new CatalogSourceError(\n `Could not read the catalog for \"${locale}\"${namespace ? ` namespace \"${namespace}\"` : \"\"}.`,\n { cause: error },\n );\n }\n\n const catalog = parseJsonCatalog(contents, locale);\n return catalog;\n },\n });\n};\n"],"mappings":";;;;;AAMA,MAAM,gBAAgB,WAA2B;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AA,KAAK,MAAA,GAClCL,UAAAA,WAAAA,CAAW,YAAY,GAEvB,MAAM,IAAID,sBAAAA,mBACR,qBAAqB,OAAO,+BAC9B;GAGF,WAAW,OAAA,GAAMO,iBAAAA,SAAAA,CAAS,UAAU;IAClC,UAAU;IACV;GACF,CAAC;EACH,SAAS,OAAO;GACd,IAAI,iBAAiBP,sBAAAA,oBACnB,MAAM;GAGR,IAAI,QAAQ,SACV,MAAM,OAAO,UAAU;GAGzB,MAAM,IAAIA,sBAAAA,mBACR,mCAAmC,OAAO,GAAG,YAAY,eAAe,UAAU,KAAK,GAAG,IAC1F,EAAE,OAAO,MAAM,CACjB;EACF;EAGA,OADgBQ,sBAAAA,iBAAiB,UAAU,MAC9B;CACf,EACF,CAAC;AACH"}
@@ -0,0 +1,5 @@
1
+ import { CatalogSource } from "./index.cjs";
2
+ export interface FileCatalogSourceOptions {
3
+ rootDir: string;
4
+ }
5
+ export declare const createFileCatalogSource: (options: FileCatalogSourceOptions) => CatalogSource;
@@ -0,0 +1,5 @@
1
+ import { CatalogSource } from "./index.js";
2
+ export interface FileCatalogSourceOptions {
3
+ rootDir: string;
4
+ }
5
+ export declare const createFileCatalogSource: (options: FileCatalogSourceOptions) => CatalogSource;
@@ -0,0 +1,49 @@
1
+ import { CatalogSourceError, parseJsonCatalog } from "./index.js";
2
+ import { readFile, realpath } from "node:fs/promises";
3
+ import { isAbsolute, join, relative, resolve, sep } from "node:path";
4
+ // src/sources/node.ts
5
+ const canonicalize = (locale) => {
6
+ try {
7
+ const [canonical] = Intl.getCanonicalLocales(locale);
8
+ if (!canonical) throw new Error();
9
+ return canonical;
10
+ } catch {
11
+ throw new CatalogSourceError(`Invalid BCP 47 catalog locale "${locale}".`);
12
+ }
13
+ };
14
+ const namespaceSegments = (namespace) => {
15
+ if (!namespace) return [];
16
+ const segments = namespace.split(".");
17
+ if (segments.some((segment) => !segment || !/^[A-Za-z0-9_-]+$/.test(segment) || segment === "." || segment === "..")) throw new CatalogSourceError(`Invalid catalog namespace "${namespace}".`);
18
+ return segments;
19
+ };
20
+ const createFileCatalogSource = (options) => {
21
+ if (!isAbsolute(options.rootDir)) throw new CatalogSourceError("File catalog rootDir must be an absolute path.");
22
+ const rootDir = resolve(options.rootDir);
23
+ return Object.freeze({ async load(inputLocale, namespace, signal) {
24
+ const locale = canonicalize(inputLocale);
25
+ const segments = namespaceSegments(namespace);
26
+ const filePath = segments.length ? join(rootDir, locale, ...segments.slice(0, -1), `${segments.at(-1)}.json`) : join(rootDir, `${locale}.json`);
27
+ let realRoot;
28
+ let realFile;
29
+ let contents;
30
+ try {
31
+ realRoot = await realpath(rootDir);
32
+ realFile = await realpath(filePath);
33
+ const relativePath = relative(realRoot, realFile);
34
+ if (relativePath === ".." || relativePath.startsWith(`..${sep}`) || isAbsolute(relativePath)) throw new CatalogSourceError(`Catalog path for "${locale}" escapes its configured root.`);
35
+ contents = await readFile(realFile, {
36
+ encoding: "utf8",
37
+ signal
38
+ });
39
+ } catch (error) {
40
+ if (error instanceof CatalogSourceError) throw error;
41
+ if (signal?.aborted) throw signal.reason ?? error;
42
+ throw new CatalogSourceError(`Could not read the catalog for "${locale}"${namespace ? ` namespace "${namespace}"` : ""}.`, { cause: error });
43
+ }
44
+ return parseJsonCatalog(contents, locale);
45
+ } });
46
+ };
47
+ export { createFileCatalogSource };
48
+
49
+ //# sourceMappingURL=node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.js","names":[],"sources":["../../src/sources/node.ts"],"sourcesContent":["import { readFile, realpath } from \"node:fs/promises\";\nimport { isAbsolute, join, relative, resolve, sep } from \"node:path\";\n\nimport type { CatalogSource } from \"./index\";\nimport { CatalogSourceError, parseJsonCatalog } from \"./index\";\n\nconst canonicalize = (locale: string): string => {\n try {\n const [canonical] = Intl.getCanonicalLocales(locale);\n\n if (!canonical) {\n throw new Error();\n }\n\n return canonical;\n } catch {\n throw new CatalogSourceError(`Invalid BCP 47 catalog locale \"${locale}\".`);\n }\n};\n\nconst namespaceSegments = (namespace: string | undefined): string[] => {\n if (!namespace) {\n return [];\n }\n\n const segments = namespace.split(\".\");\n\n if (\n segments.some(\n (segment) =>\n !segment || !/^[A-Za-z0-9_-]+$/.test(segment) || segment === \".\" || segment === \"..\",\n )\n ) {\n throw new CatalogSourceError(\n `Invalid catalog namespace \"${namespace}\".`,\n );\n }\n\n return segments;\n};\n\nexport interface FileCatalogSourceOptions {\n rootDir: string;\n}\n\nexport const createFileCatalogSource = (\n options: FileCatalogSourceOptions,\n): CatalogSource => {\n if (!isAbsolute(options.rootDir)) {\n throw new CatalogSourceError(\"File catalog rootDir must be an absolute path.\");\n }\n\n const rootDir = resolve(options.rootDir);\n\n return Object.freeze({\n async load(\n inputLocale: string,\n namespace?: string,\n signal?: AbortSignal,\n ) {\n const locale = canonicalize(inputLocale);\n const segments = namespaceSegments(namespace);\n const filePath = segments.length\n ? join(rootDir, locale, ...segments.slice(0, -1), `${segments.at(-1)}.json`)\n : join(rootDir, `${locale}.json`);\n\n let realRoot: string;\n let realFile: string;\n let contents: string;\n\n try {\n realRoot = await realpath(rootDir);\n realFile = await realpath(filePath);\n const relativePath = relative(realRoot, realFile);\n\n if (\n relativePath === \"..\" ||\n relativePath.startsWith(`..${sep}`) ||\n isAbsolute(relativePath)\n ) {\n throw new CatalogSourceError(\n `Catalog path for \"${locale}\" escapes its configured root.`,\n );\n }\n\n contents = await readFile(realFile, {\n encoding: \"utf8\",\n signal,\n });\n } catch (error) {\n if (error instanceof CatalogSourceError) {\n throw error;\n }\n\n if (signal?.aborted) {\n throw signal.reason ?? error;\n }\n\n throw new CatalogSourceError(\n `Could not read the catalog for \"${locale}\"${namespace ? ` namespace \"${namespace}\"` : \"\"}.`,\n { cause: error },\n );\n }\n\n const catalog = parseJsonCatalog(contents, locale);\n return catalog;\n },\n });\n};\n"],"mappings":";;;;AAMA,MAAM,gBAAgB,WAA2B;CAC/C,IAAI;EACF,MAAM,CAAC,aAAa,KAAK,oBAAoB,MAAM;EAEnD,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AmC,OAAO,GAAG,YAAY,eAAe,UAAU,KAAK,GAAG,IAC1F,EAAE,OAAO,MAAM,CACjB;EACF;EAGA,OADgB,iBAAiB,UAAU,MAC9B;CACf,EACF,CAAC;AACH"}
package/package.json CHANGED
@@ -1,6 +1,258 @@
1
1
  {
2
2
  "name": "@puzzle-ui/i18n",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.14.0",
4
+ "description": "Type-safe, SSR-safe internationalization primitives for React applications.",
5
+ "homepage": "https://puzzle-ui.com/docs/multilingual",
6
+ "keywords": [
7
+ "puzzle-ui",
8
+ "i18n",
9
+ "internationalization",
10
+ "localization",
11
+ "typescript"
12
+ ],
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/senorprogramador/puzzle.git"
16
+ },
17
+ "license": "MIT",
18
+ "publishConfig": {
19
+ "access": "public",
20
+ "registry": "https://registry.npmjs.org/"
21
+ },
22
+ "type": "module",
23
+ "main": "./dist/index.cjs",
24
+ "module": "./dist/index.js",
25
+ "types": "./dist/index.d.ts",
26
+ "bin": {
27
+ "puzzle-i18n": "./dist/cli/bin.js"
28
+ },
29
+ "exports": {
30
+ ".": {
31
+ "import": {
32
+ "types": "./dist/index.d.ts",
33
+ "default": "./dist/index.js"
34
+ },
35
+ "require": {
36
+ "types": "./dist/index.d.cts",
37
+ "default": "./dist/index.cjs"
38
+ }
39
+ },
40
+ "./routing": {
41
+ "import": {
42
+ "types": "./dist/routing/index.d.ts",
43
+ "default": "./dist/routing/index.js"
44
+ },
45
+ "require": {
46
+ "types": "./dist/routing/index.d.cts",
47
+ "default": "./dist/routing/index.cjs"
48
+ }
49
+ },
50
+ "./seo": {
51
+ "import": {
52
+ "types": "./dist/seo/index.d.ts",
53
+ "default": "./dist/seo/index.js"
54
+ },
55
+ "require": {
56
+ "types": "./dist/seo/index.d.cts",
57
+ "default": "./dist/seo/index.cjs"
58
+ }
59
+ },
60
+ "./seo/sitemap": {
61
+ "import": {
62
+ "types": "./dist/seo/sitemap.d.ts",
63
+ "default": "./dist/seo/sitemap.js"
64
+ },
65
+ "require": {
66
+ "types": "./dist/seo/sitemap.d.cts",
67
+ "default": "./dist/seo/sitemap.cjs"
68
+ }
69
+ },
70
+ "./react": {
71
+ "import": {
72
+ "types": "./dist/react/index.d.ts",
73
+ "default": "./dist/react/index.js"
74
+ },
75
+ "require": {
76
+ "types": "./dist/react/index.d.cts",
77
+ "default": "./dist/react/index.cjs"
78
+ }
79
+ },
80
+ "./compiler": {
81
+ "import": {
82
+ "types": "./dist/compiler/index.d.ts",
83
+ "default": "./dist/compiler/index.js"
84
+ },
85
+ "require": {
86
+ "types": "./dist/compiler/index.d.cts",
87
+ "default": "./dist/compiler/index.cjs"
88
+ }
89
+ },
90
+ "./compiler/typescript": {
91
+ "import": {
92
+ "types": "./dist/compiler/typescript.d.ts",
93
+ "default": "./dist/compiler/typescript.js"
94
+ },
95
+ "require": {
96
+ "types": "./dist/compiler/typescript.d.cts",
97
+ "default": "./dist/compiler/typescript.cjs"
98
+ }
99
+ },
100
+ "./vite": {
101
+ "import": {
102
+ "types": "./dist/compiler/vite.d.ts",
103
+ "default": "./dist/compiler/vite.js"
104
+ },
105
+ "require": {
106
+ "types": "./dist/compiler/vite.d.cts",
107
+ "default": "./dist/compiler/vite.cjs"
108
+ }
109
+ },
110
+ "./ai": {
111
+ "import": {
112
+ "types": "./dist/ai/index.d.ts",
113
+ "default": "./dist/ai/index.js"
114
+ },
115
+ "require": {
116
+ "types": "./dist/ai/index.d.cts",
117
+ "default": "./dist/ai/index.cjs"
118
+ }
119
+ },
120
+ "./sources": {
121
+ "import": {
122
+ "types": "./dist/sources/index.d.ts",
123
+ "default": "./dist/sources/index.js"
124
+ },
125
+ "require": {
126
+ "types": "./dist/sources/index.d.cts",
127
+ "default": "./dist/sources/index.cjs"
128
+ }
129
+ },
130
+ "./sources/node": {
131
+ "import": {
132
+ "types": "./dist/sources/node.d.ts",
133
+ "default": "./dist/sources/node.js"
134
+ },
135
+ "require": {
136
+ "types": "./dist/sources/node.d.cts",
137
+ "default": "./dist/sources/node.cjs"
138
+ }
139
+ },
140
+ "./cli": {
141
+ "import": {
142
+ "types": "./dist/cli/index.d.ts",
143
+ "default": "./dist/cli/index.js"
144
+ },
145
+ "require": {
146
+ "types": "./dist/cli/index.d.cts",
147
+ "default": "./dist/cli/index.cjs"
148
+ }
149
+ },
150
+ "./next": {
151
+ "import": {
152
+ "types": "./dist/adapters/next.d.ts",
153
+ "default": "./dist/adapters/next.js"
154
+ },
155
+ "require": {
156
+ "types": "./dist/adapters/next.d.cts",
157
+ "default": "./dist/adapters/next.cjs"
158
+ }
159
+ },
160
+ "./tanstack": {
161
+ "import": {
162
+ "types": "./dist/adapters/tanstack.d.ts",
163
+ "default": "./dist/adapters/tanstack.js"
164
+ },
165
+ "require": {
166
+ "types": "./dist/adapters/tanstack.d.cts",
167
+ "default": "./dist/adapters/tanstack.cjs"
168
+ }
169
+ },
170
+ "./react-router": {
171
+ "import": {
172
+ "types": "./dist/adapters/react-router.d.ts",
173
+ "default": "./dist/adapters/react-router.js"
174
+ },
175
+ "require": {
176
+ "types": "./dist/adapters/react-router.d.cts",
177
+ "default": "./dist/adapters/react-router.cjs"
178
+ }
179
+ },
180
+ "./devtools": {
181
+ "import": {
182
+ "types": "./dist/devtools/index.d.ts",
183
+ "default": "./dist/devtools/index.js"
184
+ },
185
+ "require": {
186
+ "types": "./dist/devtools/index.d.cts",
187
+ "default": "./dist/devtools/index.cjs"
188
+ }
189
+ },
190
+ "./content": {
191
+ "import": {
192
+ "types": "./dist/content/index.d.ts",
193
+ "default": "./dist/content/index.js"
194
+ },
195
+ "require": {
196
+ "types": "./dist/content/index.d.cts",
197
+ "default": "./dist/content/index.cjs"
198
+ }
199
+ }
200
+ },
201
+ "files": [
202
+ "dist",
203
+ "README.md",
204
+ "ai"
205
+ ],
206
+ "sideEffects": false,
207
+ "scripts": {
208
+ "build": "tsdown",
209
+ "typecheck": "tsc --noEmit -p .",
210
+ "benchmark": "bun run build && node scripts/benchmark.mjs",
211
+ "vitest": "bun run test:unit",
212
+ "test:unit": "vitest run --config vitest.config.ts",
213
+ "test:browser": "bun run build && tsc --noEmit -p fixtures/accessibility/tsconfig.json && node --test src/tests/accessibility.browser.test.mjs",
214
+ "test:package": "bun run build && node --test src/tests/package.test.mjs",
215
+ "prepack": "bun run build"
216
+ },
217
+ "peerDependencies": {
218
+ "@puzzle-ui/seo": "^0.14.0",
219
+ "react": "^19.0.0",
220
+ "react-router": "^7.0.0",
221
+ "typescript": "^5.0.0",
222
+ "vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"
223
+ },
224
+ "peerDependenciesMeta": {
225
+ "@puzzle-ui/seo": {
226
+ "optional": true
227
+ },
228
+ "react": {
229
+ "optional": true
230
+ },
231
+ "react-router": {
232
+ "optional": true
233
+ },
234
+ "typescript": {
235
+ "optional": true
236
+ },
237
+ "vite": {
238
+ "optional": true
239
+ }
240
+ },
241
+ "devDependencies": {
242
+ "@axe-core/playwright": "^4.14.0",
243
+ "@puzzle-ui/seo": "^0.14.0",
244
+ "@types/node": "^26.6.6",
245
+ "@types/react": "^19.0.0",
246
+ "@types/react-dom": "^19.3.0",
247
+ "react": "^19.0.0",
248
+ "react-dom": "^19.0.0",
249
+ "react-router": "^7.0.0",
250
+ "tsdown": "^0.23.1",
251
+ "typescript": "^5.9.3",
252
+ "vitest": "^5.1.0",
253
+ "vite": "^8.3.3"
254
+ },
255
+ "dependencies": {
256
+ "intl-messageformat": "^12.2.0"
257
+ }
258
+ }