Skip to content

Commit

Permalink
feat(cli): optional t argument for newTestEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkdev98 committed Oct 22, 2024
1 parent b40a15f commit 129de8e
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 34 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"node": ">=18"
},
"devDependencies": {
"@lightbase/eslint-config": "1.2.0",
"@lightbase/eslint-config": "2.0.0",
"@types/node": "22.7.8",
"@types/react": "18.3.11",
"@tanstack/react-query": "5.59.15",
Expand Down
16 changes: 13 additions & 3 deletions packages/cli/src/testing/events.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
import { newEvent } from "@compas/stdlib";
import { isNil, newEvent, newLogger } from "@compas/stdlib";

/**
* Create a new test event
*
* @since 0.1.0
*
* @param {import("../../types/advanced-types.d.ts").TestRunner} t
* @param {import("../../types/advanced-types.d.ts").TestRunner} [t]
* @returns {import("@compas/stdlib").InsightEvent}
*/
export function newTestEvent(t) {
return newEvent(t.log, t.signal);
if (!isNil(t) && typeof t === "object" && typeof t.log?.info === "function") {
return newEvent(t.log, t.signal);
}

return newEvent(
newLogger({
ctx: {
type: "new-test-event",
},
}),
);
}
8 changes: 1 addition & 7 deletions packages/code-gen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,7 @@
"./package.json": "./package.json"
},
"type": "module",
"keywords": [
"compas",
"generate",
"router",
"validation",
"code-gen"
],
"keywords": ["compas", "generate", "router", "validation", "code-gen"],
"license": "MIT",
"dependencies": {
"@compas/stdlib": "0.15.1"
Expand Down
5 changes: 1 addition & 4 deletions packages/create-compas/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
"bin": {
"create-compas": "src/create-compas.js"
},
"keywords": [
"compas",
"create"
],
"keywords": ["compas", "create"],
"license": "MIT",
"dependencies": {
"@compas/stdlib": "0.15.1",
Expand Down
8 changes: 1 addition & 7 deletions packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,7 @@
"./package.json": "./package.json"
},
"type": "module",
"keywords": [
"compas",
"koa",
"api",
"http",
"backend"
],
"keywords": ["compas", "koa", "api", "http", "backend"],
"license": "MIT",
"dependencies": {
"@compas/stdlib": "0.15.1",
Expand Down
7 changes: 1 addition & 6 deletions packages/stdlib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@
"./package.json": "./package.json"
},
"type": "module",
"keywords": [
"compas",
"stdlib",
"standard",
"logger"
],
"keywords": ["compas", "stdlib", "standard", "logger"],
"license": "MIT",
"dependencies": {
"@types/node": "22.7.8",
Expand Down
7 changes: 1 addition & 6 deletions packages/store/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@
"./package.json": "./package.json"
},
"type": "module",
"keywords": [
"compas",
"s3",
"postgres",
"persistence"
],
"keywords": ["compas", "s3", "postgres", "persistence"],
"license": "MIT",
"dependencies": {
"@aws-sdk/client-s3": "3.675.0",
Expand Down

0 comments on commit 129de8e

Please sign in to comment.