forked from algolia/algoliasearch-client-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ship.config.js
34 lines (30 loc) · 1.27 KB
/
ship.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
/* eslint-disable functional/immutable-data */
/* eslint-disable import/no-commonjs */
const util = require('util');
const exec = util.promisify(require('child_process').exec);
const fs = require('fs').promises;
const path = require('path');
module.exports = {
monorepo: {
mainVersionFile: 'package.json',
// no packages should be versioned by shipjs, lerna should do it!
packagesToBump: [],
packagesToPublish: ['packages/*'],
},
getTagName: ({ version }) => `${version}`,
conventionalChangelogArgs:
'--config conventional-changelog.config.js --infile CHANGELOG.md --same-file',
publishCommand({ tag }) {
return `yarn publish --access public --tag ${tag}`;
},
async versionUpdated({ version, dir }) {
// Update version with lerna
await exec(`lerna version ${version} --no-git-tag-version --no-push --exact --yes`);
// Update version in `packages/client-common/src/version.ts` file since
// `shipjs prepare` does not seem to support Typescript version files
// bumping (yet?).
const clientCommonTypescriptPath = 'packages/client-common/src/version.ts';
const clientCommonTypescript = path.resolve(dir, clientCommonTypescriptPath);
await fs.writeFile(clientCommonTypescript, `export const version = '${version}';\n`);
},
};