Skip to content

Commit f1b0825

Browse files
authored
Merge pull request #291 from aziontech/stage
Release 2.2.0
2 parents 35592e6 + cde050a commit f1b0825

13 files changed

Lines changed: 755 additions & 18 deletions

File tree

CHANGELOG.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,45 @@
1+
## [2.2.0-stage.6](https://github.com/aziontech/lib/compare/v2.2.0-stage.5...v2.2.0-stage.6) (2025-10-15)
2+
3+
4+
### Bug Fixes
5+
6+
* next handler wait until bind (#293) ([ceffe0a](https://github.com/aziontech/lib/commit/ceffe0a439e3413d415071de7374bcc2e804f17e))
7+
8+
## [2.2.0-stage.5](https://github.com/aziontech/lib/compare/v2.2.0-stage.4...v2.2.0-stage.5) (2025-10-15)
9+
10+
11+
### Bug Fixes
12+
13+
* remove extra slash in rewrite request URI pattern for Nuxt preset (#292) ([c9cde09](https://github.com/aziontech/lib/commit/c9cde09587588d0d4eefb178038a46f4023ae28b))
14+
15+
## [2.2.0-stage.4](https://github.com/aziontech/lib/compare/v2.2.0-stage.3...v2.2.0-stage.4) (2025-10-15)
16+
17+
18+
### Bug Fixes
19+
20+
* handle root path correctly when fetching prerendered assets (#290) ([a33c1b9](https://github.com/aziontech/lib/commit/a33c1b9e98d985624a71b98dc98cb6e9ba630bd0))
21+
22+
## [2.2.0-stage.3](https://github.com/aziontech/lib/compare/v2.2.0-stage.2...v2.2.0-stage.3) (2025-10-14)
23+
24+
25+
### Bug Fixes
26+
27+
* replace hardcoded connector name with environment variable (#289) ([08b9c23](https://github.com/aziontech/lib/commit/08b9c2388bf39ba16a2e8688cf01485a612ed318))
28+
29+
## [2.2.0-stage.2](https://github.com/aziontech/lib/compare/v2.2.0-stage.1...v2.2.0-stage.2) (2025-10-14)
30+
31+
32+
### Bug Fixes
33+
34+
* update exports path for nuxt presets to include nitro subdirectory (#288) ([96caa80](https://github.com/aziontech/lib/commit/96caa8070386e00e8087b16bb25d32ddb3e8ea8b))
35+
36+
## [2.2.0-stage.1](https://github.com/aziontech/lib/compare/v2.1.4...v2.2.0-stage.1) (2025-10-14)
37+
38+
39+
### Features
40+
41+
* add Azion deployment support with SSR and static presets (#286) ([8cea74c](https://github.com/aziontech/lib/commit/8cea74c42faef605554ccb156e45a0ee148a038c))
42+
143
### [2.1.4](https://github.com/aziontech/lib/compare/v2.1.3...v2.1.4) (2025-10-07)
244

345

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,13 @@ export default defineConfig({
434434
});
435435
```
436436

437-
Read more in the [AzionConfig README](./packages/config/README.md).
437+
Read more in the [AzionConfig README](https://github.com/aziontech/lib/tree/main/packages/config/README.md).
438+
439+
## Presets
440+
441+
The Presets package provides pre-configured presets for different frameworks and libraries to simplify the development process.
442+
443+
Read more in the [Presets README](https://github.com/aziontech/lib/tree/main/packages/presets/README.md).
438444

439445
## Contributing
440446

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "azion",
3-
"version": "2.1.4",
3+
"version": "2.2.0-stage.6",
44
"description": "Azion Packages for Edge Computing.",
55
"scripts": {
66
"prepare": "husky",
@@ -76,7 +76,8 @@
7676
"cli/**/*",
7777
"packages/unenv-preset/src/polyfills/*",
7878
"packages/bundler/src/polyfills/*",
79-
"packages/presets/src/presets/next/*"
79+
"packages/presets/src/presets/next/*",
80+
"packages/presets/src/presets/nuxt/nitro/*"
8081
],
8182
"exports": {
8283
".": {
@@ -88,6 +89,7 @@
8889
"import": "./packages/presets/dist/index.js"
8990
},
9091
"./presets/preset/*": "./packages/presets/dist/presets/*",
92+
"./preset/nuxt/*": "./packages/presets/src/presets/nuxt/nitro/*/index.js",
9193
"./bundler": {
9294
"require": "./packages/bundler/dist/index.cjs",
9395
"import": "./packages/bundler/dist/index.js"

packages/presets/README.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Azion Presets
2+
3+
The Presets package provides pre-configured presets for different frameworks and libraries to simplify deployment on the Azion Edge Platform.
4+
5+
## Available Presets
6+
7+
- Angular
8+
- Astro
9+
- Docusaurus
10+
- Eleventy
11+
- Emscripten
12+
- Gatsby
13+
- Hexo
14+
- HTML
15+
- Hugo
16+
- JavaScript
17+
- Jekyll
18+
- Next.js
19+
- Nuxt.js
20+
- OpenNext.js
21+
- Preact
22+
- Qwik
23+
- React
24+
- Rust WASM
25+
- Stencil
26+
- Svelte
27+
- TypeScript
28+
- VitePress
29+
- Vue
30+
- VuePress
31+
32+
## Usage with Azion CLI
33+
34+
1. **Link your project:**
35+
36+
```bash
37+
azion link
38+
```
39+
40+
> Choose the preset you want to use when prompted.
41+
42+
2. **Build and preview:**
43+
44+
```bash
45+
azion build
46+
azion dev
47+
```
48+
49+
3. **Deploy:**
50+
```bash
51+
azion deploy --local
52+
```
53+
54+
### Nuxt.js Custom Preset (Nitro)
55+
56+
Supports both Server-Side Rendering (SSR) and Static Site Generation (SSG) for Nuxt.js applications.
57+
58+
**Features:**
59+
60+
- SSR support with edge runtime optimization
61+
- SSG support with automatic static generation
62+
- Seamless integration with Azion CLI
63+
- Optimized for edge computing performance
64+
65+
**Quick Start:**
66+
67+
```bash
68+
npm install azion
69+
```
70+
71+
Configure your `nuxt.config.ts`:
72+
73+
```typescript
74+
import { createRequire } from 'module';
75+
const require = createRequire(import.meta.url);
76+
77+
export default defineNuxtConfig({
78+
nitro: {
79+
preset: require.resolve('azion/preset/nuxt/ssr'), // or 'azion/preset/nuxt/ssg'
80+
},
81+
});
82+
```
83+
84+
📖 **[Read the complete Nuxt.js preset documentation](https://github.com/aziontech/lib/tree/main/packages/presets/docs/preset-nuxt.md)**
85+
86+
## Contributing
87+
88+
We welcome contributions to add support for more frameworks and improve existing presets. Please check the main [Contributing Guidelines](https://github.com/aziontech/lib/tree/main/README.md#contributing) for more information.
Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
# Nuxt.js Preset
2+
3+
This preset enables Server-Side Rendering (SSR) and Static Site Generation (SSG) for Nuxt.js applications on the Azion Platform.
4+
5+
## Prerequisites
6+
7+
- Node.js 18+
8+
- Nuxt.js 3.x project
9+
- Azion CLI installed globally
10+
11+
## Installation
12+
13+
First, install the Azion package in your Nuxt.js project:
14+
15+
```bash
16+
npm install azion
17+
```
18+
19+
## Configuration SSR
20+
21+
Configure your `nuxt.config.ts` to use the Azion SSR preset:
22+
23+
```typescript
24+
import { createRequire } from 'module';
25+
const require = createRequire(import.meta.url);
26+
27+
export default defineNuxtConfig({
28+
nitro: {
29+
preset: require.resolve('azion/preset/nuxt/ssr'),
30+
},
31+
});
32+
```
33+
34+
Or directly with the path node_modules:
35+
36+
```typescript
37+
export default defineNuxtConfig({
38+
nitro: {
39+
preset: './node_modules/azion/packages/presets/src/presets/nuxt/nitro/ssr',
40+
},
41+
});
42+
```
43+
44+
## Configuration SSG
45+
46+
Configure your `nuxt.config.ts` to use the Azion SSG preset:
47+
48+
```typescript
49+
import { createRequire } from 'module';
50+
const require = createRequire(import.meta.url);
51+
52+
export default defineNuxtConfig({
53+
nitro: {
54+
preset: require.resolve('azion/preset/nuxt/ssg'),
55+
},
56+
});
57+
```
58+
59+
Or directly with the path node_modules:
60+
61+
```typescript
62+
export default defineNuxtConfig({
63+
nitro: {
64+
preset: './node_modules/azion/packages/presets/src/presets/nuxt/nitro/ssg',
65+
},
66+
});
67+
```
68+
69+
## If your configuration not contains the nitro preset
70+
71+
If your `nuxt.config.ts` doesn't include a nitro preset configuration, our preset will automatically execute `npx nuxt generate` to create a static project.
72+
73+
```typescript
74+
export default defineNuxtConfig({
75+
...
76+
});
77+
```
78+
79+
## Project Setup
80+
81+
### 1. Link Your Project
82+
83+
Connect your project to Azion and select the Nuxt preset:
84+
85+
```bash
86+
azion link
87+
```
88+
89+
When prompted, choose the **Nuxt preset** from the available options.
90+
91+
## Development Workflow
92+
93+
### Preview Your Application
94+
95+
#### Build and Preview
96+
97+
Build your application and preview it locally:
98+
99+
```bash
100+
azion build
101+
azion dev
102+
```
103+
104+
#### Skip Framework Build (Optional)
105+
106+
If you want to skip the Nuxt.js framework build process and use existing build artifacts:
107+
108+
```bash
109+
azion dev --skip-framework-build
110+
```
111+
112+
This is useful when you've already built your Nuxt application and want to quickly test the edge function behavior.
113+
114+
## Deployment
115+
116+
### Deploy to Azion Edge
117+
118+
Deploy your application directly from your local environment:
119+
120+
```bash
121+
azion -t <personal-token>
122+
azion deploy --local
123+
```
124+
125+
This command will:
126+
127+
1. Build your Nuxt.js application with the SSR preset
128+
2. Package the edge function
129+
3. Deploy to Azion's edge network
130+
4. Provide you with the deployment URL
131+
132+
## Features
133+
134+
The Nuxt.js SSR preset provides:
135+
136+
- **Server-Side Rendering**: Full SSR support with Nuxt.js
137+
- **Edge Runtime**: Optimized for Azion's edge computing platform
138+
- **Automatic Optimization**: Built-in performance optimizations for edge deployment
139+
- **Static Asset Handling**: Efficient static file serving
140+
- **API Routes**: Support for Nuxt.js server API routes
141+
142+
## Troubleshooting
143+
144+
### Common Issues
145+
146+
**Build Errors**: Ensure your `nuxt.config.ts` is properly configured with the preset path.
147+
148+
**Deployment Failures**: Verify that the Azion CLI is authenticated and your project is properly linked.
149+
150+
**Runtime Errors**: Check that your Nuxt.js application is compatible with edge runtime constraints.
151+
152+
### Getting Help
153+
154+
For additional support:
155+
156+
- Check the [Azion Documentation](https://www.azion.com/en/documentation/)
157+
- Visit the [Nuxt.js Documentation](https://nuxt.com/docs)
158+
- Contact Azion Support for platform-specific issues
159+
160+
## Example Project Structure
161+
162+
```
163+
my-nuxt-app/
164+
├── nuxt.config.ts # Azion preset configuration
165+
├── package.json # Include azion dependency
166+
├── pages/ # Nuxt.js pages
167+
├── server/ # Server API routes
168+
├── components/ # Vue components
169+
└── assets/ # Static assets
170+
```
171+
172+
## Next Steps
173+
174+
After successful deployment:
175+
176+
1. Test your application on the provided edge URL
177+
2. Configure custom domains if needed
178+
179+
> **Note**: We are currently working on a Pull Request to the official Nitro repository to include an Azion preset natively. This will simplify the configuration process in future versions.

packages/presets/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,17 @@
1818
"require": "./dist/index.cjs",
1919
"import": "./dist/index.js"
2020
},
21+
"./preset/nuxt/*": "./src/presets/nuxt/nitro/*/index.js",
2122
"./presets/preset/*": "./dist/presets/*"
2223
},
2324
"author": "aziontech",
2425
"license": "MIT",
2526
"files": [
2627
"dist",
2728
"package.json",
28-
"src/presets/next/*"
29+
"README.md",
30+
"src/presets/next/*",
31+
"src/presets/nuxt/nitro/*"
2932
],
3033
"dependencies": {
3134
"cookie": "^1.0.2",

0 commit comments

Comments
 (0)