edge-functions 1.3.0 → 1.5.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.
Files changed (34) hide show
  1. package/.eslintrc.json +4 -0
  2. package/aliases.js +1 -0
  3. package/examples/vue-static/yarn.lock +13094 -0
  4. package/examples/vue-vite-static/yarn.lock +333 -0
  5. package/jsconfig.json +3 -0
  6. package/lib/build/dispatcher/dispatcher.js +30 -21
  7. package/lib/commands/auth.commands.js +85 -0
  8. package/lib/commands/build.commands.js +47 -0
  9. package/lib/commands/deploy.commands.js +45 -0
  10. package/lib/commands/dev.commands.js +26 -0
  11. package/lib/commands/index.js +13 -0
  12. package/lib/commands/init.commands.js +61 -0
  13. package/lib/commands/logs.commands.js +34 -0
  14. package/lib/commands/presets.commands.js +97 -0
  15. package/lib/commands/storage.commands.js +22 -0
  16. package/lib/constants/framework-initializer.constants.js +2 -2
  17. package/lib/constants/messages/build.messages.js +1 -0
  18. package/lib/env/polyfills/fetch.polyfills.js +10 -10
  19. package/lib/env/runtime.env.js +1 -1
  20. package/lib/env/server.env.js +101 -23
  21. package/lib/env/vulcan.env.js +43 -21
  22. package/lib/main.js +36 -261
  23. package/lib/platform/actions/core/auth.actions.js +3 -3
  24. package/lib/platform/services/base.service.js +1 -2
  25. package/lib/presets/custom/next/deliver/prebuild.js +4 -1
  26. package/lib/presets/custom/vue/deliver/prebuild.js +2 -5
  27. package/lib/utils/getUrlFromResource/getUrlFromResource.utils.js +16 -0
  28. package/lib/utils/getUrlFromResource/index.js +3 -0
  29. package/lib/utils/index.js +2 -0
  30. package/package.json +4 -3
  31. package/releaserc.json +1 -0
  32. package/lib/polyfills/FetchEvent.polyfills.js +0 -13
  33. package/lib/polyfills/fetch.polyfills.js +0 -39
  34. package/lib/polyfills/index.js +0 -4
