Commit 9e31f279 authored by 邓晓峰's avatar 邓晓峰

fix: release lerna list

parents ca4508bb 79f56822
Pipeline #27301 failed with stages
in 15 seconds
...@@ -2,6 +2,12 @@ ...@@ -2,6 +2,12 @@
All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.0.2](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/ec_devicetree@1.0.1...@wisdom-components/ec_devicetree@1.0.2) (2021-05-10)
### Bug Fixes
- 修改 mqtt 连接配置 ([d42cbc9](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/d42cbc9edcab56ed29ca1399f8f0ea714601964a))
## 1.0.1 (2021-05-10) ## 1.0.1 (2021-05-10)
### Bug Fixes ### Bug Fixes
......
{ {
"name": "@wisdom-components/ec_devicetree", "name": "@wisdom-components/ec_devicetree",
"version": "1.0.1", "version": "1.0.2",
"description": "> TODO: description", "description": "> TODO: description",
"author": "tuqian <webtuqian@163.com>", "author": "tuqian <webtuqian@163.com>",
"homepage": "", "homepage": "",
......
const { utils } = require('umi'); const { utils } = require('umi');
const { join } = require('path'); const { join, relative, resolve, sep } = require('path');
const exec = require('./utils/exec'); const exec = require('./utils/exec');
const getPackages = require('./utils/getPackages'); const getPackages = require('./utils/getPackages');
const isNextVersion = require('./utils/isNextVersion'); const isNextVersion = require('./utils/isNextVersion');
...@@ -24,6 +24,16 @@ function packageExists({ name, version }) { ...@@ -24,6 +24,16 @@ function packageExists({ name, version }) {
} }
async function release() { async function release() {
let pkgList = execa.sync(lernaCli, ['list', '--json']).stdout;
pkgList = JSON.parse(pkgList);
const locMap = {};
pkgList.forEach((item) => {
const location = item.location.split(sep);
locMap[location[location.length - 1]] = `${location[location.length - 2]}/${
location[location.length - 1]
}`;
});
console.log(locMap);
// Check git status // Check git status
if (!args.skipGitStatusCheck) { if (!args.skipGitStatusCheck) {
const gitStatus = execa.sync('git', ['status', '--porcelain']).stdout; const gitStatus = execa.sync('git', ['status', '--porcelain']).stdout;
...@@ -121,7 +131,8 @@ async function release() { ...@@ -121,7 +131,8 @@ async function release() {
// eslint-disable-next-line consistent-return // eslint-disable-next-line consistent-return
pkgs.forEach((pkg, index) => { pkgs.forEach((pkg, index) => {
const [shortName, p] = pkg.split('!'); const pkgMap = locMap[pkg];
const [p, shortName] = pkgMap.split('/');
const pkgPath = join(cwd, 'packages', p, shortName.replace('pro-', '')); const pkgPath = join(cwd, 'packages', p, shortName.replace('pro-', ''));
// eslint-disable-next-line global-require,import/no-dynamic-require // eslint-disable-next-line global-require,import/no-dynamic-require
const { name, version } = require(join(pkgPath, 'package.json')); const { name, version } = require(join(pkgPath, 'package.json'));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment