pepr 0.48.1-nightly.10 → 0.48.1-nightly.12
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/dist/cli/crd/create.d.ts +11 -0
- package/dist/cli/crd/create.d.ts.map +1 -0
- package/dist/cli/crd/generate.d.ts +49 -0
- package/dist/cli/crd/generate.d.ts.map +1 -0
- package/dist/cli/crd/index.d.ts +3 -0
- package/dist/cli/crd/index.d.ts.map +1 -0
- package/dist/cli/init/templates.d.ts +1 -0
- package/dist/cli/init/templates.d.ts.map +1 -1
- package/dist/cli.js +7663 -42
- package/dist/controller.js +1 -1
- package/dist/lib/controller/createHooks.d.ts +13 -0
- package/dist/lib/controller/createHooks.d.ts.map +1 -0
- package/dist/lib/core/module.d.ts.map +1 -1
- package/dist/lib.js +22 -14
- package/dist/lib.js.map +3 -3
- package/package.json +3 -2
- package/src/cli/crd/create.ts +134 -0
- package/src/cli/crd/generate.ts +317 -0
- package/src/cli/crd/index.ts +15 -0
- package/src/cli.ts +3 -0
- package/src/lib/controller/createHooks.ts +34 -0
- package/src/lib/core/module.ts +8 -20
package/dist/controller.js
CHANGED
|
@@ -51,7 +51,7 @@ if (process.env.LOG_LEVEL) {
|
|
|
51
51
|
var logger_default = Log;
|
|
52
52
|
|
|
53
53
|
// src/templates/data.json
|
|
54
|
-
var packageJSON = { name: "pepr", description: "Kubernetes application engine", author: "Defense Unicorns", homepage: "https://github.com/defenseunicorns/pepr", license: "Apache-2.0", bin: "dist/cli.js", repository: "defenseunicorns/pepr", engines: { node: ">=18.0.0" }, files: ["/dist", "/src", "!src/**/*.test.ts", "!src/fixtures/**", "!dist/**/*.test.d.ts*"], version: "0.48.1-nightly.
|
|
54
|
+
var packageJSON = { name: "pepr", description: "Kubernetes application engine", author: "Defense Unicorns", homepage: "https://github.com/defenseunicorns/pepr", license: "Apache-2.0", bin: "dist/cli.js", repository: "defenseunicorns/pepr", engines: { node: ">=18.0.0" }, files: ["/dist", "/src", "!src/**/*.test.ts", "!src/fixtures/**", "!dist/**/*.test.d.ts*"], version: "0.48.1-nightly.12", main: "dist/lib.js", types: "dist/lib.d.ts", scripts: { ci: "npm ci", "gen-data-json": "node hack/build-template-data.js", prebuild: "rm -fr dist/* && npm run gen-data-json", build: "tsc && node build.mjs && npm pack", "build:image": "npm run build && docker buildx build --output type=docker --tag pepr:dev .", "build:image:unicorn": "npm run build && docker buildx build --output type=docker --tag pepr:dev $(node scripts/read-unicorn-build-args.mjs) .", "set:version": "node scripts/set-version.js", test: "npm run test:unit && npm run test:journey && npm run test:journey-wasm", "test:artifacts": "npm run build && jest src/build-artifact.test.ts", "test:integration": "npm run test:integration:prep && npm run test:integration:run", "test:integration:prep": "./integration/prep.sh", "test:integration:run": "jest --maxWorkers=4 integration", "test:journey": "npm run test:journey:k3d && npm run build && npm run test:journey:image && npm run test:journey:run", "test:journey-wasm": "npm run test:journey:k3d && npm run build && npm run test:journey:image && npm run test:journey:run-wasm", "test:journey-wasm:unicorn": "npm run test:journey:k3d && npm run build && npm run test:journey:image:unicorn && npm run test:journey:run-wasm", "test:journey:image": "docker buildx build --output type=docker --tag pepr:dev . && k3d image import pepr:dev -c pepr-dev", "test:journey:image:unicorn": "npm run build && docker buildx build --output type=docker --tag pepr:dev $(node scripts/read-unicorn-build-args.mjs) . && k3d image import pepr:dev -c pepr-dev", "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", "test:journey:run": "jest --detectOpenHandles journey/entrypoint.test.ts && npm run test:journey:upgrade", "test:journey:run-wasm": "jest --detectOpenHandles journey/entrypoint-wasm.test.ts", "test:journey:unicorn": "npm run test:journey:k3d && npm run test:journey:image:unicorn && npm run test:journey:run", "test:journey:upgrade": "npm run test:journey:k3d && npm run test:journey:image && jest --detectOpenHandles journey/pepr-upgrade.test.ts", "test:unit": "npm run gen-data-json && jest src --coverage --detectOpenHandles --coverageDirectory=./coverage --testPathIgnorePatterns='build-artifact.test.ts'", "format:check": "eslint src && prettier --config .prettierrc src --check", "format:fix": "eslint src --fix && prettier --config .prettierrc src --write", prepare: `if [ "$NODE_ENV" != 'production' ]; then husky; fi` }, dependencies: { "@types/ramda": "0.30.2", express: "5.1.0", "fast-json-patch": "3.1.1", heredoc: "^1.3.1", "http-status-codes": "^2.3.0", "json-pointer": "^0.6.2", "kubernetes-fluent-client": "3.5.1", pino: "9.6.0", "pino-pretty": "13.0.0", "prom-client": "15.1.3", ramda: "0.30.1", sigstore: "3.1.0", "ts-morph": "^25.0.1" }, devDependencies: { "@commitlint/cli": "19.8.0", "@commitlint/config-conventional": "19.8.0", "@fast-check/jest": "^2.0.1", "@jest/globals": "29.7.0", "@types/eslint": "9.6.1", "@types/express": "5.0.1", "@types/json-pointer": "^1.0.34", "@types/node": "22.x.x", "@types/node-forge": "1.3.11", "@types/uuid": "10.0.0", "fast-check": "^4.0.0", globals: "^16.0.0", husky: "^9.1.6", jest: "29.7.0", "js-yaml": "^4.1.0", shellcheck: "^3.0.0", "ts-jest": "29.3.2", undici: "^7.0.1" }, overrides: { glob: "^9.0.0" }, peerDependencies: { "@types/prompts": "2.4.9", "@typescript-eslint/eslint-plugin": "8.23.0", "@typescript-eslint/parser": "8.23.0", commander: "13.1.0", esbuild: "0.25.0", eslint: "8.57.0", "node-forge": "1.3.1", prettier: "3.4.2", prompts: "2.4.2", typescript: "5.7.3", uuid: "11.0.5" } };
|
|
55
55
|
|
|
56
56
|
// src/lib/k8s.ts
|
|
57
57
|
var import_kubernetes_fluent_client = require("kubernetes-fluent-client");
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ControllerHooks } from ".";
|
|
2
|
+
import { Capability } from "../core/capability";
|
|
3
|
+
import { PeprModuleOptions } from "../types";
|
|
4
|
+
/**
|
|
5
|
+
* Creates controller hooks with proper handling of watch setup
|
|
6
|
+
*
|
|
7
|
+
* @param opts Module options including hooks
|
|
8
|
+
* @param capabilities List of capabilities
|
|
9
|
+
* @param ignoreNamespaces Namespaces to ignore
|
|
10
|
+
* @returns Controller hooks configuration
|
|
11
|
+
*/
|
|
12
|
+
export declare function createControllerHooks(opts: PeprModuleOptions, capabilities: Capability[], ignoreNamespaces?: string[]): ControllerHooks;
|
|
13
|
+
//# sourceMappingURL=createHooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createHooks.d.ts","sourceRoot":"","sources":["../../../src/lib/controller/createHooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,GAAG,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,iBAAiB,EACvB,YAAY,EAAE,UAAU,EAAE,EAC1B,gBAAgB,GAAE,MAAM,EAAO,GAC9B,eAAe,CAcjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/lib/core/module.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/lib/core/module.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAgB,MAAM,UAAU,CAAC;AAGxE,qBAAa,UAAU;;IAGrB;;;;;;OAMG;gBAED,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,WAAW,EAClC,YAAY,GAAE,UAAU,EAAO,EAC/B,IAAI,GAAE,iBAAsB;IAmD9B;;;;;OAKG;IACH,KAAK,qBAAkB,IAAI,CAEzB;CACH"}
|
package/dist/lib.js
CHANGED
|
@@ -2425,6 +2425,23 @@ function registerWatchEventHandlers(watcher, logEvent2, metricsCollector2) {
|
|
|
2425
2425
|
});
|
|
2426
2426
|
}
|
|
2427
2427
|
|
|
2428
|
+
// src/lib/controller/createHooks.ts
|
|
2429
|
+
function createControllerHooks(opts, capabilities, ignoreNamespaces = []) {
|
|
2430
|
+
return {
|
|
2431
|
+
beforeHook: opts.beforeHook,
|
|
2432
|
+
afterHook: opts.afterHook,
|
|
2433
|
+
onReady: async () => {
|
|
2434
|
+
if (isWatchMode() || isDevMode()) {
|
|
2435
|
+
try {
|
|
2436
|
+
setupWatch(capabilities, resolveIgnoreNamespaces(ignoreNamespaces));
|
|
2437
|
+
} catch (error) {
|
|
2438
|
+
throw new Error(`WatchError: Could not set up watch.`, { cause: error });
|
|
2439
|
+
}
|
|
2440
|
+
}
|
|
2441
|
+
}
|
|
2442
|
+
};
|
|
2443
|
+
}
|
|
2444
|
+
|
|
2428
2445
|
// src/lib/core/module.ts
|
|
2429
2446
|
var PeprModule = class {
|
|
2430
2447
|
#controller;
|
|
@@ -2456,20 +2473,11 @@ var PeprModule = class {
|
|
|
2456
2473
|
process.send(exportedCapabilities);
|
|
2457
2474
|
return;
|
|
2458
2475
|
}
|
|
2459
|
-
const controllerHooks =
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
try {
|
|
2465
|
-
setupWatch(capabilities, resolveIgnoreNamespaces(pepr?.alwaysIgnore?.namespaces));
|
|
2466
|
-
} catch (e) {
|
|
2467
|
-
logger_default.error(e, "Error setting up watch");
|
|
2468
|
-
process.exit(1);
|
|
2469
|
-
}
|
|
2470
|
-
}
|
|
2471
|
-
}
|
|
2472
|
-
};
|
|
2476
|
+
const controllerHooks = createControllerHooks(
|
|
2477
|
+
opts,
|
|
2478
|
+
capabilities,
|
|
2479
|
+
pepr?.alwaysIgnore?.namespaces
|
|
2480
|
+
);
|
|
2473
2481
|
this.#controller = new Controller(config, capabilities, controllerHooks);
|
|
2474
2482
|
if (opts.deferStart) {
|
|
2475
2483
|
return;
|