livelocale 0.8.0 → 0.9.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 (53) hide show
  1. package/README.md +230 -5
  2. package/dist/client/index.cjs +178 -70
  3. package/dist/client/index.cjs.map +1 -1
  4. package/dist/client/index.d.cts +36 -22
  5. package/dist/client/index.d.ts +36 -22
  6. package/dist/client/index.js +177 -70
  7. package/dist/client/index.js.map +1 -1
  8. package/dist/codemod/index.cjs +3057 -152
  9. package/dist/codemod/index.cjs.map +1 -1
  10. package/dist/codemod/index.js +3058 -153
  11. package/dist/codemod/index.js.map +1 -1
  12. package/dist/react/index.cjs +185 -77
  13. package/dist/react/index.cjs.map +1 -1
  14. package/dist/react/index.js +185 -77
  15. package/dist/react/index.js.map +1 -1
  16. package/dist/server/index.cjs +108 -66
  17. package/dist/server/index.cjs.map +1 -1
  18. package/dist/server/index.d.cts +13 -3
  19. package/dist/server/index.d.ts +13 -3
  20. package/dist/server/index.js +107 -66
  21. package/dist/server/index.js.map +1 -1
  22. package/dist/studio/assets/index-Bvbtkry-.css +1 -0
  23. package/dist/studio/assets/index-DC_jRsox.js +13 -0
  24. package/dist/studio/assets/inter-latin-300-normal-BVlfKGgI.woff2 +0 -0
  25. package/dist/studio/assets/inter-latin-300-normal-i8F0SvXL.woff +0 -0
  26. package/dist/studio/assets/inter-latin-400-normal-C38fXH4l.woff2 +0 -0
  27. package/dist/studio/assets/inter-latin-400-normal-CyCys3Eg.woff +0 -0
  28. package/dist/studio/assets/inter-latin-500-normal-BL9OpVg8.woff +0 -0
  29. package/dist/studio/assets/inter-latin-500-normal-Cerq10X2.woff2 +0 -0
  30. package/dist/studio/assets/inter-latin-600-normal-CiBQ2DWP.woff +0 -0
  31. package/dist/studio/assets/inter-latin-600-normal-LgqL8muc.woff2 +0 -0
  32. package/dist/studio/assets/inter-latin-700-normal-BLAVimhd.woff +0 -0
  33. package/dist/studio/assets/inter-latin-700-normal-Yt3aPRUw.woff2 +0 -0
  34. package/dist/studio/assets/outfit-latin-400-normal-BGsTXAXT.woff2 +0 -0
  35. package/dist/studio/assets/outfit-latin-400-normal-DMwTpYkH.woff +0 -0
  36. package/dist/studio/assets/outfit-latin-500-normal-ClnHRwRh.woff +0 -0
  37. package/dist/studio/assets/outfit-latin-500-normal-DKnIMDSk.woff2 +0 -0
  38. package/dist/studio/assets/outfit-latin-600-normal-B7SfZ07L.woff2 +0 -0
  39. package/dist/studio/assets/outfit-latin-600-normal-BEfTtDA7.woff +0 -0
  40. package/dist/studio/assets/outfit-latin-700-normal-Cu9v6i1X.woff2 +0 -0
  41. package/dist/studio/assets/outfit-latin-700-normal-D4itBLBr.woff +0 -0
  42. package/dist/studio/index.html +3 -6
  43. package/dist/vite/index.cjs +739 -77
  44. package/dist/vite/index.cjs.map +1 -1
  45. package/dist/vite/index.d.cts +22 -2
  46. package/dist/vite/index.d.ts +22 -2
  47. package/dist/vite/index.js +738 -77
  48. package/dist/vite/index.js.map +1 -1
  49. package/dist/{wrap-CsOtHp8r.d.cts → wrap-2qVxLN9Q.d.cts} +10 -18
  50. package/dist/{wrap-CsOtHp8r.d.ts → wrap-2qVxLN9Q.d.ts} +10 -18
  51. package/package.json +4 -1
  52. package/dist/studio/assets/index-D7ifnqy5.js +0 -10
  53. package/dist/studio/assets/index-Zh0KtFUH.css +0 -2
