diff --git a/.vscode/settings.json b/.vscode/settings.json index e881a8b..2c0a7aa 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,15 +3,4 @@ "java.configuration.updateBuildConfiguration": "interactive", "cmake.sourceDirectory": "/home/mulverine/Documents/Workspace/personal/refracture/refracture-music/packages/client-flutter/linux", "terminal.integrated.persistentSessionReviveProcess": "never", - "dart.flutterSdkPaths": [ - "packages/client-flutter/.fvm/flutter_sdk" - ], - "search.exclude": { - "**/.fvm": true - }, - // Remove from file watching - "files.watcherExclude": { - "**/.fvm": true - }, - "dart.flutterSdkPath": "/home/mulverine/Documents/Workspace/personal/refracture/refracture-music/packages/client-flutter/.fvm/flutter_sdk" } \ No newline at end of file diff --git a/packages/client-flutter/.fvm/flutter_sdk b/packages/client-flutter/.fvm/flutter_sdk deleted file mode 120000 index 20a84fe..0000000 --- a/packages/client-flutter/.fvm/flutter_sdk +++ /dev/null @@ -1 +0,0 @@ -/home/mulverine/fvm/versions/3.10.1 \ No newline at end of file diff --git a/packages/client-flutter/.fvm/fvm_config.json b/packages/client-flutter/.fvm/fvm_config.json deleted file mode 100644 index 9474807..0000000 --- a/packages/client-flutter/.fvm/fvm_config.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "flutterSdkVersion": "3.10.1", - "flavors": {} -} \ No newline at end of file diff --git a/packages/client-flutter/.gitignore b/packages/client-flutter/.gitignore index 24476c5..c445595 100644 --- a/packages/client-flutter/.gitignore +++ b/packages/client-flutter/.gitignore @@ -42,3 +42,5 @@ app.*.map.json /android/app/debug /android/app/profile /android/app/release + +/local-lib \ No newline at end of file diff --git a/packages/client-flutter/lib/app/core.dart b/packages/client-flutter/lib/app/core.dart index cd3b903..d5a205e 100644 --- a/packages/client-flutter/lib/app/core.dart +++ b/packages/client-flutter/lib/app/core.dart @@ -99,9 +99,6 @@ class AppCore extends InheritedWidget { bundle: MercuryBundle.fromContent('const music = { versions: {} };'), onControllerCreated: (controller) { controller.onLoad = (controller) { - - logger.d(controller.context.dispatcher); - dispatcher = controller.context.dispatcher!; loaded.complete(true); @@ -121,7 +118,6 @@ class AppCore extends InheritedWidget { ); if (await loaded.future) { - logger.d('hello?'); dispatcher.subscribe('initDatabase', (init) async { unit[init[0].name]!.initDB(init); }); @@ -167,7 +163,7 @@ class AppCore extends InheritedWidget { for (final unit in unit.values) { if (unit.bundle != null) { runtime.controller!.context.evaluateJavaScripts( - 'music.versions.${unit.indexPath} = ${await unit.secure.storage['databaseVersion'] ?? '0'};' + 'music.versions.${unit.index.join('.')} = ${await unit.secure.storage['databaseVersion'] ?? '0'};' ); runtime.controller!.context.evaluateJavaScripts(unit.bundle!); } @@ -224,8 +220,6 @@ class AppCore extends InheritedWidget { logRequests().addHandler(Cascade().add(shelf_router.Router()..post('/', (Request req) async { logger.d('[Music UI] debug: Core bundle loading from POST'); - print('hello?'); - unit['core']!.bundle = await utf8.decodeStream(req.read()); await loadRuntime(); diff --git a/packages/client-flutter/pubspec.lock b/packages/client-flutter/pubspec.lock index b60579b..6de2df1 100644 --- a/packages/client-flutter/pubspec.lock +++ b/packages/client-flutter/pubspec.lock @@ -388,10 +388,10 @@ packages: dependency: "direct main" description: name: mercuryjs - sha256: "4e21a1a6c996f8702e81e194d28e250252d1d68e6939f9c0ede6288ea4e03dde" + sha256: "2c838b592fd8c7af0849e4ed563310e735acaf1e641ca3f3bc9156a4f1708335" url: "https://pub.dev" source: hosted - version: "0.1.0" + version: "0.1.2" meta: dependency: transitive description: diff --git a/packages/client-flutter/pubspec.yaml b/packages/client-flutter/pubspec.yaml index 1bec993..5f9086d 100644 --- a/packages/client-flutter/pubspec.yaml +++ b/packages/client-flutter/pubspec.yaml @@ -51,7 +51,11 @@ dependencies: logger: ^2.0.2 sync_http: ^0.3.1 cryptography: ^2.5.0 - mercuryjs: ^0.1.0 + mercuryjs: ^0.1.2 + +# dependency_overrides: +# mercuryjs: +# path: local-lib/mercury/ dev_dependencies: flutter_test: diff --git a/packages/core/src/env.d.ts b/packages/core/src/env.d.ts index 94243b9..a4c4d3c 100644 --- a/packages/core/src/env.d.ts +++ b/packages/core/src/env.d.ts @@ -6,11 +6,8 @@ declare global { */ function sendMessage(channel_name: string, message: string): string; - function database_migrations(): Array<[number, string]> - - const database_version: number - const music: { + readonly versions: Record readonly core: import("./index.js").MusicCore } } \ No newline at end of file diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 0ae0b81..c9c88ce 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -54,4 +54,6 @@ export class MusicCore { // Warning: Do not access the global Music within a constructor /* @ts-ignore */ -music.core = new MusicCore(); \ No newline at end of file +music.core = new MusicCore(); + +music.core.Logger.debug('test'); \ No newline at end of file diff --git a/packages/core/src/storage/index.ts b/packages/core/src/storage/index.ts index b237140..72d4fc8 100644 --- a/packages/core/src/storage/index.ts +++ b/packages/core/src/storage/index.ts @@ -7,8 +7,6 @@ export class Database { public readonly server_address: URL; - public readonly migrations = database_migrations(); - /** * Requests * @param request_type The type of Data you are requesting, eg. track diff --git a/packages/core/src/util/logging.ts b/packages/core/src/util/logging.ts index e055e6f..e8266a1 100644 --- a/packages/core/src/util/logging.ts +++ b/packages/core/src/util/logging.ts @@ -6,12 +6,8 @@ export class LoggerClass { constructor(unit: string, initialize = false) { this.unit = unit; - /* @ts-ignore */ - if (console.info && console.info.toString() !== '() => {}') { - this.provider = (message) => console.log(message); - } else { - this.provider = (message) => sendMessage('print', `"${message}"`); - } + // TODO: Move this to Dart logger + this.provider = (message) => console.log(message); } /**