forked from absolute-version/commit-and-tag-version
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdefaults.ts
52 lines (48 loc) · 1.59 KB
/
defaults.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import spec from "conventional-changelog-config-spec/versions/2.1.0/schema.json";
import { PrettyPrint } from "./type-helpers";
const defaults = {
infile: "CHANGELOG.md",
firstRelease: false,
sign: false,
noVerify: false,
commitAll: false,
silent: false,
tagPrefix: "v",
releaseCount: 1,
scripts: {},
skip: {},
dryRun: false,
tagForce: false,
gitTagFallback: true,
preset: require.resolve("conventional-changelog-conventionalcommits"),
npmPublishHint: undefined,
/**
* Sets the default for `header` (provided by the spec) for backwards
* compatibility. This should be removed in the next major version.
*/
header:
"# Changelog\n\nAll notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.\n",
packageFiles: ["package.json", "bower.json", "manifest.json"],
bumpFiles: [
"package.json",
"bower.json",
"manifest.json",
"package-lock.json",
"npm-shrinkwrap.json",
],
} as const;
type Defaults = PrettyPrint<
typeof defaults &
Readonly<{
[key in keyof typeof spec.properties]: typeof spec.properties[key]["default"];
}>
>;
/**
* Merge in defaults provided by the spec
*/
Object.keys(spec.properties).forEach((propertyKey) => {
const property = spec.properties[propertyKey as keyof typeof spec.properties];
// @ts-expect-error - We used a const assertion to infer literal types for intellisense, so TS thinks defaults is readonly.
defaults[propertyKey] = property.default;
});
export default defaults as Defaults;