@aziontech/bundler 1.1.3 → 1.2.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/README.md +79 -68
- package/dist/index-Dx9B4Utx.js +2290 -0
- package/dist/index.js +94 -54
- package/dist/utils-CSEkDVys.js +399 -0
- package/package.json +9 -10
- package/dist/index-dMuB6SYF.js +0 -2147
- package/dist/utils-DkUMNTN3.js +0 -329
package/README.md
CHANGED
|
@@ -23,6 +23,7 @@ Azion Bundler is a powerful tool designed to build and adapt projects for edge c
|
|
|
23
23
|
- [`presets`](#presets)
|
|
24
24
|
- [`store`](#store)
|
|
25
25
|
- [`manifest`](#manifest)
|
|
26
|
+
- [`telemetry`](#telemetry)
|
|
26
27
|
- [Configuration](#configuration)
|
|
27
28
|
- [Build Process Flow](#build-process-flow)
|
|
28
29
|
- [Documentation](#documentation)
|
|
@@ -120,14 +121,47 @@ Builds your project for edge deployment.
|
|
|
120
121
|
azbundler build [options]
|
|
121
122
|
|
|
122
123
|
Options:
|
|
123
|
-
-e, --entry <
|
|
124
|
-
-p, --preset <type>
|
|
125
|
-
--polyfills
|
|
126
|
-
-w, --worker
|
|
127
|
-
-d, --dev
|
|
128
|
-
-x, --experimental
|
|
124
|
+
-e, --entry <entries...> Code entrypoint (default: ./main.js or ./main.ts)
|
|
125
|
+
-p, --preset <type> Preset of build target (e.g., vue, next, javascript)
|
|
126
|
+
--polyfills [boolean] Use node polyfills in build (default: true)
|
|
127
|
+
-w, --worker [boolean] Indicates that the constructed code inserts its own worker expression (default: false)
|
|
128
|
+
-d, --dev Build in development mode (default: false)
|
|
129
|
+
-x, --experimental Enable experimental features (default: false)
|
|
130
|
+
--skip-framework-build Skip framework build step (default: false)
|
|
131
|
+
--config-version <version> Config (Azion API) version: 3 or 4. Overrides the `version` field of azion.config (default: 4)
|
|
132
|
+
--config-file <path> Path to the azion.config file to use (default: azion.config.* found in the current directory)
|
|
133
|
+
--only-generate-config Build only generate azion.config (default: false)
|
|
134
|
+
--telemetry [format] Enable telemetry output (console, json, html or both; defaults to both)
|
|
135
|
+
--alias-env Rewrite env var names to a per-project prefix to avoid cross-project naming collisions (default: false)
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
#### Config version
|
|
139
|
+
|
|
140
|
+
The bundler can target the Azion API v3 or v4 config. The version is resolved in this order:
|
|
141
|
+
|
|
142
|
+
1. `--config-version` (also available on `dev`, `manifest` and `presets config`)
|
|
143
|
+
2. the `version` field of your `azion.config`
|
|
144
|
+
3. the default, `4`
|
|
145
|
+
|
|
146
|
+
If you already use the v3 config, add `version: 3` to your `azion.config` (or pass `--config-version 3`). When there is no `azion.config`, the generated one is created from the preset for the resolved version and declares `version` explicitly. Using the flag and a different `version` in `azion.config` is an error.
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
azbundler build --preset react --config-version 3
|
|
150
|
+
azbundler presets config react --config-version 3
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
#### Config file
|
|
154
|
+
|
|
155
|
+
By default the bundler looks for `azion.config.*` in the current directory. Use `--config-file` to point to another file, for example one per environment. It is available on `build`, `dev`, `manifest`, `config` and `presets config`.
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
azbundler build --config-file ./azion.staging.config.ts
|
|
159
|
+
azbundler dev --config-file ./azion.staging.config.ts
|
|
160
|
+
azbundler config read -a --config-file ./azion.staging.config.ts
|
|
129
161
|
```
|
|
130
162
|
|
|
163
|
+
Relative paths are resolved from the current directory. If the file does not exist the command fails, it does not fall back to the default `azion.config`. The bundler never generates an `azion.config` when `--config-file` is used. In `dev`, changes to the given file rebuild the project, even when it is outside the project directory. On `manifest`, `-e/--entry` takes precedence over `--config-file`, and the `transform` action ignores it. On `config`, `create` and `delete` need a `.js`, `.mjs`, `.cjs` or `.ts` file.
|
|
164
|
+
|
|
131
165
|
### `dev`
|
|
132
166
|
|
|
133
167
|
Starts a local development environment.
|
|
@@ -141,6 +175,10 @@ Arguments:
|
|
|
141
175
|
Options:
|
|
142
176
|
-p, --port <port> Specify the port (default: "3333")
|
|
143
177
|
-x, --experimental Enable experimental features (default: false)
|
|
178
|
+
--skip-framework-build Skip framework build step (default: false)
|
|
179
|
+
--function-name <name> Specify the function name
|
|
180
|
+
--config-version <version> Config (Azion API) version: 3 or 4. Overrides the `version` field of azion.config (default: 4)
|
|
181
|
+
--config-file <path> Path to the azion.config file to use (default: azion.config.* found in the current directory)
|
|
144
182
|
```
|
|
145
183
|
|
|
146
184
|
### `config`
|
|
@@ -151,22 +189,26 @@ Manages Azion configuration settings with CRUD operations.
|
|
|
151
189
|
azbundler config <command> [options]
|
|
152
190
|
|
|
153
191
|
Commands:
|
|
154
|
-
create
|
|
155
|
-
read
|
|
156
|
-
update
|
|
157
|
-
delete
|
|
192
|
+
create Create a new configuration property
|
|
193
|
+
read Read configuration properties
|
|
194
|
+
update Update existing configuration properties
|
|
195
|
+
delete Delete configuration properties
|
|
196
|
+
replace Replace a placeholder value across the configuration
|
|
158
197
|
|
|
159
198
|
Options:
|
|
160
|
-
-k, --key <key
|
|
161
|
-
-v, --value <value
|
|
162
|
-
-a, --all
|
|
199
|
+
-k, --key <key...> Property key (e.g., build.preset or applications[0].name)
|
|
200
|
+
-v, --value <value...> Value to be set (for create/update/replace commands)
|
|
201
|
+
-a, --all Read or delete entire configuration (for read/delete commands)
|
|
202
|
+
-r, --replacements <replacements> JSON string of key-value pairs for replacement
|
|
163
203
|
|
|
164
204
|
Examples:
|
|
165
205
|
$ azbundler config create -k "build.preset" -v "typescript"
|
|
166
|
-
$ azbundler config read -
|
|
167
|
-
$ azbundler config
|
|
168
|
-
$ azbundler config
|
|
169
|
-
$ azbundler config
|
|
206
|
+
$ azbundler config read -a
|
|
207
|
+
$ azbundler config read -k "build.preset"
|
|
208
|
+
$ azbundler config update -k "build.preset" -v "vue"
|
|
209
|
+
$ azbundler config delete -a
|
|
210
|
+
$ azbundler config delete -k "build.preset"
|
|
211
|
+
$ azbundler config replace -k '$EDGE_FUNCTION_NAME' -v "my-func"
|
|
170
212
|
```
|
|
171
213
|
|
|
172
214
|
### `presets`
|
|
@@ -226,6 +268,21 @@ Examples:
|
|
|
226
268
|
$ azbundler manifest -e azion.config.js -o .edge
|
|
227
269
|
```
|
|
228
270
|
|
|
271
|
+
### `telemetry`
|
|
272
|
+
|
|
273
|
+
Opens the telemetry HTML report in the default browser.
|
|
274
|
+
|
|
275
|
+
```shell
|
|
276
|
+
azbundler telemetry [options]
|
|
277
|
+
|
|
278
|
+
Options:
|
|
279
|
+
-p, --path <path> Custom path to the telemetry HTML file
|
|
280
|
+
|
|
281
|
+
Examples:
|
|
282
|
+
$ azbundler telemetry
|
|
283
|
+
$ azbundler telemetry --path ./custom-report.html
|
|
284
|
+
```
|
|
285
|
+
|
|
229
286
|
## Configuration
|
|
230
287
|
|
|
231
288
|
The configuration file (`azion.config.js` or `azion.config.ts`) offers a robust configuration system for Bundler. With Azion Bundler, you can extend configurations and leverage pre-configured framework presets for immediate use. The tool empowers users to create their own automations and extensions, making it highly customizable for specific project needs.
|
|
@@ -344,9 +401,10 @@ export default defineConfig({
|
|
|
344
401
|
|
|
345
402
|
## Documentation
|
|
346
403
|
|
|
347
|
-
- [Handler Patterns](docs/handler-patterns.md)
|
|
348
|
-
- [Node.js APIs](docs/nodejs-apis.md)
|
|
349
|
-
- [Nextjs](docs/nextjs.md)
|
|
404
|
+
- [Handler Patterns](https://github.com/aziontech/bundler/blob/main/packages/bundler/docs/handler-patterns.md)
|
|
405
|
+
- [Node.js APIs](https://github.com/aziontech/bundler/blob/main/packages/bundler/docs/nodejs-apis.md)
|
|
406
|
+
- [Nextjs](https://github.com/aziontech/bundler/blob/main/packages/bundler/docs/nextjs.md)
|
|
407
|
+
- [Environment Variable Prefixing](https://github.com/aziontech/bundler/blob/main/packages/bundler/docs/env-var-prefixing.md)
|
|
350
408
|
- [Rust/Wasm example](https://github.com/aziontech/bundler-examples/tree/main/examples/rust-wasm-yew-ssr/)
|
|
351
409
|
- [Emscripten/Wasm example](https://github.com/aziontech/bundler-examples/tree/main/examples/emscripten-wasm/)
|
|
352
410
|
- [Env vars example](https://github.com/aziontech/bundler-examples/tree/main/examples/javascript/simple-js-env-vars)
|
|
@@ -355,54 +413,7 @@ export default defineConfig({
|
|
|
355
413
|
|
|
356
414
|
## Supported Features
|
|
357
415
|
|
|
358
|
-
E2E tests run daily in the [Bundler Examples](https://github.com/aziontech/bundler-examples/tree/main/examples) to ensure that the presets and frameworks continue to work correctly.
|
|
359
|
-
|
|
360
|
-
Table:
|
|
361
|
-
| Test | Status |
|
|
362
|
-
| ------------------------------------ | ------ |
|
|
363
|
-
| Next 14 2 15 Middleware | ✅ |
|
|
364
|
-
| Next 13 5 6 I18n | ✅ |
|
|
365
|
-
| Next 12 3 4 I18n | ✅ |
|
|
366
|
-
| Hexo Static | ✅ |
|
|
367
|
-
| Next 13 5 6 Middleware | ✅ |
|
|
368
|
-
| Next 12 3 4 Middleware | ✅ |
|
|
369
|
-
| Next Node Pages 12 3 1 | ✅ |
|
|
370
|
-
| Next 13 5 6 Config | ✅ |
|
|
371
|
-
| Next 12 3 4 Config | ✅ |
|
|
372
|
-
| Html | ✅ |
|
|
373
|
-
| Next Static | ✅ |
|
|
374
|
-
| Gatsby Static | ✅ |
|
|
375
|
-
| Next Node Pages 12 3 1 Fs | ✅ |
|
|
376
|
-
| Sveltekit Static | ✅ |
|
|
377
|
-
| Vue Vite Static | ✅ |
|
|
378
|
-
| Qwik Static | ✅ |
|
|
379
|
-
| Opennext Ssr | ✅ |
|
|
380
|
-
| Sveltekit Ssr | ✅ |
|
|
381
|
-
| Next 12 Static | ✅ |
|
|
382
|
-
| Hugo | ✅ |
|
|
383
|
-
| Astro Static | ✅ |
|
|
384
|
-
| Simple Js Env Vars | ✅ |
|
|
385
|
-
| Eleventy Static | ✅ |
|
|
386
|
-
| Simple Js Network List | ✅ |
|
|
387
|
-
| Angular Static | ✅ |
|
|
388
|
-
| React Static | ✅ |
|
|
389
|
-
| Svelte Static | ✅ |
|
|
390
|
-
| Stencil Static | ⚠️ |
|
|
391
|
-
| Vitepress Static | ✅ |
|
|
392
|
-
| Preact Static | ✅ |
|
|
393
|
-
| Vuepress Static | ✅ |
|
|
394
|
-
| Nuxt Static | ✅ |
|
|
395
|
-
| Docusaurus Static | ✅ |
|
|
396
|
-
| Simple Js Firewall Event | ✅ |
|
|
397
|
-
| Nuxt Ssr | ✅ |
|
|
398
|
-
| Simple Js Network List With Firewall | ✅ |
|
|
399
|
-
| Jekyll Static | ✅ |
|
|
400
|
-
| Simple Js Esm Worker | ✅ |
|
|
401
|
-
| Simple Js Esm Node | ✅ |
|
|
402
|
-
| Simple Js Esm | ✅ |
|
|
403
|
-
| Simple Ts Esm | ✅ |
|
|
404
|
-
|
|
405
|
-
Last test run date: 07/05/26 04:19:39 AM
|
|
416
|
+
E2E tests run daily in the [Bundler Examples](https://github.com/aziontech/bundler-examples/tree/main/examples) to ensure that the presets and frameworks continue to work correctly. Failures are reported to the team on Slack instead of being tracked here.
|
|
406
417
|
|
|
407
418
|
## Contributing
|
|
408
419
|
|