@content-collections/core 0.8.0 → 0.8.2

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/README.md CHANGED
@@ -27,7 +27,7 @@ Content Collections offers a variety of adapters that seamlessly integrate with
27
27
  - [Next.js](https://www.content-collections.dev/docs/quickstart/next)
28
28
  - [Qwik](https://www.content-collections.dev/docs/quickstart/qwik)
29
29
  - [Remix (Vite)](https://www.content-collections.dev/docs/quickstart/remix-vite)
30
- - [Solid Start](https://www.content-collections.dev/docs/quickstart/solid)
30
+ - [Solid Start](https://www.content-collections.dev/docs/quickstart/solid-start)
31
31
  - [SvelteKit](https://www.content-collections.dev/docs/quickstart/svelte-kit)
32
32
  - [Vite](https://www.content-collections.dev/docs/quickstart/vite)
33
33
 
package/dist/index.d.ts CHANGED
@@ -1,7 +1,10 @@
1
1
  import z__default, { ZodRawShape, z as z$1, ZodObject, ZodTypeAny, ZodString } from 'zod';
2
2
  export * from 'zod';
3
3
 
4
- type CacheFn = <TInput, TOutput>(input: TInput, compute: (input: TInput) => Promise<TOutput> | TOutput) => Promise<TOutput>;
4
+ type Options$2 = {
5
+ key: string;
6
+ };
7
+ type CacheFn = <TInput, TOutput>(input: TInput, compute: (input: TInput) => Promise<TOutput> | TOutput, options?: Options$2) => Promise<TOutput>;
5
8
 
6
9
  declare const importSymbol: unique symbol;
7
10
  type Import<T> = {
package/dist/index.js CHANGED
@@ -6,8 +6,8 @@ import { createHash } from "node:crypto";
6
6
  import { existsSync } from "node:fs";
7
7
  import { mkdir, readFile, unlink, writeFile } from "node:fs/promises";
8
8
  import path, { join } from "node:path";
9
- function createKey(config, input) {
10
- return createHash("sha256").update(config).update(JSON.stringify(input)).digest("hex");
9
+ function createKey(config, input, key) {
10
+ return createHash("sha256").update(config).update(JSON.stringify(input)).update(key).digest("hex");
11
11
  }
12
12
  async function createCacheDirectory(directory) {
13
13
  const cacheDirectory = path.join(directory, ".content-collections", "cache");
@@ -55,8 +55,8 @@ async function createCacheManager(baseDirectory, configChecksum) {
55
55
  collectionMapping[file] = fileMapping;
56
56
  }
57
57
  let newFileMapping = [];
58
- const cacheFn = async (input, fn) => {
59
- const key = createKey(configChecksum, input);
58
+ const cacheFn = async (input, fn, options) => {
59
+ const key = createKey(configChecksum, input, options?.key || "");
60
60
  newFileMapping.push(key);
61
61
  const filePath = join(directory, `${key}.cache`);
62
62
  if (fileMapping?.includes(key) || newFileMapping.includes(key)) {
@@ -741,7 +741,7 @@ import { existsSync as existsSync2 } from "node:fs";
741
741
  import fs3 from "node:fs/promises";
742
742
  import path7 from "node:path";
743
743
 
744
- // ../../node_modules/.pnpm/bundle-require@5.0.0_esbuild@0.21.4/node_modules/bundle-require/dist/index.js
744
+ // ../../node_modules/.pnpm/bundle-require@5.0.0_esbuild@0.25.0/node_modules/bundle-require/dist/index.js
745
745
  import {
746
746
  build as build2,
747
747
  context
@@ -918,7 +918,7 @@ var loadTsConfigInternal = (dir = process.cwd(), name = "tsconfig.json", isExten
918
918
  };
919
919
  var loadTsConfig = (dir, name) => loadTsConfigInternal(dir, name);
920
920
 
921
- // ../../node_modules/.pnpm/bundle-require@5.0.0_esbuild@0.21.4/node_modules/bundle-require/dist/index.js
921
+ // ../../node_modules/.pnpm/bundle-require@5.0.0_esbuild@0.25.0/node_modules/bundle-require/dist/index.js
922
922
  var tsconfigPathsToRegExp = (paths) => {
923
923
  return Object.keys(paths || {}).map((key) => {
924
924
  return new RegExp(`^${key.replace(/\*/, ".*")}$`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@content-collections/core",
3
- "version": "0.8.0",
3
+ "version": "0.8.2",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -33,7 +33,7 @@
33
33
  "dependencies": {
34
34
  "@parcel/watcher": "^2.4.1",
35
35
  "camelcase": "^8.0.0",
36
- "esbuild": "^0.21.4",
36
+ "esbuild": "^0.25.0",
37
37
  "gray-matter": "^4.0.3",
38
38
  "p-limit": "^6.1.0",
39
39
  "picomatch": "^4.0.2",