Skip to content

Commit 3adb913

Browse files
authored
Merge pull request #929 from nextcloud-libraries/chore/prepare-v3-3
chore: prepare v3.3.0
2 parents 7b64d6e + 8b40f8a commit 3adb913

File tree

5 files changed

+67
-4
lines changed

5 files changed

+67
-4
lines changed

CHANGELOG.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,27 @@
66

77
All notable changes to this project will be documented in this file.
88

9-
## UNRELEASED
9+
## 3.3.0 - 2025-05-29
1010
### ℹ️ Notes
1111
- The Node version was increased to current LTS version 22.
1212
- The `callback` parameter of the `loadTranslations` method is deprecated.
1313
Instead just use the returned promise like `loadTranslations('app').then(callback)`.
1414

15+
### 🚀 Enhancements
16+
* feat: add method to format relative time [#921](https://github.com/nextcloud-libraries/nextcloud-l10n/pull/921) ([susnux](https://github.com/susnux))
17+
18+
### 🐛 Fixed bugs
19+
* fix: export types used in gettext exports [#905](https://github.com/nextcloud-libraries/nextcloud-l10n/pull/905) ([susnux](https://github.com/susnux))
20+
* fix(translations): use language instead of locale + refactor the `loadTranslations` method [#927](https://github.com/nextcloud-libraries/nextcloud-l10n/pull/927) ([susnux](https://github.com/susnux))
21+
* fix(locale): fallback to device preferences instead of 'en' [#864](https://github.com/nextcloud-libraries/nextcloud-l10n/pull/864) ([ShGKme](https://github.com/ShGKme))
22+
23+
### Other changes
24+
* refactor: simplify `loadTranslations` [#928](https://github.com/nextcloud-libraries/nextcloud-l10n/pull/928) ([susnux](https://github.com/susnux))
25+
* chore(deps): drop unnecessary @types/dompurify [#903](https://github.com/nextcloud-libraries/nextcloud-l10n/pull/903) ([max-nextcloud](https://github.com/max-nextcloud))
26+
* docs(readme): update badges [#904](https://github.com/nextcloud-libraries/nextcloud-l10n/pull/904) ([st3iny](https://github.com/st3iny))
27+
* chore(deps): Bump dompurify to 3.2.6
28+
* Bump development dependencies
29+
1530
## 3.2.0 - 2025-02-13
1631
### ℹ️ Notes
1732
The `GettextBuilder.detectLocale` method is deprecated and will be removed in the next major version.

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,26 @@ gt.ngettext('%n Mississippi', '%n Mississippi', 3)
142142
// or if you are using the aliases mentioned above:
143143
n('%n Mississippi', '%n Mississippi', 3)
144144
```
145+
146+
## Development
147+
### 📤 Releasing a new version
148+
149+
- Pull the latest changes from `main` or `stableX`
150+
- Checkout a new branch with the tag name (e.g `v4.0.1`): `git checkout -b v<version>`
151+
- Run `npm version patch --no-git-tag-version` (`npm version minor --no-git-tag-version` if minor).
152+
This will return a new version name, make sure it matches what you expect
153+
- Generate the changelog content from the [release](https://github.com/nextcloud-libraries/nextcloud-l10n/releases) page.
154+
Create a draft release, select the previous tag, click `generate` then paste the content to the `CHANGELOG.md` file
155+
1. adjust the links to the merged pull requests and authors so that the changelog also works outside of GitHub
156+
by running `npm run prerelease:format-changelog`.
157+
This will apply this regex: `by @([^ ]+) in ((https://github.com/)nextcloud-libraries/nextcloud-l10n/pull/(\d+))`
158+
Which this as the replacement: `[\#$4]($2) \([$1]($3$1)\)`
159+
2. use the the version as tag AND title (e.g `v4.0.1`)
160+
3. add the changelog content as description (https://github.com/nextcloud-libraries/nextcloud-l10n/releases)
161+
- Commit, push and create PR
162+
- Get your PR reviewed and merged
163+
- Create a milestone with the follow-up version at https://github.com/nextcloud-libraries/nextcloud-l10n/milestones
164+
- Move all open tickets and PRs to the follow-up
165+
- Close the milestone of the version you release
166+
- Publish the previously drafted release on GitHub
167+
![image](https://user-images.githubusercontent.com/14975046/124442568-2a952500-dd7d-11eb-82a2-402f9170231a.png)

build/format-changelog.mjs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* SPDX-FileCopyrightText: Nextcloud GmbH and Nextcloud contributors
3+
* SPDX-License-Identifier: GPL-3.0-or-later
4+
*/
5+
import { readFile, writeFile } from 'node:fs/promises'
6+
import { join } from 'node:path'
7+
8+
console.info('🔎 checking format of CHANGELOG.md')
9+
10+
const file = join(import.meta.dirname, '..', 'CHANGELOG.md')
11+
const content = await readFile(file, { encoding: 'utf-8' })
12+
13+
const formatted = content.replaceAll(
14+
/by @([^ ]+) in ((https:\/\/github.com\/)nextcloud-libraries\/nextcloud-l10n\/pull\/(\d+))/g,
15+
'[\\#$4]($2) \\([$1]($3$1)\\)',
16+
)
17+
18+
if (formatted !== content) {
19+
console.info('✏️ fixing format')
20+
await writeFile(file, formatted)
21+
console.info('🎉 done')
22+
} else {
23+
console.info('✅ no formatting needed - done.')
24+
}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nextcloud/l10n",
3-
"version": "3.2.0",
3+
"version": "3.3.0",
44
"description": "Nextcloud localization and translation helpers for apps and libraries",
55
"keywords": [
66
"nextcloud",
@@ -41,6 +41,7 @@
4141
"dev": "vite --mode development build --watch",
4242
"lint": "eslint .",
4343
"lint:fix": "eslint --fix lib tests",
44+
"prerelease:format-changelog": "node build/format-changelog.mjs",
4445
"test": "LANG=en-US vitest run",
4546
"test:coverage": "LANG=en-US vitest run --coverage",
4647
"test:watch": "LANG=en-US vitest watch"

0 commit comments

Comments
 (0)