@formspec/build 0.1.0-alpha.51 → 0.1.0-alpha.53

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.
@@ -40,6 +40,7 @@ import { ExtensionDefinition } from '@formspec/core';
40
40
  import { FormElement } from '@formspec/core';
41
41
  import { FormSpec } from '@formspec/core';
42
42
  import { Group } from '@formspec/core';
43
+ import type { LoggerLike } from '@formspec/core';
43
44
  import type { MetadataPolicyInput } from '@formspec/core';
44
45
  import { NumberField } from '@formspec/core';
45
46
  import { ObjectField } from '@formspec/core';
@@ -95,6 +96,11 @@ export declare function buildFormSchemas<E extends readonly FormElement[]>(form:
95
96
  * @public
96
97
  */
97
98
  export declare interface BuildFormSchemasOptions extends GenerateJsonSchemaOptions, GenerateUiSchemaOptions {
99
+ /**
100
+ * Optional logger for diagnostic output. Defaults to a no-op logger so
101
+ * existing callers produce no output.
102
+ */
103
+ readonly logger?: LoggerLike | undefined;
98
104
  }
99
105
 
100
106
  /**
@@ -1008,6 +1014,11 @@ export declare interface GenerateJsonSchemaOptions {
1008
1014
  readonly enumSerialization?: "enum" | "oneOf";
1009
1015
  /** Metadata resolution policy for chain DSL generation. */
1010
1016
  readonly metadata?: MetadataPolicyInput | undefined;
1017
+ /**
1018
+ * Optional logger for diagnostic output. Defaults to a no-op logger so
1019
+ * existing callers produce no output.
1020
+ */
1021
+ readonly logger?: LoggerLike | undefined;
1011
1022
  }
1012
1023
 
1013
1024
  /**
@@ -1390,6 +1401,11 @@ export declare function generateUiSchema<E extends readonly FormElement[]>(form:
1390
1401
  export declare interface GenerateUiSchemaOptions {
1391
1402
  /** Metadata resolution policy for chain DSL UI generation. */
1392
1403
  readonly metadata?: MetadataPolicyInput | undefined;
1404
+ /**
1405
+ * Optional logger for diagnostic output. Defaults to a no-op logger so
1406
+ * existing callers produce no output.
1407
+ */
1408
+ readonly logger?: LoggerLike | undefined;
1393
1409
  }
1394
1410
 
1395
1411
  export { Group }
@@ -2391,6 +2407,11 @@ export declare interface WriteSchemasOptions extends GenerateJsonSchemaOptions {
2391
2407
  readonly name?: string;
2392
2408
  /** Number of spaces for JSON indentation. Defaults to 2 */
2393
2409
  readonly indent?: number;
2410
+ /**
2411
+ * Optional logger for diagnostic output. Defaults to a no-op logger so
2412
+ * existing callers produce no output.
2413
+ */
2414
+ readonly logger?: LoggerLike | undefined;
2394
2415
  }
2395
2416
 
2396
2417
  /**
@@ -40,6 +40,7 @@ import { ExtensionDefinition } from '@formspec/core';
40
40
  import { FormElement } from '@formspec/core';
41
41
  import { FormSpec } from '@formspec/core';
42
42
  import { Group } from '@formspec/core';
43
+ import type { LoggerLike } from '@formspec/core';
43
44
  import type { MetadataPolicyInput } from '@formspec/core';
44
45
  import { NumberField } from '@formspec/core';
45
46
  import { ObjectField } from '@formspec/core';
@@ -95,6 +96,11 @@ export declare function buildFormSchemas<E extends readonly FormElement[]>(form:
95
96
  * @public
96
97
  */
97
98
  export declare interface BuildFormSchemasOptions extends GenerateJsonSchemaOptions, GenerateUiSchemaOptions {
99
+ /**
100
+ * Optional logger for diagnostic output. Defaults to a no-op logger so
101
+ * existing callers produce no output.
102
+ */
103
+ readonly logger?: LoggerLike | undefined;
98
104
  }
99
105
 
100
106
  /**
@@ -1008,6 +1014,11 @@ export declare interface GenerateJsonSchemaOptions {
1008
1014
  readonly enumSerialization?: "enum" | "oneOf";
1009
1015
  /** Metadata resolution policy for chain DSL generation. */
