From 9c4ccb62bf2ea2e649b1e5448784c903b306d296 Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Sun, 22 Sep 2024 16:24:35 +0200 Subject: [PATCH 1/3] chore(docs): fix typedoc warnings --- src/common/Events.ts | 6 +++--- src/index.ts | 3 ++- src/lib/index.ts | 1 + src/lib/uuid.ts | 2 +- src/server/WrakerApp.ts | 15 ++++++--------- src/server/WrakerAppResponse.ts | 1 - 6 files changed, 13 insertions(+), 15 deletions(-) create mode 100644 src/lib/index.ts diff --git a/src/common/Events.ts b/src/common/Events.ts index e8338f1..e87b2b7 100644 --- a/src/common/Events.ts +++ b/src/common/Events.ts @@ -1,7 +1,7 @@ /** * Lowercase request method */ -type LowercaseMethod = +export type LowercaseMethod = | "checkout" | "copy" | "delete" @@ -39,14 +39,14 @@ export type EventPath = `/${string}`; /** * Request body * - * @link [allowed types](https://developer.mozilla.org/docs/Web/API/Web_Workers_API/Structured_clone_algorithm#error_types) + * @see {@link https://developer.mozilla.org/docs/Web/API/Web_Workers_API/Structured_clone_algorithm#error_types|allowed types} */ export type EventData = any; /** * Request headers * - * @link [allowed types](https://developer.mozilla.org/docs/Web/API/Web_Workers_API/Structured_clone_algorithm#error_types) + * @see {@link https://developer.mozilla.org/docs/Web/API/Web_Workers_API/Structured_clone_algorithm#error_types|allowed types} */ export type EventHeaders = Record; diff --git a/src/index.ts b/src/index.ts index 4147e71..f3aac01 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,4 @@ -export * from "./server"; export * from "./client"; export * from "./common"; +export * from "./lib"; +export * from "./server"; diff --git a/src/lib/index.ts b/src/lib/index.ts new file mode 100644 index 0000000..8be0f79 --- /dev/null +++ b/src/lib/index.ts @@ -0,0 +1 @@ +export * from "./uuid"; diff --git a/src/lib/uuid.ts b/src/lib/uuid.ts index e0763a5..839cf10 100644 --- a/src/lib/uuid.ts +++ b/src/lib/uuid.ts @@ -4,7 +4,7 @@ * @returns {string} uuid * * @see https://stackoverflow.com/a/2117523/12828306 - * @copyright CC BY-SA 4.0 + * @license "CC BY-SA 4.0" */ export function uuid() { diff --git a/src/server/WrakerApp.ts b/src/server/WrakerApp.ts index 0588749..8dda75b 100644 --- a/src/server/WrakerApp.ts +++ b/src/server/WrakerApp.ts @@ -51,28 +51,24 @@ export class WrakerApp extends WrakerRouter { } /** - * Mounts the application at the specified path. - * - * @param path - The path to mount the application at. + * Gets the path at which the application is mounted. */ public get mountpath(): string | string[] { return this._mountpath; } /** - * Mounts the application at the specified path. - * - * @param path - The path to mount the application at. + * Adds a listener for the event. */ - public on(_e: "mount", callback: (parent?: WrakerApp) => void) { - this._mountCallbacks.push(callback); + public on(event: "mount", callback: (parent?: WrakerApp) => void): void; + public on(event: string, callback: (parent?: WrakerApp) => void) { + if (event === "mount") this._mountCallbacks.push(callback); } // public disable(name: string) {} // public disabled(name: string) {} // public enable(name: string) {} // public enabled(name: string) {} - // public engine(name: string, callback: Function) {} /** @@ -88,6 +84,7 @@ export class WrakerApp extends WrakerRouter { if (callback) callback(); else return Promise.resolve(); } + // public render(name: string, options: any, callback: Function) {} // public set(setting: string, value: any) {} } diff --git a/src/server/WrakerAppResponse.ts b/src/server/WrakerAppResponse.ts index a396290..ec06624 100644 --- a/src/server/WrakerAppResponse.ts +++ b/src/server/WrakerAppResponse.ts @@ -216,7 +216,6 @@ export class WrakerAppResponse implements WrakerAppResponseOptions { /** * Redirects to the specified URL. * - * @param status - The status code. * @param url - The URL to redirect to. */ public location(url: "back" | string): WrakerAppResponse { From 6ccd003cb0269f8aebebe5faab54513e89d93bfc Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Mon, 23 Sep 2024 03:08:58 +0200 Subject: [PATCH 2/3] chore: migrate to @wraker organisation --- package.json | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ac0d345..81729c7 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "wraker", + "name": "@wraker/core", "version": "0.5.2", "main": "./dist/wraker.js", "module": "./dist/wraker.mjs", @@ -60,5 +60,12 @@ }, "dependencies": { "js-cookie": "^3.0.5" - } + }, + "directories": { + "doc": "docs" + }, + "bugs": { + "url": "https://github.com/wrakerjs/core/issues" + }, + "homepage": "https://github.com/wrakerjs/core#readme" } From 3466faf8edcf2e8fa70650687192fe7c05274aaf Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Mon, 23 Sep 2024 03:09:05 +0200 Subject: [PATCH 3/3] 0.5.3 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6c64b61..2056c38 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wraker", - "version": "0.5.2", + "version": "0.5.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "wraker", - "version": "0.5.2", + "version": "0.5.3", "license": "MIT", "dependencies": { "js-cookie": "^3.0.5" diff --git a/package.json b/package.json index 81729c7..7da34d7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@wraker/core", - "version": "0.5.2", + "version": "0.5.3", "main": "./dist/wraker.js", "module": "./dist/wraker.mjs", "types": "./dist/wraker.d.ts",