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

💡 [Feature]: Add SPFx Fast Serve setup as additional step to the scaffolding form #218

Closed
Adam-it opened this issue Apr 17, 2024 · 2 comments
Assignees
Labels
⭐ enhancement New feature or request 👨‍💻work in progress I am working on it
Milestone

Comments

@Adam-it
Copy link
Member

Adam-it commented Apr 17, 2024

🎯 Aim of the feature

the aim would be to extend the additional steps section of the scaffolding form with SPFx Fast Serve
https://github.com/s-KaiNet/spfx-fast-serve?tab=readme-ov-file#which-sharepoint-framework-versions-are-supported

📷 Images (if possible) with expected result

Add a new option here
image

🤔 Additional remarks or comments

Prototype

  • add a new option (additional dependency) here
    </div>
    <PackageSelector value={shouldInstallReusablePropertyPaneControls}
    setValue={setShouldInstallReusablePropertyPaneControls}
    label='Install reusable property pane controls'
    link='https://pnp.github.io/sp-dev-fx-property-controls/' />
    <PackageSelector
    value={shouldInstallReusableReactControls}
    setValue={setShouldInstallReusableReactControls}
    label='Install reusable React controls'
    link='https://pnp.github.io/sp-dev-fx-controls-react/' />
    <PackageSelector
    value={shouldInstallPnPJs}
    setValue={setShouldInstallPnPJs}
    label='Install PnPjs (@pnp/sp, @pnp/graph)'
    link='https://pnp.github.io/pnpjs/' />
    {nodeVersionManager !== 'none' &&
    <PackageSelector
    value={shouldCreateNodeVersionFile}
    setValue={setShouldCreateNodeVersionFile}
    label='Create node version manager configuration file' />}
    </div>

    with description to isntall fast-serve and link to offcial fast serve guidance (as besides adding packages to the project user will need to also install global dependency manually)
  • when selected we need to handle it here
    let content = newSolutionInput.shouldRunInit ? ProjectFileContent.init : '';
    if (newSolutionInput.shouldInstallReusablePropertyPaneControls) {
    content += ` ${ProjectFileContent.installReusablePropertyPaneControls}`;
    }
    if (newSolutionInput.shouldInstallReusableReactControls) {
    content += ` ${ProjectFileContent.installReusableReactControls}`;
    }
    if (newSolutionInput.shouldInstallPnPJs) {
    content += ` ${ProjectFileContent.installPnPJs}`;
    }
  • we need to add new file content for the pnp project which will be added in the previous step when the option is selected
    https://github.com/pnp/vscode-viva/blob/main/src/constants/ProjectFileContent.ts
    so that when new project gets scaffolded the project.pnp file will have our new step that will need to be handeld
  • handle our new scaffolding step after new project gets created here
    if (fileContents.indexOf(ProjectFileContent.initScenario) > -1) {
    commands.executeCommand('codetour.startTour');
    }
    if (fileContents.indexOf(ProjectFileContent.installReusablePropertyPaneControls) > -1) {
    await TerminalCommandExecuter.runCommand('npm install @pnp/spfx-property-controls --save --save-exact', terminalTitle, terminalIcon);
    }
    if (fileContents.indexOf(ProjectFileContent.installReusableReactControls) > -1) {
    await TerminalCommandExecuter.runCommand('npm install @pnp/spfx-controls-react --save --save-exact', terminalTitle, terminalIcon);
    }
    if (fileContents.indexOf(ProjectFileContent.installPnPJs) > -1) {
    await TerminalCommandExecuter.runCommand('npm install @pnp/sp @pnp/graph --save', terminalTitle, terminalIcon);
    }

    when the new fast-serve step gets catched we should run spfx-fast-serve --force-install on the new project
@Adam-it Adam-it added ⭐ enhancement New feature or request 🤔 research needs researching before I start hacking labels Apr 17, 2024
@Adam-it Adam-it added this to the v3.X milestone Apr 17, 2024
@Adam-it Adam-it self-assigned this Jul 28, 2024
@Adam-it Adam-it modified the milestones: v3.X, v4.X Sep 8, 2024
@Adam-it
Copy link
Member Author

Adam-it commented Nov 17, 2024

The biggest problem is that spfx-fast-serve will prompt for running npm install which may be overlooked by a user when a new project is scaffolded.
It would be perfect if there was some option not to prompt for it and always run npm install

Let's put this on hold until we get some answer here 👇
s-KaiNet/spfx-fast-serve#157

@Adam-it Adam-it added the 🤚 on hold I need to wait for something else label Nov 17, 2024
@Adam-it Adam-it removed their assignment Nov 17, 2024
@Adam-it Adam-it removed 🤔 research needs researching before I start hacking ✏️prototype labels Nov 17, 2024
@Adam-it
Copy link
Member Author

Adam-it commented Nov 24, 2024

this feature was implemented and it is now possible to add fast-serve with --force-install so that it will not show any additional prompt after project scaffolding

@Adam-it Adam-it added ✏️prototype and removed 🤚 on hold I need to wait for something else labels Nov 24, 2024
@Adam-it Adam-it self-assigned this Nov 24, 2024
@Adam-it Adam-it added 🙏 help wanted Open for contributors and removed ✏️prototype labels Nov 24, 2024
@Adam-it Adam-it removed their assignment Nov 25, 2024
@Adam-it Adam-it added 👨‍💻work in progress I am working on it and removed 🙏 help wanted Open for contributors labels Dec 9, 2024
@Adam-it Adam-it self-assigned this Dec 9, 2024
Adam-it added a commit that referenced this issue Dec 9, 2024
## 🎯 Aim

The aim is to add SPFx fast serve support to project scaffolding so that
it may be selected in as and optional dependency to install and
configure

## ✅ What was done

- [X] adds spfx-fast-serve optional step

## 🔗 Related issue

Closes: #218
@Adam-it Adam-it closed this as completed Dec 9, 2024
Adam-it added a commit that referenced this issue Dec 10, 2024
## 🎯 Aim

The aim is to add SPFx fast serve support to project scaffolding so that
it may be selected in as and optional dependency to install and
configure

## ✅ What was done

- [X] adds spfx-fast-serve optional step

## 🔗 Related issue

Closes: #218
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⭐ enhancement New feature or request 👨‍💻work in progress I am working on it
Projects
None yet
Development

No branches or pull requests

1 participant