Skip to content

Commit

Permalink
🚧 Continue environment work
Browse files Browse the repository at this point in the history
  • Loading branch information
MulverineX committed Oct 31, 2023
1 parent db81e67 commit 0165f06
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 39 deletions.
11 changes: 0 additions & 11 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
1 change: 0 additions & 1 deletion packages/client-flutter/.fvm/flutter_sdk

This file was deleted.

4 changes: 0 additions & 4 deletions packages/client-flutter/.fvm/fvm_config.json

This file was deleted.

2 changes: 2 additions & 0 deletions packages/client-flutter/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@ app.*.map.json
/android/app/debug
/android/app/profile
/android/app/release

/local-lib
8 changes: 1 addition & 7 deletions packages/client-flutter/lib/app/core.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
});
Expand Down Expand Up @@ -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!);
}
Expand Down Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions packages/client-flutter/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 5 additions & 1 deletion packages/client-flutter/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 1 addition & 4 deletions packages/core/src/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, number>
readonly core: import("./index.js").MusicCore
}
}
4 changes: 3 additions & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,6 @@ export class MusicCore {

// Warning: Do not access the global Music within a constructor
/* @ts-ignore */
music.core = new MusicCore();
music.core = new MusicCore();

music.core.Logger.debug('test');
2 changes: 0 additions & 2 deletions packages/core/src/storage/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 2 additions & 6 deletions packages/core/src/util/logging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 0165f06

Please sign in to comment.