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

Adds support for SPFx v1.19. Closes #6010 #6036

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/m365/spfx/commands/project/project-doctor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,8 @@ describe(commands.PROJECT_DOCTOR, () => {
assert.strictEqual(findings.length, 0);
});

it('e2e: shows correct number of findings for a valid 1.19.0-beta.0 project', async () => {
sinon.stub(command as any, 'getProjectRoot').callsFake(_ => path.join(process.cwd(), 'src/m365/spfx/commands/project/test-projects/spfx-1190-beta0-webpart-react'));
it('e2e: shows correct number of findings for a valid 1.19.0 project', async () => {
sinon.stub(command as any, 'getProjectRoot').callsFake(_ => path.join(process.cwd(), 'src/m365/spfx/commands/project/test-projects/spfx-1190-webpart-react'));

await command.action(logger, { options: {} } as any);
const findings: FindingToReport[] = log[0];
Expand Down
2 changes: 1 addition & 1 deletion src/m365/spfx/commands/project/project-doctor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class SpfxProjectDoctorCommand extends BaseProjectCommand {
'1.18.0',
'1.18.1',
'1.18.2',
'1.19.0-beta.0'
'1.19.0'
];

protected get allowedOutputs(): string[] {
Expand Down
32 changes: 16 additions & 16 deletions src/m365/spfx/commands/project/project-upgrade.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3254,66 +3254,66 @@ describe(commands.PROJECT_UPGRADE, () => {
//#endregion

//#region 1.18.2
it('e2e: shows correct number of findings for upgrading ace 1.18.2 project to 1.19.0-beta.0', async () => {
it('e2e: shows correct number of findings for upgrading ace 1.18.2 project to 1.19.0', async () => {
sinon.stub(command as any, 'getProjectRoot').callsFake(_ => path.join(process.cwd(), 'src/m365/spfx/commands/project/test-projects/spfx-1182-ace'));

await command.action(logger, { options: { toVersion: '1.19.0-beta.0', preview: true, output: 'json' } } as any);
await command.action(logger, { options: { toVersion: '1.19.0', preview: true, output: 'json' } } as any);
const findings: FindingToReport[] = log[0];
assert.strictEqual(findings.length, 9);
});

it('e2e: shows correct number of findings for upgrading application customizer 1.18.2 project to 1.19.0-beta.0', async () => {
it('e2e: shows correct number of findings for upgrading application customizer 1.18.2 project to 1.19.0', async () => {
sinon.stub(command as any, 'getProjectRoot').callsFake(_ => path.join(process.cwd(), 'src/m365/spfx/commands/project/test-projects/spfx-1182-applicationcustomizer'));

await command.action(logger, { options: { toVersion: '1.19.0-beta.0', preview: true, output: 'json' } } as any);
await command.action(logger, { options: { toVersion: '1.19.0', preview: true, output: 'json' } } as any);
const findings: FindingToReport[] = log[0];
assert.strictEqual(findings.length, 11);
});

it('e2e: shows correct number of findings for upgrading field customizer react 1.18.2 project to 1.19.0-beta.0', async () => {
it('e2e: shows correct number of findings for upgrading field customizer react 1.18.2 project to 1.19.0', async () => {
sinon.stub(command as any, 'getProjectRoot').callsFake(_ => path.join(process.cwd(), 'src/m365/spfx/commands/project/test-projects/spfx-1182-fieldcustomizer-react'));

await command.action(logger, { options: { toVersion: '1.19.0-beta.0', preview: true, output: 'json' } } as any);
await command.action(logger, { options: { toVersion: '1.19.0', preview: true, output: 'json' } } as any);
const findings: FindingToReport[] = log[0];
assert.strictEqual(findings.length, 10);
});

it('e2e: shows correct number of findings for upgrading form customizer react 1.18.2 project to 1.19.0-beta.0', async () => {
it('e2e: shows correct number of findings for upgrading form customizer react 1.18.2 project to 1.19.0', async () => {
sinon.stub(command as any, 'getProjectRoot').callsFake(_ => path.join(process.cwd(), 'src/m365/spfx/commands/project/test-projects/spfx-1182-formcustomizer-react'));

await command.action(logger, { options: { toVersion: '1.19.0-beta.0', preview: true, output: 'json' } } as any);
await command.action(logger, { options: { toVersion: '1.19.0', preview: true, output: 'json' } } as any);
const findings: FindingToReport[] = log[0];
assert.strictEqual(findings.length, 12);
});

it('e2e: shows correct number of findings for upgrading list view command set 1.18.2 project to 1.19.0-beta.0', async () => {
it('e2e: shows correct number of findings for upgrading list view command set 1.18.2 project to 1.19.0', async () => {
sinon.stub(command as any, 'getProjectRoot').callsFake(_ => path.join(process.cwd(), 'src/m365/spfx/commands/project/test-projects/spfx-1182-listviewcommandset'));

await command.action(logger, { options: { toVersion: '1.19.0-beta.0', preview: true, output: 'json' } } as any);
await command.action(logger, { options: { toVersion: '1.19.0', preview: true, output: 'json' } } as any);
const findings: FindingToReport[] = log[0];
assert.strictEqual(findings.length, 11);
});

it('e2e: shows correct number of findings for upgrading no framework web part 1.18.2 project to 1.19.0-beta.0', async () => {
it('e2e: shows correct number of findings for upgrading no framework web part 1.18.2 project to 1.19.0', async () => {
sinon.stub(command as any, 'getProjectRoot').callsFake(_ => path.join(process.cwd(), 'src/m365/spfx/commands/project/test-projects/spfx-1182-webpart-nolib'));

await command.action(logger, { options: { toVersion: '1.19.0-beta.0', preview: true, output: 'json' } } as any);
await command.action(logger, { options: { toVersion: '1.19.0', preview: true, output: 'json' } } as any);
const findings: FindingToReport[] = log[0];
assert.strictEqual(findings.length, 13);
});

it('e2e: shows correct number of findings for upgrading react web part 1.18.2 project to 1.19.0-beta.0', async () => {
it('e2e: shows correct number of findings for upgrading react web part 1.18.2 project to 1.19.0', async () => {
sinon.stub(command as any, 'getProjectRoot').callsFake(_ => path.join(process.cwd(), 'src/m365/spfx/commands/project/test-projects/spfx-1182-webpart-react'));

await command.action(logger, { options: { toVersion: '1.19.0-beta.0', preview: true, output: 'json' } } as any);
await command.action(logger, { options: { toVersion: '1.19.0', preview: true, output: 'json' } } as any);
const findings: FindingToReport[] = log[0];
assert.strictEqual(findings.length, 13);
});

it('e2e: shows correct number of findings for upgrading web part with optional dependencies 1.18.2 project to 1.19.0-beta.0', async () => {
it('e2e: shows correct number of findings for upgrading web part with optional dependencies 1.18.2 project to 1.19.0', async () => {
sinon.stub(command as any, 'getProjectRoot').callsFake(_ => path.join(process.cwd(), 'src/m365/spfx/commands/project/test-projects/spfx-1182-webpart-optionaldeps'));

await command.action(logger, { options: { toVersion: '1.19.0-beta.0', preview: true, output: 'json' } } as any);
await command.action(logger, { options: { toVersion: '1.19.0', preview: true, output: 'json' } } as any);
const findings: FindingToReport[] = log[0];
assert.strictEqual(findings.length, 22);
});
Expand Down
28 changes: 14 additions & 14 deletions src/m365/spfx/commands/project/project-upgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import fs from 'fs';
import os from 'os';
import path from 'path';
// uncomment to support upgrading to preview releases
import { prerelease } from 'semver';
// import { prerelease } from 'semver';
import { Logger } from '../../../../cli/Logger.js';
import Command, { CommandError } from '../../../../Command.js';
import GlobalOptions from '../../../../GlobalOptions.js';
Expand Down Expand Up @@ -79,7 +79,7 @@ class SpfxProjectUpgradeCommand extends BaseProjectCommand {
'1.18.0',
'1.18.1',
'1.18.2',
'1.19.0-beta.0'
'1.19.0'
];

public static ERROR_NO_PROJECT_ROOT_FOLDER: number = 1;
Expand Down Expand Up @@ -117,9 +117,9 @@ class SpfxProjectUpgradeCommand extends BaseProjectCommand {
preview: args.options.preview
});
// uncomment to support upgrading to preview releases
if (prerelease(this.telemetryProperties.toVersion) && !args.options.preview) {
this.telemetryProperties.toVersion = this.supportedVersions[this.supportedVersions.length - 2];
}
// if (prerelease(this.telemetryProperties.toVersion) && !args.options.preview) {
// this.telemetryProperties.toVersion = this.supportedVersions[this.supportedVersions.length - 2];
// }
});
}

Expand Down Expand Up @@ -176,15 +176,15 @@ class SpfxProjectUpgradeCommand extends BaseProjectCommand {

this.toVersion = args.options.toVersion ? args.options.toVersion : this.supportedVersions[this.supportedVersions.length - 1];
// uncomment to support upgrading to preview releases
if (!args.options.toVersion &&
!args.options.preview &&
prerelease(this.toVersion)) {
// no version and no preview specified while the current version to
// upgrade to is a prerelease so let's grab the first non-preview version
// since we're supporting only one preview version, it's sufficient for
// us to take second to last version
this.toVersion = this.supportedVersions[this.supportedVersions.length - 2];
}
// if (!args.options.toVersion &&
// !args.options.preview &&
// prerelease(this.toVersion)) {
// // no version and no preview specified while the current version to
// // upgrade to is a prerelease so let's grab the first non-preview version
// // since we're supporting only one preview version, it's sufficient for
// // us to take second to last version
// this.toVersion = this.supportedVersions[this.supportedVersions.length - 2];
// }
this.packageManager = args.options.packageManager || 'npm';
this.shell = args.options.shell || 'bash';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,29 @@ import { FN002023_DEVDEP_microsoft_eslint_config_spfx } from './rules/FN002023_D
import { FN010001_YORC_version } from './rules/FN010001_YORC_version.js';

export default [
new FN001001_DEP_microsoft_sp_core_library('1.19.0-beta.0'),
new FN001002_DEP_microsoft_sp_lodash_subset('1.19.0-beta.0'),
new FN001003_DEP_microsoft_sp_office_ui_fabric_core('1.19.0-beta.0'),
new FN001004_DEP_microsoft_sp_webpart_base('1.19.0-beta.0'),
new FN001011_DEP_microsoft_sp_dialog('1.19.0-beta.0'),
new FN001012_DEP_microsoft_sp_application_base('1.19.0-beta.0'),
new FN001014_DEP_microsoft_sp_listview_extensibility('1.19.0-beta.0'),
new FN001021_DEP_microsoft_sp_property_pane('1.19.0-beta.0'),
new FN001023_DEP_microsoft_sp_component_base('1.19.0-beta.0'),
new FN001024_DEP_microsoft_sp_diagnostics('1.19.0-beta.0'),
new FN001025_DEP_microsoft_sp_dynamic_data('1.19.0-beta.0'),
new FN001026_DEP_microsoft_sp_extension_base('1.19.0-beta.0'),
new FN001027_DEP_microsoft_sp_http('1.19.0-beta.0'),
new FN001028_DEP_microsoft_sp_list_subscription('1.19.0-beta.0'),
new FN001029_DEP_microsoft_sp_loader('1.19.0-beta.0'),
new FN001030_DEP_microsoft_sp_module_interfaces('1.19.0-beta.0'),
new FN001031_DEP_microsoft_sp_odata_types('1.19.0-beta.0'),
new FN001032_DEP_microsoft_sp_page_context('1.19.0-beta.0'),
new FN001013_DEP_microsoft_decorators('1.19.0-beta.0'),
new FN001034_DEP_microsoft_sp_adaptive_card_extension_base('1.19.0-beta.0'),
new FN001001_DEP_microsoft_sp_core_library('1.19.0'),
new FN001002_DEP_microsoft_sp_lodash_subset('1.19.0'),
new FN001003_DEP_microsoft_sp_office_ui_fabric_core('1.19.0'),
new FN001004_DEP_microsoft_sp_webpart_base('1.19.0'),
new FN001011_DEP_microsoft_sp_dialog('1.19.0'),
new FN001012_DEP_microsoft_sp_application_base('1.19.0'),
new FN001014_DEP_microsoft_sp_listview_extensibility('1.19.0'),
new FN001021_DEP_microsoft_sp_property_pane('1.19.0'),
new FN001023_DEP_microsoft_sp_component_base('1.19.0'),
new FN001024_DEP_microsoft_sp_diagnostics('1.19.0'),
new FN001025_DEP_microsoft_sp_dynamic_data('1.19.0'),
new FN001026_DEP_microsoft_sp_extension_base('1.19.0'),
new FN001027_DEP_microsoft_sp_http('1.19.0'),
new FN001028_DEP_microsoft_sp_list_subscription('1.19.0'),
new FN001029_DEP_microsoft_sp_loader('1.19.0'),
new FN001030_DEP_microsoft_sp_module_interfaces('1.19.0'),
new FN001031_DEP_microsoft_sp_odata_types('1.19.0'),
new FN001032_DEP_microsoft_sp_page_context('1.19.0'),
new FN001013_DEP_microsoft_decorators('1.19.0'),
new FN001034_DEP_microsoft_sp_adaptive_card_extension_base('1.19.0'),
new FN002001_DEVDEP_microsoft_sp_build_web('1.20.1'),
new FN002002_DEVDEP_microsoft_sp_module_interfaces('1.20.1'),
new FN002022_DEVDEP_microsoft_eslint_plugin_spfx('1.20.1'),
new FN002023_DEVDEP_microsoft_eslint_config_spfx('1.20.1'),
new FN010001_YORC_version('1.19.0-beta.0')
new FN010001_YORC_version('1.19.0')
];
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@microsoft/microsoft-graph-client": "3.0.2",
"@microsoft/teams-js": "2.12.0"
},
"version": "1.19.0-beta.0",
"version": "1.19.0",
"libraryName": "spfx",
"libraryId": "5476262a-4291-4fcd-b30d-7d4316a8bacc",
"packageManager": "npm",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"websiteUrl": "",
"privacyUrl": "",
"termsOfUseUrl": "",
"mpnId": "Undefined-1.19.0-beta.0"
"mpnId": "Undefined-1.19.0"
},
"metadata": {
"shortDescription": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.1",
"private": true,
"engines": {
"node": ">=16.13.0 <17.0.0 || >=18.17.1 <19.0.0"
"node": ">=18.17.1 <19.0.0"
},
"main": "lib/index.js",
"scripts": {
Expand All @@ -16,12 +16,12 @@
"react": "17.0.1",
"react-dom": "17.0.1",
"@fluentui/react": "^8.106.4",
"@microsoft/sp-core-library": "1.19.0-beta.0",
"@microsoft/sp-component-base": "1.19.0-beta.0",
"@microsoft/sp-property-pane": "1.19.0-beta.0",
"@microsoft/sp-webpart-base": "1.19.0-beta.0",
"@microsoft/sp-lodash-subset": "1.19.0-beta.0",
"@microsoft/sp-office-ui-fabric-core": "1.19.0-beta.0"
"@microsoft/sp-core-library": "1.19.0",
"@microsoft/sp-component-base": "1.19.0",
"@microsoft/sp-property-pane": "1.19.0",
"@microsoft/sp-webpart-base": "1.19.0",
"@microsoft/sp-lodash-subset": "1.19.0",
"@microsoft/sp-office-ui-fabric-core": "1.19.0"
},
"devDependencies": {
"@microsoft/rush-stack-compiler-4.7": "0.1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/m365/spfx/commands/spfx-doctor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ class SpfxDoctorCommand extends BaseProjectCommand {
fix: 'npm i -g yo@5'
}
},
'1.19.0-beta.0': {
'1.19.0': {
gulpCli: {
range: '^1 || ^2',
fix: 'npm i -g gulp-cli@2'
Expand Down