This repository has been archived by the owner on Mar 9, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnew.config.js
72 lines (53 loc) · 1.7 KB
/
new.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
/* eslint-env node */
const dedent = require('dedent');
const { Confirm } = require('enquirer');
const lerna = require('./lerna');
const pkg = require('./package');
module.exports = {
// Allowed scopes.
scopes: ['anireact'],
// Workspaces locations.
workspaces: ['@anireact'],
// Repository URL.
repository: pkg.repository,
// Package’s homepage.
homepage: (name, workspace) => `https://github.com/anireact/tooling/tree/master/${workspace}/${name}`,
// Issue tracker URL.
bugs: (name, workspace) => `https://github.com/anireact/tooling/issues?q=is:issue+label:${workspace}/${name}`,
// Author’s name, email, homepage.
author: pkg.author,
// Monorepo root.
context: __dirname,
// Initial version of new packages.
version: lerna.version,
// Prefer private packages.
private: false,
// Default license.
license: 'MIT',
// Default entry point.
main: 'dist/index.js',
// Post-process generated `package.json`.
package: x => x,
// Post-spawn commands.
finalize: async pkg_ => {
const add = await new Confirm({
message: 'Add to Git:',
initial: true,
}).run();
return [
{ root: true, run: ['yarn'] },
['yarn', 'add', '@babel/runtime', 'core-js'],
{
file: 'README.md',
data: dedent`
# ${pkg_.name}
> ${pkg_.description}
## License
MIT
`,
},
['prettier', '--write', './**/*.{js,jsx,ts,tsx,css,less,scss,html,json,md}'],
add && ['git', 'add', './*'],
];
},
};