fix(core): update
This commit is contained in:
parent
96a88911a7
commit
8f1464c97e
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@api.global/typedserver',
|
name: '@api.global/typedserver',
|
||||||
version: '3.0.43',
|
version: '3.0.44',
|
||||||
description: 'A TypeScript-based project for easy serving of static files with support for live reloading, compression, and typed requests.'
|
description: 'A TypeScript-based project for easy serving of static files with support for live reloading, compression, and typed requests.'
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import * as plugins from './lele-serviceworker.plugins.js';
|
import * as plugins from './plugins.js';
|
||||||
import * as interfaces from '../dist_ts_interfaces/index.js';
|
import * as interfaces from '../dist_ts_interfaces/index.js';
|
||||||
import { logger } from './serviceworker.logging.js';
|
import { logger } from './logging.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MessageManager implements two ways of serviceworker communication
|
* MessageManager implements two ways of serviceworker communication
|
@ -1,9 +1,9 @@
|
|||||||
import * as plugins from './lele-serviceworker.plugins.js';
|
import * as plugins from './plugins.js';
|
||||||
import { LosslessServiceworker } from './lele-serviceworker.classes.serviceworker.js';
|
import { ServiceworkerClient } from './classes.serviceworkerclient.js';
|
||||||
|
|
||||||
export class GlobalSW {
|
export class GlobalSW {
|
||||||
losslessSw: LosslessServiceworker;
|
losslessSw: ServiceworkerClient;
|
||||||
constructor(losslessServiceWorkerInstanceArg: LosslessServiceworker) {
|
constructor(losslessServiceWorkerInstanceArg: ServiceworkerClient) {
|
||||||
this.losslessSw = losslessServiceWorkerInstanceArg;
|
this.losslessSw = losslessServiceWorkerInstanceArg;
|
||||||
globalThis.globalSw = this;
|
globalThis.globalSw = this;
|
||||||
};
|
};
|
@ -1,6 +1,6 @@
|
|||||||
import * as plugins from './lele-serviceworker.plugins.js';
|
import * as plugins from './plugins.js';
|
||||||
import * as interfaces from '../dist_ts_interfaces/index.js';
|
import * as interfaces from '../dist_ts_interfaces/index.js';
|
||||||
import { logger } from "./serviceworker.logging.js";
|
import { logger } from "./logging.js";
|
||||||
|
|
||||||
export class NotificationManager {
|
export class NotificationManager {
|
||||||
|
|
@ -1,13 +1,13 @@
|
|||||||
import * as plugins from './lele-serviceworker.plugins.js';
|
import * as plugins from './plugins.js';
|
||||||
import * as interfaces from '../dist_ts_interfaces/index.js';
|
import * as interfaces from '../dist_ts_interfaces/index.js';
|
||||||
import { logger } from "./serviceworker.logging.js";
|
import { logger } from "./logging.js";
|
||||||
import { NotificationManager } from './lele-serviceworker.classes.notificationmanager.js';
|
import { NotificationManager } from './classes.notificationmanager.js';
|
||||||
import { ActionManager } from './lele-serviceworker.classes.actionmanager.js';
|
import { ActionManager } from './classes.actionmanager.js';
|
||||||
import { GlobalSW } from './lele-serviceworker.classes.globalsw.js'
|
import { GlobalSW } from './classes.globalsw.js'
|
||||||
|
|
||||||
export class LosslessServiceworker {
|
export class ServiceworkerClient {
|
||||||
// STATIC
|
// STATIC
|
||||||
public static async createServiceWorker(): Promise<LosslessServiceworker> {
|
public static async createServiceWorker(): Promise<ServiceworkerClient> {
|
||||||
if ('serviceWorker' in navigator) {
|
if ('serviceWorker' in navigator) {
|
||||||
try {
|
try {
|
||||||
logger.log('info', 'trying to register serviceworker');
|
logger.log('info', 'trying to register serviceworker');
|
||||||
@ -31,7 +31,7 @@ export class LosslessServiceworker {
|
|||||||
await navigator.serviceWorker.ready;
|
await navigator.serviceWorker.ready;
|
||||||
logger.log('ok', 'serviceworker is ready!');
|
logger.log('ok', 'serviceworker is ready!');
|
||||||
await this.waitForController();
|
await this.waitForController();
|
||||||
const losslessServiceWorkerInstance = new LosslessServiceworker();
|
const losslessServiceWorkerInstance = new ServiceworkerClient();
|
||||||
return losslessServiceWorkerInstance;
|
return losslessServiceWorkerInstance;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// sentry integration here
|
// sentry integration here
|
@ -8,17 +8,17 @@ export type {
|
|||||||
// imports
|
// imports
|
||||||
// ====================================
|
// ====================================
|
||||||
|
|
||||||
import { logger } from './serviceworker.logging.js';
|
import { logger } from './logging.js';
|
||||||
logger.log('note', 'mainthread console initialized!');
|
logger.log('note', 'mainthread console initialized!');
|
||||||
|
|
||||||
import { LosslessServiceworker } from './lele-serviceworker.classes.serviceworker.js';
|
import { ServiceworkerClient } from './classes.serviceworkerclient.js';
|
||||||
|
|
||||||
export type {
|
export type {
|
||||||
LosslessServiceworker
|
ServiceworkerClient as LosslessServiceworker
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getServiceWorker = async () => {
|
export const getServiceWorker = async () => {
|
||||||
const losslessServiceWorkerInstance = await LosslessServiceworker.createServiceWorker(); // lets setup the service worker
|
const losslessServiceWorkerInstance = await ServiceworkerClient.createServiceWorker(); // lets setup the service worker
|
||||||
logger.log('ok', 'service worker ready!'); // and wait for it to be ready
|
logger.log('ok', 'service worker ready!'); // and wait for it to be ready
|
||||||
return losslessServiceWorkerInstance;
|
return losslessServiceWorkerInstance;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user