@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.
@@ -1,11 +1,26 @@
1
1
 
2
2
  $ microbundle
3
- Build "@lowerdeck/unique" to dist:
4
- 77 B: index.cjs.gz
5
- 58 B: index.cjs.br
6
- 66 B: index.module.js.gz
7
- 50 B: index.module.js.br
8
- 88 B: index.module.js.gz
9
- 72 B: index.module.js.br
10
- 170 B: index.umd.js.gz
11
- 137 B: index.umd.js.br
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
+ Build "@lowerdeck/execution-context" to dist:
19
+ 589 B: index.cjs.gz
20
+ 507 B: index.cjs.br
21
+ 555 B: index.module.js.gz
22
+ 488 B: index.module.js.br
23
+ 610 B: index.module.js.gz
24
+ 528 B: index.module.js.br
25
+ 691 B: index.umd.js.gz
26
+ 590 B: index.umd.js.br
package/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+ # @lowerdeck/execution-context
2
+
3
+ ## 1.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - add readmes
8
+ - Updated dependencies
9
+ - @lowerdeck/sentry@1.0.1
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.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.0"
28
+ "@lowerdeck/sentry": "^1.0.1"
29
29
  },
30
30
  "devDependencies": {
31
31
  "microbundle": "^0.15.1",