Skip to content

Commit bcbebe9

Browse files
committed
Copy powersync_db_worker to powersync_core for tests
1 parent fdf478c commit bcbebe9

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

packages/powersync_core/test/server/worker_server.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Future<void> hybridMain(StreamChannel<Object?> channel) async {
2424

2525
if (!(await File(workerOutputPath).exists())) {
2626
throw AssertionError(
27-
'powersync_db.worker.js file should be present in the powersync/assets folder');
27+
'powersync_db.worker.js file should be present in the powersync_core/assets folder');
2828
}
2929

3030
final server = await HttpServer.bind('localhost', 0);

scripts/compile_webworker.dart

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ Future<void> main() async {
3232
throw Exception('Could not compile worker: ${process.stdout.toString()}');
3333
}
3434

35+
final workerFile = File(outputPath);
36+
37+
//Copy worker to powersync_core
38+
final powersyncCoreAssetsPath =
39+
path.join(repoRoot, 'packages/powersync_core/assets/$workerFilename');
40+
workerFile.copySync(powersyncCoreAssetsPath);
41+
3542
// Copy this to all demo apps web folders
3643
final demosRoot = path.join(repoRoot, 'demos');
3744
final demoDirectories =
@@ -44,6 +51,6 @@ Future<void> main() async {
4451
continue;
4552
}
4653
final demoOutputPath = path.join(demoWebDir, workerFilename);
47-
File(outputPath).copySync(demoOutputPath);
54+
workerFile.copySync(demoOutputPath);
4855
}
4956
}

0 commit comments

Comments
 (0)