@content-collections/core 0.15.2 → 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 +2 -0
- package/dist/index.js +8 -4
- package/package.json +12 -12
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
|
@@ -9,7 +9,7 @@ import path2 from "path";
|
|
|
9
9
|
import { build } from "esbuild";
|
|
10
10
|
import { createRequire } from "module";
|
|
11
11
|
import { fileURLToPath } from "node:url";
|
|
12
|
-
import matter from "gray-matter";
|
|
12
|
+
import matter from "@11ty/gray-matter";
|
|
13
13
|
import { parse, stringify } from "yaml";
|
|
14
14
|
import camelcase from "camelcase";
|
|
15
15
|
import pluralize from "pluralize";
|
|
@@ -250,7 +250,7 @@ var loadTsConfigInternal = (dir = process.cwd(), name = "tsconfig.json", isExten
|
|
|
250
250
|
var loadTsConfig = (dir, name) => loadTsConfigInternal(dir, name);
|
|
251
251
|
|
|
252
252
|
//#endregion
|
|
253
|
-
//#region ../../node_modules/.pnpm/bundle-require@5.
|
|
253
|
+
//#region ../../node_modules/.pnpm/bundle-require@5.1.0_esbuild@0.25.12/node_modules/bundle-require/dist/index.js
|
|
254
254
|
var tsconfigPathsToRegExp = (paths) => {
|
|
255
255
|
return Object.keys(paths || {}).map((key) => {
|
|
256
256
|
return /* @__PURE__ */ new RegExp(`^${key.replace(/\*/, ".*")}$`);
|
|
@@ -2287,11 +2287,14 @@ function createEmitter() {
|
|
|
2287
2287
|
|
|
2288
2288
|
//#endregion
|
|
2289
2289
|
//#region src/watcher.ts
|
|
2290
|
-
|
|
2291
|
-
|
|
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.
|
|
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",
|
|
@@ -30,28 +30,28 @@
|
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/node": "^20.14.9",
|
|
33
|
-
"@types/picomatch": "^3.0.
|
|
33
|
+
"@types/picomatch": "^3.0.2",
|
|
34
34
|
"@types/pluralize": "^0.0.33",
|
|
35
35
|
"@types/serialize-javascript": "^5.0.4",
|
|
36
|
-
"@vitest/coverage-v8": "^4.
|
|
37
|
-
"bundle-require": "^5.
|
|
36
|
+
"@vitest/coverage-v8": "^4.1.11",
|
|
37
|
+
"bundle-require": "^5.1.0",
|
|
38
38
|
"tsdown": "^0.15.12",
|
|
39
39
|
"typescript": "^5.5.4",
|
|
40
|
-
"vitest": "^4.
|
|
40
|
+
"vitest": "^4.1.11",
|
|
41
41
|
"zod": "^4.1.11"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@
|
|
44
|
+
"@11ty/gray-matter": "^3.0.0",
|
|
45
|
+
"@standard-schema/spec": "^1.1.0",
|
|
45
46
|
"camelcase": "^8.0.0",
|
|
46
47
|
"chokidar": "^5.0.0",
|
|
47
48
|
"esbuild": "^0.25.11",
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"picomatch": "^4.0.4",
|
|
49
|
+
"p-limit": "^6.2.0",
|
|
50
|
+
"picomatch": "^4.0.7",
|
|
51
51
|
"pluralize": "^8.0.0",
|
|
52
|
-
"serialize-javascript": "^7.
|
|
53
|
-
"tinyglobby": "^0.2.
|
|
54
|
-
"yaml": "^2.
|
|
52
|
+
"serialize-javascript": "^7.1.1",
|
|
53
|
+
"tinyglobby": "^0.2.17",
|
|
54
|
+
"yaml": "^2.9.1"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"build": "tsdown",
|