Skip to content

Commit 88ace60

Browse files
authored
Merge pull request #198 from raxjs/release/miniapp-0805
release/miniapp@0805
2 parents e017379 + 0686658 commit 88ace60

File tree

17 files changed

+163
-35
lines changed

17 files changed

+163
-35
lines changed

.github/workflows/release-report.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: ci
2+
on:
3+
release:
4+
types:
5+
- created
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v1
11+
- name: Use Node.js 12.x
12+
uses: actions/setup-node@v2
13+
with:
14+
node-version: 12.x
15+
registry-url: https://registry.npmjs.org
16+
- name: Set branch name
17+
run: echo >>$GITHUB_ENV BRANCH_NAME=${GITHUB_REF#refs/heads/}
18+
- name: Output branch name
19+
run: echo ${BRANCH_NAME}
20+
- run: npm install
21+
- name: Publish And Notify
22+
run: npm run release
23+
env:
24+
DING_WEBHOOK: ${{secrets.DING_WEBHOOK}}

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"@iceworks/spec": "^1.0.3",
1919
"@typescript-eslint/eslint-plugin": "^3.4.0",
2020
"@typescript-eslint/parser": "^3.4.0",
21-
"axios": "^0.21.0",
21+
"axios": "^0.21.1",
2222
"babel-eslint": "^10.1.0",
2323
"babel-jest": "^26.3.0",
2424
"babel-plugin-transform-jsx-stylesheet": "^1.0.0",
@@ -40,6 +40,7 @@
4040
"regenerator-runtime": "^0.13.7",
4141
"rimraf": "^3.0.2",
4242
"semver": "^7.3.2",
43+
"ts-node": "^10.1.0",
4344
"typescript": "^4.0.3",
4445
"universal-env": "^3.2.2"
4546
},
@@ -54,7 +55,8 @@
5455
"clean": "lerna clean --yes && rimraf packages/*/lib",
5556
"clean:lib": "rm -rf ./packages/*/lib",
5657
"check-and-publish": "node ./scripts/check-and-publish",
57-
"ci": "npm run setup && npm run lint && npm run test"
58+
"ci": "npm run setup && npm run lint && npm run test",
59+
"release": "ts-node ./scripts/release.ts"
5860
},
5961
"config": {
6062
"commitizen": {

packages/miniapp-builder-shared/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## [0.2.10] - 2021-08-05
4+
5+
### Changed
6+
7+
- Update autoInstallNpm method to support multiple install action
8+
39
## [0.2.9] - 2021-07-27
410

511
### Fixed

packages/miniapp-builder-shared/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "miniapp-builder-shared",
3-
"version": "0.2.9",
3+
"version": "0.2.10",
44
"description": "miniapp project builder shared lib",
55
"author": "Rax Team",
66
"homepage": "https://github.com/raxjs/miniapp#readme",

packages/miniapp-builder-shared/src/autoInstallNpm.js

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,37 @@
11
const execa = require('execa');
2+
const { join } = require('path');
23
const { checkAliInternal } = require('ice-npm-utils');
34

45
let isAliInternal;
56
let npmRegistry;
67

7-
async function autoInstallNpm(dir, callback) {
8+
function executeInstall(cwd) {
9+
return execa('npm', ['install', '--production', `--registry=${npmRegistry}`], { cwd });
10+
}
11+
12+
function warnInstallManually() {
13+
console.log('\nInstall dependencies failed, please enter dist path and retry installing by yourself\n');
14+
}
15+
16+
async function autoInstallNpm(callback, { distDir, packageJsonFilePath = []}) {
817
if (isAliInternal === undefined) {
918
isAliInternal = await checkAliInternal();
1019
npmRegistry = isAliInternal
1120
? 'https://registry.npm.alibaba-inc.com'
1221
: 'https://registry.npm.taobao.org';
1322
}
14-
execa('npm', ['install', '--production', `--registry=${npmRegistry}`], {
15-
cwd: dir,
16-
})
17-
.then(({ exitCode }) => {
18-
if (!exitCode) {
19-
callback();
20-
} else {
21-
console.log(
22-
`\nInstall dependencies failed, please enter ${dir} and retry by yourself\n`
23-
);
24-
callback();
23+
const installPromiseArray = packageJsonFilePath.map(installPath => {
24+
return executeInstall(join(distDir, installPath));
25+
});
26+
Promise.all(installPromiseArray)
27+
.then((results) => {
28+
if (results.some(result => result.exitCode)) {
29+
warnInstallManually();
2530
}
31+
callback();
2632
})
2733
.catch(() => {
28-
console.log(
29-
`\nInstall dependencies failed, please enter ${dir} and retry by yourself\n`
30-
);
34+
warnInstallManually();
3135
callback();
3236
});
3337
}

packages/miniapp-compile-config/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## [0.2.4] - 2021-08-05
4+
5+
### Added
6+
7+
- Support generating multiple package.json file in subpackages mode
8+
39
## [0.2.3] - 2021-07-20
410

511
### Added

packages/miniapp-compile-config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "miniapp-compile-config",
3-
"version": "0.2.3",
3+
"version": "0.2.4",
44
"description": "miniapp compile project config",
55
"author": "Rax Team",
66
"homepage": "https://github.com/raxjs/miniapp#readme",
Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,35 @@
11
const { autoInstallNpm } = require('miniapp-builder-shared');
22
const { writeJSONSync } = require('fs-extra');
3-
const { join } = require('path');
3+
const { join, dirname } = require('path');
44
/**
55
* Auto install npm
66
*/
77
module.exports = class AutoInstallNpmPlugin {
88
constructor({ nativePackage = {} }) {
99
this.autoInstall = nativePackage.autoInstall;
1010
this.dependencies = nativePackage.dependencies || null;
11+
this.subPackages = nativePackage.subPackages || null;
1112
}
1213
apply(compiler) {
1314
compiler.hooks.done.tapAsync('AutoInstallNpmPlugin', async(stats, callback) => {
15+
const packageJsonFilePath = [];
1416
const distDir = stats.compilation.outputOptions.path;
1517
// Generate package.json
1618
if (this.dependencies) {
17-
const pkgFilePath = join(distDir, 'package.json');
18-
writeJSONSync(pkgFilePath, {
19-
dependencies: this.dependencies
19+
writeJSONSync(join(distDir, 'package.json'), { dependencies: this.dependencies });
20+
packageJsonFilePath.push('');
21+
}
22+
if (this.subPackages) {
23+
this.subPackages.forEach(({ dependencies = {}, source = '' }) => {
24+
writeJSONSync(join(distDir, dirname(source), 'package.json'), { dependencies });
25+
packageJsonFilePath.push(dirname(source));
2026
});
2127
}
28+
2229
if (!this.autoInstall) {
2330
return callback();
2431
}
25-
await autoInstallNpm(distDir, callback);
32+
await autoInstallNpm(callback, { distDir, packageJsonFilePath });
2633
});
2734
}
2835
};

packages/rax-miniapp-runtime-webpack-plugin/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## [4.9.0] - 2021-08-05
4+
5+
### Added
6+
7+
- Support generating multiple package.json file in subpackages mode
8+
9+
### Fixed
10+
11+
- Data binding error in scroll-view template in baidu smartprogram
12+
- Text can't be nested in baidu smartprogram
13+
- Can't generate native components template in windows system
14+
315
## [4.8.0] - 2021-07-20
416

517
### Added

packages/rax-miniapp-runtime-webpack-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rax-miniapp-runtime-webpack-plugin",
3-
"version": "4.8.0",
3+
"version": "4.9.0",
44
"description": "A webpack plugin for miniapp runtime build",
55
"main": "src/index.js",
66
"homepage": "https://github.com/raxjs/miniapp#readme",

0 commit comments

Comments
 (0)