Skip to content

Commit 452b510

Browse files
committed
feat: add release config
1 parent ea93f23 commit 452b510

File tree

5 files changed

+828
-270
lines changed

5 files changed

+828
-270
lines changed

micro-app.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use strict';
2+
3+
const config = {};
4+
5+
config.plugins = [
6+
__dirname,
7+
];
8+
9+
module.exports = config;

micro-app.release.config.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
'use strict';
2+
3+
module.exports = {
4+
hooks: {
5+
'before:bump': [
6+
'npm test',
7+
],
8+
},
9+
git: {
10+
requireUpstream: false,
11+
commitMessage: 'release: v${version}',
12+
tagName: 'v${version}',
13+
push: false,
14+
},
15+
github: {
16+
release: true,
17+
releaseName: 'Deploy %s Released!',
18+
draft: true,
19+
},
20+
plugins: {
21+
'@release-it/conventional-changelog': {
22+
preset: 'angular',
23+
},
24+
},
25+
};

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"scripts": {
77
"prepublishOnly": "npm run test",
88
"test": "jest",
9+
"release": "micro-app release",
910
"publish:next": "npm publish --tag next"
1011
},
1112
"files": [
@@ -35,15 +36,16 @@
3536
"@micro-app/cli": ">=0.3.0"
3637
},
3738
"devDependencies": {
38-
"@micro-app/cli": "^0.3.0-alpha.3",
39-
"@micro-app/shared-utils": "^0.1.13",
40-
"@types/jest": "^24.0.25",
39+
"@micro-app/cli": "0.3.0-alpha.6",
40+
"@micro-app/shared-utils": "0.1.14-alpha.1",
41+
"@types/jest": "^24.9.1",
4142
"babel-eslint": "^10.0.3",
4243
"eslint": "^5.16.0",
4344
"eslint-config-2o3t": "^1.1.17",
4445
"jest": "^24.9.0"
4546
},
4647
"dependencies": {
48+
"@release-it/conventional-changelog": "^1.1.0",
4749
"release-it": "^12.4.3"
4850
}
4951
}

test/index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@ const { service } = require('@micro-app/cli');
55

66
service.registerPlugin({
77
id: 'test:DeployCommand',
8-
link: path.join(__dirname, '../src/commands//deploy/index.js'),
8+
link: path.join(__dirname, '../src/deploy/index.js'),
9+
});
10+
11+
service.registerPlugin({
12+
id: 'test:ReleaseCommand',
13+
link: path.join(__dirname, '../src/release/index.js'),
914
});
1015

1116
(async () => {
12-
const result = await service.run('deploy');
17+
const result = await service.run('release');
1318
console.log(result);
1419
})();

0 commit comments

Comments
 (0)