@@ -0,0 +1,333 @@
1
+ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
+ # yarn lockfile v1
3
+
4
+
5
+ "@babel/parser@^7.20.15", "@babel/parser@^7.21.3":
6
+ version "7.22.11"
7
+ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.22.11.tgz#becf8ee33aad2a35ed5607f521fe6e72a615f905"
8
+ integrity sha512-R5zb8eJIBPJriQtbH/htEQy4k7E2dHWlD2Y2VT07JCzwYZHBxV5ZYtM0UhXSNMT74LyxuM+b1jdL7pSesXbC/g==
9
+
10
+ "@esbuild/android-arm64@0.18.20":
11
+ version "0.18.20"
12
+ resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz#984b4f9c8d0377443cc2dfcef266d02244593622"
13
+ integrity sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==
14
+
15
+ "@esbuild/android-arm@0.18.20":
16
+ version "0.18.20"
17
+ resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.18.20.tgz#fedb265bc3a589c84cc11f810804f234947c3682"
18
+ integrity sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==
19
+
20
+ "@esbuild/android-x64@0.18.20":
21
+ version "0.18.20"
22
+ resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.18.20.tgz#35cf419c4cfc8babe8893d296cd990e9e9f756f2"
23
+ integrity sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==
24
+
25
+ "@esbuild/darwin-arm64@0.18.20":
26
+ version "0.18.20"
27
+ resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz#08172cbeccf95fbc383399a7f39cfbddaeb0d7c1"
28
+ integrity sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==
29
+
30
+ "@esbuild/darwin-x64@0.18.20":
31
+ version "0.18.20"
32
+ resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz#d70d5790d8bf475556b67d0f8b7c5bdff053d85d"
33
+ integrity sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==
34
+
35
+ "@esbuild/freebsd-arm64@0.18.20":
36
+ version "0.18.20"
37
+ resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz#98755cd12707f93f210e2494d6a4b51b96977f54"
38
+ integrity sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==
39
+
40
+ "@esbuild/freebsd-x64@0.18.20":
41
+ version "0.18.20"
42
+ resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz#c1eb2bff03915f87c29cece4c1a7fa1f423b066e"
43
+ integrity sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==
44
+
45
+ "@esbuild/linux-arm64@0.18.20":
46
+ version "0.18.20"
47
+ resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz#bad4238bd8f4fc25b5a021280c770ab5fc3a02a0"
48
+ integrity sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==
49
+
50
+ "@esbuild/linux-arm@0.18.20":
51
+ version "0.18.20"
52
+ resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz#3e617c61f33508a27150ee417543c8ab5acc73b0"
53
+ integrity sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==
54
+
55
+ "@esbuild/linux-ia32@0.18.20":
56
+ version "0.18.20"
57
+ resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz#699391cccba9aee6019b7f9892eb99219f1570a7"
58
+ integrity sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==
59
+
60
+ "@esbuild/linux-loong64@0.18.20":
61
+ version "0.18.20"
62
+ resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz#e6fccb7aac178dd2ffb9860465ac89d7f23b977d"
63
+ integrity sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==
64
+
65
+ "@esbuild/linux-mips64el@0.18.20":
66
+ version "0.18.20"
67
+ resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz#eeff3a937de9c2310de30622a957ad1bd9183231"
68
+ integrity sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==
69
+
70
+ "@esbuild/linux-ppc64@0.18.20":
71
+ version "0.18.20"
72
+ resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz#2f7156bde20b01527993e6881435ad79ba9599fb"
73
+ integrity sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==
74
+
75
+ "@esbuild/linux-riscv64@0.18.20":
76
+ version "0.18.20"
77
+ resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz#6628389f210123d8b4743045af8caa7d4ddfc7a6"
78
+ integrity sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==
79
+
80
+ "@esbuild/linux-s390x@0.18.20":
81
+ version "0.18.20"
82
+ resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz#255e81fb289b101026131858ab99fba63dcf0071"
83
+ integrity sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==
84
+
85
+ "@esbuild/linux-x64@0.18.20":
86
+ version "0.18.20"
87
+ resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz#c7690b3417af318a9b6f96df3031a8865176d338"
88
+ integrity sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==
89
+
90
+ "@esbuild/netbsd-x64@0.18.20":
91
+ version "0.18.20"
92
+ resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz#30e8cd8a3dded63975e2df2438ca109601ebe0d1"
93
+ integrity sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==
94
+
95
+ "@esbuild/openbsd-x64@0.18.20":
96
+ version "0.18.20"
97
+ resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz#7812af31b205055874c8082ea9cf9ab0da6217ae"
98
+ integrity sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==
99
+
100
+ "@esbuild/sunos-x64@0.18.20":
101
+ version "0.18.20"
102
+ resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz#d5c275c3b4e73c9b0ecd38d1ca62c020f887ab9d"
103
+ integrity sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==
104
+
105
+ "@esbuild/win32-arm64@0.18.20":
106
+ version "0.18.20"
107
+ resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz#73bc7f5a9f8a77805f357fab97f290d0e4820ac9"
108
+ integrity sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==
109
+
110
+ "@esbuild/win32-ia32@0.18.20":
111
+ version "0.18.20"
112
+ resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz#ec93cbf0ef1085cc12e71e0d661d20569ff42102"
113
+ integrity sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==
114
+
115
+ "@esbuild/win32-x64@0.18.20":
116
+ version "0.18.20"
117
+ resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz#786c5f41f043b07afb1af37683d7c33668858f6d"
118
+ integrity sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==
119
+
120
+ "@jridgewell/sourcemap-codec@^1.4.15":
121
+ version "1.4.15"
122
+ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32"
123
+ integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==
124
+
125
+ "@vitejs/plugin-vue@^4.2.3":
126
+ version "4.3.3"
127
+ resolved "https://registry.yarnpkg.com/@vitejs/plugin-vue/-/plugin-vue-4.3.3.tgz#3b2337f64495f95cfea5b1497d2d3f4a0b3382b2"
128
+ integrity sha512-ssxyhIAZqB0TrpUg6R0cBpCuMk9jTIlO1GNSKKQD6S8VjnXi6JXKfUXjSsxey9IwQiaRGsO1WnW9Rkl1L6AJVw==
129
+
130
+ "@vue/compiler-core@3.3.4":
131
+ version "3.3.4"
132
+ resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.3.4.tgz#7fbf591c1c19e1acd28ffd284526e98b4f581128"
133
+ integrity sha512-cquyDNvZ6jTbf/+x+AgM2Arrp6G4Dzbb0R64jiG804HRMfRiFXWI6kqUVqZ6ZR0bQhIoQjB4+2bhNtVwndW15g==
134
+ dependencies:
135
+ "@babel/parser" "^7.21.3"
136
+ "@vue/shared" "3.3.4"
137
+ estree-walker "^2.0.2"
138
+ source-map-js "^1.0.2"
139
+
140
+ "@vue/compiler-dom@3.3.4":
141
+ version "3.3.4"
142
+ resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.3.4.tgz#f56e09b5f4d7dc350f981784de9713d823341151"
143
+ integrity sha512-wyM+OjOVpuUukIq6p5+nwHYtj9cFroz9cwkfmP9O1nzH68BenTTv0u7/ndggT8cIQlnBeOo6sUT/gvHcIkLA5w==
144
+ dependencies:
145
+ "@vue/compiler-core" "3.3.4"
146
+ "@vue/shared" "3.3.4"
147
+
148
+ "@vue/compiler-sfc@3.3.4":
149
+ version "3.3.4"
150
+ resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-3.3.4.tgz#b19d942c71938893535b46226d602720593001df"
151
+ integrity sha512-6y/d8uw+5TkCuzBkgLS0v3lSM3hJDntFEiUORM11pQ/hKvkhSKZrXW6i69UyXlJQisJxuUEJKAWEqWbWsLeNKQ==
152
+ dependencies:
153
+ "@babel/parser" "^7.20.15"
154
+ "@vue/compiler-core" "3.3.4"
155
+ "@vue/compiler-dom" "3.3.4"
156
+ "@vue/compiler-ssr" "3.3.4"
157
+ "@vue/reactivity-transform" "3.3.4"
158
+ "@vue/shared" "3.3.4"
159
+ estree-walker "^2.0.2"
160
+ magic-string "^0.30.0"
161
+ postcss "^8.1.10"
162
+ source-map-js "^1.0.2"
163
+
164
+ "@vue/compiler-ssr@3.3.4":
165
+ version "3.3.4"
166
+ resolved "https://registry.yarnpkg.com/@vue/compiler-ssr/-/compiler-ssr-3.3.4.tgz#9d1379abffa4f2b0cd844174ceec4a9721138777"
167
+ integrity sha512-m0v6oKpup2nMSehwA6Uuu+j+wEwcy7QmwMkVNVfrV9P2qE5KshC6RwOCq8fjGS/Eak/uNb8AaWekfiXxbBB6gQ==
168
+ dependencies:
169
+ "@vue/compiler-dom" "3.3.4"
170
+ "@vue/shared" "3.3.4"
171
+
172
+ "@vue/devtools-api@^6.5.0":
173
+ version "6.5.0"
174
+ resolved "https://registry.yarnpkg.com/@vue/devtools-api/-/devtools-api-6.5.0.tgz#98b99425edee70b4c992692628fa1ea2c1e57d07"
175
+ integrity sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q==
176
+
177
+ "@vue/reactivity-transform@3.3.4":
178
+ version "3.3.4"
179
+ resolved "https://registry.yarnpkg.com/@vue/reactivity-transform/-/reactivity-transform-3.3.4.tgz#52908476e34d6a65c6c21cd2722d41ed8ae51929"
180
+ integrity sha512-MXgwjako4nu5WFLAjpBnCj/ieqcjE2aJBINUNQzkZQfzIZA4xn+0fV1tIYBJvvva3N3OvKGofRLvQIwEQPpaXw==
181
+ dependencies:
182
+ "@babel/parser" "^7.20.15"
183
+ "@vue/compiler-core" "3.3.4"
184
+ "@vue/shared" "3.3.4"
185
+ estree-walker "^2.0.2"
186
+ magic-string "^0.30.0"
187
+
188
+ "@vue/reactivity@3.3.4":
189
+ version "3.3.4"
190
+ resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.3.4.tgz#a27a29c6cd17faba5a0e99fbb86ee951653e2253"
191
+ integrity sha512-kLTDLwd0B1jG08NBF3R5rqULtv/f8x3rOFByTDz4J53ttIQEDmALqKqXY0J+XQeN0aV2FBxY8nJDf88yvOPAqQ==
192
+ dependencies:
193
+ "@vue/shared" "3.3.4"
194
+
195
+ "@vue/runtime-core@3.3.4":
196
+ version "3.3.4"
197
+ resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.3.4.tgz#4bb33872bbb583721b340f3088888394195967d1"
198
+ integrity sha512-R+bqxMN6pWO7zGI4OMlmvePOdP2c93GsHFM/siJI7O2nxFRzj55pLwkpCedEY+bTMgp5miZ8CxfIZo3S+gFqvA==
199
+ dependencies:
200
+ "@vue/reactivity" "3.3.4"
201
+ "@vue/shared" "3.3.4"
202
+
203
+ "@vue/runtime-dom@3.3.4":
204
+ version "3.3.4"
205
+ resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.3.4.tgz#992f2579d0ed6ce961f47bbe9bfe4b6791251566"
206
+ integrity sha512-Aj5bTJ3u5sFsUckRghsNjVTtxZQ1OyMWCr5dZRAPijF/0Vy4xEoRCwLyHXcj4D0UFbJ4lbx3gPTgg06K/GnPnQ==
207
+ dependencies:
208
+ "@vue/runtime-core" "3.3.4"
209
+ "@vue/shared" "3.3.4"
210
+ csstype "^3.1.1"
211
+
212
+ "@vue/server-renderer@3.3.4":
213
+ version "3.3.4"
214
+ resolved "https://registry.yarnpkg.com/@vue/server-renderer/-/server-renderer-3.3.4.tgz#ea46594b795d1536f29bc592dd0f6655f7ea4c4c"
215
+ integrity sha512-Q6jDDzR23ViIb67v+vM1Dqntu+HUexQcsWKhhQa4ARVzxOY2HbC7QRW/ggkDBd5BU+uM1sV6XOAP0b216o34JQ==
216
+ dependencies:
217
+ "@vue/compiler-ssr" "3.3.4"
218
+ "@vue/shared" "3.3.4"
219
+
220
+ "@vue/shared@3.3.4":
221
+ version "3.3.4"
222
+ resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.3.4.tgz#06e83c5027f464eef861c329be81454bc8b70780"
223
+ integrity sha512-7OjdcV8vQ74eiz1TZLzZP4JwqM5fA94K6yntPS5Z25r9HDuGNzaGdgvwKYq6S+MxwF0TFRwe50fIR/MYnakdkQ==
224
+
225
+ csstype@^3.1.1:
226
+ version "3.1.2"
227
+ resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.2.tgz#1d4bf9d572f11c14031f0436e1c10bc1f571f50b"
228
+ integrity sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==
229
+
230
+ esbuild@^0.18.10:
231
+ version "0.18.20"
232
+ resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.18.20.tgz#4709f5a34801b43b799ab7d6d82f7284a9b7a7a6"
233
+ integrity sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==
234
+ optionalDependencies:
235
+ "@esbuild/android-arm" "0.18.20"
236
+ "@esbuild/android-arm64" "0.18.20"
237
+ "@esbuild/android-x64" "0.18.20"
238
+ "@esbuild/darwin-arm64" "0.18.20"
239
+ "@esbuild/darwin-x64" "0.18.20"
240
+ "@esbuild/freebsd-arm64" "0.18.20"
241
+ "@esbuild/freebsd-x64" "0.18.20"
242
+ "@esbuild/linux-arm" "0.18.20"
243
+ "@esbuild/linux-arm64" "0.18.20"
244
+ "@esbuild/linux-ia32" "0.18.20"
245
+ "@esbuild/linux-loong64" "0.18.20"
246
+ "@esbuild/linux-mips64el" "0.18.20"
247
+ "@esbuild/linux-ppc64" "0.18.20"
248
+ "@esbuild/linux-riscv64" "0.18.20"
249
+ "@esbuild/linux-s390x" "0.18.20"
250
+ "@esbuild/linux-x64" "0.18.20"
251
+ "@esbuild/netbsd-x64" "0.18.20"
252
+ "@esbuild/openbsd-x64" "0.18.20"
253
+ "@esbuild/sunos-x64" "0.18.20"
254
+ "@esbuild/win32-arm64" "0.18.20"
255
+ "@esbuild/win32-ia32" "0.18.20"
256
+ "@esbuild/win32-x64" "0.18.20"
257
+
258
+ estree-walker@^2.0.2:
259
+ version "2.0.2"
260
+ resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac"
261
+ integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==
262
+
263
+ fsevents@~2.3.2:
264
+ version "2.3.3"
265
+ resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6"
266
+ integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==
267
+
268
+ magic-string@^0.30.0:
269
+ version "0.30.3"
270
+ resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.3.tgz#403755dfd9d6b398dfa40635d52e96c5ac095b85"
271
+ integrity sha512-B7xGbll2fG/VjP+SWg4sX3JynwIU0mjoTc6MPpKNuIvftk6u6vqhDnk1R80b8C2GBR6ywqy+1DcKBrevBg+bmw==
272
+ dependencies:
273
+ "@jridgewell/sourcemap-codec" "^1.4.15"
274
+
275
+ nanoid@^3.3.6:
276
+ version "3.3.6"
277
+ resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.6.tgz#443380c856d6e9f9824267d960b4236ad583ea4c"
278
+ integrity sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==
279
+
280
+ picocolors@^1.0.0:
281
+ version "1.0.0"
282
+ resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c"
283
+ integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==
284
+
285
+ postcss@^8.1.10, postcss@^8.4.27:
286
+ version "8.4.28"
287
+ resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.28.tgz#c6cc681ed00109072816e1557f889ef51cf950a5"
288
+ integrity sha512-Z7V5j0cq8oEKyejIKfpD8b4eBy9cwW2JWPk0+fB1HOAMsfHbnAXLLS+PfVWlzMSLQaWttKDt607I0XHmpE67Vw==
289
+ dependencies:
290
+ nanoid "^3.3.6"
291
+ picocolors "^1.0.0"
292
+ source-map-js "^1.0.2"
293
+
294
+ rollup@^3.27.1:
295
+ version "3.28.1"
296
+ resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.28.1.tgz#fb44aa6d5e65c7e13fd5bcfff266d0c4ea9ba433"
297
+ integrity sha512-R9OMQmIHJm9znrU3m3cpE8uhN0fGdXiawME7aZIpQqvpS/85+Vt1Hq1/yVIcYfOmaQiHjvXkQAoJukvLpau6Yw==
298
+ optionalDependencies:
299
+ fsevents "~2.3.2"
300
+
301
+ source-map-js@^1.0.2:
302
+ version "1.0.2"
303
+ resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c"
304
+ integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==
305
+
306
+ vite@^4.4.6:
307
+ version "4.4.9"
308
+ resolved "https://registry.yarnpkg.com/vite/-/vite-4.4.9.tgz#1402423f1a2f8d66fd8d15e351127c7236d29d3d"
309
+ integrity sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==
310
+ dependencies:
311
+ esbuild "^0.18.10"
312
+ postcss "^8.4.27"
313
+ rollup "^3.27.1"
314
+ optionalDependencies:
315
+ fsevents "~2.3.2"
316
+
317
+ vue-router@^4.2.4:
318
+ version "4.2.4"
319
+ resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-4.2.4.tgz#382467a7e2923e6a85f015d081e1508052c191b9"
320
+ integrity sha512-9PISkmaCO02OzPVOMq2w82ilty6+xJmQrarYZDkjZBfl4RvYAlt4PKnEX21oW4KTtWfa9OuO/b3qk1Od3AEdCQ==
321
+ dependencies:
322
+ "@vue/devtools-api" "^6.5.0"
323
+
324
+ vue@^3.3.4:
325
+ version "3.3.4"
326
+ resolved "https://registry.yarnpkg.com/vue/-/vue-3.3.4.tgz#8ed945d3873667df1d0fcf3b2463ada028f88bd6"
327
+ integrity sha512-VTyEYn3yvIeY1Py0WaYGZsXnz3y5UnGi62GjVEqvEGPl6nxbOrCXbVOTQWBEJUqAyTUk2uJ5JLVnYJ6ZzGbrSw==
328
+ dependencies:
329
+ "@vue/compiler-dom" "3.3.4"
330
+ "@vue/compiler-sfc" "3.3.4"
331
+ "@vue/runtime-dom" "3.3.4"
332
+ "@vue/server-renderer" "3.3.4"
333
+ "@vue/shared" "3.3.4"
package/jsconfig.json CHANGED
@@ -34,6 +34,9 @@
34
34
  ],
