vona-cli-set-api 1.0.51 → 1.0.54
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/env/.env +1 -0
- package/cli/templates/create/project/basic/boilerplate/package.original.json +1 -1
- package/dist/lib/bean/cli.bin.build.d.ts +2 -2
- package/dist/lib/bean/cli.bin.build.js +13 -8
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +6 -0
- package/package.json +2 -2
|
@@ -10,6 +10,6 @@ declare module '@cabloy/cli' {
|
|
|
10
10
|
export declare class CliBinBuild extends BeanCliBase {
|
|
11
11
|
execute(): Promise<void>;
|
|
12
12
|
_build(projectPath: string): Promise<void>;
|
|
13
|
-
_assets(
|
|
14
|
-
_rollup(projectPath: string, env: NodeJS.ProcessEnv): Promise<void>;
|
|
13
|
+
_assets(_projectPath: string, modulesMeta: Awaited<ReturnType<typeof glob>>, outDir: string): Promise<void>;
|
|
14
|
+
_rollup(projectPath: string, env: NodeJS.ProcessEnv, outDir: string): Promise<void>;
|
|
15
15
|
}
|
|
@@ -10,7 +10,7 @@ import terserImport from '@rollup/plugin-terser';
|
|
|
10
10
|
import fse from 'fs-extra';
|
|
11
11
|
import { rimraf } from 'rimraf';
|
|
12
12
|
import { rollup } from 'rollup';
|
|
13
|
-
import { generateConfigDefine } from "../utils.js";
|
|
13
|
+
import { generateConfigDefine, getOutDir, getOutReleasesDir } from "../utils.js";
|
|
14
14
|
import { generateVonaMeta } from "./toolsBin/generateVonaMeta.js";
|
|
15
15
|
const commonjs = commonjsImport;
|
|
16
16
|
const resolve = resolveImport;
|
|
@@ -39,13 +39,18 @@ export class CliBinBuild extends BeanCliBase {
|
|
|
39
39
|
workers: argv.workers,
|
|
40
40
|
};
|
|
41
41
|
const { env, modulesMeta } = await generateVonaMeta(configMeta, configOptions);
|
|
42
|
-
|
|
43
|
-
await
|
|
44
|
-
await this.
|
|
42
|
+
const outDir = path.join(projectPath, getOutDir());
|
|
43
|
+
await rimraf(outDir);
|
|
44
|
+
await this._rollup(projectPath, env, outDir);
|
|
45
|
+
await this._assets(projectPath, modulesMeta, outDir);
|
|
45
46
|
await rimraf(path.join(projectPath, '.vona'));
|
|
47
|
+
// copy
|
|
48
|
+
const outReleasesDir = path.join(projectPath, getOutReleasesDir());
|
|
49
|
+
await rimraf(outReleasesDir);
|
|
50
|
+
fse.copySync(outDir, outReleasesDir);
|
|
46
51
|
}
|
|
47
|
-
async _assets(
|
|
48
|
-
const assetsPath = path.join(
|
|
52
|
+
async _assets(_projectPath, modulesMeta, outDir) {
|
|
53
|
+
const assetsPath = path.join(outDir, 'assets');
|
|
49
54
|
for (const relativeName in modulesMeta.modules) {
|
|
50
55
|
const module = modulesMeta.modules[relativeName];
|
|
51
56
|
if (!module.package.files)
|
|
@@ -61,7 +66,7 @@ export class CliBinBuild extends BeanCliBase {
|
|
|
61
66
|
}
|
|
62
67
|
}
|
|
63
68
|
}
|
|
64
|
-
async _rollup(projectPath, env) {
|
|
69
|
+
async _rollup(projectPath, env, outDir) {
|
|
65
70
|
const aliasEntries = [];
|
|
66
71
|
for (const name of ['better-sqlite3', 'mysql', 'oracledb', 'pg-native', 'pg-query-stream', 'sqlite3', 'tedious', 'cloudflare:sockets']) {
|
|
67
72
|
aliasEntries.push({ find: name, replacement: 'vona-shared' });
|
|
@@ -117,7 +122,7 @@ export class CliBinBuild extends BeanCliBase {
|
|
|
117
122
|
},
|
|
118
123
|
};
|
|
119
124
|
const outputOption = {
|
|
120
|
-
dir:
|
|
125
|
+
dir: outDir,
|
|
121
126
|
// file: path.join(projectPath, 'dist/index.js'),
|
|
122
127
|
format: 'esm',
|
|
123
128
|
sourcemap: process.env.BUILD_SOURCEMAP === 'true',
|
package/dist/lib/utils.d.ts
CHANGED
|
@@ -13,3 +13,5 @@ export declare function copyTemplateFile(fileSrc: URL | string, fileDest: string
|
|
|
13
13
|
export declare function loadJSONFile(fileName: string): Promise<any>;
|
|
14
14
|
export declare function saveJSONFile(fileName: string, json: object): Promise<void>;
|
|
15
15
|
export declare function pathToHref(fileName: string): string;
|
|
16
|
+
export declare function getOutDir(): string;
|
|
17
|
+
export declare function getOutReleasesDir(): string;
|
package/dist/lib/utils.js
CHANGED
|
@@ -61,3 +61,9 @@ export async function saveJSONFile(fileName, json) {
|
|
|
61
61
|
export function pathToHref(fileName) {
|
|
62
62
|
return pathToFileURL(fileName).href;
|
|
63
63
|
}
|
|
64
|
+
export function getOutDir() {
|
|
65
|
+
return process.env.BUILD_OUTDIR || `dist/${process.env.META_FLAVOR}`;
|
|
66
|
+
}
|
|
67
|
+
export function getOutReleasesDir() {
|
|
68
|
+
return `dist-releases/${process.env.META_FLAVOR}-${process.env.APP_VERSION}`;
|
|
69
|
+
}
|
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.54",
|
|
5
5
|
"description": "vona cli-set-api",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@babel/plugin-proposal-decorators": "^7.25.9",
|
|
32
32
|
"@babel/plugin-transform-class-properties": "^7.25.9",
|
|
33
33
|
"@babel/plugin-transform-typescript": "^7.26.8",
|
|
34
|
-
"@cabloy/cli": "^3.0.
|
|
34
|
+
"@cabloy/cli": "^3.0.29",
|
|
35
35
|
"@cabloy/dotenv": "^1.1.10",
|
|
36
36
|
"@cabloy/extend": "^3.1.10",
|
|
37
37
|
"@cabloy/module-glob": "^5.2.12",
|