@rimori/client 2.4.0 → 2.5.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/scripts/init/dev-registration.js +4 -2
- package/dist/cli/scripts/init/main.js +1 -0
- package/dist/cli/scripts/release/release.js +0 -0
- package/dist/controller/SettingsController.d.ts +1 -1
- package/dist/controller/SharedContentController.d.ts +1 -1
- package/dist/fromRimori/EventBus.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/plugin/CommunicationHandler.d.ts +13 -8
- package/dist/plugin/CommunicationHandler.js +44 -59
- package/dist/plugin/RimoriClient.d.ts +11 -195
- package/dist/plugin/RimoriClient.js +17 -298
- package/dist/plugin/StandaloneClient.d.ts +1 -1
- package/dist/plugin/StandaloneClient.js +3 -2
- package/dist/plugin/module/AIModule.d.ts +49 -0
- package/dist/plugin/module/AIModule.js +81 -0
- package/dist/plugin/module/DbModule.d.ts +30 -0
- package/dist/plugin/module/DbModule.js +51 -0
- package/dist/plugin/module/EventModule.d.ts +99 -0
- package/dist/plugin/module/EventModule.js +162 -0
- package/dist/{controller/ExerciseController.d.ts → plugin/module/ExerciseModule.d.ts} +20 -16
- package/dist/{controller/ExerciseController.js → plugin/module/ExerciseModule.js} +27 -20
- package/dist/plugin/module/PluginModule.d.ts +76 -0
- package/dist/plugin/module/PluginModule.js +88 -0
- package/package.json +8 -3
- package/.github/workflows/pre-release.yml +0 -126
- package/.prettierignore +0 -35
- package/eslint.config.js +0 -53
- package/example/docs/devdocs.md +0 -241
- package/example/docs/overview.md +0 -29
- package/example/docs/userdocs.md +0 -126
- package/example/rimori.config.ts +0 -91
- package/example/worker/vite.config.ts +0 -26
- package/example/worker/worker.ts +0 -11
- package/prettier.config.js +0 -8
- package/src/cli/scripts/init/dev-registration.ts +0 -189
- package/src/cli/scripts/init/env-setup.ts +0 -44
- package/src/cli/scripts/init/file-operations.ts +0 -58
- package/src/cli/scripts/init/html-cleaner.ts +0 -45
- package/src/cli/scripts/init/main.ts +0 -175
- package/src/cli/scripts/init/package-setup.ts +0 -113
- package/src/cli/scripts/init/router-transformer.ts +0 -332
- package/src/cli/scripts/init/tailwind-config.ts +0 -66
- package/src/cli/scripts/init/vite-config.ts +0 -73
- package/src/cli/scripts/release/detect-translation-languages.ts +0 -37
- package/src/cli/scripts/release/release-config-upload.ts +0 -119
- package/src/cli/scripts/release/release-db-update.ts +0 -97
- package/src/cli/scripts/release/release-file-upload.ts +0 -138
- package/src/cli/scripts/release/release.ts +0 -85
- package/src/cli/types/DatabaseTypes.ts +0 -125
- package/src/controller/AIController.ts +0 -295
- package/src/controller/AccomplishmentController.ts +0 -188
- package/src/controller/AudioController.ts +0 -64
- package/src/controller/ExerciseController.ts +0 -117
- package/src/controller/ObjectController.ts +0 -120
- package/src/controller/SettingsController.ts +0 -186
- package/src/controller/SharedContentController.ts +0 -365
- package/src/controller/TranslationController.ts +0 -136
- package/src/controller/VoiceController.ts +0 -33
- package/src/fromRimori/EventBus.ts +0 -382
- package/src/fromRimori/PluginTypes.ts +0 -214
- package/src/fromRimori/readme.md +0 -2
- package/src/index.ts +0 -19
- package/src/plugin/CommunicationHandler.ts +0 -310
- package/src/plugin/Logger.ts +0 -394
- package/src/plugin/RimoriClient.ts +0 -530
- package/src/plugin/StandaloneClient.ts +0 -125
- package/src/utils/difficultyConverter.ts +0 -15
- package/src/utils/endpoint.ts +0 -3
- package/src/worker/WorkerSetup.ts +0 -35
- package/tsconfig.json +0 -17
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { RimoriClient } from '../plugin/RimoriClient';
|
|
2
|
-
import { EventBusHandler } from '../fromRimori/EventBus';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Sets up the web worker for the plugin to be able receive and send messages to Rimori.
|
|
6
|
-
* @param pluginId - The id of the plugin to setup the worker for.
|
|
7
|
-
* @param init - The function containing the initialization logic.
|
|
8
|
-
*/
|
|
9
|
-
export async function setupWorker(
|
|
10
|
-
pluginId: string,
|
|
11
|
-
init: (client: RimoriClient) => void | Promise<void>,
|
|
12
|
-
): Promise<void> {
|
|
13
|
-
// Mock of the window object for the worker context to be able to use the PluginController.
|
|
14
|
-
const mockWindow = {
|
|
15
|
-
isWorker: true,
|
|
16
|
-
location: {},
|
|
17
|
-
parent: {
|
|
18
|
-
postMessage: () => {},
|
|
19
|
-
},
|
|
20
|
-
addEventListener: () => {},
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
// Assign the mock to globalThis.
|
|
24
|
-
Object.assign(globalThis, { window: mockWindow });
|
|
25
|
-
|
|
26
|
-
EventBusHandler.getInstance('Worker EventBus');
|
|
27
|
-
|
|
28
|
-
const rimoriClient = await RimoriClient.getInstance(pluginId);
|
|
29
|
-
console.debug('[Worker] RimoriClient initialized.');
|
|
30
|
-
|
|
31
|
-
await init(rimoriClient);
|
|
32
|
-
console.debug('[Worker] Worker initialized.');
|
|
33
|
-
|
|
34
|
-
rimoriClient.event.emit('self.rimori.triggerInitFinished');
|
|
35
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"outDir": "dist",
|
|
4
|
-
"rootDir": "src",
|
|
5
|
-
"module": "ESNext",
|
|
6
|
-
"target": "ES6",
|
|
7
|
-
"declaration": true,
|
|
8
|
-
"jsx": "react-jsx",
|
|
9
|
-
"moduleResolution": "node",
|
|
10
|
-
"esModuleInterop": true,
|
|
11
|
-
"skipLibCheck": true,
|
|
12
|
-
"strict": true
|
|
13
|
-
},
|
|
14
|
-
"include": [
|
|
15
|
-
"src/**/*",
|
|
16
|
-
]
|
|
17
|
-
}
|