@fulmenhq/tsfulmen 0.3.2 → 0.3.3

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/CHANGELOG.md CHANGED
@@ -14,6 +14,20 @@ _No unreleased changes._
14
14
 
15
15
  ---
16
16
 
17
+ ## [0.3.3] - 2026-06-17
18
+
19
+ > **Patch — compile-safety ergonomics.** Two purely-additive API options that let `bun --compile` single-file binary consumers register a build-embedded identity and load embedded config without per-consumer workarounds — ahead of the larger v0.4.0 SSOT-asset-embedding work. No breaking changes; the existing exported `LoadConfigOptions` shape is unchanged; engine floor unchanged (`>=22.12.0`). Full details in `docs/releases/v0.3.3.md`.
20
+
21
+ ### Added
22
+
23
+ - **`skipValidation` on `registerEmbeddedIdentity(data, options?)`** — symmetric with the existing `loadIdentity({ skipValidation })`. Lets a `bun --compile` binary register a CI-validated embedded identity without hitting the filesystem-backed schema registry (absent in a single-file binary). Parse / first-wins / deep-freeze semantics are unchanged; only schema validation is gated. New `RegisterEmbeddedIdentityOptions` type exported from `appidentity`.
24
+ - **Inline `defaults` / `schema` on `loadConfig`** — provide a pre-parsed `defaults` object and/or an inline `schema` string instead of file paths, so consumers embedding config at build time needn't write content to a temp file just to pass a path. Exposed via a new `LoadInlineConfigOptions` shape and a `loadConfig` overload; `defaults` is `structuredClone`'d so callers' embedded objects are never mutated.
25
+
26
+ ### Changed
27
+
28
+ - **`loadConfig` options split into path-based and inline shapes** (additive). `LoadConfigOptions` keeps `defaultsPath: string` (required) exactly as before; the new `LoadInlineConfigOptions` carries `defaults` (required). Both extend a shared `BaseLoadConfigOptions` and are mutually exclusive at the type level (`?: never`); `loadConfig` is overloaded over the two. The existing exported `LoadConfigOptions` is unchanged — patch-compatible for strict TypeScript consumers.
29
+ - **`ConfigMetadata` diagnostics** — adds optional `defaultsSource: "path" | "inline"` and `schema.source: "path" | "inline" | null`. `defaultsPath` stays typed `string` (reports `""` for inline). Fixes a bug where, when both inline `schema` and `schemaPath` were given, `schema.path` mis-reported the unused `schemaPath` — inline now correctly reports `path: null`.
30
+
17
31
  ## [0.3.2] - 2026-06-17
18
32
 
19
33
  > **Patch — app-identity follow-up.** Syncs the Crucible SSOT to v0.4.14 (which adds the formal `metadata.typescript` app-identity section) and promotes tsfulmen's interim custom `metadata.console_scripts` field to it. No code or behavior change; the only published delta is the refreshed bundled `crucible-ts` schemas. Full details in `docs/releases/v0.3.2.md`.
@@ -1,5 +1,5 @@
1
- import { I as Identity, L as LoadIdentityOptions } from '../types-Dv5TERCM.js';
2
- export { A as AppIdentity, a as IdentityMetadata, P as PythonMetadata, R as RepositoryCategory } from '../types-Dv5TERCM.js';
1
+ import { I as Identity, R as RegisterEmbeddedIdentityOptions, L as LoadIdentityOptions } from '../types-CHDvDRCf.js';
2
+ export { A as AppIdentity, a as IdentityMetadata, P as PythonMetadata, b as RepositoryCategory } from '../types-CHDvDRCf.js';
3
3
  import { F as FulmenError } from '../fulmen-error-B_kX8jSC.js';
4
4
  import { b as SchemaValidationDiagnostic } from '../types-DdoeE7F5.js';
5
5
 
@@ -50,10 +50,11 @@ declare const MAX_ANCESTOR_SEARCH_DEPTH = 20;
50
50
  *
51
51
  * Semantics:
52
52
  * - First registration wins (subsequent calls throw error)
53
- * - Validates against schema on registration
53
+ * - Validates against schema on registration (unless `skipValidation`)
54
54
  * - Stores as immutable process-level fallback
55
55
  *
56
56
  * @param data - YAML string or pre-parsed Identity object
57
+ * @param options - Optional registration options (see {@link RegisterEmbeddedIdentityOptions})
57
58
  * @throws {AppIdentityError} If already registered or validation fails
58
59
  *
59
60
  * @example
@@ -75,8 +76,17 @@ declare const MAX_ANCESTOR_SEARCH_DEPTH = 20;
75
76
  * // Embedded identity not available - discovery will use filesystem
76
77
  * }
