Skip to content

Commit beaf740

Browse files
Adam-itSaurabh7019nicodecleyre
authored
Release v4.3.0 (#380)
## 🎯 Aim The aim is to create a new minor release that adds more manage capabilities to the SPFx solutions view for every app catalog. It also includes a new `/manage` GitHub Copilot Chat command that allows to retrieve data from SharePoint Online. Improvements to the upgrade and validate actions which now allow to generate a code tour with guidance and added support for SPFx Fast Serve as an optional dependency. ## 📷 Result ![spfx-chat2](https://github.com/user-attachments/assets/ff86b85b-82eb-4b8c-87db-7b555a5bce41) ![sign-in-cache](https://github.com/user-attachments/assets/737d0b29-87a0-4821-a425-ae91f66fd9a6) ![spfx-fast-serve](https://github.com/user-attachments/assets/33e9373b-a304-4dbf-9b05-8b83aa4f5536) ![app-catalog-list](https://github.com/user-attachments/assets/46739b9f-da48-4905-8588-9c82a4a8d528) ## ✅ What was done - [x] Added remove confirmation prompt when removing SPFx solution from app catalog - [x] Added /manage GitHub Chat command - [x] Added generating code tour for upgrade and validate SPFx solution actions - [x] Added upgrade SPFx project action - [x] Added SPFx Fast Serve optional dependency to the scaffolding form - [x] Improved sign in experience with caching of Client ID and Tenant ID --------- Co-authored-by: Saurabh Tripathi <[email protected]> Co-authored-by: Nico De Cleyre <[email protected]>
1 parent 82393b2 commit beaf740

36 files changed

+2847
-170
lines changed

CHANGELOG.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
# Change Log
22

3+
## [4.3.0] - 2024-12-11
4+
5+
- Added remove confirmation prompt when removing SPFx solution from app catalog
6+
- Added /manage GitHub Chat command
7+
- Added generating code tour for upgrade and validate SPFx solution actions
8+
- Added upgrade SPFx project action
9+
- Added SPFx Fast Serve optional dependency to the scaffolding form
10+
- Improved sign in experience with caching of Client ID and Tenant ID
11+
312
## [4.2.0] - 2024-10-19
413

5-
- Include m365 prefix and log passed CLI command options
6-
- Refactors to ensure types for settings
14+
- Included m365 prefix and log passed CLI command options
15+
- Refactored to ensure types for settings
716
- Added a new project additional step to create or not the node version manager configuration file
817
- Added new VSCode setting createNodeVersionFileDefaultValue to define the default value of the new project additional step
918
- Added new VSCode setting nodeVersionManagerFile to specify which configuration file to be created

README.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -104,22 +104,14 @@ Creating a new project was never easier. Just use the **create a new project** a
104104

105105
![Create new project](./assets/images/scaffolding.png)
106106

107-
Check it out in action 👇.
108-
109-
![Create new project](./assets/images/scaffolding-form.gif)
110-
111107
It's possible to scaffold any kind of SPFx project.
112108

113109
![All SPFx project support](./assets/images/scaffolding-support.png)
114110

115-
Install additional dependencies with a single click straight from the scaffolding form. Currently we support installing [PnP reusable property pane controls](https://pnp.github.io/sp-dev-fx-property-controls/), [PnP reusable React controls](https://pnp.github.io/sp-dev-fx-controls-react/), and [PnPjs](https://pnp.github.io/pnpjs/).
111+
Install additional dependencies with a single click straight from the scaffolding form. Currently we support installing [PnP reusable property pane controls](https://pnp.github.io/sp-dev-fx-property-controls/), [PnP reusable React controls](https://pnp.github.io/sp-dev-fx-controls-react/), [PnPjs](https://pnp.github.io/pnpjs/). Add and preconfigure [SPFx Fast Serve](https://github.com/s-KaiNet/spfx-fast-serve) and add a Node Version Manager configuration file either for NVM or NVS.
116112

117113
![Additional dependency step](./assets/images/scaffolding-additional-step.png)
118114

119-
When you can set the additional dependencies it's also possible to automatically create the node version manager file with the version of Node.js used when creating the project. These settings are available in the extension settings.
120-
121-
![Additional dependency step node version](./assets/images/scaffolding-additional-step-node-version.png)
122-
123115
[Check out our docs for more details](https://github.com/pnp/vscode-viva/wiki/5.2-Scaffolding#1-scaffold-a-new-spfx-project)
124116

125117
### 6️⃣ Sign in to your tenant & retrieve environment details
@@ -136,6 +128,8 @@ SPFx Toolkit will guide you through the process of creating a new app registrati
136128

137129
![entra app reg form](./assets/images/sign-in-entra-app-reg-form.png)
138130

131+
Check it out in action 👇
132+
139133
![app registration](./assets/images/sign-in.gif)
140134

141135
If you already have an Entra App Registration you may use it to sign in to your tenant by providing the Client Id and Tenant Id.
@@ -159,6 +153,7 @@ After successful sign in, an additional view is presented that shows a list of l
159153
- **Remove**: Removes the app from the app catalog.
160154
- **Enable**: Allows end users to add the solution to their SharePoint sites.
161155
- **Disable**: Hides the solution from end users, preventing them from adding it to sites.
156+
- **Upgrade**: Upgrades the solution to the latest version available in the app catalog for the specified site.
162157

163158
Additionally, it will show you all tenant-wide extensions installed on your tenant.
164159

@@ -202,13 +197,17 @@ And for Azure DevOps👇
202197

203198
[Check out our docs for more details](https://github.com/pnp/vscode-viva/wiki/5.5-Actions#cicd-github-workflow)
204199

205-
- **Upgrade project** - Uses CLI for Microsoft 365 to create a .md report with upgrade guidance to the latest supported SPFx version by the extension.
200+
- **Upgrade project** - Uses CLI for Microsoft 365 to create a .md and/or code tour report with upgrade guidance to the latest supported SPFx version by the extension. The upgrade guidance provides optional as well as required steps a user needs to take manually in order to upgrade the project. At the end of the guidance file, the user may find a summary of the steps in a single script and a couple of manual steps that need to be taken.
206201

207202
![Upgrade project](./assets/images/upgrade-project.png)
208203

204+
And the code tour guidance will provide you upgrade tips directly in your code!
205+
206+
![Upgrade project](./assets/images/upgrade-project-code-tour.png)
207+
209208
[Check out our docs for more details](https://github.com/pnp/vscode-viva/wiki/5.5-Actions#upgrade-project)
210209

211-
- **Validate project** - Creates a validation .md report against the currently used SPFx version in the project. The action will automatically detect the SPFx version used and will validate if the project is properly set up.
210+
- **Validate project** - Creates a validation .md report and/or code tour validation guidance for the currently open SPFx project. The action will automatically detect the SPFx version used and will validate if the project is properly set up.
212211

213212
![Upgrade project](./assets/images/validate-project.png)
214213

@@ -315,7 +314,8 @@ Now you may use SPFx Toolkit as a chat participant in GitHub Copilot chat extens
315314
Currently, we support the following commands:
316315
- `/setup` - that is dedicated to providing information on how to setup your local workspace for SharePoint Framework development
317316
- `/new` - that may be used to get guidance on how to create a new solution or find and reuse an existing sample from the PnP SPFx sample gallery
318-
- `/code` - that is fine-tuned to provide help in coding your SharePoint Framework project and provides additional boosters like validating the correctness of your SPFx project, scaffolding a CI/CD workflow, or renaming your project, and many more.
317+
- `/code` - [beta] this command is fine-tuned to provide help in coding your SharePoint Framework project and provides additional boosters like validating the correctness of your SPFx project, scaffolding a CI/CD workflow, or renaming your project, and many more.
318+
- `/manage` - [beta] this command will allow you to ask and retrieve any kind of data from you SharePoint Online tenant. This command will only work if your are signed in to your tenant. It uses CLI for Microsoft 365 commands under the hood to retrieve and explain data and assets from your SharePoint Online tenant. Currently it does support only retrieving information, it will not support you in creating, updating or removing any resources. For example, you want to check if some list item or file exists. Or how many items with specific metadata do you have on a list? Or ask for content type columns to generate an interface based on the response quickly.
319319

320320
[Check out our docs for more details](https://github.com/pnp/vscode-viva/wiki/8.-SPFx-Toolkit-GitHub-Chat-Participant)
321321

assets/images/actions.png

1.6 KB
Loading

assets/images/app-catalog-list.png

308 KB
Loading
3.83 MB
Loading
38.6 KB
Loading

assets/images/scaffolding.png

-16.8 KB
Loading

assets/images/settings.png

148 KB
Loading
-3.57 MB
Loading

assets/images/sign-in.gif

-3.31 MB
Loading
492 KB
Loading

assets/walkthrough/actions.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,17 @@ And for Azure DevOps👇
2020

2121
[Check out our docs for more details](https://github.com/pnp/vscode-viva/wiki/5.5-Actions#cicd-github-workflow)
2222

23-
- **Upgrade project** - Uses CLI for Microsoft 365 to create a .md report with upgrade guidance to the latest supported SPFx version by the extension.
23+
- **Upgrade project** - Uses CLI for Microsoft 365 to create a .md and/or code tour report with upgrade guidance to the latest supported SPFx version by the extension. The upgrade guidance provides optional as well as required steps a user needs to take manually in order to upgrade the project. At the end of the guidance file, the user may find a summary of the steps in a single script and a couple of manual steps that need to be taken.
2424

2525
![Upgrade project](../images/upgrade-project.png)
2626

27+
And the code tour guidance will provide you upgrade tips directly in your code!
28+
29+
![Upgrade project](./assets/images/upgrade-project-code-tour.png)
30+
2731
[Check out our docs for more details](https://github.com/pnp/vscode-viva/wiki/5.5-Actions#upgrade-project)
2832

29-
- **Validate project** - Creates a validation .md report against the currently used SPFx version in the project. The action will automatically detect the SPFx version used and will validate if the project is properly set up.
33+
- **Validate project** - Creates a validation .md report and/or code tour validation guidance for the currently open SPFx project. The action will automatically detect the SPFx version used and will validate if the project is properly set up.
3034

3135
![Upgrade project](../images/validate-project.png)
3236

assets/walkthrough/create-new-project.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ Creating a new project was never easier. Just use the **create a new project** a
44

55
![Create new project](../images/scaffolding.png)
66

7-
Check it out in action 👇.
8-
9-
![Create new project](../images/scaffolding-form.gif)
10-
117
It's possible to scaffold any kind of SPFx project including web parts, extensions, library components, and adaptive card extensions.
128

139
![All SPFx project support](../images/scaffolding-support.png)
@@ -17,7 +13,7 @@ It's possible to scaffold any kind of SPFx project including web parts, extensio
1713
- **Library components** are reusable code elements that can be shared across all the components in the tenant.
1814
- **Adaptive Card Extensions (ACEs)** allow you to build rich, native extensions for Viva Connections Dashboards and SharePoint Pages.
1915

20-
Install additional dependencies with a single click straight from the scaffolding form. Currently we support installing [PnP reusable property pane controls](https://pnp.github.io/sp-dev-fx-property-controls/), [PnP reusable React controls](https://pnp.github.io/sp-dev-fx-controls-react/), and [PnPjs](https://pnp.github.io/pnpjs/).
16+
Install additional dependencies with a single click straight from the scaffolding form. Currently we support installing [PnP reusable property pane controls](https://pnp.github.io/sp-dev-fx-property-controls/), [PnP reusable React controls](https://pnp.github.io/sp-dev-fx-controls-react/), [PnPjs](https://pnp.github.io/pnpjs/). Add and preconfigure [SPFx Fast Serve](https://github.com/s-KaiNet/spfx-fast-serve) and add a Node Version Manager configuration file either for NVM or NVS.
2117

2218
![Additional dependency step](../images/scaffolding-additional-step.png)
2319

assets/walkthrough/tenant-details.md

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ After successful sign in, an additional view is presented that shows a list of l
2929
- **Remove**: Removes the app from the app catalog.
3030
- **Enable**: Allows end users to add the solution to their SharePoint sites.
3131
- **Disable**: Hides the solution from end users, preventing them from adding it to sites.
32+
- **Upgrade**: Upgrades the solution to the latest version available in the app catalog for the specified site.
3233

3334
Additionally, it will show you all tenant-wide extensions installed on your tenant.
3435

npm-shrinkwrap.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+40-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "viva-connections-toolkit",
33
"displayName": "SharePoint Framework Toolkit",
44
"description": "SharePoint Framework Toolkit aims to boost your productivity in developing and managing SharePoint Framework solutions helping at every stage of your development flow, from setting up your development workspace to deploying a solution straight to your tenant without the need to leave VS Code and now even create a CI/CD pipeline to introduce automate deployment of your app. This toolkit is provided by the community.",
5-
"version": "4.2.0",
5+
"version": "4.3.0",
66
"publisher": "m365pnp",
77
"preview": false,
88
"homepage": "https://github.com/pnp/vscode-viva",
@@ -63,12 +63,17 @@
6363
{
6464
"name": "new",
6565
"isSticky": true,
66-
"description": "Create a new SharePoint Framework project."
66+
"description": "Create a new SharePoint Framework project"
67+
},
68+
{
69+
"name": "manage",
70+
"isSticky": true,
71+
"description": "[beta] Manage your SharePoint Online tenant"
6772
},
6873
{
6974
"name": "code",
7075
"isSticky": true,
71-
"description": "Let's write some SPFx code (I am still learning this, please consider this as beta)"
76+
"description": "[beta] Let's write some SPFx code"
7277
}
7378
]
7479
}
@@ -205,6 +210,28 @@
205210
".node-version"
206211
],
207212
"description": "The file to be used to store the Node version for the selected Node version manager. Remember that the .node-version file is supported only while using nvs."
213+
},
214+
"spfx-toolkit.projectUpgradeOutputMode": {
215+
"title": "Project upgrade output mode",
216+
"type": "string",
217+
"default": "both",
218+
"enum": [
219+
"both",
220+
"markdown",
221+
"code tour"
222+
],
223+
"description": "Choose the output mode for the project upgrade. You can choose between `both`, `markdown`, or `code tour`."
224+
},
225+
"spfx-toolkit.projectValidateOutputMode": {
226+
"title": "Project validate output mode",
227+
"type": "string",
228+
"default": "both",
229+
"enum": [
230+
"both",
231+
"markdown",
232+
"code tour"
233+
],
234+
"description": "Choose the output mode for the project validation. You can choose between `both`, `markdown`, or `code tour`."
208235
}
209236
}
210237
},
@@ -433,6 +460,12 @@
433460
"category": "SharePoint Framework Toolkit",
434461
"icon": "$(circle-slash)"
435462
},
463+
{
464+
"command": "spfx-toolkit.upgradeAppCatalogApp",
465+
"title": "Upgrade",
466+
"category": "SharePoint Framework Toolkit",
467+
"icon": "$(sync)"
468+
},
436469
{
437470
"command": "spfx-toolkit.showMoreActions",
438471
"title": "...",
@@ -504,6 +537,10 @@
504537
{
505538
"command": "spfx-toolkit.disableAppCatalogApp",
506539
"group": "actions.more@4"
540+
},
541+
{
542+
"command": "spfx-toolkit.upgradeAppCatalogApp",
543+
"group": "actions.more@5"
507544
}
508545
],
509546
"explorer/context": [
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
param ([string[]]$workspacePath)
2+
3+
$cliLocalProjectPath = "$workspacePath\cli-microsoft365"
4+
5+
if (-not (Test-Path -Path $cliLocalProjectPath -PathType Container)) {
6+
return
7+
}
8+
9+
[hashtable]$commandsData = @{}
10+
11+
$allSpoCommands = Get-ChildItem -Path "$workspacePath\cli-microsoft365\docs\docs\cmd\spo\*.mdx" -Recurse -Force -Exclude "_global*"
12+
13+
foreach ($command in $allSpoCommands) {
14+
$commandDocs = ConvertFrom-Markdown -Path $command
15+
$html = New-Object -Com 'HTMLFile'
16+
$html.write([ref]$commandDocs.Html)
17+
18+
$title = $html.all.tags('h1')[0]
19+
$commandTitle = $title.innerText
20+
21+
if (-not ($commandTitle -match "\b(list|get)$")) {
22+
continue
23+
}
24+
25+
$titleIndex = @($html.all).IndexOf($title)
26+
27+
$usage = $html.all.tags('h2') | Where-Object { $_.tagName -eq 'H2' } | Select-Object -First 1
28+
$usageIndex = @($html.all).IndexOf($usage)
29+
30+
$commandDescription = @($html.all)[($titleIndex + 1)..($usageIndex - 1)]
31+
$commandDescription = $commandDescription | ForEach-Object { $_.innerText }
32+
33+
$subTitles = $html.all.tags('h2') | Where-Object { $_.tagName -eq 'H2' } | Select-Object -First 5
34+
$optionsStartIndex = @($html.all).IndexOf($subTitles[1])
35+
$optionsEndIndex = @($html.all).IndexOf($subTitles[2])
36+
$commandOptions = @($html.all)[($optionsStartIndex + 1)..($optionsEndIndex - 1)]
37+
$commandOptions = $commandOptions | Where-Object { $_.nodeName -eq 'CODE' } | ForEach-Object { $_.innerText }
38+
$commandOptions = $commandOptions | ForEach-Object { $_.Replace("`r`n", '') }
39+
40+
$examples = $subTitles[2].innerText
41+
$examplesStartIndex = @($html.all).IndexOf($subTitles[2])
42+
$examplesEndIndex = @($html.all).IndexOf($subTitles[3])
43+
if (-not ($examples -match "Example")) {
44+
$examples = $subTitles[3].innerText
45+
$examplesStartIndex = @($html.all).IndexOf($subTitles[3])
46+
$examplesEndIndex = @($html.all).IndexOf($subTitles[4])
47+
}
48+
$commandExamples = @($html.all)[($examplesStartIndex + 1)..($examplesEndIndex - 1)]
49+
$commandExamples = $commandExamples | Where-Object { $_.nodeName -match 'CODE|P' } | ForEach-Object { $_.innerText }
50+
$commandExamples = $commandExamples | Select-Object -Unique
51+
$commandExamples = $commandExamples -split '\r?\n'
52+
$commandExamplesObjects = @()
53+
for ($i = 0; $i -lt $commandExamples.Length; $i += 2) {
54+
$example = $commandExamples[$i]
55+
$description = $commandExamples[$i + 1]
56+
$commandExamplesObject = @{
57+
Example = $example
58+
Description = $description
59+
}
60+
$commandExamplesObjects += $commandExamplesObject
61+
}
62+
63+
$commandsData["m365 $commandTitle"] = @{
64+
Description = $commandDescription
65+
Options = $commandOptions
66+
Examples = $commandExamplesObjects
67+
}
68+
}
69+
70+
$dataArray = @()
71+
foreach ($key in $commandsData.Keys) {
72+
$orderedHashtable = [ordered]@{
73+
Command = $key
74+
Description = $commandsData[$key].Description
75+
Options = $commandsData[$key].Options
76+
Examples = $commandsData[$key].Examples
77+
}
78+
$dataArray += $orderedHashtable
79+
}
80+
81+
$dataArray | ConvertTo-Json -Depth 3 | Out-File "$workspacePath\vscode-viva\src\chat\CliForMicrosoft365SpoCommands.ts"

0 commit comments

Comments
 (0)