35
35
  "#edge": [
36
36
  "./lib/platform/edgehooks/index.js"
37
+ ],
38
+ "#commands": [
39
+ "./lib/commands/index.js"
37
40
  ]
38
41
  }
39
42
  }
@@ -8,6 +8,7 @@ import {
8
8
  feedback, debug, generateTimestamp, getAbsoluteLibDirPath, presets,
9
9
  } from '#utils';
10
10
  import { Messages } from '#constants';
11
+ import { vulcan } from '#env';
11
12
 
12
13
  const vulcanLibPath = getAbsoluteLibDirPath();
13
14
  const vulcanRootPath = resolve(vulcanLibPath, '..');
@@ -148,21 +149,24 @@ async function loadBuildContext(preset, entry, mode) {
148
149
  }
149
150
 
150
151
  /**
151
- * Generates a build ID and saves it in the .env file (for deploy).
152
- * @returns {Promise<string>} The generated build ID.
152
+ Create a .env file in the build folder with specified parameters.
153
+ * @param {string} buildId - The version ID to write into the .env file.
154
+ * @param {string} entry - Entrypoint path.
155
+ * @param {string} preset - The preset to write into the .env file.
156
+ * @param {string} mode - The mode to write into the .env file.
157
+ * @param {boolean} useNodePolyfills - The flag to indicates polyfills use.
153
158
  */
