pepr 0.51.4-nightly.0 → 0.51.4-nightly.2

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/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "!dist/**/*.test.d.ts*",
18
18
  "!src/cli/docs/**"
19
19
  ],
20
- "version": "0.51.4-nightly.0",
20
+ "version": "0.51.4-nightly.2",
21
21
  "main": "dist/lib.js",
22
22
  "types": "dist/lib.d.ts",
23
23
  "scripts": {
@@ -29,24 +29,29 @@
29
29
  "build:image:unicorn": "npm run build && docker buildx build --output type=docker --tag pepr/private:dev $(node scripts/read-unicorn-build-args.mjs) .",
30
30
  "set:version": "node scripts/set-version.js",
31
31
  "test": "npm run test:unit && npm run test:journey && npm run test:journey-wasm",
32
- "test:artifacts": "npm run build && jest src/build-artifact.test.ts",
33
- "test:docs": "jest --verbose src/cli/docs/*.test.ts",
32
+ "test:artifacts": "npm run build && vitest run src/build-artifact.test.ts",
33
+ "test:docs": "vitest run --config=vitest.config.ts src/cli/docs/*.test.ts",
34
34
  "test:integration": "npm run test:integration:prep && npm run test:integration:run",
35
35
  "test:integration:prep": "./integration/prep.sh",
36
- "test:integration:run": "jest --maxWorkers=4 integration",
36
+ "test:integration:run": "vitest run --config=integration/vitest.config.ts integration",
37
37
  "test:journey": "npm run test:journey:k3d && npm run build && npm run test:journey:image && npm run test:journey:run",
38
38
  "test:journey-wasm": "npm run test:journey:k3d && npm run build && npm run test:journey:image && npm run test:journey:run-wasm",
39
39
  "test:journey-wasm:unicorn": "npm run test:journey:k3d && npm run build && npm run test:journey:image:unicorn && npm run test:journey:run-wasm",
40
40
  "test:journey:image": "docker buildx build --output type=docker --tag pepr:dev . && k3d image import pepr:dev -c pepr-dev",
41
41
  "test:journey:image:unicorn": "npm run build && docker buildx build --output type=docker --tag pepr/private:dev $(node scripts/read-unicorn-build-args.mjs) . && k3d image import pepr/private:dev -c pepr-dev",
42
42
  "test:journey:k3d": "k3d cluster delete pepr-dev && k3d cluster create pepr-dev --k3s-arg '--debug@server:0' --wait && kubectl rollout status deployment -n kube-system",
43
- "test:journey:run": "jest --detectOpenHandles journey/entrypoint.test.ts && npm run test:journey:upgrade",
44
- "test:journey:run-wasm": "jest --detectOpenHandles journey/entrypoint-wasm.test.ts",
43
+ "test:journey:run": "vitest run --config=journey/vitest.config.ts journey/entrypoint.test.ts && npm run test:journey:upgrade",
44
+ "test:journey:run-wasm": "vitest run --config=journey/vitest.config.ts journey/entrypoint-wasm.test.ts",
45
45
  "test:journey:unicorn": "npm run test:journey:k3d && npm run test:journey:image:unicorn && npm run test:journey:run",
46
- "test:journey:upgrade": "npm run test:journey:k3d && npm run test:journey:image && jest --detectOpenHandles journey/pepr-upgrade.test.ts",
47
- "test:unit": "npm run gen-data-json && jest src --coverage --detectOpenHandles --coverageDirectory=./coverage --testPathIgnorePatterns=\"build-artifact.test.ts|src/cli/docs/.*\\.test\\.ts\"",
48
- "format:check": "eslint --ignore-pattern src/templates/eslint.config.mjs src && prettier --config .prettierrc src --check && npx -y markdownlint-cli --ignore adr --ignore integration/testroot --ignore pepr-test-module --ignore pepr-upgrade-test --ignore node_modules \"**/*.md\"",
49
- "format:fix": "eslint --fix --ignore-pattern src/templates/eslint.config.mjs src && prettier --config .prettierrc src --write && npx -y markdownlint-cli --fix --ignore adr --ignore integration/testroot --ignore pepr-test-module --ignore pepr-upgrade-test --ignore node_modules \"**/*.md\"",
46
+ "format:check": "npm run format:src && npm run format:tests && npm run format:markdown && npm run format:integration && npm run format:prettier -- --check",
47
+ "format:fix": "npm run format:src -- --fix && npm run format:markdown -- --fix && npm run format:integration -- --fix && npm run format:prettier -- --write",
48
+ "format:integration": "eslint --config integration/eslint.config.mjs integration/cli integration/helpers",
49
+ "format:markdown": "npx -y markdownlint-cli --ignore adr --ignore integration/testroot --ignore pepr-test-module --ignore pepr-upgrade-test --ignore node_modules \"**/*.md\"",
50
+ "format:prettier": "prettier --config .prettierrc src integration/cli/**/*.ts integration/helpers/**/*.ts",
51
+ "format:src": "eslint 'src/**/*.ts' --ignore-pattern '**/*.test.ts' --ignore-pattern src/templates/eslint.config.mjs",
52
+ "format:tests": "eslint --config eslint.test.config.mjs 'src/**/*.test.ts'",
53
+ "test:journey:upgrade": "npm run test:journey:k3d && npm run test:journey:image && vitest run --config=journey/vitest.config.ts journey/pepr-upgrade.test.ts",
54
+ "test:unit": "npm run gen-data-json && NODE_OPTIONS=--no-deprecation vitest run --coverage",
50
55
  "prepare": "if [ \"$NODE_ENV\" != 'production' ]; then husky; fi"
51
56
  },
