Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update azure SWA preset and update node versions detection #43

Merged
merged 3 commits into from
Apr 7, 2022

Conversation

danielroe
Copy link
Member

📚 Description

This is now how we take advantage of the new Node runtimes with Azure SWA: https://docs.microsoft.com/en-us/azure/static-web-apps/configuration#platform

@danielroe danielroe self-assigned this Apr 7, 2022
@danielroe danielroe requested a review from pi0 April 7, 2022 13:29
@@ -26,7 +26,18 @@ async function writeRoutes (nitro) {
version: '2.0'
}

let nodeVersion = '16'
try {
const currentNodeVersion = fse.readJSONSync(join(nitro.options.rootDir, 'package.json')).engines.node
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't engines.node optional? Are we doing try/catch to ignore this?

Copy link
Member Author

@danielroe danielroe Apr 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, and also if the file doesn't exist. Implementation from https://github.com/unjs/nitropack/blob/305c49853d514ceb00342107a7affdbd9500f5f2/src/presets/firebase.ts#L57-L65.

But maybe might be better to just grab from process?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of falling back to process.versions :)

@danielroe danielroe requested a review from pi0 April 7, 2022 14:58
@danielroe danielroe changed the title fix: detect node versions 16/14 for azure swa fix: update azure SWA present and update node versions detection Apr 7, 2022
@danielroe danielroe changed the title fix: update azure SWA present and update node versions detection fix: update azure SWA preset and update node versions detection Apr 7, 2022
@pi0 pi0 merged commit 19c784b into main Apr 7, 2022
@pi0 pi0 deleted the fix/azure-swa-runtime branch April 7, 2022 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants