Skip to content

Commit

Permalink
refactor(publish): Remove luxon dependency (#93)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
nicolasperez19 and lachlancollins authored May 24, 2024
1 parent fab1d85 commit 9f05be8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 23 deletions.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
"interpret": "^3.1.1",
"jsonfile": "^6.1.0",
"liftoff": "^5.0.0",
"luxon": "^3.4.4",
"minimist": "^1.2.8",
"rollup-plugin-preserve-directives": "^0.4.0",
"semver": "^7.6.2",
Expand All @@ -90,7 +89,6 @@
"@types/interpret": "^1.1.3",
"@types/jsonfile": "^6.1.4",
"@types/liftoff": "^4.0.3",
"@types/luxon": "^3.4.2",
"@types/minimist": "^1.2.5",
"@types/node": "^18.19.8",
"@types/semver": "^7.5.8",
Expand Down
17 changes: 0 additions & 17 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions src/publish/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import currentGitBranch from 'current-git-branch'
import { parse as parseCommit } from '@commitlint/parse'
import log from 'git-log-parser'
import streamToArray from 'stream-to-array'
import { DateTime } from 'luxon'
import {
capitalize,
getSorterFn,
Expand Down Expand Up @@ -334,10 +333,13 @@ export const publish = async (options) => {
)
}

const date = new Intl.DateTimeFormat(undefined, {
dateStyle: 'short',
timeStyle: 'short',
}).format(Date.now())

const changelogMd = [
`Version ${version} - ${DateTime.now().toLocaleString(
DateTime.DATETIME_SHORT,
)}${tag ? ' (Manual Release)' : ''}`,
`Version ${version} - ${date}${tag ? ' (Manual Release)' : ''}`,
'## Changes',
changelogCommitsMd || '- None',
'## Packages',
Expand Down

0 comments on commit 9f05be8

Please sign in to comment.