vona-cli-set-api 1.0.52 → 1.0.55

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.
@@ -27,6 +27,7 @@ LOGGER_CLIENT_DEFAULT =
27
27
 
28
28
  # build
29
29
 
30
+ BUILD_OUTDIR =
30
31
  BUILD_SOURCEMAP = false
31
32
  BUILD_MINIFY = true
32
33
  BUILD_INLINEDYNAMICIMPORTS = true
@@ -32,8 +32,10 @@
32
32
  "cov": "npm run prerun && npm run vona :bin:test -- --coverage --flavor=normal",
33
33
  "tsc": "npm run prerun && npm run vona :bin:tsc",
34
34
  "build": "npm run prerun && npm run vona :bin:build -- --flavor=normal",
35
- "start": "node ./dist/bootstrap.js",
36
- "start:one": "cross-env SERVER_WORKERS=1 node ./dist/bootstrap.js",
35
+ "build:docker": "npm run prerun && npm run vona :bin:build -- --flavor=docker",
36
+ "start": "node ./dist/normal/bootstrap.js",
37
+ "start:one": "cross-env SERVER_WORKERS=1 node ./dist/normal/bootstrap.js",
38
+ "start:docker": "cross-env SERVER_WORKERS=1 node ./dist/docker/bootstrap.js",
37
39
  "prerun": "npm run vona :tools:deps",
38
40
  "lint": "eslint",
39
41
  "lint:fix": "eslint --fix"
@@ -44,7 +46,7 @@
44
46
  }
45
47
  },
46
48
  "dependencies": {
47
- "vona": "^5.0.30"
49
+ "vona": "^5.0.31"
48
50
  },
49
51
  "devDependencies": {
50
52
  "@cabloy/lint": "^5.0.16",
@@ -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(projectPath: string, modulesMeta: Awaited<ReturnType<typeof glob>>): Promise<void>;
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
- await rimraf(path.join(projectPath, 'dist'));
43
- await this._rollup(projectPath, env);
44
- await this._assets(projectPath, modulesMeta);
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(projectPath, modulesMeta) {
48
- const assetsPath = path.join(projectPath, 'dist/assets');
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: path.join(projectPath, 'dist'),
125
+ dir: outDir,
121
126
  // file: path.join(projectPath, 'dist/index.js'),
122
127
  format: 'esm',
123
128
  sourcemap: process.env.BUILD_SOURCEMAP === 'true',
@@ -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.52",
4
+ "version": "1.0.55",
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.28",
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",