@weglot/translate-react 0.2.1 → 0.3.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 (111) hide show
  1. package/README.md +118 -12
  2. package/build/metadata/manager.cjs +18 -5
  3. package/build/metadata/manager.mjs +17 -5
  4. package/build/metadata/manager.mjs.map +1 -1
  5. package/build/plugin/next-compiler-loader.cjs +1 -4
  6. package/build/plugin/next-compiler-loader.mjs +2 -5
  7. package/build/plugin/next-compiler-loader.mjs.map +1 -1
  8. package/build/plugin/next-traces.cjs +38 -0
  9. package/build/plugin/next-traces.mjs +36 -0
  10. package/build/plugin/next-traces.mjs.map +1 -0
  11. package/build/plugin/next.cjs +43 -12
  12. package/build/plugin/next.d.cts.map +1 -1
  13. package/build/plugin/next.d.mts.map +1 -1
  14. package/build/plugin/next.mjs +41 -13
  15. package/build/plugin/next.mjs.map +1 -1
  16. package/build/plugin/transform/index.cjs +17 -3
  17. package/build/plugin/transform/index.mjs +17 -3
  18. package/build/plugin/transform/index.mjs.map +1 -1
  19. package/build/plugin/transform/msg.cjs +66 -0
  20. package/build/plugin/transform/msg.mjs +64 -0
  21. package/build/plugin/transform/msg.mjs.map +1 -0
  22. package/build/plugin/transform/process-file.cjs +18 -7
  23. package/build/plugin/transform/process-file.mjs +18 -7
  24. package/build/plugin/transform/process-file.mjs.map +1 -1
  25. package/build/plugin/transform/utils.cjs +1 -0
  26. package/build/plugin/transform/utils.mjs +1 -1
  27. package/build/plugin/transform/utils.mjs.map +1 -1
  28. package/build/plugin/unplugin.cjs +6 -7
  29. package/build/plugin/unplugin.d.cts.map +1 -1
  30. package/build/plugin/unplugin.d.mts.map +1 -1
  31. package/build/plugin/unplugin.mjs +7 -8
  32. package/build/plugin/unplugin.mjs.map +1 -1
  33. package/build/react/client/index.cjs +2 -0
  34. package/build/react/client/index.d.cts +2 -1
  35. package/build/react/client/index.d.mts +2 -1
  36. package/build/react/client/index.mjs +2 -1
  37. package/build/react/client/useTranslation.cjs +14 -2
  38. package/build/react/client/useTranslation.d.cts +0 -35
  39. package/build/react/client/useTranslation.d.cts.map +1 -1
  40. package/build/react/client/useTranslation.d.mts +0 -35
  41. package/build/react/client/useTranslation.d.mts.map +1 -1
  42. package/build/react/client/useTranslation.mjs +15 -3
  43. package/build/react/client/useTranslation.mjs.map +1 -1
  44. package/build/react/server/ServerWeglotProvider.d.cts +2 -2
  45. package/build/react/server/ServerWeglotProvider.d.mts +2 -2
  46. package/build/react/server/index.cjs +2 -0
  47. package/build/react/server/index.d.cts +2 -1
  48. package/build/react/server/index.d.mts +2 -1
  49. package/build/react/server/index.mjs +2 -1
  50. package/build/react/server/useTranslation.cjs +6 -4
  51. package/build/react/server/useTranslation.d.cts.map +1 -1
  52. package/build/react/server/useTranslation.d.mts.map +1 -1
  53. package/build/react/server/useTranslation.mjs +6 -4
  54. package/build/react/server/useTranslation.mjs.map +1 -1
  55. package/build/react/server-only/index.cjs +5 -3
  56. package/build/react/server-only/index.d.cts +2 -3
  57. package/build/react/server-only/index.d.cts.map +1 -1
  58. package/build/react/server-only/index.d.mts +2 -3
  59. package/build/react/server-only/index.d.mts.map +1 -1
  60. package/build/react/server-only/index.mjs +5 -3
  61. package/build/react/server-only/index.mjs.map +1 -1
  62. package/build/react/server-only/translations.cjs +21 -1
  63. package/build/react/server-only/translations.mjs +22 -2
  64. package/build/react/server-only/translations.mjs.map +1 -1
  65. package/build/react/shared/LocaleSwitcher.d.mts +2 -2
  66. package/build/react/shared/WeglotContext.cjs +18 -2
  67. package/build/react/shared/WeglotContext.d.cts +1 -0
  68. package/build/react/shared/WeglotContext.d.cts.map +1 -1
  69. package/build/react/shared/WeglotContext.d.mts +2 -0
  70. package/build/react/shared/WeglotContext.d.mts.map +1 -1
  71. package/build/react/shared/WeglotContext.mjs +18 -2
  72. package/build/react/shared/WeglotContext.mjs.map +1 -1
  73. package/build/react/shared/WeglotProvider.cjs +4 -0
  74. package/build/react/shared/WeglotProvider.d.cts +2 -2
  75. package/build/react/shared/WeglotProvider.d.cts.map +1 -1
  76. package/build/react/shared/WeglotProvider.d.mts +2 -2
  77. package/build/react/shared/WeglotProvider.d.mts.map +1 -1
  78. package/build/react/shared/WeglotProvider.mjs +4 -0
  79. package/build/react/shared/WeglotProvider.mjs.map +1 -1
  80. package/build/react/shared/msg.cjs +50 -0
  81. package/build/react/shared/msg.d.cts +26 -0
  82. package/build/react/shared/msg.d.cts.map +1 -0
  83. package/build/react/shared/msg.d.mts +26 -0
  84. package/build/react/shared/msg.d.mts.map +1 -0
  85. package/build/react/shared/msg.mjs +47 -0
  86. package/build/react/shared/msg.mjs.map +1 -0
  87. package/build/react/types.d.cts +7 -3
  88. package/build/react/types.d.cts.map +1 -1
  89. package/build/react/types.d.mts +7 -3
  90. package/build/react/types.d.mts.map +1 -1
  91. package/build/runtime/lru-cache.cjs +38 -0
  92. package/build/runtime/lru-cache.mjs +38 -0
  93. package/build/runtime/lru-cache.mjs.map +1 -0
  94. package/build/runtime/translate-dynamic.cjs +71 -17
  95. package/build/runtime/translate-dynamic.d.cts +2 -0
  96. package/build/runtime/translate-dynamic.d.cts.map +1 -1
  97. package/build/runtime/translate-dynamic.d.mts +2 -0
  98. package/build/runtime/translate-dynamic.d.mts.map +1 -1
  99. package/build/runtime/translate-dynamic.mjs +71 -17
  100. package/build/runtime/translate-dynamic.mjs.map +1 -1
  101. package/build/translators/weglot/api-client.cjs +4 -1
  102. package/build/translators/weglot/api-client.mjs +4 -1
  103. package/build/translators/weglot/api-client.mjs.map +1 -1
  104. package/build/types.d.cts +7 -1
  105. package/build/types.d.cts.map +1 -1
  106. package/build/types.d.mts +7 -1
  107. package/build/types.d.mts.map +1 -1
  108. package/build/utils/package-version.cjs +12 -0
  109. package/build/utils/package-version.mjs +12 -0
  110. package/build/utils/package-version.mjs.map +1 -0
  111. package/package.json +4 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weglot/translate-react",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Automatic Weglot translation for React and Next.js apps, detected from your JSX at build time",
5
5
  "sideEffects": false,
6
6
  "type": "module",
@@ -190,9 +190,10 @@
190
190
  "scripts": {
191
191
  "dev": "tsdown --watch",
192
192
  "build": "pnpm typecheck && tsdown",
193
- "typecheck": "tsc --noEmit",
193
+ "typecheck": "tsc --noEmit && tsc -p e2e/tsconfig.json",
194
194
  "clean": "rm -rf build",
195
195
  "test": "vitest --run",
196
+ "test:e2e": "vitest --run --config vitest.e2e.config.ts",
196
197
  "sync-definitions": "node scripts/sync-definitions.ts",
197
198
  "check-definitions": "node scripts/sync-definitions.ts --check",
198
199
  "test:watch": "vitest -w",
@@ -232,6 +233,7 @@
232
233
  "@types/react-dom": "19.2.3",
233
234
  "jsdom": "30.0.1",
234
235
  "next": "16.2.9",
236
+ "playwright": "1.64.1",
235
237
  "tsdown": "0.18.2",
236
238
  "typescript": "5.9.3",
237
239
  "vitest": "4.1.0"