@storm-software/k8s-tools 0.7.0 → 0.8.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/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## 0.8.0 (2024-09-06)
2
+
3
+ ### Features
4
+
5
+ - **k8s-tools:** Added extra fields onto the released container's `meta.json`
6
+ file ([14356536](https://github.com/storm-software/storm-ops/commit/14356536))
7
+
8
+ ### Bug Fixes
9
+
10
+ - **workspace-tools:** Resolved the duplicate export name issue
11
+ ([f2586335](https://github.com/storm-software/storm-ops/commit/f2586335))
12
+
1
13
  ## 0.7.0 (2024-09-05)
2
14
 
3
15
  ### Features
package/index.js CHANGED
@@ -49,41 +49,10 @@ __export(k8s_tools_exports, {
49
49
  module.exports = __toCommonJS(k8s_tools_exports);
50
50
 
51
51
  // packages/k8s-tools/src/executors/container-publish/executor.ts
52
- var import_devkit2 = require("@nx/devkit");
52
+ var import_devkit = require("@nx/devkit");
53
53
  var import_apply_workspace_tokens = require("@storm-software/workspace-tools/utils/apply-workspace-tokens");
54
+ var import_package_helpers = require("@storm-software/workspace-tools/utils/package-helpers");
54
55
  var import_node_https = __toESM(require("node:https"));
55
-
56
- // packages/k8s-tools/src/utils/package-helpers.ts
57
- var import_devkit = require("@nx/devkit");
58
- var import_project_tags = require("@storm-software/workspace-tools/utils/project-tags");
59
- var import_toml = require("@storm-software/workspace-tools/utils/toml");
60
- var import_node_fs = require("node:fs");
61
- var getPackageManager = (project) => {
62
- if ((0, import_project_tags.isEqualProjectTag)(
63
- project,
64
- import_project_tags.ProjectTagConstants.Language.TAG_ID,
65
- import_project_tags.ProjectTagConstants.Language.RUST
66
- ) && (0, import_node_fs.existsSync)((0, import_devkit.joinPathFragments)(project.root, "Cargo.toml"))) {
67
- return {
68
- type: "Cargo.toml",
69
- content: (0, import_toml.parseCargoToml)((0, import_devkit.joinPathFragments)(project.root, "Cargo.toml"))
70
- };
71
- } else if ((0, import_project_tags.isEqualProjectTag)(
72
- project,
73
- import_project_tags.ProjectTagConstants.Language.TAG_ID,
74
- import_project_tags.ProjectTagConstants.Language.TYPESCRIPT
75
- ) && (0, import_node_fs.existsSync)((0, import_devkit.joinPathFragments)(project.root, "package.json"))) {
76
- return {
77
- type: "package.json",
78
- content: (0, import_devkit.readJsonFile)(
79
- (0, import_devkit.joinPathFragments)(project.root, "package.json")
80
- )
81
- };
82
- }
83
- return null;
84
- };
85
-
86
- // packages/k8s-tools/src/executors/container-publish/executor.ts
87
56
  var getRegistryVersion = (name2, config) => {
88
57
  if (!name2) {
89
58
  throw new Error(
@@ -342,19 +311,19 @@ var executor_default = (0, import_base_executor.withRunExecutor)(
342
311
  );
343
312
 
344
313
  // packages/k8s-tools/src/generators/helm-chart/generator.ts
345
- var import_devkit3 = require("@nx/devkit");
314
+ var import_devkit2 = require("@nx/devkit");
346
315
  var import_base_generator = require("@storm-software/workspace-tools/base/base-generator");
347
316
  var import_path = require("path");
348
317
  async function helmChartGeneratorFn(tree, options, config) {
349
318
  const { writeTrace } = await import("@storm-software/config-tools");
350
319
  writeTrace("\u{1F4DD} Preparing to write Helm Chart", config);
351
- const project = (0, import_devkit3.readProjectConfiguration)(tree, options.project);
320
+ const project = (0, import_devkit2.readProjectConfiguration)(tree, options.project);
352
321
  if (project.targets?.["helm-package"]) {
353
322
  throw new Error(
354
323
  `Project ${options.project} already has a helm target. Please remove it before running this command.`
355
324
  );
356
325
  }
357
- (0, import_devkit3.updateProjectConfiguration)(tree, options.project, {
326
+ (0, import_devkit2.updateProjectConfiguration)(tree, options.project, {
358
327
  ...project,
359
328
  targets: {
360
329
  ...project.targets,
@@ -375,14 +344,14 @@ async function helmChartGeneratorFn(tree, options, config) {
375
344
  }
376
345
  }
377
346
  });
378
- (0, import_devkit3.generateFiles)(
347
+ (0, import_devkit2.generateFiles)(
379
348
  tree,
380
349
  (0, import_path.join)(__dirname, "files", "chart"),
381
350
  (0, import_path.join)(project.root, options.chartFolder ?? ""),
382
351
  options
383
352
  );
384
353
  if (options.format) {
385
- await (0, import_devkit3.formatFiles)(tree);
354
+ await (0, import_devkit2.formatFiles)(tree);
386
355
  }
387
356
  return {
388
357
  success: true
@@ -394,7 +363,7 @@ var generator_default = (0, import_base_generator.withRunGenerator)(
394
363
  );
395
364
 
396
365
  // packages/k8s-tools/src/generators/helm-dependency/generator.ts
397
- var import_devkit4 = require("@nx/devkit");
366
+ var import_devkit3 = require("@nx/devkit");
398
367
  var import_base_generator2 = require("@storm-software/workspace-tools/base/base-generator");
399
368
 
400
369
  // node_modules/.pnpm/js-yaml@4.1.0/node_modules/js-yaml/dist/js-yaml.mjs
@@ -3023,13 +2992,13 @@ var js_yaml_default = jsYaml;
3023
2992
  async function helmDependencyGeneratorFn(tree, options, config) {
3024
2993
  const { writeTrace } = await import("@storm-software/config-tools");
3025
2994
  writeTrace("\u{1F4DD} Preparing to add Helm Dependency", config);
3026
- const project = (0, import_devkit4.readProjectConfiguration)(tree, options.project);
2995
+ const project = (0, import_devkit3.readProjectConfiguration)(tree, options.project);
3027
2996
  if (!project.targets?.["helm-package"]) {
3028
2997
  throw new Error(
3029
2998
  `Project ${options.project} does not have a helm target. Please run the chart generator first.`
3030
2999
  );
3031
3000
  }
3032
- (0, import_devkit4.updateProjectConfiguration)(
3001
+ (0, import_devkit3.updateProjectConfiguration)(
3033
3002
  tree,
3034
3003
  options.project,
3035
3004
  addDependencyToConfig(project, options.repositoryName, options.repository)
@@ -3042,7 +3011,7 @@ async function helmDependencyGeneratorFn(tree, options, config) {
3042
3011
  options.repository
3043
3012
  );
3044
3013
  if (options.format) {
3045
- await (0, import_devkit4.formatFiles)(tree);
3014
+ await (0, import_devkit3.formatFiles)(tree);
3046
3015
  }
3047
3016
  return {
3048
3017
  success: true
@@ -3109,9 +3078,10 @@ function updateChartYaml(tree, project, name2, version, repository) {
3109
3078
  }
3110
3079
 
3111
3080
  // packages/k8s-tools/src/plugins/docker/_dockerfile.ts
3112
- var import_devkit5 = require("@nx/devkit");
3113
- var import_project_tags2 = require("@storm-software/workspace-tools/utils/project-tags");
3114
- var import_node_fs2 = require("node:fs");
3081
+ var import_devkit4 = require("@nx/devkit");
3082
+ var import_package_helpers2 = require("@storm-software/workspace-tools/utils/package-helpers");
3083
+ var import_project_tags = require("@storm-software/workspace-tools/utils/project-tags");
3084
+ var import_node_fs = require("node:fs");
3115
3085
  var name = "storm-software/docker/dockerfile";
3116
3086
  var description = "Plugin for parsing Dockerfile files";
3117
3087
  var createNodes = [
@@ -3124,11 +3094,11 @@ var createNodes = [
3124
3094
  }
3125
3095
  const { loadStormConfig, findWorkspaceRoot } = await import("@storm-software/config-tools");
3126
3096
  const root = dockerFilePath.substring(dockerFilePath.lastIndexOf("/") + 1);
3127
- const projectJsonPath = (0, import_devkit5.joinPathFragments)(root, "project.json");
3128
- if (!(0, import_node_fs2.existsSync)(projectJsonPath)) {
3097
+ const projectJsonPath = (0, import_devkit4.joinPathFragments)(root, "project.json");
3098
+ if (!(0, import_node_fs.existsSync)(projectJsonPath)) {
3129
3099
  return {};
3130
3100
  }
3131
- const projectJson = (0, import_devkit5.readJsonFile)(projectJsonPath);
3101
+ const projectJson = (0, import_devkit4.readJsonFile)(projectJsonPath);
3132
3102
  if (projectJson?.name) {
3133
3103
  return {};
3134
3104
  }
@@ -3154,7 +3124,7 @@ var createNodes = [
3154
3124
  `org.opencontainers.image.source=${config.repository}`
3155
3125
  ];
3156
3126
  let tag = "latest";
3157
- const packageManager = getPackageManager(project);
3127
+ const packageManager = (0, import_package_helpers2.getPackageInfo)(project);
3158
3128
  if (packageManager) {
3159
3129
  if (packageManager.type === "Cargo.toml") {
3160
3130
  tag = packageManager.content.package.version;
@@ -3216,11 +3186,11 @@ var createNodes = [
3216
3186
  }
3217
3187
  }
3218
3188
  };
3219
- if (((0, import_project_tags2.isEqualProjectTag)(
3189
+ if (((0, import_project_tags.isEqualProjectTag)(
3220
3190
  project,
3221
- import_project_tags2.ProjectTagConstants.ProjectType.TAG_ID,
3222
- import_project_tags2.ProjectTagConstants.ProjectType.APPLICATION
3223
- ) || project.projectType === "application") && (0, import_project_tags2.hasProjectTag)(project, import_project_tags2.ProjectTagConstants.Registry.TAG_ID)) {
3191
+ import_project_tags.ProjectTagConstants.ProjectType.TAG_ID,
3192
+ import_project_tags.ProjectTagConstants.ProjectType.APPLICATION
3193
+ ) || project.projectType === "application") && (0, import_project_tags.hasProjectTag)(project, import_project_tags.ProjectTagConstants.Registry.TAG_ID)) {
3224
3194
  if (project.targets["nx-release-publish"]) {
3225
3195
  project.targets["nx-release-publish"] = {
3226
3196
  ...project.targets["nx-release-publish"],
@@ -3247,7 +3217,7 @@ var createNodes = [
3247
3217
  };
3248
3218
  }
3249
3219
  }
3250
- (0, import_project_tags2.setDefaultProjectTags)(project);
3220
+ (0, import_project_tags.setDefaultProjectTags)(project);
3251
3221
  const projects = {};
3252
3222
  const externalNodes = {};
3253
3223
  projects[project.root] = {
package/meta.json CHANGED
@@ -1 +1 @@
1
- {"inputs":{"packages/k8s-tools/src/utils/package-helpers.ts":{"bytes":1567,"imports":[{"path":"@nx/devkit","kind":"import-statement","external":true},{"path":"@storm-software/workspace-tools/executors/clean-package/types","kind":"import-statement","external":true},{"path":"@storm-software/workspace-tools/utils/project-tags","kind":"import-statement","external":true},{"path":"@storm-software/workspace-tools/utils/toml","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true}],"format":"esm"},"packages/k8s-tools/src/executors/container-publish/executor.ts":{"bytes":6601,"imports":[{"path":"@nx/devkit","kind":"import-statement","external":true},{"path":"@storm-software/config","kind":"import-statement","external":true},{"path":"@storm-software/workspace-tools/utils/apply-workspace-tokens","kind":"import-statement","external":true},{"path":"@storm-software/workspace-tools/utils/toml","kind":"import-statement","external":true},{"path":"node:https","kind":"import-statement","external":true},{"path":"packages/k8s-tools/src/utils/package-helpers.ts","kind":"import-statement","original":"../../utils/package-helpers"},{"path":"@storm-software/config-tools","kind":"dynamic-import","external":true}],"format":"esm"},"packages/k8s-tools/src/types.ts":{"bytes":859,"imports":[{"path":"prettier","kind":"import-statement","external":true}],"format":"esm"},"packages/k8s-tools/src/utils/ensure-init.ts":{"bytes":956,"imports":[{"path":"../types","kind":"import-statement","external":true}],"format":"esm"},"packages/k8s-tools/src/utils/client.ts":{"bytes":3533,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"packages/k8s-tools/src/types.ts","kind":"import-statement","original":"../types"},{"path":"packages/k8s-tools/src/utils/ensure-init.ts","kind":"import-statement","original":"./ensure-init"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"packages/k8s-tools/src/executors/helm-package/executor.ts":{"bytes":1977,"imports":[{"path":"@storm-software/workspace-tools/base/base-executor","kind":"import-statement","external":true},{"path":"packages/k8s-tools/src/utils/client.ts","kind":"import-statement","original":"../../utils/client"},{"path":"./schema","kind":"import-statement","external":true},{"path":"@storm-software/config-tools","kind":"dynamic-import","external":true}],"format":"esm"},"packages/k8s-tools/src/executors/index.ts":{"bytes":87,"imports":[{"path":"packages/k8s-tools/src/executors/container-publish/executor.ts","kind":"import-statement","original":"./container-publish/executor"},{"path":"packages/k8s-tools/src/executors/helm-package/executor.ts","kind":"import-statement","original":"./helm-package/executor"}],"format":"esm"},"packages/k8s-tools/src/generators/helm-chart/generator.ts":{"bytes":1814,"imports":[{"path":"@nx/devkit","kind":"import-statement","external":true},{"path":"@storm-software/config","kind":"import-statement","external":true},{"path":"@storm-software/workspace-tools/base/base-generator","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"@storm-software/config-tools","kind":"dynamic-import","external":true}],"format":"esm"},"node_modules/.pnpm/js-yaml@4.1.0/node_modules/js-yaml/dist/js-yaml.mjs":{"bytes":107533,"imports":[],"format":"esm"},"packages/k8s-tools/src/generators/helm-dependency/generator.ts":{"bytes":3414,"imports":[{"path":"@nx/devkit","kind":"import-statement","external":true},{"path":"@storm-software/config","kind":"import-statement","external":true},{"path":"@storm-software/workspace-tools/base/base-generator","kind":"import-statement","external":true},{"path":"node_modules/.pnpm/js-yaml@4.1.0/node_modules/js-yaml/dist/js-yaml.mjs","kind":"import-statement","original":"js-yaml"},{"path":"@storm-software/config-tools","kind":"dynamic-import","external":true}],"format":"esm"},"packages/k8s-tools/src/generators/index.ts":{"bytes":85,"imports":[{"path":"packages/k8s-tools/src/generators/helm-chart/generator.ts","kind":"import-statement","original":"./helm-chart/generator"},{"path":"packages/k8s-tools/src/generators/helm-dependency/generator.ts","kind":"import-statement","original":"./helm-dependency/generator"}],"format":"esm"},"packages/k8s-tools/src/plugins/docker/_dockerfile.ts":{"bytes":6642,"imports":[{"path":"@nx/devkit","kind":"import-statement","external":true},{"path":"@storm-software/workspace-tools/utils/project-tags","kind":"import-statement","external":true},{"path":"@storm-software/workspace-tools/utils/toml","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"packages/k8s-tools/src/utils/package-helpers.ts","kind":"import-statement","original":"../../utils/package-helpers"},{"path":"@storm-software/config-tools","kind":"dynamic-import","external":true}],"format":"esm"},"packages/k8s-tools/src/plugins/docker/index.ts":{"bytes":31,"imports":[{"path":"packages/k8s-tools/src/plugins/docker/_dockerfile.ts","kind":"import-statement","original":"./_dockerfile"}],"format":"esm"},"packages/k8s-tools/src/plugins/index.ts":{"bytes":26,"imports":[{"path":"packages/k8s-tools/src/plugins/docker/index.ts","kind":"import-statement","original":"./docker"}],"format":"esm"},"packages/k8s-tools/src/index.ts":{"bytes":86,"imports":[{"path":"packages/k8s-tools/src/executors/index.ts","kind":"import-statement","original":"./executors"},{"path":"packages/k8s-tools/src/generators/index.ts","kind":"import-statement","original":"./generators"},{"path":"packages/k8s-tools/src/plugins/index.ts","kind":"import-statement","original":"./plugins"}],"format":"esm"},"packages/k8s-tools/index.ts":{"bytes":23,"imports":[{"path":"packages/k8s-tools/src/index.ts","kind":"import-statement","original":"./src"}],"format":"esm"}},"outputs":{"dist/packages/k8s-tools/index.js":{"imports":[{"path":"@nx/devkit","kind":"require-call","external":true},{"path":"@storm-software/workspace-tools/utils/apply-workspace-tokens","kind":"require-call","external":true},{"path":"node:https","kind":"require-call","external":true},{"path":"@nx/devkit","kind":"require-call","external":true},{"path":"@storm-software/workspace-tools/utils/project-tags","kind":"require-call","external":true},{"path":"@storm-software/workspace-tools/utils/toml","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"@storm-software/workspace-tools/base/base-executor","kind":"require-call","external":true},{"path":"node:child_process","kind":"require-call","external":true},{"path":"@storm-software/config-tools","kind":"dynamic-import","external":true},{"path":"@nx/devkit","kind":"require-call","external":true},{"path":"@storm-software/workspace-tools/base/base-generator","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"@storm-software/config-tools","kind":"dynamic-import","external":true},{"path":"@nx/devkit","kind":"require-call","external":true},{"path":"@storm-software/workspace-tools/base/base-generator","kind":"require-call","external":true},{"path":"@storm-software/config-tools","kind":"dynamic-import","external":true},{"path":"@nx/devkit","kind":"require-call","external":true},{"path":"@storm-software/workspace-tools/utils/project-tags","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"@storm-software/config-tools","kind":"dynamic-import","external":true}],"exports":[],"entryPoint":"packages/k8s-tools/index.ts","inputs":{"packages/k8s-tools/index.ts":{"bytesInOutput":447},"packages/k8s-tools/src/executors/container-publish/executor.ts":{"bytesInOutput":1936},"packages/k8s-tools/src/utils/package-helpers.ts":{"bytesInOutput":1238},"packages/k8s-tools/src/executors/index.ts":{"bytesInOutput":0},"packages/k8s-tools/src/executors/helm-package/executor.ts":{"bytesInOutput":1555},"packages/k8s-tools/src/utils/client.ts":{"bytesInOutput":3290},"packages/k8s-tools/src/types.ts":{"bytesInOutput":134},"packages/k8s-tools/src/utils/ensure-init.ts":{"bytesInOutput":579},"packages/k8s-tools/src/index.ts":{"bytesInOutput":0},"packages/k8s-tools/src/generators/helm-chart/generator.ts":{"bytesInOutput":1689},"packages/k8s-tools/src/generators/index.ts":{"bytesInOutput":0},"packages/k8s-tools/src/generators/helm-dependency/generator.ts":{"bytesInOutput":2873},"node_modules/.pnpm/js-yaml@4.1.0/node_modules/js-yaml/dist/js-yaml.mjs":{"bytesInOutput":88006},"packages/k8s-tools/src/plugins/docker/_dockerfile.ts":{"bytesInOutput":5761},"packages/k8s-tools/src/plugins/docker/index.ts":{"bytesInOutput":0},"packages/k8s-tools/src/plugins/index.ts":{"bytesInOutput":0}},"bytes":110506},"dist/packages/k8s-tools/src/executors/helm-package/executor.js":{"imports":[{"path":"@storm-software/workspace-tools/base/base-executor","kind":"require-call","external":true},{"path":"node:child_process","kind":"require-call","external":true},{"path":"@storm-software/config-tools","kind":"dynamic-import","external":true}],"exports":[],"entryPoint":"packages/k8s-tools/src/executors/helm-package/executor.ts","inputs":{"packages/k8s-tools/src/executors/helm-package/executor.ts":{"bytesInOutput":1736},"packages/k8s-tools/src/utils/client.ts":{"bytesInOutput":3288},"packages/k8s-tools/src/types.ts":{"bytesInOutput":134},"packages/k8s-tools/src/utils/ensure-init.ts":{"bytesInOutput":579}},"bytes":7918},"dist/packages/k8s-tools/src/executors/container-publish/executor.js":{"imports":[{"path":"@nx/devkit","kind":"require-call","external":true},{"path":"@storm-software/workspace-tools/utils/apply-workspace-tokens","kind":"require-call","external":true},{"path":"node:https","kind":"require-call","external":true},{"path":"@nx/devkit","kind":"require-call","external":true},{"path":"@storm-software/workspace-tools/utils/project-tags","kind":"require-call","external":true},{"path":"@storm-software/workspace-tools/utils/toml","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"@storm-software/config-tools","kind":"dynamic-import","external":true}],"exports":[],"entryPoint":"packages/k8s-tools/src/executors/container-publish/executor.ts","inputs":{"packages/k8s-tools/src/executors/container-publish/executor.ts":{"bytesInOutput":5692},"packages/k8s-tools/src/utils/package-helpers.ts":{"bytesInOutput":1238}},"bytes":8610},"dist/packages/k8s-tools/src/generators/helm-chart/generator.js":{"imports":[{"path":"@nx/devkit","kind":"require-call","external":true},{"path":"@storm-software/workspace-tools/base/base-generator","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"@storm-software/config-tools","kind":"dynamic-import","external":true}],"exports":[],"entryPoint":"packages/k8s-tools/src/generators/helm-chart/generator.ts","inputs":{"packages/k8s-tools/src/generators/helm-chart/generator.ts":{"bytesInOutput":1883}},"bytes":3441},"dist/packages/k8s-tools/src/generators/helm-dependency/generator.js":{"imports":[{"path":"@nx/devkit","kind":"require-call","external":true},{"path":"@storm-software/workspace-tools/base/base-generator","kind":"require-call","external":true},{"path":"@storm-software/config-tools","kind":"dynamic-import","external":true}],"exports":[],"entryPoint":"packages/k8s-tools/src/generators/helm-dependency/generator.ts","inputs":{"packages/k8s-tools/src/generators/helm-dependency/generator.ts":{"bytesInOutput":3051},"node_modules/.pnpm/js-yaml@4.1.0/node_modules/js-yaml/dist/js-yaml.mjs":{"bytesInOutput":87999}},"bytes":92893},"dist/packages/k8s-tools/src/plugins/docker/index.js":{"imports":[{"path":"@nx/devkit","kind":"require-call","external":true},{"path":"@storm-software/workspace-tools/utils/project-tags","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"@nx/devkit","kind":"require-call","external":true},{"path":"@storm-software/workspace-tools/utils/project-tags","kind":"require-call","external":true},{"path":"@storm-software/workspace-tools/utils/toml","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"@storm-software/config-tools","kind":"dynamic-import","external":true}],"exports":[],"entryPoint":"packages/k8s-tools/src/plugins/docker/index.ts","inputs":{"packages/k8s-tools/src/plugins/docker/index.ts":{"bytesInOutput":238},"packages/k8s-tools/src/plugins/docker/_dockerfile.ts":{"bytesInOutput":5761},"packages/k8s-tools/src/utils/package-helpers.ts":{"bytesInOutput":1238}},"bytes":8989}}}
1
+ {"inputs":{"packages/k8s-tools/src/executors/container-publish/executor.ts":{"bytes":6726,"imports":[{"path":"@nx/devkit","kind":"import-statement","external":true},{"path":"@storm-software/config","kind":"import-statement","external":true},{"path":"@storm-software/workspace-tools/utils/apply-workspace-tokens","kind":"import-statement","external":true},{"path":"@storm-software/workspace-tools/utils/package-helpers","kind":"import-statement","external":true},{"path":"@storm-software/workspace-tools/utils/toml","kind":"import-statement","external":true},{"path":"node:https","kind":"import-statement","external":true},{"path":"@storm-software/config-tools","kind":"dynamic-import","external":true}],"format":"esm"},"packages/k8s-tools/src/types.ts":{"bytes":859,"imports":[{"path":"prettier","kind":"import-statement","external":true}],"format":"esm"},"packages/k8s-tools/src/utils/ensure-init.ts":{"bytes":956,"imports":[{"path":"../types","kind":"import-statement","external":true}],"format":"esm"},"packages/k8s-tools/src/utils/client.ts":{"bytes":3533,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"packages/k8s-tools/src/types.ts","kind":"import-statement","original":"../types"},{"path":"packages/k8s-tools/src/utils/ensure-init.ts","kind":"import-statement","original":"./ensure-init"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"packages/k8s-tools/src/executors/helm-package/executor.ts":{"bytes":1977,"imports":[{"path":"@storm-software/workspace-tools/base/base-executor","kind":"import-statement","external":true},{"path":"packages/k8s-tools/src/utils/client.ts","kind":"import-statement","original":"../../utils/client"},{"path":"./schema","kind":"import-statement","external":true},{"path":"@storm-software/config-tools","kind":"dynamic-import","external":true}],"format":"esm"},"packages/k8s-tools/src/executors/index.ts":{"bytes":87,"imports":[{"path":"packages/k8s-tools/src/executors/container-publish/executor.ts","kind":"import-statement","original":"./container-publish/executor"},{"path":"packages/k8s-tools/src/executors/helm-package/executor.ts","kind":"import-statement","original":"./helm-package/executor"}],"format":"esm"},"packages/k8s-tools/src/generators/helm-chart/generator.ts":{"bytes":1814,"imports":[{"path":"@nx/devkit","kind":"import-statement","external":true},{"path":"@storm-software/config","kind":"import-statement","external":true},{"path":"@storm-software/workspace-tools/base/base-generator","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"@storm-software/config-tools","kind":"dynamic-import","external":true}],"format":"esm"},"node_modules/.pnpm/js-yaml@4.1.0/node_modules/js-yaml/dist/js-yaml.mjs":{"bytes":107533,"imports":[],"format":"esm"},"packages/k8s-tools/src/generators/helm-dependency/generator.ts":{"bytes":3414,"imports":[{"path":"@nx/devkit","kind":"import-statement","external":true},{"path":"@storm-software/config","kind":"import-statement","external":true},{"path":"@storm-software/workspace-tools/base/base-generator","kind":"import-statement","external":true},{"path":"node_modules/.pnpm/js-yaml@4.1.0/node_modules/js-yaml/dist/js-yaml.mjs","kind":"import-statement","original":"js-yaml"},{"path":"@storm-software/config-tools","kind":"dynamic-import","external":true}],"format":"esm"},"packages/k8s-tools/src/generators/index.ts":{"bytes":85,"imports":[{"path":"packages/k8s-tools/src/generators/helm-chart/generator.ts","kind":"import-statement","original":"./helm-chart/generator"},{"path":"packages/k8s-tools/src/generators/helm-dependency/generator.ts","kind":"import-statement","original":"./helm-dependency/generator"}],"format":"esm"},"packages/k8s-tools/src/plugins/docker/_dockerfile.ts":{"bytes":6662,"imports":[{"path":"@nx/devkit","kind":"import-statement","external":true},{"path":"@storm-software/workspace-tools/utils/package-helpers","kind":"import-statement","external":true},{"path":"@storm-software/workspace-tools/utils/project-tags","kind":"import-statement","external":true},{"path":"@storm-software/workspace-tools/utils/toml","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"@storm-software/config-tools","kind":"dynamic-import","external":true}],"format":"esm"},"packages/k8s-tools/src/plugins/docker/index.ts":{"bytes":31,"imports":[{"path":"packages/k8s-tools/src/plugins/docker/_dockerfile.ts","kind":"import-statement","original":"./_dockerfile"}],"format":"esm"},"packages/k8s-tools/src/plugins/index.ts":{"bytes":26,"imports":[{"path":"packages/k8s-tools/src/plugins/docker/index.ts","kind":"import-statement","original":"./docker"}],"format":"esm"},"packages/k8s-tools/src/index.ts":{"bytes":86,"imports":[{"path":"packages/k8s-tools/src/executors/index.ts","kind":"import-statement","original":"./executors"},{"path":"packages/k8s-tools/src/generators/index.ts","kind":"import-statement","original":"./generators"},{"path":"packages/k8s-tools/src/plugins/index.ts","kind":"import-statement","original":"./plugins"}],"format":"esm"},"packages/k8s-tools/index.ts":{"bytes":23,"imports":[{"path":"packages/k8s-tools/src/index.ts","kind":"import-statement","original":"./src"}],"format":"esm"}},"outputs":{"dist/packages/k8s-tools/index.js":{"imports":[{"path":"@nx/devkit","kind":"require-call","external":true},{"path":"@storm-software/workspace-tools/utils/apply-workspace-tokens","kind":"require-call","external":true},{"path":"@storm-software/workspace-tools/utils/package-helpers","kind":"require-call","external":true},{"path":"node:https","kind":"require-call","external":true},{"path":"@storm-software/workspace-tools/base/base-executor","kind":"require-call","external":true},{"path":"node:child_process","kind":"require-call","external":true},{"path":"@storm-software/config-tools","kind":"dynamic-import","external":true},{"path":"@nx/devkit","kind":"require-call","external":true},{"path":"@storm-software/workspace-tools/base/base-generator","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"@storm-software/config-tools","kind":"dynamic-import","external":true},{"path":"@nx/devkit","kind":"require-call","external":true},{"path":"@storm-software/workspace-tools/base/base-generator","kind":"require-call","external":true},{"path":"@storm-software/config-tools","kind":"dynamic-import","external":true},{"path":"@nx/devkit","kind":"require-call","external":true},{"path":"@storm-software/workspace-tools/utils/package-helpers","kind":"require-call","external":true},{"path":"@storm-software/workspace-tools/utils/project-tags","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"@storm-software/config-tools","kind":"dynamic-import","external":true}],"exports":[],"entryPoint":"packages/k8s-tools/index.ts","inputs":{"packages/k8s-tools/index.ts":{"bytesInOutput":447},"packages/k8s-tools/src/executors/container-publish/executor.ts":{"bytesInOutput":2030},"packages/k8s-tools/src/executors/index.ts":{"bytesInOutput":0},"packages/k8s-tools/src/executors/helm-package/executor.ts":{"bytesInOutput":1555},"packages/k8s-tools/src/utils/client.ts":{"bytesInOutput":3290},"packages/k8s-tools/src/types.ts":{"bytesInOutput":134},"packages/k8s-tools/src/utils/ensure-init.ts":{"bytesInOutput":579},"packages/k8s-tools/src/index.ts":{"bytesInOutput":0},"packages/k8s-tools/src/generators/helm-chart/generator.ts":{"bytesInOutput":1689},"packages/k8s-tools/src/generators/index.ts":{"bytesInOutput":0},"packages/k8s-tools/src/generators/helm-dependency/generator.ts":{"bytesInOutput":2873},"node_modules/.pnpm/js-yaml@4.1.0/node_modules/js-yaml/dist/js-yaml.mjs":{"bytesInOutput":88006},"packages/k8s-tools/src/plugins/docker/_dockerfile.ts":{"bytesInOutput":5874},"packages/k8s-tools/src/plugins/docker/index.ts":{"bytesInOutput":0},"packages/k8s-tools/src/plugins/index.ts":{"bytesInOutput":0}},"bytes":109356},"dist/packages/k8s-tools/src/executors/helm-package/executor.js":{"imports":[{"path":"@storm-software/workspace-tools/base/base-executor","kind":"require-call","external":true},{"path":"node:child_process","kind":"require-call","external":true},{"path":"@storm-software/config-tools","kind":"dynamic-import","external":true}],"exports":[],"entryPoint":"packages/k8s-tools/src/executors/helm-package/executor.ts","inputs":{"packages/k8s-tools/src/executors/helm-package/executor.ts":{"bytesInOutput":1736},"packages/k8s-tools/src/utils/client.ts":{"bytesInOutput":3288},"packages/k8s-tools/src/types.ts":{"bytesInOutput":134},"packages/k8s-tools/src/utils/ensure-init.ts":{"bytesInOutput":579}},"bytes":7918},"dist/packages/k8s-tools/src/executors/container-publish/executor.js":{"imports":[{"path":"@nx/devkit","kind":"require-call","external":true},{"path":"@storm-software/workspace-tools/utils/apply-workspace-tokens","kind":"require-call","external":true},{"path":"@storm-software/workspace-tools/utils/package-helpers","kind":"require-call","external":true},{"path":"node:https","kind":"require-call","external":true},{"path":"@storm-software/config-tools","kind":"dynamic-import","external":true}],"exports":[],"entryPoint":"packages/k8s-tools/src/executors/container-publish/executor.ts","inputs":{"packages/k8s-tools/src/executors/container-publish/executor.ts":{"bytesInOutput":5914}},"bytes":7475},"dist/packages/k8s-tools/src/generators/helm-chart/generator.js":{"imports":[{"path":"@nx/devkit","kind":"require-call","external":true},{"path":"@storm-software/workspace-tools/base/base-generator","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"@storm-software/config-tools","kind":"dynamic-import","external":true}],"exports":[],"entryPoint":"packages/k8s-tools/src/generators/helm-chart/generator.ts","inputs":{"packages/k8s-tools/src/generators/helm-chart/generator.ts":{"bytesInOutput":1883}},"bytes":3441},"dist/packages/k8s-tools/src/generators/helm-dependency/generator.js":{"imports":[{"path":"@nx/devkit","kind":"require-call","external":true},{"path":"@storm-software/workspace-tools/base/base-generator","kind":"require-call","external":true},{"path":"@storm-software/config-tools","kind":"dynamic-import","external":true}],"exports":[],"entryPoint":"packages/k8s-tools/src/generators/helm-dependency/generator.ts","inputs":{"packages/k8s-tools/src/generators/helm-dependency/generator.ts":{"bytesInOutput":3051},"node_modules/.pnpm/js-yaml@4.1.0/node_modules/js-yaml/dist/js-yaml.mjs":{"bytesInOutput":87999}},"bytes":92893},"dist/packages/k8s-tools/src/plugins/docker/index.js":{"imports":[{"path":"@nx/devkit","kind":"require-call","external":true},{"path":"@storm-software/workspace-tools/utils/package-helpers","kind":"require-call","external":true},{"path":"@storm-software/workspace-tools/utils/project-tags","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"@storm-software/config-tools","kind":"dynamic-import","external":true}],"exports":[],"entryPoint":"packages/k8s-tools/src/plugins/docker/index.ts","inputs":{"packages/k8s-tools/src/plugins/docker/index.ts":{"bytesInOutput":238},"packages/k8s-tools/src/plugins/docker/_dockerfile.ts":{"bytesInOutput":5869}},"bytes":7750}}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/k8s-tools",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "type": "commonjs",
5
5
  "description": "⚡ A Nx plugin package that contains various executors, generators, and utilities that assist in managing k8s IoC.",
6
6
  "repository": {
@@ -33,41 +33,10 @@ __export(executor_exports, {
33
33
  getRegistryVersion: () => getRegistryVersion
34
34
  });
35
35
  module.exports = __toCommonJS(executor_exports);
36
- var import_devkit2 = require("@nx/devkit");
36
+ var import_devkit = require("@nx/devkit");
37
37
  var import_apply_workspace_tokens = require("@storm-software/workspace-tools/utils/apply-workspace-tokens");
38
+ var import_package_helpers = require("@storm-software/workspace-tools/utils/package-helpers");
38
39
  var import_node_https = __toESM(require("node:https"));
39
-
40
- // packages/k8s-tools/src/utils/package-helpers.ts
41
- var import_devkit = require("@nx/devkit");
42
- var import_project_tags = require("@storm-software/workspace-tools/utils/project-tags");
43
- var import_toml = require("@storm-software/workspace-tools/utils/toml");
44
- var import_node_fs = require("node:fs");
45
- var getPackageManager = (project) => {
46
- if ((0, import_project_tags.isEqualProjectTag)(
47
- project,
48
- import_project_tags.ProjectTagConstants.Language.TAG_ID,
49
- import_project_tags.ProjectTagConstants.Language.RUST
50
- ) && (0, import_node_fs.existsSync)((0, import_devkit.joinPathFragments)(project.root, "Cargo.toml"))) {
51
- return {
52
- type: "Cargo.toml",
53
- content: (0, import_toml.parseCargoToml)((0, import_devkit.joinPathFragments)(project.root, "Cargo.toml"))
54
- };
55
- } else if ((0, import_project_tags.isEqualProjectTag)(
56
- project,
57
- import_project_tags.ProjectTagConstants.Language.TAG_ID,
58
- import_project_tags.ProjectTagConstants.Language.TYPESCRIPT
59
- ) && (0, import_node_fs.existsSync)((0, import_devkit.joinPathFragments)(project.root, "package.json"))) {
60
- return {
61
- type: "package.json",
62
- content: (0, import_devkit.readJsonFile)(
63
- (0, import_devkit.joinPathFragments)(project.root, "package.json")
64
- )
65
- };
66
- }
67
- return null;
68
- };
69
-
70
- // packages/k8s-tools/src/executors/container-publish/executor.ts
71
40
  async function* publishExecutor(options, context) {
72
41
  const { loadStormConfig, applyWorkspaceTokens, findWorkspaceRoot } = await import("@storm-software/config-tools");
73
42
  const isDryRun = process.env.NX_DRY_RUN === "true" || options.dryRun || false;
@@ -110,7 +79,7 @@ async function* publishExecutor(options, context) {
110
79
  );
111
80
  } else {
112
81
  console.log(`Published to ${tokenized.registry}`);
113
- const packageManager = getPackageManager(projectConfig);
82
+ const packageManager = (0, import_package_helpers.getPackageInfo)(projectConfig);
114
83
  if (packageManager) {
115
84
  tokenized["build-args"] ??= [
116
85
  "ENVIRONMENT=production",
@@ -118,10 +87,14 @@ async function* publishExecutor(options, context) {
118
87
  ];
119
88
  tokenized["labels"] ??= [];
120
89
  let version = "";
121
- if (packageManager.type === "Cargo.toml") {
122
- version = packageManager.content.package.version;
123
- } else if (packageManager.type === "package.json") {
124
- version = packageManager.content.version;
90
+ if (process.env.TAG) {
91
+ version = process.env.TAG;
92
+ } else {
93
+ if (packageManager.type === "Cargo.toml") {
94
+ version = packageManager.content.package.version;
95
+ } else if (packageManager.type === "package.json") {
96
+ version = packageManager.content.version;
97
+ }
125
98
  }
126
99
  tokenized["build-args"].push(`RELEASE=${version}`);
127
100
  tokenized["labels"].push(`org.opencontainers.image.version=${version}`);
@@ -146,11 +119,11 @@ async function* publishExecutor(options, context) {
146
119
  success: true
147
120
  };
148
121
  }
149
- const { project, target, configuration } = (0, import_devkit2.parseTargetString)(
122
+ const { project, target, configuration } = (0, import_devkit.parseTargetString)(
150
123
  "container",
151
124
  context
152
125
  );
153
- for await (const output of await (0, import_devkit2.runExecutor)({ project, target, configuration }, tokenized, context)) {
126
+ for await (const output of await (0, import_devkit.runExecutor)({ project, target, configuration }, tokenized, context)) {
154
127
  if (!output.success) {
155
128
  throw new Error("Could not compile application files");
156
129
  }
@@ -37,41 +37,10 @@ __export(docker_exports, {
37
37
  module.exports = __toCommonJS(docker_exports);
38
38
 
39
39
  // packages/k8s-tools/src/plugins/docker/_dockerfile.ts
40
- var import_devkit2 = require("@nx/devkit");
41
- var import_project_tags2 = require("@storm-software/workspace-tools/utils/project-tags");
42
- var import_node_fs2 = require("node:fs");
43
-
44
- // packages/k8s-tools/src/utils/package-helpers.ts
45
40
  var import_devkit = require("@nx/devkit");
41
+ var import_package_helpers = require("@storm-software/workspace-tools/utils/package-helpers");
46
42
  var import_project_tags = require("@storm-software/workspace-tools/utils/project-tags");
47
- var import_toml = require("@storm-software/workspace-tools/utils/toml");
48
43
  var import_node_fs = require("node:fs");
49
- var getPackageManager = (project) => {
50
- if ((0, import_project_tags.isEqualProjectTag)(
51
- project,
52
- import_project_tags.ProjectTagConstants.Language.TAG_ID,
53
- import_project_tags.ProjectTagConstants.Language.RUST
54
- ) && (0, import_node_fs.existsSync)((0, import_devkit.joinPathFragments)(project.root, "Cargo.toml"))) {
55
- return {
56
- type: "Cargo.toml",
57
- content: (0, import_toml.parseCargoToml)((0, import_devkit.joinPathFragments)(project.root, "Cargo.toml"))
58
- };
59
- } else if ((0, import_project_tags.isEqualProjectTag)(
60
- project,
61
- import_project_tags.ProjectTagConstants.Language.TAG_ID,
62
- import_project_tags.ProjectTagConstants.Language.TYPESCRIPT
63
- ) && (0, import_node_fs.existsSync)((0, import_devkit.joinPathFragments)(project.root, "package.json"))) {
64
- return {
65
- type: "package.json",
66
- content: (0, import_devkit.readJsonFile)(
67
- (0, import_devkit.joinPathFragments)(project.root, "package.json")
68
- )
69
- };
70
- }
71
- return null;
72
- };
73
-
74
- // packages/k8s-tools/src/plugins/docker/_dockerfile.ts
75
44
  var name = "storm-software/docker/dockerfile";
76
45
  var description = "Plugin for parsing Dockerfile files";
77
46
  var createNodes = [
@@ -84,11 +53,11 @@ var createNodes = [
84
53
  }
85
54
  const { loadStormConfig, findWorkspaceRoot } = await import("@storm-software/config-tools");
86
55
  const root = dockerFilePath.substring(dockerFilePath.lastIndexOf("/") + 1);
87
- const projectJsonPath = (0, import_devkit2.joinPathFragments)(root, "project.json");
88
- if (!(0, import_node_fs2.existsSync)(projectJsonPath)) {
56
+ const projectJsonPath = (0, import_devkit.joinPathFragments)(root, "project.json");
57
+ if (!(0, import_node_fs.existsSync)(projectJsonPath)) {
89
58
  return {};
90
59
  }
91
- const projectJson = (0, import_devkit2.readJsonFile)(projectJsonPath);
60
+ const projectJson = (0, import_devkit.readJsonFile)(projectJsonPath);
92
61
  if (projectJson?.name) {
93
62
  return {};
94
63
  }
@@ -114,7 +83,7 @@ var createNodes = [
114
83
  `org.opencontainers.image.source=${config.repository}`
115
84
  ];
116
85
  let tag = "latest";
117
- const packageManager = getPackageManager(project);
86
+ const packageManager = (0, import_package_helpers.getPackageInfo)(project);
118
87
  if (packageManager) {
119
88
  if (packageManager.type === "Cargo.toml") {
120
89
  tag = packageManager.content.package.version;
@@ -176,11 +145,11 @@ var createNodes = [
176
145
  }
177
146
  }
178
147
  };
179
- if (((0, import_project_tags2.isEqualProjectTag)(
148
+ if (((0, import_project_tags.isEqualProjectTag)(
180
149
  project,
181
- import_project_tags2.ProjectTagConstants.ProjectType.TAG_ID,
182
- import_project_tags2.ProjectTagConstants.ProjectType.APPLICATION
183
- ) || project.projectType === "application") && (0, import_project_tags2.hasProjectTag)(project, import_project_tags2.ProjectTagConstants.Registry.TAG_ID)) {
150
+ import_project_tags.ProjectTagConstants.ProjectType.TAG_ID,
151
+ import_project_tags.ProjectTagConstants.ProjectType.APPLICATION
152
+ ) || project.projectType === "application") && (0, import_project_tags.hasProjectTag)(project, import_project_tags.ProjectTagConstants.Registry.TAG_ID)) {
184
153
  if (project.targets["nx-release-publish"]) {
185
154
  project.targets["nx-release-publish"] = {
186
155
  ...project.targets["nx-release-publish"],
@@ -207,7 +176,7 @@ var createNodes = [
207
176
  };
208
177
  }
209
178
  }
210
- (0, import_project_tags2.setDefaultProjectTags)(project);
179
+ (0, import_project_tags.setDefaultProjectTags)(project);
211
180
  const projects = {};
212
181
  const externalNodes = {};
213
182
  projects[project.root] = {
@@ -1,13 +0,0 @@
1
- import { ProjectConfiguration } from "@nx/devkit";
2
- import { PackageJson } from "@storm-software/workspace-tools/executors/clean-package/types";
3
- import { CargoToml } from "@storm-software/workspace-tools/utils/toml";
4
- export type PackageManagerType = "package.json" | "Cargo.toml";
5
- export declare const PackageManagerTypes: {
6
- PackageJson: PackageManagerType;
7
- CargoToml: PackageManagerType;
8
- };
9
- export type PackageManager = {
10
- content: PackageJson | CargoToml;
11
- type: "package.json" | "Cargo.toml";
12
- };
13
- export declare const getPackageManager: (project: ProjectConfiguration) => null | PackageManager;