forked from algolia/docsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathship.config.js
29 lines (25 loc) · 936 Bytes
/
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
import fs from 'fs';
import path from 'path';
const packages = ['packages/docsearch-css', 'packages/docsearch-react', 'packages/docsearch-js'];
export default {
monorepo: {
mainVersionFile: 'lerna.json',
// We rely on Lerna to bump our dependencies.
packagesToBump: [],
packagesToPublish: packages,
},
publishCommand({ tag }) {
return `yarn publish --access public --tag ${tag}`;
},
versionUpdated({ exec, dir, version }) {
// Update package dependencies
exec(`yarn lerna version ${version} --exact --no-git-tag-version --no-push --yes`);
// Ship.js reads JSON and writes with `fs.writeFileSync(JSON.stringify(json, null, 2))`
// which causes a lint error in the `lerna.json` file.
exec('yarn eslint lerna.json --fix');
fs.writeFileSync(
path.resolve(dir, 'packages', 'docsearch-react', 'src', 'version.ts'),
`export const version = '${version}';\n`,
);
},
};