owebjs 1.0.3 → 1.0.4
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/README.md +1 -1
- package/dist/index.d.ts +14 -15
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/scripts/copyBinaries.js +8 -10
package/README.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FastifyServerOptions, FastifyListenOptions, FastifyInstance } from 'fastify';
|
|
2
2
|
|
|
3
|
-
interface
|
|
4
|
-
|
|
5
|
-
host?: string;
|
|
3
|
+
interface OwebOptions extends FastifyServerOptions {
|
|
4
|
+
uWebSocketsEnabled?: boolean;
|
|
6
5
|
}
|
|
7
|
-
interface
|
|
8
|
-
|
|
6
|
+
interface LoadRoutesOptions {
|
|
7
|
+
directory: string;
|
|
9
8
|
}
|
|
10
|
-
interface
|
|
9
|
+
interface _FastifyInstance extends FastifyInstance {
|
|
11
10
|
}
|
|
12
|
-
declare class
|
|
13
|
-
constructor();
|
|
11
|
+
declare class _FastifyInstance {
|
|
14
12
|
}
|
|
15
|
-
declare class Oweb extends
|
|
13
|
+
declare class Oweb extends _FastifyInstance {
|
|
16
14
|
constructor(options?: OwebOptions);
|
|
17
|
-
loadRoutes({
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
loadRoutes({ directory }: LoadRoutesOptions): Promise<void>;
|
|
16
|
+
start(listenOptions?: FastifyListenOptions): Promise<{
|
|
17
|
+
err: Error;
|
|
18
|
+
address: string;
|
|
19
|
+
}>;
|
|
21
20
|
}
|
|
22
21
|
|
|
23
|
-
export { Oweb as default };
|
|
22
|
+
export { LoadRoutesOptions, OwebOptions, Oweb as default };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-VLHAZXJ6.js";import{b as n}from"./chunk-JSRKSHP6.js";import"./chunk-OR3GJT5E.js";import"./chunk-XR5MHIBF.js";import"./chunk-2WXLF7QU.js";import"./chunk-2D3NDWTU.js";import"./chunk-Z23QA6PX.js";import"./chunk-7JAXN5IF.js";import"./chunk-ARAMBVQ3.js";import{a as
|
|
1
|
+
import{a as i}from"./chunk-VLHAZXJ6.js";import{b as n}from"./chunk-JSRKSHP6.js";import"./chunk-OR3GJT5E.js";import"./chunk-XR5MHIBF.js";import"./chunk-2WXLF7QU.js";import"./chunk-2D3NDWTU.js";import"./chunk-Z23QA6PX.js";import"./chunk-7JAXN5IF.js";import"./chunk-ARAMBVQ3.js";import{a as r}from"./chunk-2HA4XQFN.js";import u from"fastify";var a=i({}),f=r((e,t)=>(a.on("request",e),a),"serverFactory"),m=class{static{r(this,"_FastifyInstance")}},o=class extends m{static{r(this,"Oweb")}constructor(t={}){super();let s=t??{};s.uWebSocketsEnabled&&(s.serverFactory=f),Object.assign(this,u(s))}loadRoutes({directory:t}){return n(t,this)}start(t={port:3e3,host:"127.0.0.1"}){return new Promise(s=>{this.listen({port:+t.port},(c,p)=>s({err:c,address:p}))})}};export{o as default};
|
package/package.json
CHANGED
package/scripts/copyBinaries.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import path from 'path';
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
3
|
|
|
4
|
-
fs.readdirSync('node_modules/uWebSockets.js')
|
|
4
|
+
for (const file of fs.readdirSync('node_modules/uWebSockets.js')) {
|
|
5
5
|
if (file.endsWith('.node')) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if (err) throw err;
|
|
11
|
-
});
|
|
6
|
+
fs.copyFileSync(
|
|
7
|
+
path.resolve('node_modules/uWebSockets.js/' + file),
|
|
8
|
+
path.resolve('dist/' + file),
|
|
9
|
+
);
|
|
12
10
|
}
|
|
13
|
-
}
|
|
11
|
+
}
|