1010
1016
  readonly metadata?: MetadataPolicyInput | undefined;
1017
+ /**
1018
+ * Optional logger for diagnostic output. Defaults to a no-op logger so
1019
+ * existing callers produce no output.
1020
+ */
1021
+ readonly logger?: LoggerLike | undefined;
1011
1022
  }
1012
1023
 
1013
1024
  /**
@@ -1390,6 +1401,11 @@ export declare function generateUiSchema<E extends readonly FormElement[]>(form:
1390
1401
  export declare interface GenerateUiSchemaOptions {
1391
1402
  /** Metadata resolution policy for chain DSL UI generation. */
1392
1403
  readonly metadata?: MetadataPolicyInput | undefined;
1404
+ /**
1405
+ * Optional logger for diagnostic output. Defaults to a no-op logger so
1406
+ * existing callers produce no output.
1407
+ */
1408
+ readonly logger?: LoggerLike | undefined;
1393
1409
  }
1394
1410
 
1395
1411
  export { Group }
@@ -2391,6 +2407,11 @@ export declare interface WriteSchemasOptions extends GenerateJsonSchemaOptions {
2391
2407
  readonly name?: string;
2392
2408
  /** Number of spaces for JSON indentation. Defaults to 2 */
2393
2409
  readonly indent?: number;
2410
+ /**
2411
+ * Optional logger for diagnostic output. Defaults to a no-op logger so
2412
+ * existing callers produce no output.
2413
+ */
2414
+ readonly logger?: LoggerLike | undefined;
2394
2415
  }
2395
2416
 
2396
2417
  /**
@@ -40,6 +40,7 @@ import { ExtensionDefinition } from '@formspec/core';
40
40
  import { FormElement } from '@formspec/core';
41
41
  import { FormSpec } from '@formspec/core';
42
42
  import { Group } from '@formspec/core';
43
+ import type { LoggerLike } from '@formspec/core';
43
44
  import type { MetadataPolicyInput } from '@formspec/core';
44
45
  import { NumberField } from '@formspec/core';
45
46
  import { ObjectField } from '@formspec/core';
@@ -95,6 +96,11 @@ export declare function buildFormSchemas<E extends readonly FormElement[]>(form:
95
96
  * @public
96
97
  */
97
98
  export declare interface BuildFormSchemasOptions extends GenerateJsonSchemaOptions, GenerateUiSchemaOptions {
99
+ /**
100
+ * Optional logger for diagnostic output. Defaults to a no-op logger so
101
+ * existing callers produce no output.
102
+ */
103
+ readonly logger?: LoggerLike | undefined;
98
104
  }
99
105
 
100
106
  /**
@@ -1008,6 +1014,11 @@ export declare interface GenerateJsonSchemaOptions {
1008
1014
  readonly enumSerialization?: "enum" | "oneOf";
1009
1015
  /** Metadata resolution policy for chain DSL generation. */
1010
1016
  readonly metadata?: MetadataPolicyInput | undefined;
1017
+ /**
1018
+ * Optional logger for diagnostic output. Defaults to a no-op logger so
1019
+ * existing callers produce no output.
1020
+ */
1021
+ readonly logger?: LoggerLike | undefined;
1011
1022
  }
1012
1023
 
1013
1024
  /**
@@ -1390,6 +1401,11 @@ export declare function generateUiSchema<E extends readonly FormElement[]>(form:
1390
1401
  export declare interface GenerateUiSchemaOptions {
1391
1402
  /** Metadata resolution policy for chain DSL UI generation. */
1392
1403
  readonly metadata?: MetadataPolicyInput | undefined;
1404
+ /**
1405
+ * Optional logger for diagnostic output. Defaults to a no-op logger so
1406
+ * existing callers produce no output.
1407
+ */
1408
+ readonly logger?: LoggerLike | undefined;
1393
1409
  }
1394
1410
 
1395
1411
  export { Group }
@@ -2391,6 +2407,11 @@ export declare interface WriteSchemasOptions extends GenerateJsonSchemaOptions {
2391
2407
  readonly name?: string;
2392
2408
  /** Number of spaces for JSON indentation. Defaults to 2 */
2393
2409
  readonly indent?: number;
2410
+ /**
2411
+ * Optional logger for diagnostic output. Defaults to a no-op logger so
2412
+ * existing callers produce no output.
2413
+ */
2414
+ readonly logger?: LoggerLike | undefined;
2394
2415
  }
