@theholocron/cli 5.0.0-alpha.420 → 5.0.0-alpha.421
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/README.md +8 -8
- package/dist/cli.mjs +75 -20
- package/dist/cli.mjs.map +1 -1
- package/dist/{config-system-CPLUPDn8.mjs → config-system-BFlPXyU2.mjs} +29 -11
- package/dist/index.mjs +1 -1
- package/dist/presets.mjs +1 -1
- package/package.json +8 -8
|
@@ -57,6 +57,32 @@ function validateEnvironmentChoice(entry, what, required = true) {
|
|
|
57
57
|
}
|
|
58
58
|
if (required) throw new ConfigError(`${what} needs the name of a vault environment (\`environment\`) or a \`layer\``);
|
|
59
59
|
}
|
|
60
|
+
// src/credentials-environments/repo-slug/repo-slug.ts
|
|
61
|
+
/**
|
|
62
|
+
* The `<org>/<repo>` of the repository at `cwd`, from its `origin` remote. A remote that is missing or cannot be
|
|
63
|
+
* parsed is a `ConfigError` that names the `environment` option as the fix.
|
|
64
|
+
*/
|
|
65
|
+
async function repoSlug(cwd, exec) {
|
|
66
|
+
const remote = await readGitRemote(cwd, exec ? { exec } : {});
|
|
67
|
+
if (!remote) throw new ConfigError(`cannot derive the 1Password Environment name: the \`origin\` remote of ${cwd} is missing or not an owner/repo URL. Give the \`credentials\` provider an \`environment\` option to name it.`);
|
|
68
|
+
return remote.slug;
|
|
69
|
+
}
|
|
70
|
+
// src/credentials-environments/unsynced-layer/unsynced-layer.ts
|
|
71
|
+
/** The layers this machine reads for itself. They are never synced to GitHub, a deployment or a Worker (#2104). */
|
|
72
|
+
const UNSYNCED_LAYERS = ["local", "dev"];
|
|
73
|
+
/** Whether `layer` is one of {@link UNSYNCED_LAYERS}. */
|
|
74
|
+
function isUnsyncedLayer(layer) {
|
|
75
|
+
return isEnvironmentLayer(layer) && UNSYNCED_LAYERS.includes(layer);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The text of the error for an Environment of an unsynced layer, shared by the command and the config checks.
|
|
79
|
+
*
|
|
80
|
+
* @param what - What names the layer, e.g. "`secrets sync dev`" or "a `repo.secrets.sync` entry".
|
|
81
|
+
* @param layer - The unsynced layer.
|
|
82
|
+
*/
|
|
83
|
+
function unsyncedLayerMessage(what, layer) {
|
|
84
|
+
return `${what} names the \`${layer}\` layer: \`local\` and \`dev\` are read by this machine and are never synced. Only ${ENVIRONMENT_LAYERS.filter((l) => !isUnsyncedLayer(l)).map((l) => `\`${l}\``).join(" and ")} can be synced`;
|
|
85
|
+
}
|
|
60
86
|
// src/config/validate-secrets-deploy/validate-secrets-deploy.ts
|
|
61
87
|
/**
|
|
62
88
|
* Check `repo.secrets.deploy`: each entry names a vault environment (or a `layer`) and at least one of a non-empty `keys` list and a
|
|
@@ -70,6 +96,7 @@ function validateSecretsDeploy(secrets) {
|
|
|
70
96
|
for (const entry of secrets?.deploy ?? []) {
|
|
71
97
|
const named = validateEnvironmentChoice(entry, "a `repo.secrets.deploy` entry");
|
|
72
98
|
const label = `\`repo.secrets.deploy\` entry for ${JSON.stringify(named)}`;
|
|
99
|
+
if (isUnsyncedLayer(entry.layer)) throw new ConfigError(unsyncedLayerMessage(label, entry.layer));
|
|
73
100
|
const { keys, prefix } = entry;
|
|
74
101
|
if (keys !== void 0 && (!Array.isArray(keys) || keys.some((k) => typeof k !== "string" || k === ""))) throw new ConfigError(`${label} has \`keys\` that is not a list of key names`);
|
|
75
102
|
if (prefix !== void 0 && (typeof prefix !== "string" || prefix === "")) throw new ConfigError(`${label} has an empty \`prefix\``);
|
|
@@ -94,6 +121,7 @@ function validateSecretsSync(secrets) {
|
|
|
94
121
|
for (const entry of secrets?.sync ?? []) {
|
|
95
122
|
const named = validateEnvironmentChoice(entry, "a `repo.secrets.sync` entry");
|
|
96
123
|
const label = `\`repo.secrets.sync\` entry for ${JSON.stringify(named)}`;
|
|
124
|
+
if (isUnsyncedLayer(entry.layer)) throw new ConfigError(unsyncedLayerMessage(label, entry.layer));
|
|
97
125
|
const scope = entry.scope ?? "repo";
|
|
98
126
|
if (!scope.startsWith("org=")) {
|
|
99
127
|
if (entry.visibility !== void 0 || entry.repos !== void 0) throw new ConfigError(`${label} sets \`visibility\` or \`repos\` on scope ${JSON.stringify(scope)}: only an organization scope ("org=<name>") has readers to name`);
|
|
@@ -335,16 +363,6 @@ function resolveConfig(raw) {
|
|
|
335
363
|
eslint: raw.eslint
|
|
336
364
|
};
|
|
337
365
|
}
|
|
338
|
-
// src/credentials-environments/repo-slug/repo-slug.ts
|
|
339
|
-
/**
|
|
340
|
-
* The `<org>/<repo>` of the repository at `cwd`, from its `origin` remote. A remote that is missing or cannot be
|
|
341
|
-
* parsed is a `ConfigError` that names the `environment` option as the fix.
|
|
342
|
-
*/
|
|
343
|
-
async function repoSlug(cwd, exec) {
|
|
344
|
-
const remote = await readGitRemote(cwd, exec ? { exec } : {});
|
|
345
|
-
if (!remote) throw new ConfigError(`cannot derive the 1Password Environment name: the \`origin\` remote of ${cwd} is missing or not an owner/repo URL. Give the \`credentials\` provider an \`environment\` option to name it.`);
|
|
346
|
-
return remote.slug;
|
|
347
|
-
}
|
|
348
366
|
// src/config/compose/merge-sync/merge-sync.ts
|
|
349
367
|
/**
|
|
350
368
|
* Merge two lists of `repo.secrets.sync` (or `repo.variables.sync`) entries. An entry is the same sync when its
|
|
@@ -793,4 +811,4 @@ async function loadConfig(cwd, input = {}) {
|
|
|
793
811
|
* const preset = compose(node(), nextjs());
|
|
794
812
|
*/
|
|
795
813
|
const compose = system.compose;
|
|
796
|
-
export { placeAreas as a,
|
|
814
|
+
export { placeAreas as a, ConfigError$1 as c, resolveEntry as d, resolvePluginPackage$1 as f, layerEnvironment as h, loadConfig as i, credentialsEnvironment as l, isEnvironmentLayer as m, compose as n, HOLOCRON_AREAS as o, repoSlug as p, defineConfig as r, SHARED_AREAS as s, ConfigFileError as t, resolveConfig as u };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CARDINALITY, ElevationRequiredError, MissingTokenError, ProviderApiError, REQUIRED_CAPABILITIES, WebhookVerificationError, isMulti } from "./plugin/capabilities.mjs";
|
|
2
|
-
import { a as placeAreas, c as
|
|
2
|
+
import { a as placeAreas, c as ConfigError, d as resolveEntry, f as resolvePluginPackage, h as layerEnvironment, i as loadConfig, l as credentialsEnvironment, m as isEnvironmentLayer, n as compose, o as HOLOCRON_AREAS, p as repoSlug, r as defineConfig, s as SHARED_AREAS, t as ConfigFileError, u as resolveConfig } from "./config-system-BFlPXyU2.mjs";
|
|
3
3
|
import { Entry, findCredentials } from "@napi-rs/keyring";
|
|
4
4
|
import { AuthError, createFeatureResolver as createFeatureResolver$1, createKeyring, createResolveToken as createResolveToken$1, resolveValue } from "@theholocron/kyber/secrets";
|
|
5
5
|
import { describeError, style } from "@theholocron/kyber/ui";
|
package/dist/presets.mjs
CHANGED
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.421",
|
|
4
4
|
"description": "The Holocron CLI - a pluggable, capability-based orchestrator for spinning up and operating software projects.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -59,18 +59,18 @@
|
|
|
59
59
|
"posthog-node": "^5.63.1",
|
|
60
60
|
"tsx": "4.23.15",
|
|
61
61
|
"yargs": "^18.1.0",
|
|
62
|
-
"@theholocron/astromech": "5.0.0-alpha.
|
|
63
|
-
"@theholocron/dagobah": "5.0.0-alpha.
|
|
62
|
+
"@theholocron/astromech": "5.0.0-alpha.421",
|
|
63
|
+
"@theholocron/dagobah": "5.0.0-alpha.421",
|
|
64
|
+
"@theholocron/datapad": "5.0.0-alpha.421",
|
|
64
65
|
"@theholocron/env-utils": "^1.17.0-alpha.4",
|
|
65
|
-
"@theholocron/datapad": "5.0.0-alpha.420",
|
|
66
66
|
"@theholocron/fs-utils": "^1.17.0-alpha.4",
|
|
67
|
-
"@theholocron/github-client": "^1.58.0-alpha.28",
|
|
68
|
-
"@theholocron/http-client": "^1.58.0-alpha.28",
|
|
69
67
|
"@theholocron/git-utils": "^1.17.0-alpha.4",
|
|
68
|
+
"@theholocron/github-client": "^1.58.0-alpha.28",
|
|
69
|
+
"@theholocron/kyber": "5.0.0-alpha.421",
|
|
70
70
|
"@theholocron/json-utils": "^1.17.0-alpha.4",
|
|
71
71
|
"@theholocron/misc-utils": "^1.17.0-alpha.4",
|
|
72
|
+
"@theholocron/http-client": "^1.58.0-alpha.28",
|
|
72
73
|
"@theholocron/observability": "^0.7.0-alpha.4",
|
|
73
|
-
"@theholocron/kyber": "5.0.0-alpha.420",
|
|
74
74
|
"@theholocron/pkg-utils": "^1.17.0-alpha.4"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
@@ -84,9 +84,9 @@
|
|
|
84
84
|
"tsdown": "^0.23.5",
|
|
85
85
|
"typescript": "^5.9.3",
|
|
86
86
|
"vitest": "^5.1.0",
|
|
87
|
+
"@theholocron/tsconfig": "^8.9.0-alpha.16",
|
|
87
88
|
"@theholocron/eslint-config": "^8.9.0-alpha.16",
|
|
88
89
|
"@theholocron/rollup-plugin-transform-template": "^8.9.0-alpha.16",
|
|
89
|
-
"@theholocron/tsconfig": "^8.9.0-alpha.16",
|
|
90
90
|
"@theholocron/vitest-config": "^8.9.0-alpha.16"
|
|
91
91
|
},
|
|
92
92
|
"engines": {
|