pepr 0.49.0-nightly.9 → 0.50.0-nightly.0
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/format/format.helpers.d.ts.map +1 -0
- package/dist/cli/{format.d.ts → format/index.d.ts} +2 -2
- package/dist/cli/format/index.d.ts.map +1 -0
- package/dist/cli/init/templates.d.ts +1 -18
- package/dist/cli/init/templates.d.ts.map +1 -1
- package/dist/cli/update/index.d.ts +3 -0
- package/dist/cli/update/index.d.ts.map +1 -0
- package/dist/cli.js +193 -184
- package/dist/controller.js +1 -1
- package/package.json +6 -6
- package/src/cli/{format.ts → format/index.ts} +1 -1
- package/src/cli/init/templates.ts +17 -3
- package/src/cli/{update.ts → update/index.ts} +30 -3
- package/src/templates/capabilities/hello-pepr.ts +1 -1
- package/src/templates/eslint.config.mjs +45 -0
- package/dist/cli/format.d.ts.map +0 -1
- package/dist/cli/format.helpers.d.ts.map +0 -1
- package/dist/cli/update.d.ts +0 -3
- package/dist/cli/update.d.ts.map +0 -1
- package/src/templates/.eslintrc.json +0 -6
- package/src/templates/.eslintrc.template.json +0 -18
- /package/dist/cli/{format.helpers.d.ts → format/format.helpers.d.ts} +0 -0
- /package/src/cli/{format.helpers.ts → format/format.helpers.ts} +0 -0
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*", "!src/cli/docs/**"], version: "0.
|
|
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*", "!src/cli/docs/**"], version: "0.50.0-nightly.0", 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:docs": "jest --verbose src/cli/docs/*.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|src/cli/docs/.*\\.test\\.ts"', "format:check": "eslint --ignore-pattern src/templates/eslint.config.mjs src && prettier --config .prettierrc src --check", "format:fix": "eslint --fix --ignore-pattern src/templates/eslint.config.mjs src && 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.3", 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.1", "@commitlint/config-conventional": "19.8.1", "@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: "^9.26.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");
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"!dist/**/*.test.d.ts*",
|
|
18
18
|
"!src/cli/docs/**"
|
|
19
19
|
],
|
|
20
|
-
"version": "0.
|
|
20
|
+
"version": "0.50.0-nightly.0",
|
|
21
21
|
"main": "dist/lib.js",
|
|
22
22
|
"types": "dist/lib.d.ts",
|
|
23
23
|
"scripts": {
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"test:journey:unicorn": "npm run test:journey:k3d && npm run test:journey:image:unicorn && npm run test:journey:run",
|
|
46
46
|
"test:journey:upgrade": "npm run test:journey:k3d && npm run test:journey:image && jest --detectOpenHandles journey/pepr-upgrade.test.ts",
|
|
47
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 src && prettier --config .prettierrc src --check",
|
|
49
|
-
"format:fix": "eslint
|
|
48
|
+
"format:check": "eslint --ignore-pattern src/templates/eslint.config.mjs src && prettier --config .prettierrc src --check",
|
|
49
|
+
"format:fix": "eslint --fix --ignore-pattern src/templates/eslint.config.mjs src && prettier --config .prettierrc src --write",
|
|
50
50
|
"prepare": "if [ \"$NODE_ENV\" != 'production' ]; then husky; fi"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"ts-morph": "^25.0.1"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@commitlint/cli": "19.8.
|
|
69
|
-
"@commitlint/config-conventional": "19.8.
|
|
68
|
+
"@commitlint/cli": "19.8.1",
|
|
69
|
+
"@commitlint/config-conventional": "19.8.1",
|
|
70
70
|
"@fast-check/jest": "^2.0.1",
|
|
71
71
|
"@jest/globals": "29.7.0",
|
|
72
72
|
"@types/eslint": "9.6.1",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"@typescript-eslint/parser": "8.23.0",
|
|
94
94
|
"commander": "13.1.0",
|
|
95
95
|
"esbuild": "0.25.0",
|
|
96
|
-
"eslint": "
|
|
96
|
+
"eslint": "^9.26.0",
|
|
97
97
|
"node-forge": "1.3.1",
|
|
98
98
|
"prettier": "3.4.2",
|
|
99
99
|
"prompts": "2.4.2",
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
import { dumpYaml } from "@kubernetes/client-node";
|
|
5
5
|
import { inspect } from "util";
|
|
6
6
|
import { v4 as uuidv4 } from "uuid";
|
|
7
|
+
import { readFileSync } from "fs";
|
|
8
|
+
import path from "path";
|
|
7
9
|
|
|
8
|
-
import eslintJSON from "../../templates/.eslintrc.template.json";
|
|
9
10
|
import peprSnippetsJSON from "../../templates/pepr.code-snippets.json";
|
|
10
11
|
import prettierJSON from "../../templates/.prettierrc.json";
|
|
11
12
|
import samplesJSON from "../../templates/capabilities/hello-pepr.samples.json";
|
|
@@ -159,6 +160,19 @@ export const prettier = {
|
|
|
159
160
|
};
|
|
160
161
|
|
|
161
162
|
export const eslint = {
|
|
162
|
-
path: ".
|
|
163
|
-
data:
|
|
163
|
+
path: "eslint.config.mjs",
|
|
164
|
+
data: readFileSync(
|
|
165
|
+
path.resolve(
|
|
166
|
+
((): string => {
|
|
167
|
+
const fullPath = __dirname;
|
|
168
|
+
const lengthOfSuffix = "pepr/".length;
|
|
169
|
+
// Find the last occurrence of "pepr/"
|
|
170
|
+
const lastPeprIndex = fullPath.lastIndexOf("pepr/");
|
|
171
|
+
// Return the path up to and including the last "pepr/"
|
|
172
|
+
return fullPath.substring(0, lastPeprIndex + lengthOfSuffix);
|
|
173
|
+
})(),
|
|
174
|
+
"src/templates/eslint.config.mjs",
|
|
175
|
+
),
|
|
176
|
+
"utf-8",
|
|
177
|
+
),
|
|
164
178
|
};
|
|
@@ -13,9 +13,9 @@ import {
|
|
|
13
13
|
samplesYaml,
|
|
14
14
|
snippet,
|
|
15
15
|
tsConfig,
|
|
16
|
-
} from "
|
|
17
|
-
import { write } from "
|
|
18
|
-
import { RootCmd } from "
|
|
16
|
+
} from "../init/templates";
|
|
17
|
+
import { write } from "../init/utils";
|
|
18
|
+
import { RootCmd } from "../root";
|
|
19
19
|
|
|
20
20
|
export default function (program: RootCmd): void {
|
|
21
21
|
program
|
|
@@ -41,6 +41,33 @@ export default function (program: RootCmd): void {
|
|
|
41
41
|
console.log("Updating the Pepr module...");
|
|
42
42
|
|
|
43
43
|
try {
|
|
44
|
+
// Check if eslint v8 is a project dependency and warn about future upgrade
|
|
45
|
+
let packageLockContent = "";
|
|
46
|
+
let foundPackageLock = false;
|
|
47
|
+
|
|
48
|
+
try {
|
|
49
|
+
// Try to find package-lock.json in the current directory
|
|
50
|
+
if (fs.existsSync("./package-lock.json")) {
|
|
51
|
+
packageLockContent = fs.readFileSync("./package-lock.json", "utf-8");
|
|
52
|
+
foundPackageLock = true;
|
|
53
|
+
}
|
|
54
|
+
} catch {
|
|
55
|
+
// Ignore errors and continue with installation
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// If we found the package-lock.json and could read it, check for eslint v8
|
|
59
|
+
if (foundPackageLock && packageLockContent) {
|
|
60
|
+
// Look for eslint version 8.x.x pattern in the file content
|
|
61
|
+
if (
|
|
62
|
+
packageLockContent.indexOf('"eslint":') >= 0 &&
|
|
63
|
+
packageLockContent.match(/"eslint":\s*"[~^]?8\.[0-9]+\.[0-9]+"/)
|
|
64
|
+
) {
|
|
65
|
+
console.warn(
|
|
66
|
+
"\nWarning: This Pepr module uses ESLint v8. Pepr will be upgraded to use v9 in a future release.\nSee eslint@9.0.0 release notes for more details: https://eslint.org/blog/2024/04/eslint-v9.0.0-released/",
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
44
71
|
// Update Pepr for the module
|
|
45
72
|
execSync("npm install pepr@latest", {
|
|
46
73
|
stdio: "inherit",
|
|
@@ -211,7 +211,7 @@ When(a.ConfigMap)
|
|
|
211
211
|
When(a.ConfigMap).IsCreated().WithName("example-4").Mutate(example4Cb);
|
|
212
212
|
|
|
213
213
|
// This function uses the complete type definition, but is not required.
|
|
214
|
-
function example4Cb(cm: PeprMutateRequest<a.ConfigMap>) {
|
|
214
|
+
function example4Cb(cm: PeprMutateRequest<a.ConfigMap>): void {
|
|
215
215
|
cm.SetLabel("pepr.dev/first", "true");
|
|
216
216
|
cm.SetLabel("pepr.dev/second", "true");
|
|
217
217
|
cm.SetLabel("pepr.dev/third", "true");
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import typescriptEslint from "@typescript-eslint/eslint-plugin";
|
|
2
|
+
import tsParser from "@typescript-eslint/parser";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import js from "@eslint/js";
|
|
6
|
+
import { FlatCompat } from "@eslint/eslintrc";
|
|
7
|
+
import globals from "globals";
|
|
8
|
+
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = path.dirname(__filename);
|
|
11
|
+
const compat = new FlatCompat({
|
|
12
|
+
baseDirectory: __dirname,
|
|
13
|
+
recommendedConfig: js.configs.recommended,
|
|
14
|
+
allConfig: js.configs.all,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export default [
|
|
18
|
+
{
|
|
19
|
+
ignores: ["**/node_modules", "**/dist"],
|
|
20
|
+
},
|
|
21
|
+
...compat.extends("eslint:recommended", "plugin:@typescript-eslint/recommended"),
|
|
22
|
+
{
|
|
23
|
+
plugins: {
|
|
24
|
+
"@typescript-eslint": typescriptEslint,
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
languageOptions: {
|
|
28
|
+
parser: tsParser,
|
|
29
|
+
parserOptions: {
|
|
30
|
+
projectService: {
|
|
31
|
+
allowDefaultProject: ["eslint.config.mjs"],
|
|
32
|
+
},
|
|
33
|
+
tsconfigRootDir: __dirname,
|
|
34
|
+
sourceType: "module",
|
|
35
|
+
},
|
|
36
|
+
globals: {
|
|
37
|
+
...globals.node,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
rules: {
|
|
42
|
+
"@typescript-eslint/no-floating-promises": "error",
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
];
|
package/dist/cli/format.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/cli/format.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,MAAM,CAAC,OAAO,WAAW,OAAO,EAAE,OAAO,GAAG,IAAI,CAc/C;AAED;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,YAAY,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAoCxE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"format.helpers.d.ts","sourceRoot":"","sources":["../../src/cli/format.helpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,CAAC,UAAU,EAAE,EAC5B,YAAY,EAAE,OAAO,GACpB,OAAO,CAAC,OAAO,CAAC,CAgBlB"}
|
package/dist/cli/update.d.ts
DELETED
package/dist/cli/update.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/cli/update.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,MAAM,CAAC,OAAO,WAAW,OAAO,EAAE,OAAO,GAAG,IAAI,CA2E/C"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"env": {
|
|
3
|
-
"browser": false,
|
|
4
|
-
"es2021": true
|
|
5
|
-
},
|
|
6
|
-
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
|
|
7
|
-
"parser": "@typescript-eslint/parser",
|
|
8
|
-
"parserOptions": {
|
|
9
|
-
"project": ["./tsconfig.json"],
|
|
10
|
-
"ecmaVersion": 2022
|
|
11
|
-
},
|
|
12
|
-
"plugins": ["@typescript-eslint"],
|
|
13
|
-
"ignorePatterns": ["node_modules", "dist"],
|
|
14
|
-
"root": true,
|
|
15
|
-
"rules": {
|
|
16
|
-
"@typescript-eslint/no-floating-promises": ["error"]
|
|
17
|
-
}
|
|
18
|
-
}
|
|
File without changes
|
|
File without changes
|