From 5cce86d4765bd43b18fb4e8b02820392554e1ec9 Mon Sep 17 00:00:00 2001 From: abearxiong Date: Fri, 23 May 2025 12:05:53 +0800 Subject: [PATCH] fix --- .github/workflows/git-sync.yml | 28 ---------------------------- bun.config.mjs | 28 ++++++++++++++++------------ package.json | 22 +++++++++++----------- 3 files changed, 27 insertions(+), 51 deletions(-) delete mode 100644 .github/workflows/git-sync.yml diff --git a/.github/workflows/git-sync.yml b/.github/workflows/git-sync.yml deleted file mode 100644 index ac08ba8..0000000 --- a/.github/workflows/git-sync.yml +++ /dev/null @@ -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 diff --git a/bun.config.mjs b/bun.config.mjs index 27d12c4..6beea30 100644 --- a/bun.config.mjs +++ b/bun.config.mjs @@ -1,20 +1,24 @@ // @ts-check -// https://bun.sh/docs/bundler -// @ts-ignore -import pkg from './package.json'; -import { resolvePath as rp } from '@kevisual/use-config/env'; -// bun run src/index.ts -- +import { resolvePath } from '@kevisual/use-config/env'; +import { execSync } from 'node:child_process'; + +const entry = 'src/index.ts'; +const naming = 'app'; +/** + * @type {import('bun').BuildConfig} + */ await Bun.build({ target: 'node', format: 'esm', - entrypoints: [rp('./src/main.ts')], - outdir: rp('./dist'), + entrypoints: [resolvePath(entry, { meta: import.meta })], + outdir: resolvePath('./dist', { meta: import.meta }), naming: { - entry: 'app.mjs', - }, - - define: { - VERSION: JSON.stringify(pkg.version), + entry: `${naming}.js`, }, + external: [], 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' }); diff --git a/package.json b/package.json index 5560800..a641b0c 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "basename": "/root/demo-app", "app": { "key": "demo-app", - "entry": "dist/app.mjs", + "entry": "dist/app.js", "type": "system-app", "files": [ "dist" @@ -33,33 +33,33 @@ "access": "public" }, "dependencies": { - "@kevisual/code-center-module": "0.0.18", - "@kevisual/router": "0.0.13", - "@kevisual/use-config": "^1.0.12", + "@kevisual/code-center-module": "0.0.19", + "@kevisual/router": "0.0.21", + "@kevisual/use-config": "^1.0.17", "cookie": "^1.0.2", "dayjs": "^1.11.13", "formidable": "^3.5.4", "lodash-es": "^4.17.21" }, "devDependencies": { - "@kevisual/types": "^0.0.9", - "@kevisual/use-config": "^1.0.12", - "@types/bun": "^1.2.11", + "@kevisual/types": "^0.0.10", + "@kevisual/use-config": "^1.0.17", + "@types/bun": "^1.2.14", "@types/crypto-js": "^4.2.2", "@types/formidable": "^3.4.5", "@types/lodash-es": "^4.17.12", - "@types/node": "^22.15.3", - "commander": "^13.1.0", + "@types/node": "^22.15.21", + "commander": "^14.0.0", "concurrently": "^9.1.2", "cross-env": "^7.0.3", "inquire": "^0.4.8", "ioredis": "^5.6.1", "nodemon": "^3.1.10", - "pg": "^8.15.6", + "pg": "^8.16.0", "rimraf": "^6.0.1", "sequelize": "^6.37.7", "tape": "^5.9.0", "typescript": "^5.8.3" }, - "packageManager": "pnpm@10.10.0" + "packageManager": "pnpm@10.11.0" } \ No newline at end of file