diff --git a/.changeset/brave-turtles-tickle.md b/.changeset/brave-turtles-tickle.md deleted file mode 100644 index 336e02a7..00000000 --- a/.changeset/brave-turtles-tickle.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"wuchale": minor -"@wuchale/json": patch -"@wuchale/jsx": patch ---- - -Include placeholders in nested messages also indicating nesting like `0.0.1` diff --git a/.changeset/new-cycles-attack.md b/.changeset/new-cycles-attack.md deleted file mode 100644 index ef1fd8cd..00000000 --- a/.changeset/new-cycles-attack.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"wuchale": patch ---- - -Use the same fallback chains for URL translations diff --git a/.changeset/wicked-doors-wait.md b/.changeset/wicked-doors-wait.md deleted file mode 100644 index 3faf7f4b..00000000 --- a/.changeset/wicked-doors-wait.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -"wuchale": minor ---- - -⚠️ BREAKING: Built-in URL matcher - -A small purpose-built no-RegExp URL matcher is now included and the glob-like syntax it accepts is different from/simpler than that of `path-to-regexp`. - -- `*` for required segments like `/foo-*` matches `/foo-bar` -- `?` for optional segments like `/foo/?` matches `/foo` and `/foo/bar` -- `**` for nested like `/foo/**` matches `/foo`, `/foo/bar` and `/foo/1/bar` - -If you use URL patterns, you have to adjust your config accordingly: - -```diff -export default { - // ... - adapters: { - main: svelte({ - // ... - url: { - // ... - patterns: [ -- 'foo/*rest', -+ 'foo/**', - ] - }, - }), - } -} -``` diff --git a/.changeset/yummy-plums-reply.md b/.changeset/yummy-plums-reply.md deleted file mode 100644 index 37d3e8d7..00000000 --- a/.changeset/yummy-plums-reply.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -"wuchale": minor -"@wuchale/svelte": minor -"@wuchale/astro": minor -"@wuchale/jsx": minor ---- - -⚠️ BREAKING: reorganize loading config, use glob patterns and number load IDs - -- `granularLoad` is now `loading.granular` -- `bundleLoad` is now `loading.direct` -- `generateLoadID` is replaced by a glob config at `loading.group` - -Therefore if you use any of these, update your config like this: - -```diff --import { defineConfig, defaultGenerateLoadID, pofile } from "wuchale" -+import { defineConfig, pofile } from "wuchale" -import { adapter as svelte } from '@wuchale/svelte' - -export default defineConfig({ - // ... - adapters: { - main: svelte({ - // ... - bundleLoad: true, -- granularLoad: true, -- generateLoadID: filename => { -- if (filename.includes('grouped')) { -- return 'grouped' -- } -- return defaultGenerateLoadID(filename) -- }, -+ loading: { -+ granular: true, -+ direct: true, -+ group: [ -+ '**/*grouped*', -+ ] -+ } - }), - } -}) -``` diff --git a/packages/astro/CHANGELOG.md b/packages/astro/CHANGELOG.md index 4ed1c69a..22950ae7 100644 --- a/packages/astro/CHANGELOG.md +++ b/packages/astro/CHANGELOG.md @@ -1,5 +1,52 @@ # @wuchale/astro +## 0.4.0 + +### Minor Changes + +- ⚠️ BREAKING: reorganize loading config, use glob patterns and number load IDs ([#355](https://github.com/wuchalejs/wuchale/pull/355)) + + - `granularLoad` is now `loading.granular` + - `bundleLoad` is now `loading.direct` + - `generateLoadID` is replaced by a glob config at `loading.group` + + Therefore if you use any of these, update your config like this: + + ```diff + -import { defineConfig, defaultGenerateLoadID, pofile } from "wuchale" + +import { defineConfig, pofile } from "wuchale" + import { adapter as svelte } from '@wuchale/svelte' + + export default defineConfig({ + // ... + adapters: { + main: svelte({ + // ... + bundleLoad: true, + - granularLoad: true, + - generateLoadID: filename => { + - if (filename.includes('grouped')) { + - return 'grouped' + - } + - return defaultGenerateLoadID(filename) + - }, + + loading: { + + granular: true, + + direct: true, + + group: [ + + '**/*grouped*', + + ] + + } + }), + } + }) + ``` + +### Patch Changes + +- Updated dependencies [[`2005ea1`](https://github.com/wuchalejs/wuchale/commit/2005ea1968291fb4a3f72af098ff72d31baa9ab6), [`2521033`](https://github.com/wuchalejs/wuchale/commit/25210330c22b22e12a2984a9b6fa7dcba4a657d7), [`5063533`](https://github.com/wuchalejs/wuchale/commit/5063533dbe518e0ffb3b105e035253801625d19e), [`6d5e244`](https://github.com/wuchalejs/wuchale/commit/6d5e244d9d0744d600d8e15933381934688eaf42)]: + - wuchale@0.24.0 + ## 0.3.4 ### Patch Changes diff --git a/packages/astro/package.json b/packages/astro/package.json index 6ecd7291..a654a152 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -1,6 +1,6 @@ { "name": "@wuchale/astro", - "version": "0.3.4", + "version": "0.4.0", "description": "Wuchale i18n adapter for Astro files", "scripts": { "dev": "tsc --watch", @@ -52,7 +52,7 @@ "@sveltejs/acorn-typescript": "^1.0.10", "acorn": "^8.16.0", "magic-string": "^0.30.21", - "wuchale": "^0.23.4" + "wuchale": "^0.24.0" }, "devDependencies": { "@types/estree-jsx": "^1.0.5", diff --git a/packages/json/CHANGELOG.md b/packages/json/CHANGELOG.md index fcd9bd35..ff75c21c 100644 --- a/packages/json/CHANGELOG.md +++ b/packages/json/CHANGELOG.md @@ -1,5 +1,14 @@ # @wuchale/json +## 0.1.2 + +### Patch Changes + +- Include placeholders in nested messages also indicating nesting like `0.0.1` ([`2005ea1`](https://github.com/wuchalejs/wuchale/commit/2005ea1968291fb4a3f72af098ff72d31baa9ab6)) + +- Updated dependencies [[`2005ea1`](https://github.com/wuchalejs/wuchale/commit/2005ea1968291fb4a3f72af098ff72d31baa9ab6), [`2521033`](https://github.com/wuchalejs/wuchale/commit/25210330c22b22e12a2984a9b6fa7dcba4a657d7), [`5063533`](https://github.com/wuchalejs/wuchale/commit/5063533dbe518e0ffb3b105e035253801625d19e), [`6d5e244`](https://github.com/wuchalejs/wuchale/commit/6d5e244d9d0744d600d8e15933381934688eaf42)]: + - wuchale@0.24.0 + ## 0.1.1 ### Patch Changes diff --git a/packages/json/package.json b/packages/json/package.json index 9eb53975..9fc8f0aa 100644 --- a/packages/json/package.json +++ b/packages/json/package.json @@ -1,6 +1,6 @@ { "name": "@wuchale/json", - "version": "0.1.1", + "version": "0.1.2", "description": "Protobuf-like i18n from plain code: JSON storage driver", "scripts": { "dev": "tsc --watch", @@ -33,7 +33,7 @@ "author": "K1DV5", "license": "MIT", "dependencies": { - "wuchale": "^0.23.0" + "wuchale": "^0.24.0" }, "devDependencies": { "typescript": "^6.0.3", diff --git a/packages/jsx/CHANGELOG.md b/packages/jsx/CHANGELOG.md index 0aaa54f7..9a8af7d1 100644 --- a/packages/jsx/CHANGELOG.md +++ b/packages/jsx/CHANGELOG.md @@ -1,5 +1,54 @@ # @wuchale/jsx +## 0.12.0 + +### Minor Changes + +- ⚠️ BREAKING: reorganize loading config, use glob patterns and number load IDs ([#355](https://github.com/wuchalejs/wuchale/pull/355)) + + - `granularLoad` is now `loading.granular` + - `bundleLoad` is now `loading.direct` + - `generateLoadID` is replaced by a glob config at `loading.group` + + Therefore if you use any of these, update your config like this: + + ```diff + -import { defineConfig, defaultGenerateLoadID, pofile } from "wuchale" + +import { defineConfig, pofile } from "wuchale" + import { adapter as svelte } from '@wuchale/svelte' + + export default defineConfig({ + // ... + adapters: { + main: svelte({ + // ... + bundleLoad: true, + - granularLoad: true, + - generateLoadID: filename => { + - if (filename.includes('grouped')) { + - return 'grouped' + - } + - return defaultGenerateLoadID(filename) + - }, + + loading: { + + granular: true, + + direct: true, + + group: [ + + '**/*grouped*', + + ] + + } + }), + } + }) + ``` + +### Patch Changes + +- Include placeholders in nested messages also indicating nesting like `0.0.1` ([`2005ea1`](https://github.com/wuchalejs/wuchale/commit/2005ea1968291fb4a3f72af098ff72d31baa9ab6)) + +- Updated dependencies [[`2005ea1`](https://github.com/wuchalejs/wuchale/commit/2005ea1968291fb4a3f72af098ff72d31baa9ab6), [`2521033`](https://github.com/wuchalejs/wuchale/commit/25210330c22b22e12a2984a9b6fa7dcba4a657d7), [`5063533`](https://github.com/wuchalejs/wuchale/commit/5063533dbe518e0ffb3b105e035253801625d19e), [`6d5e244`](https://github.com/wuchalejs/wuchale/commit/6d5e244d9d0744d600d8e15933381934688eaf42)]: + - wuchale@0.24.0 + ## 0.11.3 ### Patch Changes diff --git a/packages/jsx/package.json b/packages/jsx/package.json index eac0e1ce..979971b5 100644 --- a/packages/jsx/package.json +++ b/packages/jsx/package.json @@ -1,6 +1,6 @@ { "name": "@wuchale/jsx", - "version": "0.11.3", + "version": "0.12.0", "description": "Protobuf-like i18n from plain code: JSX adapter", "scripts": { "dev": "tsc --watch", @@ -61,7 +61,7 @@ "@sveltejs/acorn-typescript": "^1.0.10", "acorn": "^8.16.0", "magic-string": "^0.30.21", - "wuchale": "^0.23.0" + "wuchale": "^0.24.0" }, "devDependencies": { "@types/estree-jsx": "^1.0.5", diff --git a/packages/svelte/CHANGELOG.md b/packages/svelte/CHANGELOG.md index 7529ab6a..df029e5e 100644 --- a/packages/svelte/CHANGELOG.md +++ b/packages/svelte/CHANGELOG.md @@ -1,5 +1,52 @@ # @wuchale/svelte +## 0.20.0 + +### Minor Changes + +- ⚠️ BREAKING: reorganize loading config, use glob patterns and number load IDs ([#355](https://github.com/wuchalejs/wuchale/pull/355)) + + - `granularLoad` is now `loading.granular` + - `bundleLoad` is now `loading.direct` + - `generateLoadID` is replaced by a glob config at `loading.group` + + Therefore if you use any of these, update your config like this: + + ```diff + -import { defineConfig, defaultGenerateLoadID, pofile } from "wuchale" + +import { defineConfig, pofile } from "wuchale" + import { adapter as svelte } from '@wuchale/svelte' + + export default defineConfig({ + // ... + adapters: { + main: svelte({ + // ... + bundleLoad: true, + - granularLoad: true, + - generateLoadID: filename => { + - if (filename.includes('grouped')) { + - return 'grouped' + - } + - return defaultGenerateLoadID(filename) + - }, + + loading: { + + granular: true, + + direct: true, + + group: [ + + '**/*grouped*', + + ] + + } + }), + } + }) + ``` + +### Patch Changes + +- Updated dependencies [[`2005ea1`](https://github.com/wuchalejs/wuchale/commit/2005ea1968291fb4a3f72af098ff72d31baa9ab6), [`2521033`](https://github.com/wuchalejs/wuchale/commit/25210330c22b22e12a2984a9b6fa7dcba4a657d7), [`5063533`](https://github.com/wuchalejs/wuchale/commit/5063533dbe518e0ffb3b105e035253801625d19e), [`6d5e244`](https://github.com/wuchalejs/wuchale/commit/6d5e244d9d0744d600d8e15933381934688eaf42)]: + - wuchale@0.24.0 + ## 0.19.4 ### Patch Changes diff --git a/packages/svelte/package.json b/packages/svelte/package.json index c363455e..aac5eb5e 100644 --- a/packages/svelte/package.json +++ b/packages/svelte/package.json @@ -1,6 +1,6 @@ { "name": "@wuchale/svelte", - "version": "0.19.4", + "version": "0.20.0", "description": "Protobuf-like i18n from plain code: Svelte adapter", "scripts": { "dev": "tsc --watch", @@ -53,7 +53,7 @@ "dependencies": { "magic-string": "^0.30.21", "svelte": "^5", - "wuchale": "^0.23.0" + "wuchale": "^0.24.0" }, "devDependencies": { "@types/node": "~24.12.4", diff --git a/packages/wuchale/CHANGELOG.md b/packages/wuchale/CHANGELOG.md index 46c19466..f689b99a 100644 --- a/packages/wuchale/CHANGELOG.md +++ b/packages/wuchale/CHANGELOG.md @@ -1,5 +1,81 @@ # wuchale +## 0.24.0 + +### Minor Changes + +- Include placeholders in nested messages also indicating nesting like `0.0.1` ([`2005ea1`](https://github.com/wuchalejs/wuchale/commit/2005ea1968291fb4a3f72af098ff72d31baa9ab6)) + +- ⚠️ BREAKING: Built-in URL matcher ([#363](https://github.com/wuchalejs/wuchale/pull/363)) + + A small purpose-built no-RegExp URL matcher is now included and the glob-like syntax it accepts is different from/simpler than that of `path-to-regexp`. + + - `*` for required segments like `/foo-*` matches `/foo-bar` + - `?` for optional segments like `/foo/?` matches `/foo` and `/foo/bar` + - `**` for nested like `/foo/**` matches `/foo`, `/foo/bar` and `/foo/1/bar` + + If you use URL patterns, you have to adjust your config accordingly: + + ```diff + export default { + // ... + adapters: { + main: svelte({ + // ... + url: { + // ... + patterns: [ + - 'foo/*rest', + + 'foo/**', + ] + }, + }), + } + } + ``` + +- ⚠️ BREAKING: reorganize loading config, use glob patterns and number load IDs ([#355](https://github.com/wuchalejs/wuchale/pull/355)) + + - `granularLoad` is now `loading.granular` + - `bundleLoad` is now `loading.direct` + - `generateLoadID` is replaced by a glob config at `loading.group` + + Therefore if you use any of these, update your config like this: + + ```diff + -import { defineConfig, defaultGenerateLoadID, pofile } from "wuchale" + +import { defineConfig, pofile } from "wuchale" + import { adapter as svelte } from '@wuchale/svelte' + + export default defineConfig({ + // ... + adapters: { + main: svelte({ + // ... + bundleLoad: true, + - granularLoad: true, + - generateLoadID: filename => { + - if (filename.includes('grouped')) { + - return 'grouped' + - } + - return defaultGenerateLoadID(filename) + - }, + + loading: { + + granular: true, + + direct: true, + + group: [ + + '**/*grouped*', + + ] + + } + }), + } + }) + ``` + +### Patch Changes + +- Use the same fallback chains for URL translations ([`2521033`](https://github.com/wuchalejs/wuchale/commit/25210330c22b22e12a2984a9b6fa7dcba4a657d7)) + ## 0.23.4 ### Patch Changes diff --git a/packages/wuchale/package.json b/packages/wuchale/package.json index 6665c581..2f7997d6 100644 --- a/packages/wuchale/package.json +++ b/packages/wuchale/package.json @@ -1,6 +1,6 @@ { "name": "wuchale", - "version": "0.23.4", + "version": "0.24.0", "description": "Protobuf-like i18n from plain code", "scripts": { "dev": "tsc --watch",