forked from microsoft/fluentui-react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbeachball.config.js
32 lines (30 loc) · 1010 Bytes
/
beachball.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
const fs = require('fs');
const path = require('path');
module.exports = {
disallowedChangeTypes: ['major'],
hooks: {
prepublish: (packagePath) => {
const packageJsonPath = path.join(packagePath, 'package.json');
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
if (packageJson.onPublish) {
Object.assign(packageJson, packageJson.onPublish);
delete packageJson.onPublish;
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2) + '\n');
}
},
},
changelog: {
groups: [
{
masterPackageName: '@fluentui/react-native',
include: getPackagesToInclude(),
changelogPath: path.resolve('packages/libraries/core/'),
},
],
},
};
function getPackagesToInclude() {
const content = fs.readFileSync(path.resolve('packages/libraries/core/src/index.ts'), 'utf8');
const matches = Array.from(content.matchAll(new RegExp("'(@.*)'", 'g')), (m) => m[1]);
return matches;
}