This repository has been archived by the owner on Sep 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnew.config.js
79 lines (72 loc) · 2.36 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
73
74
75
76
77
78
79
/* eslint-env node */
const dedent = require('dedent');
const { Confirm } = require('enquirer');
const lerna = require('./lerna');
const pkg = require('./package');
module.exports = {
scopes: ['anireact'],
workspaces: ['@anireact'],
repository: pkg.repository,
homepage: (name, workspace) => `https://github.com/anireact/themed/tree/master/${workspace}/${name}`,
bugs: (name, workspace) => `https://github.com/anireact/themed/issues?q=is:issue+label:${workspace}/${name}`,
author: pkg.author,
context: __dirname,
version: lerna.version,
private: false,
license: 'MIT',
main: 'dist/index.js',
package: x => ({
...x,
types: x.main.replace(/\.js$/u, '.d.ts'),
scripts: {
build: 'yarn build:js && yarn build:ts',
'build:js': 'rollup -c ../../rollup.config.js',
'build:ts': 'tsc --declaration --emitDeclarationOnly --outDir dist --pretty --rootDir src',
clean: 'rimraf dist',
prepublishOnly: 'yarn run clean && yarn run build',
},
}),
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',
// language=Markdown
data: dedent`
# ${pkg_.name}
> ${pkg_.description}
## License
MIT`,
},
{
file: 'babel.config.js',
data: `
module.exports = require('../../babel.config');
`,
},
{
file: 'tsconfig.json',
data: {
extends: '../../tsconfig.json',
compilerOptions: {
rootDir: 'src',
outDir: 'dist',
},
exclude: ['dist'],
},
},
['mkdirp', 'src'],
{
file: 'src/index.ts',
data: '',
},
['prettier', '--write', './**/*.{js,jsx,ts,tsx,css,less,scss,html,json,md}'],
add && ['git', 'add', './*'],
];
},
};