Skip to content

Commit

Permalink
Merge pull request #3 from wrakerjs/dev
Browse files Browse the repository at this point in the history
v0.5.3 - Migration
  • Loading branch information
josselinonduty authored Sep 23, 2024
2 parents bdc839b + 3466faf commit ad557d4
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 20 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wraker",
"version": "0.5.2",
"name": "@wraker/core",
"version": "0.5.3",
"main": "./dist/wraker.js",
"module": "./dist/wraker.mjs",
"types": "./dist/wraker.d.ts",
Expand Down Expand Up @@ -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"
}
6 changes: 3 additions & 3 deletions src/common/Events.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Lowercase request method
*/
type LowercaseMethod =
export type LowercaseMethod =
| "checkout"
| "copy"
| "delete"
Expand Down Expand Up @@ -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<string, string>;

Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from "./server";
export * from "./client";
export * from "./common";
export * from "./lib";
export * from "./server";
1 change: 1 addition & 0 deletions src/lib/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./uuid";
2 changes: 1 addition & 1 deletion src/lib/uuid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
15 changes: 6 additions & 9 deletions src/server/WrakerApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}

/**
Expand All @@ -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) {}
}
1 change: 0 additions & 1 deletion src/server/WrakerAppResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ad557d4

Please sign in to comment.