Skip to content

Commit 9f05be8

Browse files
refactor(publish): Remove luxon dependency (#93)
* refactor(src/publish): Dropped `luxon` dependency for native date-time formatting within changelog markdown * Refactor, remove @types/luxon --------- Co-authored-by: Lachlan Collins <[email protected]>
1 parent fab1d85 commit 9f05be8

File tree

3 files changed

+6
-23
lines changed

3 files changed

+6
-23
lines changed

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
"interpret": "^3.1.1",
7373
"jsonfile": "^6.1.0",
7474
"liftoff": "^5.0.0",
75-
"luxon": "^3.4.4",
7675
"minimist": "^1.2.8",
7776
"rollup-plugin-preserve-directives": "^0.4.0",
7877
"semver": "^7.6.2",
@@ -90,7 +89,6 @@
9089
"@types/interpret": "^1.1.3",
9190
"@types/jsonfile": "^6.1.4",
9291
"@types/liftoff": "^4.0.3",
93-
"@types/luxon": "^3.4.2",
9492
"@types/minimist": "^1.2.5",
9593
"@types/node": "^18.19.8",
9694
"@types/semver": "^7.5.8",

pnpm-lock.yaml

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

src/publish/index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import currentGitBranch from 'current-git-branch'
1010
import { parse as parseCommit } from '@commitlint/parse'
1111
import log from 'git-log-parser'
1212
import streamToArray from 'stream-to-array'
13-
import { DateTime } from 'luxon'
1413
import {
1514
capitalize,
1615
getSorterFn,
@@ -334,10 +333,13 @@ export const publish = async (options) => {
334333
)
335334
}
336335

336+
const date = new Intl.DateTimeFormat(undefined, {
337+
dateStyle: 'short',
338+
timeStyle: 'short',
339+
}).format(Date.now())
340+
337341
const changelogMd = [
338-
`Version ${version} - ${DateTime.now().toLocaleString(
339-
DateTime.DATETIME_SHORT,
340-
)}${tag ? ' (Manual Release)' : ''}`,
342+
`Version ${version} - ${date}${tag ? ' (Manual Release)' : ''}`,
341343
'## Changes',
342344
changelogCommitsMd || '- None',
343345
'## Packages',

0 commit comments

Comments
 (0)