@lunora/config 1.0.0-alpha.4 → 1.0.0-alpha.5
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
|
@@ -288,6 +288,12 @@ declare const LUNORA_EVENT_SOURCE = "lunora";
|
|
|
288
288
|
* — so the caller passes the original line through untouched. Pure and total.
|
|
289
289
|
*/
|
|
290
290
|
declare const formatLunoraEvent: (line: string) => LunoraFormattedLine | undefined;
|
|
291
|
+
declare class LunoraReporter {
|
|
292
|
+
#private;
|
|
293
|
+
setStdout(stdout: NodeJS.WriteStream): void;
|
|
294
|
+
setStderr(stderr: NodeJS.WriteStream): void;
|
|
295
|
+
log(meta: unknown): void;
|
|
296
|
+
}
|
|
291
297
|
/**
|
|
292
298
|
* Per-package secret-requirements registry for `.dev.vars` scaffolding.
|
|
293
299
|
*
|
|
@@ -891,6 +897,54 @@ interface DiscoverSchemaInfoResult {
|
|
|
891
897
|
* parse failure is a warning (validator) or simply ignorable (inference).
|
|
892
898
|
*/
|
|
893
899
|
declare const discoverSchemaInfo: (projectRoot: string, schemaDirectory: string) => DiscoverSchemaInfoResult;
|
|
900
|
+
/**
|
|
901
|
+
* A badge: the short colored label that prefixes a line. `bg`/`fg` are hex so the
|
|
902
|
+
* same value drives both colorize's `bgHex().hex()` and the tui `<Text>` props.
|
|
903
|
+
*/
|
|
904
|
+
interface BadgeSpec {
|
|
905
|
+
bg: `#${string}`;
|
|
906
|
+
fg: `#${string}`;
|
|
907
|
+
text: string;
|
|
908
|
+
}
|
|
909
|
+
/** Lunora purple — the accent shared with the CLI prompt frames. */
|
|
910
|
+
declare const ACCENT: `#${string}`;
|
|
911
|
+
/** Standard log-level badge names (the restyled base output). */
|
|
912
|
+
type LevelBadgeName = "debug" | "error" | "info" | "success" | "warn";
|
|
913
|
+
/** Step-phase badge names (the create-astro-style flow transcript). */
|
|
914
|
+
type StepBadgeName = "add" | "deps" | "dir" | "git" | "lunora" | "next" | "tmpl";
|
|
915
|
+
type BadgeName = LevelBadgeName | StepBadgeName;
|
|
916
|
+
/** The ordered step-phase names, used to register custom pail log types. */
|
|
917
|
+
declare const STEP_BADGE_NAMES: ReadonlyArray<StepBadgeName>;
|
|
918
|
+
/**
|
|
919
|
+
* Every badge, keyed by name. Levels get their conventional colors (red/amber/
|
|
920
|
+
* green/blue/grey); step phases follow create-astro's green→purple→cyan rhythm.
|
|
921
|
+
*/
|
|
922
|
+
declare const BADGES: Record<BadgeName, BadgeSpec>;
|
|
923
|
+
/**
|
|
924
|
+
* Luna, the mascot: the folklore rabbit-in-the-moon — a bunny tucked inside the
|
|
925
|
+
* moon disc. Pure ASCII so it renders the same everywhere (including piped logs).
|
|
926
|
+
* The CLI signs off the `init` flow with it, the way create-astro closes with
|
|
927
|
+
* Houston.
|
|
928
|
+
*/
|
|
929
|
+
declare const LUNA_NAME = "Luna";
|
|
930
|
+
declare const LUNA_SIGNOFF = "Safe travels, voyager.";
|
|
931
|
+
declare const LUNA_BUNNY: string;
|
|
932
|
+
/**
|
|
933
|
+
* {@link LUNA_BUNNY} with its leading newline stripped, ready to render inline
|
|
934
|
+
* (beside the name + sign-off). Both render paths — the tui mascot frame and the
|
|
935
|
+
* pail off-TTY fallback — use this so neither re-implements the strip.
|
|
936
|
+
*/
|
|
937
|
+
declare const LUNA_ART: string;
|
|
938
|
+
/** The colored part of a badge — the word with one space of padding each side. */
|
|
939
|
+
declare const padBadge: (text: string) => string;
|
|
940
|
+
/** Leading spaces that right-align a badge's box within the gutter. */
|
|
941
|
+
declare const badgeLead: (text: string) => string;
|
|
942
|
+
/** Columns a rendered badge occupies — the gutter-aligned column width. */
|
|
943
|
+
declare const badgeWidth: (_spec: BadgeSpec) => number;
|
|
944
|
+
/** Paint a badge as an ANSI string (the non-tui path): right-aligning spaces + the colored box. */
|
|
945
|
+
declare const paintBadge: (spec: BadgeSpec) => string;
|
|
946
|
+
/** Dim continuation text (a step's chosen answer, shown under the question). */
|
|
947
|
+
declare const paintAnswer: (text: string) => string;
|
|
894
948
|
/** Candidate wrangler config filenames, in the order every consumer probes them. */
|
|
895
949
|
declare const WRANGLER_FILES: readonly ["wrangler.jsonc", "wrangler.json"];
|
|
896
950
|
/** Locate the project's wrangler config, or `undefined` when none exists. */
|
|
@@ -1072,4 +1126,4 @@ interface WranglerProjectValidationResult {
|
|
|
1072
1126
|
* `{ problems, wranglerPath }` shape plus the structured `report`.
|
|
1073
1127
|
*/
|
|
1074
1128
|
declare const validateWranglerProject: (options: WranglerProjectValidationOptions) => WranglerProjectValidationResult;
|
|
1075
|
-
export { AGENT_RULES_DIR, AGENT_RULES_HINT, AGENT_RULES_HINT_ENV, type AddIndexEdit, type AddOptionalColumnEdit, type AddTableEdit, type AdditiveEdit, type AgentRulesStatus, type ApplyEditResult, type ApplyFailureReason, type AugmentPlan, DEV_VARS_EXAMPLE_FILE, DEV_VARS_FILE, DEV_VARS_KEY_PATTERN, type DestructiveEdit, type DetectedFramework, type DiscoverContainerInfoResult, type DiscoverSchemaInfoResult, type DiscoverWorkflowInfoResult, type EnsureDevVariablesDeps, type EnsureDevVariablesResult, type EnsureDevVariablesStatus, type ExportGap, type FrameworkClass, type FrameworkDetection, type InferOptions, type InferredBindings, type InferredContainer, type InferredWorkflow, LINKED_PROJECT_DIR, LINKED_PROJECT_FILE, LUNORA_CONFIG_FILE, LUNORA_EVENT_SOURCE, LUNORA_SKILL_NAMES, type LinkedProject, type LunoraFormattedLine, type LunoraLineLevel, type LunoraProjectConfig, type MaterializeOptions, type MaterializeResult, type MultiSelectOption, PACKAGE_SECRETS_REGISTRY, type ParseSchemaResult, REMOTE_ELIGIBLE_KEYS, REQUIRED_COMPATIBILITY_DATE, REQUIRED_FLAG, ROOT_SKILL_NAME, type ReadWranglerResult, type ReconcileBindingsResult, type RemoteBindingPlan, type RemoteEnableInputs, type RemotePreference, type RemoteWranglerShape, type ScaffoldPlan, type SchemaColumn, type SchemaEdit, type SchemaIndex, type SchemaInfo, type SchemaTable, type SecretEntry, type SelectOption, type TailConsumer, WRANGLER_FILES, type WranglerConfig, type WranglerContainerEntry, type WranglerProjectValidationOptions, type WranglerProjectValidationResult, type WranglerValidationReport, type WranglerWorkflowEntry, applyAdditiveEdit, buildPackageSecretsBlock, claimAgentRulesHint, classifyEdit, createConfirm, detectAgentRules, detectFramework, discoverContainerInfo, discoverSchemaInfo, discoverWorkflowInfo, ensureDevVariables, ensureDevVariablesExample as ensureDevVarsExample, findWranglerFile, formatLunoraEvent, inferLunoraBindings, injectRemoteFlags, interpretRemote, isInteractive, isPlaceholderValue, isRemoteEnvEnabled, materializeRemoteWranglerConfig, packageNamesFromBindings, parseDevVariableEntries, parseSchema, planDevVariablesAugment, planDevVariablesScaffold, planRemoteBindings, promptMultiSelect, promptSelect, promptYesNo, readLinkedProject, readProjectRemotePreference, readWranglerJsonc, reconcileWranglerBindings, resolveRemoteEnabled, secretsForPackages, validateWrangler, validateWranglerConfig, validateWranglerProject, withTailConsumer, writeLinkedProject };
|
|
1129
|
+
export { ACCENT, AGENT_RULES_DIR, AGENT_RULES_HINT, AGENT_RULES_HINT_ENV, type AddIndexEdit, type AddOptionalColumnEdit, type AddTableEdit, type AdditiveEdit, type AgentRulesStatus, type ApplyEditResult, type ApplyFailureReason, type AugmentPlan, BADGES, type BadgeName, type BadgeSpec, DEV_VARS_EXAMPLE_FILE, DEV_VARS_FILE, DEV_VARS_KEY_PATTERN, type DestructiveEdit, type DetectedFramework, type DiscoverContainerInfoResult, type DiscoverSchemaInfoResult, type DiscoverWorkflowInfoResult, type EnsureDevVariablesDeps, type EnsureDevVariablesResult, type EnsureDevVariablesStatus, type ExportGap, type FrameworkClass, type FrameworkDetection, type InferOptions, type InferredBindings, type InferredContainer, type InferredWorkflow, LINKED_PROJECT_DIR, LINKED_PROJECT_FILE, LUNA_ART, LUNA_BUNNY, LUNA_NAME, LUNA_SIGNOFF, LUNORA_CONFIG_FILE, LUNORA_EVENT_SOURCE, LUNORA_SKILL_NAMES, type LevelBadgeName, type LinkedProject, type LunoraFormattedLine, type LunoraLineLevel, type LunoraProjectConfig, LunoraReporter, type MaterializeOptions, type MaterializeResult, type MultiSelectOption, PACKAGE_SECRETS_REGISTRY, type ParseSchemaResult, REMOTE_ELIGIBLE_KEYS, REQUIRED_COMPATIBILITY_DATE, REQUIRED_FLAG, ROOT_SKILL_NAME, type ReadWranglerResult, type ReconcileBindingsResult, type RemoteBindingPlan, type RemoteEnableInputs, type RemotePreference, type RemoteWranglerShape, STEP_BADGE_NAMES, type ScaffoldPlan, type SchemaColumn, type SchemaEdit, type SchemaIndex, type SchemaInfo, type SchemaTable, type SecretEntry, type SelectOption, type StepBadgeName, type TailConsumer, WRANGLER_FILES, type WranglerConfig, type WranglerContainerEntry, type WranglerProjectValidationOptions, type WranglerProjectValidationResult, type WranglerValidationReport, type WranglerWorkflowEntry, applyAdditiveEdit, badgeLead, badgeWidth, buildPackageSecretsBlock, claimAgentRulesHint, classifyEdit, createConfirm, detectAgentRules, detectFramework, discoverContainerInfo, discoverSchemaInfo, discoverWorkflowInfo, ensureDevVariables, ensureDevVariablesExample as ensureDevVarsExample, findWranglerFile, formatLunoraEvent, inferLunoraBindings, injectRemoteFlags, interpretRemote, isInteractive, isPlaceholderValue, isRemoteEnvEnabled, materializeRemoteWranglerConfig, packageNamesFromBindings, padBadge, paintAnswer, paintBadge, parseDevVariableEntries, parseSchema, planDevVariablesAugment, planDevVariablesScaffold, planRemoteBindings, promptMultiSelect, promptSelect, promptYesNo, readLinkedProject, readProjectRemotePreference, readWranglerJsonc, reconcileWranglerBindings, resolveRemoteEnabled, secretsForPackages, validateWrangler, validateWranglerConfig, validateWranglerProject, withTailConsumer, writeLinkedProject };
|
package/dist/index.d.ts
CHANGED
|
@@ -288,6 +288,12 @@ declare const LUNORA_EVENT_SOURCE = "lunora";
|
|
|
288
288
|
* — so the caller passes the original line through untouched. Pure and total.
|
|
289
289
|
*/
|
|
290
290
|
declare const formatLunoraEvent: (line: string) => LunoraFormattedLine | undefined;
|
|
291
|
+
declare class LunoraReporter {
|
|
292
|
+
#private;
|
|
293
|
+
setStdout(stdout: NodeJS.WriteStream): void;
|
|
294
|
+
setStderr(stderr: NodeJS.WriteStream): void;
|
|
295
|
+
log(meta: unknown): void;
|
|
296
|
+
}
|
|
291
297
|
/**
|
|
292
298
|
* Per-package secret-requirements registry for `.dev.vars` scaffolding.
|
|
293
299
|
*
|
|
@@ -891,6 +897,54 @@ interface DiscoverSchemaInfoResult {
|
|
|
891
897
|
* parse failure is a warning (validator) or simply ignorable (inference).
|
|
892
898
|
*/
|
|
893
899
|
declare const discoverSchemaInfo: (projectRoot: string, schemaDirectory: string) => DiscoverSchemaInfoResult;
|
|
900
|
+
/**
|
|
901
|
+
* A badge: the short colored label that prefixes a line. `bg`/`fg` are hex so the
|
|
902
|
+
* same value drives both colorize's `bgHex().hex()` and the tui `<Text>` props.
|
|
903
|
+
*/
|
|
904
|
+
interface BadgeSpec {
|
|
905
|
+
bg: `#${string}`;
|
|
906
|
+
fg: `#${string}`;
|
|
907
|
+
text: string;
|
|
908
|
+
}
|
|
909
|
+
/** Lunora purple — the accent shared with the CLI prompt frames. */
|
|
910
|
+
declare const ACCENT: `#${string}`;
|
|
911
|
+
/** Standard log-level badge names (the restyled base output). */
|
|
912
|
+
type LevelBadgeName = "debug" | "error" | "info" | "success" | "warn";
|
|
913
|
+
/** Step-phase badge names (the create-astro-style flow transcript). */
|
|
914
|
+
type StepBadgeName = "add" | "deps" | "dir" | "git" | "lunora" | "next" | "tmpl";
|
|
915
|
+
type BadgeName = LevelBadgeName | StepBadgeName;
|
|
916
|
+
/** The ordered step-phase names, used to register custom pail log types. */
|
|
917
|
+
declare const STEP_BADGE_NAMES: ReadonlyArray<StepBadgeName>;
|
|
918
|
+
/**
|
|
919
|
+
* Every badge, keyed by name. Levels get their conventional colors (red/amber/
|
|
920
|
+
* green/blue/grey); step phases follow create-astro's green→purple→cyan rhythm.
|
|
921
|
+
*/
|
|
922
|
+
declare const BADGES: Record<BadgeName, BadgeSpec>;
|
|
923
|
+
/**
|
|
924
|
+
* Luna, the mascot: the folklore rabbit-in-the-moon — a bunny tucked inside the
|
|
925
|
+
* moon disc. Pure ASCII so it renders the same everywhere (including piped logs).
|
|
926
|
+
* The CLI signs off the `init` flow with it, the way create-astro closes with
|
|
927
|
+
* Houston.
|
|
928
|
+
*/
|
|
929
|
+
declare const LUNA_NAME = "Luna";
|
|
930
|
+
declare const LUNA_SIGNOFF = "Safe travels, voyager.";
|
|
931
|
+
declare const LUNA_BUNNY: string;
|
|
932
|
+
/**
|
|
933
|
+
* {@link LUNA_BUNNY} with its leading newline stripped, ready to render inline
|
|
934
|
+
* (beside the name + sign-off). Both render paths — the tui mascot frame and the
|
|
935
|
+
* pail off-TTY fallback — use this so neither re-implements the strip.
|
|
936
|
+
*/
|
|
937
|
+
declare const LUNA_ART: string;
|
|
938
|
+
/** The colored part of a badge — the word with one space of padding each side. */
|
|
939
|
+
declare const padBadge: (text: string) => string;
|
|
940
|
+
/** Leading spaces that right-align a badge's box within the gutter. */
|
|
941
|
+
declare const badgeLead: (text: string) => string;
|
|
942
|
+
/** Columns a rendered badge occupies — the gutter-aligned column width. */
|
|
943
|
+
declare const badgeWidth: (_spec: BadgeSpec) => number;
|
|
944
|
+
/** Paint a badge as an ANSI string (the non-tui path): right-aligning spaces + the colored box. */
|
|
945
|
+
declare const paintBadge: (spec: BadgeSpec) => string;
|
|
946
|
+
/** Dim continuation text (a step's chosen answer, shown under the question). */
|
|
947
|
+
declare const paintAnswer: (text: string) => string;
|
|
894
948
|
/** Candidate wrangler config filenames, in the order every consumer probes them. */
|
|
895
949
|
declare const WRANGLER_FILES: readonly ["wrangler.jsonc", "wrangler.json"];
|
|
896
950
|
/** Locate the project's wrangler config, or `undefined` when none exists. */
|
|
@@ -1072,4 +1126,4 @@ interface WranglerProjectValidationResult {
|
|
|
1072
1126
|
* `{ problems, wranglerPath }` shape plus the structured `report`.
|
|
1073
1127
|
*/
|
|
1074
1128
|
declare const validateWranglerProject: (options: WranglerProjectValidationOptions) => WranglerProjectValidationResult;
|
|
1075
|
-
export { AGENT_RULES_DIR, AGENT_RULES_HINT, AGENT_RULES_HINT_ENV, type AddIndexEdit, type AddOptionalColumnEdit, type AddTableEdit, type AdditiveEdit, type AgentRulesStatus, type ApplyEditResult, type ApplyFailureReason, type AugmentPlan, DEV_VARS_EXAMPLE_FILE, DEV_VARS_FILE, DEV_VARS_KEY_PATTERN, type DestructiveEdit, type DetectedFramework, type DiscoverContainerInfoResult, type DiscoverSchemaInfoResult, type DiscoverWorkflowInfoResult, type EnsureDevVariablesDeps, type EnsureDevVariablesResult, type EnsureDevVariablesStatus, type ExportGap, type FrameworkClass, type FrameworkDetection, type InferOptions, type InferredBindings, type InferredContainer, type InferredWorkflow, LINKED_PROJECT_DIR, LINKED_PROJECT_FILE, LUNORA_CONFIG_FILE, LUNORA_EVENT_SOURCE, LUNORA_SKILL_NAMES, type LinkedProject, type LunoraFormattedLine, type LunoraLineLevel, type LunoraProjectConfig, type MaterializeOptions, type MaterializeResult, type MultiSelectOption, PACKAGE_SECRETS_REGISTRY, type ParseSchemaResult, REMOTE_ELIGIBLE_KEYS, REQUIRED_COMPATIBILITY_DATE, REQUIRED_FLAG, ROOT_SKILL_NAME, type ReadWranglerResult, type ReconcileBindingsResult, type RemoteBindingPlan, type RemoteEnableInputs, type RemotePreference, type RemoteWranglerShape, type ScaffoldPlan, type SchemaColumn, type SchemaEdit, type SchemaIndex, type SchemaInfo, type SchemaTable, type SecretEntry, type SelectOption, type TailConsumer, WRANGLER_FILES, type WranglerConfig, type WranglerContainerEntry, type WranglerProjectValidationOptions, type WranglerProjectValidationResult, type WranglerValidationReport, type WranglerWorkflowEntry, applyAdditiveEdit, buildPackageSecretsBlock, claimAgentRulesHint, classifyEdit, createConfirm, detectAgentRules, detectFramework, discoverContainerInfo, discoverSchemaInfo, discoverWorkflowInfo, ensureDevVariables, ensureDevVariablesExample as ensureDevVarsExample, findWranglerFile, formatLunoraEvent, inferLunoraBindings, injectRemoteFlags, interpretRemote, isInteractive, isPlaceholderValue, isRemoteEnvEnabled, materializeRemoteWranglerConfig, packageNamesFromBindings, parseDevVariableEntries, parseSchema, planDevVariablesAugment, planDevVariablesScaffold, planRemoteBindings, promptMultiSelect, promptSelect, promptYesNo, readLinkedProject, readProjectRemotePreference, readWranglerJsonc, reconcileWranglerBindings, resolveRemoteEnabled, secretsForPackages, validateWrangler, validateWranglerConfig, validateWranglerProject, withTailConsumer, writeLinkedProject };
|
|
1129
|
+
export { ACCENT, AGENT_RULES_DIR, AGENT_RULES_HINT, AGENT_RULES_HINT_ENV, type AddIndexEdit, type AddOptionalColumnEdit, type AddTableEdit, type AdditiveEdit, type AgentRulesStatus, type ApplyEditResult, type ApplyFailureReason, type AugmentPlan, BADGES, type BadgeName, type BadgeSpec, DEV_VARS_EXAMPLE_FILE, DEV_VARS_FILE, DEV_VARS_KEY_PATTERN, type DestructiveEdit, type DetectedFramework, type DiscoverContainerInfoResult, type DiscoverSchemaInfoResult, type DiscoverWorkflowInfoResult, type EnsureDevVariablesDeps, type EnsureDevVariablesResult, type EnsureDevVariablesStatus, type ExportGap, type FrameworkClass, type FrameworkDetection, type InferOptions, type InferredBindings, type InferredContainer, type InferredWorkflow, LINKED_PROJECT_DIR, LINKED_PROJECT_FILE, LUNA_ART, LUNA_BUNNY, LUNA_NAME, LUNA_SIGNOFF, LUNORA_CONFIG_FILE, LUNORA_EVENT_SOURCE, LUNORA_SKILL_NAMES, type LevelBadgeName, type LinkedProject, type LunoraFormattedLine, type LunoraLineLevel, type LunoraProjectConfig, LunoraReporter, type MaterializeOptions, type MaterializeResult, type MultiSelectOption, PACKAGE_SECRETS_REGISTRY, type ParseSchemaResult, REMOTE_ELIGIBLE_KEYS, REQUIRED_COMPATIBILITY_DATE, REQUIRED_FLAG, ROOT_SKILL_NAME, type ReadWranglerResult, type ReconcileBindingsResult, type RemoteBindingPlan, type RemoteEnableInputs, type RemotePreference, type RemoteWranglerShape, STEP_BADGE_NAMES, type ScaffoldPlan, type SchemaColumn, type SchemaEdit, type SchemaIndex, type SchemaInfo, type SchemaTable, type SecretEntry, type SelectOption, type StepBadgeName, type TailConsumer, WRANGLER_FILES, type WranglerConfig, type WranglerContainerEntry, type WranglerProjectValidationOptions, type WranglerProjectValidationResult, type WranglerValidationReport, type WranglerWorkflowEntry, applyAdditiveEdit, badgeLead, badgeWidth, buildPackageSecretsBlock, claimAgentRulesHint, classifyEdit, createConfirm, detectAgentRules, detectFramework, discoverContainerInfo, discoverSchemaInfo, discoverWorkflowInfo, ensureDevVariables, ensureDevVariablesExample as ensureDevVarsExample, findWranglerFile, formatLunoraEvent, inferLunoraBindings, injectRemoteFlags, interpretRemote, isInteractive, isPlaceholderValue, isRemoteEnvEnabled, materializeRemoteWranglerConfig, packageNamesFromBindings, padBadge, paintAnswer, paintBadge, parseDevVariableEntries, parseSchema, planDevVariablesAugment, planDevVariablesScaffold, planRemoteBindings, promptMultiSelect, promptSelect, promptYesNo, readLinkedProject, readProjectRemotePreference, readWranglerJsonc, reconcileWranglerBindings, resolveRemoteEnabled, secretsForPackages, validateWrangler, validateWranglerConfig, validateWranglerProject, withTailConsumer, writeLinkedProject };
|
package/dist/index.mjs
CHANGED
|
@@ -5,6 +5,7 @@ export { DEV_VARS_EXAMPLE_FILE, DEV_VARS_FILE, DEV_VARS_KEY_PATTERN, parseDevVar
|
|
|
5
5
|
export { inferLunoraBindings, packageNamesFromBindings } from './packem_shared/inferLunoraBindings-XNJH4pup.mjs';
|
|
6
6
|
export { LINKED_PROJECT_DIR, LINKED_PROJECT_FILE, readLinkedProject, writeLinkedProject } from './packem_shared/LINKED_PROJECT_DIR-CXwXzV_C.mjs';
|
|
7
7
|
export { LUNORA_EVENT_SOURCE, formatLunoraEvent } from './packem_shared/LUNORA_EVENT_SOURCE-D2fDeGB6.mjs';
|
|
8
|
+
export { default as LunoraReporter } from './packem_shared/LunoraReporter-DDGFirVv.mjs';
|
|
8
9
|
export { PACKAGE_SECRETS_REGISTRY, secretsForPackages } from './packem_shared/PACKAGE_SECRETS_REGISTRY-CySy5vR_.mjs';
|
|
9
10
|
export { LUNORA_CONFIG_FILE, interpretRemote, readProjectRemotePreference } from './packem_shared/LUNORA_CONFIG_FILE-CtcIcB5-.mjs';
|
|
10
11
|
export { createConfirm, isInteractive, promptMultiSelect, promptSelect, promptYesNo } from './packem_shared/createConfirm-fvpdgJ9s.mjs';
|
|
@@ -15,6 +16,7 @@ export { applyAdditiveEdit, classifyEdit } from './packem_shared/applyAdditiveEd
|
|
|
15
16
|
export { parseSchema } from './packem_shared/parseSchema-DSeyktvG.mjs';
|
|
16
17
|
export { classifyPolicyEdit, scaffoldPolicyFile, wireRlsIntoProcedure } from './packem_shared/classifyPolicyEdit-BHeAqF8P.mjs';
|
|
17
18
|
export { discoverSchemaInfo } from './packem_shared/discoverSchemaInfo-DWtypqpP.mjs';
|
|
19
|
+
export { ACCENT, BADGES, LUNA_ART, LUNA_BUNNY, LUNA_NAME, LUNA_SIGNOFF, STEP_BADGE_NAMES, badgeLead, badgeWidth, padBadge, paintAnswer, paintBadge } from './packem_shared/ACCENT-DN2byyj1.mjs';
|
|
18
20
|
export { discoverWorkflowInfo } from './packem_shared/discoverWorkflowInfo-CedvR0mn.mjs';
|
|
19
21
|
export { WRANGLER_FILES, findWranglerFile, readWranglerJsonc } from './packem_shared/WRANGLER_FILES-DwSuC-Kn.mjs';
|
|
20
22
|
export { REQUIRED_COMPATIBILITY_DATE, REQUIRED_FLAG, validateWrangler, validateWranglerConfig, validateWranglerProject, withTailConsumer } from './packem_shared/REQUIRED_COMPATIBILITY_DATE-ycqievRl.mjs';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import colorize from '@visulima/colorize';
|
|
2
|
+
|
|
3
|
+
const ACCENT = "#a855f7";
|
|
4
|
+
const INK = "#0b0b0b";
|
|
5
|
+
const STEP_BADGE_NAMES = ["lunora", "dir", "tmpl", "add", "deps", "git", "next"];
|
|
6
|
+
const BADGES = {
|
|
7
|
+
add: { bg: ACCENT, fg: INK, text: "add" },
|
|
8
|
+
debug: { bg: "#6b7280", fg: "#f3f4f6", text: "debug" },
|
|
9
|
+
deps: { bg: ACCENT, fg: INK, text: "deps" },
|
|
10
|
+
dir: { bg: ACCENT, fg: INK, text: "dir" },
|
|
11
|
+
error: { bg: "#ef4444", fg: INK, text: "error" },
|
|
12
|
+
git: { bg: "#f59e0b", fg: INK, text: "git" },
|
|
13
|
+
info: { bg: "#3b82f6", fg: INK, text: "info" },
|
|
14
|
+
lunora: { bg: "#22c55e", fg: INK, text: "lunora" },
|
|
15
|
+
next: { bg: "#06b6d4", fg: INK, text: "next" },
|
|
16
|
+
success: { bg: "#22c55e", fg: INK, text: "ok" },
|
|
17
|
+
tmpl: { bg: ACCENT, fg: INK, text: "tmpl" },
|
|
18
|
+
warn: { bg: "#f59e0b", fg: INK, text: "warn" }
|
|
19
|
+
};
|
|
20
|
+
const LUNA_NAME = "Luna";
|
|
21
|
+
const LUNA_SIGNOFF = "Safe travels, voyager.";
|
|
22
|
+
const LUNA_BUNNY = String.raw`
|
|
23
|
+
.-"""""-.
|
|
24
|
+
/ (\(\ \
|
|
25
|
+
| ( -.-) |
|
|
26
|
+
\ o(")(") /
|
|
27
|
+
'-._____.-'`;
|
|
28
|
+
const LUNA_ART = LUNA_BUNNY.startsWith("\n") ? LUNA_BUNNY.slice(1) : LUNA_BUNNY;
|
|
29
|
+
const BADGE_GUTTER = 6;
|
|
30
|
+
const padBadge = (text) => ` ${text} `;
|
|
31
|
+
const badgeLead = (text) => " ".repeat(Math.max(0, BADGE_GUTTER - text.length));
|
|
32
|
+
const BADGE_COLUMN_WIDTH = BADGE_GUTTER + 2;
|
|
33
|
+
const badgeWidth = (_spec) => BADGE_COLUMN_WIDTH;
|
|
34
|
+
const paintBadge = (spec) => (
|
|
35
|
+
// eslint-disable-next-line import/no-named-as-default-member -- see file header.
|
|
36
|
+
badgeLead(spec.text) + colorize.bgHex(spec.bg).hex(spec.fg).bold(padBadge(spec.text))
|
|
37
|
+
);
|
|
38
|
+
const paintAnswer = (text) => colorize.dim(text);
|
|
39
|
+
|
|
40
|
+
export { ACCENT, BADGES, LUNA_ART, LUNA_BUNNY, LUNA_NAME, LUNA_SIGNOFF, STEP_BADGE_NAMES, badgeLead, badgeWidth, padBadge, paintAnswer, paintBadge };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { paintBadge, badgeWidth, BADGES } from './ACCENT-DN2byyj1.mjs';
|
|
2
|
+
|
|
3
|
+
const NAME_ALIASES = {
|
|
4
|
+
informational: "info",
|
|
5
|
+
warning: "warn"
|
|
6
|
+
};
|
|
7
|
+
const STDERR_LEVELS = /* @__PURE__ */ new Set(["alert", "critical", "emergency", "error", "warn", "warning"]);
|
|
8
|
+
const resolveBadge = (name) => {
|
|
9
|
+
if (name in BADGES) {
|
|
10
|
+
return BADGES[name];
|
|
11
|
+
}
|
|
12
|
+
const alias = NAME_ALIASES[name];
|
|
13
|
+
return alias === void 0 ? void 0 : BADGES[alias];
|
|
14
|
+
};
|
|
15
|
+
const renderContextArgument = (value) => {
|
|
16
|
+
if (value instanceof Error) {
|
|
17
|
+
return `
|
|
18
|
+
${value.stack ?? value.message}`;
|
|
19
|
+
}
|
|
20
|
+
if (typeof value === "object" && value !== null) {
|
|
21
|
+
try {
|
|
22
|
+
return ` ${JSON.stringify(value)}`;
|
|
23
|
+
} catch {
|
|
24
|
+
return " [unserializable]";
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return ` ${String(value)}`;
|
|
28
|
+
};
|
|
29
|
+
const composeMessage = (meta) => {
|
|
30
|
+
const base = typeof meta.message === "string" ? meta.message : String(meta.message);
|
|
31
|
+
const context = meta.context ?? [];
|
|
32
|
+
return context.length === 0 ? base : base + context.map((value) => renderContextArgument(value)).join("");
|
|
33
|
+
};
|
|
34
|
+
class LunoraReporter {
|
|
35
|
+
#stdout = process.stdout;
|
|
36
|
+
#stderr = process.stderr;
|
|
37
|
+
setStdout(stdout) {
|
|
38
|
+
this.#stdout = stdout;
|
|
39
|
+
}
|
|
40
|
+
setStderr(stderr) {
|
|
41
|
+
this.#stderr = stderr;
|
|
42
|
+
}
|
|
43
|
+
// Note: pail's other reporter setters (setLoggerTypes / setInteractiveManager /
|
|
44
|
+
// setIsInteractive) are optional and intentionally omitted — this reporter keeps
|
|
45
|
+
// no type or interactive state; it only needs the two stream setters above.
|
|
46
|
+
log(meta) {
|
|
47
|
+
const data = meta;
|
|
48
|
+
const badge = resolveBadge(data.type.name);
|
|
49
|
+
const stream = STDERR_LEVELS.has(data.type.level ?? data.type.name) ? this.#stderr : this.#stdout;
|
|
50
|
+
stream.write(LunoraReporter.#render(badge, composeMessage(data)));
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Frame `text` under `badge`: `<badge> <first line>`, with any further lines
|
|
54
|
+
* indented to align beneath the message. Without a badge (unknown type) the
|
|
55
|
+
* message is written plain.
|
|
56
|
+
*/
|
|
57
|
+
static #render(badge, text) {
|
|
58
|
+
if (badge === void 0) {
|
|
59
|
+
return `${text}
|
|
60
|
+
`;
|
|
61
|
+
}
|
|
62
|
+
const [first = "", ...rest] = text.split("\n");
|
|
63
|
+
const indent = " ".repeat(badgeWidth() + 1);
|
|
64
|
+
const lines = [`${paintBadge(badge)} ${first}`, ...rest.map((line) => `${indent}${line}`)];
|
|
65
|
+
return `${lines.join("\n")}
|
|
66
|
+
`;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export { LunoraReporter as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/config",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.5",
|
|
4
4
|
"description": "Internal shared CLI + Vite config layer for Lunora: wrangler.jsonc validation, binding inference, and .dev.vars scaffolding",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bindings",
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"@lunora/codegen": "1.0.0-alpha.3",
|
|
54
54
|
"@lunora/container": "1.0.0-alpha.1",
|
|
55
55
|
"@lunora/seed": "1.0.0-alpha.1",
|
|
56
|
+
"@visulima/colorize": "2.0.0-alpha.14",
|
|
56
57
|
"es-module-lexer": "^2.1.0",
|
|
57
58
|
"jsonc-parser": "^3.3.1",
|
|
58
59
|
"ts-morph": "^28.0.0"
|