Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
### [2.2.2-stage.1](https://github.com/aziontech/lib/compare/v2.2.1...v2.2.2-stage.1) (2025-10-29)


### Bug Fixes

* routing rule for handling Nuxt content API requests and adds a polyfill for the Node.js console (#300) ([356198b](https://github.com/aziontech/lib/commit/356198b4135c1242476bcc32778f583a48a197a0))

### [2.2.1](https://github.com/aziontech/lib/compare/v2.2.0...v2.2.1) (2025-10-22)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "azion",
"version": "2.2.1",
"version": "2.2.2-stage.1",
"description": "Azion Packages for Edge Computing.",
"scripts": {
"prepare": "husky",
Expand Down
30 changes: 30 additions & 0 deletions packages/presets/src/presets/nuxt/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,36 @@ const config: AzionConfig = {
},
],
},
{
name: 'Execute Nuxt Function when starts with /api/_content',
description:
'Handle @nuxt/content API requests - executes Nuxt function for content management endpoints. Remove this rule if your project does not use the @nuxt/content library.',
active: true,
criteria: [
[
{
variable: '${uri}',
conditional: 'if',
operator: 'starts_with',
argument: '/api/_content',
},
],
],
behaviors: [
{
type: 'run_function',
attributes: {
value: '$FUNCTION_NAME',
},
},
{
type: 'forward_cookies',
},
{
type: 'deliver',
},
],
},
{
name: 'Deliver Static Assets',
description: 'Deliver static assets directly from storage',
Expand Down
1 change: 1 addition & 0 deletions packages/unenv-preset/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default {
performance: `unenv/polyfill/performance`,
setInterval: `${polyfillsPath}/node/globals/set-interval.js`,
clearInterval: `${polyfillsPath}/node/globals/clear-interval.js`,
console: `${polyfillsPath}/node/globals/console.js`,
},
alias: {
'azion/utils': 'azion/utils',
Expand Down
20 changes: 20 additions & 0 deletions packages/unenv-preset/src/polyfills/node/globals/console.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
globalThis.__mockTimers = new Map();

const _console = globalThis.console;

_console.time = (label = 'default') => {
globalThis.__mockTimers.set(label, Date.now());
};
_console.timeEnd = (label = 'default') => {
const startTime = globalThis.__mockTimers.get(label);
if (startTime) {
const duration = Date.now() - startTime;
globalThis.__mockTimers.delete(label);
return duration;
}
return 0;
};

globalThis.console = _console;

export default globalThis.console;