Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Commit

Permalink
auto deploy buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
mkloubert committed Apr 11, 2018
1 parent ba292a0 commit 1e86cca
Show file tree
Hide file tree
Showing 12 changed files with 830 additions and 144 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

[![Share via Facebook](https://raw.githubusercontent.com/mkloubert/vscode-deploy-reloaded/master/img/share/Facebook.png)](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dmkloubert.vscode-deploy-reloaded&quote=vscode-deploy-reloaded) [![Share via Twitter](https://raw.githubusercontent.com/mkloubert/vscode-deploy-reloaded/master/img/share/Twitter.png)](https://twitter.com/intent/tweet?source=https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dmkloubert.vscode-deploy-reloaded&text=vscode-deploy-reloaded:%20https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dmkloubert.vscode-deploy-reloaded&via=mjkloubert) [![Share via Google+](https://raw.githubusercontent.com/mkloubert/vscode-deploy-reloaded/master/img/share/Google+.png)](https://plus.google.com/share?url=https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dmkloubert.vscode-deploy-reloaded) [![Share via Pinterest](https://raw.githubusercontent.com/mkloubert/vscode-deploy-reloaded/master/img/share/Pinterest.png)](https://pinterest.com/pin/create/button/?url=https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dmkloubert.vscode-deploy-reloaded&media=https://raw.githubusercontent.com/mkloubert/vscode-deploy-reloaded/master/img/demo1.gif&description=Recoded%20version%20of%20Visual%20Studio%20Code%20extension%20%27vs-deploy%27%2C%20which%20provides%20commands%20to%20deploy%20files%20to%20one%20or%20more%20destinations.) [![Share via Reddit](https://raw.githubusercontent.com/mkloubert/vscode-deploy-reloaded/master/img/share/Reddit.png)](https://www.reddit.com/submit?url=https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dmkloubert.vscode-deploy-reloaded&title=vscode-deploy-reloaded) [![Share via LinkedIn](https://raw.githubusercontent.com/mkloubert/vscode-deploy-reloaded/master/img/share/LinkedIn.png)](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dmkloubert.vscode-deploy-reloaded&title=vscode-deploy-reloaded&summary=Recoded%20version%20of%20Visual%20Studio%20Code%20extension%20%27vs-deploy%27%2C%20which%20provides%20commands%20to%20deploy%20files%20to%20one%20or%20more%20destinations.&source=https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dmkloubert.vscode-deploy-reloaded) [![Share via Wordpress](https://raw.githubusercontent.com/mkloubert/vscode-deploy-reloaded/master/img/share/Wordpress.png)](https://wordpress.com/press-this.php?u=https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dmkloubert.vscode-deploy-reloaded&quote=vscode-deploy-reloaded&s=Recoded%20version%20of%20Visual%20Studio%20Code%20extension%20%27vs-deploy%27%2C%20which%20provides%20commands%20to%20deploy%20files%20to%20one%20or%20more%20destinations.&i=https://raw.githubusercontent.com/mkloubert/vscode-deploy-reloaded/master/img/demo1.gif) [![Share via Email](https://raw.githubusercontent.com/mkloubert/vscode-deploy-reloaded/master/img/share/Email.png)](mailto:?subject=vscode-deploy-reloaded&body=Recoded%20version%20of%20Visual%20Studio%20Code%20extension%20'vs-deploy'%2C%20which%20provides%20commands%20to%20deploy%20files%20to%20one%20or%20more%20destinations.:%20https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dmkloubert.vscode-deploy-reloaded)

## 0.70.0 (April 11th, 2018; auto deployment)

* added `pauseFilesFor` setting for [packages](https://github.com/mkloubert/vscode-deploy-reloaded/wiki#packages-), which can define a time, in milliseconds, to wait, before an auto operation can be done for a file again
* added `deployOnChangeButton` [setting](https://github.com/mkloubert/vscode-deploy-reloaded/wiki#settings--), which can setup a [button](https://github.com/mkloubert/vscode-deploy-reloaded/wiki/deploy_on_change#buttons), that is able to activate or deactivate [deploy on change](https://github.com/mkloubert/vscode-deploy-reloaded/wiki/deploy_on_change) feature
* added `deployOnSaveButton` [setting](https://github.com/mkloubert/vscode-deploy-reloaded/wiki#settings--), which can setup a [button](https://github.com/mkloubert/vscode-deploy-reloaded/wiki/deploy_on_save#buttons), that is able to activate or deactivate [deploy on save](https://github.com/mkloubert/vscode-deploy-reloaded/wiki/deploy_on_save) feature
* added `removeOnChangeButton` [setting](https://github.com/mkloubert/vscode-deploy-reloaded/wiki#settings--), which can setup a [button](https://github.com/mkloubert/vscode-deploy-reloaded/wiki/remove_on_change#buttons), that is able to activate or deactivate [remove on change](https://github.com/mkloubert/vscode-deploy-reloaded/wiki/remove_on_change) feature
* improved concurrent auto deployments
* fixed auto creation of directories on [ftp server](https://github.com/mkloubert/vscode-deploy-reloaded/wiki/target_ftp)
* more bugfixes

## 0.69.1 (April 10th, 2018; log files)

* added `Deploy Reloaded: Log files ...` command, which can open an extension's log file now
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

138 changes: 136 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vscode-deploy-reloaded",
"displayName": "Deploy (Reloaded)",
"description": "Deploys files of a workspace to a destination.",
"version": "0.69.1",
"version": "0.70.0",
"publisher": "mkloubert",
"engines": {
"vscode": "^1.22.0"
Expand Down Expand Up @@ -511,11 +511,97 @@
"type": "boolean",
"default": true
},
"deployOnChangeButton": {
"description": "Show a button that (de-)activate 'deploy on change' feature.",
"oneOf": [
{
"description": "Show a button that (de-)activate 'deploy on change' feature or not.",
"type": "boolean",
"default": false
},
{
"description": "Settings for showing a button that (de-)activate 'deploy on change' feature.",
"type": "object",
"properties": {
"color": {
"description": "The (text) color for the button.",
"type": "string",
"default": "button.foreground"
},
"enabled": {
"description": "Enable button or not.",
"type": "boolean",
"default": true
},
"isRight": {
"description": "Put button on the right side or not.",
"type": "boolean",
"default": false
},
"priority": {
"description": "The priority.",
"type": "integer"
},
"text": {
"description": "The custom display text.",
"type": "string"
},
"tooltip": {
"description": "The custom tooltip.",
"type": "string"
}
}
}
]
},
"deployOnSave": {
"description": "Activates or deactivates 'deploy on save' feature for all packages.",
"type": "boolean",
"default": true
},
"deployOnSaveButton": {
"description": "Show a button that (de-)activate 'deploy on save' feature.",
"oneOf": [
{
"description": "Show a button that (de-)activate 'deploy on save' feature or not.",
"type": "boolean",
"default": false
},
{
"description": "Settings for showing a button that (de-)activate 'deploy on save' feature.",
"type": "object",
"properties": {
"color": {
"description": "The (text) color for the button.",
"type": "string",
"default": "button.foreground"
},
"enabled": {
"description": "Enable button or not.",
"type": "boolean",
"default": true
},
"isRight": {
"description": "Put button on the right side or not.",
"type": "boolean",
"default": false
},
"priority": {
"description": "The priority.",
"type": "integer"
},
"text": {
"description": "The custom display text.",
"type": "string"
},
"tooltip": {
"description": "The custom tooltip.",
"type": "string"
}
}
}
]
},
"env": {
"description": "Settings for the process's environment.",
"type": "object",
Expand Down Expand Up @@ -988,6 +1074,11 @@
"description": "A (display) name for that package.",
"type": "string"
},
"pauseFilesFor": {
"description": "The number of milliseconds to wait before an auto operation can be done for a file again.",
"type": "integer",
"minimum": 0
},
"platforms": {
"description": "One or more platform names the package is available for.",
"type": "array",
Expand Down Expand Up @@ -1264,6 +1355,49 @@
"type": "boolean",
"default": true
},
"removeOnChangeButton": {
"description": "Show a button that (de-)activate 'remove on change' feature.",
"oneOf": [
{
"description": "Show a button that (de-)activate 'remove on change' feature or not.",
"type": "boolean",
"default": false
},
{
"description": "Settings for showing a button that (de-)activate 'remove on change' feature.",
"type": "object",
"properties": {
"color": {
"description": "The (text) color for the button.",
"type": "string",
"default": "button.foreground"
},
"enabled": {
"description": "Enable button or not.",
"type": "boolean",
"default": true
},
"isRight": {
"description": "Put button on the right side or not.",
"type": "boolean",
"default": false
},
"priority": {
"description": "The priority.",
"type": "integer"
},
"text": {
"description": "The custom display text.",
"type": "string"
},
"tooltip": {
"description": "The custom tooltip.",
"type": "string"
}
}
}
]
},
"requiredExtensions": {
"description": "Defines one or more Visual Studio Code extensions, which are required.",
"type": "object",
Expand Down Expand Up @@ -71706,6 +71840,6 @@
"tmp": "0.0.33",
"uglify-js": "^3.3.20",
"uuid": "^3.2.1",
"vscode-helpers": "^1.7.0"
"vscode-helpers": "^1.8.0"
}
}
50 changes: 42 additions & 8 deletions src/buttons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ import * as deploy_workspaces from './workspaces';
import * as vscode from 'vscode';


/**
* Describes a button, which can (de-)activate an auto deploy operation.
*/
export interface AutoDeployButton extends deploy_contracts.Button {
}

/**
* Description for a global button.
*/
Expand All @@ -32,6 +38,28 @@ export interface Button extends deploy_contracts.ButtonWithCustomCommand {
readonly arguments?: any[];
}

/**
* Describes a button that should be shown to actiovate or deactivate "deploy on change" feature.
*/
export interface DeployOnChangeButton extends AutoDeployButton {
}

/**
* A value for a "deploy on change" button.
*/
export type DeployOnChangeButtonValue = boolean | DeployOnChangeButton;

/**
* Describes a button that should be shown to actiovate or deactivate "deploy on save" feature.
*/
export interface DeployOnSaveButton extends AutoDeployButton {
}

/**
* A value for a "deploy on save" button.
*/
export type DeployOnSaveButtonValue = boolean | DeployOnSaveButton;

interface FinishedButton extends vscode.Disposable {
readonly button: vscode.StatusBarItem;
readonly command: vscode.Disposable;
Expand All @@ -42,6 +70,17 @@ interface GlobalButton extends vscode.Disposable {
readonly command: vscode.Disposable;
}

/**
* Describes a button that should be shown to actiovate or deactivate "remove on change" feature.
*/
export interface RemoveOnChangeButton extends AutoDeployButton {
}

/**
* A value for a "remove on change" button.
*/
export type RemoveOnChangeButtonValue = boolean | RemoveOnChangeButton;


const KEY_FINISHED_BTNS = 'finished_buttons';
const KEY_FINISHED_BTN_DELETE = 'finish_delete';
Expand Down Expand Up @@ -90,14 +129,10 @@ function createFinishedButton(state: deploy_contracts.KeyValuePairs, key: string
deploy_helpers.tryDispose( this.command );

if (BUTTONS) {
delete BUTTONS[ key ];
delete BUTTONS[key];
}

if (timeouts) {
deploy_helpers.tryDispose( timeouts[key] );

delete timeouts[ key ];
}
deploy_helpers.tryDisposeAndDelete(timeouts, key);
}
};
}
Expand Down Expand Up @@ -358,8 +393,7 @@ export function setTimeoutForFinishedButton(
}

if (false !== key) {
deploy_helpers.tryDispose( timeouts[key] );
delete timeouts[key];
deploy_helpers.tryDisposeAndDelete(timeouts, key);

const BTN = deploy_helpers.applyFuncFor(
getFinishedButton, WORKSPACE
Expand Down
16 changes: 5 additions & 11 deletions src/clients/ftp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,14 +261,13 @@ export abstract class FTPClientBase extends deploy_clients.AsyncFileListBase {
return false;
}

// check if remote directory exists
// check if remote directory exists ...
if (true === this._existingRemoteDirs[dir]) {
return false;
return false; // seems to exist
}

try {
// check if exist
await this.list(dir);
await this.cwd(dir);
}
catch (e) {
// no, try to create
Expand Down Expand Up @@ -1135,13 +1134,8 @@ class JsFTPClient extends FTPClientBase {
const COMPLETED = deploy_helpers.createCompletedAction(resolve, reject);

try {
ME.connection.list(dir, (err) => {
if (err) {
COMPLETED(err);
}
else {
COMPLETED(null);
}
ME.connection.raw("CWD", [ dir ], (err) => {
COMPLETED(err);
});
}
catch (e) {
Expand Down
12 changes: 12 additions & 0 deletions src/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,18 @@ export interface Configuration extends deploy_packages.WithFastFileCheckSettings
* Activates or deactivates 'deploy on change' feature for all packages.
*/
readonly deployOnChange?: boolean;
/**
* Shows a button that (de-)activate "deploy on change" feature.
*/
readonly deployOnChangeButton?: deploy_buttons.DeployOnChangeButtonValue;
/**
* Activates or deactivates 'deploy on save' feature for all packages.
*/
readonly deployOnSave?: boolean;
/**
* Shows a button that can (de-)activate "deploy on save" feature.
*/
readonly deployOnSaveButton?: deploy_buttons.DeployOnSaveButtonValue;
/**
* Settings for the process's environment.
*/
Expand Down Expand Up @@ -249,6 +257,10 @@ export interface Configuration extends deploy_packages.WithFastFileCheckSettings
* Activates or deactivates "remove on change" feature for all packages.
*/
readonly removeOnChange?: boolean;
/**
* Shows a button that (de-)activate "remove on change" feature.
*/
readonly removeOnChangeButton?: deploy_buttons.RemoveOnChangeButtonValue;
/**
* Run build task on startup or define the wait time, in milliseconds, after
* the build task should be run after startup.
Expand Down
Loading

0 comments on commit 1e86cca

Please sign in to comment.