Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
Merge branch 'release/0.7.1'
Browse files Browse the repository at this point in the history
njpanderson committed Apr 21, 2019
2 parents 4bd6020 + 7f87eaa commit 7901966
Showing 8 changed files with 3,188 additions and 204 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -3,3 +3,4 @@ node_modules
/coverage
/docs
/.rsync.json
/dist
13 changes: 10 additions & 3 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
.vscode/**
.vscode-test/**
test/**
.vscode/
.vscode-test/
test/
.gitignore
jsconfig.json
vsc-extension-quickstart.md
.eslintrc.json
.debug
.rsync.json
webpack.config.js
extension.js
node_modules/
src/
.ide/
.gitmodules
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Push Changelog
All notable changes to Push will be documented in this file. If this file has appeared within Visual Studio Code, it means that Push has had a notable update. You can easily disable this feature by setting the `njpPush.showChangelog` to `false`.

## 0.7.1
- Updated underlying SFTP / SSH libs - New OpenSSH formatted SSH keys are now supported properly.
- Optimised package payload.

## 0.7.0
- **Added environment reminders** - This is a change to the interface which you may notice in this version. Push will now remind you when your session has been inactive for over 30 seconds (or less if you switch away from vscode) when working within an applicable environment. Set `reminder` to false on any environments in which you don't want this behaviour. See README for more information.
- **Added a new explorer window** - Queues and watch lists now appear in their own panels.
3,257 changes: 3,090 additions & 167 deletions package-lock.json

Large diffs are not rendered by default.

31 changes: 19 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
"name": "push",
"displayName": "Push",
"description": "SFTP and File based uploading",
"version": "0.7.0",
"version": "0.7.1",
"publisher": "njp-anderson",
"engines": {
"vscode": "^1.30.0"
@@ -30,14 +30,16 @@
"activationEvents": [
"*"
],
"main": "./extension",
"main": "./dist/extension",
"contributes": {
"viewsContainers": {
"activitybar": [{
"id": "njp-push",
"title": "Push",
"icon": "resources/cloud.svg"
}]
"activitybar": [
{
"id": "njp-push",
"title": "Push",
"icon": "resources/cloud.svg"
}
]
},
"views": {
"njp-push": [
@@ -611,7 +613,10 @@
"test": "mocha",
"docs": "jsdoc -c .ide/jsdoc.json && node .ide/package-docs.js",
"publish": "npm run t && vsce publish",
"vsce": "vsce"
"vsce": "vsce",
"vscode:prepublish": "webpack --mode production",
"compile": "webpack --mode none",
"watch": "webpack --mode none --watch"
},
"devDependencies": {
"@types/mocha": "^2.2.48",
@@ -622,19 +627,21 @@
"jsdoc": "^3.5.5",
"mocha": "^5.2.0",
"typescript": "^2.8.3",
"vsce": "^1.55.0",
"vscode": "^1.1.18"
"vsce": "^1.59.0",
"vscode": "^1.1.18",
"webpack": "^4.30.0",
"webpack-cli": "^3.3.0"
},
"dependencies": {
"dateformat": "^3.0.3",
"glob": "^7.1.3",
"jsonc-parser": "^2.0.1",
"micromatch": "^3.1.10",
"glob": "^7.1.3",
"mkdirp": "^0.5.1",
"mockery": "^2.1.0",
"semver": "^5.6.0",
"simple-git": "^1.92.0",
"ssh2-sftp-client": "^1.1.0",
"ssh2-sftp-client": "^2.5.0",
"tmp": "^0.0.33",
"url-parse": "^1.4.1"
}
53 changes: 36 additions & 17 deletions src/Service/providers/ProviderSFTP.js
Original file line number Diff line number Diff line change
@@ -897,26 +897,45 @@ class ProviderSFTP extends ProviderBase {

utils.trace('ProviderSFTP#clientGetByStream', remote);

client.get(remote, true, charset === 'binary' ? null : 'utf8')
.then((stream) => {
utils.writeFileFromStream(stream, localPath, remote)
.then(() => {
resolve(new TransferResult(
local,
true,
TRANSFER_TYPES.GET
));
}, (error) => {
resolve(new TransferResult(
local,
new PushError(error),
TRANSFER_TYPES.GET
));
});

client.get(remote, localPath, {
encoding: (charset === 'binary' ? null : 'utf8')
})
.then(() => {
resolve(new TransferResult(
local,
true,
TRANSFER_TYPES.GET
));
})
.catch((error) => {
throw new PushError(`${remote}: ${error && error.message}`);
resolve(new TransferResult(
local,
new PushError(error),
TRANSFER_TYPES.GET
));
});

// client.get(remote, true, charset === 'binary' ? null : 'utf8')
// .then((stream) => {
// utils.writeFileFromStream(stream, localPath, remote)
// .then(() => {
// resolve(new TransferResult(
// local,
// true,
// TRANSFER_TYPES.GET
// ));
// }, (error) => {
// resolve(new TransferResult(
// local,
// new PushError(error),
// TRANSFER_TYPES.GET
// ));
// });
// })
// .catch((error) => {
// throw new PushError(`${remote}: ${error && error.message}`);
// });
});
});
}
12 changes: 7 additions & 5 deletions src/i18n/index.js
Original file line number Diff line number Diff line change
@@ -4,6 +4,11 @@ const config = require('../lib/config');
const {
PUSH_MESSAGE_PREFIX
} = require('../lib/constants');
const locales = {
en_gb: require('./locales/en_gb'),
it: require('./locales/it'),
ja: require('./locales/ja')
};

/**
* Internationalisation (i18n) class.
@@ -18,7 +23,7 @@ class i18n {
this._locale = 'en_gb';

this.strings = {
base: require('./locales/en_gb'),
base: locales.en_gb,
localised: {}
};

@@ -32,13 +37,10 @@ class i18n {
* @param {string} locale - The active locale to set.
*/
setLocale(locale) {
let fileName;

locale = locale || config.get('locale');
fileName = `./locales/${locale}`;

try {
this.strings.localised = require(fileName);
this.strings.localised = locales[locale];
this._locale = locale;

return;
21 changes: 21 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const path = require('path');

const config = {
target: 'node',
entry: './extension.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'extension.js',
libraryTarget: 'commonjs2',
devtoolModuleFilenameTemplate: '../[resource-path]'
},
devtool: 'source-map',
externals: {
vscode: 'commonjs vscode' // the vscode-module is created on-the-fly and must be excluded. Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/
},
resolve: {
extensions: ['.js']
}
};

module.exports = config;

0 comments on commit 7901966

Please sign in to comment.