@theholocron/cli 2.0.0-alpha.70 → 2.0.0-alpha.71

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 (2) hide show
  1. package/dist/cli.mjs +26 -34
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -1008,11 +1008,11 @@ var test_default = "name: Test\n\non: # yamllint disable-line rule:truthy\n pus
1008
1008
  var typecheck_default = "name: Typecheck\n\non: # yamllint disable-line rule:truthy\n push:\n branches: [main, alpha]\n pull_request:\n\nconcurrency:\n group: typecheck-${{ github.ref }}\n cancel-in-progress: true\n\npermissions:\n contents: read\n\njobs:\n typecheck:\n name: Typecheck\n uses: theholocron/.github/.github/workflows/typecheck.yml@main\n secrets: inherit\n";
1009
1009
  //#endregion
1010
1010
  //#region src/commands/setup-workflows.ts
1011
- /** Header prepended when holocron setup writes a thin caller to a repo. */
1012
- function workflowHeader() {
1011
+ /** Header prepended when holocron setup writes a generated file to a repo. */
1012
+ function workflowHeader(source = "packages/cli/src/commands/setup-workflows.ts") {
1013
1013
  return [
1014
1014
  `# AUTO-GENERATED — do not edit directly.`,
1015
- `# Source: theholocron/holocron · packages/cli/src/commands/setup-workflows.ts`,
1015
+ `# Source: theholocron/holocron · ${source}`,
1016
1016
  `# Synced: ${(/* @__PURE__ */ new Date()).toISOString()}`,
1017
1017
  `# Tool: holocron setup`,
1018
1018
  `# Changes: run \`holocron setup\` to regenerate.`,
@@ -2784,12 +2784,7 @@ function vaultProviderName(loader) {
2784
2784
  */
2785
2785
  function editorconfigContent() {
2786
2786
  return [
2787
- `# AUTO-GENERATED — do not edit directly.`,
2788
- `# Source: theholocron/holocron · packages/cli/src/commands/setup.ts`,
2789
- `# Synced: ${(/* @__PURE__ */ new Date()).toISOString()}`,
2790
- `# Tool: holocron setup`,
2791
- `# Changes: run \`holocron setup\` to regenerate.`,
2792
- ``,
2787
+ workflowHeader("packages/cli/src/commands/setup.ts"),
2793
2788
  `root = true`,
2794
2789
  ``,
2795
2790
  `[*]`,
@@ -2819,23 +2814,25 @@ function editorconfigContent() {
2819
2814
  ``
2820
2815
  ].join("\n");
2821
2816
  }
2822
- function codecovContent(packages) {
2823
- const header = [
2824
- `# AUTO-GENERATED by holocron setup — do not edit directly.`,
2825
- `# Source: theholocron/holocron · packages/cli/src/commands/setup.ts`,
2826
- `# Synced: ${(/* @__PURE__ */ new Date()).toISOString()}`,
2827
- `# Tool: holocron setup`,
2828
- `# Changes: run \`holocron setup\` to regenerate.`
2829
- ].join("\n");
2830
- const componentLines = packages.flatMap(({ slug, name }) => [
2817
+ const INDIVIDUAL_COMPONENTS_MARKER = " individual_components:";
2818
+ function codecovComponentBlock(packages) {
2819
+ if (packages.length === 0) return "\n []\n";
2820
+ return "\n" + packages.flatMap(({ slug }) => [
2831
2821
  ` - component_id: ${slug}`,
2832
- ` name: "${name}"`,
2822
+ ` name: "${slug}"`,
2833
2823
  ` paths:`,
2834
- ` - packages/${slug}/**`
2835
- ]);
2824
+ ` - packages/${slug}/**`,
2825
+ ``
2826
+ ]).join("\n");
2827
+ }
2828
+ function mergeCodecovComponents(existing, packages) {
2829
+ const idx = existing.indexOf(INDIVIDUAL_COMPONENTS_MARKER);
2830
+ if (idx === -1) return existing;
2831
+ return existing.slice(0, idx + 24) + codecovComponentBlock(packages);
2832
+ }
2833
+ function codecovContent(packages) {
2836
2834
  return [
2837
- header,
2838
- ``,
2835
+ workflowHeader("packages/cli/src/commands/setup.ts"),
2839
2836
  `codecov:`,
2840
2837
  ` require_ci_to_pass: true`,
2841
2838
  ``,
@@ -2861,10 +2858,8 @@ function codecovContent(packages) {
2861
2858
  ` statuses:`,
2862
2859
  ` - type: patch`,
2863
2860
  ` target: 80%`,
2864
- ` individual_components:`,
2865
- ...componentLines.length > 0 ? componentLines : [` []`],
2866
- ``
2867
- ].join("\n");
2861
+ ` individual_components:`
2862
+ ].join("\n") + codecovComponentBlock(packages);
2868
2863
  }
2869
2864
  async function readWorkspacePackages(repoRoot) {
2870
2865
  const packagesDir = join(repoRoot, "packages");
@@ -3009,12 +3004,7 @@ const STALE_LABELS = [
3009
3004
  ];
3010
3005
  function labelerConfig() {
3011
3006
  return [
3012
- `# AUTO-GENERATED — do not edit directly.`,
3013
- `# Source: theholocron/holocron · packages/cli/src/commands/setup.ts`,
3014
- `# Synced: ${(/* @__PURE__ */ new Date()).toISOString()}`,
3015
- `# Tool: holocron setup`,
3016
- `# Changes: run \`holocron setup\` to regenerate.`,
3017
- ``,
3007
+ workflowHeader("packages/cli/src/commands/setup.ts"),
3018
3008
  `bug:`,
3019
3009
  ` - '^fix'`,
3020
3010
  ``,
@@ -3273,7 +3263,9 @@ async function runSetup(input) {
3273
3263
  print(formatStep(steps[steps.length - 1]));
3274
3264
  steps.push(await runStep("source", "write codecov.yml", dryRun, async () => {
3275
3265
  const packages = await readWorkspacePackages(input.context.repoRoot);
3276
- await source.writeRepoFile("codecov.yml", codecovContent(packages));
3266
+ const existing = await readFile(join(input.context.repoRoot, "codecov.yml"), "utf8").catch(() => null);
3267
+ const content = existing != null ? mergeCodecovComponents(existing, packages) : codecovContent(packages);
3268
+ await source.writeRepoFile("codecov.yml", content);
3277
3269
  return packages.length > 0 ? `${packages.length} components` : "no components";
3278
3270
  }));
3279
3271
  print(formatStep(steps[steps.length - 1]));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/cli",
3
- "version": "2.0.0-alpha.70",
3
+ "version": "2.0.0-alpha.71",
4
4
  "description": "The Holocron CLI — a pluggable, capability-based orchestrator for spinning up and operating software projects.",
5
5
  "homepage": "https://github.com/theholocron/holocron/tree/main/packages/cli#readme",
6
6
  "bugs": "https://github.com/theholocron/holocron/issues",