Skip to content

Commit

Permalink
starting dependency-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
farskipper committed Nov 5, 2023
1 parent 9ad5e53 commit 377817e
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 44 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jobs:
fail-fast: true
matrix:
node-version:
- lts/* # LTS version
- "17" # latest version
- lts/*
- latest
os: [ubuntu-latest, macOS-latest, windows-latest]

steps:
Expand Down
2 changes: 1 addition & 1 deletion packages/krl-compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"homepage": "https://github.com/Picolab/pico-engine#readme",
"devDependencies": {
"ava": "^4.0.0",
"ava": "^5.3.1",
"contra": "^1.9.4",
"diff-lines": "^1.1.0",
"standard": "^12.0.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/krl-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"homepage": "https://github.com/Picolab/pico-engine#readme",
"devDependencies": {
"ava": "^4.0.0",
"ava": "^5.3.1",
"krl-parser": "^1.3.0",
"standard": "^12.0.1"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/krl-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"homepage": "https://github.com/Picolab/pico-engine#readme",
"devDependencies": {
"ava": "^2.4.0",
"ts-node": "^9.1.1",
"typescript": "^4.1.2"
"ts-node": "^10.9.1",
"typescript": "^5.2.2"
},
"dependencies": {
"excerpt-at-line-col": "^1.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/krl-stdlib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
"@types/leveldown": "^4.0.0",
"@types/levelup": "^3.1.0",
"@types/lodash": "^4.14.123",
"@types/node": "^14.0.24",
"@types/node": "^20.8.10",
"ava": "^1.4.1",
"ts-node": "^10.4.0",
"typescript": "^4.1.2"
"typescript": "^5.2.2"
},
"dependencies": {
"json-log": "^3.0.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/pico-engine-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@
"@types/abstract-leveldown": "^5.0.1",
"@types/levelup": "^4.3.3",
"@types/lodash": "^4.14.123",
"@types/node": "^14.14.10",
"@types/node": "^20.8.10",
"ava": "^1.4.1",
"ts-node": "^10.4.0",
"typescript": "^4.1.2"
"typescript": "^5.2.2"
},
"ava": {
"compileEnhancements": false,
Expand Down
70 changes: 38 additions & 32 deletions packages/pico-engine-core/test/modules/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as _ from "lodash";
import makeCoreAndKrlCtx from "../helpers/makeCoreAndKrlCtx";

test("http module", async function (t) {
var server = http.createServer(function (req, res) {
var server = http.createServer({ keepAliveTimeout: 0 }, function (req, res) {
var body = "";
req.on("data", function (buffer) {
body += buffer.toString();
Expand All @@ -26,7 +26,7 @@ test("http module", async function (t) {
body: body,
},
undefined,
2
2,
);
res.writeHead(200, {
"Content-Type": "application/json",
Expand Down Expand Up @@ -65,7 +65,7 @@ test("http module", async function (t) {
url: "/?a=1",
headers: {
host,
connection: "close",
connection: "keep-alive",
"user-agent": "pico-engine-core-http",
accept: "*/*",
"accept-encoding": "gzip,deflate",
Expand All @@ -77,7 +77,7 @@ test("http module", async function (t) {
status_line: "OK",
headers: {
"content-type": "application/json",
connection: "close",
connection: "keep-alive",
"da-extra-header": "wat?",
},
});
Expand Down Expand Up @@ -105,7 +105,7 @@ test("http module", async function (t) {
authorization: "Basic Ym9iOm5vcGFzcw==",
"user-agent": "pico-engine-core-http",
"content-length": "14",
connection: "close",
connection: "keep-alive",
"content-type": "text/plain;charset=UTF-8",
accept: "*/*",
"accept-encoding": "gzip,deflate",
Expand All @@ -117,7 +117,7 @@ test("http module", async function (t) {
status_line: "OK",
headers: {
"content-type": "application/json",
connection: "close",
connection: "keep-alive",
"da-extra-header": "wat?",
},
});
Expand All @@ -138,7 +138,7 @@ test("http module", async function (t) {
host,
"content-type": "application/x-www-form-urlencoded",
"content-length": "45",
connection: "close",
connection: "keep-alive",
"user-agent": "pico-engine-core-http",
accept: "*/*",
"accept-encoding": "gzip,deflate",
Expand All @@ -150,7 +150,7 @@ test("http module", async function (t) {
status_line: "OK",
headers: {
"content-type": "application/json",
connection: "close",
connection: "keep-alive",
"da-extra-header": "wat?",
},
});
Expand All @@ -171,7 +171,7 @@ test("http module", async function (t) {
host,
"content-type": "application/json",
"content-length": "41",
connection: "close",
connection: "keep-alive",
"user-agent": "pico-engine-core-http",
accept: "*/*",
"accept-encoding": "gzip,deflate",
Expand All @@ -183,7 +183,7 @@ test("http module", async function (t) {
status_line: "OK",
headers: {
"content-type": "application/json",
connection: "close",
connection: "keep-alive",
"da-extra-header": "wat?",
},
});
Expand All @@ -199,7 +199,7 @@ test("http module", async function (t) {
headers: {
host,
"content-length": "0",
connection: "close",
connection: "keep-alive",
"user-agent": "pico-engine-core-http",
accept: "*/*",
"accept-encoding": "gzip,deflate",
Expand All @@ -211,7 +211,7 @@ test("http module", async function (t) {
status_line: "OK",
headers: {
"content-type": "application/json",
connection: "close",
connection: "keep-alive",
"da-extra-header": "wat?",
},
});
Expand All @@ -227,7 +227,7 @@ test("http module", async function (t) {
status_code: 200,
status_line: "OK",
headers: {
connection: "close",
connection: "keep-alive",
},
});

Expand All @@ -238,7 +238,7 @@ test("http module", async function (t) {
err = await t.throwsAsync(khttp[method](krlCtx, { url: { one: 1 } }));
t.is(
err + "",
`TypeError: http:${method} was given [Map] instead of a url string`
`TypeError: http:${method} was given [Map] instead of a url string`,
);
}
});
Expand All @@ -259,10 +259,13 @@ test("http autosend", async function (t) {
serverRespond = resolve;
});

const server = http.createServer(function (req, res) {
res.end("some response");
serverRespond();
});
const server = http.createServer(
{ keepAliveTimeout: 0 },
function (req, res) {
res.end("some response");
serverRespond();
},
);
server.unref();
await new Promise(function (resolve) {
server.listen(0, () => resolve(undefined));
Expand All @@ -285,7 +288,7 @@ test("http autosend", async function (t) {
t.deepEqual(
signaledEvents,
[],
"should be empty bc the server has not yet responded"
"should be empty bc the server has not yet responded",
);

await serverResponse;
Expand All @@ -311,7 +314,7 @@ test("http autosend", async function (t) {
status_code: 200,
status_line: "OK",
headers: {
connection: "close",
connection: "keep-alive",
"content-length": "13",
},
},
Expand All @@ -324,16 +327,19 @@ test("http redirects", async function (t) {
const { core, krlCtx } = await makeCoreAndKrlCtx();
const khttp = core.modules["http"];

const server = http.createServer(function (req, res) {
if (req.url === "/redir") {
res.writeHead(302, {
Location: "/other",
});
res.end();
} else {
res.end("some response");
}
});
const server = http.createServer(
{ keepAliveTimeout: 0 },
function (req, res) {
if (req.url === "/redir") {
res.writeHead(302, {
Location: "/other",
});
res.end();
} else {
res.end("some response");
}
},
);
server.unref();
await new Promise(function (resolve) {
server.listen(0, () => resolve(undefined));
Expand All @@ -351,7 +357,7 @@ test("http redirects", async function (t) {
content_length: 13,
content_type: null,
headers: {
connection: "close",
connection: "keep-alive",
"content-length": "13",
},
status_code: 200,
Expand All @@ -369,7 +375,7 @@ test("http redirects", async function (t) {
content_length: 0,
content_type: null,
headers: {
connection: "close",
connection: "keep-alive",
location: url + "/other",
"transfer-encoding": "chunked",
},
Expand Down
4 changes: 2 additions & 2 deletions packages/pico-engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@
"@types/leveldown": "^4.0.0",
"@types/levelup": "^3.1.0",
"@types/lodash": "^4.14.123",
"@types/node": "^14.14.10",
"@types/node": "^20.8.10",
"ava": "^1.4.1",
"onchange": "^6.0.0",
"scriptsp": "^1.1.1",
"temp-dir": "^2.0.0",
"ts-node": "^10.4.0",
"typescript": "^4.1.2"
"typescript": "^5.2.2"
},
"ava": {
"compileEnhancements": false,
Expand Down

0 comments on commit 377817e

Please sign in to comment.