-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathconfig.js
82 lines (65 loc) · 2.76 KB
/
config.js
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
Hey, welcome to the changeset config! This file has been generated
for you with the default configs we use, and some comments around
what options mean, so that it's easy to customise your workflow.
You should update this as you need to craft your workflow.
Config provided by a CI command takes precedence over the contents of this file.
If a config option isn't present here, we will fall back to the defaults.
*/
const changesetOptions = {
// If true, we will automatically commit the changeset when the command is run
commit: false,
};
// This function takes information about a changeset to generate an entry for it in your
// changelog. We provide the full changeset object as well as the version.
// It may be a good idea to replace the commit hash with a link to the commit.
/* the default shape is:
- [patch] ABCDEFG:
A summary message you wrote, indented
*/
const getReleaseLine = async (changeset, versionType) => {
const indentedSummary = changeset.summary
.split('\n')
.map(l => ` ${l}`.trimRight())
.join('\n').trimLeft();
return `- [${changeset.commit}](https://github.com/keystonejs/keystone-5/commit/${changeset.commit}): ${indentedSummary}\n`;
};
// This function takes information about what dependencies we are updating in the package.
// It provides an array of related changesets, as well as the dependencies updated.
/*
- Updated dependencies: [ABCDEFG]:
- Updated dependencies: [HIJKLMN]:
*/
const getDependencyReleaseLine = async (changesets, dependenciesUpdated) => {
if (dependenciesUpdated.length === 0) return '';
const changesetLinks = changesets.map(
changeset => `- Updated dependencies [${changeset.commit}](https://github.com/keystonejs/keystone-5/commit/${changeset.commit}):`
);
const updatedDepenenciesList = dependenciesUpdated.map(
dependency => ` - ${dependency.name}@${dependency.version}`
);
return [...changesetLinks, ...updatedDepenenciesList].join('\n');
};
const versionOptions = {
// If true, we will automatically commit the version updating when the command is run
commit: false,
// Adds a skipCI flag to the commit - only valid if `commit` is also true.
skipCI: false,
// Do not modify the `changelog.md` files for packages that are updated
noChangelog: false,
// A function that returns a string. It takes in options about a change. This allows you to customise your changelog entries
getReleaseLine,
// A function that returns a string. It takes in options about when a pacakge is updated because
getDependencyReleaseLine,
};
const publishOptions = {
// This sets whether unpublished packages are public by default. We err on the side of caution here.
public: false,
};
module.exports = {
versionOptions,
changesetOptions,
publishOptions,
};