77
78
  * ```
79
+ *
80
+ * @example
81
+ * ```typescript
82
+ * // In a `bun --compile` single-file binary, the FS-backed schema registry
83
+ * // is unavailable. Register a build-time-embedded, CI-validated identity
84
+ * // without re-validating against the (absent) schema registry:
85
+ * import embeddedYaml from "./app-identity.embedded.js"; // inlined at build
86
+ * registerEmbeddedIdentity(embeddedYaml, { skipValidation: true });
87
+ * ```
78
88
  */
79
- declare function registerEmbeddedIdentity(data: string | Identity): Promise<void>;
89
+ declare function registerEmbeddedIdentity(data: string | Identity, options?: RegisterEmbeddedIdentityOptions): Promise<void>;
80
90
  /**
81
91
  * Check if embedded identity has been registered
82
92
  *
@@ -305,4 +315,4 @@ interface BuildRuntimeInfoOptions {
305
315
  */
306
316
  declare function buildRuntimeInfo(options?: BuildRuntimeInfoOptions): RuntimeInfo;
307
317
 
308
- export { APP_IDENTITY_DIR, APP_IDENTITY_ENV_VAR, APP_IDENTITY_FILENAME, APP_IDENTITY_SCHEMA_ID, AppIdentityError, type BuildRuntimeInfoOptions, type ConfigIdentifiers, Identity, LoadIdentityOptions, MAX_ANCESTOR_SEARCH_DEPTH, type RuntimeInfo, type RuntimeName, buildEnvVar, buildRuntimeInfo, clearEmbeddedIdentity, clearIdentityCache, getBinaryName, getCachedIdentity, getConfigIdentifiers, getConfigName, getEmbeddedIdentity, getEnvPrefix, getEnvVar, getTelemetryNamespace, getVendor, hasEmbeddedIdentity, loadIdentity, registerEmbeddedIdentity };
318
+ export { APP_IDENTITY_DIR, APP_IDENTITY_ENV_VAR, APP_IDENTITY_FILENAME, APP_IDENTITY_SCHEMA_ID, AppIdentityError, type BuildRuntimeInfoOptions, type ConfigIdentifiers, Identity, LoadIdentityOptions, MAX_ANCESTOR_SEARCH_DEPTH, RegisterEmbeddedIdentityOptions, type RuntimeInfo, type RuntimeName, buildEnvVar, buildRuntimeInfo, clearEmbeddedIdentity, clearIdentityCache, getBinaryName, getCachedIdentity, getConfigIdentifiers, getConfigName, getEmbeddedIdentity, getEnvPrefix, getEnvVar, getTelemetryNamespace, getVendor, hasEmbeddedIdentity, loadIdentity, registerEmbeddedIdentity };
@@ -1915,10 +1915,11 @@ function deepFreeze(obj) {
1915
1915
  });
1916
1916
  return obj;
1917
1917
  }
1918
- async function registerEmbeddedIdentity(data) {
1918
+ async function registerEmbeddedIdentity(data, options) {
1919
1919
  if (isRegistered) {
1920
1920
  throw AppIdentityError.alreadyRegistered();
1921
1921
  }
1922
+ const skipValidation = options?.skipValidation ?? false;
1922
1923
  let identity;
1923
1924
  if (typeof data === "string") {
1924
1925
  let parsed;
@@ -1929,15 +1930,19 @@ async function registerEmbeddedIdentity(data) {
1929
1930
  error instanceof Error ? error : new Error(String(error))
1930
1931
  );
1931
1932
  }
1932
- const result = await validateDataBySchemaId(parsed, APP_IDENTITY_SCHEMA_ID);
1933
- if (!result.valid) {
1934
- throw AppIdentityError.embeddedValidationFailed(result.diagnostics);
1933
+ if (!skipValidation) {
1934
+ const result = await validateDataBySchemaId(parsed, APP_IDENTITY_SCHEMA_ID);
1935
+ if (!result.valid) {
1936
+ throw AppIdentityError.embeddedValidationFailed(result.diagnostics);
1937
+ }
1935
1938
  }
1936
1939
  identity = parsed;
1937
1940
  } else {
1938
- const result = await validateDataBySchemaId(data, APP_IDENTITY_SCHEMA_ID);
1939
- if (!result.valid) {
1940
- throw AppIdentityError.embeddedValidationFailed(result.diagnostics);
1941
+ if (!skipValidation) {
1942
+ const result = await validateDataBySchemaId(data, APP_IDENTITY_SCHEMA_ID);
1943
+ if (!result.valid) {
1944
+ throw AppIdentityError.embeddedValidationFailed(result.diagnostics);
1945
+ }
1941
1946
  }
1942
1947
  identity = data;
1943
1948
  }