-
Notifications
You must be signed in to change notification settings - Fork 19
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
🚀 Add command to increase project version and implement version increment logic, Closes #94 #387
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 added some small fixup to your branch. I left also two comments that we could recheck before we merge.
const wsFolder = workspace.workspaceFolders?.[0]; | ||
if (!wsFolder) { | ||
throw new Error('Workspace folder not found'); | ||
} | ||
|
||
const packageJsonPath = join(wsFolder.uri.fsPath, 'package.json'); | ||
const packageSolutionPath = join(wsFolder.uri.fsPath, 'config/package-solution.json'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will not work when the SPFx project was created by TeamsToolkit. We should also support that case.
In case TT created a project that uses SPFx project then the SPFx part is in a src
subcatalog.
I took a screenshot of the result when we use SPFx Toolkit in a project created by TT.
We already have some parts in SPFx Toolkit that add this support and check. Like here
vscode-viva/src/services/check/DebuggerCheck.ts
Lines 37 to 41 in beaf740
let launchFiles = await workspace.findFiles('.vscode/launch.json', '**/node_modules/**'); | |
if (!launchFiles || launchFiles.length <= 0) { | |
launchFiles = await workspace.findFiles('src/.vscode/launch.json', '**/node_modules/**'); | |
} |
@@ -302,6 +306,7 @@ export class CommandPanel { | |||
actionCommands.push(new ActionTreeItem('Upgrade project SPFx version', '', { name: 'arrow-up', custom: false }, undefined, Commands.upgradeProject)); | |||
actionCommands.push(new ActionTreeItem('Validate project correctness', '', { name: 'check-all', custom: false }, undefined, Commands.validateProject)); | |||
actionCommands.push(new ActionTreeItem('Rename project', '', { name: 'whole-word', custom: false }, undefined, Commands.renameProject)); | |||
actionCommands.push(new ActionTreeItem('Increase project version', '', { name: 'arrow-up', custom: false }, undefined, Commands.increaseVersion)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets pick a different icon. This one is already used in upgrade action which may be just confusing.
we may use any icon from this
https://microsoft.github.io/vscode-codicons/dist/codicon.html
what do you think about fold-up
icon 🤔
🎯 Aim
This pull request increases the version of the package.json & package-solution.json file with either major, minor or patch
📷 Result
Untitled.video.-.Made.with.Clipchamp.14.mp4
✅ What was done
🔗 Related issue
Closes: #94