@content-collections/core 0.15.0 → 0.15.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.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +16 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -913,7 +913,7 @@ type InvalidReturnType<TMessage extends string, TObject> = {
|
|
|
913
913
|
[InvalidReturnTypeSymbol]: TMessage;
|
|
914
914
|
object: TObject;
|
|
915
915
|
};
|
|
916
|
-
type ResolveImports<TTransformResult> = TTransformResult extends Import<any> ? GetTypeOfImport<TTransformResult> : TTransformResult extends Array<infer U> ? Array<ResolveImports<U>> : TTransformResult extends ((...args: any[]) => any) ? TTransformResult : TTransformResult extends object ? { [K in keyof TTransformResult]: ResolveImports<TTransformResult[K]> } : TTransformResult;
|
|
916
|
+
type ResolveImports<TTransformResult> = TTransformResult extends Import<any> ? GetTypeOfImport<TTransformResult> : TTransformResult extends Array<infer U> ? Array<ResolveImports<U>> : TTransformResult extends ((...args: any[]) => any) ? TTransformResult : TTransformResult extends (Date | RegExp | Map<any, any> | Set<any> | WeakMap<any, any> | WeakSet<any> | Promise<any>) ? TTransformResult : TTransformResult extends object ? { [K in keyof TTransformResult]: ResolveImports<TTransformResult[K]> } : TTransformResult;
|
|
917
917
|
declare function defineCollection<TName extends string, TShape extends TSchemaProp, TParser extends ConfiguredParser = "frontmatter", TSchema$1 = Schema<TParser, TShape>, TTransformResult = never, TDocument$1 = ([TTransformResult] extends [never] ? Schema<TParser, TShape> : Exclude<Awaited<TTransformResult>, SkippedSignal>), TResult = (TDocument$1 extends Serializable ? Collection<TName, TShape, TParser, TSchema$1, TTransformResult, ResolveImports<TDocument$1>> : InvalidReturnType<NotSerializableError, TDocument$1>)>(collection: CollectionRequest<TName, TShape, TParser, TSchema$1, TTransformResult, TDocument$1>): TResult;
|
|
918
918
|
declare function defineSingleton<TName extends string, TShape extends TSchemaProp, TParser extends ConfiguredParser = "frontmatter", TSchema$1 = Schema<TParser, TShape>, TTransformResult = never, TDocument$1 = ([TTransformResult] extends [never] ? Schema<TParser, TShape> : Exclude<Awaited<TTransformResult>, SkippedSignal>), TResult = (TDocument$1 extends Serializable ? Singleton<TName, TShape, TParser, TSchema$1, TTransformResult, ResolveImports<TDocument$1>> : InvalidReturnType<NotSerializableError, TDocument$1>)>(singleton: SingletonRequest<TName, TShape, TParser, TSchema$1, TTransformResult, TDocument$1>): TResult;
|
|
919
919
|
type Cache = "memory" | "file" | "none";
|
package/dist/index.js
CHANGED
|
@@ -2292,8 +2292,23 @@ async function createWatcher(emitter, baseDirectory, configuration, sync) {
|
|
|
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
|
+
function isInsideWatchPath(filePath, watchPath) {
|
|
2296
|
+
const relativePath = path.relative(watchPath, filePath);
|
|
2297
|
+
return relativePath !== "" && !relativePath.startsWith("..") && !path.isAbsolute(relativePath);
|
|
2298
|
+
}
|
|
2299
|
+
function isHiddenInWatchedTree(filePath) {
|
|
2300
|
+
return paths.some((watchPath) => {
|
|
2301
|
+
if (!isInsideWatchPath(filePath, watchPath)) return false;
|
|
2302
|
+
const relativePath = path.relative(watchPath, filePath);
|
|
2303
|
+
return /(^|[\/\\])\./.test(relativePath);
|
|
2304
|
+
});
|
|
2305
|
+
}
|
|
2295
2306
|
const watcher = chokidar.watch(paths, {
|
|
2296
|
-
ignored:
|
|
2307
|
+
ignored: (filePath) => {
|
|
2308
|
+
const absolutePath = resolve(filePath);
|
|
2309
|
+
if (/(^|[\/\\])node_modules([\/\\]|$)/.test(absolutePath)) return true;
|
|
2310
|
+
return isHiddenInWatchedTree(absolutePath);
|
|
2311
|
+
},
|
|
2297
2312
|
persistent: true,
|
|
2298
2313
|
ignoreInitial: true
|
|
2299
2314
|
});
|
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.1",
|
|
5
5
|
"description": "Core of Content Collections",
|
|
6
6
|
"author": "Sebastian Sdorra <s.sdorra@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -47,11 +47,11 @@
|
|
|
47
47
|
"esbuild": "^0.25.11",
|
|
48
48
|
"gray-matter": "^4.0.3",
|
|
49
49
|
"p-limit": "^6.1.0",
|
|
50
|
-
"picomatch": "^4.0.
|
|
50
|
+
"picomatch": "^4.0.4",
|
|
51
51
|
"pluralize": "^8.0.0",
|
|
52
|
-
"serialize-javascript": "^7.0.
|
|
52
|
+
"serialize-javascript": "^7.0.5",
|
|
53
53
|
"tinyglobby": "^0.2.5",
|
|
54
|
-
"yaml": "^2.
|
|
54
|
+
"yaml": "^2.8.3"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"build": "tsdown",
|