@ricsam/isolate-types 0.1.3 → 0.1.6
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 +12 -6
- package/dist/cjs/package.json +1 -1
- package/dist/mjs/package.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Type definitions and type-checking utilities for isolate user code.
|
|
4
4
|
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
5
7
|
```bash
|
|
6
8
|
npm add @ricsam/isolate-types
|
|
7
9
|
```
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
## Type Checking Isolate Code
|
|
10
12
|
|
|
11
13
|
Validate TypeScript/JavaScript code that will run inside the isolate before execution using `ts-morph`:
|
|
12
14
|
|
|
@@ -41,15 +43,15 @@ if (!result.success) {
|
|
|
41
43
|
}
|
|
42
44
|
```
|
|
43
45
|
|
|
44
|
-
|
|
46
|
+
## Options
|
|
45
47
|
|
|
46
48
|
| Option | Description |
|
|
47
49
|
|--------|-------------|
|
|
48
50
|
| `include` | Which package types to include: `"core"`, `"fetch"`, `"fs"`, `"console"`, `"encoding"`, `"timers"`, `"testEnvironment"` (default: `["core", "fetch", "fs"]`) |
|
|
49
51
|
| `compilerOptions` | Additional TypeScript compiler options |
|
|
50
|
-
| `libraryTypes` | External library type definitions for import resolution
|
|
52
|
+
| `libraryTypes` | External library type definitions for import resolution |
|
|
51
53
|
|
|
52
|
-
|
|
54
|
+
## Using with Tests
|
|
53
55
|
|
|
54
56
|
```typescript
|
|
55
57
|
import { describe, expect, test } from "node:test";
|
|
@@ -65,7 +67,7 @@ describe("Isolate code validation", () => {
|
|
|
65
67
|
});
|
|
66
68
|
```
|
|
67
69
|
|
|
68
|
-
|
|
70
|
+
## Type Definition Strings
|
|
69
71
|
|
|
70
72
|
The type definitions are exported as strings for custom use cases:
|
|
71
73
|
|
|
@@ -85,4 +87,8 @@ import {
|
|
|
85
87
|
|
|
86
88
|
// Use with your own ts-morph project
|
|
87
89
|
project.createSourceFile("isolate-globals.d.ts", FETCH_TYPES);
|
|
88
|
-
```
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## License
|
|
93
|
+
|
|
94
|
+
MIT
|
package/dist/cjs/package.json
CHANGED
package/dist/mjs/package.json
CHANGED