154
- function generateBuildId() {
159
+ function createDotEnvFile(buildId) {
155
160
  const projectRoot = process.cwd();
156
161
  const outputPath = isWindows ? fileURLToPath(new URL(`file:///${join(projectRoot, '.edge')}`)) : join(projectRoot, '.edge');
157
-
158
162
  const envFilePath = join(outputPath, '.env');
159
- const BUILD_VERSION___AKA__VERSION_ID = generateTimestamp();
160
- const envContent = `VERSION_ID=${BUILD_VERSION___AKA__VERSION_ID}`;
163
+
164
+ const envContent = [
165
+ `VERSION_ID=${buildId}`,
166
+ ].join('\n');
161
167
 
162
168
  mkdirSync(outputPath, { recursive: true });
163
169
  writeFileSync(envFilePath, envContent);
164
-
165
- return BUILD_VERSION___AKA__VERSION_ID;
166
170
  }
167
171
 
168
172
  /**
@@ -177,15 +181,14 @@ class Dispatcher {
177
181
  * @param {string} preset - The preset for the build.
178
182
  * @param {string} mode - The mode of build target.
179
183
  * @param {string} entry - The entry point for the build.
180
- * @param {string} versionId - The version ID for the build.
181
184
  * @param {boolean} useNodePolyfills - The flag to indicates polyfills use.
182
185
  */
183
- constructor(preset, mode, entry, versionId, useNodePolyfills) {
186
+ constructor(preset, mode, entry, useNodePolyfills) {
184
187
  this.preset = preset;
185
188
  this.mode = mode;
186
189
  this.entry = entry;
187
- this.versionId = versionId;
188
190
  this.useNodePolyfills = useNodePolyfills;
191
+ this.buildId = generateTimestamp();
189
192
  }
190
193
 
191
194
  /**
@@ -199,29 +202,27 @@ class Dispatcher {
199
202
  this.mode,
200
203
  );
201
204
 
202
- const buildId = generateBuildId();
203
-
204
205
  const buildContext = {
205
206
  preset: this.preset,
206
- entry: this.entry,
207
207
  mode: this.mode,
208
- cliVersionId: this.versionId,
209
- useNodePolyfills: this.useNodePolyfills,
210
- buildId,
211
- config,
208
+ entry: this.entry,
212
209
  entryContent,
210
+ config,
211
+ useNodePolyfills: this.useNodePolyfills,
212
+ buildId: this.buildId,
213
213
  };
214
214
 
215
215
  // Run prebuild actions
216
216
  try {
217
217
  feedback.prebuild.info(Messages.build.info.prebuild_starting);
218
218
  await prebuild(buildContext);
219
+ createDotEnvFile(this.buildId);
219
220
  feedback.prebuild.success(Messages.build.success.prebuild_succeeded);
220
221
 
221
222
  feedback.build.info(Messages.build.info.vulcan_build_starting);
222
223
  // create tmp entrypoint
223
224
  const currentDir = process.cwd();
224
- let tempEntryFile = `vulcan-${buildId}.temp.`;
225
+ let tempEntryFile = `vulcan-${this.buildId}.temp.`;
225
226
  tempEntryFile += (this.preset === 'typescript') ? 'ts' : 'js';
226
227
  const tempBuilderEntryPath = join(currentDir, tempEntryFile);
227
228
 
@@ -229,7 +230,7 @@ class Dispatcher {
229
230
 
230
231
  // builder entry
231
232
  config.entry = tempBuilderEntryPath;
232
- config.buildId = buildId;
233
+ config.buildId = this.buildId;
233
234
  config.useNodePolyfills = this.useNodePolyfills;
234
235
 
235
236
  let builder;
@@ -250,9 +251,17 @@ class Dispatcher {
250
251
 
251
252
  // delete .temp files
252
253
  rmSync(tempBuilderEntryPath);
254
+
255
+ await vulcan.createVulcanEnv({
256
+ entry: this.entry,
257
+ preset: this.preset,
258
+ mode: this.mode,
259
+ useNodePolyfills: this.useNodePolyfills,
260
+ }, 'local');
261
+
253
262
  feedback.build.success(Messages.build.success.vulcan_build_succeeded);
254
263
  } catch (error) {
255
- debug.error(error);
264
+ feedback.build.error(error);
256
265
  process.exit(1);
257
266
  }
258
267
  };
@@ -0,0 +1,85 @@
1
+ import { createPromptModule } from 'inquirer';
2
+
3
+ const prompt = createPromptModule();
4
+ /**
5
+ * A command to handle authentication through various methods.
6
+ * @memberof commands
7
+ * @param {object} options - Configuration options for authentication
8
+ * @param {string} [options.password] - Credentials in the format "username:password"
9
+ * @param {string} [options.token] - Personal authentication token
10
+ * @returns {Promise<void>} - A promise that resolves when authentication is complete
11
+ * @example
12
+ *
13
+ * authCommand({
14
+ * password: 'username:password'
15
+ * });
16
+ *
17
+ * authCommand({
18
+ * token: 'your_personal_token'
19
+ * });
20
+ *
21
+ * authCommand({});
22
+ */
23
+ async function authCommand(options) {
24
+ const { core } = await import('#platform');
25
+
26
+ const authOptions = [
27
+ {
28
+ name: 'Username and Password',
29
+ value: 'password',
30
+ },
31
+ {
32
+ name: 'Personal Token',
33
+ value: 'token',
34
+ },
35
+ ];
36
+
37
+ if (options.password) {
38
+ const [username, password] = options.password.split(':');
39
+ core.actions.auth('password', { username, password });
40
+ }
41
+
42
+ if (options.token) {
43
+ const { token } = options;
44
+ core.actions.auth('token', { token });
45
+ }
46
+
47
+ if (!options.token && !options.password) {
48
+ const { authOption } = await prompt([
49
+ {
50
+ type: 'list',
51
+ name: 'authOption',
52
+ message: 'Choose your login option:',
53
+ choices: authOptions.map((option) => option.name),
54
+ },
55
+ ]);
56
+
57
+ if (authOption === 'Username and Password') {
58
+ const { username, password } = await prompt([
59
+ {
60
+ type: 'input',
61
+ name: 'username',
62
+ message: 'Enter your username:',
63
+ },
64
+ {
65
+ type: 'password',
66
+ name: 'password',
67
+ message: 'Enter your password:',
68
+ },
69
+ ]);
70
+ core.actions.auth('password', { username, password });
71
+ }
72
+ if (authOption === 'Personal Token') {
73
+ const { token } = await prompt([
74
+ {
75
+ type: 'password',
76
+ name: 'token',
77
+ message: 'Enter your personal token:',
78
+ },
79
+ ]);
80
+ core.actions.auth('token', { token });
81
+ }
82
+ }
83
+ }
84
+
85
+ export default authCommand;
@@ -0,0 +1,47 @@
1
+ import { feedback } from '#utils';
2
+
3
+ /**
4
+ * A command to initiate the build process.
5
+ * @memberof commands
6
+ * @param {object} options - Configuration options for the build command
7
+ * @param {string} options.entry - The entry point file for the build
8
+ * @param {string} options.preset - Preset to be used (e.g., 'javascript', 'typescript')
9
+ * @param {string} options.mode - Mode in which to run the build (e.g., 'deliver', 'compute')
10
+ * @param {boolean} options.useNodePolyfills - Whether to use Node.js polyfills
11
+ * @returns {Promise<void>} - A promise that resolves when the build is complete
12
+ * @example
13
+ *
14
+ * buildCommand({
15
+ * entry: './src/index.js',
16
+ * preset: 'javascript',
17
+ * mode: 'compute',
18
+ * useNodePolyfills: false
19
+ * });
20
+ */
21
+ async function buildCommand({
22
+ entry, preset, mode, useNodePolyfills,
23
+ }) {
24
+ let entryPoint = null;
25
+
26
+ if (preset === 'javascript') {
27
+ entryPoint = entry;
28
+ feedback.info('Using main.js as entrypoint by default');
29
+ }
30
+ if (preset === 'typescript') {
31
+ if (entry) { entryPoint = entry; }
32
+ feedback.info('Using main.ts as entrypoint by default');
33
+ if (!entry) { entryPoint = './main.ts'; }
34
+ }
35
+
36
+ const BuildDispatcher = (await import('#build')).default;
37
+ const buildDispatcher = new BuildDispatcher(
38
+ preset,
39
+ mode,
40
+ entryPoint,
41
+ useNodePolyfills,
42
+ );
43
+
44
+ await buildDispatcher.run();
45
+ }
46
+
47
+ export default buildCommand;
@@ -0,0 +1,45 @@
1
+ import { join } from 'path';
2
+ import { createPromptModule } from 'inquirer';
3
+
4
+ const prompt = createPromptModule();
5
+ /**
6
+ * A Command to deploy a web application.
7
+ * @memberof commands
8
+ * This command will ask for the application name and function name via the terminal.
9
+ * Then, it will upload static files and deploy the application.
10
+ * Finally, it watches for the propagation of the deployment.
11
+ * @returns {Promise<void>} - A promise that resolves when the deployment is complete.
12
+ * @example
13
+ *
14
+ * deployCommand();
15
+ */
16
+ async function deployCommand() {
17
+ const { core } = await import('#platform');
18
+ const { getVulcanBuildId } = await import('#utils');
19
+
20
+ const versionId = getVulcanBuildId();
21
+ const staticsPath = join(process.cwd(), '/.edge/storage');
22
+
23
+ const answers = await prompt([
24
+ {
25
+ type: 'input',
26
+ name: 'applicationName',
27
+ message:
28
+ 'Enter the name of the application (optional, leave empty for random name):',
29
+ },
30
+ {
31
+ type: 'input',
32
+ name: 'functionName',
33
+ message:
34
+ 'Enter the name of the function (optional, leave empty for random name):',
35
+ },
36
+ ]);
37
+
38
+ const { applicationName, functionName } = answers;
39
+
40
+ await core.actions.uploadStatics(versionId, staticsPath);
41
+ const domain = await core.actions.deploy(applicationName, functionName);
42
+ core.actions.watchPropagation(domain);
43
+ }
44
+
45
+ export default deployCommand;
@@ -0,0 +1,26 @@
1
+ import { join } from 'path';
2
+
3
+ /**
4
+ * A command to start the development server.
5
+ * @memberof commands
6
+ *
7
+ * This function takes a file path and options object as arguments.
8
+ * The file path is the entry point for the development server,
9
+ * and the options object contains the port number.
10
+ * @param {string} entry - The path to the file that serves as the
11
+ * entry point for the development server.
12
+ * @param {object} options - An object containing configuration options.
13
+ * @param {string|number} options.port - The port number on which the development server will run.
14
+ * @returns {Promise<void>} - A promise that resolves when the development server starts.
15
+ * @example
16
+ *
17
+ * devCommand('./path/to/entry.js', { port: 3000 });
18
+ */
19
+ async function devCommand(entry, { port }) {
20
+ const parsedPort = parseInt(port, 10);
21
+ const { server } = await import('#env');
22
+ const entryPoint = entry || join(process.cwd(), '.edge/worker.js');
23
+ server(entryPoint, parsedPort);
24
+ }
25
+
26
+ export default devCommand;