Skip to content

We should remove the possibility to generate pipeline/workflow with node 16.x #6242

@Adam-it

Description

@Adam-it

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

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)"
              }
            },

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions