Skip to content

Commit

Permalink
docs: fix some docs error (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
hexqi authored Jul 4, 2023
1 parent 4347b59 commit 03efb39
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 21 deletions.
11 changes: 4 additions & 7 deletions docs/tool-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@

基于以上的场景,大致描绘一下一个工程化工具的一些功能。

![](https://raw.githubusercontent.com/opentiny/tiny-vue/blob/main/docs/images/feature_2012x914.png)

![](https://raw.githubusercontent.com/opentiny/tiny-cli/dev/docs/images/feature_2012x914.png)

<a name="c9200446"></a>
### 套件
Expand Down Expand Up @@ -70,7 +69,7 @@ module.exports = {
tasks: {
init: [{
// 清除临时文件
command: 'clearn'
command: 'node tools/clean.js'
},
{
// 安装依赖
Expand All @@ -91,12 +90,12 @@ module.exports = {
}],
build: [{
// 基于webpack构建
command: 'webpack2',
command: 'webpack',
},
],
test: [{
// 执行eslint
command: 'lint',
command: 'eslint',
},
],
},
Expand Down Expand Up @@ -124,8 +123,6 @@ cli本身不具备任何工程化能力,cli只是提供了一个让你写套
基于上面的思考,我们参考DDD的思维模式,将域能力划分出来,将cli的整体框架理清晰。


![image.png](http://image.huawei.com/tiny-lts/v1/images/bcaed973d9deccf67381b6fc06c3d67c_1418x1248.png)

<a name="dmXHx"></a>
### 包函数说明

Expand Down
2 changes: 1 addition & 1 deletion docs/use-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ tiny 使用帮助: $ tiny [command] [options]
$ tiny init [toolkitName]
```

其中`toolkitName`表示套件的名字。一般的套件名格式为:`tiny-toolkit-{toolkitName}`。如DEV套件:[tiny-toolkit-dev](http://git.huawei.com/tiny/tiny-toolkit-dev),若要使用该套件可直接初始化:
其中`toolkitName`表示套件的名字。一般的套件名格式为:`tiny-toolkit-{toolkitName}`。如DEV套件:[tiny-toolkit-dev](http://github.com/opentiny/tiny-cli/tree/dev/packages/toolkits/dev),若要使用该套件可直接初始化:

```bash
$ tiny init dev
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/commands/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
/**
* 设置cnpmrc
* 类似于 $ npm config set registry http://cmc-cd-mirror.rnd.huawei.com/npm
* 类似于 $ npm config set registry https://registry.npmmirror.com/
*/
import * as path from 'path';
import os from 'os';
Expand Down Expand Up @@ -52,7 +52,7 @@ export default async (argv) => {
log.warn(`config 参数不正确,用法举例:
# 设置.cnpmrc 文件,写入registry
${bin} config set registry http://cmc-cd-mirror.rnd.huawei.com/npm/
${bin} config set registry https://registry.npmmirror.com/
# 获取.cnpmrc 文件中registry的值
${bin} config get registry
Expand Down
4 changes: 0 additions & 4 deletions packages/cli/devkit/src/error/handle-default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
/**
* Created by hugo on 16/11/16.
*/

import logs from '../log/index';
import message from './locale/index';
import Intl from '../intl/index';
Expand Down
1 change: 0 additions & 1 deletion packages/cli/devkit/src/error/handle-eaddrinuse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
*
*/
/**
* Created by hugo on 17/4/21.
* 端口被占用时的错误处理
*/
import logs from '../log/index';
Expand Down
3 changes: 0 additions & 3 deletions packages/cli/devkit/src/error/handle-enoent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
/**
* Created by hugo on 16/11/16.
*/
import _ from 'lodash';
import logs from '../log/index';
import Intl from '../intl/index';
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/devkit/src/error/locale/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
export default {
zh: {
// handle-default.js
intranetTips: '运行报错, 请在issue中反馈问题:https://codehub-g.huawei.com/Tiny/opentiny/opentiny-cli/issues/new',
intranetTips: '运行报错, 请在issue中反馈问题:https://github.com/opentiny/tiny-cli/issues/new',
winPidTips: ` # 看下是哪个PID占用的端口
$ lsof -i :{port}
# 杀进程
Expand Down Expand Up @@ -47,7 +47,7 @@ export default {
en: {
// handle-default.js
intranetTips:
'Runtime Error, please report the issue: https://codehub-g.huawei.com/Tiny/opentiny/opentiny-cli/issues/new',
'Runtime Error, please report the issue: https://github.com/opentiny/tiny-cli/issues/new',
winPidTips: ` # Look up for the PID which occupies the port
$ lsof -i :{port}
# Kill process
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/devkit/src/git/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ git.repository = function (cwd?: string) {
shelljs.exec('git config --get remote.origin.url', { silent: true, cwd }).stdout.toString() || ''
).trim();
// 有些git的url是http开头的,需要格式化为git@格式,方便统一处理
const match = repository.match(/^(http|https):\/\/(.*huawei\.com|github\.com)\/(.*)/);
const match = repository.match(/^(http|https):\/\/(.*?\.com)\/(.*)/);
if (match && match.length > 3) {
repository = `git@${match[2]}:${match[3]}`;
}
Expand Down

0 comments on commit 03efb39

Please sign in to comment.