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

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.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
- interface PackageJsonLike {
609
- name?: string;
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,8 +2,9 @@ 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
10
  import { loadTasksConfig } from "@theholocron/astromech/config";
@@ -214,10 +215,10 @@ function missingCapabilities(capabilities) {
214
215
  */
215
216
  async function readWorkspacePackageJsons(repoRoot, workspacePackages) {
216
217
  const results = [];
217
- for (const { slug, dir = "packages" } of workspacePackages) try {
218
- const raw = await readFile(join(repoRoot, dir, slug, "package.json"), "utf8");
219
- results.push(JSON.parse(raw));
220
- } catch {}
218
+ for (const { slug, dir = "packages" } of workspacePackages) {
219
+ const pkg = await readPackageJson(join(repoRoot, dir, slug));
220
+ if (pkg) results.push(pkg);
221
+ }
221
222
  return results;
222
223
  }
223
224
  //#endregion
@@ -509,12 +510,13 @@ async function loadConfig(cwd) {
509
510
  });
510
511
  if (!found) throw new ConfigFileError$1(`no holocron.config.{ts,js,mjs,cjs,json} found in ${cwd}. Create one — see the README for the schema.`);
511
512
  return {
512
- resolved: resolveConfig(await deriveDefaults(dirname(found.filepath), found.config)),
513
+ resolved: resolveConfig(await deriveDefaults(found)),
513
514
  filepath: found.filepath
514
515
  };
515
516
  }
516
- async function deriveDefaults(configDir, raw) {
517
- const result = { ...raw };
517
+ async function deriveDefaults(found) {
518
+ const configDir = dirname(found.filepath);
519
+ const result = { ...found.config };
518
520
  if (!result.name) result.name = await readPackageJsonName(configDir) ?? basename(configDir);
519
521
  if (result.repo && !result.repo.name) {
520
522
  const remote = await readGitRemote(configDir);
@@ -523,7 +525,7 @@ async function deriveDefaults(configDir, raw) {
523
525
  name: remote.slug
524
526
  };
525
527
  }
526
- const manifest = await loadTasksConfig(configDir);
528
+ const manifest = await loadTasksConfig(configDir, { holocron: found });
527
529
  if (manifest.tasks) result.tasks = manifest.tasks;
528
530
  if (manifest.syncScripts !== void 0) result.syncScripts = manifest.syncScripts;
529
531
  if (manifest.holocronScript !== void 0) result.holocronScript = manifest.holocronScript;
@@ -532,13 +534,8 @@ async function deriveDefaults(configDir, raw) {
532
534
  return result;
533
535
  }
534
536
  async function readPackageJsonName(dir) {
535
- try {
536
- const content = await readFile(join(dir, "package.json"), "utf8");
537
- const pkg = JSON.parse(content);
538
- return typeof pkg.name === "string" ? pkg.name.replace(/^@[^/]+\//, "") : void 0;
539
- } catch {
540
- return;
541
- }
537
+ const name = (await readPackageJson(dir))?.name;
538
+ return name === void 0 ? void 0 : name.replace(/^@[^/]+\//, "");
542
539
  }
543
540
  //#endregion
544
541
  //#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.147",
3
+ "version": "5.0.0-alpha.149",
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,14 +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.10.0",
53
- "@theholocron/fs-utils": "^1.10.0",
54
- "@theholocron/git-utils": "^1.10.0",
52
+ "@theholocron/env-utils": "^1.12.0",
53
+ "@theholocron/fs-utils": "^1.12.0",
54
+ "@theholocron/git-utils": "^1.12.0",
55
55
  "@theholocron/github-client": "^1.41.0",
56
56
  "@theholocron/http-client": "^1.42.0",
57
- "@theholocron/json-utils": "^1.10.0",
58
- "@theholocron/misc-utils": "^1.10.0",
57
+ "@theholocron/json-utils": "^1.12.0",
58
+ "@theholocron/misc-utils": "^1.12.0",
59
59
  "@theholocron/observability": "^0.5.0",
60
+ "@theholocron/pkg-utils": "^1.12.0",
60
61
  "@theholocron/registry-doc": "^1.12.0",
61
62
  "chalk": "^6.0.0",
62
63
  "ora": "^9.4.1",
@@ -64,8 +65,8 @@
64
65
  "pino-pretty": "^13.1.3",
65
66
  "posthog-node": "^5.51.6",
66
67
  "yargs": "^18.1.0",
67
- "@theholocron/astromech": "5.0.0-alpha.147",
68
- "@theholocron/datapad": "5.0.0-alpha.147"
68
+ "@theholocron/astromech": "5.0.0-alpha.149",
69
+ "@theholocron/datapad": "5.0.0-alpha.149"
69
70
  },
70
71
  "devDependencies": {
71
72
  "@commitlint/config-conventional": "^21.2.3",
@@ -84,7 +85,7 @@
84
85
  "tsx": "4.23.12",
85
86
  "typescript": "^5.9.3",
86
87
  "vitest": "^4.1.11",
87
- "@theholocron/rollup-plugin-transform-template": "5.0.0-alpha.147"
88
+ "@theholocron/rollup-plugin-transform-template": "5.0.0-alpha.149"
88
89
  },
89
90
  "engines": {
90
91
  "node": ">=22.0.0"