@content-collections/integrations 0.4.0 → 0.5.0

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.
@@ -1,16 +1,16 @@
1
1
 
2
- > @content-collections/integrations@0.4.0 build /home/runner/work/content-collections/content-collections/packages/integrations
2
+ > @content-collections/integrations@0.5.0 build /home/runner/work/content-collections/content-collections/packages/integrations
3
3
  > tsdown src/index.ts --format esm,cjs --dts -d dist
4
4
 
5
5
  ℹ tsdown v0.15.12 powered by rolldown v1.0.0-beta.45
6
6
  ℹ entry: src/index.ts
7
7
  ℹ tsconfig: tsconfig.json
8
8
  ℹ Build start
9
- ℹ [CJS] dist/index.cjs 3.16 kB │ gzip: 1.14 kB
10
- ℹ [CJS] 1 files, total: 3.16 kB
11
- ℹ [ESM] dist/index.js 2.07 kB │ gzip: 0.71 kB
9
+ ℹ [CJS] dist/index.cjs 3.46 kB │ gzip: 1.24 kB
10
+ ℹ [CJS] 1 files, total: 3.46 kB
11
+ ℹ [ESM] dist/index.js 2.37 kB │ gzip: 0.80 kB
12
12
  ℹ [ESM] dist/index.d.ts 0.26 kB │ gzip: 0.19 kB
13
- ℹ [ESM] 2 files, total: 2.33 kB
13
+ ℹ [ESM] 2 files, total: 2.63 kB
14
14
  ℹ [CJS] dist/index.d.cts 0.26 kB │ gzip: 0.19 kB
15
15
  ℹ [CJS] 1 files, total: 0.26 kB
16
- ✔ Build complete in 1091ms
16
+ ✔ Build complete in 1154ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @content-collections/integrations
2
2
 
3
+ ## 0.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#708](https://github.com/sdorra/content-collections/pull/708) [`9d68701`](https://github.com/sdorra/content-collections/commit/9d68701de6244d5a2dd9c8e87cb1441f151ec148) Thanks [@ExpensiveKoala](https://github.com/ExpensiveKoala)! - Support for singletons #300
8
+
3
9
  ## 0.4.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -30,9 +30,15 @@ function isUnknownError(event) {
30
30
  return !handledErrors.includes(event);
31
31
  }
32
32
  function registerErrorListeners(builder) {
33
+ builder.on("transformer:singleton-warning", (event) => {
34
+ console.log();
35
+ console.log(`Singleton collection "${event.collection.name}" matched no documents. Export will be undefined.`);
36
+ console.log();
37
+ });
33
38
  builder.on("transformer:validation-error", (event) => {
34
39
  console.log();
35
- console.log("Validation failed on", node_path.default.join(event.collection.directory, event.file.path) + ":");
40
+ const location = "filePath" in event.collection ? event.collection.filePath : node_path.default.join(event.collection.directory, event.file.path);
41
+ console.log("Validation failed on", location + ":");
36
42
  console.log(event.error.message);
37
43
  console.log();
38
44
  });
package/dist/index.js CHANGED
@@ -6,9 +6,15 @@ function isUnknownError(event) {
6
6
  return !handledErrors.includes(event);
7
7
  }
8
8
  function registerErrorListeners(builder) {
9
+ builder.on("transformer:singleton-warning", (event) => {
10
+ console.log();
11
+ console.log(`Singleton collection "${event.collection.name}" matched no documents. Export will be undefined.`);
12
+ console.log();
13
+ });
9
14
  builder.on("transformer:validation-error", (event) => {
10
15
  console.log();
11
- console.log("Validation failed on", path.join(event.collection.directory, event.file.path) + ":");
16
+ const location = "filePath" in event.collection ? event.collection.filePath : path.join(event.collection.directory, event.file.path);
17
+ console.log("Validation failed on", location + ":");
12
18
  console.log(event.error.message);
13
19
  console.log();
14
20
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@content-collections/integrations",
3
3
  "type": "module",
4
- "version": "0.4.0",
4
+ "version": "0.5.0",
5
5
  "description": "Utils for integrating Content Collections with other tools",
6
6
  "author": "Sebastian Sdorra <s.sdorra@gmail.com>",
7
7
  "license": "MIT",
@@ -27,7 +27,7 @@
27
27
  "@types/node": "20",
28
28
  "tsdown": "^0.15.12",
29
29
  "typescript": "^5.5.4",
30
- "@content-collections/core": "0.13.0"
30
+ "@content-collections/core": "0.14.0"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@content-collections/core": "0.x"
package/src/errors.ts CHANGED
@@ -8,12 +8,19 @@ export function isUnknownError(event: string) {
8
8
  }
9
9
 
10
10
  export function registerErrorListeners(builder: Builder) {
11
+ builder.on("transformer:singleton-warning", (event) => {
12
+ console.log();
13
+ console.log(`Singleton collection "${event.collection.name}" matched no documents. Export will be undefined.`);
14
+ console.log();
15
+ });
16
+
11
17
  builder.on("transformer:validation-error", (event) => {
12
18
  console.log();
13
- console.log(
14
- "Validation failed on",
15
- path.join(event.collection.directory, event.file.path) + ":",
16
- );
19
+ const location =
20
+ "filePath" in (event.collection as any)
21
+ ? (event.collection as any).filePath
22
+ : path.join((event.collection as any).directory, event.file.path);
23
+ console.log("Validation failed on", location + ":");
17
24
  console.log(event.error.message);
18
25
  console.log();
19
26
  });