Skip to content

Commit

Permalink
feat: bump deps
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacek Piętal committed May 23, 2024
1 parent f9a0064 commit 0f4b10e
Show file tree
Hide file tree
Showing 11 changed files with 765 additions and 477 deletions.
2 changes: 1 addition & 1 deletion bin/chef-express
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env node
const startServer = require('../index.js');
const startServer = require("../index.js");

startServer();
2 changes: 1 addition & 1 deletion dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Config } from "chef-core";
export default function startChef(
config?: Partial<Config>
config?: Partial<Config>,
): Promise<import("chef-core").Server>;
//# sourceMappingURL=index.d.ts.map
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ async function startChef(config) {
{
createServer: server_1.createServer,
requestHandler: server_1.requestHandler,
}
},
);
}
exports.default = startChef;
4 changes: 2 additions & 2 deletions dist/server/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Request, Response } from "express";
import { Cache } from "latermom";
import { Cache } from "@pietal.dev/cache";
import { Config, Server, FileReaderResponse } from "chef-core";
export declare function createServer(config: Config): Promise<Server>;
export declare function requestHandler(
fileReaderCache: Cache<FileReaderResponse>
fileReaderCache: Cache<FileReaderResponse>,
): (req: Request, res: Response) => void;
//# sourceMappingURL=index.d.ts.map
2 changes: 1 addition & 1 deletion dist/server/index.d.ts.map

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

2 changes: 1 addition & 1 deletion dist/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function createExpressServer(config, app) {
// start ssl app and finish
return https_1.default.createServer(
{ key: (0, fs_1.readFileSync)(key), cert: (0, fs_1.readFileSync)(cert) },
app
app,
);
}
// else start normal app
Expand Down
2 changes: 1 addition & 1 deletion index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe("GIVEN chef is provided", () => {

expect(
() =>
startChef({ type: "uws", folder: "demo", port: 3012 }).__proto__.head
startChef({ type: "uws", folder: "demo", port: 3012 }).__proto__.head,
).toBeTruthy();
});
});
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chef-express",
"version": "2.1.3",
"version": "2.1.4",
"description": "chef-js + express = static files server",
"main": "index.js",
"keywords": [
Expand Down Expand Up @@ -35,15 +35,15 @@
"precommit": "yarn build && prettier . --write"
},
"dependencies": {
"chef-core": "^3.0.4",
"express": "^4.18.2"
"chef-core": "^3.0.6",
"express": "^4.19.2"
},
"devDependencies": {
"@types/express": "^4.17.17",
"@types/node": "^20.3.0",
"jest": "^29.5.0",
"prettier": "^2.8.8",
"typescript": "^5.1.3"
"@types/express": "^4.17.21",
"@types/node": "^20.12.12",
"jest": "^29.7.0",
"prettier": "^3.2.5",
"typescript": "^5.4.5"
},
"resolutions": {
"minimist": "^1.2.6"
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import { createServer, requestHandler } from "./server";
export default async function startChef(config?: Partial<Config>) {
return await chef(
{ ...config, type: "express" },
{ createServer, requestHandler }
{ createServer, requestHandler },
);
}
6 changes: 3 additions & 3 deletions src/server/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import http, { RequestListener } from "http";
import https from "https";
import express, { Request, Response } from "express";
import { Cache } from "latermom";
import { Cache } from "@pietal.dev/cache";
import { readFileSync } from "fs";
import { debug } from "chef-core/config";
import { Config, Server, FileReaderResponse, getUrl } from "chef-core";
Expand All @@ -22,7 +22,7 @@ export async function createServer(config: Config): Promise<Server> {

function createExpressServer(
config: Config,
app: Express.Application
app: Express.Application,
): http.Server | https.Server {
// spread ssl from config
const { ssl } = config;
Expand All @@ -34,7 +34,7 @@ function createExpressServer(
// start ssl app and finish
return https.createServer(
{ key: readFileSync(key), cert: readFileSync(cert) },
app as RequestListener
app as RequestListener,
);
}

Expand Down
Loading

0 comments on commit 0f4b10e

Please sign in to comment.