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

Added tour response for Upgrade and Validate actions, Closes #188 #323

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nicodecleyre
Copy link
Contributor

🎯 Aim

Adding the tour options and both md & tour options as settings for the upgrade and validate actions

πŸ“· Result

image

βœ… What was done

  • Added Md, Tour, Both as upgrade options in the settings
  • Added Md, Tour, Both as validate options in the settings
  • Added tour logic to code for the upgrade option
  • Added tour logic to code for the validate option

πŸ”— Related issue

Closes: #188

@nicodecleyre nicodecleyre changed the title First commit Added tour response for Upgrade and Validate actions, Closes #188 Oct 13, 2024
@Adam-it
Copy link
Contributor

Adam-it commented Oct 13, 2024

Awesome. Thank you for another awesome contribution. I will review it ASAP

@Adam-it Adam-it self-assigned this Oct 13, 2024
Copy link
Contributor

@Adam-it Adam-it left a comment

Choose a reason for hiding this comment

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

@nicodecleyre Awesome work so far πŸ‘πŸ‘πŸ‘πŸ‘
I tested it and works really good. During my tests and review I noticed some small details we could sort out before we merge πŸ‘
Please do give them a double check πŸ™

savePath = join(savePath, 'src');
}

const filePath = join(savePath || '', 'spfx.upgrade.md');
Copy link
Contributor

Choose a reason for hiding this comment

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

We should pass the markdown file name as param. Currently, we will get the same file name for both upgrade and validate action and it will be spfx.upgrade.md


if (projectValidateOutputMode === 'markdown') {
resultMd = await CliExecuter.execute('spfx project doctor', 'md');
CliActions.handleMarkdownResult(resultMd,wsFolder);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
CliActions.handleMarkdownResult(resultMd,wsFolder);
CliActions.handleMarkdownResult(resultMd, wsFolder);


if (projectUpgradeOutputMode === 'markdown') {
resultMd = await CliExecuter.execute('spfx project upgrade', 'md');
CliActions.handleMarkdownResult(resultMd,wsFolder);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
CliActions.handleMarkdownResult(resultMd,wsFolder);
CliActions.handleMarkdownResult(resultMd, wsFolder);

@@ -15,6 +15,8 @@ import { PnPWebview } from '../../webview/PnPWebview';
import { parseYoRc } from '../../utils/parseYoRc';
import { CertificateActions } from './CertificateActions';
import path = require('path');
import * as fs from 'fs';
Copy link
Contributor

Choose a reason for hiding this comment

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

is this import actually needed?

CliActions.handleMarkdownResult(resultMd,wsFolder);
} else if (projectValidateOutputMode === 'code tour') {
await CliExecuter.execute('spfx project doctor', 'tour');
commands.executeCommand('codetour.startTour');
Copy link
Contributor

Choose a reason for hiding this comment

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

the problem with this approach is that it will run code tour even if nothing was found. in this case we see a picker to run tour but there is non to run. this may be very confusing and I suggest we should run the code tour command only when something was created, so the CLI command did return something
image

The same applies to the Upgrade report

@Adam-it Adam-it marked this pull request as draft October 14, 2024 23:46
@Adam-it
Copy link
Contributor

Adam-it commented Oct 14, 2024

@nicodecleyre I also did some merging to the dev branch. May I kindly ask you to rebase against latest dev

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.

πŸ’‘ [Feature]: The Upgrade and Validate actions could return also code tour response
2 participants