@storm-software/k8s-tools 0.0.1
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/LICENSE +201 -0
- package/README.md +7 -0
- package/executors.json +9 -0
- package/generators.json +14 -0
- package/index.js +4109 -0
- package/meta.json +1 -0
- package/package.json +71 -0
- package/packages/build-tools/src/build/index.d.ts +3 -0
- package/packages/build-tools/src/build/rolldown.d.ts +20 -0
- package/packages/build-tools/src/build/ts-build.d.ts +20 -0
- package/packages/build-tools/src/build/unbuild.d.ts +20 -0
- package/packages/build-tools/src/cli/index.d.ts +2 -0
- package/packages/build-tools/src/config/browser-config.d.ts +2 -0
- package/packages/build-tools/src/config/default-config.d.ts +2 -0
- package/packages/build-tools/src/config/get-config.d.ts +2 -0
- package/packages/build-tools/src/config/get-rolldown-config.d.ts +6 -0
- package/packages/build-tools/src/config/get-unbuild-config.d.ts +6 -0
- package/packages/build-tools/src/config/index.d.ts +7 -0
- package/packages/build-tools/src/config/neutral-config.d.ts +2 -0
- package/packages/build-tools/src/config/node-config.d.ts +3 -0
- package/packages/build-tools/src/index.d.ts +6 -0
- package/packages/build-tools/src/plugins/analyze-plugin.d.ts +4 -0
- package/packages/build-tools/src/plugins/index.d.ts +4 -0
- package/packages/build-tools/src/plugins/swc-plugin.d.ts +2 -0
- package/packages/build-tools/src/plugins/ts-resolve.d.ts +6 -0
- package/packages/build-tools/src/plugins/type-definitions.d.ts +7 -0
- package/packages/build-tools/src/types.d.ts +213 -0
- package/packages/build-tools/src/utils/apply-default-options.d.ts +6 -0
- package/packages/build-tools/src/utils/generate-package-json.d.ts +7 -0
- package/packages/build-tools/src/utils/get-entry-points.d.ts +3 -0
- package/packages/build-tools/src/utils/get-file-banner.d.ts +8 -0
- package/packages/build-tools/src/utils/get-project-deps.d.ts +5 -0
- package/packages/build-tools/src/utils/index.d.ts +7 -0
- package/packages/build-tools/src/utils/out-extension.d.ts +8 -0
- package/packages/build-tools/src/utils/run-tsup-build.d.ts +3 -0
- package/packages/build-tools/src/utils/task-graph.d.ts +6 -0
- package/packages/config/src/constants.d.ts +3 -0
- package/packages/config/src/define-config.d.ts +174 -0
- package/packages/config/src/index.d.ts +12 -0
- package/packages/config/src/schema.d.ts +1915 -0
- package/packages/config/src/types.d.ts +23 -0
- package/packages/config-tools/src/config-file/get-config-file.d.ts +16 -0
- package/packages/config-tools/src/config-file/index.d.ts +1 -0
- package/packages/config-tools/src/create-storm-config.d.ts +26 -0
- package/packages/config-tools/src/env/get-env.d.ts +15 -0
- package/packages/config-tools/src/env/index.d.ts +2 -0
- package/packages/config-tools/src/env/set-env.d.ts +14 -0
- package/packages/config-tools/src/index.d.ts +13 -0
- package/packages/config-tools/src/types.d.ts +33 -0
- package/packages/config-tools/src/utilities/apply-workspace-tokens.d.ts +4 -0
- package/packages/config-tools/src/utilities/chalk.d.ts +23 -0
- package/packages/config-tools/src/utilities/correct-paths.d.ts +1 -0
- package/packages/config-tools/src/utilities/file-path-utils.d.ts +2 -0
- package/packages/config-tools/src/utilities/find-up.d.ts +4 -0
- package/packages/config-tools/src/utilities/find-workspace-root.d.ts +14 -0
- package/packages/config-tools/src/utilities/get-default-config.d.ts +15 -0
- package/packages/config-tools/src/utilities/get-log-level.d.ts +15 -0
- package/packages/config-tools/src/utilities/index.d.ts +10 -0
- package/packages/config-tools/src/utilities/logger.d.ts +74 -0
- package/packages/config-tools/src/utilities/process-handler.d.ts +4 -0
- package/packages/config-tools/src/utilities/run.d.ts +18 -0
- package/packages/k8s-tools/index.d.ts +1 -0
- package/packages/k8s-tools/src/executors/helm-package/executor.d.ts +8 -0
- package/packages/k8s-tools/src/executors/index.d.ts +1 -0
- package/packages/k8s-tools/src/generators/helm-chart/generator.d.ts +5 -0
- package/packages/k8s-tools/src/generators/helm-dependency/generator.d.ts +5 -0
- package/packages/k8s-tools/src/generators/index.d.ts +2 -0
- package/packages/k8s-tools/src/index.d.ts +2 -0
- package/packages/k8s-tools/src/types.d.ts +28 -0
- package/packages/k8s-tools/src/utils/client.d.ts +26 -0
- package/packages/k8s-tools/src/utils/ensure-init.d.ts +9 -0
- package/packages/k8s-tools/src/utils/prettier.d.ts +9 -0
- package/packages/workspace-tools/index.d.ts +32 -0
- package/packages/workspace-tools/src/base/base-executor.d.ts +7 -0
- package/packages/workspace-tools/src/base/base-generator.d.ts +4 -0
- package/packages/workspace-tools/src/base/index.d.ts +3 -0
- package/packages/workspace-tools/src/base/typescript-library-generator.d.ts +8 -0
- package/packages/workspace-tools/src/executors/cargo-publish/executor.d.ts +6 -0
- package/packages/workspace-tools/src/executors/clean-package/constants.d.ts +4 -0
- package/packages/workspace-tools/src/executors/clean-package/executor.d.ts +8 -0
- package/packages/workspace-tools/src/executors/clean-package/types.d.ts +8 -0
- package/packages/workspace-tools/src/executors/clean-package/utils.d.ts +4 -0
- package/packages/workspace-tools/src/executors/npm-publish/executor.d.ts +6 -0
- package/packages/workspace-tools/src/executors/rolldown/executor.d.ts +9 -0
- package/packages/workspace-tools/src/executors/size-limit/executor.d.ts +8 -0
- package/packages/workspace-tools/src/executors/tsup/executor.d.ts +8 -0
- package/packages/workspace-tools/src/executors/tsup-browser/executor.d.ts +8 -0
- package/packages/workspace-tools/src/executors/tsup-neutral/executor.d.ts +8 -0
- package/packages/workspace-tools/src/executors/tsup-node/executor.d.ts +8 -0
- package/packages/workspace-tools/src/executors/typia/executor.d.ts +8 -0
- package/packages/workspace-tools/src/executors/unbuild/executor.d.ts +9 -0
- package/packages/workspace-tools/src/generators/config-schema/generator.d.ts +13 -0
- package/packages/workspace-tools/src/generators/init/init.d.ts +4 -0
- package/packages/workspace-tools/src/generators/node-library/generator.d.ts +5 -0
- package/packages/workspace-tools/src/generators/preset/generator.d.ts +5 -0
- package/packages/workspace-tools/src/generators/release-version/generator.d.ts +13 -0
- package/packages/workspace-tools/src/utils/apply-workspace-tokens.d.ts +8 -0
- package/packages/workspace-tools/src/utils/cargo.d.ts +26 -0
- package/packages/workspace-tools/src/utils/create-cli-options.d.ts +1 -0
- package/packages/workspace-tools/src/utils/get-project-configurations.d.ts +13 -0
- package/packages/workspace-tools/src/utils/index.d.ts +9 -0
- package/packages/workspace-tools/src/utils/lock-file.d.ts +23 -0
- package/packages/workspace-tools/src/utils/project-tags.d.ts +30 -0
- package/packages/workspace-tools/src/utils/toml.d.ts +167 -0
- package/packages/workspace-tools/src/utils/typia-transform.d.ts +2 -0
- package/packages/workspace-tools/src/utils/versions.d.ts +18 -0
- package/src/executors/helm-package/executor.js +1244 -0
- package/src/executors/helm-package/schema.d.ts +29 -0
- package/src/executors/helm-package/schema.json +112 -0
- package/src/generators/helm-chart/files/chart/.helmignore +23 -0
- package/src/generators/helm-chart/files/chart/Chart.yaml.template +6 -0
- package/src/generators/helm-chart/files/chart/templates/NOTES.txt +22 -0
- package/src/generators/helm-chart/files/chart/templates/_helpers.yaml +62 -0
- package/src/generators/helm-chart/files/chart/templates/deployment.yaml +68 -0
- package/src/generators/helm-chart/files/chart/templates/hpa.yaml +32 -0
- package/src/generators/helm-chart/files/chart/templates/ingress.yaml +61 -0
- package/src/generators/helm-chart/files/chart/templates/service.yaml +13 -0
- package/src/generators/helm-chart/files/chart/templates/serviceaccount.yaml +13 -0
- package/src/generators/helm-chart/files/chart/templates/test/test-connection.yaml +15 -0
- package/src/generators/helm-chart/files/chart/values.yaml +111 -0
- package/src/generators/helm-chart/generator.js +131 -0
- package/src/generators/helm-chart/schema.d.ts +11 -0
- package/src/generators/helm-chart/schema.json +48 -0
- package/src/generators/helm-dependency/generator.js +2805 -0
- package/src/generators/helm-dependency/schema.d.ts +15 -0
- package/src/generators/helm-dependency/schema.json +71 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// packages/k8s-tools/src/generators/helm-chart/generator.ts
|
|
30
|
+
var generator_exports = {};
|
|
31
|
+
__export(generator_exports, {
|
|
32
|
+
default: () => generator_default,
|
|
33
|
+
helmChartGenerator: () => helmChartGenerator,
|
|
34
|
+
helmChartSchematic: () => helmChartSchematic
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(generator_exports);
|
|
37
|
+
var import_devkit = require("@nx/devkit");
|
|
38
|
+
var import_path = require("path");
|
|
39
|
+
async function helmChartGenerator(tree, options) {
|
|
40
|
+
const {
|
|
41
|
+
getStopwatch,
|
|
42
|
+
writeDebug,
|
|
43
|
+
writeError,
|
|
44
|
+
writeFatal,
|
|
45
|
+
writeInfo,
|
|
46
|
+
writeTrace,
|
|
47
|
+
findWorkspaceRoot,
|
|
48
|
+
loadStormConfig
|
|
49
|
+
} = await import("@storm-software/config-tools");
|
|
50
|
+
const stopwatch = getStopwatch("Storm Helm Chart generator");
|
|
51
|
+
let config;
|
|
52
|
+
try {
|
|
53
|
+
writeInfo(`\u26A1 Running the Storm Helm Chart generator...
|
|
54
|
+
|
|
55
|
+
`, config);
|
|
56
|
+
const workspaceRoot = findWorkspaceRoot();
|
|
57
|
+
writeDebug(
|
|
58
|
+
`Loading the Storm Config from environment variables and storm.json file...
|
|
59
|
+
- workspaceRoot: ${workspaceRoot}`,
|
|
60
|
+
config
|
|
61
|
+
);
|
|
62
|
+
config = await loadStormConfig(workspaceRoot);
|
|
63
|
+
writeTrace(
|
|
64
|
+
`Loaded Storm config into env:
|
|
65
|
+
${Object.keys(process.env).map((key) => ` - ${key}=${JSON.stringify(process.env[key])}`).join("\n")}`,
|
|
66
|
+
config
|
|
67
|
+
);
|
|
68
|
+
const tasks = [];
|
|
69
|
+
tasks.push(async () => {
|
|
70
|
+
const project = (0, import_devkit.readProjectConfiguration)(tree, options.project);
|
|
71
|
+
if (project.targets?.["helm-package"]) {
|
|
72
|
+
throw new Error(
|
|
73
|
+
`Project ${options.project} already has a helm target. Please remove it before running this command.`
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
(0, import_devkit.updateProjectConfiguration)(tree, options.project, {
|
|
77
|
+
...project,
|
|
78
|
+
targets: {
|
|
79
|
+
...project.targets,
|
|
80
|
+
"helm-package": {
|
|
81
|
+
executor: "@storm-software/k8s-tools:helm-package",
|
|
82
|
+
outputs: ["{options.outputFolder}"],
|
|
83
|
+
options: {
|
|
84
|
+
chartFolder: `${project.root}/${options.chartFolder}`,
|
|
85
|
+
outputFolder: "{workspaceRoot}/dist/charts/{projectRoot}",
|
|
86
|
+
push: false,
|
|
87
|
+
remote: "oci://localhost:5000/helm-charts",
|
|
88
|
+
dependencies: {
|
|
89
|
+
update: true,
|
|
90
|
+
build: true,
|
|
91
|
+
repositories: []
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
(0, import_devkit.generateFiles)(
|
|
98
|
+
tree,
|
|
99
|
+
(0, import_path.join)(__dirname, "files", "chart"),
|
|
100
|
+
(0, import_path.join)(project.root, options.chartFolder ?? ""),
|
|
101
|
+
options
|
|
102
|
+
);
|
|
103
|
+
if (options.format) {
|
|
104
|
+
await (0, import_devkit.formatFiles)(tree);
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
return (0, import_devkit.runTasksInSerial)(...tasks);
|
|
108
|
+
} catch (error) {
|
|
109
|
+
return () => {
|
|
110
|
+
writeFatal(
|
|
111
|
+
"A fatal error occurred while running the generator - the process was forced to terminate",
|
|
112
|
+
config
|
|
113
|
+
);
|
|
114
|
+
writeError(
|
|
115
|
+
`An exception was thrown in the generator's process
|
|
116
|
+
- Details: ${error.message}
|
|
117
|
+
- Stacktrace: ${error.stack}`,
|
|
118
|
+
config
|
|
119
|
+
);
|
|
120
|
+
};
|
|
121
|
+
} finally {
|
|
122
|
+
stopwatch();
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
var generator_default = helmChartGenerator;
|
|
126
|
+
var helmChartSchematic = (0, import_devkit.convertNxGenerator)(helmChartGenerator);
|
|
127
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
128
|
+
0 && (module.exports = {
|
|
129
|
+
helmChartGenerator,
|
|
130
|
+
helmChartSchematic
|
|
131
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface HelmChartGeneratorSchema {
|
|
2
|
+
/** Name of the chart */
|
|
3
|
+
name: string;
|
|
4
|
+
/** Name of the project to add the chart to */
|
|
5
|
+
project: string;
|
|
6
|
+
/** Folder to store the chart */
|
|
7
|
+
chartFolder?: string;
|
|
8
|
+
/** Format the generated chart */
|
|
9
|
+
format?: boolean;
|
|
10
|
+
[k: string]: unknown;
|
|
11
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "helm-chart",
|
|
4
|
+
"title": "Helm chart generator",
|
|
5
|
+
"description": "Create a Helm chart for a Kubernetes application",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"name": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "Name of the chart",
|
|
11
|
+
"$default": {
|
|
12
|
+
"$source": "argv",
|
|
13
|
+
"index": 0
|
|
14
|
+
},
|
|
15
|
+
"x-prompt": "Provide a name for your chart"
|
|
16
|
+
},
|
|
17
|
+
"project": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "Name of the project to add the chart to",
|
|
20
|
+
"$default": {
|
|
21
|
+
"$source": "argv",
|
|
22
|
+
"index": 1
|
|
23
|
+
},
|
|
24
|
+
"x-prompt": "Provide the project name"
|
|
25
|
+
},
|
|
26
|
+
"chartFolder": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"description": "Folder to store the chart",
|
|
29
|
+
"$default": {
|
|
30
|
+
"$source": "argv",
|
|
31
|
+
"index": 2
|
|
32
|
+
},
|
|
33
|
+
"default": "chart",
|
|
34
|
+
"x-prompt": "Provide the chart folder"
|
|
35
|
+
},
|
|
36
|
+
"format": {
|
|
37
|
+
"type": "boolean",
|
|
38
|
+
"description": "Format the generated chart",
|
|
39
|
+
"$default": {
|
|
40
|
+
"$source": "argv",
|
|
41
|
+
"index": 3
|
|
42
|
+
},
|
|
43
|
+
"default": false,
|
|
44
|
+
"x-prompt": "Format the generated chart? Warning: prettier will display errors due to the template syntax: https://github.com/prettier/prettier/issues/6517"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"required": ["name", "project"]
|
|
48
|
+
}
|