Skip to content

Commit 1b46fff

Browse files
authored
Merge pull request #14 from k0d13/5
2 parents 80c1731 + 803a171 commit 1b46fff

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+2307
-2097
lines changed

.changeset/breezy-cows-wish.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"enhanced-ms": major
3+
---
4+
5+
Return null from ms(string) if no duration strings are found within input
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
"enhanced-ms": major
3+
---
4+
5+
Locales are now tree-shakeable, reducing bundle size for consumers
6+
who only need a single locale. Import your locale directly instead of
7+
passing a string.
8+
9+
```diff
10+
- ms({ language: 'de' })
11+
+ import de from 'enhanced-ms/locales/de';
12+
+ const ms = createMs({ language: de })
13+
+ ms()
14+
```
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"enhanced-ms": patch
3+
---
4+
5+
Parse throughput improved by ~25% and GC pressure reduced at runtime.
6+
Language definitions are no longer mutated on compile, and memory usage
7+
per unit dropped from N allocations to one.

.changeset/perf-format-pipeline.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"enhanced-ms": minor
3+
---
4+
5+
Format throughput improved by up to 5x. The internal pipeline was reduced
6+
from four passes to one, with option presets cached at module load so
7+
common calls make zero allocations.

.github/actions/node/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ name: Setup Node.js
22
description: Setup Node.js, PNPM, and install dependencies
33

44
runs:
5-
using: "composite"
5+
using: 'composite'
66
steps:
77
- uses: pnpm/action-setup@v4
88

99
- name: Setup Node.js environment
1010
uses: actions/setup-node@v4
1111
with:
1212
node-version: 24
13-
registry-url: "https://registry.npmjs.org"
13+
registry-url: 'https://registry.npmjs.org'
1414
cache: pnpm
1515

1616
- name: Install dependencies

.github/pr-labels.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
"dependencies":
1+
'dependencies':
22
- changed-files:
3-
- any-glob-to-any-file: ["pnpm-lock.yaml"]
3+
- any-glob-to-any-file: ['pnpm-lock.yaml']
44

5-
"languages":
5+
'languages':
66
- changed-files:
77
- any-glob-to-any-file:
8-
- "src/languages/*"
9-
- "src/languages/**/*"
8+
- 'src/locales/*.ts'

.github/workflows/label-sync.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
push:
66
branches: [main]
7-
paths: [".github/labels.yml"]
7+
paths: [.github/labels.yml]
88

99
jobs:
1010
sync:

.github/workflows/pipeline.yml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,12 @@ on:
44
push:
55
branches: [main]
66
paths:
7-
[
8-
"package.json",
9-
"pnpm-lock.yaml",
10-
"src/**",
11-
"tests/**",
12-
".github/workflows/pipeline.yml",
13-
]
7+
['package.json', 'pnpm-lock.yaml', 'src/**', 'tests/**', '.github/workflows/pipeline.yml']
148
pull_request:
159
branches: [main]
1610
types: [opened, synchronize, reopened]
1711
paths:
18-
[
19-
"package.json",
20-
"pnpm-lock.yaml",
21-
"src/**",
22-
"tests/**",
23-
".github/workflows/pipeline.yml",
24-
]
12+
['package.json', 'pnpm-lock.yaml', 'src/**', 'tests/**', '.github/workflows/pipeline.yml']
2513
workflow_dispatch:
2614

2715
concurrency:
@@ -137,8 +125,8 @@ jobs:
137125
with:
138126
version: pnpm run release:version
139127
publish: pnpm run release:publish
140-
title: "Pending Releases"
141-
commit: "Update changelog and release"
128+
title: 'Pending Releases'
129+
commit: 'Update changelog and release'
142130

143131
- run: |
144132
echo "published=${{ steps.changesets.outputs.published }}" >> $GITHUB_OUTPUT
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
name: Pull Request Triage
22

33
on:
4-
pull_request:
5-
types: [opened, synchronize, reopened]
4+
- pull_request_target
65

76
jobs:
87
label:
98
name: Label Pull Request
10-
if: github.event.action != 'edited'
11-
runs-on: ubuntu-latest
129
permissions:
1310
contents: read
1411
pull-requests: write
12+
runs-on: ubuntu-latest
1513

1614
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
1718
- name: Apply pull request labels
1819
uses: actions/labeler@v5
1920
with:
20-
repo-token: ${{ secrets.GITHUB_TOKEN }}
2121
configuration-path: .github/pr-labels.yml
22-
sync-labels: true

.gitignore

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# Node
2-
node_modules/
3-
4-
# Build
5-
dist/
1+
.ignore
2+
bench
3+
dist
4+
node_modules

0 commit comments

Comments
 (0)