@@ -5,6 +5,21 @@ interface VitePluginConfig {
5
5
  git?: boolean;
6
6
  /** Bearer token required on every request. Defaults to `LIVELOCALE_TOKEN`. */
7
7
  authToken?: string;
8
+ /** Write the share Studio into <outDir>/livelocale/ on `vite build`. Off by default. */
9
+ share?: boolean;
10
+ /** Put the GitHub owner/repo into the published manifest. Defaults to false. */
11
+ exposeRepo?: boolean;
12
+ /** Source locale for the manifest. Defaults to en when present, else the first locale. */
13
+ sourceLocale?: string;
14
+ /** Site path the HTML is served from, when Vite `base` is a full URL or differs. */
15
+ shareBase?: string;
16
+ }
17
+ /** What `apply` receives from Vite: the command, and whether this is an SSR build. */
18
+ interface ViteConfigEnv {
19
+ command: 'serve' | 'build';
20
+ isSsrBuild?: boolean;
21
+ /** The Vite 4 name of `isSsrBuild`. */
22
+ ssrBuild?: boolean;
8
23
  }
9
24
  /**
10
25
  * A Vite plugin that serves the livelocale mutation API for Vite-based SPAs
@@ -20,9 +35,14 @@ interface VitePluginConfig {
20
35
  */
21
36
  declare function liveLocaleVite(config: VitePluginConfig): {
22
37
  name: string;
23
- apply: "serve";
38
+ apply(_userConfig: unknown, env: ViteConfigEnv): boolean;
39
+ configResolved(resolved: any): void;
40
+ buildStart(): void;
41
+ writeBundle(): Promise<void>;
24
42
  configureServer(server: any): void;
25
- transformIndexHtml(html: string): string;
43
+ transformIndexHtml(html: string, ctx?: {
44
+ path?: string;
45
+ }): string;
26
46
  };
27
47
 
28
48
  export { type VitePluginConfig, liveLocaleVite };
@@ -5,6 +5,21 @@ interface VitePluginConfig {
5
5
  git?: boolean;
6
6
  /** Bearer token required on every request. Defaults to `LIVELOCALE_TOKEN`. */
7
7
  authToken?: string;
8
+ /** Write the share Studio into <outDir>/livelocale/ on `vite build`. Off by default. */
9
+ share?: boolean;
10
+ /** Put the GitHub owner/repo into the published manifest. Defaults to false. */
11
+ exposeRepo?: boolean;
12
+ /** Source locale for the manifest. Defaults to en when present, else the first locale. */
13
+ sourceLocale?: string;
14
+ /** Site path the HTML is served from, when Vite `base` is a full URL or differs. */
15
+ shareBase?: string;
16
+ }
17
+ /** What `apply` receives from Vite: the command, and whether this is an SSR build. */
18
+ interface ViteConfigEnv {
19
+ command: 'serve' | 'build';
20
+ isSsrBuild?: boolean;
21
+ /** The Vite 4 name of `isSsrBuild`. */
22
+ ssrBuild?: boolean;
8
23
  }
9
24
  /**
10
25
  * A Vite plugin that serves the livelocale mutation API for Vite-based SPAs
@@ -20,9 +35,14 @@ interface VitePluginConfig {
20
35
  */
21
36
  declare function liveLocaleVite(config: VitePluginConfig): {
22
37
  name: string;
23
- apply: "serve";
38
+ apply(_userConfig: unknown, env: ViteConfigEnv): boolean;
39
+ configResolved(resolved: any): void;
40
+ buildStart(): void;
41
+ writeBundle(): Promise<void>;
24
42
  configureServer(server: any): void;
25
- transformIndexHtml(html: string): string;
43
+ transformIndexHtml(html: string, ctx?: {
44
+ path?: string;
45
+ }): string;
26
46
  };
27
47
 
28
48
  export { type VitePluginConfig, liveLocaleVite };