Skip to content

Commit

Permalink
chore(release): Update release note
Browse files Browse the repository at this point in the history
  • Loading branch information
tommy351 committed Mar 20, 2024
1 parent fe88dcc commit 98a9106
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 21 deletions.
15 changes: 0 additions & 15 deletions .changeset/breezy-cobras-joke.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,3 @@
---

Add `validateAllManifests` option to `generate` function. You can use this option to run a custom validation function for all manifests. This function will be called after all manifests are resolved.

```ts
generate(values, {
validateAllManifests(manifests) {
for (const manifest of manifests) {
if (!manifest.metadata.namespace) {
manifest.report({
severity: "error",
message: "Namespace is required"
});
}
}
}
});
```
2 changes: 1 addition & 1 deletion .changeset/famous-shirts-train.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"@kosko/require": minor
---

Add `resolveModule` function.
Add `resolveModule` function. This function supports both module name and path resolution. Unlike `resolvePath` function which only supports path resolution.
12 changes: 8 additions & 4 deletions .changeset/hot-ants-enjoy.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@

Add `validateManifest` option to `generate` and `resolve` function. You can use this option to run a custom validation function for each manifest. This function will be called after the `transform` function and the `validate` method of a manifest.

The following example shows how to use this option to validate that a manifest has a namespace.

```ts
resolve(values, {
validateManifest(manifest) {
manifest.report({
severity: "error",
message: "This is an error message"
});
if (!manifest.metadata.namespace) {
manifest.report({
severity: "error",
message: "Namespace is required"
});
}
}
});
```
20 changes: 19 additions & 1 deletion .changeset/sharp-oranges-relax.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,22 @@
"@kosko/generate": major
---

`path` and `index` properties are replaced by `position` property in `Manifest` type, `ResolveErrorOptions` type and `ResolveError` class.
`path` and `index` properties are replaced by `position` property in `Manifest` type, `ResolveErrorOptions` type and `ResolveError` class.'

```ts
// Before
{
path: string;
index: number[];
data: unknown;
}

// After
{
position: {
path: string;
index: number[];
};
data: unknown;
}
```

0 comments on commit 98a9106

Please sign in to comment.