@content-collections/core 0.15.3 → 0.15.4

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.ts CHANGED
@@ -1071,6 +1071,7 @@ declare function createBuilder(configurationPath: string, options?: Options$1, e
1071
1071
  watch: () => Promise<{
1072
1072
  unsubscribe: () => Promise<void>;
1073
1073
  }>;
1074
+ watchPaths: () => string[];
1074
1075
  on: {
1075
1076
  <TKey extends "builder:start" | "builder:end" | "builder:created" | "watcher:file-changed" | "watcher:config-changed" | "watcher:config-reload-error" | "collector:read-error" | "collector:parse-error" | "transformer:validation-error" | "transformer:singleton-warning" | "transformer:result-error" | "transformer:error" | "transformer:document-skipped" | "watcher:subscribe-error" | "watcher:subscribed" | "watcher:unsubscribed">(key: TKey, listener: (event: Events[TKey]) => void): void;
1076
1077
  <TKey extends "_error" | "_all">(key: TKey, listener: (event: SystemEvents[TKey]) => void): void;
@@ -1082,6 +1083,7 @@ declare function createInternalBuilder(initialConfiguration: InternalConfigurati
1082
1083
  watch: () => Promise<{
1083
1084
  unsubscribe: () => Promise<void>;
1084
1085
  }>;
1086
+ watchPaths: () => string[];
1085
1087
  on: {
1086
1088
  <TKey extends "builder:start" | "builder:end" | "builder:created" | "watcher:file-changed" | "watcher:config-changed" | "watcher:config-reload-error" | "collector:read-error" | "collector:parse-error" | "transformer:validation-error" | "transformer:singleton-warning" | "transformer:result-error" | "transformer:error" | "transformer:document-skipped" | "watcher:subscribe-error" | "watcher:subscribed" | "watcher:unsubscribed">(key: TKey, listener: (event: Events[TKey]) => void): void;
1087
1089
  <TKey extends "_error" | "_all">(key: TKey, listener: (event: SystemEvents[TKey]) => void): void;
package/dist/index.js CHANGED
@@ -2287,11 +2287,14 @@ function createEmitter() {
2287
2287
 
2288
2288
  //#endregion
2289
2289
  //#region src/watcher.ts
2290
- async function createWatcher(emitter, baseDirectory, configuration, sync) {
2291
- const paths = removeChildPaths([...configuration.collections.map((collection) => {
2290
+ function resolveWatchPaths(baseDirectory, configuration) {
2291
+ return removeChildPaths([...configuration.collections.map((collection) => {
2292
2292
  const directory = isSingleton(collection) ? path.dirname(collection.filePath) : collection.directory;
2293
2293
  return path.join(baseDirectory, directory);
2294
2294
  }).map((p) => resolve(p)), ...configuration.inputPaths.map((p) => dirname(p))]);
2295
+ }
2296
+ async function createWatcher(emitter, baseDirectory, configuration, sync) {
2297
+ const paths = resolveWatchPaths(baseDirectory, configuration);
2295
2298
  function isInsideWatchPath(filePath, watchPath) {
2296
2299
  const relativePath = path.relative(watchPath, filePath);
2297
2300
  return relativePath !== "" && !relativePath.startsWith("..") && !path.isAbsolute(relativePath);
@@ -2439,6 +2442,7 @@ async function createInternalBuilder(initialConfiguration, baseDirectory, option
2439
2442
  build: () => build$1(context),
2440
2443
  sync,
2441
2444
  watch,
2445
+ watchPaths: () => resolveWatchPaths(baseDirectory, configuration),
2442
2446
  on: emitter.on
2443
2447
  };
2444
2448
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@content-collections/core",
3
3
  "type": "module",
4
- "version": "0.15.3",
4
+ "version": "0.15.4",
5
5
  "description": "Core of Content Collections",
6
6
  "author": "Sebastian Sdorra <s.sdorra@gmail.com>",
7
7
  "license": "MIT",