@theholocron/cli 5.0.0-alpha.146 → 5.0.0-alpha.148
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/cli.mjs +65 -140
- package/dist/cli.mjs.map +1 -1
- package/dist/index.d.mts +3 -7
- package/dist/index.mjs +12 -36
- package/package.json +10 -6
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Analytics, Auth, AuthDescription, AuthEvent, AuthEventType, AuthIdentity, AuthUser, CARDINALITY, CapabilityImpls, CapabilityKey, Cardinality, CardinalityFor, Ci, CiRun, CiRunFilter, CiRunStatus, ConnectionStringOptions, CreateAuthUserInput, DeployFunctionConfig, DeployFunctionResult, DeployScriptConfig, DeployScriptResult, Deployment, DeploymentProject, DeploymentProjectSettings, DeploymentRecord, DeploymentTarget, DeploymentTrigger, Dns, DnsRecord, DnsRecordRequest, DnsRecordType, EnsureResult, Environment, EnvironmentReviewer, Environments, Errors, Issue, IssueSearchFilter, Issues, LabelDef, LifecycleResult, LifecycleSlot, Logs, Monitoring, MonitoringAssertion, MonitoringAssertionComparison, MonitoringAssertionSource, MonitoringCheck, MonitoringCheckInput, MonitoringHttpMethod, NormalizedAuthUser, Notifications, PagesConfig, ParseWebhookInput, ProviderApiError, ProviderIdentity, PullRequest, REQUIRED_CAPABILITIES, RepoRef, RepoSettings, ResolvedCapability, Ruleset, SecretScope, Secrets, Source, StatusCategory, Storage, StorageBranch, TeamEntry, TeamPermission, Tooling, ToolingDoctorReport, TrackerDoctorReport, TrackerUser, Vault, WebhookDashboardInfo, WebhookVerificationError, Wiki, WikiProvisionOpts, WikiProxyConfig, Workers, isMulti } from "./plugin/capabilities.mjs";
|
|
2
2
|
import { AuthError, RequestOptions, ResolveTokenConfig as ResolveTokenConfig$1, ResolveTokenInput, RestClient, RestClientConfig, createRestClient } from "@theholocron/http-client";
|
|
3
|
+
import { PackageJson } from "@theholocron/pkg-utils";
|
|
3
4
|
import { ConfigFileError } from "@theholocron/datapad";
|
|
4
5
|
import { LogLevel } from "@theholocron/observability/core";
|
|
5
6
|
import { WorkspacePackage } from "@theholocron/astromech";
|
|
@@ -605,13 +606,8 @@ declare function resolveConfig(raw: HolocronConfig): ResolvedHolocronConfig;
|
|
|
605
606
|
* definitions (#677)" for the full design.
|
|
606
607
|
*/
|
|
607
608
|
type HolocronProfile = "library" | "cli" | "plugin" | "template" | "app" | "docs" | "platform";
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
private?: boolean;
|
|
611
|
-
bin?: unknown;
|
|
612
|
-
dependencies?: Record<string, string>;
|
|
613
|
-
devDependencies?: Record<string, string>;
|
|
614
|
-
}
|
|
609
|
+
/** The `package.json` shape profile derivation reads — `@theholocron/pkg-utils`'s `PackageJson`, under the name Sentinel already imports. */
|
|
610
|
+
type PackageJsonLike = PackageJson;
|
|
615
611
|
interface DeriveProfileInput {
|
|
616
612
|
rootPackageJson: PackageJsonLike | null;
|
|
617
613
|
repoName: string;
|
package/dist/index.mjs
CHANGED
|
@@ -2,14 +2,14 @@ import { CARDINALITY, ProviderApiError, REQUIRED_CAPABILITIES, WebhookVerificati
|
|
|
2
2
|
import { AuthError, createResolveToken as createResolveToken$1, createRestClient } from "@theholocron/http-client";
|
|
3
3
|
import { createEnvLookup } from "@theholocron/env-utils";
|
|
4
4
|
import { Entry, findCredentials } from "@napi-rs/keyring";
|
|
5
|
-
import { readFile } from "node:fs/promises";
|
|
6
5
|
import { basename, dirname, join } from "node:path";
|
|
6
|
+
import { readPackageJson } from "@theholocron/pkg-utils";
|
|
7
|
+
import { readFile } from "node:fs/promises";
|
|
7
8
|
import load from "@commitlint/load";
|
|
8
9
|
import lint from "@commitlint/lint";
|
|
9
|
-
import { execFile } from "node:child_process";
|
|
10
|
-
import { promisify } from "node:util";
|
|
11
10
|
import { loadTasksConfig } from "@theholocron/astromech/config";
|
|
12
11
|
import { ConfigFileError, ConfigFileError as ConfigFileError$1, loadConfigFile } from "@theholocron/datapad";
|
|
12
|
+
import { readGitRemote } from "@theholocron/git-utils";
|
|
13
13
|
createEnvLookup();
|
|
14
14
|
/**
|
|
15
15
|
* Create an injectable env for commands that accept a fake env in tests.
|
|
@@ -215,10 +215,10 @@ function missingCapabilities(capabilities) {
|
|
|
215
215
|
*/
|
|
216
216
|
async function readWorkspacePackageJsons(repoRoot, workspacePackages) {
|
|
217
217
|
const results = [];
|
|
218
|
-
for (const { slug, dir = "packages" } of workspacePackages)
|
|
219
|
-
const
|
|
220
|
-
results.push(
|
|
221
|
-
}
|
|
218
|
+
for (const { slug, dir = "packages" } of workspacePackages) {
|
|
219
|
+
const pkg = await readPackageJson(join(repoRoot, dir, slug));
|
|
220
|
+
if (pkg) results.push(pkg);
|
|
221
|
+
}
|
|
222
222
|
return results;
|
|
223
223
|
}
|
|
224
224
|
//#endregion
|
|
@@ -493,7 +493,6 @@ function defineConfig(config) {
|
|
|
493
493
|
* Probe order is TS-first (`.ts` → `.js` → `.mjs` → `.cjs` → `.json`) —
|
|
494
494
|
* see ADR-0010 / issue #75 / #81.
|
|
495
495
|
*/
|
|
496
|
-
const execFileAsync = promisify(execFile);
|
|
497
496
|
/**
|
|
498
497
|
* Read + parse + resolve `holocron.config.*` starting from the given
|
|
499
498
|
* directory, walking up through ancestors to the nearest `.git` boundary
|
|
@@ -519,10 +518,10 @@ async function deriveDefaults(configDir, raw) {
|
|
|
519
518
|
const result = { ...raw };
|
|
520
519
|
if (!result.name) result.name = await readPackageJsonName(configDir) ?? basename(configDir);
|
|
521
520
|
if (result.repo && !result.repo.name) {
|
|
522
|
-
const
|
|
523
|
-
if (
|
|
521
|
+
const remote = await readGitRemote(configDir);
|
|
522
|
+
if (remote?.host === "github.com") result.repo = {
|
|
524
523
|
...result.repo,
|
|
525
|
-
name:
|
|
524
|
+
name: remote.slug
|
|
526
525
|
};
|
|
527
526
|
}
|
|
528
527
|
const manifest = await loadTasksConfig(configDir);
|
|
@@ -534,31 +533,8 @@ async function deriveDefaults(configDir, raw) {
|
|
|
534
533
|
return result;
|
|
535
534
|
}
|
|
536
535
|
async function readPackageJsonName(dir) {
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
const pkg = JSON.parse(content);
|
|
540
|
-
return typeof pkg.name === "string" ? pkg.name.replace(/^@[^/]+\//, "") : void 0;
|
|
541
|
-
} catch {
|
|
542
|
-
return;
|
|
543
|
-
}
|
|
544
|
-
}
|
|
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];
|
|
536
|
+
const name = (await readPackageJson(dir))?.name;
|
|
537
|
+
return name === void 0 ? void 0 : name.replace(/^@[^/]+\//, "");
|
|
562
538
|
}
|
|
563
539
|
//#endregion
|
|
564
540
|
//#region src/editorconfig/config.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/cli",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.148",
|
|
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,11 +49,15 @@
|
|
|
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.
|
|
52
|
+
"@theholocron/env-utils": "^1.12.0",
|
|
53
|
+
"@theholocron/fs-utils": "^1.12.0",
|
|
54
|
+
"@theholocron/git-utils": "^1.12.0",
|
|
53
55
|
"@theholocron/github-client": "^1.41.0",
|
|
54
56
|
"@theholocron/http-client": "^1.42.0",
|
|
55
|
-
"@theholocron/
|
|
57
|
+
"@theholocron/json-utils": "^1.12.0",
|
|
58
|
+
"@theholocron/misc-utils": "^1.12.0",
|
|
56
59
|
"@theholocron/observability": "^0.5.0",
|
|
60
|
+
"@theholocron/pkg-utils": "^1.12.0",
|
|
57
61
|
"@theholocron/registry-doc": "^1.12.0",
|
|
58
62
|
"chalk": "^6.0.0",
|
|
59
63
|
"ora": "^9.4.1",
|
|
@@ -61,8 +65,8 @@
|
|
|
61
65
|
"pino-pretty": "^13.1.3",
|
|
62
66
|
"posthog-node": "^5.51.6",
|
|
63
67
|
"yargs": "^18.1.0",
|
|
64
|
-
"@theholocron/
|
|
65
|
-
"@theholocron/
|
|
68
|
+
"@theholocron/astromech": "5.0.0-alpha.148",
|
|
69
|
+
"@theholocron/datapad": "5.0.0-alpha.148"
|
|
66
70
|
},
|
|
67
71
|
"devDependencies": {
|
|
68
72
|
"@commitlint/config-conventional": "^21.2.3",
|
|
@@ -81,7 +85,7 @@
|
|
|
81
85
|
"tsx": "4.23.12",
|
|
82
86
|
"typescript": "^5.9.3",
|
|
83
87
|
"vitest": "^4.1.11",
|
|
84
|
-
"@theholocron/rollup-plugin-transform-template": "5.0.0-alpha.
|
|
88
|
+
"@theholocron/rollup-plugin-transform-template": "5.0.0-alpha.148"
|
|
85
89
|
},
|
|
86
90
|
"engines": {
|
|
87
91
|
"node": ">=22.0.0"
|