standard-changelog 5.0.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/{cli.mjs → cli.js} +18 -1
- package/figures.js +1 -3
- package/index.js +8 -12
- package/package.json +18 -14
package/README.md
CHANGED
package/{cli.mjs → cli.js}
RENAMED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { resolve, extname } from 'path'
|
|
3
|
+
import { pathToFileURL } from 'url'
|
|
2
4
|
import { createWriteStream } from 'fs'
|
|
3
5
|
import {
|
|
4
6
|
readFile,
|
|
@@ -11,6 +13,21 @@ import standardChangelog, {
|
|
|
11
13
|
checkpoint
|
|
12
14
|
} from './index.js'
|
|
13
15
|
|
|
16
|
+
function relativeResolve (filePath) {
|
|
17
|
+
return pathToFileURL(resolve(process.cwd(), filePath))
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async function loadDataFile (filePath) {
|
|
21
|
+
const resolvedFilePath = relativeResolve(filePath)
|
|
22
|
+
const ext = extname(resolvedFilePath.toString())
|
|
23
|
+
|
|
24
|
+
if (ext === '.json') {
|
|
25
|
+
return JSON.parse(await readFile(resolvedFilePath, 'utf8'))
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return (await import(resolvedFilePath)).default
|
|
29
|
+
}
|
|
30
|
+
|
|
14
31
|
function printError (err) {
|
|
15
32
|
if (flags.verbose) {
|
|
16
33
|
console.error(pc.gray(err.stack))
|
|
@@ -126,7 +143,7 @@ let templateContext
|
|
|
126
143
|
|
|
127
144
|
try {
|
|
128
145
|
if (flags.context) {
|
|
129
|
-
templateContext =
|
|
146
|
+
templateContext = await loadDataFile(flags.context)
|
|
130
147
|
}
|
|
131
148
|
} catch (err) {
|
|
132
149
|
printError(err)
|
package/figures.js
CHANGED
package/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import fs from 'fs/promises'
|
|
2
|
+
import pc from 'picocolors'
|
|
3
|
+
import conventionalChangelogCore from 'conventional-changelog-core'
|
|
4
|
+
import angular from 'conventional-changelog-angular'
|
|
5
|
+
import { tick } from './figures.js'
|
|
6
6
|
|
|
7
|
-
function conventionalChangelog (options, context, gitRawCommitsOpts, parserOpts, writerOpts) {
|
|
7
|
+
export default function conventionalChangelog (options, context, gitRawCommitsOpts, parserOpts, writerOpts) {
|
|
8
8
|
options = options || {}
|
|
9
9
|
options.config = angular
|
|
10
10
|
|
|
11
11
|
return conventionalChangelogCore(options, context, gitRawCommitsOpts, parserOpts, writerOpts)
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
async function createIfMissing (infile) {
|
|
14
|
+
export async function createIfMissing (infile) {
|
|
15
15
|
try {
|
|
16
16
|
await fs.access(infile, fs.F_OK)
|
|
17
17
|
} catch (err) {
|
|
@@ -22,10 +22,6 @@ async function createIfMissing (infile) {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
function checkpoint (msg, args) {
|
|
25
|
+
export function checkpoint (msg, args) {
|
|
26
26
|
console.info(`${pc.green(tick)} ${msg}`, ...args.map(arg => pc.bold(arg)))
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
module.exports = conventionalChangelog
|
|
30
|
-
module.exports.createIfMissing = createIfMissing
|
|
31
|
-
module.exports.checkpoint = checkpoint
|
package/package.json
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "standard-changelog",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "6.0.0",
|
|
5
|
+
"description": "Generate a changelog from git metadata with Angular commit convention.",
|
|
6
|
+
"author": "Steve Mao",
|
|
7
|
+
"license": "MIT",
|
|
8
8
|
"homepage": "https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/standard-changelog#readme",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "https://github.com/conventional-changelog/conventional-changelog.git"
|
|
11
|
+
"url": "https://github.com/conventional-changelog/conventional-changelog.git",
|
|
12
|
+
"directory": "packages/standard-changelog"
|
|
13
|
+
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/conventional-changelog/conventional-changelog/issues"
|
|
12
16
|
},
|
|
13
17
|
"keywords": [
|
|
14
18
|
"conventional-changelog",
|
|
@@ -17,20 +21,20 @@
|
|
|
17
21
|
"changelog",
|
|
18
22
|
"log"
|
|
19
23
|
],
|
|
20
|
-
"license": "MIT",
|
|
21
24
|
"engines": {
|
|
22
|
-
"node": ">=
|
|
25
|
+
"node": ">=18"
|
|
23
26
|
},
|
|
27
|
+
"bin": "cli.js",
|
|
28
|
+
"exports": "./index.js",
|
|
24
29
|
"files": [
|
|
25
30
|
"index.js",
|
|
26
31
|
"figures.js",
|
|
27
|
-
"cli.
|
|
32
|
+
"cli.js"
|
|
28
33
|
],
|
|
29
34
|
"dependencies": {
|
|
30
|
-
"meow": "^
|
|
35
|
+
"meow": "^13.0.0",
|
|
31
36
|
"picocolors": "^1.0.0",
|
|
32
|
-
"conventional-changelog-angular": "^
|
|
33
|
-
"conventional-changelog-core": "^
|
|
34
|
-
}
|
|
35
|
-
"bin": "cli.mjs"
|
|
37
|
+
"conventional-changelog-angular": "^8.0.0",
|
|
38
|
+
"conventional-changelog-core": "^8.0.0"
|
|
39
|
+
}
|
|
36
40
|
}
|