@lowerdeck/execution-context 1.0.0 → 1.0.1
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/.turbo/turbo-build.log +24 -9
- package/CHANGELOG.md +9 -0
- package/README.md +56 -0
- package/package.json +2 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,11 +1,26 @@
|
|
|
1
1
|
|
|
2
2
|
[0m[2m[35m$[0m [2m[1mmicrobundle[0m
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
Failed to resolve the module async_hooks imported by src/with-execution-context.ts
|
|
4
|
+
Is the module installed? Note:
|
|
5
|
+
↳ to inline a module into your bundle, install it to "devDependencies".
|
|
6
|
+
↳ to depend on a module via import/require, install it to "dependencies".
|
|
7
|
+
Failed to resolve the module async_hooks imported by src/with-execution-context.ts
|
|
8
|
+
Is the module installed? Note:
|
|
9
|
+
↳ to inline a module into your bundle, install it to "devDependencies".
|
|
10
|
+
↳ to depend on a module via import/require, install it to "dependencies".
|
|
11
|
+
Failed to resolve the module async_hooks imported by src/with-execution-context.ts
|
|
12
|
+
Is the module installed? Note:
|
|
13
|
+
↳ to inline a module into your bundle, install it to "devDependencies".
|
|
14
|
+
↳ to depend on a module via import/require, install it to "dependencies".
|
|
15
|
+
No name was provided for external module '@lowerdeck/id' in output.globals – guessing 'id'
|
|
16
|
+
No name was provided for external module '@lowerdeck/sentry' in output.globals – guessing 'sentry'
|
|
17
|
+
No name was provided for external module 'async_hooks' in output.globals – guessing 'async_hooks'
|
|
18
|
+
[34mBuild "@lowerdeck/execution-context" to dist:[39m
|
|
19
|
+
[32m589 B[39m: [37mindex.cjs[39m.gz
|
|
20
|
+
[32m507 B[39m: [37mindex.cjs[39m.br
|
|
21
|
+
[32m555 B[39m: [37mindex.module.js[39m.gz
|
|
22
|
+
[32m488 B[39m: [37mindex.module.js[39m.br
|
|
23
|
+
[32m610 B[39m: [37mindex.module.js[39m.gz
|
|
24
|
+
[32m528 B[39m: [37mindex.module.js[39m.br
|
|
25
|
+
[32m691 B[39m: [37mindex.umd.js[39m.gz
|
|
26
|
+
[32m590 B[39m: [37mindex.umd.js[39m.br
|
package/CHANGELOG.md
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# `@lowerdeck/execution-context`
|
|
2
|
+
|
|
3
|
+
Track and manage execution context for requests, scheduled jobs, and background tasks. Provides type-safe context objects for different execution environments with support for parent-child relationships.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @lowerdeck/execution-context
|
|
9
|
+
yarn add @lowerdeck/execution-context
|
|
10
|
+
bun add @lowerdeck/execution-context
|
|
11
|
+
pnpm add @lowerdeck/execution-context
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import { createExecutionContext, ExecutionContext } from '@lowerdeck/execution-context';
|
|
18
|
+
|
|
19
|
+
// Create context for an HTTP request
|
|
20
|
+
const requestContext = createExecutionContext({
|
|
21
|
+
type: 'request',
|
|
22
|
+
userId: 'user_123',
|
|
23
|
+
ip: '192.168.1.1',
|
|
24
|
+
userAgent: 'Mozilla/5.0...'
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
// Create context for a scheduled job
|
|
28
|
+
const cronContext = createExecutionContext({
|
|
29
|
+
type: 'scheduled',
|
|
30
|
+
cron: '0 0 * * *',
|
|
31
|
+
name: 'daily-cleanup'
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// Create context for a queue job
|
|
35
|
+
const jobContext = createExecutionContext({
|
|
36
|
+
type: 'job',
|
|
37
|
+
queue: 'emails'
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// Nest contexts with parent relationships
|
|
41
|
+
const childContext = createExecutionContext({
|
|
42
|
+
type: 'job',
|
|
43
|
+
queue: 'notifications',
|
|
44
|
+
parent: requestContext
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
console.log(childContext.contextId); // Auto-generated ID
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## License
|
|
51
|
+
|
|
52
|
+
This project is licensed under the Apache License 2.0.
|
|
53
|
+
|
|
54
|
+
<div align="center">
|
|
55
|
+
<sub>Built with ❤️ by <a href="https://metorial.com">Metorial</a></sub>
|
|
56
|
+
</div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowerdeck/execution-context",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@lowerdeck/id": "^1.0.0",
|
|
28
|
-
"@lowerdeck/sentry": "^1.0.
|
|
28
|
+
"@lowerdeck/sentry": "^1.0.1"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"microbundle": "^0.15.1",
|