@ontrails/library 1.0.0-beta.43 → 1.0.0-beta.46

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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @ontrails/library
2
2
 
3
+ ## 1.0.0-beta.46
4
+
5
+ ## 1.0.0-beta.45
6
+
7
+ ### Patch Changes
8
+
9
+ - [`f9533a4`](https://github.com/outfitter-dev/trails/commit/f9533a4ef7392201c71d7f751361b4f7177eeacb): Keep public error projection shared and redacted while using transport-neutral CLI vocabulary and preserving safe topo diagnostics in structured output.
10
+
11
+ ## 1.0.0-beta.44
12
+
13
+ ### Patch Changes
14
+
15
+ - [`b1fbe57`](https://github.com/outfitter-dev/trails/commit/b1fbe574e6f44d1fecb5e3a000270955c0a77b7b): Publish Bun-validated package tarballs through an npm trusted-publishing adapter
16
+ binding, add exact repository metadata for each public workspace package, and
17
+ correct the native Bun release descriptor to its pack-only runtime boundary.
18
+
3
19
  ## 1.0.0-beta.43
4
20
 
5
21
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,11 @@
1
1
  {
2
2
  "name": "@ontrails/library",
3
- "version": "1.0.0-beta.43",
3
+ "version": "1.0.0-beta.46",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "git+https://github.com/outfitter-dev/trails.git",
7
+ "directory": "packages/library"
8
+ },
4
9
  "files": [
5
10
  "src/**/*.ts",
6
11
  "!src/**/__tests__/**",
@@ -22,10 +27,10 @@
22
27
  "clean": "rm -rf dist *.tsbuildinfo"
23
28
  },
24
29
  "dependencies": {
25
- "@ontrails/core": "^1.0.0-beta.43"
30
+ "@ontrails/core": "^1.0.0-beta.46"
26
31
  },
27
32
  "devDependencies": {
28
- "@ontrails/testing": "^1.0.0-beta.43"
33
+ "@ontrails/testing": "^1.0.0-beta.46"
29
34
  },
30
35
  "peerDependencies": {
31
36
  "zod": "^4.3.5"
package/src/errors.ts CHANGED
@@ -1,11 +1,10 @@
1
1
  /* oxlint-disable max-classes-per-file -- package-facing error taxonomy stays co-located */
2
2
  import {
3
- INTERNAL_ERROR_PUBLIC_MESSAGE,
4
3
  createSurfaceErrorMapper,
5
4
  isTrailsError,
6
- redactErrorString,
5
+ renderPublicError,
7
6
  } from '@ontrails/core';
8
- import type { ErrorCategory, TrailsError } from '@ontrails/core';
7
+ import type { ErrorCategory } from '@ontrails/core';
9
8
 
10
9
  export interface LibraryErrorOptions {
11
10
  readonly cause?: Error | undefined;
@@ -171,25 +170,21 @@ const libraryErrorClasses = {
171
170
 
172
171
  const mapLibraryErrorClass = createSurfaceErrorMapper(libraryErrorClasses);
173
172
 
174
- const publicMessage = (error: TrailsError): string =>
175
- error.category === 'internal'
176
- ? INTERNAL_ERROR_PUBLIC_MESSAGE
177
- : redactErrorString(error.message);
178
-
179
173
  export const toLibraryError = (error: Error): LibraryError => {
180
174
  if (error instanceof LibraryError) {
181
175
  return error;
182
176
  }
183
177
 
178
+ const rendering = renderPublicError(error);
184
179
  if (!isTrailsError(error)) {
185
- return new LibraryInternalError(INTERNAL_ERROR_PUBLIC_MESSAGE, {
180
+ return new LibraryInternalError(rendering.message, {
186
181
  cause: error,
187
182
  originalName: error.name || 'Error',
188
183
  });
189
184
  }
190
185
 
191
186
  const ErrorClass = mapLibraryErrorClass(error);
192
- return new ErrorClass(publicMessage(error), {
187
+ return new ErrorClass(rendering.message, {
193
188
  cause: error,
194
189
  originalName: error.name,
195
190
  });