mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Merge from master
This commit is contained in:
@@ -19,16 +19,6 @@ function handleDeletions() {
|
||||
|
||||
let watch = void 0;
|
||||
|
||||
// Disabled due to https://github.com/Microsoft/vscode/issues/36214
|
||||
// if (!process.env['VSCODE_USE_LEGACY_WATCH']) {
|
||||
// try {
|
||||
// watch = require('./watch-nsfw');
|
||||
// } catch (err) {
|
||||
// console.warn('Could not load our cross platform file watcher: ' + err.toString());
|
||||
// console.warn('Falling back to our platform specific watcher...');
|
||||
// }
|
||||
// }
|
||||
|
||||
if (!watch) {
|
||||
watch = process.platform === 'win32' ? require('./watch-win32') : require('gulp-watch');
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
"author": "Microsoft ",
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"gulp-watch": "^4.3.9",
|
||||
"nsfw": "^1.0.15"
|
||||
"gulp-watch": "^4.3.9"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,94 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
var nsfw = require('nsfw');
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var File = require('vinyl');
|
||||
var es = require('event-stream');
|
||||
var filter = require('gulp-filter');
|
||||
|
||||
function toChangeType(type) {
|
||||
switch (type) {
|
||||
case 0: return 'add';
|
||||
case 1: return 'unlink';
|
||||
case 2: return 'change';
|
||||
}
|
||||
}
|
||||
|
||||
function watch(root) {
|
||||
var result = es.through();
|
||||
|
||||
function handleEvent(path, type) {
|
||||
if (/[/\\].git[/\\]/.test(path) || /[/\\]out[/\\]/.test(path)) {
|
||||
return; // filter as early as possible
|
||||
}
|
||||
|
||||
var file = new File({
|
||||
path: path,
|
||||
base: root
|
||||
});
|
||||
//@ts-ignore
|
||||
file.event = type;
|
||||
result.emit('data', file);
|
||||
}
|
||||
|
||||
nsfw(root, function (events) {
|
||||
for (var i = 0; i < events.length; i++) {
|
||||
var e = events[i];
|
||||
var changeType = e.action;
|
||||
|
||||
if (changeType === 3 /* RENAMED */) {
|
||||
handleEvent(path.join(e.directory, e.oldFile), 'unlink');
|
||||
handleEvent(path.join(e.directory, e.newFile), 'add');
|
||||
} else {
|
||||
handleEvent(path.join(e.directory, e.file), toChangeType(changeType));
|
||||
}
|
||||
}
|
||||
}).then(function (watcher) {
|
||||
watcher.start();
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
var cache = Object.create(null);
|
||||
|
||||
module.exports = function (pattern, options) {
|
||||
options = options || {};
|
||||
|
||||
var cwd = path.normalize(options.cwd || process.cwd());
|
||||
var watcher = cache[cwd];
|
||||
|
||||
if (!watcher) {
|
||||
watcher = cache[cwd] = watch(cwd);
|
||||
}
|
||||
|
||||
var rebase = !options.base ? es.through() : es.mapSync(function (f) {
|
||||
f.base = options.base;
|
||||
return f;
|
||||
});
|
||||
|
||||
return watcher
|
||||
.pipe(filter(['**', '!.git{,/**}'])) // ignore all things git
|
||||
.pipe(filter(pattern))
|
||||
.pipe(es.map(function (file, cb) {
|
||||
fs.stat(file.path, function (err, stat) {
|
||||
if (err && err.code === 'ENOENT') { return cb(null, file); }
|
||||
if (err) { return cb(); }
|
||||
if (!stat.isFile()) { return cb(); }
|
||||
|
||||
fs.readFile(file.path, function (err, contents) {
|
||||
if (err && err.code === 'ENOENT') { return cb(null, file); }
|
||||
if (err) { return cb(); }
|
||||
|
||||
file.contents = contents;
|
||||
file.stat = stat;
|
||||
cb(null, file);
|
||||
});
|
||||
});
|
||||
}))
|
||||
.pipe(rebase);
|
||||
};
|
||||
@@ -73,11 +73,6 @@ array-unique@^0.2.1:
|
||||
resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53"
|
||||
integrity sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=
|
||||
|
||||
asap@~2.0.3:
|
||||
version "2.0.6"
|
||||
resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46"
|
||||
integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=
|
||||
|
||||
asn1@~0.2.3:
|
||||
version "0.2.3"
|
||||
resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86"
|
||||
@@ -393,17 +388,6 @@ form-data@~2.1.1:
|
||||
combined-stream "^1.0.5"
|
||||
mime-types "^2.1.12"
|
||||
|
||||
fs-extra@^0.26.5:
|
||||
version "0.26.7"
|
||||
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.26.7.tgz#9ae1fdd94897798edab76d0918cf42d0c3184fa9"
|
||||
integrity sha1-muH92UiXeY7at20JGM9C0MMYT6k=
|
||||
dependencies:
|
||||
graceful-fs "^4.1.2"
|
||||
jsonfile "^2.1.0"
|
||||
klaw "^1.0.0"
|
||||
path-is-absolute "^1.0.0"
|
||||
rimraf "^2.2.8"
|
||||
|
||||
fs.realpath@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
|
||||
@@ -499,7 +483,7 @@ glogg@^1.0.0:
|
||||
dependencies:
|
||||
sparkles "^1.0.0"
|
||||
|
||||
graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9:
|
||||
graceful-fs@^4.1.2:
|
||||
version "4.1.11"
|
||||
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
|
||||
integrity sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=
|
||||
@@ -763,13 +747,6 @@ json-stringify-safe@~5.0.1:
|
||||
resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
|
||||
integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=
|
||||
|
||||
jsonfile@^2.1.0:
|
||||
version "2.4.0"
|
||||
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8"
|
||||
integrity sha1-NzaitCi4e72gzIO1P6PWM6NcKug=
|
||||
optionalDependencies:
|
||||
graceful-fs "^4.1.6"
|
||||
|
||||
jsonify@~0.0.0:
|
||||
version "0.0.0"
|
||||
resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73"
|
||||
@@ -799,13 +776,6 @@ kind-of@^4.0.0:
|
||||
dependencies:
|
||||
is-buffer "^1.1.5"
|
||||
|
||||
klaw@^1.0.0:
|
||||
version "1.3.1"
|
||||
resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439"
|
||||
integrity sha1-QIhDO0azsbolnXh4XY6W9zugJDk=
|
||||
optionalDependencies:
|
||||
graceful-fs "^4.1.9"
|
||||
|
||||
lodash._basecopy@^3.0.0:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36"
|
||||
@@ -868,16 +838,6 @@ lodash.isarray@^3.0.0:
|
||||
resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55"
|
||||
integrity sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=
|
||||
|
||||
lodash.isinteger@^4.0.4:
|
||||
version "4.0.4"
|
||||
resolved "https://registry.yarnpkg.com/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz#619c0af3d03f8b04c31f5882840b77b11cd68343"
|
||||
integrity sha1-YZwK89A/iwTDH1iChAt3sRzWg0M=
|
||||
|
||||
lodash.isundefined@^3.0.1:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/lodash.isundefined/-/lodash.isundefined-3.0.1.tgz#23ef3d9535565203a66cefd5b830f848911afb48"
|
||||
integrity sha1-I+89lTVWUgOmbO/VuDD4SJEa+0g=
|
||||
|
||||
lodash.keys@^3.0.0:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a"
|
||||
@@ -982,7 +942,7 @@ multipipe@^0.1.2:
|
||||
dependencies:
|
||||
duplexer2 "0.0.2"
|
||||
|
||||
nan@^2.0.0, nan@^2.3.0:
|
||||
nan@^2.3.0:
|
||||
version "2.7.0"
|
||||
resolved "https://registry.yarnpkg.com/nan/-/nan-2.7.0.tgz#d95bf721ec877e08db276ed3fc6eb78f9083ad46"
|
||||
integrity sha1-2Vv3IeyHfgjbJ27T/G63j5CDrUY=
|
||||
@@ -1004,13 +964,6 @@ node-pre-gyp@^0.6.39:
|
||||
tar "^2.2.1"
|
||||
tar-pack "^3.4.0"
|
||||
|
||||
nodegit-promise@~4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/nodegit-promise/-/nodegit-promise-4.0.0.tgz#5722b184f2df7327161064a791d2e842c9167b34"
|
||||
integrity sha1-VyKxhPLfcycWEGSnkdLoQskWezQ=
|
||||
dependencies:
|
||||
asap "~2.0.3"
|
||||
|
||||
nopt@^4.0.1:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d"
|
||||
@@ -1036,17 +989,6 @@ npmlog@^4.0.2:
|
||||
gauge "~2.7.3"
|
||||
set-blocking "~2.0.0"
|
||||
|
||||
nsfw@^1.0.15:
|
||||
version "1.0.16"
|
||||
resolved "https://registry.yarnpkg.com/nsfw/-/nsfw-1.0.16.tgz#78ba3e7f513b53d160c221b9018e0baf108614cc"
|
||||
integrity sha1-eLo+f1E7U9FgwiG5AY4LrxCGFMw=
|
||||
dependencies:
|
||||
fs-extra "^0.26.5"
|
||||
lodash.isinteger "^4.0.4"
|
||||
lodash.isundefined "^3.0.1"
|
||||
nan "^2.0.0"
|
||||
promisify-node "^0.3.0"
|
||||
|
||||
number-is-nan@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d"
|
||||
@@ -1152,13 +1094,6 @@ process-nextick-args@~1.0.6:
|
||||
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3"
|
||||
integrity sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=
|
||||
|
||||
promisify-node@^0.3.0:
|
||||
version "0.3.0"
|
||||
resolved "https://registry.yarnpkg.com/promisify-node/-/promisify-node-0.3.0.tgz#b4b55acf90faa7d2b8b90ca396899086c03060cf"
|
||||
integrity sha1-tLVaz5D6p9K4uQyjlomQhsAwYM8=
|
||||
dependencies:
|
||||
nodegit-promise "~4.0.0"
|
||||
|
||||
punycode@^1.4.1:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
|
||||
@@ -1275,7 +1210,7 @@ request@2.81.0:
|
||||
tunnel-agent "^0.6.0"
|
||||
uuid "^3.0.0"
|
||||
|
||||
rimraf@2, rimraf@^2.2.8, rimraf@^2.5.1, rimraf@^2.6.1:
|
||||
rimraf@2, rimraf@^2.5.1, rimraf@^2.6.1:
|
||||
version "2.6.2"
|
||||
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36"
|
||||
integrity sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==
|
||||
|
||||
Reference in New Issue
Block a user