Skip to content

Commit

Permalink
chore: move changelog config to config directory
Browse files Browse the repository at this point in the history
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
  • Loading branch information
unicornware committed Feb 18, 2023
1 parent a9a5758 commit 0cc494c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions changelog.config.ts → config/changelog.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @file Changelog Configuration
* @file Configuration - Changelog
* @module config/changelog
* @see https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-conventionalcommits
* @see https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-core
Expand Down Expand Up @@ -31,7 +31,7 @@ import type { Readable } from 'node:stream'
import sade from 'sade'
import semver from 'semver'
import tempfile from 'tempfile'
import pkg from './package.json' assert { type: 'json' }
import pkg from '../package.json' assert { type: 'json' }

/**
* CLI flags.
Expand Down Expand Up @@ -317,7 +317,8 @@ sade('changelog', true)

// set release date
context.date =
key?.committerDate ?? dateformat(new Date(), 'yyyy-mm-dd', true)
key?.committerDate ??
dateformat(new Date().toLocaleDateString(), 'yyyy-mm-dd', true)

// determine patch release state
if (version && semver.valid(version)) {
Expand All @@ -333,7 +334,10 @@ sade('changelog', true)
repoUrl: pkg.repository.slice(0, -4)
}
},
headerPartial: readFileSync('templates/changelog/header.hbs', 'utf8'),
headerPartial: readFileSync(
'config/templates/changelog/header.hbs',
'utf8'
),
ignoreReverted: false
}
).on('error', err => console.error(err.stack))
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"types": "./dist/index.d.mts",
"scripts": {
"build": "mkbuild",
"changelog": "node --loader=./loader.mjs ./changelog.config",
"changelog": "node --loader=./loader.mjs ./config/changelog.config",
"check:ci": "yarn dedupe --check && yarn check:format && yarn check:lint && yarn check:spelling && yarn typecheck && yarn test:cov && NODE_ENV=production yarn pack -o %s-%v.tgz && yarn clean:pack && yarn check:types:build",
"check:format": "prettier --check .",
"check:lint": "eslint --exit-on-fatal-error --ext cjs,gql,json,jsonc,md,mjs,mts,ts,yml --max-warnings 0 .",
Expand Down

0 comments on commit 0cc494c

Please sign in to comment.