Skip to content

Commit b9a9402

Browse files
committed
feat(v3/runtime): export cancellable utilities
The package ships dist/cancellable.js and types/cancellable.d.ts, but the exhaustive exports map only lists "." and "./plugins/*", so `@wailsio/runtime/cancellable` fails with ERR_PACKAGE_PATH_NOT_EXPORTED. The root entry runs the runtime bootstrap and environment detection on import, so consumers that only want CancellablePromise, such as browser test infrastructure, have no side-effect-free import path. cancellable.js is absent from "sideEffects", so the standalone entry stays free of bootstrap side effects.
1 parent 623b529 commit b9a9402

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

‎v3/UNRELEASED_CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ After processing, the content will be moved to the main changelog and this file
1717

1818
## Added
1919
<!-- New features, capabilities, or enhancements -->
20+
- Expose the `@wailsio/runtime/cancellable` subpath export so `CancellablePromise` can be imported without evaluating the root runtime entry (#6153)
2021

2122
## Changed
2223
<!-- Changes in existing functionality -->

‎v3/internal/runtime/desktop/@wailsio/runtime/package.json‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
"./plugins/*": {
1313
"types": "./types/plugins/*.d.ts",
1414
"default": "./dist/plugins/*.js"
15+
},
16+
"./cancellable": {
17+
"types": "./types/cancellable.d.ts",
18+
"default": "./dist/cancellable.js"
1519
}
1620
},
1721
"repository": {
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { readFileSync } from "node:fs";
2+
import { describe, expect, it } from "vitest";
3+
4+
const packageJson = JSON.parse(readFileSync("package.json", "utf8"));
5+
6+
describe("@wailsio/runtime package exports", () => {
7+
it("exposes cancellable without loading the root runtime", () => {
8+
expect(packageJson.exports["./cancellable"]).toEqual({
9+
types: "./types/cancellable.d.ts",
10+
default: "./dist/cancellable.js",
11+
});
12+
});
13+
});

0 commit comments

Comments
 (0)