Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/batch-dependency-updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: install node
uses: actions/setup-node@v4
with:
node-version: 18.16.1
node-version: 24
cache: 'pnpm'

- name: update dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: install node
uses: actions/setup-node@v4
with:
node-version: 18.16.1
node-version: 24
cache: 'pnpm'

- run: pnpm install --frozen-lockfile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: install node
uses: actions/setup-node@v4
with:
node-version: 18.16.1
node-version: 24

- name: install dependencies
run: npm install --no-save
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/example-typesafe-i18n-exporter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: install node
uses: actions/setup-node@v4
with:
node-version: 18.16.1
node-version: 24

- name: install dependencies
run: npm install --no-save
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: install node
uses: actions/setup-node@v4
with:
node-version: 18.16.1
node-version: 24

- name: install dependencies
run: npm install --no-save
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/example-typesafe-i18n-formatters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: install node
uses: actions/setup-node@v4
with:
node-version: 18.16.1
node-version: 24

- name: install dependencies
run: npm install --no-save
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: install node
uses: actions/setup-node@v4
with:
node-version: 18.16.1
node-version: 24

- name: install dependencies
run: npm install --no-save
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/example-typesafe-i18n-importer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: install node
uses: actions/setup-node@v4
with:
node-version: 18.16.1
node-version: 24

- name: install dependencies
run: npm install --no-save
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: install node
uses: actions/setup-node@v4
with:
node-version: 18.16.1
node-version: 24
cache: 'pnpm'

- run: pnpm install --frozen-lockfile
Expand Down
45 changes: 28 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,34 @@
name: run tests & bump version & publish to npm
name: release-please & publish to npm

on:
push:
branches:
- 'main'

permissions:
contents: write
pull-requests: write
issues: write

jobs:
release:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
steps:
- id: release
uses: googleapis/release-please-action@v4
with:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json

publish:
needs: release-please
if: ${{ needs.release-please.outputs.release_created == 'true' }}
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'chore:') && !contains(github.event.head_commit.message, 'docs:')"
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4

Expand All @@ -19,8 +39,9 @@ jobs:
- name: install node
uses: actions/setup-node@v4
with:
node-version: 18.16.1
node-version: 24
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'

- run: pnpm install --frozen-lockfile

Expand All @@ -30,24 +51,14 @@ jobs:
- name: run tests
run: pnpm test

- name: bump version and create tag
uses: 'phips28/gh-action-bump-version@master'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
minor-wording: 'feat'
major-wording: 'major'

- name: build package
run: pnpm build

- name: create browser artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: typesafe-i18n-browser
path: dist/

- name: publish to npm
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
- name: publish to npm (OIDC)
run: npm publish --provenance
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
- name: install node
uses: actions/setup-node@v4
with:
node-version: 18.16.1
node-version: 24
cache: 'pnpm'

- run: pnpm install --frozen-lockfile

- name: run tests
run: pnpm test
run: pnpm test
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.16.1
24
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "5.26.2"
}
17 changes: 15 additions & 2 deletions packages/detectors/src/detectors/browser/navigator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,26 @@ import type { Locale } from '../../../../runtime/src/core.mjs'
import { navigatorDetector } from './navigator.mjs'

const test = suite('detector:navigator')
const originalNavigatorDescriptor = Object.getOwnPropertyDescriptor(globalThis, 'navigator')

// --------------------------------------------------------------------------------------------------------------------

const testDetector = (name: string, languages: string[] | undefined, expected: Locale[]) =>
test(`navigator ${name}`, () => {
globalThis.navigator = { languages: languages as string[] } as unknown as Navigator
assert.equal(navigatorDetector(), expected)
Object.defineProperty(globalThis, 'navigator', {
configurable: true,
value: { languages: languages as string[] } as unknown as Navigator,
})

try {
assert.equal(navigatorDetector(), expected)
} finally {
if (originalNavigatorDescriptor) {
Object.defineProperty(globalThis, 'navigator', originalNavigatorDescriptor)
} else {
delete (globalThis as { navigator?: Navigator }).navigator
}
}
})

testDetector('undefined', undefined, [])
Expand Down
2 changes: 1 addition & 1 deletion packages/version.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// this file gets auto-generated
export const version = '5.25.1'
export const version = '5.26.2'
59 changes: 59 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"packages": {
".": {
"release-type": "node",
"package-name": "typesafe-i18n",
"changelog-path": "CHANGELOG.md",
"include-component-in-tag": false,
"include-v-in-tag": false,
"changelog-sections": [
{
"type": "feat",
"section": "Features",
"hidden": false
},
{
"type": "fix",
"section": "Bug Fixes",
"hidden": false
},
{
"type": "perf",
"section": "Performance Improvements",
"hidden": false
},
{
"type": "refactor",
"section": "Refactoring",
"hidden": false
},
{
"type": "docs",
"section": "Documentation",
"hidden": false
},
{
"type": "ci",
"section": "Continuous Integration",
"hidden": true
},
{
"type": "build",
"section": "Build System",
"hidden": true
},
{
"type": "test",
"section": "Tests",
"hidden": true
},
{
"type": "chore",
"section": "Miscellaneous",
"hidden": true
}
]
}
}
}
2 changes: 1 addition & 1 deletion website/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16.14.2
24
Loading