-
Notifications
You must be signed in to change notification settings - Fork 368
Updates ci-cd commands to set node version based on SPFx project version. Closes #6717 #6766
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
base: main
Are you sure you want to change the base?
Updates ci-cd commands to set node version based on SPFx project version. Closes #6717 #6766
Conversation
milanholemans
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really cool enhancement @Adam-it! This will improve the command a lot.
However, while reviewing, I found a few things we should take a look at first.
src/m365/spfx/commands/project/project-github-workflow-add.spec.ts
Outdated
Show resolved
Hide resolved
src/m365/spfx/commands/project/project-github-workflow-add.spec.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request updates CI/CD workflow commands to dynamically determine the Node.js version based on the SharePoint Framework (SPFx) project version rather than using a hardcoded version. The PR refactors shared compatibility data into a separate module and adds logic to compute the appropriate Node.js version from version ranges.
- Extracts SPFx version compatibility matrix to a shared module
- Adds utility function to parse version ranges and determine highest compatible Node.js version
- Updates GitHub workflow and Azure DevOps pipeline commands to set Node.js version dynamically
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/spfx.ts | Added utility function to extract highest Node version from semver range |
| src/utils/spfx.spec.ts | Added test coverage for the new utility function |
| src/m365/spfx/commands/spfx-doctor.ts | Removed duplicate compatibility matrix, now imports from shared module |
| src/m365/spfx/commands/project/project-github-workflow-add.ts | Added logic to determine and set Node version based on SPFx project version |
| src/m365/spfx/commands/project/project-github-workflow-add.spec.ts | Added test coverage for version determination and error handling |
| src/m365/spfx/commands/project/project-azuredevops-pipeline-add.ts | Added logic to determine and set Node version based on SPFx project version |
| src/m365/spfx/commands/project/project-azuredevops-pipeline-add.spec.ts | Added test coverage for version determination and error handling |
| src/m365/spfx/commands/project/DeployWorkflow.ts | Changed default Node version from hardcoded "22.x" to empty string |
| src/m365/spfx/commands/SpfxCompatibilityMatrix.ts | New shared module containing SPFx compatibility matrix data |
47d9054 to
d6cbe35
Compare
|
@milanholemans I added the first batch of fixes to your comments that I could do without thinking 😁. |
ebb5e21 to
136ddf6
Compare
|
@milanholemans it took a while, and I do apologize for that. Lately, I have more tasks/work in a day than I can simply manage within 24 hours |
Closes #6717