diff --git a/.changeset/fuzzy-states-rescue.md b/.changeset/fuzzy-states-rescue.md deleted file mode 100644 index 414e0e63..00000000 --- a/.changeset/fuzzy-states-rescue.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"wuchale": minor ---- - -More reliable HMR implementation that doesn't get confused with secondary instances (like the CLI) diff --git a/.changeset/strong-chefs-raise.md b/.changeset/strong-chefs-raise.md deleted file mode 100644 index 168b24a2..00000000 --- a/.changeset/strong-chefs-raise.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -"wuchale": minor -"@wuchale/svelte": minor -"@wuchale/astro": minor -"@wuchale/jsx": minor ---- - -!Replace single details object with an array of scope objects and separate filename for heuristic - -The heuristic function now gets called with two arguments: the extracted `Text` object, and the filename as a `string` argument. The `Text` object now has: - -- `.body: string[]` instead of `Message.msgStr` -- `.path: Scope[]` instead of `Message.details` - this is an array of different small `Scope` objects that better conveys nesting information. -- The rest of the properties are the same as `Message` - -Therefore if you implement a custom heuristic function you should for example: - -```diff --heuristic: (msg) => { -+heuristic: (text, file) => { -- if (msg.details.element || msg.details.file.endsWith('.foo')) { -+ if (text.path.some(s => s.type === 'element') || file.endsWith('.foo')) { - return false - } - } -``` - -The scope array is now used to ignore whole sub-trees of ignored elements even if they contain non-ignored elements. diff --git a/packages/astro/CHANGELOG.md b/packages/astro/CHANGELOG.md index ccf6c25f..d8537a47 100644 --- a/packages/astro/CHANGELOG.md +++ b/packages/astro/CHANGELOG.md @@ -1,5 +1,36 @@ # @wuchale/astro +## 0.5.0 + +### Minor Changes + +- [15d677e](https://github.com/wuchalejs/wuchale/commit/15d677e8286dba588a2123389375673e3ea83675): ⚠️ BREAKING: Replace single details object with an array of scope objects and separate filename for heuristic + + The heuristic function now gets called with two arguments: the extracted `Text` object, and the filename as a `string` argument. The `Text` object now has: + + - `.body: string[]` instead of `Message.msgStr` + - `.path: Scope[]` instead of `Message.details` - this is an array of different small `Scope` objects that better conveys nesting information. + - The rest of the properties are the same as `Message` + + Therefore if you implement a custom heuristic function you should for example: + + ```diff + -heuristic: (msg) => { + +heuristic: (text, file) => { + - if (msg.details.element || msg.details.file.endsWith('.foo')) { + + if (text.path.some(s => s.type === 'element') || file.endsWith('.foo')) { + return false + } + } + ``` + + The scope array is now used to ignore whole sub-trees of ignored elements even if they contain non-ignored elements. + +### Patch Changes + +- Updated dependencies [cd53445, 15d677e]: + - wuchale@0.26.0 + ## 0.4.4 ### Patch Changes diff --git a/packages/astro/package.json b/packages/astro/package.json index ff3f7487..df80639a 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -1,6 +1,6 @@ { "name": "@wuchale/astro", - "version": "0.4.4", + "version": "0.5.0", "description": "Wuchale i18n adapter for Astro files", "scripts": { "dev": "tsc --watch", @@ -51,7 +51,7 @@ "@astrojs/compiler": "^4", "@sveltejs/acorn-typescript": "^1.0.11", "acorn": "^8.17.0", - "wuchale": "^0.25.6" + "wuchale": "^0.26.0" }, "devDependencies": { "@types/node": "~24.13.3", diff --git a/packages/json/CHANGELOG.md b/packages/json/CHANGELOG.md index e18411d5..3880bd41 100644 --- a/packages/json/CHANGELOG.md +++ b/packages/json/CHANGELOG.md @@ -1,5 +1,12 @@ # @wuchale/json +## 0.2.2 + +### Patch Changes + +- Updated dependencies [cd53445, 15d677e]: + - wuchale@0.26.0 + ## 0.2.1 ### Patch Changes diff --git a/packages/json/package.json b/packages/json/package.json index cd9f7b5f..236dd4fc 100644 --- a/packages/json/package.json +++ b/packages/json/package.json @@ -1,6 +1,6 @@ { "name": "@wuchale/json", - "version": "0.2.1", + "version": "0.2.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.25.0" + "wuchale": "^0.26.0" }, "devDependencies": { "typescript": "^6.0.3", diff --git a/packages/jsx/CHANGELOG.md b/packages/jsx/CHANGELOG.md index b4a97822..fc41d680 100644 --- a/packages/jsx/CHANGELOG.md +++ b/packages/jsx/CHANGELOG.md @@ -1,5 +1,36 @@ # @wuchale/jsx +## 0.13.0 + +### Minor Changes + +- [15d677e](https://github.com/wuchalejs/wuchale/commit/15d677e8286dba588a2123389375673e3ea83675): ⚠️ BREAKING: Replace single details object with an array of scope objects and separate filename for heuristic + + The heuristic function now gets called with two arguments: the extracted `Text` object, and the filename as a `string` argument. The `Text` object now has: + + - `.body: string[]` instead of `Message.msgStr` + - `.path: Scope[]` instead of `Message.details` - this is an array of different small `Scope` objects that better conveys nesting information. + - The rest of the properties are the same as `Message` + + Therefore if you implement a custom heuristic function you should for example: + + ```diff + -heuristic: (msg) => { + +heuristic: (text, file) => { + - if (msg.details.element || msg.details.file.endsWith('.foo')) { + + if (text.path.some(s => s.type === 'element') || file.endsWith('.foo')) { + return false + } + } + ``` + + The scope array is now used to ignore whole sub-trees of ignored elements even if they contain non-ignored elements. + +### Patch Changes + +- Updated dependencies [cd53445, 15d677e]: + - wuchale@0.26.0 + ## 0.12.5 ### Patch Changes diff --git a/packages/jsx/package.json b/packages/jsx/package.json index 360f9c6f..bdd3cf73 100644 --- a/packages/jsx/package.json +++ b/packages/jsx/package.json @@ -1,6 +1,6 @@ { "name": "@wuchale/jsx", - "version": "0.12.5", + "version": "0.13.0", "description": "Protobuf-like i18n from plain code: JSX adapter", "scripts": { "dev": "tsc --watch", @@ -72,7 +72,7 @@ "dependencies": { "@sveltejs/acorn-typescript": "^1.0.11", "acorn": "^8.17.0", - "wuchale": "^0.25.6" + "wuchale": "^0.26.0" }, "devDependencies": { "@types/estree-jsx": "^1.0.5", diff --git a/packages/svelte/CHANGELOG.md b/packages/svelte/CHANGELOG.md index 330d98b1..659aea82 100644 --- a/packages/svelte/CHANGELOG.md +++ b/packages/svelte/CHANGELOG.md @@ -1,5 +1,36 @@ # @wuchale/svelte +## 0.21.0 + +### Minor Changes + +- [15d677e](https://github.com/wuchalejs/wuchale/commit/15d677e8286dba588a2123389375673e3ea83675): ⚠️ BREAKING: Replace single details object with an array of scope objects and separate filename for heuristic + + The heuristic function now gets called with two arguments: the extracted `Text` object, and the filename as a `string` argument. The `Text` object now has: + + - `.body: string[]` instead of `Message.msgStr` + - `.path: Scope[]` instead of `Message.details` - this is an array of different small `Scope` objects that better conveys nesting information. + - The rest of the properties are the same as `Message` + + Therefore if you implement a custom heuristic function you should for example: + + ```diff + -heuristic: (msg) => { + +heuristic: (text, file) => { + - if (msg.details.element || msg.details.file.endsWith('.foo')) { + + if (text.path.some(s => s.type === 'element') || file.endsWith('.foo')) { + return false + } + } + ``` + + The scope array is now used to ignore whole sub-trees of ignored elements even if they contain non-ignored elements. + +### Patch Changes + +- Updated dependencies [cd53445, 15d677e]: + - wuchale@0.26.0 + ## 0.20.5 ### Patch Changes diff --git a/packages/svelte/package.json b/packages/svelte/package.json index f69b4480..6030318a 100644 --- a/packages/svelte/package.json +++ b/packages/svelte/package.json @@ -1,6 +1,6 @@ { "name": "@wuchale/svelte", - "version": "0.20.5", + "version": "0.21.0", "description": "Protobuf-like i18n from plain code: Svelte adapter", "scripts": { "dev": "tsc --watch", @@ -57,7 +57,7 @@ "svelte": "^5" }, "dependencies": { - "wuchale": "^0.25.6" + "wuchale": "^0.26.0" }, "devDependencies": { "@types/node": "~24.13.3", diff --git a/packages/wuchale/CHANGELOG.md b/packages/wuchale/CHANGELOG.md index 9f13e8dd..7db725bd 100644 --- a/packages/wuchale/CHANGELOG.md +++ b/packages/wuchale/CHANGELOG.md @@ -1,5 +1,32 @@ # wuchale +## 0.26.0 + +### Minor Changes + +- [cd53445](https://github.com/wuchalejs/wuchale/commit/cd53445e64344206fdd8aff1c50e72eab5d8d9b2): More reliable HMR implementation that doesn't get confused with secondary instances (like the CLI) +- [15d677e](https://github.com/wuchalejs/wuchale/commit/15d677e8286dba588a2123389375673e3ea83675): ⚠️ BREAKING: Replace single details object with an array of scope objects and separate filename for heuristic + + The heuristic function now gets called with two arguments: the extracted `Text` object, and the filename as a `string` argument. The `Text` object now has: + + - `.body: string[]` instead of `Message.msgStr` + - `.path: Scope[]` instead of `Message.details` - this is an array of different small `Scope` objects that better conveys nesting information. + - The rest of the properties are the same as `Message` + + Therefore if you implement a custom heuristic function you should for example: + + ```diff + -heuristic: (msg) => { + +heuristic: (text, file) => { + - if (msg.details.element || msg.details.file.endsWith('.foo')) { + + if (text.path.some(s => s.type === 'element') || file.endsWith('.foo')) { + return false + } + } + ``` + + The scope array is now used to ignore whole sub-trees of ignored elements even if they contain non-ignored elements. + ## 0.25.6 ### Patch Changes diff --git a/packages/wuchale/package.json b/packages/wuchale/package.json index 3e9dbf5b..d70b12b8 100644 --- a/packages/wuchale/package.json +++ b/packages/wuchale/package.json @@ -1,6 +1,6 @@ { "name": "wuchale", - "version": "0.25.6", + "version": "0.26.0", "description": "Protobuf-like i18n from plain code", "scripts": { "dev": "tsc --watch",