mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-10-26 02:04:37 +08:00
- Extract shared AnalyticsService to packages/node-runtime using direct Aptabase HTTP API (removes @aptabase/electron dependency) - Add POST /_web/telemetry/track route for generic event reporting - Desktop: migrate analytics.json from userData to systemDir (~/.chatlab/), trigger daily active from renderer via new IPC so user-selected locale is used - CLI: inject APTABASE_APP_KEY at build time, create AnalyticsService on server start, report app_active with platform: cli-web - Both platforms report user-selected locale via platform service abstraction Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
33 lines
1.0 KiB
TypeScript
33 lines
1.0 KiB
TypeScript
import { defineConfig } from 'tsup'
|
|
|
|
export default defineConfig({
|
|
entry: {
|
|
cli: 'src/cli.ts',
|
|
index: 'src/index.ts',
|
|
'semantic-index-worker': '../../packages/node-runtime/src/semantic-index/worker-thread-entry.ts',
|
|
},
|
|
format: ['esm'],
|
|
outDir: 'dist',
|
|
outExtension: () => ({ js: '.mjs' }),
|
|
splitting: true,
|
|
sourcemap: true,
|
|
clean: true,
|
|
target: 'node20',
|
|
platform: 'node',
|
|
define: {
|
|
'process.env.APTABASE_APP_KEY': JSON.stringify(process.env.APTABASE_APP_KEY || ''),
|
|
},
|
|
noExternal: [/^@openchatlab\//, 'chatlab-mcp', 'stream-json'],
|
|
external: ['better-sqlite3', '@node-rs/jieba'],
|
|
banner: {
|
|
js: [
|
|
"import { createRequire as __createRequire } from 'module';",
|
|
"import { dirname as __pathDirname } from 'path';",
|
|
"import { fileURLToPath as __fileURLToPath } from 'url';",
|
|
'const require = __createRequire(import.meta.url);',
|
|
'const __filename = __fileURLToPath(import.meta.url);',
|
|
'const __dirname = __pathDirname(__filename);',
|
|
].join('\n'),
|
|
},
|
|
})
|