edge-functions 1.7.1 → 2.0.0-stage.2
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/.prettierignore +4 -0
- package/CHANGELOG.md +78 -29
- package/CODE_OF_CONDUCT.md +11 -11
- package/CONTRIBUTING.md +6 -5
- package/LICENSE.md +1 -1
- package/README.md +125 -30
- package/aliases.js +2 -0
- package/docs/overview.md +14 -7
- package/docs/presets.md +40 -63
- package/jsconfig.json +15 -37
- package/jsdoc.json +7 -7
- package/lib/build/bundlers/esbuild/esbuild.config.js +9 -2
- package/lib/build/bundlers/esbuild/index.js +21 -8
- package/lib/build/bundlers/esbuild/plugins/node-polyfills/index.js +10 -12
- package/lib/build/bundlers/esbuild/plugins/node-polyfills/node-polyfills-paths.js +1 -3
- package/lib/build/bundlers/webpack/index.js +34 -3
- package/lib/build/bundlers/webpack/webpack.config.js +3 -1
- package/lib/build/dispatcher/dispatcher.js +253 -172
- package/lib/build/dispatcher/dispatcher.test.js +12 -0
- package/lib/build/polyfills/node/dns.js +38 -36
- package/lib/build/polyfills/node/fs.js +621 -0
- package/lib/build/polyfills/node/globals/navigator.js +1 -1
- package/lib/build/polyfills/node/globals/performance.js +20 -18
- package/lib/build/polyfills/node/globals/process.js +238 -0
- package/lib/build/polyfills/node/http2.js +52 -10
- package/lib/build/polyfills/node/module.js +138 -0
- package/lib/commands/auth.commands.js +5 -2
- package/lib/commands/build.commands.js +128 -24
- package/lib/commands/deploy.commands.js +25 -5
- package/lib/commands/dev.commands.js +5 -3
- package/lib/commands/index.js +8 -2
- package/lib/commands/init.commands.js +6 -4
- package/lib/commands/logs.commands.js +5 -2
- package/lib/commands/presets.commands.js +8 -3
- package/lib/commands/storage.commands.js +5 -2
- package/lib/constants/index.js +1 -3
- package/lib/constants/messages/env.messages.js +4 -2
- package/lib/constants/messages/global.messages.js +10 -5
- package/lib/constants/messages/index.js +4 -1
- package/lib/constants/messages/platform.messages.js +10 -7
- package/lib/env/polyfills/fetch.polyfills.js +4 -5
- package/lib/env/runtime.env.js +4 -1
- package/lib/env/server.env.js +24 -5
- package/lib/env/vulcan.env.js +36 -7
- package/lib/main.js +16 -20
- package/lib/notations/namespaces.js +39 -7
- package/lib/notations/typedef.js +29 -7
- package/lib/platform/actions/application/createApplication.actions.js +3 -2
- package/lib/platform/actions/application/enableEdgeFunctions.actions.js +6 -3
- package/lib/platform/actions/application/instantiateFunction.actions.js +5 -3
- package/lib/platform/actions/application/setFunctionAsDefaultRule.actions.js +11 -5
- package/lib/platform/actions/core/auth.actions.js +10 -4
- package/lib/platform/actions/core/deploy.actions.js +41 -15
- package/lib/platform/actions/core/propagation.actions.js +4 -6
- package/lib/platform/actions/core/storage.actions.js +3 -2
- package/lib/platform/actions/domain/createDomain.actions.js +2 -2
- package/lib/platform/actions/function/createFunction.actions.js +9 -5
- package/lib/platform/actions/function/showFunctionLogs.actions.js +19 -7
- package/lib/platform/edgehooks/ErrorHTML/ErrorHTML.hooks.js +7 -4
- package/lib/platform/edgehooks/debugRequest/debugRequest.hooks.js +5 -5
- package/lib/platform/edgehooks/index.js +1 -3
- package/lib/platform/edgehooks/mountSPA/mountSPA.hooks.js +7 -5
- package/lib/platform/edgehooks/mountSPA/mountSPA.hooks.test.js +36 -14
- package/lib/platform/edgehooks/mountSSG/mountSSG.hooks.js +15 -8
- package/lib/platform/edgehooks/mountSSG/mountSSG.hooks.test.js +41 -0
- package/lib/platform/index.js +5 -4
- package/lib/platform/services/application.service.js +13 -3
- package/lib/platform/services/base.service.js +4 -2
- package/lib/platform/services/domain.service.js +1 -0
- package/lib/platform/services/events.service.js +7 -2
- package/lib/platform/services/function.service.js +1 -0
- package/lib/platform/services/index.js +1 -3
- package/lib/platform/services/storage.service.js +1 -0
- package/lib/platform/services/tokens.service.js +4 -1
- package/lib/presets/custom/angular/deliver/handler.js +5 -2
- package/lib/presets/custom/angular/deliver/prebuild.js +6 -3
- package/lib/presets/custom/astro/deliver/handler.js +4 -3
- package/lib/presets/custom/astro/deliver/prebuild.js +2 -5
- package/lib/presets/custom/hexo/deliver/handler.js +4 -3
- package/lib/presets/custom/hexo/deliver/prebuild.js +4 -6
- package/lib/presets/custom/next/compute/config.js +9 -7
- package/lib/presets/custom/next/compute/default/index.js +1 -0
- package/lib/presets/custom/next/compute/handler.js +11 -4
- package/lib/presets/custom/next/compute/node/custom-server/12.3.1/index.js +12 -4
- package/lib/presets/custom/next/compute/node/custom-server/12.3.1/server/base-http/compute-js.js +7 -1
- package/lib/presets/custom/next/compute/node/custom-server/12.3.1/server/compute-js.js +18 -3
- package/lib/presets/custom/next/compute/node/custom-server/12.3.1/server/config.js +264 -128
- package/lib/presets/custom/next/compute/node/custom-server/12.3.1/server/load-components.js +47 -11
- package/lib/presets/custom/next/compute/node/custom-server/12.3.1/server/next-compute-js-server.js +301 -89
- package/lib/presets/custom/next/compute/node/custom-server/12.3.1/server/next.js +23 -4
- package/lib/presets/custom/next/compute/node/custom-server/12.3.1/server/require.js +214 -72
- package/lib/presets/custom/next/compute/node/custom-server/12.3.1/server/response-cache/index.js +16 -4
- package/lib/presets/custom/next/compute/node/custom-server/12.3.1/server/serve-static.js +17 -6
- package/lib/presets/custom/next/compute/node/custom-server/12.3.1/util/etag.js +8 -2
- package/lib/presets/custom/next/compute/node/index.js +17 -4
- package/lib/presets/custom/next/compute/node/prebuild/index.js +1 -1
- package/lib/presets/custom/next/compute/node/prebuild/statics/index.js +107 -37
- package/lib/presets/custom/next/compute/prebuild.js +2 -2
- package/lib/presets/custom/next/deliver/handler.js +4 -3
- package/lib/presets/custom/next/deliver/prebuild.js +19 -14
- package/lib/presets/custom/react/deliver/handler.js +5 -3
- package/lib/presets/custom/react/deliver/prebuild.js +6 -3
- package/lib/presets/custom/vue/deliver/handler.js +4 -2
- package/lib/presets/custom/vue/deliver/prebuild.js +1 -3
- package/lib/presets/default/html/deliver/handler.js +4 -3
- package/lib/presets/default/html/deliver/prebuild.js +1 -0
- package/lib/presets/default/javascript/compute/handler.js +5 -5
- package/lib/presets/default/javascript/compute/prebuild.js +2 -1
- package/lib/presets/default/typescript/compute/handler.js +5 -5
- package/lib/presets/default/typescript/compute/prebuild.js +2 -1
- package/lib/providers/azion/worker.js +1 -13
- package/lib/utils/copyDirectory/copyDirectory.utils.js +16 -7
- package/lib/utils/copyDirectory/copyDirectory.utils.test.js +22 -5
- package/lib/utils/debug/debug.utils.js +5 -4
- package/lib/utils/debug/debug.utils.test.js +6 -2
- package/lib/utils/exec/exec.utils.js +14 -5
- package/lib/utils/exec/exec.utils.test.js +3 -2
- package/lib/utils/feedback/feedback.utils.js +73 -14
- package/lib/utils/generateTimestamp/generateTimestamp.utils.js +4 -3
- package/lib/utils/generateTimestamp/generateTimestamp.utils.test.js +1 -1
- package/lib/utils/generateWebpackBanner/generateWebpackBanner.utils.js +6 -1
- package/lib/utils/getAbsoluteLibDirPath/getAbsoluteLibDirPath.utils.js +5 -4
- package/lib/utils/getExportedFunctionBody/getExportedFunctionBody.utils.js +88 -0
- package/lib/utils/getExportedFunctionBody/getExportedFunctionBody.utils.test.js +80 -0
- package/lib/utils/getExportedFunctionBody/index.js +3 -0
- package/lib/utils/getPackageManager/getPackageManager.utils.js +14 -9
- package/lib/utils/getPackageManager/getPackageManager.utils.test.js +38 -22
- package/lib/utils/getPackageVersion/getPackageVersion.utils.js +5 -1
- package/lib/utils/getPackageVersion/getPackageVersion.utils.test.js +6 -20
- package/lib/utils/getProjectJsonFile/getProjectJsonFile.utils.js +9 -9
- package/lib/utils/getProjectJsonFile/getProjectJsonFile.utils.test.js +5 -2
- package/lib/utils/getUrlFromResource/getUrlFromResource.utils.js +12 -5
- package/lib/utils/getVulcanBuildId/getVulcanBuildId.utils.js +3 -2
- package/lib/utils/index.js +6 -0
- package/lib/utils/injectFilesInMem/index.js +3 -0
- package/lib/utils/injectFilesInMem/injectFilesInMem.utils.js +51 -0
- package/lib/utils/injectFilesInMem/injectFilesInMem.utils.test.js +48 -0
- package/lib/utils/overrideStaticOutputPath/overrideStaticOutputPath.utils.js +19 -8
- package/lib/utils/overrideStaticOutputPath/overrideStaticOutputPath.utils.test.js +5 -2
- package/lib/utils/presets/presets.utils.js +25 -23
- package/lib/utils/presets/presets.utils.test.js +103 -3
- package/lib/utils/readWorkerFile/readWorkerFile.utils.js +8 -7
- package/lib/utils/readWorkerFile/readWorkerFile.utils.test.js +14 -12
- package/lib/utils/relocateImportsAndRequires/index.js +3 -0
- package/lib/utils/relocateImportsAndRequires/relocateImportsAndRequires.utils.js +23 -0
- package/lib/utils/spinner/spinner.utils.js +9 -1
- package/lib/utils/vercel/vercel.utils.js +41 -5
- package/package.json +11 -9
- package/tasks/sync-aliases.js +4 -2
package/.prettierignore
ADDED
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,56 @@
|
|
|
1
|
+
## [2.0.0-stage.2](https://github.com/aziontech/vulcan/compare/v2.0.0-stage.1...v2.0.0-stage.2) (2023-10-26)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* local env hot reload ([#161](https://github.com/aziontech/vulcan/issues/161)) ([e2edb9c](https://github.com/aziontech/vulcan/commit/e2edb9cad2222395850a09f9476eb206b64568f3))
|
|
7
|
+
* localenv hot reload ([85f606c](https://github.com/aziontech/vulcan/commit/85f606c7025d1d8474e37bbeecaf46ee9bd7ef3b))
|
|
8
|
+
|
|
9
|
+
## [2.0.0-stage.1](https://github.com/aziontech/vulcan/compare/v1.7.1...v2.0.0-stage.1) (2023-10-25)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### ⚠ BREAKING CHANGES
|
|
13
|
+
|
|
14
|
+
* Introduced vulcan.config.js and changing the way to read the entry point of the preset files and the application entrypoint. No longer use the "main()" function as input, but the function that is exported as default "export default foo()".
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* add jsx loader (esbuild) ([93ccf13](https://github.com/aziontech/vulcan/commit/93ccf134159e053814e315ce0e0e4a71ca086b7d))
|
|
19
|
+
* Create injectFilesInMem util ([1555c98](https://github.com/aziontech/vulcan/commit/1555c98e1cf0ce40e3c9aca2d14a75af03e89fa3))
|
|
20
|
+
* Create node fs polyfill ([cab1095](https://github.com/aziontech/vulcan/commit/cab1095e056e4720c8762a7b27fc6c92e3b4dd03))
|
|
21
|
+
* Create node module polyfill ([976a6c3](https://github.com/aziontech/vulcan/commit/976a6c382119c55e3c9f92cd02d0fd74aee863d3))
|
|
22
|
+
* Create node process polyfill ([1e61ba2](https://github.com/aziontech/vulcan/commit/1e61ba2d1fb30259b47c72e825dab5a72478d532))
|
|
23
|
+
* enable useOwnWorker for custom provider ([8a88ff7](https://github.com/aziontech/vulcan/commit/8a88ff7efd0bc5afc43f0fe6666da3831ae702c0))
|
|
24
|
+
* esbuild windows support ([d10e467](https://github.com/aziontech/vulcan/commit/d10e4678154e87ad33b5de9f76680f1a6815edcc))
|
|
25
|
+
* Handle content to inject in worker ([3356743](https://github.com/aziontech/vulcan/commit/33567432832ebb60e07bd4a1098ff62ef1e2f09c))
|
|
26
|
+
* Handle mem fs injection in dispatcher ([3e89438](https://github.com/aziontech/vulcan/commit/3e89438528b8ebbbecc8366af5776c282d8a764e))
|
|
27
|
+
* In Memory File System ([#154](https://github.com/aziontech/vulcan/issues/154)) ([5a1a4fc](https://github.com/aziontech/vulcan/commit/5a1a4fc2f8c971fe57cb96888310910eef350102))
|
|
28
|
+
* new vulcan.config and entry reading pattern ([62dbcae](https://github.com/aziontech/vulcan/commit/62dbcae283df8440daa91238ec577060662be3bf))
|
|
29
|
+
* read vulcan.env for build preconfig ([b6a7b7c](https://github.com/aziontech/vulcan/commit/b6a7b7c8733a59513f624ba8dd68d424c7a66616))
|
|
30
|
+
* Use fs, module and process polyfills in next compute build ([7de9a56](https://github.com/aziontech/vulcan/commit/7de9a56e7cdda8cf584697ec02457f602e2dad68))
|
|
31
|
+
* vulcan.config.js ([ee7b0c0](https://github.com/aziontech/vulcan/commit/ee7b0c038a9623adec6b44e528ff3c8269e07cc9))
|
|
32
|
+
* vulcan.config.js ([#153](https://github.com/aziontech/vulcan/issues/153)) ([f7d0118](https://github.com/aziontech/vulcan/commit/f7d01183d961aac5a50f4739db2504e1dd3c452d))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### Bug Fixes
|
|
36
|
+
|
|
37
|
+
* Create vulcan global object ([04e2c4e](https://github.com/aziontech/vulcan/commit/04e2c4eaf0ddae261069c04212f9aef333516cbf))
|
|
38
|
+
* fetch in local environment ([86ec3f5](https://github.com/aziontech/vulcan/commit/86ec3f536c30be13591074a97ca33058004c4c35))
|
|
39
|
+
* fix some tests ([ed603a9](https://github.com/aziontech/vulcan/commit/ed603a9be4931d2e7b10fc3c2dab036a84113097))
|
|
40
|
+
* getPackageManager command ([391d565](https://github.com/aziontech/vulcan/commit/391d565c289527e911bc47c8f9a45b33d2a2c88f))
|
|
41
|
+
* rebuild yarn.lock ([7d60749](https://github.com/aziontech/vulcan/commit/7d60749627d931e31528ab903588a5c88b058a20))
|
|
42
|
+
* relative package manager (npm) ([605d6e6](https://github.com/aziontech/vulcan/commit/605d6e6280496707d32df5df08745076e490b4cb))
|
|
43
|
+
* remove dependency cycle in vercel util ([a0cc528](https://github.com/aziontech/vulcan/commit/a0cc5286665258b87fd9125ef3a082c9cd25d7ff))
|
|
44
|
+
* Remove duplicated imports of typedefs (jsdocs) ([58054d0](https://github.com/aziontech/vulcan/commit/58054d011203d2c54a0961a25d1fbfe1621d5597))
|
|
45
|
+
* Remove duplicated imports of typedefs (jsdocs) ([#138](https://github.com/aziontech/vulcan/issues/138)) ([03d6be9](https://github.com/aziontech/vulcan/commit/03d6be99835657032844f74dd95c435b58ce9468))
|
|
46
|
+
* Remove duplicated to string in injectFilesInMem util ([1a9bc0f](https://github.com/aziontech/vulcan/commit/1a9bc0fff99fa9ecdaa1a1f69be871674a9e49d6))
|
|
47
|
+
* Set correct command in hexo prebuild ([fd62874](https://github.com/aziontech/vulcan/commit/fd628748c0432056f166075a607db588ed748125))
|
|
48
|
+
* Set correct command in hexo prebuild ([#158](https://github.com/aziontech/vulcan/issues/158)) ([5cb729c](https://github.com/aziontech/vulcan/commit/5cb729ca477a53018b23a4bfb40766099a126240))
|
|
49
|
+
* Set correct log in get asset from storage method ([1e9c63a](https://github.com/aziontech/vulcan/commit/1e9c63ae6a2f4af3359ed9b610d9c692891577a6))
|
|
50
|
+
* validate installed dependencies only if they exists ([c2789e5](https://github.com/aziontech/vulcan/commit/c2789e5e7b2be855a328d4a24d02da22d7874a2c))
|
|
51
|
+
* validate installed dependencies only if they exists ([850dbd1](https://github.com/aziontech/vulcan/commit/850dbd1512efb4658eac5ccab42fdd0b1f96b73f))
|
|
52
|
+
* validate installed dependencies only if they exists ([#134](https://github.com/aziontech/vulcan/issues/134)) ([51474ab](https://github.com/aziontech/vulcan/commit/51474aba9f97a3beaef58d7a9bc7e26a9d19ca69))
|
|
53
|
+
|
|
1
54
|
### [1.7.1](https://github.com/aziontech/vulcan/compare/v1.7.0...v1.7.1) (2023-10-10)
|
|
2
55
|
|
|
3
56
|
|
|
@@ -45,49 +98,45 @@
|
|
|
45
98
|
|
|
46
99
|
## [1.7.0-stage.2](https://github.com/aziontech/vulcan/compare/v1.7.0-stage.1...v1.7.0-stage.2) (2023-09-14)
|
|
47
100
|
|
|
48
|
-
|
|
49
101
|
### Bug Fixes
|
|
50
102
|
|
|
51
|
-
|
|
52
|
-
|
|
103
|
+
- Add unused files in npm ignore ([ea3acf8](https://github.com/aziontech/vulcan/commit/ea3acf8a536fbe26f0e3e5b359385607930e79ec))
|
|
104
|
+
- Create .npmignore ([#131](https://github.com/aziontech/vulcan/issues/131)) ([90383b0](https://github.com/aziontech/vulcan/commit/90383b01cd0dea848840d3348bf30cdcfdd79388))
|
|
53
105
|
|
|
54
106
|
## [1.7.0-stage.1](https://github.com/aziontech/vulcan/compare/v1.6.4-stage.2...v1.7.0-stage.1) (2023-09-14)
|
|
55
107
|
|
|
56
|
-
|
|
57
108
|
### Features
|
|
58
109
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
110
|
+
- add custom server with js files ([#97](https://github.com/aziontech/vulcan/issues/97)) ([f73a31e](https://github.com/aziontech/vulcan/commit/f73a31e19e23c773e379f3cd193262468cf1ba52))
|
|
111
|
+
- Add list preset modes ([4d1b924](https://github.com/aziontech/vulcan/commit/4d1b924f1c3d403683dcd1d0a2245cf9d68cd3a3))
|
|
112
|
+
- Add next webpack polyfills ([#98](https://github.com/aziontech/vulcan/issues/98)) ([5451fa5](https://github.com/aziontech/vulcan/commit/5451fa59c69f4bc148649e2f0b67e7b15012f678))
|
|
113
|
+
- Add Next.js support ([#125](https://github.com/aziontech/vulcan/issues/125)) ([a53c807](https://github.com/aziontech/vulcan/commit/a53c80727673ff209842372eb467d01595f3d15d))
|
|
114
|
+
- added handler and code compile ([#100](https://github.com/aziontech/vulcan/issues/100)) ([2e245fd](https://github.com/aziontech/vulcan/commit/2e245fdf67f5fdb746072950b6e64b14d9273d19))
|
|
115
|
+
- check if dependencies are installed and log vercel cli ([144bc7a](https://github.com/aziontech/vulcan/commit/144bc7ac02b626fa9c1693ebd9a2f39a17244473))
|
|
116
|
+
- Improve vercel build logs ([67ad3bd](https://github.com/aziontech/vulcan/commit/67ad3bd8f918c23d09514ce7acac77a5ac519db5))
|
|
117
|
+
- list presets modes ([df1d71e](https://github.com/aziontech/vulcan/commit/df1d71e43041224a47653e0c9853e18205f92c51))
|
|
118
|
+
- pre build configuration and custom static file server Next ([#96](https://github.com/aziontech/vulcan/issues/96)) ([1d2ab58](https://github.com/aziontech/vulcan/commit/1d2ab58370432b81cfa625a0d9a1c32eaa27cb93))
|
|
68
119
|
|
|
69
120
|
### [1.6.5](https://github.com/aziontech/vulcan/compare/v1.6.4...v1.6.5) (2023-09-14)
|
|
70
121
|
|
|
71
|
-
|
|
72
122
|
### Bug Fixes
|
|
73
123
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
124
|
+
- Add npm semantic release plugin in plugins list ([703a8ea](https://github.com/aziontech/vulcan/commit/703a8ea0f04f8d1de4489a8dd9f3523566334a4a))
|
|
125
|
+
- Add write permissions in release workflow ([39c1cae](https://github.com/aziontech/vulcan/commit/39c1cae20cc5371a1a7ba49d4754474ee61735d0))
|
|
126
|
+
- permissions in release workflow ([#126](https://github.com/aziontech/vulcan/issues/126)) ([37ebee6](https://github.com/aziontech/vulcan/commit/37ebee608564de0d8903f9b09788c3aaffcd2315))
|
|
127
|
+
- Remove skip ci option in git plugin ([d954fdc](https://github.com/aziontech/vulcan/commit/d954fdc76944c954662e3828054f5b06c854e865))
|
|
128
|
+
- semantic release plugins config ([f7c30a2](https://github.com/aziontech/vulcan/commit/f7c30a26dd7eb0051bf9306be66cbcb78253286a))
|
|
129
|
+
- semantic release plugins config ([#124](https://github.com/aziontech/vulcan/issues/124)) ([89289e0](https://github.com/aziontech/vulcan/commit/89289e066b01880f566d396a2214c528e6db93a3))
|
|
130
|
+
- set correct options in plugins section ([3a0c8f2](https://github.com/aziontech/vulcan/commit/3a0c8f2cf4c70fc70da0c19e6c5172a4bb8aef0a))
|
|
81
131
|
|
|
82
132
|
### [1.6.4-stage.2](https://github.com/aziontech/vulcan/compare/v1.6.4-stage.1...v1.6.4-stage.2) (2023-09-14)
|
|
83
133
|
|
|
84
|
-
|
|
85
134
|
### Bug Fixes
|
|
86
135
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
136
|
+
- Add npm semantic release plugin in plugins list ([703a8ea](https://github.com/aziontech/vulcan/commit/703a8ea0f04f8d1de4489a8dd9f3523566334a4a))
|
|
137
|
+
- Add write permissions in release workflow ([39c1cae](https://github.com/aziontech/vulcan/commit/39c1cae20cc5371a1a7ba49d4754474ee61735d0))
|
|
138
|
+
- permissions in release workflow ([#126](https://github.com/aziontech/vulcan/issues/126)) ([37ebee6](https://github.com/aziontech/vulcan/commit/37ebee608564de0d8903f9b09788c3aaffcd2315))
|
|
139
|
+
- Remove skip ci option in git plugin ([d954fdc](https://github.com/aziontech/vulcan/commit/d954fdc76944c954662e3828054f5b06c854e865))
|
|
140
|
+
- semantic release plugins config ([f7c30a2](https://github.com/aziontech/vulcan/commit/f7c30a26dd7eb0051bf9306be66cbcb78253286a))
|
|
141
|
+
- semantic release plugins config ([#124](https://github.com/aziontech/vulcan/issues/124)) ([89289e0](https://github.com/aziontech/vulcan/commit/89289e066b01880f566d396a2214c528e6db93a3))
|
|
142
|
+
- set correct options in plugins section ([3a0c8f2](https://github.com/aziontech/vulcan/commit/3a0c8f2cf4c70fc70da0c19e6c5172a4bb8aef0a))
|
package/CODE_OF_CONDUCT.md
CHANGED
|
@@ -14,21 +14,21 @@ religion, or sexual identity and orientation.
|
|
|
14
14
|
Examples of behavior that contributes to creating a positive environment
|
|
15
15
|
include:
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
- Using welcoming and inclusive language
|
|
18
|
+
- Being respectful of differing viewpoints and experiences
|
|
19
|
+
- Gracefully accepting constructive criticism
|
|
20
|
+
- Focusing on what is best for the community
|
|
21
|
+
- Showing empathy towards other community members
|
|
22
22
|
|
|
23
23
|
Examples of unacceptable behavior by participants include:
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
- The use of sexualized language or imagery and unwelcome sexual attention or
|
|
26
26
|
advances
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
- Trolling, insulting/derogatory comments, and personal or political attacks
|
|
28
|
+
- Public or private harassment
|
|
29
|
+
- Publishing others' private information, such as a physical or electronic
|
|
30
30
|
address, without explicit permission
|
|
31
|
-
|
|
31
|
+
- Other conduct which could reasonably be considered inappropriate in a
|
|
32
32
|
professional setting
|
|
33
33
|
|
|
34
34
|
## Our Responsibilities
|
|
@@ -70,4 +70,4 @@ members of the project's leadership.
|
|
|
70
70
|
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
|
71
71
|
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
|
72
72
|
|
|
73
|
-
[homepage]: https://www.contributor-covenant.org
|
|
73
|
+
[homepage]: https://www.contributor-covenant.org
|
package/CONTRIBUTING.md
CHANGED
|
@@ -5,6 +5,7 @@ First off, thanks for taking the time to contribute!
|
|
|
5
5
|
All types of contributions are encouraged and valued. See the Table of Contents for different ways to help and details about how this project handles them. 🎉
|
|
6
6
|
|
|
7
7
|
## Table of Contents
|
|
8
|
+
|
|
8
9
|
- [Code of Conduct](#code-of-conduct)
|
|
9
10
|
- [I Have a Question](#i-have-a-question)
|
|
10
11
|
- [I Want To Contribute](#i-want-to-contribute)
|
|
@@ -12,7 +13,6 @@ All types of contributions are encouraged and valued. See the Table of Contents
|
|
|
12
13
|
- [Suggesting Enhancements](#suggesting-enhancements)
|
|
13
14
|
- [Your First Code Contribution](#your-first-code-contribution)
|
|
14
15
|
|
|
15
|
-
|
|
16
16
|
## Code of Conduct
|
|
17
17
|
|
|
18
18
|
This project and everyone participating in it is governed by the
|
|
@@ -35,6 +35,7 @@ We will then take care of the issue as soon as possible.
|
|
|
35
35
|
## I Want To Contribute
|
|
36
36
|
|
|
37
37
|
> ### Legal Notice
|
|
38
|
+
>
|
|
38
39
|
> When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content, and that the content you contribute may be provided under the project license.
|
|
39
40
|
|
|
40
41
|
### Reporting Bugs
|
|
@@ -57,7 +58,7 @@ We use GitHub issues to track bugs and errors. If you run into an issue with the
|
|
|
57
58
|
|
|
58
59
|
- Open an [Issue](https://github.com/aziontech/vulcan/issues/new). (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.)
|
|
59
60
|
- Explain the behavior you would expect and the actual behavior.
|
|
60
|
-
- Please provide as much context as possible and describe the
|
|
61
|
+
- Please provide as much context as possible and describe the _reproduction steps_ that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case.
|
|
61
62
|
- Provide the information you collected in the previous section.
|
|
62
63
|
|
|
63
64
|
### Suggesting Enhancements
|
|
@@ -69,8 +70,8 @@ This section guides you through submitting an enhancement suggestion for Cells S
|
|
|
69
70
|
- Make sure that you are using the latest version.
|
|
70
71
|
- Perform a [search](https://github.com/aziontech/vulcan/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
|
|
71
72
|
- If your enhancement is nontrivial,
|
|
72
|
-
please open an [Issue](https://github.com/aziontech/vulcan/issues/new) to discuss the
|
|
73
|
-
idea and implementation strategy before submitting a PR.
|
|
73
|
+
please open an [Issue](https://github.com/aziontech/vulcan/issues/new) to discuss the
|
|
74
|
+
idea and implementation strategy before submitting a PR.
|
|
74
75
|
|
|
75
76
|
#### How Do I Submit a Good Enhancement Suggestion?
|
|
76
77
|
|
|
@@ -87,4 +88,4 @@ Enhancement suggestions are tracked as [GitHub issues](https://github.com/aziont
|
|
|
87
88
|
1. Fork the repo
|
|
88
89
|
2. Clone your forked repo
|
|
89
90
|
3. Commit the changes you’ve developed on your fork
|
|
90
|
-
4. If everything looks good, create a pull request on the base repo with your changes.
|
|
91
|
+
4. If everything looks good, create a pull request on the base repo with your changes.
|
package/LICENSE.md
CHANGED
|
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
18
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
1
|
# Vulcan - Forging The Edge
|
|
3
|
-

|
|
4
2
|
|
|
3
|
+

|
|
5
4
|
|
|
6
5
|
Vulcan is a powerful tool designed to streamline the development and deployment of JavaScript applications and frameworks. This powerful utility automates polyfills for Edge Computing, significantly simplifying the process of creating Workers, particularly for the Azion platform.
|
|
7
6
|
|
|
@@ -37,6 +36,7 @@ Follow these steps to start using Vulcan:
|
|
|
37
36
|
cd vulcan
|
|
38
37
|
npm install
|
|
39
38
|
```
|
|
39
|
+
|
|
40
40
|
3. Install the Vulcan CLI globally, which allows you to use it as a command-line tool from anywhere in your system.
|
|
41
41
|
|
|
42
42
|
```shell
|
|
@@ -45,52 +45,147 @@ Follow these steps to start using Vulcan:
|
|
|
45
45
|
|
|
46
46
|
This command sets up the necessary project structure and configuration files for Vulcan.
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
4. Start developing: Once the project is set up, you can start developing your JavaScript applications or frameworks using the power of Vulcan. Leverage the automated polyfills, Worker creation assistance, and other features provided by Vulcan to enhance your development workflow.
|
|
49
49
|
|
|
50
50
|
## Using Vulcan
|
|
51
51
|
|
|
52
52
|
See some examples below:
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
- Build a JavaScript/Node project (back-end)
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
* Build a TypeScript/Node (back-end)
|
|
56
|
+
```shell
|
|
57
|
+
vulcan build
|
|
58
|
+
```
|
|
61
59
|
|
|
62
|
-
|
|
63
|
-
vulcan build --preset typescript
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
* Build a Static Next.js project
|
|
60
|
+
- Build a TypeScript/Node (back-end)
|
|
67
61
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
* Build a Static Astro.js project
|
|
62
|
+
```shell
|
|
63
|
+
vulcan build --preset typescript
|
|
64
|
+
```
|
|
73
65
|
|
|
74
|
-
|
|
75
|
-
vulcan build --preset astro --mode deliver
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
* Test your project locally (after build)
|
|
66
|
+
- Build a Static Next.js project
|
|
79
67
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
68
|
+
```shell
|
|
69
|
+
vulcan build --preset next --mode deliver
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
- Build a Static Astro.js project
|
|
73
|
+
|
|
74
|
+
```shell
|
|
75
|
+
vulcan build --preset astro --mode deliver
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
- Test your project locally (after build)
|
|
79
|
+
|
|
80
|
+
```shell
|
|
81
|
+
vulcan dev
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Vulcan.config.js
|
|
85
|
+
|
|
86
|
+
The `vulcan.config.js` file offers a robust configuration system for Vulcan. This file is not mandatory but acts as an override mechanism. If you define properties in this file, they will supersede the preset configurations. Properties not defined will rely on the preset.
|
|
87
|
+
|
|
88
|
+
Here's a detailed breakdown of the configuration properties available in `vulcan.config.js`:
|
|
89
|
+
|
|
90
|
+
### Entry
|
|
91
|
+
|
|
92
|
+
**Type:** String
|
|
93
|
+
|
|
94
|
+
**Description:**
|
|
95
|
+
This represents the primary entry point for your application, where the building process begins.
|
|
96
|
+
|
|
97
|
+
**Note:** `Entry` will be ignored for jamstack solutions.
|
|
98
|
+
|
|
99
|
+
### Builder
|
|
100
|
+
|
|
101
|
+
**Type:** String ('esbuild' or 'webpack')
|
|
102
|
+
|
|
103
|
+
**Description:**
|
|
104
|
+
Defines which build tool to use. The available options are `esbuild` and `webpack`.
|
|
83
105
|
|
|
106
|
+
### UseNodePolyfills
|
|
107
|
+
|
|
108
|
+
**Type:** Boolean
|
|
109
|
+
|
|
110
|
+
**Description:**
|
|
111
|
+
Determines if Node.js polyfills should be applied. This is useful for projects that leverage Node.js specific functionalities but are targeting environments without such built-in capabilities.
|
|
112
|
+
|
|
113
|
+
### UseOwnWorker
|
|
114
|
+
|
|
115
|
+
**Type:** Boolean
|
|
116
|
+
|
|
117
|
+
**Description:**
|
|
118
|
+
This flag indicates that the constructed code inserts its own worker expression, such as `addEventListener("fetch")` or similar, without the need to inject a provider.
|
|
119
|
+
|
|
120
|
+
### Preset
|
|
121
|
+
|
|
122
|
+
**Type:** Object
|
|
123
|
+
|
|
124
|
+
**Description:**
|
|
125
|
+
Provides preset-specific configurations.
|
|
126
|
+
|
|
127
|
+
- **Name (Type: String):** Refers to the preset name, e.g., "vue" or "next".
|
|
128
|
+
- **Mode (Type: String):** Specifies the mode for the preset, e.g., "compute" or "deliver".
|
|
129
|
+
|
|
130
|
+
### MemoryFS
|
|
131
|
+
|
|
132
|
+
**Type:** Object
|
|
133
|
+
|
|
134
|
+
**Description:**
|
|
135
|
+
Configurations related to the in-memory filesystem.
|
|
136
|
+
|
|
137
|
+
- **InjectionDirs (Type: Array of Strings):** Directories to be injected into memory for runtime access via the fs API.
|
|
138
|
+
|
|
139
|
+
- **RemovePathPrefix (Type: String):** A prefix path to be removed from files before injecting into memory.
|
|
140
|
+
|
|
141
|
+
### Custom
|
|
142
|
+
|
|
143
|
+
**Type:** Object
|
|
144
|
+
|
|
145
|
+
**Description:**
|
|
146
|
+
Allows you to extend the capabilities of the chosen bundler (either `webpack` or `esbuild`) with custom plugins or configurations.
|
|
147
|
+
|
|
148
|
+
- **Plugins (Type: Object):** Add your custom plugins for your chosen bundler here.
|
|
149
|
+
|
|
150
|
+
### Example Configuration
|
|
151
|
+
|
|
152
|
+
For a Vue-based project:
|
|
153
|
+
|
|
154
|
+
```javascript
|
|
155
|
+
module.exports = {
|
|
156
|
+
entry: 'src/index.js',
|
|
157
|
+
builder: 'webpack',
|
|
158
|
+
useNodePolyfills: true,
|
|
159
|
+
useOwnWorker: false,
|
|
160
|
+
preset: {
|
|
161
|
+
name: 'vue',
|
|
162
|
+
mode: 'compute',
|
|
163
|
+
},
|
|
164
|
+
memoryFS: {
|
|
165
|
+
injectionDirs: ['.faststore/@generated/graphql'],
|
|
166
|
+
removePathPrefix: '.faststore/',
|
|
167
|
+
},
|
|
168
|
+
custom: {
|
|
169
|
+
plugins: {},
|
|
170
|
+
},
|
|
171
|
+
};
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**Note:** Adapting `vulcan.config.js` to your setup allows a personalized development experience, catering to the specific needs of your JavaScript applications and frameworks.
|
|
84
175
|
|
|
85
176
|
## Docs
|
|
86
|
-
|
|
87
|
-
|
|
177
|
+
|
|
178
|
+
- [Overview](docs/overview.md)
|
|
179
|
+
- [Presets](docs/presets.md)
|
|
88
180
|
|
|
89
181
|
## Contributing
|
|
182
|
+
|
|
90
183
|
Check the [Contributing doc](CONTRIBUTING.md).
|
|
91
184
|
|
|
92
185
|
## Code of Conduct
|
|
93
|
-
|
|
186
|
+
|
|
187
|
+
Check the [Code of Conduct](CODE_OF_CONDUCT.md).
|
|
94
188
|
|
|
95
189
|
## License
|
|
190
|
+
|
|
96
191
|
[MIT](LICENSE.md)
|
package/aliases.js
CHANGED
|
@@ -6,6 +6,8 @@ export default [
|
|
|
6
6
|
['#build', './lib/build/dispatcher/index.js'],
|
|
7
7
|
['#bundlers', './lib/build/bundlers/index.js'],
|
|
8
8
|
['#notations/*', './lib/notations'],
|
|
9
|
+
['#namespaces', './lib/notations/namespaces.js'],
|
|
10
|
+
['#typedef', './lib/notations/typedef.js'],
|
|
9
11
|
['#env', './lib/env/index.js'],
|
|
10
12
|
['#platform', './lib/platform/index.js'],
|
|
11
13
|
['#constants', './lib/constants/index.js'],
|
package/docs/overview.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# Overview
|
|
2
2
|
|
|
3
3
|
## Build Pipeline
|
|
4
|
+
|
|
4
5
|
```mermaid
|
|
5
6
|
flowchart LR
|
|
6
7
|
|
|
@@ -11,19 +12,23 @@ D --> E[Artifacts]
|
|
|
11
12
|
```
|
|
12
13
|
|
|
13
14
|
### Trigger
|
|
15
|
+
|
|
14
16
|
An external call to run a build.
|
|
15
17
|
|
|
16
18
|
### Dispatcher
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
|
|
20
|
+
- Receive build options(args);
|
|
21
|
+
- Select which build process to run;
|
|
22
|
+
- Load necessary template files and import correct modules (prebuild and configs);
|
|
20
23
|
|
|
21
24
|
### Prebuild
|
|
25
|
+
|
|
22
26
|
Custom prebuild module that runs actions to generate entrypoint and necessary files.
|
|
23
27
|
|
|
24
|
-
The user is free to run any action in this step. All actions must be called in a exported `
|
|
28
|
+
The user is free to run any action in this step. All actions must be called in a `exported default` function.
|
|
25
29
|
|
|
26
30
|
### Common Build
|
|
31
|
+
|
|
27
32
|
Module that runs azion common build.
|
|
28
33
|
|
|
29
34
|
Polyfills can be used to generate the worker(s) file(s).
|
|
@@ -31,7 +36,9 @@ Polyfills can be used to generate the worker(s) file(s).
|
|
|
31
36
|
Some configs can be passed to the builder but if user tries to override `azion worker configs` this passed configs will be ignored.
|
|
32
37
|
|
|
33
38
|
### Artifacts
|
|
39
|
+
|
|
34
40
|
The **'.edge'** folder will be generated representing the edge locally. Files generated to run on the infrastructure:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
41
|
+
|
|
42
|
+
- JS worker(s) => '.edge/workers.js';
|
|
43
|
+
- Assets => '.edge/storage/\*';
|
|
44
|
+
- Environment variables => '.edge/.env'.
|