edge-functions 4.0.1 → 4.1.0
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
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## [4.1.0](https://github.com/aziontech/bundler/compare/v4.0.1...v4.1.0) (2024-10-02)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* add FetchEventContext class to handle event initialization and args loading ([063c8a5](https://github.com/aziontech/bundler/commit/063c8a59b0cd7e3099038098704a7e1968b27bea))
|
|
7
|
+
* add FetchEventContext class to handle event initialization and args loading ([#392](https://github.com/aziontech/bundler/issues/392)) ([cad66e4](https://github.com/aziontech/bundler/commit/cad66e4ce906072b5981eca07c6e1388bec3fd01))
|
|
8
|
+
|
|
9
|
+
## [4.1.0-stage.1](https://github.com/aziontech/bundler/compare/v4.0.1...v4.1.0-stage.1) (2024-10-02)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* add FetchEventContext class to handle event initialization and args loading ([063c8a5](https://github.com/aziontech/bundler/commit/063c8a59b0cd7e3099038098704a7e1968b27bea))
|
|
15
|
+
* add FetchEventContext class to handle event initialization and args loading ([#392](https://github.com/aziontech/bundler/issues/392)) ([cad66e4](https://github.com/aziontech/bundler/commit/cad66e4ce906072b5981eca07c6e1388bec3fd01))
|
|
16
|
+
|
|
1
17
|
### [4.0.1](https://github.com/aziontech/bundler/compare/v4.0.0...v4.0.1) (2024-09-30)
|
|
2
18
|
|
|
3
19
|
|
package/README.md
CHANGED
|
@@ -9,7 +9,6 @@ One of the key highlights of Azion Bundler is its ability to establish an intuit
|
|
|
9
9
|
E2E tests run daily in the [Vulcan Examples](https://github.com/aziontech/vulcan-examples/tree/main/examples) to ensure that the presets and frameworks continue to work correctly.
|
|
10
10
|
|
|
11
11
|
Table:
|
|
12
|
-
|
|
13
12
|
| Test | Status |
|
|
14
13
|
| ------------------------------------ | ------ |
|
|
15
14
|
| Next 13 5 6 I18n | ✅ |
|
|
@@ -18,15 +17,15 @@ Table:
|
|
|
18
17
|
| Next 13 5 6 Middleware | ✅ |
|
|
19
18
|
| Next 12 3 4 Middleware | ✅ |
|
|
20
19
|
| Next Node Pages 12 3 1 | ✅ |
|
|
21
|
-
| Next 13 5 6 Config |
|
|
20
|
+
| Next 13 5 6 Config | ✅ |
|
|
22
21
|
| Next 12 3 4 Config | ✅ |
|
|
23
22
|
| Next Static | ✅ |
|
|
24
23
|
| Gatsby Static | ✅ |
|
|
25
24
|
| Next Node Pages 12 3 1 Fs | ✅ |
|
|
26
25
|
| Vue Vite Static | ✅ |
|
|
27
26
|
| Next 12 Static | ✅ |
|
|
28
|
-
| Simple Js Env Vars | ✅ |
|
|
29
27
|
| Astro Static | ✅ |
|
|
28
|
+
| Simple Js Env Vars | ✅ |
|
|
30
29
|
| Eleventy Static | ✅ |
|
|
31
30
|
| React Static | ✅ |
|
|
32
31
|
| Angular Static | ✅ |
|
|
@@ -37,13 +36,12 @@ Table:
|
|
|
37
36
|
| Simple Js Firewall Event | ✅ |
|
|
38
37
|
| Simple Js Network List With Firewall | ✅ |
|
|
39
38
|
| Jekyll Static | ✅ |
|
|
40
|
-
| Simple Js Esm
|
|
39
|
+
| Simple Js Esm Worker | ✅ |
|
|
41
40
|
| Simple Js Esm Node | ✅ |
|
|
42
|
-
| Simple Js Esm | ✅ |
|
|
43
41
|
| Simple Ts Esm | ✅ |
|
|
42
|
+
| Simple Js Esm | ✅ |
|
|
44
43
|
|
|
45
|
-
Last test run date:
|
|
46
|
-
|
|
44
|
+
Last test run date: 10/02/24 03:35:49 AM
|
|
47
45
|
## Quick Installation
|
|
48
46
|
|
|
49
47
|
For those who just want to use Azion Bundler in their project without contributing to the development, you can install it directly from npm.
|
|
@@ -1,9 +1,21 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'fs';
|
|
2
|
+
import { join } from 'path';
|
|
1
3
|
import primitives from '@edge-runtime/primitives';
|
|
2
4
|
import { feedback } from '#utils';
|
|
3
5
|
|
|
4
6
|
class FetchEventContext extends primitives.FetchEvent {
|
|
5
|
-
constructor(
|
|
6
|
-
super(
|
|
7
|
+
constructor(type, eventInitDict) {
|
|
8
|
+
super(type, eventInitDict);
|
|
9
|
+
const argsPathEnv = globalThis.vulcan.argsPath || 'azion/args.json';
|
|
10
|
+
const argsPath = join(process.cwd(), argsPathEnv);
|
|
11
|
+
if (existsSync(argsPath)) {
|
|
12
|
+
try {
|
|
13
|
+
const args = JSON.parse(readFileSync(argsPath, 'utf8'));
|
|
14
|
+
this.args = args || {};
|
|
15
|
+
} catch (error) {
|
|
16
|
+
feedback.server.error(`Error reading args.json: ${error.message}`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
7
19
|
this.console = {
|
|
8
20
|
log: (log) => feedback.server.log(log),
|
|
9
21
|
};
|
package/lib/main.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "edge-functions",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.0
|
|
4
|
+
"version": "4.1.0",
|
|
5
5
|
"description": "Tool to launch and build JavaScript/Frameworks. This tool automates polyfills for Edge Computing and assists in creating Workers, notably for the Azion platform.",
|
|
6
6
|
"main": "lib/main.js",
|
|
7
7
|
"bin": {
|