@wzyjs/cli 0.0.27 → 0.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/build/index.js +1 -1
- package/dist/commands/dev/index.js +0 -5
- package/dist/commands/merge/script.js +11 -2
- package/dist/commands/start/index.js +1 -1
- package/dist/index.js +0 -2
- package/package.json +4 -5
- package/dist/commands/create/index.d.ts +0 -3
- package/dist/commands/create/index.js +0 -13
- package/dist/examples/empty/src/index.d.ts +0 -0
- package/dist/examples/empty/src/index.js +0 -1
- package/dist/examples/fe/src/app.d.ts +0 -9
- package/dist/examples/fe/src/app.js +0 -19
|
@@ -7,7 +7,7 @@ const umi_1 = require("umi");
|
|
|
7
7
|
const internal_1 = require("@midwayjs/hooks/internal");
|
|
8
8
|
const utils_1 = require("@wzyjs/utils");
|
|
9
9
|
const utils_2 = require("./utils");
|
|
10
|
-
const consola = require('
|
|
10
|
+
const { consola } = require('@wzyjs/utils');
|
|
11
11
|
exports.default = (cli) => {
|
|
12
12
|
cli.command('build', 'cli工具')
|
|
13
13
|
.option('--outDir [dir]', `[string] output directory (default: dist)`, {
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const umi_1 = require("umi");
|
|
4
|
-
const internal_1 = require("@midwayjs/hooks/internal");
|
|
5
4
|
exports.default = (cli) => {
|
|
6
5
|
cli.command('dev', 'cli工具')
|
|
7
6
|
.action(() => {
|
|
8
7
|
// 设置 midway 接口服务端口为 7001
|
|
9
8
|
process.env.MIDWAY_HTTP_PORT = '7001';
|
|
10
|
-
// 给 @midwayjs/hooks-bundler里的 vite() 插件,设置 midway.config.ts 的配置
|
|
11
|
-
// 加这一行,该插件就不会去使用根目录下的 midway.config.ts 文件了
|
|
12
|
-
// 就可把 midway.config.ts 文件删了,也没啥用
|
|
13
|
-
(0, internal_1.setConfig)({});
|
|
14
9
|
(0, umi_1.run)({
|
|
15
10
|
presets: [require.resolve('../../plugins/preset')],
|
|
16
11
|
}).catch((e) => {
|
|
@@ -37,8 +37,14 @@ function execGitCommand(command) {
|
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
exports.default = async (options) => {
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
const hasChange = await execGitCommand('git status -s');
|
|
41
|
+
if (hasChange) {
|
|
42
|
+
if (options?.commit) {
|
|
43
|
+
console.log('commit success', await execGitCommand(`git commit -a -m "${(await getLatestCommitMsg()).trim()}"`));
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
console.log('stash success', await execGitCommand('git stash'));
|
|
47
|
+
}
|
|
42
48
|
}
|
|
43
49
|
const count = options?.count || await getContinuousCommitCount();
|
|
44
50
|
const command = `GIT_EDITOR=true GIT_SEQUENCE_EDITOR="sed -i -e '2,\\$s/^pick/squash/'" git rebase -i HEAD~${count}`;
|
|
@@ -46,4 +52,7 @@ exports.default = async (options) => {
|
|
|
46
52
|
if (options?.push) {
|
|
47
53
|
console.log('push success', await execGitCommand('git push origin HEAD --force'));
|
|
48
54
|
}
|
|
55
|
+
if (hasChange && !options?.commit) {
|
|
56
|
+
await execGitCommand('git stash pop');
|
|
57
|
+
}
|
|
49
58
|
};
|
|
@@ -5,7 +5,7 @@ const path_1 = require("path");
|
|
|
5
5
|
const fs = tslib_1.__importStar(require("fs-extra"));
|
|
6
6
|
const bootstrap_1 = require("@midwayjs/bootstrap");
|
|
7
7
|
const internal_1 = require("@midwayjs/hooks/internal");
|
|
8
|
-
const consola = require('
|
|
8
|
+
const { consola } = require('@wzyjs/utils');
|
|
9
9
|
exports.default = (cli) => {
|
|
10
10
|
cli.command('start', 'start')
|
|
11
11
|
.option('-p, --port <port>', '[number] specify port', { default: 3000 })
|
package/dist/index.js
CHANGED
|
@@ -5,13 +5,11 @@ const cac_1 = tslib_1.__importDefault(require("cac"));
|
|
|
5
5
|
const dev_1 = tslib_1.__importDefault(require("./commands/dev"));
|
|
6
6
|
const build_1 = tslib_1.__importDefault(require("./commands/build"));
|
|
7
7
|
const start_1 = tslib_1.__importDefault(require("./commands/start"));
|
|
8
|
-
const create_1 = tslib_1.__importDefault(require("./commands/create"));
|
|
9
8
|
const merge_1 = tslib_1.__importDefault(require("./commands/merge"));
|
|
10
9
|
const cli = (0, cac_1.default)();
|
|
11
10
|
(0, dev_1.default)(cli);
|
|
12
11
|
(0, build_1.default)(cli);
|
|
13
12
|
(0, start_1.default)(cli);
|
|
14
|
-
(0, create_1.default)(cli);
|
|
15
13
|
(0, merge_1.default)(cli);
|
|
16
14
|
cli.help();
|
|
17
15
|
cli.version('0.0.1');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wzyjs/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.30",
|
|
4
4
|
"description": "description",
|
|
5
5
|
"author": "wzy",
|
|
6
6
|
"license": "ISC",
|
|
@@ -21,11 +21,10 @@
|
|
|
21
21
|
"@midwayjs/command-core": "^1.3.14",
|
|
22
22
|
"@midwayjs/hooks": "^3.0.1",
|
|
23
23
|
"@umijs/plugins": "^4.0.28",
|
|
24
|
-
"@wzyjs/utils": "^0.0.
|
|
24
|
+
"@wzyjs/utils": "^0.0.30",
|
|
25
25
|
"cac": "^6.7.14",
|
|
26
|
-
"consola": "^2.15.3",
|
|
27
26
|
"fs-extra": "^10.1.0",
|
|
28
|
-
"rc-field-form": "^1.
|
|
27
|
+
"rc-field-form": "^1.32.2",
|
|
29
28
|
"umi": "^4.0.30",
|
|
30
29
|
"vite": "^2.7.9"
|
|
31
30
|
},
|
|
@@ -43,5 +42,5 @@
|
|
|
43
42
|
"type": "git",
|
|
44
43
|
"url": "https://gitee.com/wang-zhenyu/app.git"
|
|
45
44
|
},
|
|
46
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "c8e042a5bb184b3842ec4f04d2edd671a0ac2802"
|
|
47
46
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const fs = tslib_1.__importStar(require("fs-extra"));
|
|
5
|
-
const path_1 = require("path");
|
|
6
|
-
exports.default = (cli) => {
|
|
7
|
-
cli.command('create <name> [outDir]', 'cli工具')
|
|
8
|
-
.action((name, outDir) => {
|
|
9
|
-
const sourceDir = (0, path_1.resolve)('libs/cli/examples/empty');
|
|
10
|
-
const targetDir = (0, path_1.resolve)(outDir || '.', name);
|
|
11
|
-
fs.copySync(sourceDir, targetDir);
|
|
12
|
-
});
|
|
13
|
-
};
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// 运行时配置
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.layout = exports.getInitialState = void 0;
|
|
5
|
-
// 全局初始化数据配置,用于 Layout 用户信息和权限初始化
|
|
6
|
-
// 更多信息见文档:https://next.umijs.org/docs/api/runtime-config#getinitialstate
|
|
7
|
-
async function getInitialState() {
|
|
8
|
-
return { name: '@umijs/max' };
|
|
9
|
-
}
|
|
10
|
-
exports.getInitialState = getInitialState;
|
|
11
|
-
const layout = () => {
|
|
12
|
-
return {
|
|
13
|
-
logo: 'https://img.alicdn.com/tfs/TB1YHEpwUT1gK0jSZFhXXaAtVXa-28-27.svg',
|
|
14
|
-
menu: {
|
|
15
|
-
locale: false,
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
exports.layout = layout;
|