-
Notifications
You must be signed in to change notification settings - Fork 20
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]: Create one task for bundle & package each (Fix - 386) #397
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's remove this file from the assets folder as if we follow my previous suggestion to no include it in the readme it will be not needed |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's remove this file from the assets folder as if we follow my previous suggestion to no include it in the readme it will be not needed |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's remove this file from the assets folder as if we follow my previous suggestion to no include it in the readme it will be not needed |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's remove this file from the assets folder as if we follow my previous suggestion to no include it in the readme it will be not needed |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,6 @@ deploy-azure-storage - Deploys client-side solution project assets to Azure Stor | |
|
||
SPFx Toolkit VS Code extension shows all possible Gulp tasks one may run on an SPFx project. Don't worry about remembering all the commands, just click on the task you want to run and the extension will do the rest. | ||
|
||
![Gulp Tasks](../images/tasks.png) | ||
![Gulp Tasks](../images/tasks2.png) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if we replace the old image instead of adding a new one then lets ever this change as well |
||
|
||
[Check out our docs for more details](https://github.com/pnp/vscode-viva/wiki/5.4-Gulp-tasks) |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -22,6 +22,12 @@ export class TerminalCommandExecuter { | |||||
subscriptions.push( | ||||||
commands.registerCommand(Commands.serveProject, TerminalCommandExecuter.serveProject) | ||||||
); | ||||||
subscriptions.push( | ||||||
commands.registerCommand(Commands.bundleProject, TerminalCommandExecuter.bundleProject) | ||||||
); | ||||||
subscriptions.push( | ||||||
commands.registerCommand(Commands.packageProject, TerminalCommandExecuter.packageProject) | ||||||
); | ||||||
subscriptions.push( | ||||||
commands.registerCommand(Commands.executeTerminalCommand, TerminalCommandExecuter.runCommand) | ||||||
); | ||||||
|
@@ -93,6 +99,34 @@ export class TerminalCommandExecuter { | |||||
commands.executeCommand(Commands.executeTerminalCommand, `gulp serve --config=${answer}`); | ||||||
} | ||||||
|
||||||
public static async bundleProject() { | ||||||
const tasks = ['local','production']; | ||||||
const answer = await window.showQuickPick(tasks, { | ||||||
title: 'Select the target environment', | ||||||
ignoreFocusOut: true | ||||||
}); | ||||||
|
||||||
if(!answer) { | ||||||
return; | ||||||
} | ||||||
Comment on lines
+103
to
+111
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This part is actually duplicated in both methods. Let's extract it to a small helper private method in the same class and reuse instead |
||||||
|
||||||
commands.executeCommand(Commands.executeTerminalCommand, answer === 'local' ? 'gulp bundle' : 'gulp bundle --ship'); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could simplify and make it a bit shorter like.
Suggested change
What do you think? |
||||||
} | ||||||
|
||||||
public static async packageProject() { | ||||||
const tasks = ['local','production']; | ||||||
const answer = await window.showQuickPick(tasks, { | ||||||
title: 'Select the target environment', | ||||||
ignoreFocusOut: true | ||||||
}); | ||||||
|
||||||
if(!answer) { | ||||||
return; | ||||||
} | ||||||
|
||||||
commands.executeCommand(Commands.executeTerminalCommand, answer === 'local' ? 'gulp package-solution' : 'gulp package-solution --ship'); | ||||||
} | ||||||
|
||||||
/** | ||||||
* Initializes the shell path for executing terminal commands. | ||||||
* If the shell path is an object with a `path` property, it sets the `shellPath` to that value. | ||||||
|
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.
I appreciate taking your time to include and improve it in the readme as well but I would try to make it shorter. The readme is a first glance overall view of the product before you install it to VS Code so for gulp tasks I would just leave what we have and instead add the detail description and the gifs you provided to our wiki. At the end of each section, also here in gulp tasks, user has a link to wiki page for more details regarding that part