Skip to content

Commit

Permalink
Fix downloading worker
Browse files Browse the repository at this point in the history
  • Loading branch information
simolus3 committed Jan 27, 2025
1 parent 4adfbc1 commit d3d258a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export 'powersync_database_impl_stub.dart'
// ignore: uri_does_not_exist
if (dart.library.io) './native/native_powersync_database.dart'
// ignore: uri_does_not_exist
if (dart.library.html) './web/web_powersync_database.dart';
if (dart.library.js_interop) './web/web_powersync_database.dart';
2 changes: 1 addition & 1 deletion packages/powersync_core/lib/src/open_factory.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export 'open_factory/open_factory_stub.dart'
// ignore: uri_does_not_exist
if (dart.library.io) 'open_factory/native/native_open_factory.dart'
// ignore: uri_does_not_exist
if (dart.library.html) 'open_factory/web/web_open_factory.dart';
if (dart.library.js_interop) 'open_factory/web/web_open_factory.dart';
6 changes: 3 additions & 3 deletions packages/powersync_core/lib/src/setup_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ Future<void> downloadWebAssets(List<String> arguments,
final root = Directory.current.uri;
print('Project root: ${root.toFilePath()}');

final wasmPath = '${root.toFilePath()}$outputDir/sqlite3.wasm';
final wasmFileName = encryption ? 'sqlite3mc.wasm' : 'sqlite3.wasm';
final wasmPath = '${root.toFilePath()}$outputDir/$wasmFileName';

final workerPath = '${root.toFilePath()}$outputDir/powersync_db.worker.js';
final syncWorkerPath =
Expand Down Expand Up @@ -86,9 +87,8 @@ Future<void> downloadWebAssets(List<String> arguments,
You can view the full list of releases at https://github.com/powersync-ja/sqlite3.dart/releases""");
}

final filename = encryption ? 'sqlite3mc.wasm' : 'sqlite3.wasm';
final sqliteUrl =
'https://github.com/powersync-ja/sqlite3.dart/releases/download/$sqlite3Version/$filename';
'https://github.com/powersync-ja/sqlite3.dart/releases/download/$sqlite3Version/$wasmFileName';

await downloadFile(httpClient, sqliteUrl, wasmPath);
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion packages/powersync_core/lib/src/user_agent/user_agent.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ export './user_agent_stub.dart'
// ignore: uri_does_not_exist
if (dart.library.io) './user_agent_native.dart'
// ignore: uri_does_not_exist
if (dart.library.html) './user_agent_web.dart';
if (dart.library.js_interop) './user_agent_web.dart';
2 changes: 1 addition & 1 deletion packages/powersync_core/test/utils/test_utils_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ export 'stub_test_utils.dart'
// ignore: uri_does_not_exist
if (dart.library.io) 'native_test_utils.dart'
// ignore: uri_does_not_exist
if (dart.library.html) 'web_test_utils.dart';
if (dart.library.js_interop) 'web_test_utils.dart';

0 comments on commit d3d258a

Please sign in to comment.