This commit is contained in:
熊潇 2025-05-23 12:05:53 +08:00
parent 5e03ef2dd9
commit 5cce86d476
3 changed files with 27 additions and 51 deletions

View File

@ -1,28 +0,0 @@
name: Sync to CNB
on:
push:
branches:
# - main
- 'releases/**'
workflow_dispatch:
# This workflow is triggered on push events to the repository.
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Sync to CNB Repository
run: |
docker run --rm \
-v ${{ github.workspace }}:${{ github.workspace }} \
-w ${{ github.workspace }} \
-e PLUGIN_TARGET_URL="https://cnb.cool/kevisual/router-template.git" \
-e PLUGIN_AUTH_TYPE="https" \
-e PLUGIN_USERNAME="cnb" \
-e PLUGIN_PASSWORD=${{ secrets.GIT_PASSWORD }} \
-e PLUGIN_SYNC_MODE="rebase" \
tencentcom/git-sync

View File

@ -1,20 +1,24 @@
// @ts-check // @ts-check
// https://bun.sh/docs/bundler import { resolvePath } from '@kevisual/use-config/env';
// @ts-ignore import { execSync } from 'node:child_process';
import pkg from './package.json';
import { resolvePath as rp } from '@kevisual/use-config/env'; const entry = 'src/index.ts';
// bun run src/index.ts -- const naming = 'app';
/**
* @type {import('bun').BuildConfig}
*/
await Bun.build({ await Bun.build({
target: 'node', target: 'node',
format: 'esm', format: 'esm',
entrypoints: [rp('./src/main.ts')], entrypoints: [resolvePath(entry, { meta: import.meta })],
outdir: rp('./dist'), outdir: resolvePath('./dist', { meta: import.meta }),
naming: { naming: {
entry: 'app.mjs', entry: `${naming}.js`,
},
define: {
VERSION: JSON.stringify(pkg.version),
}, },
external: [],
env: 'KEVISUAL_*', env: 'KEVISUAL_*',
}); });
// const cmd = `dts -i src/index.ts -o app.d.ts`;
const cmd = `dts -i ${entry} -o ${naming}.d.ts`;
execSync(cmd, { stdio: 'inherit' });

View File

@ -6,7 +6,7 @@
"basename": "/root/demo-app", "basename": "/root/demo-app",
"app": { "app": {
"key": "demo-app", "key": "demo-app",
"entry": "dist/app.mjs", "entry": "dist/app.js",
"type": "system-app", "type": "system-app",
"files": [ "files": [
"dist" "dist"
@ -33,33 +33,33 @@
"access": "public" "access": "public"
}, },
"dependencies": { "dependencies": {
"@kevisual/code-center-module": "0.0.18", "@kevisual/code-center-module": "0.0.19",
"@kevisual/router": "0.0.13", "@kevisual/router": "0.0.21",
"@kevisual/use-config": "^1.0.12", "@kevisual/use-config": "^1.0.17",
"cookie": "^1.0.2", "cookie": "^1.0.2",
"dayjs": "^1.11.13", "dayjs": "^1.11.13",
"formidable": "^3.5.4", "formidable": "^3.5.4",
"lodash-es": "^4.17.21" "lodash-es": "^4.17.21"
}, },
"devDependencies": { "devDependencies": {
"@kevisual/types": "^0.0.9", "@kevisual/types": "^0.0.10",
"@kevisual/use-config": "^1.0.12", "@kevisual/use-config": "^1.0.17",
"@types/bun": "^1.2.11", "@types/bun": "^1.2.14",
"@types/crypto-js": "^4.2.2", "@types/crypto-js": "^4.2.2",
"@types/formidable": "^3.4.5", "@types/formidable": "^3.4.5",
"@types/lodash-es": "^4.17.12", "@types/lodash-es": "^4.17.12",
"@types/node": "^22.15.3", "@types/node": "^22.15.21",
"commander": "^13.1.0", "commander": "^14.0.0",
"concurrently": "^9.1.2", "concurrently": "^9.1.2",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"inquire": "^0.4.8", "inquire": "^0.4.8",
"ioredis": "^5.6.1", "ioredis": "^5.6.1",
"nodemon": "^3.1.10", "nodemon": "^3.1.10",
"pg": "^8.15.6", "pg": "^8.16.0",
"rimraf": "^6.0.1", "rimraf": "^6.0.1",
"sequelize": "^6.37.7", "sequelize": "^6.37.7",
"tape": "^5.9.0", "tape": "^5.9.0",
"typescript": "^5.8.3" "typescript": "^5.8.3"
}, },
"packageManager": "pnpm@10.10.0" "packageManager": "pnpm@10.11.0"
} }