2395
2416
 
2396
2417
  /**
package/dist/build.d.ts CHANGED
@@ -40,6 +40,7 @@ import { ExtensionDefinition } from '@formspec/core';
40
40
  import { FormElement } from '@formspec/core';
41
41
  import { FormSpec } from '@formspec/core';
42
42
  import { Group } from '@formspec/core';
43
+ import type { LoggerLike } from '@formspec/core';
43
44
  import type { MetadataPolicyInput } from '@formspec/core';
44
45
  import { NumberField } from '@formspec/core';
45
46
  import { ObjectField } from '@formspec/core';
@@ -95,6 +96,11 @@ export declare function buildFormSchemas<E extends readonly FormElement[]>(form:
95
96
  * @public
96
97
  */
97
98
  export declare interface BuildFormSchemasOptions extends GenerateJsonSchemaOptions, GenerateUiSchemaOptions {
99
+ /**
100
+ * Optional logger for diagnostic output. Defaults to a no-op logger so
101
+ * existing callers produce no output.
102
+ */
103
+ readonly logger?: LoggerLike | undefined;
98
104
  }
99
105
 
100
106
  /**
@@ -1008,6 +1014,11 @@ export declare interface GenerateJsonSchemaOptions {
1008
1014
  readonly enumSerialization?: "enum" | "oneOf";
1009
1015
  /** Metadata resolution policy for chain DSL generation. */
1010
1016
  readonly metadata?: MetadataPolicyInput | undefined;
1017
+ /**
1018
+ * Optional logger for diagnostic output. Defaults to a no-op logger so
1019
+ * existing callers produce no output.
1020
+ */
1021
+ readonly logger?: LoggerLike | undefined;
1011
1022
  }
1012
1023
 
1013
1024
  /**
@@ -1390,6 +1401,11 @@ export declare function generateUiSchema<E extends readonly FormElement[]>(form:
1390
1401
  export declare interface GenerateUiSchemaOptions {
1391
1402
  /** Metadata resolution policy for chain DSL UI generation. */
1392
1403
  readonly metadata?: MetadataPolicyInput | undefined;
1404
+ /**
1405
+ * Optional logger for diagnostic output. Defaults to a no-op logger so
1406
+ * existing callers produce no output.
1407
+ */
1408
+ readonly logger?: LoggerLike | undefined;
1393
1409
  }
1394
1410
 
1395
1411
  export { Group }
@@ -2391,6 +2407,11 @@ export declare interface WriteSchemasOptions extends GenerateJsonSchemaOptions {
2391
2407
  readonly name?: string;
2392
2408
  /** Number of spaces for JSON indentation. Defaults to 2 */
2393
2409
  readonly indent?: number;
2410
+ /**
2411
+ * Optional logger for diagnostic output. Defaults to a no-op logger so
2412
+ * existing callers produce no output.
2413
+ */
2414
+ readonly logger?: LoggerLike | undefined;
2394
2415
  }
2395
2416
 
2396
2417
  /**
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Pino-based logger factory for the @formspec/build CLI.
3
+ *
4
+ * Reads `process.env.DEBUG` to determine which namespaces are enabled using
5
+ * the shared matcher in `@formspec/core` — same semantics as the `debug` npm
6
+ * package (comma-separated patterns, `*` wildcard, `-` prefix for negation,
7
+ * negations always win).
8
+ */
9
+ import type { LoggerLike } from "@formspec/core";
10
+ /**
11
+ * Creates a logger for the given namespace.
12
+ *
13
+ * When the namespace is enabled by `DEBUG`, writes structured JSON to stderr
14
+ * (with pino-pretty formatting when stderr is a TTY). Otherwise returns the
15
+ * silent `noopLogger` from `@formspec/core`.
16
+ *
17
+ * pino and pino-pretty are loaded lazily via `require()` so that the CLI
18
+ * pays no load-time cost when logging is disabled, and so the dependencies
19
+ * can be declared as `optionalDependencies` of `@formspec/build`.
20
+ */
21
+ export declare function createLogger(namespace: string): LoggerLike;
22
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/cli/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAIjD;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU,CAwB1D"}