@rife/cli 0.0.6-beta.7 → 0.0.6-beta.9
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/1.js +24 -0
- package/dist/1.mjs +20 -0
- package/dist/cjs/1.js +24 -0
- package/dist/cli.js +1 -2
- package/dist/cli.js.map +1 -1
- package/dist/esm/1.mjs +20 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/plugin/commander.js +2 -0
- package/dist/plugin/commander.js.map +1 -1
- package/dist/plugin/compiler/index.js +3 -3
- package/dist/plugin/compiler/index.js.map +1 -1
- package/dist/plugin/compiler/swc.js +2 -1
- package/dist/plugin/compiler/swc.js.map +1 -1
- package/dist/plugin/compiler/swc2.js +65 -0
- package/dist/plugin/compiler/swc2.js.map +1 -0
- package/dist/plugin/config.js +20 -5
- package/dist/plugin/config.js.map +1 -1
- package/dist/plugin/index.js +1 -0
- package/dist/plugin/index.js.map +1 -1
- package/dist/plugin/release.js +38 -24
- package/dist/plugin/release.js.map +1 -1
- package/dist/runner.js +9 -3
- package/dist/runner.js.map +1 -1
- package/dist/sync.js +3 -3
- package/dist/sync.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/util.js +14 -0
- package/dist/util.js.map +1 -0
- package/package.json +23 -23
- package/src/cli.ts +1 -2
- package/src/index.ts +4 -0
- package/src/plugin/commander.ts +2 -0
- package/src/plugin/compiler/index.ts +115 -115
- package/src/plugin/compiler/swc.ts +2 -1
- package/src/plugin/config.ts +78 -64
- package/src/plugin/index.ts +1 -0
- package/src/plugin/release.ts +42 -26
- package/src/runner.ts +10 -3
- package/src/sync.ts +3 -3
- package/src/util.ts +9 -0
- package/src/pnpmfile.ts +0 -147
- package/src/test/pnpmfile.test.ts +0 -223
|
@@ -1,115 +1,115 @@
|
|
|
1
|
-
import type { ChildProcess } from 'child_process';
|
|
2
|
-
|
|
3
|
-
import { AsyncSeriesHook } from 'tapable';
|
|
4
|
-
|
|
5
|
-
import { TsxConfig, checkAndEmitType, compileTs, formatDiagnostic } from './compiler';
|
|
6
|
-
import type { Plugin } from '../../runner';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
.
|
|
48
|
-
.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
if (runner.compiler.fail) {
|
|
76
|
-
log.fail(
|
|
77
|
-
process.exit(1);
|
|
78
|
-
} else {
|
|
79
|
-
log.success(
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
runner.compiler.hook.checkAndEmitType.tapPromise(pluginCompiler.name, async () => {
|
|
84
|
-
const { diagnostics, duration } = checkAndEmitType();
|
|
85
|
-
if (diagnostics.length) {
|
|
86
|
-
log.error(`类型检查失败,耗时 ${duration} s\n\n%s`, formatDiagnostic(diagnostics));
|
|
87
|
-
runner.compiler.fail = true;
|
|
88
|
-
} else {
|
|
89
|
-
log.success(`类型检查成功,耗时 ${duration} s`);
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
runner.compiler.hook.execMain.tapPromise(pluginCompiler.name, async () => {
|
|
94
|
-
const compiler = runner.compiler;
|
|
95
|
-
const { main } = compiler.tsx;
|
|
96
|
-
if (!main) {
|
|
97
|
-
log.debug('没有指定 main');
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
if (!(await fs.exists(main))) {
|
|
102
|
-
log.warn(`启动文件不存在 %s`, main);
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
log.info(`启动文件 node %s`, main);
|
|
107
|
-
|
|
108
|
-
const { fork } = require('child_process') as typeof import('child_process');
|
|
109
|
-
compiler.process?.kill();
|
|
110
|
-
compiler.process = fork(main, { stdio: 'inherit' });
|
|
111
|
-
});
|
|
112
|
-
},
|
|
113
|
-
};
|
|
114
|
-
return plugin;
|
|
115
|
-
}
|
|
1
|
+
import type { ChildProcess } from 'child_process';
|
|
2
|
+
|
|
3
|
+
import { AsyncSeriesHook } from 'tapable';
|
|
4
|
+
|
|
5
|
+
import { TsxConfig, checkAndEmitType, compileTs, formatDiagnostic } from './compiler';
|
|
6
|
+
import type { Plugin } from '../../runner';
|
|
7
|
+
import { getDuration } from '../../util';
|
|
8
|
+
|
|
9
|
+
declare module '../../runner' {
|
|
10
|
+
interface Runner {
|
|
11
|
+
compiler: {
|
|
12
|
+
fail: boolean;
|
|
13
|
+
process: ChildProcess | null;
|
|
14
|
+
hook: {
|
|
15
|
+
checkAndEmitType: AsyncSeriesHook<[]>;
|
|
16
|
+
execMain: AsyncSeriesHook<[]>;
|
|
17
|
+
};
|
|
18
|
+
tsx: TsxConfig;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface pluginCompilerOptions {
|
|
24
|
+
tsx?: Partial<TsxConfig>;
|
|
25
|
+
less?: {};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function pluginCompiler(options?: pluginCompilerOptions) {
|
|
29
|
+
const plugin: Plugin = {
|
|
30
|
+
name: pluginCompiler.name,
|
|
31
|
+
apply: runner => {
|
|
32
|
+
const { hook, logger, z, tapable, fs } = runner;
|
|
33
|
+
const log = logger.withTag(pluginCompiler.name);
|
|
34
|
+
const validation = z
|
|
35
|
+
.object({
|
|
36
|
+
tsx: z
|
|
37
|
+
.object({
|
|
38
|
+
type: z.enum(['tsc', 'swc']).default('swc'),
|
|
39
|
+
rootDir: z.string().trim().min(1).default('.'),
|
|
40
|
+
outDir: z.string().trim().min(1).default('./dist/'),
|
|
41
|
+
clean: z.boolean().default(true),
|
|
42
|
+
main: z.string().trim().optional(),
|
|
43
|
+
options: z.object({}).passthrough().optional(),
|
|
44
|
+
})
|
|
45
|
+
.default({}),
|
|
46
|
+
})
|
|
47
|
+
.optional()
|
|
48
|
+
.default({})
|
|
49
|
+
.safeParse(options);
|
|
50
|
+
|
|
51
|
+
if (!validation.success) {
|
|
52
|
+
log.error('配置错误\n', validation.error.message);
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
runner.compiler = {
|
|
57
|
+
fail: false,
|
|
58
|
+
process: null,
|
|
59
|
+
hook: {
|
|
60
|
+
checkAndEmitType: new tapable.AsyncSeriesHook(),
|
|
61
|
+
execMain: new tapable.AsyncSeriesHook(),
|
|
62
|
+
},
|
|
63
|
+
tsx: validation.data.tsx,
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
hook.dev.tapPromise(pluginCompiler.name, async () => {
|
|
67
|
+
const tsxConfig: TsxConfig = validation.data.tsx;
|
|
68
|
+
compileTs(runner, tsxConfig, { dev: true });
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
hook.build.tapPromise(pluginCompiler.name, async () => {
|
|
72
|
+
const perfStart = performance.now();
|
|
73
|
+
const tsxConfig: TsxConfig = validation.data.tsx;
|
|
74
|
+
await compileTs(runner, tsxConfig, { build: true });
|
|
75
|
+
if (runner.compiler.fail) {
|
|
76
|
+
log.fail(`构建失败,${getDuration(perfStart)}`);
|
|
77
|
+
process.exit(1);
|
|
78
|
+
} else {
|
|
79
|
+
log.success(`构建成功,${getDuration(perfStart)}`);
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
runner.compiler.hook.checkAndEmitType.tapPromise(pluginCompiler.name, async () => {
|
|
84
|
+
const { diagnostics, duration } = checkAndEmitType();
|
|
85
|
+
if (diagnostics.length) {
|
|
86
|
+
log.error(`类型检查失败,耗时 ${duration} s\n\n%s`, formatDiagnostic(diagnostics));
|
|
87
|
+
runner.compiler.fail = true;
|
|
88
|
+
} else {
|
|
89
|
+
log.success(`类型检查成功,耗时 ${duration} s`);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
runner.compiler.hook.execMain.tapPromise(pluginCompiler.name, async () => {
|
|
94
|
+
const compiler = runner.compiler;
|
|
95
|
+
const { main } = compiler.tsx;
|
|
96
|
+
if (!main) {
|
|
97
|
+
log.debug('没有指定 main');
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (!(await fs.exists(main))) {
|
|
102
|
+
log.warn(`启动文件不存在 %s`, main);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
log.info(`启动文件 node %s`, main);
|
|
107
|
+
|
|
108
|
+
const { fork } = require('child_process') as typeof import('child_process');
|
|
109
|
+
compiler.process?.kill();
|
|
110
|
+
compiler.process = fork(main, { stdio: 'inherit' });
|
|
111
|
+
});
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
return plugin;
|
|
115
|
+
}
|
|
@@ -35,8 +35,9 @@ export async function swc(options: SwcConfig) {
|
|
|
35
35
|
outDir,
|
|
36
36
|
watch,
|
|
37
37
|
filenames: ['./src'],
|
|
38
|
-
extensions: ['.ts', '.tsx'],
|
|
38
|
+
extensions: ['.ts', '.tsx', '.js', '.jsx'],
|
|
39
39
|
stripLeadingPaths: true,
|
|
40
|
+
copyFiles: true,
|
|
40
41
|
},
|
|
41
42
|
swcOptions,
|
|
42
43
|
callbacks: {
|
package/src/plugin/config.ts
CHANGED
|
@@ -1,64 +1,78 @@
|
|
|
1
|
-
import path from 'path';
|
|
2
|
-
|
|
3
|
-
import type { Config, Plugin } from '../runner';
|
|
4
|
-
|
|
5
|
-
export function pluginConfig() {
|
|
6
|
-
const plugin: Plugin = {
|
|
7
|
-
name: pluginConfig.name,
|
|
8
|
-
apply: runner => {
|
|
9
|
-
const { logger, hook, config, command, fs, z } = runner;
|
|
10
|
-
const log = logger.withTag(pluginConfig.name);
|
|
11
|
-
|
|
12
|
-
hook.loadConfig.tapPromise(pluginConfig.name, async () => {
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
.
|
|
46
|
-
|
|
47
|
-
if (!
|
|
48
|
-
log.
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
1
|
+
import path from 'path';
|
|
2
|
+
|
|
3
|
+
import type { Config, Plugin } from '../runner';
|
|
4
|
+
|
|
5
|
+
export function pluginConfig() {
|
|
6
|
+
const plugin: Plugin = {
|
|
7
|
+
name: pluginConfig.name,
|
|
8
|
+
apply: runner => {
|
|
9
|
+
const { logger, hook, config, command, fs, z } = runner;
|
|
10
|
+
const log = logger.withTag(pluginConfig.name);
|
|
11
|
+
|
|
12
|
+
hook.loadConfig.tapPromise(pluginConfig.name, async () => {
|
|
13
|
+
let filePath = '';
|
|
14
|
+
const mjs = 'app.mjs';
|
|
15
|
+
const fileNames = ['app.js', 'app.cjs', mjs];
|
|
16
|
+
let isEsm = false;
|
|
17
|
+
for (const fileName of fileNames) {
|
|
18
|
+
if (await fs.exists(fileName)) {
|
|
19
|
+
filePath = path.posix.resolve(fileName);
|
|
20
|
+
isEsm = fileName === mjs;
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
log.debug(`filePath %s`, filePath);
|
|
25
|
+
if (!filePath) {
|
|
26
|
+
log.error(`找不到配置文件 app.(c|m)?js`);
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
29
|
+
let all: Config[] = [];
|
|
30
|
+
if (isEsm) {
|
|
31
|
+
all = (await import(filePath)).default;
|
|
32
|
+
} else {
|
|
33
|
+
all = require(filePath);
|
|
34
|
+
}
|
|
35
|
+
runner.config.all = all;
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
hook.validateConfig.tapPromise(pluginConfig.name, async () => {
|
|
39
|
+
const validation = z
|
|
40
|
+
.array(
|
|
41
|
+
z.object({
|
|
42
|
+
name: z.string().trim().min(1),
|
|
43
|
+
}),
|
|
44
|
+
)
|
|
45
|
+
.min(1)
|
|
46
|
+
.safeParse(config.all);
|
|
47
|
+
if (!validation.success) {
|
|
48
|
+
log.error(validation.error.message);
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
hook.applyConfig.tapPromise(pluginConfig.name, async () => {
|
|
54
|
+
const result = z
|
|
55
|
+
.object({
|
|
56
|
+
name: z.string().trim().default(''),
|
|
57
|
+
})
|
|
58
|
+
.default({})
|
|
59
|
+
.safeParse(command.opts());
|
|
60
|
+
const name = result.data?.name;
|
|
61
|
+
if (!name) {
|
|
62
|
+
log.debug('没有指定 --name,默认使用列表第一个');
|
|
63
|
+
config.current = config.all[0];
|
|
64
|
+
} else {
|
|
65
|
+
log.debug(`指定 --name ${name}`);
|
|
66
|
+
const find = config.all.find(t => t.name === name);
|
|
67
|
+
if (!find) {
|
|
68
|
+
log.error(`未找到 name '%s'`, name);
|
|
69
|
+
process.exit(1);
|
|
70
|
+
}
|
|
71
|
+
config.current = find;
|
|
72
|
+
}
|
|
73
|
+
config.current.plugins.forEach(plugin => plugin.apply(runner));
|
|
74
|
+
});
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
return plugin;
|
|
78
|
+
}
|
package/src/plugin/index.ts
CHANGED
package/src/plugin/release.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { execSync } from 'child_process';
|
|
2
2
|
|
|
3
3
|
import type { Plugin } from '../runner';
|
|
4
4
|
|
|
@@ -48,38 +48,27 @@ export function pluginRelease() {
|
|
|
48
48
|
log.success(`发布成功,${runner.duration}`);
|
|
49
49
|
|
|
50
50
|
log.info('同步版本');
|
|
51
|
+
let hasSync = false;
|
|
51
52
|
while (true) {
|
|
52
|
-
const res = await (
|
|
53
|
+
const res = await queryVersion(packageName);
|
|
53
54
|
const exist = Boolean(res?.versions?.[nextVersion]);
|
|
55
|
+
const latest = res?.['dist-tags']?.latest;
|
|
54
56
|
if (exist) {
|
|
55
57
|
log.debug(`同步版本存在`);
|
|
56
58
|
break;
|
|
57
59
|
}
|
|
58
|
-
log.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
'sec-fetch-mode': 'cors',
|
|
69
|
-
'sec-fetch-site': 'same-site',
|
|
70
|
-
Referer: 'https://npmmirror.com/',
|
|
71
|
-
'Referrer-Policy': 'strict-origin-when-cross-origin',
|
|
72
|
-
},
|
|
73
|
-
body: null,
|
|
74
|
-
method: 'PUT',
|
|
75
|
-
})
|
|
76
|
-
).json();
|
|
77
|
-
if (sync.ok === true) {
|
|
78
|
-
log.debug(`同步成功`);
|
|
79
|
-
} else {
|
|
80
|
-
log.debug(`同步失败,%j`, sync);
|
|
60
|
+
log.info(`同步版本 ${nextVersion} 不存在,最新版本为 ${latest}`);
|
|
61
|
+
if (!hasSync) {
|
|
62
|
+
log.debug(`开始同步`);
|
|
63
|
+
const sync = await syncVersion(packageName);
|
|
64
|
+
if (sync.ok === true) {
|
|
65
|
+
log.debug(`调用同步接口成功`);
|
|
66
|
+
hasSync = true;
|
|
67
|
+
} else {
|
|
68
|
+
log.debug(`调用同步接口失败,%j`, sync);
|
|
69
|
+
}
|
|
81
70
|
}
|
|
82
|
-
await new Promise(resolve => setTimeout(resolve,
|
|
71
|
+
await new Promise(resolve => setTimeout(resolve, 500));
|
|
83
72
|
}
|
|
84
73
|
log.success(`同步成功,${runner.duration}`);
|
|
85
74
|
});
|
|
@@ -87,3 +76,30 @@ export function pluginRelease() {
|
|
|
87
76
|
};
|
|
88
77
|
return plugin;
|
|
89
78
|
}
|
|
79
|
+
|
|
80
|
+
async function queryVersion(packageName: string) {
|
|
81
|
+
const res = await (await fetch(`https://registry.npmmirror.com/${packageName}`)).json();
|
|
82
|
+
return res;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
async function syncVersion(packageName: string) {
|
|
86
|
+
const sync = await (
|
|
87
|
+
await fetch(`https://registry-direct.npmmirror.com/-/package/${packageName}/syncs`, {
|
|
88
|
+
headers: {
|
|
89
|
+
accept: '*/*',
|
|
90
|
+
'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8',
|
|
91
|
+
'sec-ch-ua': '"Not_A Brand";v="8", "Chromium";v="120", "Google Chrome";v="120"',
|
|
92
|
+
'sec-ch-ua-mobile': '?0',
|
|
93
|
+
'sec-ch-ua-platform': '"Windows"',
|
|
94
|
+
'sec-fetch-dest': 'empty',
|
|
95
|
+
'sec-fetch-mode': 'cors',
|
|
96
|
+
'sec-fetch-site': 'same-site',
|
|
97
|
+
Referer: 'https://npmmirror.com/',
|
|
98
|
+
'Referrer-Policy': 'strict-origin-when-cross-origin',
|
|
99
|
+
},
|
|
100
|
+
body: null,
|
|
101
|
+
method: 'PUT',
|
|
102
|
+
})
|
|
103
|
+
).json();
|
|
104
|
+
return sync;
|
|
105
|
+
}
|
package/src/runner.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { ConsolaInstance } from 'consola';
|
|
2
|
-
import
|
|
2
|
+
import { colors } from 'consola/utils';
|
|
3
3
|
import { AsyncSeriesHook } from 'tapable';
|
|
4
4
|
import zod from 'zod';
|
|
5
5
|
|
|
6
6
|
import { createLogger } from './logger';
|
|
7
|
+
import { fs, glob } from './util';
|
|
7
8
|
|
|
8
9
|
export interface Config {
|
|
9
10
|
name: string;
|
|
@@ -37,10 +38,11 @@ export interface Runner {
|
|
|
37
38
|
package: any;
|
|
38
39
|
z: typeof zod;
|
|
39
40
|
fs: typeof import('fs-extra');
|
|
40
|
-
glob:
|
|
41
|
+
glob: typeof import('glob')['glob'];
|
|
41
42
|
tapable: typeof import('tapable');
|
|
42
43
|
duration: string;
|
|
43
44
|
tempDir: string;
|
|
45
|
+
clear: () => void;
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
export interface Plugin {
|
|
@@ -105,7 +107,7 @@ export function createRunner() {
|
|
|
105
107
|
},
|
|
106
108
|
package: {},
|
|
107
109
|
z: zod,
|
|
108
|
-
fs
|
|
110
|
+
fs,
|
|
109
111
|
glob: glob.glob,
|
|
110
112
|
tapable: require('tapable') as typeof import('tapable'),
|
|
111
113
|
get duration() {
|
|
@@ -113,6 +115,11 @@ export function createRunner() {
|
|
|
113
115
|
return `耗时 ${duration} s`;
|
|
114
116
|
},
|
|
115
117
|
tempDir: './node_modules/.temp/',
|
|
118
|
+
clear: () => {
|
|
119
|
+
console.clear();
|
|
120
|
+
process.stdout.write('\x1b[3J');
|
|
121
|
+
console.log(`${colors.bgBlue(' 项目名称 ')} ${runner.package.name} \n`);
|
|
122
|
+
},
|
|
116
123
|
};
|
|
117
124
|
|
|
118
125
|
return runner;
|
package/src/sync.ts
CHANGED
|
@@ -26,12 +26,12 @@ const list = [
|
|
|
26
26
|
'@rife/config', //
|
|
27
27
|
'@rife/cli', //
|
|
28
28
|
// '@rife/infra',
|
|
29
|
-
'@rife/logger',
|
|
29
|
+
// '@rife/logger',
|
|
30
30
|
// '@rife/react',
|
|
31
31
|
// '@rife/next',
|
|
32
32
|
// '@rife/nest',
|
|
33
|
-
'@rife/plugin-deploy',
|
|
34
|
-
'@rife/fast',
|
|
33
|
+
// '@rife/plugin-deploy',
|
|
34
|
+
// '@rife/fast',
|
|
35
35
|
];
|
|
36
36
|
|
|
37
37
|
async function main() {
|
package/src/util.ts
ADDED