@dephub/layer 1.0.0 → 1.0.1

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.
@@ -3,7 +3,7 @@ import { buildLayer } from "../utils/build.js";
3
3
  import { parseConfig } from "../utils/config.js";
4
4
  import { resolveEntries } from "../utils/entries.js";
5
5
  import { hasUnknownGroup } from "../utils/has.js";
6
- import { logBuildSummary, logError, logHeader, setSilent } from "../utils/log.js";
6
+ import { logBuildSummary, logError, logHeader, logMessage, setSilent } from "../utils/log.js";
7
7
  // src/core/builder.ts
8
8
  /**
9
9
  * Creates a configured builder function to process source content files, validate schemas,
@@ -120,6 +120,7 @@ async function useBuilder(builderConfig) {
120
120
  docType,
121
121
  exclude,
122
122
  importsMap,
123
+ log: (message) => logMessage(name, message),
123
124
  name,
124
125
  outDir,
125
126
  outExtension,
@@ -66,6 +66,10 @@ export interface BuilderContext<TParser = unknown> extends LayerConfig<{
66
66
  * A nested record mapping internal directories and file names to their relative output file paths.
67
67
  */
68
68
  importsMap: ImportsMap;
69
+ /**
70
+ * Emits a progress line prefixed with the builder name.
71
+ */
72
+ log: (message: string) => void;
69
73
  }
70
74
  /**
71
75
  * Configuration options for the CLI interface, extending builder configurations.
package/dist/package.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var name = "@dephub/layer";
3
3
  var type = "module";
4
- var version = "1.0.0";
4
+ var version = "1.0.1";
5
5
  var description = "A tiny builder for transforming source content into typed, validated, and cache-aware layers — with first-class CLI, watcher, and programmatic APIs.";
6
6
  var types = "dist/index.d.ts";
7
7
  var main = "dist/index.js";
@@ -11,6 +11,7 @@ export declare function logConfigPathNotFound(name: string, configPath: string):
11
11
  export declare function logDirNotFound(name: string, contentDir: string): void;
12
12
  export declare function logError(name: string, message: string): void;
13
13
  export declare function logHeader(variant: Variant, { contentDir, name, outDir, version }: LogHeader): void;
14
+ export declare function logMessage(name: string, message: string): void;
14
15
  export declare function logUpdate(variant: Variant, { duration, filePath, name }: LogUpdate): void;
15
16
  export declare function setSilent(value: boolean): void;
16
17
  export {};
package/dist/utils/log.js CHANGED
@@ -25,6 +25,10 @@ function logHeader(variant, { contentDir, name, outDir, version }) {
25
25
  console.log(`\n ${green("➜")} ${bold(variant === "builder" ? "Building" : "Watching")}: ${dim(path.resolve(contentDir))}`);
26
26
  console.log(` ${green("➜")} ${bold("Output")}: ${dim(path.resolve(outDir))}\n`);
27
27
  }
28
+ function logMessage(name, message) {
29
+ if (silent) return;
30
+ console.log(`${formatPrefix(name)} ${message}`);
31
+ }
28
32
  function logUpdate(variant, { duration, filePath, name }) {
29
33
  if (silent) return;
30
34
  const action = variant === "builder" ? "built" : "rebuilt";
@@ -33,4 +37,4 @@ function logUpdate(variant, { duration, filePath, name }) {
33
37
  function setSilent(value) {
34
38
  silent = value;
35
39
  }
36
- export { logBuildSummary, logConfigPathNotFound, logDirNotFound, logError, logHeader, logUpdate, setSilent };
40
+ export { logBuildSummary, logConfigPathNotFound, logDirNotFound, logError, logHeader, logMessage, logUpdate, setSilent };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dephub/layer",
3
3
  "type": "module",
4
- "version": "1.0.0",
4
+ "version": "1.0.1",
5
5
  "description": "A tiny builder for transforming source content into typed, validated, and cache-aware layers — with first-class CLI, watcher, and programmatic APIs.",
6
6
  "types": "dist/index.d.ts",
7
7
  "main": "dist/index.js",