pepr 0.2.1 → 0.2.3
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/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"engines": {
|
|
10
10
|
"node": ">=18.0.0"
|
|
11
11
|
},
|
|
12
|
-
"version": "0.2.
|
|
12
|
+
"version": "0.2.3",
|
|
13
13
|
"main": "dist/index.js",
|
|
14
14
|
"types": "dist/index.d.ts",
|
|
15
15
|
"pepr": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"test:e2e:k3d": "k3d cluster delete pepr-dev && k3d cluster create pepr-dev --k3s-arg '--debug@server:0'",
|
|
32
32
|
"test:e2e:build": "npm run build && npm uninstall pepr -g && npm install -g . && pepr",
|
|
33
33
|
"test:e2e:image": "docker buildx build --tag pepr:dev . && k3d image import pepr:dev -c pepr-dev",
|
|
34
|
-
"test:e2e:run": "ava hack/e2e.test.js --sequential",
|
|
34
|
+
"test:e2e:run": "ava hack/e2e.test.js --sequential --timeout=2m",
|
|
35
35
|
"format:check": "eslint src && prettier src --check",
|
|
36
36
|
"format:fix": "eslint src --fix && prettier src --write"
|
|
37
37
|
},
|
|
@@ -74,6 +74,8 @@
|
|
|
74
74
|
],
|
|
75
75
|
"require": [
|
|
76
76
|
"ts-node/register"
|
|
77
|
-
]
|
|
77
|
+
],
|
|
78
|
+
"failFast": true,
|
|
79
|
+
"verbose": true
|
|
78
80
|
}
|
|
79
81
|
}
|
package/dist/src/cli/build.js
CHANGED
|
@@ -64,6 +64,14 @@ async function buildModule() {
|
|
|
64
64
|
const cfg = JSON.parse(moduleText);
|
|
65
65
|
const { uuid } = cfg.pepr;
|
|
66
66
|
const name = `pepr-${uuid}.js`;
|
|
67
|
+
// Read the module's version from the package.json file
|
|
68
|
+
if (cfg.dependencies.pepr && cfg.dependencies.pepr !== "file:../") {
|
|
69
|
+
const versionMatch = /(\d+\.\d+\.\d+)/.exec(cfg.dependencies.pepr);
|
|
70
|
+
if (!versionMatch || versionMatch.length < 2) {
|
|
71
|
+
throw new Error("Could not find the Pepr version in package.json");
|
|
72
|
+
}
|
|
73
|
+
cfg.pepr.version = versionMatch[1];
|
|
74
|
+
}
|
|
67
75
|
// Exit if the module's UUID could not be found
|
|
68
76
|
if (!uuid) {
|
|
69
77
|
throw new Error("Could not load the uuid in package.json");
|
|
@@ -30,7 +30,6 @@ function genPkgJSON(opts, pgkVerOverride) {
|
|
|
30
30
|
keywords: ["pepr", "k8s", "policy-engine", "pepr-module", "security"],
|
|
31
31
|
pepr: {
|
|
32
32
|
name: opts.name.trim(),
|
|
33
|
-
version: package_json_1.version,
|
|
34
33
|
uuid: pgkVerOverride ? "static-test" : uuid,
|
|
35
34
|
onError: opts.errorBehavior,
|
|
36
35
|
alwaysIgnore: {
|
|
@@ -45,7 +44,7 @@ function genPkgJSON(opts, pgkVerOverride) {
|
|
|
45
44
|
start: "pepr dev",
|
|
46
45
|
},
|
|
47
46
|
dependencies: {
|
|
48
|
-
pepr: pgkVerOverride ||
|
|
47
|
+
pepr: pgkVerOverride || `${package_json_1.version}`,
|
|
49
48
|
},
|
|
50
49
|
devDependencies: {
|
|
51
50
|
typescript,
|
|
@@ -24,7 +24,7 @@ class Webhook {
|
|
|
24
24
|
this.config = config;
|
|
25
25
|
this.host = host;
|
|
26
26
|
this.name = `pepr-${config.uuid}`;
|
|
27
|
-
this.image = `ghcr.io/defenseunicorns/pepr/controller
|
|
27
|
+
this.image = `ghcr.io/defenseunicorns/pepr/controller:v${config.version}`;
|
|
28
28
|
// Generate the ephemeral tls things
|
|
29
29
|
this._tls = (0, tls_1.genTLS)(this.host || `${this.name}.pepr-system.svc`);
|
|
30
30
|
}
|
|
@@ -332,7 +332,6 @@ class Webhook {
|
|
|
332
332
|
name: this.name,
|
|
333
333
|
description: `Pepr Module: ${this.config.description}`,
|
|
334
334
|
url: "https://github.com/defenseunicorns/pepr",
|
|
335
|
-
version: this.config.version,
|
|
336
335
|
},
|
|
337
336
|
components: [
|
|
338
337
|
{
|
package/dist/src/lib/types.d.ts
CHANGED
|
@@ -73,7 +73,7 @@ export type ModuleConfig = {
|
|
|
73
73
|
/** The user-defined name for the module */
|
|
74
74
|
name: string;
|
|
75
75
|
/** The version of Pepr that the module was originally generated with */
|
|
76
|
-
version
|
|
76
|
+
version?: string;
|
|
77
77
|
/** A unique identifier for this Pepr module. This is automatically generated by Pepr. */
|
|
78
78
|
uuid: string;
|
|
79
79
|
/** A description of the Pepr module and what it does. */
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"engines": {
|
|
10
10
|
"node": ">=18.0.0"
|
|
11
11
|
},
|
|
12
|
-
"version": "0.2.
|
|
12
|
+
"version": "0.2.3",
|
|
13
13
|
"main": "dist/index.js",
|
|
14
14
|
"types": "dist/index.d.ts",
|
|
15
15
|
"pepr": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"test:e2e:k3d": "k3d cluster delete pepr-dev && k3d cluster create pepr-dev --k3s-arg '--debug@server:0'",
|
|
32
32
|
"test:e2e:build": "npm run build && npm uninstall pepr -g && npm install -g . && pepr",
|
|
33
33
|
"test:e2e:image": "docker buildx build --tag pepr:dev . && k3d image import pepr:dev -c pepr-dev",
|
|
34
|
-
"test:e2e:run": "ava hack/e2e.test.js --sequential",
|
|
34
|
+
"test:e2e:run": "ava hack/e2e.test.js --sequential --timeout=2m",
|
|
35
35
|
"format:check": "eslint src && prettier src --check",
|
|
36
36
|
"format:fix": "eslint src --fix && prettier src --write"
|
|
37
37
|
},
|
|
@@ -74,6 +74,8 @@
|
|
|
74
74
|
],
|
|
75
75
|
"require": [
|
|
76
76
|
"ts-node/register"
|
|
77
|
-
]
|
|
77
|
+
],
|
|
78
|
+
"failFast": true,
|
|
79
|
+
"verbose": true
|
|
78
80
|
}
|
|
79
81
|
}
|