pepr 0.1.36 → 0.1.37
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/.env +0 -0
- package/dist/package.json +1 -2
- package/dist/src/cli/build.js +3 -3
- package/dist/src/cli/deploy.js +2 -2
- package/dist/src/cli/dev.js +2 -2
- package/dist/src/cli/index.js +3 -3
- package/dist/src/cli/init/index.d.ts +1 -1
- package/dist/src/cli/init/index.js +1 -1
- package/dist/src/cli/init/templates.js +5 -4
- package/dist/src/cli/init/walkthrough.js +1 -1
- package/dist/src/cli/root.js +1 -1
- package/dist/src/cli/test.js +1 -1
- package/dist/src/cli/version.d.ts +1 -0
- package/dist/src/cli/version.js +6 -0
- package/dist/src/lib/k8s/webhook.d.ts +1 -1
- package/dist/src/lib/k8s/webhook.js +1 -1
- package/dist/src/lib/module.d.ts +4 -1
- package/dist/src/lib/module.js +8 -2
- package/package.json +1 -2
package/.env
ADDED
|
File without changes
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pepr",
|
|
3
|
-
"version": "0.1.36",
|
|
4
3
|
"description": "Kubernetes application engine",
|
|
5
4
|
"author": "Defense Unicorns",
|
|
6
5
|
"homepage": "https://github.com/defenseunicorns/pepr",
|
|
@@ -10,6 +9,7 @@
|
|
|
10
9
|
"engines": {
|
|
11
10
|
"node": ">=18.0.0"
|
|
12
11
|
},
|
|
12
|
+
"version": "0.1.37",
|
|
13
13
|
"main": "dist/index.js",
|
|
14
14
|
"types": "dist/index.d.ts",
|
|
15
15
|
"pepr": {
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
|
-
"preversion": "npm run prepublishOnly",
|
|
28
27
|
"build": "rm -fr dist/* && tsc -p tsconfig.build.json",
|
|
29
28
|
"test": "ava",
|
|
30
29
|
"lint": "npx eslint src",
|
package/dist/src/cli/build.js
CHANGED
|
@@ -7,14 +7,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.buildModule = void 0;
|
|
9
9
|
const plugin_json_1 = __importDefault(require("@rollup/plugin-json"));
|
|
10
|
-
const package_json_1 = require("
|
|
10
|
+
const package_json_1 = require("package.json");
|
|
11
11
|
const plugin_node_resolve_1 = __importDefault(require("@rollup/plugin-node-resolve"));
|
|
12
12
|
const plugin_typescript_1 = __importDefault(require("@rollup/plugin-typescript"));
|
|
13
13
|
const fs_1 = require("fs");
|
|
14
14
|
const path_1 = require("path");
|
|
15
15
|
const rollup_1 = require("rollup");
|
|
16
|
-
const logger_1 = __importDefault(require("
|
|
17
|
-
const webhook_1 = require("
|
|
16
|
+
const logger_1 = __importDefault(require("src/lib/logger"));
|
|
17
|
+
const webhook_1 = require("src/lib/k8s/webhook");
|
|
18
18
|
function default_1(program) {
|
|
19
19
|
program
|
|
20
20
|
.command("build")
|
package/dist/src/cli/deploy.js
CHANGED
|
@@ -6,8 +6,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
6
6
|
};
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
const fs_1 = require("fs");
|
|
9
|
-
const webhook_1 = require("
|
|
10
|
-
const logger_1 = __importDefault(require("
|
|
9
|
+
const webhook_1 = require("src/lib/k8s/webhook");
|
|
10
|
+
const logger_1 = __importDefault(require("src/lib/logger"));
|
|
11
11
|
const build_1 = require("./build");
|
|
12
12
|
const prompts_1 = require("prompts");
|
|
13
13
|
function default_1(program) {
|
package/dist/src/cli/dev.js
CHANGED
|
@@ -10,8 +10,8 @@ const chokidar_1 = require("chokidar");
|
|
|
10
10
|
const fs_1 = require("fs");
|
|
11
11
|
const path_1 = require("path");
|
|
12
12
|
const prompts_1 = require("prompts");
|
|
13
|
-
const webhook_1 = require("
|
|
14
|
-
const logger_1 = __importDefault(require("
|
|
13
|
+
const webhook_1 = require("src/lib/k8s/webhook");
|
|
14
|
+
const logger_1 = __importDefault(require("src/lib/logger"));
|
|
15
15
|
const build_1 = require("./build");
|
|
16
16
|
function default_1(program) {
|
|
17
17
|
program
|
package/dist/src/cli/index.js
CHANGED
|
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6
6
|
};
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
const package_json_1 = require("../../package.json");
|
|
9
8
|
const banner_1 = require("./banner");
|
|
10
9
|
const build_1 = __importDefault(require("./build"));
|
|
11
10
|
const capability_1 = __importDefault(require("./capability"));
|
|
@@ -14,10 +13,11 @@ const dev_1 = __importDefault(require("./dev"));
|
|
|
14
13
|
const init_1 = __importDefault(require("./init"));
|
|
15
14
|
const root_1 = require("./root");
|
|
16
15
|
const test_1 = __importDefault(require("./test"));
|
|
16
|
+
const version_1 = require("./version");
|
|
17
17
|
const program = new root_1.RootCmd();
|
|
18
18
|
program
|
|
19
|
-
.version(
|
|
20
|
-
.description(`Pepr Kubernetes Thingy (v${
|
|
19
|
+
.version(version_1.version)
|
|
20
|
+
.description(`Pepr Kubernetes Thingy (v${version_1.version})`)
|
|
21
21
|
.action(() => {
|
|
22
22
|
if (program.args.length < 1) {
|
|
23
23
|
console.log(banner_1.banner);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { RootCmd } from "
|
|
1
|
+
import { RootCmd } from "src/cli/root";
|
|
2
2
|
export default function (program: RootCmd): void;
|
|
@@ -7,7 +7,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
const child_process_1 = require("child_process");
|
|
9
9
|
const path_1 = require("path");
|
|
10
|
-
const logger_1 = __importDefault(require("
|
|
10
|
+
const logger_1 = __importDefault(require("src/lib/logger"));
|
|
11
11
|
const templates_1 = require("./templates");
|
|
12
12
|
const utils_1 = require("./utils");
|
|
13
13
|
const walkthrough_1 = require("./walkthrough");
|
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
// SPDX-FileCopyrightText: 2023-Present The Pepr Authors
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.snippet = exports.helloPeprTS = exports.samplesYaml = exports.readme = exports.prettierRC = exports.gitIgnore = exports.tsConfig = exports.genPkgJSON = exports.genPeprTS = void 0;
|
|
6
|
+
const client_node_1 = require("@kubernetes/client-node");
|
|
7
|
+
const package_json_1 = require("package.json");
|
|
8
|
+
const version_1 = require("src/cli/version");
|
|
6
9
|
const util_1 = require("util");
|
|
7
10
|
const uuid_1 = require("uuid");
|
|
8
|
-
const package_json_1 = require("../../../package.json");
|
|
9
11
|
const utils_1 = require("./utils");
|
|
10
|
-
const client_node_1 = require("@kubernetes/client-node");
|
|
11
12
|
function genPeprTS() {
|
|
12
13
|
return {
|
|
13
14
|
path: "pepr.ts",
|
|
@@ -43,7 +44,7 @@ function genPkgJSON(opts) {
|
|
|
43
44
|
keywords: ["pepr", "k8s", "policy-engine", "pepr-module", "security"],
|
|
44
45
|
pepr: {
|
|
45
46
|
name: opts.name.trim(),
|
|
46
|
-
version:
|
|
47
|
+
version: version_1.version,
|
|
47
48
|
uuid,
|
|
48
49
|
onError: opts.errorBehavior,
|
|
49
50
|
alwaysIgnore: {
|
|
@@ -56,7 +57,7 @@ function genPkgJSON(opts) {
|
|
|
56
57
|
start: "pepr dev",
|
|
57
58
|
},
|
|
58
59
|
dependencies: {
|
|
59
|
-
pepr: `^${
|
|
60
|
+
pepr: `^${version_1.version}`,
|
|
60
61
|
},
|
|
61
62
|
devDependencies: {
|
|
62
63
|
typescript,
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
exports.confirm = exports.walkthrough = void 0;
|
|
9
9
|
const fs_1 = require("fs");
|
|
10
10
|
const prompts_1 = __importDefault(require("prompts"));
|
|
11
|
-
const types_1 = require("
|
|
11
|
+
const types_1 = require("src/lib/types");
|
|
12
12
|
const templates_1 = require("./templates");
|
|
13
13
|
const utils_1 = require("./utils");
|
|
14
14
|
function walkthrough() {
|
package/dist/src/cli/root.js
CHANGED
|
@@ -7,7 +7,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.RootCmd = void 0;
|
|
9
9
|
const commander_1 = require("commander");
|
|
10
|
-
const logger_1 = __importDefault(require("
|
|
10
|
+
const logger_1 = __importDefault(require("src/lib/logger"));
|
|
11
11
|
class RootCmd extends commander_1.Command {
|
|
12
12
|
createCommand(name) {
|
|
13
13
|
const cmd = new commander_1.Command(name);
|
package/dist/src/cli/test.js
CHANGED
|
@@ -9,7 +9,7 @@ const child_process_1 = require("child_process");
|
|
|
9
9
|
const chokidar_1 = require("chokidar");
|
|
10
10
|
const path_1 = require("path");
|
|
11
11
|
const util_1 = require("util");
|
|
12
|
-
const logger_1 = __importDefault(require("
|
|
12
|
+
const logger_1 = __importDefault(require("src/lib/logger"));
|
|
13
13
|
const build_1 = require("./build");
|
|
14
14
|
const exec = (0, util_1.promisify)(child_process_1.exec);
|
|
15
15
|
function default_1(program) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const version: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { V1ClusterRole, V1ClusterRoleBinding, V1Deployment, V1MutatingWebhookConfiguration, V1Namespace, V1NetworkPolicy, V1Secret, V1Service, V1ServiceAccount } from "@kubernetes/client-node";
|
|
2
|
-
import { ModuleConfig } from "
|
|
2
|
+
import { ModuleConfig } from "src/lib/types";
|
|
3
3
|
import { TLSOut } from "./tls";
|
|
4
4
|
export declare class Webhook {
|
|
5
5
|
private readonly config;
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
exports.Webhook = void 0;
|
|
9
9
|
const client_node_1 = require("@kubernetes/client-node");
|
|
10
10
|
const zlib_1 = require("zlib");
|
|
11
|
-
const logger_1 = __importDefault(require("
|
|
11
|
+
const logger_1 = __importDefault(require("src/lib/logger"));
|
|
12
12
|
const tls_1 = require("./tls");
|
|
13
13
|
const peprIgnore = {
|
|
14
14
|
key: "pepr.dev",
|
package/dist/src/lib/module.d.ts
CHANGED
|
@@ -5,13 +5,16 @@ export type PackageJSON = {
|
|
|
5
5
|
pepr: ModuleConfig;
|
|
6
6
|
};
|
|
7
7
|
export declare class PeprModule {
|
|
8
|
+
private readonly _deferStart;
|
|
8
9
|
private _controller;
|
|
9
10
|
/**
|
|
10
11
|
* Create a new Pepr runtime
|
|
11
12
|
*
|
|
12
13
|
* @param config The configuration for the Pepr runtime
|
|
14
|
+
* @param capabilities The capabilities to be loaded into the Pepr runtime
|
|
15
|
+
* @param _deferStart (optional) If set to `true`, the Pepr runtime will not be started automatically. This can be used to start the Pepr runtime manually with `start()`.
|
|
13
16
|
*/
|
|
14
|
-
constructor({ description, pepr }: PackageJSON, capabilities?: Capability[],
|
|
17
|
+
constructor({ description, pepr }: PackageJSON, capabilities?: Capability[], _deferStart?: boolean);
|
|
15
18
|
/**
|
|
16
19
|
* Start the Pepr runtime manually.
|
|
17
20
|
* Normally this is called automatically when the Pepr module is instantiated, but can be called manually if `deferStart` is set to `true` in the constructor.
|
package/dist/src/lib/module.js
CHANGED
|
@@ -14,12 +14,15 @@ class PeprModule {
|
|
|
14
14
|
* Create a new Pepr runtime
|
|
15
15
|
*
|
|
16
16
|
* @param config The configuration for the Pepr runtime
|
|
17
|
+
* @param capabilities The capabilities to be loaded into the Pepr runtime
|
|
18
|
+
* @param _deferStart (optional) If set to `true`, the Pepr runtime will not be started automatically. This can be used to start the Pepr runtime manually with `start()`.
|
|
17
19
|
*/
|
|
18
|
-
constructor({ description, pepr }, capabilities = [],
|
|
20
|
+
constructor({ description, pepr }, capabilities = [], _deferStart = false) {
|
|
21
|
+
this._deferStart = _deferStart;
|
|
19
22
|
const config = index_1.utils.mergeDeepWith(index_1.utils.concat, pepr, alwaysIgnore);
|
|
20
23
|
config.description = description;
|
|
21
24
|
this._controller = new controller_1.Controller(config, capabilities);
|
|
22
|
-
if (!
|
|
25
|
+
if (!_deferStart) {
|
|
23
26
|
this.start();
|
|
24
27
|
}
|
|
25
28
|
}
|
|
@@ -30,6 +33,9 @@ class PeprModule {
|
|
|
30
33
|
* @param port
|
|
31
34
|
*/
|
|
32
35
|
start(port = 3000) {
|
|
36
|
+
if (!this._deferStart) {
|
|
37
|
+
throw new Error("Cannot start Pepr module: Pepr module was not instantiated with deferStart=true");
|
|
38
|
+
}
|
|
33
39
|
this._controller.startServer(port);
|
|
34
40
|
}
|
|
35
41
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pepr",
|
|
3
|
-
"version": "0.1.36",
|
|
4
3
|
"description": "Kubernetes application engine",
|
|
5
4
|
"author": "Defense Unicorns",
|
|
6
5
|
"homepage": "https://github.com/defenseunicorns/pepr",
|
|
@@ -10,6 +9,7 @@
|
|
|
10
9
|
"engines": {
|
|
11
10
|
"node": ">=18.0.0"
|
|
12
11
|
},
|
|
12
|
+
"version": "0.1.37",
|
|
13
13
|
"main": "dist/index.js",
|
|
14
14
|
"types": "dist/index.d.ts",
|
|
15
15
|
"pepr": {
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
|
-
"preversion": "npm run prepublishOnly",
|
|
28
27
|
"build": "rm -fr dist/* && tsc -p tsconfig.build.json",
|
|
29
28
|
"test": "ava",
|
|
30
29
|
"lint": "npx eslint src",
|