cabloy 5.1.16 → 5.1.20
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/{vona/.github/workflows/actions-cov-pg.yml → .github/workflows/vona-cov-pg.yml} +7 -9
- package/{vona/.github/workflows/project-test.yml → .github/workflows/vona-test-crud.yml} +12 -12
- package/{vona/.github/workflows/actions-test-mysql.yml → .github/workflows/vona-test-mysql.yml} +6 -3
- package/{vona/.github/workflows/actions-test-pg.yml → .github/workflows/vona-test-pg.yml} +6 -3
- package/{vona/.github/workflows/actions-test-sqlite3.yml → .github/workflows/vona-test-sqlite3.yml} +6 -3
- package/{vona/.github/workflows/actions-tsc.yml → .github/workflows/vona-tsc.yml} +6 -4
- package/.github/workflows/zova-ui.yml +39 -0
- package/package.json +5 -1
- package/scripts/init.ts +29 -6
- package/vona/docker-compose-original/docker-compose.original.yml +51 -0
- package/vona/env/.env.prod.docker +4 -1
- package/vona/packages-cli/cabloy-cli/package.json +1 -1
- package/vona/packages-cli/cabloy-cli/src/start.ts +7 -10
- package/vona/packages-cli/cabloy-cli/src/utils.ts +8 -0
- package/vona/packages-cli/cli/package.json +2 -1
- package/vona/packages-cli/cli/src/bin/vona.ts +15 -4
- package/vona/packages-cli/cli-set-api/package.json +1 -1
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.bin.test.ts +10 -1
- package/vona/packages-vona/vona/package.json +1 -1
- package/vona/pnpm-lock.yaml +9 -0
- package/vona/src/suite-vendor/a-vona/modules/a-core/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/test-vona/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/mail.test.ts +1 -1
- package/vona/src/suite-vendor/a-vona/package.json +1 -1
- package/zova/packages-cli/cli/package.json +3 -3
- package/zova/packages-cli/cli-set-front/package.json +2 -2
- package/zova/packages-zova/zova/package.json +2 -2
- package/zova/pnpm-lock.yaml +14 -14
- package/zova/src/suite-vendor/a-zova/modules/a-zova/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/package.json +2 -2
- package/vona/.github/workflows/docs-deploy.yml +0 -70
- package/vona/.vscode/extensions.json +0 -4
- package/vona/.vscode/settings.json +0 -52
- package/vona/.vscode/vona.code-snippets +0 -207
- package/vona/docker-compose.original.yml +0 -88
- package/zova/.github/workflows/actions-dev.yml +0 -24
- package/zova/.github/workflows/actions-ui.yml +0 -45
- package/zova/.github/workflows/deploy.yml +0 -72
- package/zova/.vscode/extensions.json +0 -9
- package/zova/.vscode/settings.json +0 -44
- package/zova/.vscode/zova.code-snippets +0 -227
- /package/vona/{docker-compose-dockerfile-app → docker-compose-original/docker-compose-dockerfile-app} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
name:
|
|
1
|
+
name: vona-cov-pg
|
|
2
2
|
on:
|
|
3
3
|
push:
|
|
4
4
|
branches:
|
|
@@ -30,16 +30,14 @@ jobs:
|
|
|
30
30
|
- uses: pnpm/action-setup@v5
|
|
31
31
|
with:
|
|
32
32
|
version: 10.19.0
|
|
33
|
-
-
|
|
34
|
-
|
|
35
|
-
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
max_attempts: 10
|
|
39
|
-
command: |
|
|
40
|
-
DATABASE_DEFAULT_CLIENT=pg npm run cov -- --ci
|
|
33
|
+
- name: init
|
|
34
|
+
run: npm run init
|
|
35
|
+
- name: cov
|
|
36
|
+
run: DATABASE_DEFAULT_CLIENT=pg npm run cov -- --ci
|
|
37
|
+
working-directory: vona
|
|
41
38
|
- name: Upload coverage to Codecov
|
|
42
39
|
uses: codecov/codecov-action@v6
|
|
43
40
|
with:
|
|
44
41
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
42
|
+
directory: vona
|
|
45
43
|
verbose: true
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
name:
|
|
1
|
+
name: vona-test-crud
|
|
2
2
|
on:
|
|
3
3
|
push:
|
|
4
4
|
branches:
|
|
@@ -23,17 +23,17 @@ jobs:
|
|
|
23
23
|
- uses: pnpm/action-setup@v5
|
|
24
24
|
with:
|
|
25
25
|
version: 10.19.0
|
|
26
|
-
-
|
|
27
|
-
|
|
28
|
-
- run: vona :create:module demo-student --suite --ci
|
|
29
|
-
working-directory: vona
|
|
30
|
-
- run:
|
|
31
|
-
working-directory: vona
|
|
32
|
-
- run: vona :tools:crud student --module=demo-student
|
|
33
|
-
working-directory: vona
|
|
26
|
+
- name: init
|
|
27
|
+
run: npm run init
|
|
28
|
+
- run: npm run vona :create:module demo-student -- --suite --ci
|
|
29
|
+
working-directory: vona
|
|
30
|
+
- run: npm run vona :tools:deps
|
|
31
|
+
working-directory: vona
|
|
32
|
+
- run: npm run vona :tools:crud student -- --module=demo-student
|
|
33
|
+
working-directory: vona
|
|
34
34
|
- run: npm run test
|
|
35
|
-
working-directory: vona
|
|
35
|
+
working-directory: vona
|
|
36
36
|
- run: npm run build -- --flavor=ci
|
|
37
|
-
working-directory: vona
|
|
37
|
+
working-directory: vona
|
|
38
38
|
- run: npm run play -- --mode=prod --flavor=ci
|
|
39
|
-
working-directory: vona
|
|
39
|
+
working-directory: vona
|
package/{vona/.github/workflows/actions-test-mysql.yml → .github/workflows/vona-test-mysql.yml}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
name:
|
|
1
|
+
name: vona-test-mysql
|
|
2
2
|
on:
|
|
3
3
|
push:
|
|
4
4
|
branches:
|
|
@@ -30,8 +30,11 @@ jobs:
|
|
|
30
30
|
- uses: pnpm/action-setup@v5
|
|
31
31
|
with:
|
|
32
32
|
version: 10.19.0
|
|
33
|
-
-
|
|
34
|
-
|
|
33
|
+
- name: init
|
|
34
|
+
run: npm run init
|
|
35
35
|
- run: DATABASE_DEFAULT_CLIENT=mysql DATABASE_CLIENT_MYSQL_HOST=127.0.0.1 DATABASE_CLIENT_MYSQL_PASSWORD=root npm run test
|
|
36
|
+
working-directory: vona
|
|
36
37
|
- run: DATABASE_DEFAULT_CLIENT=mysql DATABASE_CLIENT_MYSQL_HOST=127.0.0.1 DATABASE_CLIENT_MYSQL_PASSWORD=root npm run build -- --flavor=ci
|
|
38
|
+
working-directory: vona
|
|
37
39
|
- run: DATABASE_DEFAULT_CLIENT=mysql DATABASE_CLIENT_MYSQL_HOST=127.0.0.1 DATABASE_CLIENT_MYSQL_PASSWORD=root npm run play -- --mode=prod --flavor=ci
|
|
40
|
+
working-directory: vona
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
name:
|
|
1
|
+
name: vona-test-pg
|
|
2
2
|
on:
|
|
3
3
|
push:
|
|
4
4
|
branches:
|
|
@@ -30,8 +30,11 @@ jobs:
|
|
|
30
30
|
- uses: pnpm/action-setup@v5
|
|
31
31
|
with:
|
|
32
32
|
version: 10.19.0
|
|
33
|
-
-
|
|
34
|
-
|
|
33
|
+
- name: init
|
|
34
|
+
run: npm run init
|
|
35
35
|
- run: DATABASE_DEFAULT_CLIENT=pg npm run test
|
|
36
|
+
working-directory: vona
|
|
36
37
|
- run: DATABASE_DEFAULT_CLIENT=pg npm run build -- --flavor=ci
|
|
38
|
+
working-directory: vona
|
|
37
39
|
- run: DATABASE_DEFAULT_CLIENT=pg npm run play -- --mode=prod --flavor=ci
|
|
40
|
+
working-directory: vona
|
package/{vona/.github/workflows/actions-test-sqlite3.yml → .github/workflows/vona-test-sqlite3.yml}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
name:
|
|
1
|
+
name: vona-test-sqlite3
|
|
2
2
|
on:
|
|
3
3
|
push:
|
|
4
4
|
branches:
|
|
@@ -23,8 +23,11 @@ jobs:
|
|
|
23
23
|
- uses: pnpm/action-setup@v5
|
|
24
24
|
with:
|
|
25
25
|
version: 10.19.0
|
|
26
|
-
-
|
|
27
|
-
|
|
26
|
+
- name: init
|
|
27
|
+
run: npm run init
|
|
28
28
|
- run: DATABASE_DEFAULT_CLIENT=sqlite3 npm run test
|
|
29
|
+
working-directory: vona
|
|
29
30
|
- run: DATABASE_DEFAULT_CLIENT=sqlite3 npm run build -- --flavor=ci
|
|
31
|
+
working-directory: vona
|
|
30
32
|
- run: DATABASE_DEFAULT_CLIENT=sqlite3 npm run play -- --mode=prod --flavor=ci
|
|
33
|
+
working-directory: vona
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
name:
|
|
1
|
+
name: vona-tsc
|
|
2
2
|
on:
|
|
3
3
|
push:
|
|
4
4
|
branches:
|
|
@@ -18,6 +18,8 @@ jobs:
|
|
|
18
18
|
- uses: pnpm/action-setup@v5
|
|
19
19
|
with:
|
|
20
20
|
version: 10.19.0
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
-
|
|
21
|
+
- name: init
|
|
22
|
+
run: npm run init
|
|
23
|
+
- name: tsc
|
|
24
|
+
run: npm run tsc
|
|
25
|
+
working-directory: vona
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
name: zova-ui
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches:
|
|
5
|
+
- main
|
|
6
|
+
jobs:
|
|
7
|
+
unittest:
|
|
8
|
+
strategy:
|
|
9
|
+
fail-fast: false
|
|
10
|
+
matrix:
|
|
11
|
+
node-version: [24]
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v6
|
|
15
|
+
- uses: actions/setup-node@v6
|
|
16
|
+
with:
|
|
17
|
+
node-version: ${{ matrix.node-version }}
|
|
18
|
+
- uses: pnpm/action-setup@v5
|
|
19
|
+
with:
|
|
20
|
+
version: 10.19.0
|
|
21
|
+
- name: init
|
|
22
|
+
run: npm run init
|
|
23
|
+
- name: suite
|
|
24
|
+
run: npm run zova :create:suite test-demo
|
|
25
|
+
working-directory: zova
|
|
26
|
+
- name: module
|
|
27
|
+
run: npm run zova :create:module test-demo -- --suite=test-demo --ci
|
|
28
|
+
working-directory: zova
|
|
29
|
+
- run: npm run zova :tools:deps
|
|
30
|
+
working-directory: zova
|
|
31
|
+
- name: page
|
|
32
|
+
run: npm run zova :create:page first -- --module=test-demo
|
|
33
|
+
working-directory: zova
|
|
34
|
+
- name: component
|
|
35
|
+
run: npm run zova :create:component child -- --module=test-demo
|
|
36
|
+
working-directory: zova
|
|
37
|
+
- name: npm run build
|
|
38
|
+
run: npm run build
|
|
39
|
+
working-directory: zova
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cabloy",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.20",
|
|
4
4
|
"description": "A Node.js fullstack framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cabloy",
|
|
@@ -23,7 +23,11 @@
|
|
|
23
23
|
"init": "pnpm install --no-frozen-lockfile && node scripts/init.ts",
|
|
24
24
|
"upgrade": "node scripts/upgrade.ts",
|
|
25
25
|
"upgrade:dry-run": "node scripts/upgrade.ts --dry-run",
|
|
26
|
+
"vona": "node ./vona/packages-cli/cli/src/bin/vona.ts --projectPath=vona",
|
|
27
|
+
"zova": "node ./zova/packages-cli/cli/src/bin/zova.ts --projectPath=zova",
|
|
26
28
|
"dev": "cd vona && npm run dev",
|
|
29
|
+
"dev:zova:admin": "cd zova && npm run dev:ssr:cabloyBasicAdmin",
|
|
30
|
+
"dev:zova:web": "cd zova && npm run dev:ssr:cabloyBasicWeb",
|
|
27
31
|
"build": "pnpm --dir zova run build:ssr:cabloyBasicBatch && pnpm --dir vona run build",
|
|
28
32
|
"build:docker": "pnpm --dir zova run build:ssr:cabloyBasicBatch && pnpm --dir vona run build:docker",
|
|
29
33
|
"start": "cd vona && npm run start",
|
package/scripts/init.ts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { execSync } from 'node:child_process';
|
|
2
2
|
import { randomBytes, randomInt, randomUUID } from 'node:crypto';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
copyFileSync,
|
|
5
|
+
cpSync,
|
|
6
|
+
existsSync,
|
|
7
|
+
readdirSync,
|
|
8
|
+
readFileSync,
|
|
9
|
+
rmSync,
|
|
10
|
+
writeFileSync,
|
|
11
|
+
} from 'node:fs';
|
|
4
12
|
import { basename } from 'node:path';
|
|
5
13
|
import { dirname, resolve } from 'node:path';
|
|
6
14
|
import { fileURLToPath } from 'node:url';
|
|
@@ -28,6 +36,17 @@ function exec(cmd: string): void {
|
|
|
28
36
|
execSync(cmd, { stdio: 'inherit', cwd: ROOT_DIR });
|
|
29
37
|
}
|
|
30
38
|
|
|
39
|
+
function deleteGitkeepFiles(dir: string): void {
|
|
40
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
41
|
+
const fullPath = resolve(dir, entry.name);
|
|
42
|
+
if (entry.isDirectory()) {
|
|
43
|
+
deleteGitkeepFiles(fullPath);
|
|
44
|
+
} else if (entry.name === '.gitkeep') {
|
|
45
|
+
rmSync(fullPath);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
31
50
|
// --- Step 0: Set APP_NAME in .env files ---
|
|
32
51
|
|
|
33
52
|
function setAppName(): void {
|
|
@@ -63,7 +82,6 @@ function generateEnvProdLocal(): void {
|
|
|
63
82
|
|
|
64
83
|
function generateEnvProdDockerLocal(): void {
|
|
65
84
|
const envFilePath = resolve(ROOT_DIR, 'vona/env/.env.prod.docker.local');
|
|
66
|
-
const composeFilePath = resolve(ROOT_DIR, 'vona/docker-compose.yml');
|
|
67
85
|
if (existsSync(envFilePath)) {
|
|
68
86
|
// eslint-disable-next-line
|
|
69
87
|
console.log('[init] vona/env/.env.prod.docker.local already exists, skipping');
|
|
@@ -87,8 +105,9 @@ function generateEnvProdDockerLocal(): void {
|
|
|
87
105
|
if (!existsSync(composeDirTarget)) {
|
|
88
106
|
cpSync(composeDirOriginal, composeDirTarget, {
|
|
89
107
|
recursive: true,
|
|
90
|
-
filter: src => !src.includes('.DS_Store'),
|
|
108
|
+
filter: src => !src.includes('.DS_Store') && !src.endsWith('docker-compose.original.yml'),
|
|
91
109
|
});
|
|
110
|
+
deleteGitkeepFiles(composeDirTarget);
|
|
92
111
|
// eslint-disable-next-line
|
|
93
112
|
console.log('[init] Generated vona/docker-compose directory');
|
|
94
113
|
} else {
|
|
@@ -96,8 +115,12 @@ function generateEnvProdDockerLocal(): void {
|
|
|
96
115
|
console.log('[init] vona/docker-compose directory already exists, skipping');
|
|
97
116
|
}
|
|
98
117
|
|
|
99
|
-
// Generate docker-compose.yml from
|
|
100
|
-
const composeOriginalPath = resolve(
|
|
118
|
+
// Generate docker-compose.yml from template
|
|
119
|
+
const composeOriginalPath = resolve(
|
|
120
|
+
ROOT_DIR,
|
|
121
|
+
'vona/docker-compose-original/docker-compose.original.yml',
|
|
122
|
+
);
|
|
123
|
+
const composeFilePath = resolve(ROOT_DIR, 'vona/docker-compose/docker-compose.yml');
|
|
101
124
|
let composeContent = readFileSync(composeOriginalPath, 'utf-8');
|
|
102
125
|
composeContent = composeContent.replace(
|
|
103
126
|
/POSTGRES_PASSWORD:\s*'<placeholder>'/,
|
|
@@ -113,7 +136,7 @@ function generateEnvProdDockerLocal(): void {
|
|
|
113
136
|
);
|
|
114
137
|
writeFileSync(composeFilePath, composeContent);
|
|
115
138
|
// eslint-disable-next-line
|
|
116
|
-
console.log('[init] Generated vona/docker-compose.yml');
|
|
139
|
+
console.log('[init] Generated vona/docker-compose/docker-compose.yml');
|
|
117
140
|
}
|
|
118
141
|
|
|
119
142
|
// --- Step C: init:vona ---
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
services:
|
|
2
|
+
app:
|
|
3
|
+
depends_on:
|
|
4
|
+
- pg
|
|
5
|
+
- redis
|
|
6
|
+
build:
|
|
7
|
+
context: ..
|
|
8
|
+
dockerfile: docker-compose/docker-compose-dockerfile-app
|
|
9
|
+
restart: always
|
|
10
|
+
ports:
|
|
11
|
+
- '7202:7102'
|
|
12
|
+
volumes:
|
|
13
|
+
- ./output/dist/docker:/opt/node/app/dist/docker
|
|
14
|
+
- ./output/app/.vona:/root/.vona
|
|
15
|
+
command: [./scripts/wait-for-it.sh, 'pg:5432', 'redis:6379', -s, --, ./scripts/app-init.sh]
|
|
16
|
+
|
|
17
|
+
nginx:
|
|
18
|
+
image: nginx:latest
|
|
19
|
+
depends_on:
|
|
20
|
+
- app
|
|
21
|
+
restart: always
|
|
22
|
+
ports:
|
|
23
|
+
- '80:80'
|
|
24
|
+
volumes:
|
|
25
|
+
- ./output/app/.vona:/usr/share/nginx/app/.vona
|
|
26
|
+
- ./logs/nginx:/var/log/nginx
|
|
27
|
+
- ./config/nginx/conf.d:/etc/nginx/conf.d
|
|
28
|
+
|
|
29
|
+
pg:
|
|
30
|
+
image: postgres:17
|
|
31
|
+
restart: always
|
|
32
|
+
ports:
|
|
33
|
+
- '35432:5432'
|
|
34
|
+
# set shared memory limit when using docker compose
|
|
35
|
+
shm_size: 128mb
|
|
36
|
+
# or set shared memory limit when deploy via swarm stack
|
|
37
|
+
volumes:
|
|
38
|
+
- ./data/pg:/var/lib/postgresql/data
|
|
39
|
+
environment:
|
|
40
|
+
POSTGRES_DB: vona
|
|
41
|
+
POSTGRES_USER: postgres
|
|
42
|
+
POSTGRES_PASSWORD: '<placeholder>'
|
|
43
|
+
|
|
44
|
+
redis:
|
|
45
|
+
image: redis:latest
|
|
46
|
+
command: [redis-server, --appendonly, yes]
|
|
47
|
+
restart: always
|
|
48
|
+
ports:
|
|
49
|
+
- '36379:6379'
|
|
50
|
+
volumes:
|
|
51
|
+
- ./data/redis:/data
|
|
@@ -5,11 +5,14 @@ SERVER_WORKERS = 1
|
|
|
5
5
|
|
|
6
6
|
# build
|
|
7
7
|
|
|
8
|
+
BUILD_MINIFY = false
|
|
8
9
|
BUILD_COPY_DIST = ./docker-compose/output/dist
|
|
9
10
|
|
|
10
11
|
# database
|
|
11
12
|
|
|
12
|
-
DATABASE_DEFAULT_CLIENT = '
|
|
13
|
+
DATABASE_DEFAULT_CLIENT = 'pg' # sqlite3/pg/mysql
|
|
14
|
+
|
|
15
|
+
DATABASE_CLIENT_SQLITE3_NATIVEBINDING = false
|
|
13
16
|
|
|
14
17
|
DATABASE_CLIENT_PG_HOST = pg # see: docker-compose.yml
|
|
15
18
|
DATABASE_CLIENT_PG_PORT = 5432
|
|
@@ -7,6 +7,7 @@ import type { ICommandArgv } from './types/argv.ts';
|
|
|
7
7
|
import { BeanCli } from './lib/bean.cli.ts';
|
|
8
8
|
import { CliCommand } from './lib/cli.ts';
|
|
9
9
|
import { collectCommands } from './lib/commands.ts';
|
|
10
|
+
import { parseProjectPath } from './utils.ts';
|
|
10
11
|
|
|
11
12
|
const DISPATCH = Symbol.for('eb:Command#dispatch');
|
|
12
13
|
const PARSE = Symbol.for('eb:Command#parse');
|
|
@@ -42,24 +43,20 @@ export class CabloyCommand extends CommonBin {
|
|
|
42
43
|
const parsed = await this[PARSE](this.rawArgv);
|
|
43
44
|
// argv
|
|
44
45
|
const argv = {
|
|
45
|
-
projectPath:
|
|
46
|
+
projectPath: parseProjectPath(parsed.projectPath),
|
|
46
47
|
} as ICommandArgv;
|
|
47
48
|
// indexBrandName
|
|
48
|
-
const indexBrandName =
|
|
49
|
+
const indexBrandName = parsed._.indexOf(this.brandName);
|
|
49
50
|
// cli
|
|
50
|
-
const
|
|
51
|
-
|
|
51
|
+
const commandName = parsed._[indexBrandName + 1];
|
|
52
|
+
const indexCommand = this.rawArgv.indexOf(commandName);
|
|
53
|
+
Object.assign(argv, this._prepareCliFullName(commandName));
|
|
52
54
|
// cli meta
|
|
53
55
|
const context = { brandName: this.brandName, argv };
|
|
54
56
|
const beanCli = new BeanCli();
|
|
55
57
|
const meta = await beanCli.meta({ context });
|
|
56
58
|
// cli run
|
|
57
|
-
const rawArgv = this.rawArgv.slice();
|
|
58
|
-
if (indexBrandName > -1) {
|
|
59
|
-
rawArgv.splice(0, indexBrandName + 2);
|
|
60
|
-
} else {
|
|
61
|
-
rawArgv.splice(0, 1);
|
|
62
|
-
}
|
|
59
|
+
const rawArgv = this.rawArgv.slice(indexCommand + 1);
|
|
63
60
|
const command = new CliCommand(rawArgv, { meta, argv });
|
|
64
61
|
await command[DISPATCH]();
|
|
65
62
|
// should not force exit, let app shutdown gracefully
|
|
@@ -3,6 +3,7 @@ import type { VonaMetaFlavor } from '@cabloy/module-info';
|
|
|
3
3
|
import boxen from 'boxen';
|
|
4
4
|
import chalk from 'chalk';
|
|
5
5
|
import { createRequire } from 'node:module';
|
|
6
|
+
import path from 'node:path';
|
|
6
7
|
import semver from 'semver';
|
|
7
8
|
import urllib from 'urllib';
|
|
8
9
|
|
|
@@ -59,3 +60,10 @@ export function patchFlavor(
|
|
|
59
60
|
): VonaMetaFlavor | undefined {
|
|
60
61
|
return Array.isArray(flavor) ? flavor[flavor.length - 1] : flavor;
|
|
61
62
|
}
|
|
63
|
+
|
|
64
|
+
export function parseProjectPath(projectPath?: string) {
|
|
65
|
+
const projectPathDefault = process.cwd();
|
|
66
|
+
if (!projectPath) return projectPathDefault;
|
|
67
|
+
if (path.isAbsolute(projectPath)) return projectPath;
|
|
68
|
+
return path.join(projectPathDefault, projectPath);
|
|
69
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-cli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.103",
|
|
4
4
|
"gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
|
|
5
5
|
"description": "vona cli",
|
|
6
6
|
"keywords": [
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"@cabloy/cli": "workspace:^",
|
|
39
39
|
"@cabloy/process-helper": "workspace:^",
|
|
40
40
|
"fs-extra": "^11.3.4",
|
|
41
|
+
"mri": "^1.2.0",
|
|
41
42
|
"semver": "^7.7.4",
|
|
42
43
|
"vona-cli-set-api": "workspace:^"
|
|
43
44
|
},
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
import { parseProjectPath } from '@cabloy/cli';
|
|
3
4
|
import { ProcessHelper } from '@cabloy/process-helper';
|
|
5
|
+
import mri from 'mri';
|
|
4
6
|
import semver from 'semver';
|
|
5
7
|
|
|
6
8
|
import { playAttach } from '../play.ts';
|
|
@@ -30,22 +32,31 @@ async function checkPnpm() {
|
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
async function main() {
|
|
35
|
+
const rawArgv = process.argv.slice(2);
|
|
36
|
+
const _args = mri(rawArgv, {
|
|
37
|
+
boolean: ['force', 'help', 'version'],
|
|
38
|
+
alias: { h: 'help', v: 'version' },
|
|
39
|
+
});
|
|
40
|
+
const projectPath = parseProjectPath(_args.projectPath);
|
|
33
41
|
// args
|
|
34
42
|
let args: string[] = [];
|
|
35
|
-
const
|
|
36
|
-
const isPlay = rawArgv[0] === 'play';
|
|
43
|
+
const isPlay = _args._[0] === 'play';
|
|
37
44
|
const isPlayAttach = isPlay && (rawArgv.includes('-a') || rawArgv.includes('--attach'));
|
|
38
45
|
if (isPlay) {
|
|
39
46
|
if (!isPlayAttach) {
|
|
40
47
|
args = args.concat([':bin:play']);
|
|
41
48
|
}
|
|
42
|
-
|
|
49
|
+
const indexPlay = rawArgv.indexOf('play');
|
|
50
|
+
args = args.concat(rawArgv.slice(indexPlay + 1)).concat(['--dummy']);
|
|
51
|
+
if (_args.projectPath) {
|
|
52
|
+
args = [`--projectPath=${_args.projectPath}`].concat(args);
|
|
53
|
+
}
|
|
43
54
|
} else {
|
|
44
55
|
args = rawArgv;
|
|
45
56
|
}
|
|
46
57
|
// run
|
|
47
58
|
if (isPlayAttach) {
|
|
48
|
-
await playAttach(
|
|
59
|
+
await playAttach(projectPath, args);
|
|
49
60
|
} else {
|
|
50
61
|
if (!isPlay) {
|
|
51
62
|
await checkPnpm();
|
|
@@ -50,7 +50,16 @@ export class CliBinTest extends BeanCliBase {
|
|
|
50
50
|
async _run(projectPath: string, modulesMeta: Awaited<ReturnType<typeof glob>>) {
|
|
51
51
|
const { argv } = this.context;
|
|
52
52
|
// globs
|
|
53
|
-
|
|
53
|
+
let patterns;
|
|
54
|
+
if (argv._.length > 0) {
|
|
55
|
+
patterns = argv._.map(item => {
|
|
56
|
+
if (item.startsWith('src/')) return item;
|
|
57
|
+
if (item.startsWith('vona/src/')) return item.substring('vona/'.length);
|
|
58
|
+
return `src/**/test/**/${item}`;
|
|
59
|
+
});
|
|
60
|
+
} else {
|
|
61
|
+
patterns = this._combineTestPatterns(projectPath, modulesMeta);
|
|
62
|
+
}
|
|
54
63
|
// testFile
|
|
55
64
|
let testFile = path.join(import.meta.dirname, '../../../toolsIsolate/test.ts');
|
|
56
65
|
if (!fse.existsSync(testFile)) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.37",
|
|
4
4
|
"gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
|
|
5
5
|
"description": "Vona is an intuitive, elegant and powerful Node.js framework for rapidly developing enterprise applications of any size",
|
|
6
6
|
"keywords": [
|
package/vona/pnpm-lock.yaml
CHANGED
|
@@ -523,6 +523,9 @@ importers:
|
|
|
523
523
|
fs-extra:
|
|
524
524
|
specifier: ^11.3.4
|
|
525
525
|
version: 11.3.5
|
|
526
|
+
mri:
|
|
527
|
+
specifier: ^1.2.0
|
|
528
|
+
version: 1.2.0
|
|
526
529
|
semver:
|
|
527
530
|
specifier: ^7.7.4
|
|
528
531
|
version: 7.8.0
|
|
@@ -7316,6 +7319,10 @@ packages:
|
|
|
7316
7319
|
moment@2.30.1:
|
|
7317
7320
|
resolution: {integrity: sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==}
|
|
7318
7321
|
|
|
7322
|
+
mri@1.2.0:
|
|
7323
|
+
resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==}
|
|
7324
|
+
engines: {node: '>=4'}
|
|
7325
|
+
|
|
7319
7326
|
ms@2.1.2:
|
|
7320
7327
|
resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==}
|
|
7321
7328
|
|
|
@@ -14959,6 +14966,8 @@ snapshots:
|
|
|
14959
14966
|
|
|
14960
14967
|
moment@2.30.1: {}
|
|
14961
14968
|
|
|
14969
|
+
mri@1.2.0: {}
|
|
14970
|
+
|
|
14962
14971
|
ms@2.1.2: {}
|
|
14963
14972
|
|
|
14964
14973
|
ms@2.1.3: {}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-cli",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.70",
|
|
4
4
|
"gitHead": "6f675a8cc46d596142c591c28a40cc4d82fcc6cc",
|
|
5
5
|
"description": "zova cli",
|
|
6
6
|
"keywords": [
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
"postpack": "clean-package restore"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@cabloy/cli": "^3.1.
|
|
43
|
+
"@cabloy/cli": "^3.1.14",
|
|
44
44
|
"@cabloy/process-helper": "^3.0.0",
|
|
45
45
|
"fs-extra": "^11.3.5",
|
|
46
46
|
"semver": "^7.6.2",
|
|
47
|
-
"zova-cli-set-front": "^1.2.
|
|
47
|
+
"zova-cli-set-front": "^1.2.68"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"clean-package": "^2.2.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-cli-set-front",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.68",
|
|
4
4
|
"gitHead": "6f675a8cc46d596142c591c28a40cc4d82fcc6cc",
|
|
5
5
|
"description": "zova cli-set-front",
|
|
6
6
|
"keywords": [
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@babel/plugin-proposal-decorators": "^7.29.0",
|
|
42
42
|
"@babel/plugin-transform-class-properties": "^7.28.6",
|
|
43
43
|
"@babel/plugin-transform-typescript": "^7.28.6",
|
|
44
|
-
"@cabloy/cli": "^3.1.
|
|
44
|
+
"@cabloy/cli": "^3.1.14",
|
|
45
45
|
"@cabloy/extend": "^3.1.0",
|
|
46
46
|
"@cabloy/module-info": "^2.0.0",
|
|
47
47
|
"@cabloy/openapi-typescript": "^7.9.2",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.84",
|
|
4
4
|
"gitHead": "09d901d17140a80ee0764211b441cda72fd94663",
|
|
5
5
|
"description": "A vue3 framework with ioc",
|
|
6
6
|
"keywords": [
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"zova-core": "^5.1.42",
|
|
49
|
-
"zova-suite-a-zova": "^5.1.
|
|
49
|
+
"zova-suite-a-zova": "^5.1.83"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"clean-package": "^2.2.0",
|