vona-cli-set-api 1.0.66 → 1.0.69
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/cli/templates/create/project/basic/boilerplate/eslint.config.mjs +1 -0
- package/cli/templates/create/project/basic/boilerplate/package.original.json +1 -1
- package/dist/lib/bean/cli.bin.build.js +6 -3
- package/dist/lib/bean/cli.bin.demo.d.ts +1 -0
- package/dist/lib/bean/cli.bin.demo.js +1 -1
- package/dist/lib/bean/cli.bin.test.d.ts +1 -0
- package/dist/lib/bean/cli.bin.test.js +17 -0
- package/dist/lib/bean/toolsBin/test.js +4 -4
- package/dist/lib/command/bin.demo.d.ts +4 -0
- package/dist/lib/command/bin.demo.js +5 -1
- package/dist/lib/commands.d.ts +4 -0
- package/package.json +3 -2
|
@@ -91,6 +91,9 @@ export class CliBinBuild extends BeanCliBase {
|
|
|
91
91
|
const replaceValues = generateConfigDefine(env, ['NODE_ENV', 'META_MODE', 'META_FLAVOR']);
|
|
92
92
|
const babelPluginZovaBeanModule = getAbsolutePathOfModule('babel-plugin-zova-bean-module', '');
|
|
93
93
|
const babelPluginTransformTypescriptMetadata = getAbsolutePathOfModule('babel-plugin-transform-typescript-metadata', '');
|
|
94
|
+
const babelPluginProposalDecorators = getAbsolutePathOfModule('@babel/plugin-proposal-decorators', '');
|
|
95
|
+
const babelPluginTransformClassProperties = getAbsolutePathOfModule('@babel/plugin-transform-class-properties', '');
|
|
96
|
+
const babelPluginTransformTypescript = getAbsolutePathOfModule('@babel/plugin-transform-typescript', '');
|
|
94
97
|
const plugins = [
|
|
95
98
|
alias({
|
|
96
99
|
entries: aliasEntries,
|
|
@@ -114,9 +117,9 @@ export class CliBinBuild extends BeanCliBase {
|
|
|
114
117
|
plugins: [
|
|
115
118
|
[babelPluginZovaBeanModule, { brandName: 'vona' }],
|
|
116
119
|
[babelPluginTransformTypescriptMetadata],
|
|
117
|
-
[
|
|
118
|
-
[
|
|
119
|
-
[
|
|
120
|
+
[babelPluginProposalDecorators, { version: 'legacy' }],
|
|
121
|
+
[babelPluginTransformClassProperties, { loose: true }],
|
|
122
|
+
[babelPluginTransformTypescript],
|
|
120
123
|
],
|
|
121
124
|
}),
|
|
122
125
|
];
|
|
@@ -16,7 +16,7 @@ export class CliBinDemo extends BeanCliBase {
|
|
|
16
16
|
const mode = 'local';
|
|
17
17
|
const flavor = argv.flavor || 'normal';
|
|
18
18
|
const configMeta = { flavor, mode };
|
|
19
|
-
if (!fse.existsSync(path.join(projectPath, '.vona'))) {
|
|
19
|
+
if (!argv.retainRuntime || !fse.existsSync(path.join(projectPath, '.vona'))) {
|
|
20
20
|
const configOptions = {
|
|
21
21
|
appDir: projectPath,
|
|
22
22
|
runtimeDir: '.vona',
|
|
@@ -11,5 +11,6 @@ export declare class CliBinTest extends BeanCliBase {
|
|
|
11
11
|
execute(): Promise<void>;
|
|
12
12
|
_test(projectPath: string): Promise<void>;
|
|
13
13
|
_run(projectPath: string, modulesMeta: Awaited<ReturnType<typeof glob>>): Promise<void>;
|
|
14
|
+
_outputCoverageReportViewer(projectPath: string): Promise<void>;
|
|
14
15
|
_combineTestPatterns(projectPath: string, modulesMeta: Awaited<ReturnType<typeof glob>>): string[];
|
|
15
16
|
}
|
|
@@ -2,6 +2,7 @@ import path from 'node:path';
|
|
|
2
2
|
import { BeanCliBase } from '@cabloy/cli';
|
|
3
3
|
import fse from 'fs-extra';
|
|
4
4
|
import { rimraf } from 'rimraf';
|
|
5
|
+
import { getAbsolutePathOfModule } from "../utils.js";
|
|
5
6
|
import { generateVonaMeta } from "./toolsBin/generateVonaMeta.js";
|
|
6
7
|
export class CliBinTest extends BeanCliBase {
|
|
7
8
|
async execute() {
|
|
@@ -24,6 +25,9 @@ export class CliBinTest extends BeanCliBase {
|
|
|
24
25
|
};
|
|
25
26
|
const { modulesMeta } = await generateVonaMeta(configMeta, configOptions);
|
|
26
27
|
await this._run(projectPath, modulesMeta);
|
|
28
|
+
if (argv.coverage) {
|
|
29
|
+
await this._outputCoverageReportViewer(projectPath);
|
|
30
|
+
}
|
|
27
31
|
await rimraf(path.join(projectPath, '.vona'));
|
|
28
32
|
}
|
|
29
33
|
async _run(projectPath, modulesMeta) {
|
|
@@ -52,6 +56,19 @@ export class CliBinTest extends BeanCliBase {
|
|
|
52
56
|
},
|
|
53
57
|
});
|
|
54
58
|
}
|
|
59
|
+
async _outputCoverageReportViewer(projectPath) {
|
|
60
|
+
// lcovCliFile
|
|
61
|
+
const lcovCliFile = getAbsolutePathOfModule('@lcov-viewer/cli/lib/index.js', '');
|
|
62
|
+
// run
|
|
63
|
+
const args = [lcovCliFile, 'lcov', '-o', './coverage/report', './coverage/lcov.info'];
|
|
64
|
+
await this.helper.spawnExe({
|
|
65
|
+
cmd: 'node',
|
|
66
|
+
args,
|
|
67
|
+
options: {
|
|
68
|
+
cwd: projectPath,
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
}
|
|
55
72
|
_combineTestPatterns(projectPath, modulesMeta) {
|
|
56
73
|
const patterns = [];
|
|
57
74
|
for (const moduleName in modulesMeta.modules) {
|
|
@@ -2,7 +2,7 @@ import { createWriteStream } from 'node:fs';
|
|
|
2
2
|
import os from 'node:os';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { run } from 'node:test';
|
|
5
|
-
import { lcov,
|
|
5
|
+
import { lcov, spec } from 'node:test/reporters';
|
|
6
6
|
import { sleep } from '@cabloy/utils';
|
|
7
7
|
import TableClass from 'cli-table3';
|
|
8
8
|
import fse from 'fs-extra';
|
|
@@ -96,12 +96,12 @@ async function testRun(projectPath, coverage, patterns) {
|
|
|
96
96
|
if (coverage) {
|
|
97
97
|
const reporterDir = path.join(projectPath, 'coverage');
|
|
98
98
|
fse.ensureDirSync(reporterDir);
|
|
99
|
-
const
|
|
99
|
+
const reporterLcov = createWriteStream(path.join(reporterDir, 'lcov.info'));
|
|
100
100
|
testStream.compose(lcov)
|
|
101
|
-
.pipe(
|
|
101
|
+
.pipe(reporterLcov);
|
|
102
102
|
}
|
|
103
103
|
else {
|
|
104
|
-
testStream.compose(
|
|
104
|
+
testStream.compose(spec)
|
|
105
105
|
.pipe(process.stdout);
|
|
106
106
|
}
|
|
107
107
|
});
|
|
@@ -3,12 +3,16 @@ export default {
|
|
|
3
3
|
info: {
|
|
4
4
|
version: '5.0.0',
|
|
5
5
|
title: 'Cli: Bin: Demo',
|
|
6
|
-
usage: 'vona :bin:demo [index.ts] [--flavor=]',
|
|
6
|
+
usage: 'vona :bin:demo [index.ts] [--flavor=] [--retainRuntime=]',
|
|
7
7
|
},
|
|
8
8
|
options: {
|
|
9
9
|
flavor: {
|
|
10
10
|
description: 'flavor',
|
|
11
11
|
type: 'string',
|
|
12
12
|
},
|
|
13
|
+
retainRuntime: {
|
|
14
|
+
description: 'retainRuntime',
|
|
15
|
+
type: 'boolean',
|
|
16
|
+
},
|
|
13
17
|
},
|
|
14
18
|
};
|
package/dist/lib/commands.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-cli-set-api",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.69",
|
|
5
5
|
"description": "vona cli-set-api",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"@cabloy/module-glob": "^5.2.12",
|
|
38
38
|
"@cabloy/module-info": "^1.3.19",
|
|
39
39
|
"@cabloy/word-utils": "^2.0.1",
|
|
40
|
+
"@lcov-viewer/cli": "^1.3.0",
|
|
40
41
|
"@rollup/plugin-alias": "^5.1.1",
|
|
41
42
|
"@rollup/plugin-babel": "^6.0.4",
|
|
42
43
|
"@rollup/plugin-commonjs": "^28.0.2",
|
|
@@ -60,7 +61,7 @@
|
|
|
60
61
|
"ts-node": "^10.9.2",
|
|
61
62
|
"urllib": "^4.6.11",
|
|
62
63
|
"uuid": "^11.1.0",
|
|
63
|
-
"vona-core": "^5.0.
|
|
64
|
+
"vona-core": "^5.0.22",
|
|
64
65
|
"why-is-node-running": "^3.2.2",
|
|
65
66
|
"yargs-parser": "^21.1.1"
|
|
66
67
|
},
|