@theholocron/cli 5.0.0-alpha.145 → 5.0.0-alpha.147

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/dist/index.mjs CHANGED
@@ -6,10 +6,9 @@ import { readFile } from "node:fs/promises";
6
6
  import { basename, dirname, join } from "node:path";
7
7
  import load from "@commitlint/load";
8
8
  import lint from "@commitlint/lint";
9
- import { execFile } from "node:child_process";
10
- import { promisify } from "node:util";
11
9
  import { loadTasksConfig } from "@theholocron/astromech/config";
12
10
  import { ConfigFileError, ConfigFileError as ConfigFileError$1, loadConfigFile } from "@theholocron/datapad";
11
+ import { readGitRemote } from "@theholocron/git-utils";
13
12
  createEnvLookup();
14
13
  /**
15
14
  * Create an injectable env for commands that accept a fake env in tests.
@@ -493,7 +492,6 @@ function defineConfig(config) {
493
492
  * Probe order is TS-first (`.ts` → `.js` → `.mjs` → `.cjs` → `.json`) —
494
493
  * see ADR-0010 / issue #75 / #81.
495
494
  */
496
- const execFileAsync = promisify(execFile);
497
495
  /**
498
496
  * Read + parse + resolve `holocron.config.*` starting from the given
499
497
  * directory, walking up through ancestors to the nearest `.git` boundary
@@ -519,10 +517,10 @@ async function deriveDefaults(configDir, raw) {
519
517
  const result = { ...raw };
520
518
  if (!result.name) result.name = await readPackageJsonName(configDir) ?? basename(configDir);
521
519
  if (result.repo && !result.repo.name) {
522
- const repoName = await readGitRemote(configDir);
523
- if (repoName) result.repo = {
520
+ const remote = await readGitRemote(configDir);
521
+ if (remote?.host === "github.com") result.repo = {
524
522
  ...result.repo,
525
- name: repoName
523
+ name: remote.slug
526
524
  };
527
525
  }
528
526
  const manifest = await loadTasksConfig(configDir);
@@ -542,24 +540,6 @@ async function readPackageJsonName(dir) {
542
540
  return;
543
541
  }
544
542
  }
545
- async function readGitRemote(dir) {
546
- try {
547
- const { stdout } = await execFileAsync("git", [
548
- "remote",
549
- "get-url",
550
- "origin"
551
- ], { cwd: dir });
552
- return parseGitRemoteUrl(stdout.trim());
553
- } catch {
554
- return;
555
- }
556
- }
557
- function parseGitRemoteUrl(url) {
558
- const httpsMatch = url.match(/github\.com\/([^/]+\/[^/]+?)(?:\.git)?$/);
559
- if (httpsMatch) return httpsMatch[1];
560
- const sshMatch = url.match(/github\.com:([^/]+\/[^/]+?)(?:\.git)?$/);
561
- if (sshMatch) return sshMatch[1];
562
- }
563
543
  //#endregion
564
544
  //#region src/editorconfig/config.ts
565
545
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/cli",
3
- "version": "5.0.0-alpha.145",
3
+ "version": "5.0.0-alpha.147",
4
4
  "description": "The Holocron CLI - a pluggable, capability-based orchestrator for spinning up and operating software projects.",
5
5
  "keywords": [
6
6
  "cli",
@@ -49,10 +49,13 @@
49
49
  "@napi-rs/keyring": "^1.3.0",
50
50
  "@sentry/node": "^10.70.0",
51
51
  "@theholocron/components-doc": "^1.6.0",
52
- "@theholocron/env-utils": "^1.9.2",
52
+ "@theholocron/env-utils": "^1.10.0",
53
+ "@theholocron/fs-utils": "^1.10.0",
54
+ "@theholocron/git-utils": "^1.10.0",
53
55
  "@theholocron/github-client": "^1.41.0",
54
56
  "@theholocron/http-client": "^1.42.0",
55
- "@theholocron/misc-utils": "^1.9.2",
57
+ "@theholocron/json-utils": "^1.10.0",
58
+ "@theholocron/misc-utils": "^1.10.0",
56
59
  "@theholocron/observability": "^0.5.0",
57
60
  "@theholocron/registry-doc": "^1.12.0",
58
61
  "chalk": "^6.0.0",
@@ -61,8 +64,8 @@
61
64
  "pino-pretty": "^13.1.3",
62
65
  "posthog-node": "^5.51.6",
63
66
  "yargs": "^18.1.0",
64
- "@theholocron/astromech": "5.0.0-alpha.145",
65
- "@theholocron/datapad": "5.0.0-alpha.145"
67
+ "@theholocron/astromech": "5.0.0-alpha.147",
68
+ "@theholocron/datapad": "5.0.0-alpha.147"
66
69
  },
67
70
  "devDependencies": {
68
71
  "@commitlint/config-conventional": "^21.2.3",
@@ -81,7 +84,7 @@
81
84
  "tsx": "4.23.12",
82
85
  "typescript": "^5.9.3",
83
86
  "vitest": "^4.1.11",
84
- "@theholocron/rollup-plugin-transform-template": "5.0.0-alpha.145"
87
+ "@theholocron/rollup-plugin-transform-template": "5.0.0-alpha.147"
85
88
  },
86
89
  "engines": {
87
90
  "node": ">=22.0.0"