@git.zone/cli 4.0.0 → 6.0.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.
Files changed (35) hide show
  1. package/.smartconfig.json +0 -1
  2. package/assets/templates/ci_default/.gitea/workflows/default_tags.yaml +0 -21
  3. package/assets/templates/ci_default_gitlab/.gitlab-ci.yml +0 -13
  4. package/assets/templates/ci_default_private/.gitea/workflows/default_tags.yaml +0 -21
  5. package/assets/templates/ci_default_private_gitlab/.gitlab-ci.yml +0 -13
  6. package/dist_ts/00_commitinfo_data.js +1 -1
  7. package/dist_ts/helpers.climode.js +31 -2
  8. package/dist_ts/helpers.workflow.d.ts +10 -2
  9. package/dist_ts/helpers.workflow.js +102 -19
  10. package/dist_ts/mod_commit/mod.helpers.d.ts +3 -3
  11. package/dist_ts/mod_commit/mod.helpers.js +10 -10
  12. package/dist_ts/mod_config/index.js +22 -23
  13. package/dist_ts/mod_release/classes.releasejournal.d.ts +78 -0
  14. package/dist_ts/mod_release/classes.releasejournal.js +511 -0
  15. package/dist_ts/mod_release/helpers.npmartifact.d.ts +32 -0
  16. package/dist_ts/mod_release/helpers.npmartifact.js +358 -0
  17. package/dist_ts/mod_release/helpers.releasebranch.d.ts +47 -0
  18. package/dist_ts/mod_release/helpers.releasebranch.js +627 -0
  19. package/dist_ts/mod_release/helpers.releasepublication.d.ts +24 -0
  20. package/dist_ts/mod_release/helpers.releasepublication.js +293 -0
  21. package/dist_ts/mod_release/index.d.ts +1 -1
  22. package/dist_ts/mod_release/index.js +539 -209
  23. package/package.json +1 -1
  24. package/readme.hints.md +47 -1
  25. package/readme.md +81 -38
  26. package/ts/00_commitinfo_data.ts +1 -1
  27. package/ts/helpers.climode.ts +34 -1
  28. package/ts/helpers.workflow.ts +155 -19
  29. package/ts/mod_commit/mod.helpers.ts +12 -8
  30. package/ts/mod_config/index.ts +21 -22
  31. package/ts/mod_release/classes.releasejournal.ts +740 -0
  32. package/ts/mod_release/helpers.npmartifact.ts +553 -0
  33. package/ts/mod_release/helpers.releasebranch.ts +1344 -0
  34. package/ts/mod_release/helpers.releasepublication.ts +641 -0
  35. package/ts/mod_release/index.ts +906 -262
@@ -293,7 +293,7 @@ async function handleShow(mode: ICliMode): Promise<void> {
293
293
  const targets = release.targets || {};
294
294
  printConfigSection("Release Workflow", [
295
295
  ["confirmation", formatValue(release.confirmation)],
296
- ["require clean tree", formatValue(release.preflight?.requireCleanTree)],
296
+ ["clean tree", "required"],
297
297
  ["run tests", formatValue(release.preflight?.test)],
298
298
  ["run build", formatValue(release.preflight?.build)],
299
299
  ["test command", formatValue(release.preflight?.testCommand)],
@@ -773,12 +773,6 @@ async function handleRelease(mode: ICliMode): Promise<void> {
773
773
  choices: ["prompt", "auto", "plan"],
774
774
  default: currentRelease.confirmation || "prompt",
775
775
  });
776
- const requireCleanTree = await askValue<boolean>(interactInstance, {
777
- type: "confirm",
778
- name: "requireCleanTree",
779
- message: "Require a clean git tree before release?",
780
- default: currentRelease.preflight?.requireCleanTree ?? true,
781
- });
782
776
  const runTests = await askValue<boolean>(interactInstance, {
783
777
  type: "confirm",
784
778
  name: "runTests",
@@ -828,18 +822,8 @@ async function handleRelease(mode: ICliMode): Promise<void> {
828
822
  message: "Git remote:",
829
823
  default: currentTargets.git?.remote || "origin",
830
824
  }),
831
- pushBranch: await askValue<boolean>(interactInstance, {
832
- type: "confirm",
833
- name: "pushBranch",
834
- message: "Push release commit branch?",
835
- default: currentTargets.git?.pushBranch ?? true,
836
- }),
837
- pushTags: await askValue<boolean>(interactInstance, {
838
- type: "confirm",
839
- name: "pushTags",
840
- message: "Push release tags?",
841
- default: currentTargets.git?.pushTags ?? true,
842
- }),
825
+ pushBranch: true,
826
+ pushTags: true,
843
827
  };
844
828
  } else {
845
829
  releaseTargets.git = { ...(currentTargets.git || {}), enabled: false };
@@ -947,12 +931,13 @@ async function handleRelease(mode: ICliMode): Promise<void> {
947
931
  }
948
932
 
949
933
  setCliConfigValueInData(smartconfigData, "schemaVersion", CURRENT_GITZONE_CLI_SCHEMA_VERSION);
934
+ const currentPreflight = { ...(currentRelease.preflight || {}) };
935
+ delete currentPreflight.requireCleanTree;
950
936
  setCliConfigValueInData(smartconfigData, "release", {
951
937
  ...currentRelease,
952
938
  confirmation,
953
939
  preflight: {
954
- ...(currentRelease.preflight || {}),
955
- requireCleanTree,
940
+ ...currentPreflight,
956
941
  test: runTests,
957
942
  build: runBuild,
958
943
  testCommand: testCommand.trim(),
@@ -1704,7 +1689,7 @@ async function validateReleaseConfig(
1704
1689
  if (preflight.build === true && preflight.buildCommand === "") {
1705
1690
  findings.push({
1706
1691
  level: "warn",
1707
- message: "Release build preflight has an empty command",
1692
+ message: "Release build has an empty command",
1708
1693
  fix: "Set release.preflight.buildCommand or unset it to use pnpm build.",
1709
1694
  });
1710
1695
  }
@@ -1816,6 +1801,20 @@ async function validateGitTarget(
1816
1801
  });
1817
1802
  return;
1818
1803
  }
1804
+ if (gitTarget.pushBranch !== undefined && gitTarget.pushBranch !== true) {
1805
+ findings.push({
1806
+ level: "error",
1807
+ message: "Enabled Git release targets must push main",
1808
+ fix: "Set release.targets.git.pushBranch to true or disable the Git target.",
1809
+ });
1810
+ }
1811
+ if (gitTarget.pushTags !== undefined && gitTarget.pushTags !== true) {
1812
+ findings.push({
1813
+ level: "error",
1814
+ message: "Enabled Git release targets must push release tags",
1815
+ fix: "Set release.targets.git.pushTags to true or disable the Git target.",
1816
+ });
1817
+ }
1819
1818
  findings.push({
1820
1819
  level: "ok",
1821
1820
  message: `Git release target is enabled (${gitTarget.remote || "origin"})`,