@catladder/cli 0.0.0-main-4d1a3af5 → 0.0.0-main-36cd2ea8

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.
Files changed (47) hide show
  1. package/dist/bundles/catenv/index.js +113 -84
  2. package/dist/bundles/cli/index.js +96 -66
  3. package/dist/cli/src/apps/catenv/catenv.js +5 -4
  4. package/dist/cli/src/apps/catenv/catenv.js.map +1 -1
  5. package/dist/cli/src/apps/catenv/printVariables.d.ts +2 -2
  6. package/dist/cli/src/apps/catenv/printVariables.js +2 -2
  7. package/dist/cli/src/apps/catenv/printVariables.js.map +1 -1
  8. package/dist/cli/src/apps/catenv/writeDotEnvFiles.d.ts +2 -2
  9. package/dist/cli/src/apps/catenv/writeDotEnvFiles.js +5 -6
  10. package/dist/cli/src/apps/catenv/writeDotEnvFiles.js.map +1 -1
  11. package/dist/cli/src/apps/catenv/writeEnvDTs.d.ts +2 -2
  12. package/dist/cli/src/apps/catenv/writeEnvDTs.js +5 -6
  13. package/dist/cli/src/apps/catenv/writeEnvDTs.js.map +1 -1
  14. package/dist/pipeline/src/catenv/index.d.ts +7 -0
  15. package/dist/pipeline/src/catenv/index.js +12 -0
  16. package/dist/pipeline/src/catenv/index.js.map +1 -0
  17. package/dist/pipeline/src/index.d.ts +1 -0
  18. package/dist/pipeline/src/index.js +1 -0
  19. package/dist/pipeline/src/index.js.map +1 -1
  20. package/dist/pipeline/src/pipeline/createMainPipeline.js +1 -1
  21. package/dist/pipeline/src/pipeline/createMainPipeline.js.map +1 -1
  22. package/dist/pipeline/src/pipeline/generatePipelineFiles.d.ts +2 -1
  23. package/dist/pipeline/src/pipeline/generatePipelineFiles.js +3 -4
  24. package/dist/pipeline/src/pipeline/generatePipelineFiles.js.map +1 -1
  25. package/dist/pipeline/src/pipeline/gitlab/gitlabReleaseJobs.d.ts +2 -1
  26. package/dist/pipeline/src/pipeline/gitlab/gitlabReleaseJobs.js +29 -3
  27. package/dist/pipeline/src/pipeline/gitlab/gitlabReleaseJobs.js.map +1 -1
  28. package/dist/pipeline/src/rules/index.d.ts +0 -2
  29. package/dist/pipeline/src/rules/index.js +1 -31
  30. package/dist/pipeline/src/rules/index.js.map +1 -1
  31. package/dist/pipeline/src/types/config.d.ts +10 -0
  32. package/dist/pipeline/src/types/config.js.map +1 -1
  33. package/dist/pipeline/src/types/hooks.d.ts +26 -0
  34. package/dist/pipeline/src/types/hooks.js +3 -0
  35. package/dist/pipeline/src/types/hooks.js.map +1 -0
  36. package/dist/pipeline/src/types/release.d.ts +7 -0
  37. package/dist/pipeline/src/types/release.js +3 -0
  38. package/dist/pipeline/src/types/release.js.map +1 -0
  39. package/dist/pipeline/src/utils/writeFiles.d.ts +12 -4
  40. package/dist/pipeline/src/utils/writeFiles.js +42 -27
  41. package/dist/pipeline/src/utils/writeFiles.js.map +1 -1
  42. package/dist/tsconfig.tsbuildinfo +1 -1
  43. package/package.json +1 -1
  44. package/src/apps/catenv/catenv.ts +11 -5
  45. package/src/apps/catenv/printVariables.ts +6 -3
  46. package/src/apps/catenv/writeDotEnvFiles.ts +21 -8
  47. package/src/apps/catenv/writeEnvDTs.ts +15 -6
@@ -18,11 +18,12 @@ exports["default"] = async (choice) => {
18
18
  if (!config) {
19
19
  return;
20
20
  }
21
+ const context = (0, pipeline_1.createCatenvContext)(config);
21
22
  await Promise.all([
22
- (0, pipeline_1.generatePipelineFiles)(config, (_a = config.pipelineType) !== null && _a !== void 0 ? _a : "gitlab"),
23
- (0, writeDotEnvFiles_1.writeDotEnvFiles)(config, choice),
24
- (0, writeEnvDTs_1.writeDTsFiles)(config, choice),
25
- (0, printVariables_1.printVariables)(config, choice),
23
+ (0, pipeline_1.generatePipelineFiles)(context, (_a = config.pipelineType) !== null && _a !== void 0 ? _a : "gitlab"),
24
+ (0, writeDotEnvFiles_1.writeDotEnvFiles)(context, choice),
25
+ (0, writeEnvDTs_1.writeDTsFiles)(context, choice),
26
+ (0, printVariables_1.printVariables)(context, choice),
26
27
  ]);
27
28
  };
28
29
  //# sourceMappingURL=catenv.js.map
@@ -72,8 +73,8 @@ const getAllVariablesToPrint = async (config, choice) => {
72
73
  }, Promise.resolve({}));
73
74
  }
74
75
  };
75
- const printVariables = async (config, choice) => {
76
- const variables = await getAllVariablesToPrint(config, choice);
76
+ const printVariables = async (context, choice) => {
77
+ const variables = await getAllVariablesToPrint(context.config, choice);
77
78
  console.log(makeExportKeyValuestring(variables));
78
79
  };
79
80
  exports.printVariables = printVariables;
@@ -134,14 +135,13 @@ exports.sanitizeEnvVarName = sanitizeEnvVarName;
134
135
 
135
136
  Object.defineProperty(exports, "__esModule", ({ value: true }));
136
137
  exports.writeDotEnvFiles = void 0;
137
- const pipeline_1 = __nccwpck_require__(603);
138
138
  const path_1 = __nccwpck_require__(1017);
139
139
  const getProjectConfig_1 = __nccwpck_require__(5264);
140
140
  const projects_1 = __nccwpck_require__(9011);
141
141
  const utils_1 = __nccwpck_require__(4560);
142
- const writeDotEnvFiles = async (config, choice) => {
143
- const { env, currentComponent } = await (0, utils_1.getCurrentComponentAndEnvFromChoice)(config, choice);
144
- const componentsWithEnabledDotEnvWrite = Object.entries(config.components)
142
+ const writeDotEnvFiles = async (context, choice) => {
143
+ const { env, currentComponent } = await (0, utils_1.getCurrentComponentAndEnvFromChoice)(context.config, choice);
144
+ const componentsWithEnabledDotEnvWrite = Object.entries(context.config.components)
145
145
  .filter(([, component]) => { var _a; return (_a = component === null || component === void 0 ? void 0 : component.dotEnv) !== null && _a !== void 0 ? _a : true; }) // when set to true or "local"
146
146
  .map(([componentName]) => componentName);
147
147
  const componentsToActuallyWriteDotEnvNow = currentComponent
@@ -153,9 +153,9 @@ const writeDotEnvFiles = async (config, choice) => {
153
153
  for (const componentName of componentsToActuallyWriteDotEnvNow) {
154
154
  const variables = await (0, getProjectConfig_1.getEnvVarsResolved)(null, env, componentName);
155
155
  delete variables["_ALL_ENV_VAR_KEYS"];
156
- const componentDir = (0, utils_1.getComponentFullPath)(gitRoot, config, componentName);
156
+ const componentDir = (0, utils_1.getComponentFullPath)(gitRoot, context.config, componentName);
157
157
  const filePath = (0, path_1.join)(componentDir, ".env");
158
- await (0, pipeline_1.writeGeneratedFile)(filePath, (0, utils_1.makeKeyValueString)(variables), {
158
+ await context.fileWriter.writeGeneratedFile(filePath, (0, utils_1.makeKeyValueString)(variables), {
159
159
  commentChar: "#",
160
160
  });
161
161
  }
@@ -172,14 +172,13 @@ exports.writeDotEnvFiles = writeDotEnvFiles;
172
172
 
173
173
  Object.defineProperty(exports, "__esModule", ({ value: true }));
174
174
  exports.writeDTsFiles = void 0;
175
- const pipeline_1 = __nccwpck_require__(603);
176
175
  const path_1 = __nccwpck_require__(1017);
177
176
  const getProjectConfig_1 = __nccwpck_require__(5264);
178
177
  const projects_1 = __nccwpck_require__(9011);
179
178
  const utils_1 = __nccwpck_require__(4560);
180
- const writeDTsFiles = async (config, choice) => {
181
- const { env, currentComponent } = await (0, utils_1.getCurrentComponentAndEnvFromChoice)(config, choice);
182
- const componentsWithEnabledEnvDTsWrite = Object.entries(config.components)
179
+ const writeDTsFiles = async (context, choice) => {
180
+ const { env, currentComponent } = await (0, utils_1.getCurrentComponentAndEnvFromChoice)(context.config, choice);
181
+ const componentsWithEnabledEnvDTsWrite = Object.entries(context.config.components)
183
182
  .filter(([, component]) => { var _a; return (_a = component === null || component === void 0 ? void 0 : component.envDTs) !== null && _a !== void 0 ? _a : true; })
184
183
  .map(([componentName]) => componentName);
185
184
  const componentsToActuallyWriteEnvDts = currentComponent
@@ -191,9 +190,9 @@ const writeDTsFiles = async (config, choice) => {
191
190
  for (const componentName of componentsToActuallyWriteEnvDts) {
192
191
  const envNames = await getEnvsForDTs(env, componentName);
193
192
  const envDTsContent = createEnvDTsContent(envNames);
194
- const componentDir = (0, utils_1.getComponentFullPath)(gitRoot, config, componentName);
193
+ const componentDir = (0, utils_1.getComponentFullPath)(gitRoot, context.config, componentName);
195
194
  const filePath = (0, path_1.join)(componentDir, "env.d.ts");
196
- await (0, pipeline_1.writeGeneratedFile)(filePath, envDTsContent, {
195
+ await context.fileWriter.writeGeneratedFile(filePath, envDTsContent, {
197
196
  commentChar: "//",
198
197
  });
199
198
  }
@@ -2696,6 +2695,25 @@ exports.isOfBuildType = isOfBuildType;
2696
2695
 
2697
2696
  /***/ }),
2698
2697
 
2698
+ /***/ 2155:
2699
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
2700
+
2701
+ "use strict";
2702
+
2703
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
2704
+ exports.createCatenvContext = void 0;
2705
+ const writeFiles_1 = __nccwpck_require__(2228);
2706
+ const createCatenvContext = (config) => {
2707
+ return {
2708
+ config,
2709
+ fileWriter: writeFiles_1.FileWriter.create(config),
2710
+ };
2711
+ };
2712
+ exports.createCatenvContext = createCatenvContext;
2713
+ //# sourceMappingURL=index.js.map
2714
+
2715
+ /***/ }),
2716
+
2699
2717
  /***/ 9609:
2700
2718
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
2701
2719
 
@@ -5882,6 +5900,7 @@ __exportStar(__nccwpck_require__(8483), exports);
5882
5900
  __exportStar(__nccwpck_require__(2228), exports);
5883
5901
  __exportStar(__nccwpck_require__(1619), exports);
5884
5902
  __exportStar(__nccwpck_require__(2990), exports);
5903
+ __exportStar(__nccwpck_require__(2155), exports);
5885
5904
  //# sourceMappingURL=index.js.map
5886
5905
 
5887
5906
  /***/ }),
@@ -6573,7 +6592,7 @@ const createMainPipeline = async (pipelineType, config) => {
6573
6592
  stages: [...stages, "release"],
6574
6593
  jobs: {
6575
6594
  ...allJobs,
6576
- ...Object.fromEntries(Object.entries((0, gitlabReleaseJobs_1.getGitlabReleaseJobs)()).map(([name, gitlabJob]) => [
6595
+ ...Object.fromEntries(Object.entries((0, gitlabReleaseJobs_1.getGitlabReleaseJobs)(config)).map(([name, gitlabJob]) => [
6577
6596
  name,
6578
6597
  {
6579
6598
  gitlabJob,
@@ -6617,16 +6636,15 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
6617
6636
  exports.getGitlabCompletePipeline = exports.generatePipelineFiles = void 0;
6618
6637
  const promises_1 = __nccwpck_require__(3292);
6619
6638
  const path_1 = __nccwpck_require__(1017);
6620
- const writeFiles_1 = __nccwpck_require__(2228);
6621
6639
  const createMainPipeline_1 = __nccwpck_require__(9192);
6622
6640
  const sortGitLabJobDefProps_1 = __nccwpck_require__(2361);
6623
6641
  const CATLADDER_GENERATED_FOLDER = ".catladder-generated";
6624
6642
  const GITLAB_GENERATED_FOLDER = CATLADDER_GENERATED_FOLDER + "/gitlab";
6625
- async function generatePipelineFiles(config, pipelineType) {
6643
+ async function generatePipelineFiles(context, pipelineType) {
6626
6644
  if (pipelineType !== "gitlab") {
6627
6645
  throw new Error("Pipeline type not supported");
6628
6646
  }
6629
- const includes = await getGitlabPipelineIncludes(config);
6647
+ const includes = await getGitlabPipelineIncludes(context.config);
6630
6648
  const mainFile = {
6631
6649
  path: ".gitlab-ci.yml",
6632
6650
  content: {
@@ -6639,7 +6657,7 @@ async function generatePipelineFiles(config, pipelineType) {
6639
6657
  // write files
6640
6658
  await Promise.all(files.map(async ({ path, content }) => {
6641
6659
  await (0, promises_1.mkdir)((0, path_1.dirname)(path), { recursive: true });
6642
- await (0, writeFiles_1.writeYamlfile)(path, content);
6660
+ await context.fileWriter.writeYamlfile(path, content);
6643
6661
  }));
6644
6662
  }
6645
6663
  exports.generatePipelineFiles = generatePipelineFiles;
@@ -7090,20 +7108,46 @@ exports.getGitlabReleaseJobs = void 0;
7090
7108
  const rules_1 = __nccwpck_require__(7551);
7091
7109
  const runner_1 = __nccwpck_require__(4058);
7092
7110
  const EXPIRED_TOKEN_HELP = "echo '👉 The project access token might be invald - run `project-renew-token` in catladder CLI to fix.'";
7093
- const getGitlabReleaseJobs = () => {
7111
+ const baseReleaseRules = [
7112
+ rules_1.RULE_NEVER_ON_RELEASE_COMMIT,
7113
+ rules_1.RULE_NEVER_ON_AGENT_TRIGGER,
7114
+ rules_1.RULE_NEVER_ON_SCHEDULE,
7115
+ ];
7116
+ const getGitlabReleaseJobs = (config) => {
7117
+ var _a;
7094
7118
  return {
7095
7119
  ["create release"]: {
7096
7120
  stage: "release",
7097
7121
  image: (0, runner_1.getRunnerImage)("semantic-release"),
7098
7122
  script: ["semanticRelease", EXPIRED_TOKEN_HELP],
7099
- rules: rules_1.RULES_RELEASE,
7123
+ rules: [
7124
+ ...baseReleaseRules,
7125
+ {
7126
+ if: rules_1.RULE_CONDITION_MAIN_BRANCH,
7127
+ when: ((_a = config.releases) === null || _a === void 0 ? void 0 : _a.when) === "auto" ? "on_success" : "manual",
7128
+ },
7129
+ {
7130
+ if: rules_1.RULE_CONDITION_HOTFIX_BRANCH,
7131
+ when: "manual",
7132
+ },
7133
+ ],
7100
7134
  },
7101
7135
  ["⚠️ force create release"]: {
7102
7136
  stage: "release",
7103
7137
  image: (0, runner_1.getRunnerImage)("semantic-release"),
7104
7138
  script: ["semanticRelease", EXPIRED_TOKEN_HELP],
7105
7139
  needs: [],
7106
- rules: rules_1.RULES_MANUAL_RELEASE,
7140
+ rules: [
7141
+ ...baseReleaseRules,
7142
+ {
7143
+ if: rules_1.RULE_CONDITION_MAIN_BRANCH,
7144
+ when: "manual",
7145
+ },
7146
+ {
7147
+ if: rules_1.RULE_CONDITION_HOTFIX_BRANCH,
7148
+ when: "manual",
7149
+ },
7150
+ ],
7107
7151
  },
7108
7152
  };
7109
7153
  };
@@ -7340,7 +7384,7 @@ exports.getWorkspaceDependencies = getWorkspaceDependencies;
7340
7384
  "use strict";
7341
7385
 
7342
7386
  Object.defineProperty(exports, "__esModule", ({ value: true }));
7343
- exports.RULES_MANUAL_RELEASE = exports.RULES_RELEASE = exports.RULE_CONDITION_HOTFIX_BRANCH = exports.RULE_IS_TAGGED_RELEASE = exports.RULE_IS_MERGE_REQUEST = exports.RULE_NEVER_ON_SCHEDULE = exports.RULE_NEVER_ON_AGENT_TRIGGER = exports.RULE_NEVER_ON_RELEASE_COMMIT = exports.RULE_IS_MAIN_BRANCH_AND_NOT_RELEASE_COMMIT = exports.RULE_IS_MAIN_BRANCH = exports.RULE_CONDITION_NOT_RELEASE_COMMIT = exports.RULE_CONDITION_RELEASE_COMMIT = exports.RULE_CONDITION_MAIN_BRANCH = void 0;
7387
+ exports.RULE_CONDITION_HOTFIX_BRANCH = exports.RULE_IS_TAGGED_RELEASE = exports.RULE_IS_MERGE_REQUEST = exports.RULE_NEVER_ON_SCHEDULE = exports.RULE_NEVER_ON_AGENT_TRIGGER = exports.RULE_NEVER_ON_RELEASE_COMMIT = exports.RULE_IS_MAIN_BRANCH_AND_NOT_RELEASE_COMMIT = exports.RULE_IS_MAIN_BRANCH = exports.RULE_CONDITION_NOT_RELEASE_COMMIT = exports.RULE_CONDITION_RELEASE_COMMIT = exports.RULE_CONDITION_MAIN_BRANCH = void 0;
7344
7388
  exports.RULE_CONDITION_MAIN_BRANCH = "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH";
7345
7389
  exports.RULE_CONDITION_RELEASE_COMMIT = "$CI_COMMIT_MESSAGE =~ /^chore\\(release\\).*/";
7346
7390
  exports.RULE_CONDITION_NOT_RELEASE_COMMIT = "$CI_COMMIT_MESSAGE !~ /^chore\\(release\\).*/";
@@ -7370,36 +7414,6 @@ exports.RULE_IS_TAGGED_RELEASE = {
7370
7414
  if: "$CI_COMMIT_TAG",
7371
7415
  };
7372
7416
  exports.RULE_CONDITION_HOTFIX_BRANCH = "$CI_COMMIT_BRANCH =~ /^[0-9]+.([0-9]+|x).x$/";
7373
- exports.RULES_RELEASE = [
7374
- exports.RULE_NEVER_ON_RELEASE_COMMIT,
7375
- exports.RULE_NEVER_ON_AGENT_TRIGGER,
7376
- exports.RULE_NEVER_ON_SCHEDULE,
7377
- {
7378
- if: exports.RULE_CONDITION_MAIN_BRANCH + ' && $AUTO_RELEASE == "true"',
7379
- when: "on_success",
7380
- },
7381
- {
7382
- if: exports.RULE_CONDITION_MAIN_BRANCH,
7383
- when: "manual",
7384
- },
7385
- {
7386
- if: exports.RULE_CONDITION_HOTFIX_BRANCH,
7387
- when: "manual",
7388
- },
7389
- ];
7390
- exports.RULES_MANUAL_RELEASE = [
7391
- exports.RULE_NEVER_ON_RELEASE_COMMIT,
7392
- exports.RULE_NEVER_ON_AGENT_TRIGGER,
7393
- exports.RULE_NEVER_ON_SCHEDULE,
7394
- {
7395
- if: exports.RULE_CONDITION_MAIN_BRANCH,
7396
- when: "manual",
7397
- },
7398
- {
7399
- if: exports.RULE_CONDITION_HOTFIX_BRANCH,
7400
- when: "manual",
7401
- },
7402
- ];
7403
7417
  //# sourceMappingURL=index.js.map
7404
7418
 
7405
7419
  /***/ }),
@@ -7692,29 +7706,9 @@ exports.removeUndefined = removeUndefined;
7692
7706
  "use strict";
7693
7707
 
7694
7708
  Object.defineProperty(exports, "__esModule", ({ value: true }));
7695
- exports.writeYamlfile = exports.yamlStringifyOptions = exports.writeGeneratedFile = exports.getAutoGeneratedHeader = void 0;
7709
+ exports.FileWriter = exports.yamlStringifyOptions = void 0;
7696
7710
  const promises_1 = __nccwpck_require__(3292);
7697
7711
  const yaml_1 = __nccwpck_require__(8033);
7698
- const getAutoGeneratedHeader = (commentChar) => {
7699
- return [
7700
- "-------------------------------------------------",
7701
- `🐱 🔨 This file is generated by catladder`,
7702
- `🚨 Do not edit this file manually 🚨`,
7703
- "-------------------------------------------------",
7704
- ]
7705
- .map((line) => `${commentChar} ${line}`)
7706
- .join("\n")
7707
- .concat("\n");
7708
- };
7709
- exports.getAutoGeneratedHeader = getAutoGeneratedHeader;
7710
- const writeGeneratedFile = async (path, content, { commentChar, }) => {
7711
- await (0, promises_1.writeFile)(path,
7712
- // need to spread out the jobs, forgot why
7713
- [(0, exports.getAutoGeneratedHeader)(commentChar), content].join("\n"), {
7714
- encoding: "utf-8",
7715
- });
7716
- };
7717
- exports.writeGeneratedFile = writeGeneratedFile;
7718
7712
  exports.yamlStringifyOptions = {
7719
7713
  // prevents colapsing long command statements into multiple lines
7720
7714
  lineWidth: 0,
@@ -7723,12 +7717,47 @@ exports.yamlStringifyOptions = {
7723
7717
  // Better readability when bash commands most often use double quotes
7724
7718
  singleQuote: true,
7725
7719
  };
7726
- const writeYamlfile = async (path, data) => {
7727
- await (0, exports.writeGeneratedFile)(path, (0, yaml_1.stringify)(data, exports.yamlStringifyOptions), {
7728
- commentChar: "#",
7729
- });
7730
- };
7731
- exports.writeYamlfile = writeYamlfile;
7720
+ class FileWriter {
7721
+ static create(config) {
7722
+ return new FileWriter(config);
7723
+ }
7724
+ constructor(config) {
7725
+ this.config = config;
7726
+ this.config = config;
7727
+ }
7728
+ async writeTheFile(path, content) {
7729
+ var _a, _b;
7730
+ const transformedContent = await ((_a = this.config.hooks) === null || _a === void 0 ? void 0 : _a.transformFileBeforeWrite({
7731
+ filename: path,
7732
+ content,
7733
+ extension: (_b = path.split(".").pop()) !== null && _b !== void 0 ? _b : "",
7734
+ path,
7735
+ }));
7736
+ await (0, promises_1.writeFile)(path, transformedContent !== null && transformedContent !== void 0 ? transformedContent : content, {
7737
+ encoding: "utf-8",
7738
+ });
7739
+ }
7740
+ async writeGeneratedFile(path, content, options) {
7741
+ await this.writeTheFile(path, [this.getAutoGeneratedHeader(options.commentChar), content].join("\n"));
7742
+ }
7743
+ writeYamlfile(path, data) {
7744
+ return this.writeGeneratedFile(path, (0, yaml_1.stringify)(data, exports.yamlStringifyOptions), {
7745
+ commentChar: "#",
7746
+ });
7747
+ }
7748
+ getAutoGeneratedHeader(commentChar) {
7749
+ return [
7750
+ "-------------------------------------------------",
7751
+ `🐱 🔨 This file is generated by catladder`,
7752
+ `🚨 Do not edit this file manually 🚨`,
7753
+ "-------------------------------------------------",
7754
+ ]
7755
+ .map((line) => `${commentChar} ${line}`)
7756
+ .join("\n")
7757
+ .concat("\n");
7758
+ }
7759
+ }
7760
+ exports.FileWriter = FileWriter;
7732
7761
  //# sourceMappingURL=writeFiles.js.map
7733
7762
 
7734
7763
  /***/ }),
@@ -5950,6 +5950,25 @@ exports.isOfBuildType = isOfBuildType;
5950
5950
 
5951
5951
  /***/ }),
5952
5952
 
5953
+ /***/ 32155:
5954
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
5955
+
5956
+ "use strict";
5957
+
5958
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
5959
+ exports.createCatenvContext = void 0;
5960
+ const writeFiles_1 = __nccwpck_require__(92228);
5961
+ const createCatenvContext = (config) => {
5962
+ return {
5963
+ config,
5964
+ fileWriter: writeFiles_1.FileWriter.create(config),
5965
+ };
5966
+ };
5967
+ exports.createCatenvContext = createCatenvContext;
5968
+ //# sourceMappingURL=index.js.map
5969
+
5970
+ /***/ }),
5971
+
5953
5972
  /***/ 45449:
5954
5973
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
5955
5974
 
@@ -9136,6 +9155,7 @@ __exportStar(__nccwpck_require__(68483), exports);
9136
9155
  __exportStar(__nccwpck_require__(92228), exports);
9137
9156
  __exportStar(__nccwpck_require__(51619), exports);
9138
9157
  __exportStar(__nccwpck_require__(22990), exports);
9158
+ __exportStar(__nccwpck_require__(32155), exports);
9139
9159
  //# sourceMappingURL=index.js.map
9140
9160
 
9141
9161
  /***/ }),
@@ -9827,7 +9847,7 @@ const createMainPipeline = async (pipelineType, config) => {
9827
9847
  stages: [...stages, "release"],
9828
9848
  jobs: {
9829
9849
  ...allJobs,
9830
- ...Object.fromEntries(Object.entries((0, gitlabReleaseJobs_1.getGitlabReleaseJobs)()).map(([name, gitlabJob]) => [
9850
+ ...Object.fromEntries(Object.entries((0, gitlabReleaseJobs_1.getGitlabReleaseJobs)(config)).map(([name, gitlabJob]) => [
9831
9851
  name,
9832
9852
  {
9833
9853
  gitlabJob,
@@ -9871,16 +9891,15 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
9871
9891
  exports.getGitlabCompletePipeline = exports.generatePipelineFiles = void 0;
9872
9892
  const promises_1 = __nccwpck_require__(73292);
9873
9893
  const path_1 = __nccwpck_require__(71017);
9874
- const writeFiles_1 = __nccwpck_require__(92228);
9875
9894
  const createMainPipeline_1 = __nccwpck_require__(39192);
9876
9895
  const sortGitLabJobDefProps_1 = __nccwpck_require__(72361);
9877
9896
  const CATLADDER_GENERATED_FOLDER = ".catladder-generated";
9878
9897
  const GITLAB_GENERATED_FOLDER = CATLADDER_GENERATED_FOLDER + "/gitlab";
9879
- async function generatePipelineFiles(config, pipelineType) {
9898
+ async function generatePipelineFiles(context, pipelineType) {
9880
9899
  if (pipelineType !== "gitlab") {
9881
9900
  throw new Error("Pipeline type not supported");
9882
9901
  }
9883
- const includes = await getGitlabPipelineIncludes(config);
9902
+ const includes = await getGitlabPipelineIncludes(context.config);
9884
9903
  const mainFile = {
9885
9904
  path: ".gitlab-ci.yml",
9886
9905
  content: {
@@ -9893,7 +9912,7 @@ async function generatePipelineFiles(config, pipelineType) {
9893
9912
  // write files
9894
9913
  await Promise.all(files.map(async ({ path, content }) => {
9895
9914
  await (0, promises_1.mkdir)((0, path_1.dirname)(path), { recursive: true });
9896
- await (0, writeFiles_1.writeYamlfile)(path, content);
9915
+ await context.fileWriter.writeYamlfile(path, content);
9897
9916
  }));
9898
9917
  }
9899
9918
  exports.generatePipelineFiles = generatePipelineFiles;
@@ -10344,20 +10363,46 @@ exports.getGitlabReleaseJobs = void 0;
10344
10363
  const rules_1 = __nccwpck_require__(47551);
10345
10364
  const runner_1 = __nccwpck_require__(4058);
10346
10365
  const EXPIRED_TOKEN_HELP = "echo '👉 The project access token might be invald - run `project-renew-token` in catladder CLI to fix.'";
10347
- const getGitlabReleaseJobs = () => {
10366
+ const baseReleaseRules = [
10367
+ rules_1.RULE_NEVER_ON_RELEASE_COMMIT,
10368
+ rules_1.RULE_NEVER_ON_AGENT_TRIGGER,
10369
+ rules_1.RULE_NEVER_ON_SCHEDULE,
10370
+ ];
10371
+ const getGitlabReleaseJobs = (config) => {
10372
+ var _a;
10348
10373
  return {
10349
10374
  ["create release"]: {
10350
10375
  stage: "release",
10351
10376
  image: (0, runner_1.getRunnerImage)("semantic-release"),
10352
10377
  script: ["semanticRelease", EXPIRED_TOKEN_HELP],
10353
- rules: rules_1.RULES_RELEASE,
10378
+ rules: [
10379
+ ...baseReleaseRules,
10380
+ {
10381
+ if: rules_1.RULE_CONDITION_MAIN_BRANCH,
10382
+ when: ((_a = config.releases) === null || _a === void 0 ? void 0 : _a.when) === "auto" ? "on_success" : "manual",
10383
+ },
10384
+ {
10385
+ if: rules_1.RULE_CONDITION_HOTFIX_BRANCH,
10386
+ when: "manual",
10387
+ },
10388
+ ],
10354
10389
  },
10355
10390
  ["⚠️ force create release"]: {
10356
10391
  stage: "release",
10357
10392
  image: (0, runner_1.getRunnerImage)("semantic-release"),
10358
10393
  script: ["semanticRelease", EXPIRED_TOKEN_HELP],
10359
10394
  needs: [],
10360
- rules: rules_1.RULES_MANUAL_RELEASE,
10395
+ rules: [
10396
+ ...baseReleaseRules,
10397
+ {
10398
+ if: rules_1.RULE_CONDITION_MAIN_BRANCH,
10399
+ when: "manual",
10400
+ },
10401
+ {
10402
+ if: rules_1.RULE_CONDITION_HOTFIX_BRANCH,
10403
+ when: "manual",
10404
+ },
10405
+ ],
10361
10406
  },
10362
10407
  };
10363
10408
  };
@@ -10594,7 +10639,7 @@ exports.getWorkspaceDependencies = getWorkspaceDependencies;
10594
10639
  "use strict";
10595
10640
 
10596
10641
  Object.defineProperty(exports, "__esModule", ({ value: true }));
10597
- exports.RULES_MANUAL_RELEASE = exports.RULES_RELEASE = exports.RULE_CONDITION_HOTFIX_BRANCH = exports.RULE_IS_TAGGED_RELEASE = exports.RULE_IS_MERGE_REQUEST = exports.RULE_NEVER_ON_SCHEDULE = exports.RULE_NEVER_ON_AGENT_TRIGGER = exports.RULE_NEVER_ON_RELEASE_COMMIT = exports.RULE_IS_MAIN_BRANCH_AND_NOT_RELEASE_COMMIT = exports.RULE_IS_MAIN_BRANCH = exports.RULE_CONDITION_NOT_RELEASE_COMMIT = exports.RULE_CONDITION_RELEASE_COMMIT = exports.RULE_CONDITION_MAIN_BRANCH = void 0;
10642
+ exports.RULE_CONDITION_HOTFIX_BRANCH = exports.RULE_IS_TAGGED_RELEASE = exports.RULE_IS_MERGE_REQUEST = exports.RULE_NEVER_ON_SCHEDULE = exports.RULE_NEVER_ON_AGENT_TRIGGER = exports.RULE_NEVER_ON_RELEASE_COMMIT = exports.RULE_IS_MAIN_BRANCH_AND_NOT_RELEASE_COMMIT = exports.RULE_IS_MAIN_BRANCH = exports.RULE_CONDITION_NOT_RELEASE_COMMIT = exports.RULE_CONDITION_RELEASE_COMMIT = exports.RULE_CONDITION_MAIN_BRANCH = void 0;
10598
10643
  exports.RULE_CONDITION_MAIN_BRANCH = "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH";
10599
10644
  exports.RULE_CONDITION_RELEASE_COMMIT = "$CI_COMMIT_MESSAGE =~ /^chore\\(release\\).*/";
10600
10645
  exports.RULE_CONDITION_NOT_RELEASE_COMMIT = "$CI_COMMIT_MESSAGE !~ /^chore\\(release\\).*/";
@@ -10624,36 +10669,6 @@ exports.RULE_IS_TAGGED_RELEASE = {
10624
10669
  if: "$CI_COMMIT_TAG",
10625
10670
  };
10626
10671
  exports.RULE_CONDITION_HOTFIX_BRANCH = "$CI_COMMIT_BRANCH =~ /^[0-9]+.([0-9]+|x).x$/";
10627
- exports.RULES_RELEASE = [
10628
- exports.RULE_NEVER_ON_RELEASE_COMMIT,
10629
- exports.RULE_NEVER_ON_AGENT_TRIGGER,
10630
- exports.RULE_NEVER_ON_SCHEDULE,
10631
- {
10632
- if: exports.RULE_CONDITION_MAIN_BRANCH + ' && $AUTO_RELEASE == "true"',
10633
- when: "on_success",
10634
- },
10635
- {
10636
- if: exports.RULE_CONDITION_MAIN_BRANCH,
10637
- when: "manual",
10638
- },
10639
- {
10640
- if: exports.RULE_CONDITION_HOTFIX_BRANCH,
10641
- when: "manual",
10642
- },
10643
- ];
10644
- exports.RULES_MANUAL_RELEASE = [
10645
- exports.RULE_NEVER_ON_RELEASE_COMMIT,
10646
- exports.RULE_NEVER_ON_AGENT_TRIGGER,
10647
- exports.RULE_NEVER_ON_SCHEDULE,
10648
- {
10649
- if: exports.RULE_CONDITION_MAIN_BRANCH,
10650
- when: "manual",
10651
- },
10652
- {
10653
- if: exports.RULE_CONDITION_HOTFIX_BRANCH,
10654
- when: "manual",
10655
- },
10656
- ];
10657
10672
  //# sourceMappingURL=index.js.map
10658
10673
 
10659
10674
  /***/ }),
@@ -10946,29 +10961,9 @@ exports.removeUndefined = removeUndefined;
10946
10961
  "use strict";
10947
10962
 
10948
10963
  Object.defineProperty(exports, "__esModule", ({ value: true }));
10949
- exports.writeYamlfile = exports.yamlStringifyOptions = exports.writeGeneratedFile = exports.getAutoGeneratedHeader = void 0;
10964
+ exports.FileWriter = exports.yamlStringifyOptions = void 0;
10950
10965
  const promises_1 = __nccwpck_require__(73292);
10951
10966
  const yaml_1 = __nccwpck_require__(68033);
10952
- const getAutoGeneratedHeader = (commentChar) => {
10953
- return [
10954
- "-------------------------------------------------",
10955
- `🐱 🔨 This file is generated by catladder`,
10956
- `🚨 Do not edit this file manually 🚨`,
10957
- "-------------------------------------------------",
10958
- ]
10959
- .map((line) => `${commentChar} ${line}`)
10960
- .join("\n")
10961
- .concat("\n");
10962
- };
10963
- exports.getAutoGeneratedHeader = getAutoGeneratedHeader;
10964
- const writeGeneratedFile = async (path, content, { commentChar, }) => {
10965
- await (0, promises_1.writeFile)(path,
10966
- // need to spread out the jobs, forgot why
10967
- [(0, exports.getAutoGeneratedHeader)(commentChar), content].join("\n"), {
10968
- encoding: "utf-8",
10969
- });
10970
- };
10971
- exports.writeGeneratedFile = writeGeneratedFile;
10972
10967
  exports.yamlStringifyOptions = {
10973
10968
  // prevents colapsing long command statements into multiple lines
10974
10969
  lineWidth: 0,
@@ -10977,12 +10972,47 @@ exports.yamlStringifyOptions = {
10977
10972
  // Better readability when bash commands most often use double quotes
10978
10973
  singleQuote: true,
10979
10974
  };
10980
- const writeYamlfile = async (path, data) => {
10981
- await (0, exports.writeGeneratedFile)(path, (0, yaml_1.stringify)(data, exports.yamlStringifyOptions), {
10982
- commentChar: "#",
10983
- });
10984
- };
10985
- exports.writeYamlfile = writeYamlfile;
10975
+ class FileWriter {
10976
+ static create(config) {
10977
+ return new FileWriter(config);
10978
+ }
10979
+ constructor(config) {
10980
+ this.config = config;
10981
+ this.config = config;
10982
+ }
10983
+ async writeTheFile(path, content) {
10984
+ var _a, _b;
10985
+ const transformedContent = await ((_a = this.config.hooks) === null || _a === void 0 ? void 0 : _a.transformFileBeforeWrite({
10986
+ filename: path,
10987
+ content,
10988
+ extension: (_b = path.split(".").pop()) !== null && _b !== void 0 ? _b : "",
10989
+ path,
10990
+ }));
10991
+ await (0, promises_1.writeFile)(path, transformedContent !== null && transformedContent !== void 0 ? transformedContent : content, {
10992
+ encoding: "utf-8",
10993
+ });
10994
+ }
10995
+ async writeGeneratedFile(path, content, options) {
10996
+ await this.writeTheFile(path, [this.getAutoGeneratedHeader(options.commentChar), content].join("\n"));
10997
+ }
10998
+ writeYamlfile(path, data) {
10999
+ return this.writeGeneratedFile(path, (0, yaml_1.stringify)(data, exports.yamlStringifyOptions), {
11000
+ commentChar: "#",
11001
+ });
11002
+ }
11003
+ getAutoGeneratedHeader(commentChar) {
11004
+ return [
11005
+ "-------------------------------------------------",
11006
+ `🐱 🔨 This file is generated by catladder`,
11007
+ `🚨 Do not edit this file manually 🚨`,
11008
+ "-------------------------------------------------",
11009
+ ]
11010
+ .map((line) => `${commentChar} ${line}`)
11011
+ .join("\n")
11012
+ .concat("\n");
11013
+ }
11014
+ }
11015
+ exports.FileWriter = FileWriter;
10986
11016
  //# sourceMappingURL=writeFiles.js.map
10987
11017
 
10988
11018
  /***/ }),
@@ -11,11 +11,12 @@ exports.default = async (choice) => {
11
11
  if (!config) {
12
12
  return;
13
13
  }
14
+ const context = (0, pipeline_1.createCatenvContext)(config);
14
15
  await Promise.all([
15
- (0, pipeline_1.generatePipelineFiles)(config, (_a = config.pipelineType) !== null && _a !== void 0 ? _a : "gitlab"),
16
- (0, writeDotEnvFiles_1.writeDotEnvFiles)(config, choice),
17
- (0, writeEnvDTs_1.writeDTsFiles)(config, choice),
18
- (0, printVariables_1.printVariables)(config, choice),
16
+ (0, pipeline_1.generatePipelineFiles)(context, (_a = config.pipelineType) !== null && _a !== void 0 ? _a : "gitlab"),
17
+ (0, writeDotEnvFiles_1.writeDotEnvFiles)(context, choice),
18
+ (0, writeEnvDTs_1.writeDTsFiles)(context, choice),
19
+ (0, printVariables_1.printVariables)(context, choice),
19
20
  ]);
20
21
  };
21
22
  //# sourceMappingURL=catenv.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"catenv.js","sourceRoot":"","sources":["../../../../../src/apps/catenv/catenv.ts"],"names":[],"mappings":";;AAAA,oEAAiE;AACjE,qDAAkD;AAElD,yDAAsD;AACtD,+CAA8C;AAC9C,kDAA4D;AAE5D,kBAAe,KAAK,EAAE,MAAe,EAAE,EAAE;;IACvC,MAAM,MAAM,GAAG,MAAM,IAAA,mCAAgB,GAAE,CAAC;IACxC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO;IACT,CAAC;IAED,MAAM,OAAO,CAAC,GAAG,CAAC;QAChB,IAAA,gCAAqB,EAAC,MAAM,EAAE,MAAA,MAAM,CAAC,YAAY,mCAAI,QAAQ,CAAC;QAC9D,IAAA,mCAAgB,EAAC,MAAM,EAAE,MAAM,CAAC;QAEhC,IAAA,2BAAa,EAAC,MAAM,EAAE,MAAM,CAAC;QAE7B,IAAA,+BAAc,EAAC,MAAM,EAAE,MAAM,CAAC;KAC/B,CAAC,CAAC;AACL,CAAC,CAAC"}
1
+ {"version":3,"file":"catenv.js","sourceRoot":"","sources":["../../../../../src/apps/catenv/catenv.ts"],"names":[],"mappings":";;AAAA,oEAAiE;AACjE,qDAAkD;AAElD,yDAAsD;AACtD,+CAA8C;AAC9C,kDAI6B;AAE7B,kBAAe,KAAK,EAAE,MAAe,EAAE,EAAE;;IACvC,MAAM,MAAM,GAAG,MAAM,IAAA,mCAAgB,GAAE,CAAC;IACxC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO;IACT,CAAC;IAED,MAAM,OAAO,GAAG,IAAA,8BAAmB,EAAC,MAAM,CAAC,CAAC;IAE5C,MAAM,OAAO,CAAC,GAAG,CAAC;QAChB,IAAA,gCAAqB,EAAC,OAAO,EAAE,MAAA,MAAM,CAAC,YAAY,mCAAI,QAAQ,CAAC;QAC/D,IAAA,mCAAgB,EAAC,OAAO,EAAE,MAAM,CAAC;QAEjC,IAAA,2BAAa,EAAC,OAAO,EAAE,MAAM,CAAC;QAE9B,IAAA,+BAAc,EAAC,OAAO,EAAE,MAAM,CAAC;KAChC,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -1,3 +1,3 @@
1
- import type { Config } from "../../../../pipeline/src/index.js";
1
+ import type { CatenvContext } from "../../../../pipeline/src/index.js";
2
2
  import type { Choice } from "./types";
3
- export declare const printVariables: (config: Config, choice?: Choice) => Promise<void>;
3
+ export declare const printVariables: (context: CatenvContext, choice?: Choice) => Promise<void>;
@@ -37,8 +37,8 @@ const getAllVariablesToPrint = async (config, choice) => {
37
37
  }, Promise.resolve({}));
38
38
  }
39
39
  };
40
- const printVariables = async (config, choice) => {
41
- const variables = await getAllVariablesToPrint(config, choice);
40
+ const printVariables = async (context, choice) => {
41
+ const variables = await getAllVariablesToPrint(context.config, choice);
42
42
  console.log(makeExportKeyValuestring(variables));
43
43
  };
44
44
  exports.printVariables = printVariables;
@@ -1 +1 @@
1
- {"version":3,"file":"printVariables.js","sourceRoot":"","sources":["../../../../../src/apps/catenv/printVariables.ts"],"names":[],"mappings":";;;AACA,oEAAmE;AAEnE,mCAIiB;AAEjB,MAAM,sBAAsB,GAAG,KAAK,EAAE,MAAc,EAAE,MAAe,EAAE,EAAE;;IACvE,MAAM,EAAE,GAAG,EAAE,gBAAgB,EAAE,GAAG,MAAM,IAAA,2CAAmC,EACzE,MAAM,EACN,MAAM,CACP,CAAC;IAEF,IAAI,gBAAgB,EAAE,CAAC;QACrB,wCAAwC;QACxC,IAAI,MAAA,MAAM,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,MAAM,mCAAI,IAAI,EAAE,CAAC;YACvD,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,OAAO,MAAM,IAAA,qCAAkB,EAAC,IAAI,EAAE,GAAG,EAAE,gBAAgB,CAAC,CAAC;IAC/D,CAAC;SAAM,CAAC;QACN,6DAA6D;QAC7D,0EAA0E;QAC1E,mCAAmC;QACnC,OAAO,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,MAAM,CAChD,KAAK,EAAE,GAAG,EAAE,aAAa,EAAE,EAAE;;YAC3B,wCAAwC;YACxC,IAAI,MAAA,MAAM,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,MAAM,mCAAI,IAAI,EAAE,CAAC;gBACpD,OAAO,MAAM,GAAG,CAAC;YACnB,CAAC;YACD,MAAM,UAAU,GAAG,MAAM,IAAA,qCAAkB,EAAC,IAAI,EAAE,GAAG,EAAE,aAAa,CAAC,CAAC;YACtE,OAAO,UAAU,CAAC,mBAAmB,CAAC,CAAC;YACvC,OAAO;gBACL,GAAG,CAAC,MAAM,GAAG,CAAC;gBACd,GAAG,UAAU;gBACb,qCAAqC;gBACrC,GAAG,MAAM,CAAC,WAAW,CACnB,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;oBAC/C,GAAG,IAAA,0BAAkB,EAAC,aAAa,CAAC,WAAW,EAAE,CAAC,IAAI,GAAG,EAAE;oBAC3D,KAAK;iBACN,CAAC,CACH;aACF,CAAC;QACJ,CAAC,EACD,OAAO,CAAC,OAAO,CAAC,EAA4B,CAAC,CAC9C,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAEK,MAAM,cAAc,GAAG,KAAK,EAAE,MAAc,EAAE,MAAe,EAAE,EAAE;IACtE,MAAM,SAAS,GAAG,MAAM,sBAAsB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE/D,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,SAAS,CAAC,CAAC,CAAC;AACnD,CAAC,CAAC;AAJW,QAAA,cAAc,kBAIzB;AAEF,MAAM,wBAAwB,GAAG,CAAC,SAAiC,EAAE,EAAE,CACrE,IAAA,0BAAkB,EAAC,SAAS,EAAE;IAC5B,SAAS,EAAE,SAAS;IACpB,aAAa,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE;CACvC,CAAC,CAAC"}
1
+ {"version":3,"file":"printVariables.js","sourceRoot":"","sources":["../../../../../src/apps/catenv/printVariables.ts"],"names":[],"mappings":";;;AACA,oEAAmE;AAEnE,mCAIiB;AAEjB,MAAM,sBAAsB,GAAG,KAAK,EAAE,MAAc,EAAE,MAAe,EAAE,EAAE;;IACvE,MAAM,EAAE,GAAG,EAAE,gBAAgB,EAAE,GAAG,MAAM,IAAA,2CAAmC,EACzE,MAAM,EACN,MAAM,CACP,CAAC;IAEF,IAAI,gBAAgB,EAAE,CAAC;QACrB,wCAAwC;QACxC,IAAI,MAAA,MAAM,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,MAAM,mCAAI,IAAI,EAAE,CAAC;YACvD,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,OAAO,MAAM,IAAA,qCAAkB,EAAC,IAAI,EAAE,GAAG,EAAE,gBAAgB,CAAC,CAAC;IAC/D,CAAC;SAAM,CAAC;QACN,6DAA6D;QAC7D,0EAA0E;QAC1E,mCAAmC;QACnC,OAAO,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,MAAM,CAChD,KAAK,EAAE,GAAG,EAAE,aAAa,EAAE,EAAE;;YAC3B,wCAAwC;YACxC,IAAI,MAAA,MAAM,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,MAAM,mCAAI,IAAI,EAAE,CAAC;gBACpD,OAAO,MAAM,GAAG,CAAC;YACnB,CAAC;YACD,MAAM,UAAU,GAAG,MAAM,IAAA,qCAAkB,EAAC,IAAI,EAAE,GAAG,EAAE,aAAa,CAAC,CAAC;YACtE,OAAO,UAAU,CAAC,mBAAmB,CAAC,CAAC;YACvC,OAAO;gBACL,GAAG,CAAC,MAAM,GAAG,CAAC;gBACd,GAAG,UAAU;gBACb,qCAAqC;gBACrC,GAAG,MAAM,CAAC,WAAW,CACnB,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;oBAC/C,GAAG,IAAA,0BAAkB,EAAC,aAAa,CAAC,WAAW,EAAE,CAAC,IAAI,GAAG,EAAE;oBAC3D,KAAK;iBACN,CAAC,CACH;aACF,CAAC;QACJ,CAAC,EACD,OAAO,CAAC,OAAO,CAAC,EAA4B,CAAC,CAC9C,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAEK,MAAM,cAAc,GAAG,KAAK,EACjC,OAAsB,EACtB,MAAe,EACf,EAAE;IACF,MAAM,SAAS,GAAG,MAAM,sBAAsB,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEvE,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,SAAS,CAAC,CAAC,CAAC;AACnD,CAAC,CAAC;AAPW,QAAA,cAAc,kBAOzB;AAEF,MAAM,wBAAwB,GAAG,CAAC,SAAiC,EAAE,EAAE,CACrE,IAAA,0BAAkB,EAAC,SAAS,EAAE;IAC5B,SAAS,EAAE,SAAS;IACpB,aAAa,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE;CACvC,CAAC,CAAC"}
@@ -1,3 +1,3 @@
1
- import { type Config } from "../../../../pipeline/src/index.js";
2
1
  import type { Choice } from "./types";
3
- export declare const writeDotEnvFiles: (config: Config, choice?: Choice) => Promise<void>;
2
+ import type { CatenvContext } from "../../../../pipeline/src/index.js";
3
+ export declare const writeDotEnvFiles: (context: CatenvContext, choice?: Choice) => Promise<void>;