Since in latest version of SPFx 1.19 node 16.x was deprecated

I guess it makes no sense in giving the option to support that in our scaffolded flows since those commands target latest version of SPFx.
We should remove the following logic
|
const version = this.getProjectVersion(); |
|
|
|
if (!version) { |
|
throw `Unable to determine the version of the current SharePoint Framework project`; |
|
} |
|
|
|
const minorVersion = parse(version)?.minor; |
|
|
|
if (minorVersion === undefined) { |
|
throw `Unable to determine the minor version of the current SharePoint Framework project`; |
|
} |
|
|
|
if (minorVersion < 18) { |
|
this.getNodeAction(workflow).with!['node-version'] = '16.x'; |
|
} |
and
|
const version = this.getProjectVersion(); |
|
|
|
if (!version) { |
|
throw `Unable to determine the version of the current SharePoint Framework project`; |
|
} |
|
|
|
const minorVersion = parse(version)?.minor; |
|
|
|
if (minorVersion === undefined) { |
|
throw `Unable to determine the minor version of the current SharePoint Framework project`; |
|
} |
|
|
|
if (minorVersion < 18) { |
|
this.getNodeAction(workflow).with!['node-version'] = '16.x'; |
|
} |
Also in order to make the flows more reusable we should extract the Node versions to variables with default values so that if needed it should be easy for the developers to adapt the pipeline to desired Node version.
We should update the JSON definitions of the flows here
By adding to them variables for Node.js versions that will be used in the flows with the default value set to node 18.x
for example for Azure DevOps pipeline we should add something like
variables: [
...
{
name: "NodeVersion",
value: "18.x"
},
...
and then modify the NodeTool step to
{
task: "NodeTool@0",
displayName: "Use Node.js",
inputs: {
versionSpec: "$(NodeVersion)"
}
},
Since in latest version of SPFx 1.19 node 16.x was deprecated

I guess it makes no sense in giving the option to support that in our scaffolded flows since those commands target latest version of SPFx.
We should remove the following logic
cli-microsoft365/src/m365/spfx/commands/project/project-github-workflow-add.ts
Lines 173 to 187 in bf59841
and
cli-microsoft365/src/m365/spfx/commands/project/project-github-workflow-add.ts
Lines 173 to 187 in bf59841
Also in order to make the flows more reusable we should extract the Node versions to variables with default values so that if needed it should be easy for the developers to adapt the pipeline to desired Node version.
We should update the JSON definitions of the flows here
By adding to them variables for Node.js versions that will be used in the flows with the default value set to node 18.x
for example for Azure DevOps pipeline we should add something like
and then modify the
NodeToolstep to