@fluenti/react 0.4.0-rc.1 → 0.4.0-rc.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.
@@ -1 +1 @@
1
- {"version":3,"file":"vite-plugin.cjs","names":[],"sources":["../src/react-runtime.ts","../src/vite-plugin.ts"],"sourcesContent":["import { createRuntimeGenerator } from '@fluenti/vite-plugin'\nimport type { RuntimeGenerator } from '@fluenti/vite-plugin'\n\nexport const reactRuntimeGenerator: RuntimeGenerator = createRuntimeGenerator({\n imports: '',\n catalogInit: 'const __catalog = { ...__defaultMsgs }',\n localeInit: (defaultLocale) => `let __currentLocale = '${defaultLocale}'`,\n loadingInit: 'let __loading = false',\n catalogUpdate: (msgs) => `Object.assign(__catalog, ${msgs})`,\n localeUpdate: (locale) => `__currentLocale = ${locale}`,\n loadingUpdate: (value) => `__loading = ${value}`,\n localeRead: '__currentLocale',\n runtimeKey: 'fluenti.runtime.react.v1',\n})\n","import type { Plugin } from 'vite'\nimport type { FluentiPluginOptions } from '@fluenti/vite-plugin'\nimport { createFluentiPlugins } from '@fluenti/vite-plugin'\nimport { reactRuntimeGenerator } from './react-runtime'\n\nexport type { FluentiPluginOptions as FluentiReactOptions } from '@fluenti/vite-plugin'\n\nexport default function fluentiReact(options?: FluentiPluginOptions): Plugin[] {\n return createFluentiPlugins(\n { ...(options?.config !== undefined ? { config: options.config } : {}), framework: 'react' },\n [],\n reactRuntimeGenerator,\n )\n}\n"],"mappings":"sCAGA,IAAa,GAAA,EAAA,EAAA,wBAAiE,CAC5E,QAAS,GACT,YAAa,yCACb,WAAa,GAAkB,0BAA0B,EAAc,GACvE,YAAa,wBACb,cAAgB,GAAS,4BAA4B,EAAK,GAC1D,aAAe,GAAW,qBAAqB,IAC/C,cAAgB,GAAU,eAAe,IACzC,WAAY,kBACZ,WAAY,2BACb,CAAC,CCNF,SAAwB,EAAa,EAA0C,CAC7E,OAAA,EAAA,EAAA,sBACE,CAAE,GAAI,GAAS,SAAW,IAAA,GAAyC,EAAE,CAA/B,CAAE,OAAQ,EAAQ,OAAQ,CAAQ,UAAW,QAAS,CAC5F,EAAE,CACF,EACD"}
1
+ {"version":3,"file":"vite-plugin.cjs","names":[],"sources":["../src/react-runtime.ts","../src/vite-plugin.ts"],"sourcesContent":["import { createRuntimeGenerator } from '@fluenti/vite-plugin'\nimport type { RuntimeGenerator } from '@fluenti/vite-plugin'\n\nexport const reactRuntimeGenerator: RuntimeGenerator = createRuntimeGenerator({\n imports: '',\n catalogInit: 'const __catalog = { ...__defaultMsgs }',\n localeInit: (defaultLocale) => `let __currentLocale = '${defaultLocale}'`,\n loadingInit: 'let __loading = false',\n catalogUpdate: (msgs) => `Object.assign(__catalog, ${msgs})`,\n localeUpdate: (locale) => `__currentLocale = ${locale}`,\n loadingUpdate: (value) => `__loading = ${value}`,\n localeRead: '__currentLocale',\n runtimeKey: 'fluenti.runtime.react.v1',\n})\n","import type { Plugin } from 'vite'\nimport type { FluentiPluginOptions } from '@fluenti/vite-plugin'\nimport { createFluentiPlugins } from '@fluenti/vite-plugin'\nimport { reactRuntimeGenerator } from './react-runtime'\n\nexport type { FluentiPluginOptions as FluentiReactOptions } from '@fluenti/vite-plugin'\n\n/**\n * Fluenti React Vite plugin.\n *\n * @example Minimal — no fluenti.config.ts needed\n * ```ts\n * // vite.config.ts\n * import fluentiReact from '@fluenti/react/vite-plugin'\n *\n * export default defineConfig({\n * plugins: [fluentiReact({ config: { locales: ['en', 'ja'] } })],\n * })\n * ```\n *\n * @example With fluenti.config.ts (for advanced options)\n * ```ts\n * export default defineConfig({\n * plugins: [fluentiReact()], // auto-reads fluenti.config.ts\n * })\n * ```\n */\nexport default function fluentiReact(options?: FluentiPluginOptions): Plugin[] {\n return createFluentiPlugins(\n { ...(options?.config !== undefined ? { config: options.config } : {}), framework: 'react' },\n [],\n reactRuntimeGenerator,\n )\n}\n"],"mappings":"sCAGA,IAAa,GAAA,EAAA,EAAA,wBAAiE,CAC5E,QAAS,GACT,YAAa,yCACb,WAAa,GAAkB,0BAA0B,EAAc,GACvE,YAAa,wBACb,cAAgB,GAAS,4BAA4B,EAAK,GAC1D,aAAe,GAAW,qBAAqB,IAC/C,cAAgB,GAAU,eAAe,IACzC,WAAY,kBACZ,WAAY,2BACb,CAAC,CCcF,SAAwB,EAAa,EAA0C,CAC7E,OAAA,EAAA,EAAA,sBACE,CAAE,GAAI,GAAS,SAAW,IAAA,GAAyC,EAAE,CAA/B,CAAE,OAAQ,EAAQ,OAAQ,CAAQ,UAAW,QAAS,CAC5F,EAAE,CACF,EACD"}
@@ -1,5 +1,25 @@
1
1
  import { Plugin } from 'vite';
2
2
  import { FluentiPluginOptions } from '@fluenti/vite-plugin';
3
3
  export type { FluentiPluginOptions as FluentiReactOptions } from '@fluenti/vite-plugin';
4
+ /**
5
+ * Fluenti React Vite plugin.
6
+ *
7
+ * @example Minimal — no fluenti.config.ts needed
8
+ * ```ts
9
+ * // vite.config.ts
10
+ * import fluentiReact from '@fluenti/react/vite-plugin'
11
+ *
12
+ * export default defineConfig({
13
+ * plugins: [fluentiReact({ config: { locales: ['en', 'ja'] } })],
14
+ * })
15
+ * ```
16
+ *
17
+ * @example With fluenti.config.ts (for advanced options)
18
+ * ```ts
19
+ * export default defineConfig({
20
+ * plugins: [fluentiReact()], // auto-reads fluenti.config.ts
21
+ * })
22
+ * ```
23
+ */
4
24
  export default function fluentiReact(options?: FluentiPluginOptions): Plugin[];
5
25
  //# sourceMappingURL=vite-plugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"vite-plugin.d.ts","sourceRoot":"","sources":["../src/vite-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAClC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAIhE,YAAY,EAAE,oBAAoB,IAAI,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAEvF,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,OAAO,CAAC,EAAE,oBAAoB,GAAG,MAAM,EAAE,CAM7E"}
1
+ {"version":3,"file":"vite-plugin.d.ts","sourceRoot":"","sources":["../src/vite-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAClC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAIhE,YAAY,EAAE,oBAAoB,IAAI,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAEvF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,OAAO,CAAC,EAAE,oBAAoB,GAAG,MAAM,EAAE,CAM7E"}
@@ -1 +1 @@
1
- {"version":3,"file":"vite-plugin.js","names":[],"sources":["../src/react-runtime.ts","../src/vite-plugin.ts"],"sourcesContent":["import { createRuntimeGenerator } from '@fluenti/vite-plugin'\nimport type { RuntimeGenerator } from '@fluenti/vite-plugin'\n\nexport const reactRuntimeGenerator: RuntimeGenerator = createRuntimeGenerator({\n imports: '',\n catalogInit: 'const __catalog = { ...__defaultMsgs }',\n localeInit: (defaultLocale) => `let __currentLocale = '${defaultLocale}'`,\n loadingInit: 'let __loading = false',\n catalogUpdate: (msgs) => `Object.assign(__catalog, ${msgs})`,\n localeUpdate: (locale) => `__currentLocale = ${locale}`,\n loadingUpdate: (value) => `__loading = ${value}`,\n localeRead: '__currentLocale',\n runtimeKey: 'fluenti.runtime.react.v1',\n})\n","import type { Plugin } from 'vite'\nimport type { FluentiPluginOptions } from '@fluenti/vite-plugin'\nimport { createFluentiPlugins } from '@fluenti/vite-plugin'\nimport { reactRuntimeGenerator } from './react-runtime'\n\nexport type { FluentiPluginOptions as FluentiReactOptions } from '@fluenti/vite-plugin'\n\nexport default function fluentiReact(options?: FluentiPluginOptions): Plugin[] {\n return createFluentiPlugins(\n { ...(options?.config !== undefined ? { config: options.config } : {}), framework: 'react' },\n [],\n reactRuntimeGenerator,\n )\n}\n"],"mappings":";;AAGA,IAAa,IAA0C,EAAuB;CAC5E,SAAS;CACT,aAAa;CACb,aAAa,MAAkB,0BAA0B,EAAc;CACvE,aAAa;CACb,gBAAgB,MAAS,4BAA4B,EAAK;CAC1D,eAAe,MAAW,qBAAqB;CAC/C,gBAAgB,MAAU,eAAe;CACzC,YAAY;CACZ,YAAY;CACb,CAAC;;;ACNF,SAAwB,EAAa,GAA0C;AAC7E,QAAO,EACL;EAAE,GAAI,GAAS,WAAW,KAAA,IAAyC,EAAE,GAA/B,EAAE,QAAQ,EAAQ,QAAQ;EAAQ,WAAW;EAAS,EAC5F,EAAE,EACF,EACD"}
1
+ {"version":3,"file":"vite-plugin.js","names":[],"sources":["../src/react-runtime.ts","../src/vite-plugin.ts"],"sourcesContent":["import { createRuntimeGenerator } from '@fluenti/vite-plugin'\nimport type { RuntimeGenerator } from '@fluenti/vite-plugin'\n\nexport const reactRuntimeGenerator: RuntimeGenerator = createRuntimeGenerator({\n imports: '',\n catalogInit: 'const __catalog = { ...__defaultMsgs }',\n localeInit: (defaultLocale) => `let __currentLocale = '${defaultLocale}'`,\n loadingInit: 'let __loading = false',\n catalogUpdate: (msgs) => `Object.assign(__catalog, ${msgs})`,\n localeUpdate: (locale) => `__currentLocale = ${locale}`,\n loadingUpdate: (value) => `__loading = ${value}`,\n localeRead: '__currentLocale',\n runtimeKey: 'fluenti.runtime.react.v1',\n})\n","import type { Plugin } from 'vite'\nimport type { FluentiPluginOptions } from '@fluenti/vite-plugin'\nimport { createFluentiPlugins } from '@fluenti/vite-plugin'\nimport { reactRuntimeGenerator } from './react-runtime'\n\nexport type { FluentiPluginOptions as FluentiReactOptions } from '@fluenti/vite-plugin'\n\n/**\n * Fluenti React Vite plugin.\n *\n * @example Minimal — no fluenti.config.ts needed\n * ```ts\n * // vite.config.ts\n * import fluentiReact from '@fluenti/react/vite-plugin'\n *\n * export default defineConfig({\n * plugins: [fluentiReact({ config: { locales: ['en', 'ja'] } })],\n * })\n * ```\n *\n * @example With fluenti.config.ts (for advanced options)\n * ```ts\n * export default defineConfig({\n * plugins: [fluentiReact()], // auto-reads fluenti.config.ts\n * })\n * ```\n */\nexport default function fluentiReact(options?: FluentiPluginOptions): Plugin[] {\n return createFluentiPlugins(\n { ...(options?.config !== undefined ? { config: options.config } : {}), framework: 'react' },\n [],\n reactRuntimeGenerator,\n )\n}\n"],"mappings":";;AAGA,IAAa,IAA0C,EAAuB;CAC5E,SAAS;CACT,aAAa;CACb,aAAa,MAAkB,0BAA0B,EAAc;CACvE,aAAa;CACb,gBAAgB,MAAS,4BAA4B,EAAK;CAC1D,eAAe,MAAW,qBAAqB;CAC/C,gBAAgB,MAAU,eAAe;CACzC,YAAY;CACZ,YAAY;CACb,CAAC;;;ACcF,SAAwB,EAAa,GAA0C;AAC7E,QAAO,EACL;EAAE,GAAI,GAAS,WAAW,KAAA,IAAyC,EAAE,GAA/B,EAAE,QAAQ,EAAQ,QAAQ;EAAQ,WAAW;EAAS,EAC5F,EAAE,EACF,EACD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluenti/react",
3
- "version": "0.4.0-rc.1",
3
+ "version": "0.4.0-rc.2",
4
4
  "type": "module",
5
5
  "description": "React bindings for Fluenti — I18nProvider, useI18n, Trans/Plural/Select components",
6
6
  "homepage": "https://fluenti.dev",
@@ -89,8 +89,8 @@
89
89
  }
90
90
  },
91
91
  "dependencies": {
92
- "@fluenti/core": "0.4.0-rc.1",
93
- "@fluenti/vite-plugin": "0.4.0-rc.1"
92
+ "@fluenti/core": "0.4.0-rc.2",
93
+ "@fluenti/vite-plugin": "0.4.0-rc.2"
94
94
  },
95
95
  "devDependencies": {
96
96
  "typescript": "^5.9",