File tree Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @powersync/common ' : minor
3+ ---
4+
5+ Added ability to specify appMetadata for sync/stream requests
Original file line number Diff line number Diff line change 11import { once } from 'node:events' ;
2- import { readFileSync } from 'node:fs' ;
3- import { dirname , join } from 'node:path' ;
42import repl_factory from 'node:repl' ;
5- import { fileURLToPath } from 'node:url' ;
63import { Worker } from 'node:worker_threads' ;
74
85import {
@@ -62,18 +59,11 @@ const main = async () => {
6259 } ) ;
6360 console . log ( await db . get ( 'SELECT powersync_rs_version();' ) ) ;
6461
65- // Read package version for metadata
66- const __filename = fileURLToPath ( import . meta. url ) ;
67- const __dirname = dirname ( __filename ) ;
68- const packageJsonPath = join ( __dirname , '..' , 'package.json' ) ;
69- const packageJson = JSON . parse ( readFileSync ( packageJsonPath , 'utf-8' ) ) ;
70- const packageVersion = packageJson . version ;
71-
7262 await db . connect ( new DemoConnector ( ) , {
7363 connectionMethod : SyncStreamConnectionMethod . WEB_SOCKET ,
7464 clientImplementation : SyncClientImplementation . RUST ,
7565 appMetadata : {
76- package_version : packageVersion
66+ package_version : process . env . npm_package_version || 'unknown'
7767 }
7868 } ) ;
7969 // Example using a proxy agent for more control over the connection:
You can’t perform that action at this time.
0 commit comments