@fastly/compute-js-context 0.5.0 → 0.5.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/CHANGELOG.md +8 -1
- package/README.md +2 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.5.1] - 2025-10-14
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Updated README
|
|
15
|
+
|
|
10
16
|
## [0.5.0] - 2025-10-14
|
|
11
17
|
|
|
12
18
|
### Changed
|
|
@@ -35,7 +41,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
35
41
|
|
|
36
42
|
- Initial public release
|
|
37
43
|
|
|
38
|
-
[unreleased]: https://github.com/fastly/compute-js-context/compare/v0.5.
|
|
44
|
+
[unreleased]: https://github.com/fastly/compute-js-context/compare/v0.5.1...HEAD
|
|
45
|
+
[0.5.1]: https://github.com/fastly/compute-js-context/compare/v0.5.0...v0.5.1
|
|
39
46
|
[0.5.0]: https://github.com/fastly/compute-js-context/compare/v0.4.2...v0.5.0
|
|
40
47
|
[0.4.2]: https://github.com/fastly/compute-js-context/compare/v0.4.1...v0.4.2
|
|
41
48
|
[0.4.1]: https://github.com/fastly/compute-js-context/compare/v0.2.0...v0.4.1
|
package/README.md
CHANGED
|
@@ -80,7 +80,7 @@ Then, pass these definitions to `buildContextProxy()`.
|
|
|
80
80
|
|
|
81
81
|
```typescript
|
|
82
82
|
/// <reference types="@fastly/js-compute" />
|
|
83
|
-
import {
|
|
83
|
+
import { buildContextProxy, type BindingsDefs } from '@fastly/compute-js-context';
|
|
84
84
|
|
|
85
85
|
// Define your application's bindings
|
|
86
86
|
const bindingsDefs = {
|
|
@@ -99,10 +99,8 @@ type Bindings = ContextProxy<typeof bindingsDefs>;
|
|
|
99
99
|
|
|
100
100
|
addEventListener('fetch', (event) => event.respondWith(handler(event)));
|
|
101
101
|
async function handler(event: FetchEvent): Promise<Response> {
|
|
102
|
-
const ctx = createContext();
|
|
103
|
-
|
|
104
102
|
// Create the typed environment
|
|
105
|
-
const bindings: Bindings = buildContextProxy(
|
|
103
|
+
const bindings: Bindings = buildContextProxy(bindingsDefs);
|
|
106
104
|
|
|
107
105
|
// Now use your custom bindings!
|
|
108
106
|
const asset = await bindings.assets?.get('/index.html');
|