52
57
  "dependencies": {
@@ -68,25 +73,25 @@
68
73
  "devDependencies": {
69
74
  "@commitlint/cli": "19.8.1",
70
75
  "@commitlint/config-conventional": "19.8.1",
71
- "@fast-check/jest": "^2.0.1",
72
- "@jest/globals": "29.7.0",
76
+ "@fast-check/vitest": "^0.2.1",
73
77
  "@types/eslint": "9.6.1",
74
78
  "@types/express": "5.0.3",
75
79
  "@types/json-pointer": "^1.0.34",
76
- "@types/node": "22.x.x",
80
+ "@types/node": "24.x.x",
77
81
  "@types/node-forge": "1.3.11",
78
82
  "@types/uuid": "10.0.0",
83
+ "@vitest/coverage-v8": "^3.2.3",
79
84
  "fast-check": "^4.0.0",
80
85
  "globals": "^16.0.0",
81
86
  "husky": "^9.1.6",
82
- "jest": "29.7.0",
83
87
  "js-yaml": "^4.1.0",
84
88
  "shellcheck": "^3.0.0",
85
- "ts-jest": "29.3.4",
86
- "undici": "^7.0.1"
89
+ "undici": "^7.0.1",
90
+ "vitest": "^3.2.3"
87
91
  },
88
92
  "overrides": {
89
- "glob": "^9.0.0"
93
+ "glob": "^9.0.0",
94
+ "brace-expansion": "1.1.11"
90
95
  },
91
96
  "peerDependencies": {
92
97
  "@types/prompts": "2.4.9",
@@ -105,6 +105,9 @@ export function genPkgJSON(opts: InitOptions, pgkVerOverride?: string): peprPack
105
105
  devDependencies: {
106
106
  typescript,
107
107
  },
108
+ overrides: {
109
+ "brace-expansion": "1.1.11",
110
+ },
108
111
  };
109
112
 
110
113
  return {
@@ -12,6 +12,7 @@ import { resolveIgnoreNamespaces } from "./ignoredNamespaces";
12
12
  import { Assets } from "./assets";
13
13
  import { Event, WebhookType } from "../enums";
14
14
  import { Binding } from "../types";
15
+ import Log from "../telemetry/logger";
15
16
 
16
17
  export const peprIgnoreNamespaces: string[] = ["kube-system", "pepr-system"];
17
18
 
@@ -49,7 +50,7 @@ export async function generateWebhookRules(
49
50
  const { config, capabilities } = assets;
50
51
 
51
52
  const rules = capabilities.flatMap(capability => {
52
- console.info(`Module ${config.uuid} has capability: ${capability.name}`);
53
+ Log.info(`Module ${config.uuid} has capability: ${capability.name}`);
53
54
 
54
55
  return capability.bindings
55
56
  .map(binding => validateRule(binding, isMutateWebhook))
@@ -18,7 +18,7 @@ export class MeasureWebhookTimeout {
18
18
  start(timeout: number = 10): void {
19
19
  this.#startTime = getNow();
20
20
  this.timeout = timeout;
21
- Log.info(`Starting timer at ${this.#startTime}`);
21
+ Log.debug(`Starting timer at ${this.#startTime}`);
22
22
  }
23
23
 
24
24
  stop(): void {
@@ -27,7 +27,7 @@ export class MeasureWebhookTimeout {
27
27
  }
28
28
 
29
29
  const elapsedTime = getNow() - this.#startTime;
30
- Log.info(`Webhook ${this.#startTime} took ${elapsedTime}ms`);
30
+ Log.debug(`Webhook ${this.#startTime} took ${elapsedTime}ms`);
31
31
  this.#startTime = null;
32
32
 
33
33
  if (elapsedTime > this.timeout) {
package/src/lib.ts CHANGED
@@ -8,8 +8,10 @@ import { PeprMutateRequest } from "./lib/mutate-request";
8
8
  import * as PeprUtils from "./lib/utils";
9
9
  import { PeprValidateRequest } from "./lib/validate-request";
10
10
  import * as sdk from "./sdk/sdk";
11
+ import { metricsCollector } from "./lib/telemetry/metrics";
11
12
 
12
13
  export {
14
+ metricsCollector,
13
15
  Capability,
14
16
  K8s,
15
17
  Log,