Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pepr dev regression #94

Merged
merged 1 commit into from
May 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions hack/e2e.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ let expectedLines = [
"hello-pepr: V1ConfigMap Binding created",
"hello-pepr: V1ConfigMap Binding action created",
"Server listening on port 3000",
"Using beforeHook: req => pepr$1.Log.debug(`beforeHook: ${req.uid}`)",
"Using afterHook: res => pepr$1.Log.debug(`afterHook: ${res.uid}`)",
"Using beforeHook: req => pepr_1.Log.debug(`beforeHook: ${req.uid}`)",
"Using afterHook: res => pepr_1.Log.debug(`afterHook: ${res.uid}`)",
];

function stripAnsiCodes(input) {
Expand Down
149 changes: 147 additions & 2 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"node-forge": "1.3.1",
"prompts": "2.4.2",
"rollup": "3.21.5",
"ts-node": "10.9.1",
"typescript": "5.0.4",
"uuid": "9.0.0"
},
Expand Down
6 changes: 5 additions & 1 deletion src/cli/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Webhook } from "../../src/lib/k8s/webhook";
import Log from "../../src/lib/logger";
import { buildModule } from "./build";
import { RootCmd } from "./root";
import { register } from "ts-node";

export default function (program: RootCmd) {
program
Expand Down Expand Up @@ -104,11 +105,14 @@ export default function (program: RootCmd) {

async function runDev() {
try {
const { path } = await buildModule();
const path = resolve(".", "pepr.ts");

Log.info(`Running module ${path}`);

const program = fork(path, {
// Register ts-node
execArgv: ["-r", "ts-node/register"],
// Pass the environment variables
env: {
...process.env,
LOG_LEVEL: "debug",
Expand Down