Skip to content

Commit 237ed35

Browse files
Update log messages. Avoid requirement for NPM install scripts.
1 parent 79abf05 commit 237ed35

File tree

4 files changed

+39
-49
lines changed

4 files changed

+39
-49
lines changed

packages/powersync-db-collection/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313
"@powersync/common": "^1.39.0"
1414
},
1515
"devDependencies": {
16-
"@powersync/common": "^1.39.0",
17-
"@powersync/better-sqlite3": "^0.2.0",
18-
"@powersync/node": "^0.11.0",
16+
"@powersync/common": "0.0.0-dev-20251003085035",
17+
"@powersync/node": "0.0.0-dev-20251003085035",
1918
"@types/debug": "^4.1.12",
2019
"@vitest/coverage-istanbul": "^3.2.4"
2120
},

packages/powersync-db-collection/src/powersync.ts

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ import { DEFAULT_BATCH_SIZE } from "./definitions"
33
import { asPowerSyncRecord, mapOperation } from "./helpers"
44
import { PendingOperationStore } from "./PendingOperationStore"
55
import { PowerSyncTransactor } from "./PowerSyncTransactor"
6+
import type { TriggerDiffRecord } from "@powersync/common"
7+
import type { StandardSchemaV1 } from "@standard-schema/spec"
8+
import type {
9+
CollectionConfig,
10+
InferSchemaOutput,
11+
SyncConfig,
12+
} from "@tanstack/db"
613
import type {
714
EnhancedPowerSyncCollectionConfig,
815
PowerSyncCollectionConfig,
916
PowerSyncCollectionUtils,
1017
} from "./definitions"
1118
import type { PendingOperation } from "./PendingOperationStore"
12-
import type {
13-
CollectionConfig,
14-
InferSchemaOutput,
15-
SyncConfig,
16-
} from "@tanstack/db"
17-
import type { StandardSchemaV1 } from "@standard-schema/spec"
18-
import type { TriggerDiffRecord } from "@powersync/common"
1919

2020
/**
2121
* Creates PowerSync collection options for use with a standard Collection
@@ -142,7 +142,9 @@ export function powerSyncCollectionOptions<
142142

143143
// The sync function needs to be synchronous
144144
async function start() {
145-
database.logger.info(`Sync is starting`)
145+
database.logger.info(
146+
`Sync is starting for ${tableName} into ${trackedTableName}`
147+
)
146148
database.onChangeWithCallback(
147149
{
148150
onChange: async () => {
@@ -227,7 +229,9 @@ export function powerSyncCollectionOptions<
227229
commit()
228230
}
229231
markReady()
230-
database.logger.info(`Sync is ready`)
232+
database.logger.info(
233+
`Sync is ready for ${tableName} into ${trackedTableName}`
234+
)
231235
},
232236
},
233237
})
@@ -247,11 +251,16 @@ export function powerSyncCollectionOptions<
247251
}
248252

249253
start().catch((error) =>
250-
database.logger.error(`Could not start syncing process`, error)
254+
database.logger.error(
255+
`Could not start syncing process for ${tableName} into ${trackedTableName}`,
256+
error
257+
)
251258
)
252259

253260
return () => {
254-
database.logger.info(`Sync has been stopped`)
261+
database.logger.info(
262+
`Sync has been stopped for ${tableName} into ${trackedTableName}`
263+
)
255264
abortController.abort()
256265
}
257266
},

packages/powersync-db-collection/tests/powersync.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ describe(`PowerSync Integration`, () => {
3838
database: {
3939
dbFilename: `test.sqlite`,
4040
dbLocation: tmpdir(),
41+
implementation: { type: `node:sqlite` },
4142
},
4243
schema: APP_SCHEMA,
4344
})

pnpm-lock.yaml

Lines changed: 16 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)