mirror of
https://github.com/coder/code-server.git
synced 2024-12-23 09:42:24 +03:00
Implement fs module (#3)
* Implements the fs module * Add stats object * Add not implemented to createWriteStream * Update mkdtemp to use tmp dir * Unexport Stats * Add client web socket for commands and restructure
This commit is contained in:
parent
da27bc0f04
commit
a328204d80
@ -5,11 +5,12 @@
|
||||
"license": "TBD",
|
||||
"description": "VS Code in the cloud.",
|
||||
"scripts": {
|
||||
"build:rules": "cd ./rules && tsc -p .",
|
||||
"vscode:clone": "mkdir -p ./lib && test -d ./lib/vscode || git clone https://github.com/Microsoft/vscode/ ./lib/vscode",
|
||||
"vscode:install": "cd ./lib/vscode && git checkout tags/1.30.1 && yarn",
|
||||
"vscode": "npm-run-all vscode:*",
|
||||
"packages:install": "cd ./packages && yarn",
|
||||
"postinstall": "npm-run-all --parallel vscode packages:install",
|
||||
"packages:install": "cd ./packages && yarn && ts-node ../scripts/install-packages.ts",
|
||||
"postinstall": "npm-run-all --parallel vscode packages:install build:rules",
|
||||
"start": "webpack-dev-server --hot --config ./webpack.config.app.js",
|
||||
"test": "cd ./packages && yarn test"
|
||||
},
|
||||
@ -30,7 +31,10 @@
|
||||
"sass-loader": "^7.1.0",
|
||||
"style-loader": "^0.23.1",
|
||||
"ts-loader": "^5.3.3",
|
||||
"ts-node": "^7.0.1",
|
||||
"tslint": "^5.12.1",
|
||||
"typescript": "^3.2.2",
|
||||
"typescript-tslint-plugin": "^0.2.1",
|
||||
"uglifyjs-webpack-plugin": "^2.1.1",
|
||||
"webpack": "^4.28.4",
|
||||
"webpack-bundle-analyzer": "^3.0.3",
|
||||
|
@ -1,8 +0,0 @@
|
||||
{
|
||||
"name": "@coder/electron-browser",
|
||||
"description": "A browser implementation of Electron's API.",
|
||||
"main": "src/index.ts",
|
||||
"devDependencies": {
|
||||
"electron": "^4.0.1"
|
||||
}
|
||||
}
|
@ -1,958 +0,0 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@types/node@^10.12.18":
|
||||
version "10.12.18"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.18.tgz#1d3ca764718915584fcd9f6344621b7672665c67"
|
||||
integrity sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ==
|
||||
|
||||
ajv@^6.5.5:
|
||||
version "6.6.2"
|
||||
resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.6.2.tgz#caceccf474bf3fc3ce3b147443711a24063cc30d"
|
||||
integrity sha512-FBHEW6Jf5TB9MGBgUUA9XHkTbjXYfAUjY43ACMfmdMRHniyoMHjHjzD50OK8LGDWQwp4rWEsIq5kEqq7rvIM1g==
|
||||
dependencies:
|
||||
fast-deep-equal "^2.0.1"
|
||||
fast-json-stable-stringify "^2.0.0"
|
||||
json-schema-traverse "^0.4.1"
|
||||
uri-js "^4.2.2"
|
||||
|
||||
ansi-regex@^2.0.0:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
|
||||
integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8=
|
||||
|
||||
array-find-index@^1.0.1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1"
|
||||
integrity sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=
|
||||
|
||||
asn1@~0.2.3:
|
||||
version "0.2.4"
|
||||
resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136"
|
||||
integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==
|
||||
dependencies:
|
||||
safer-buffer "~2.1.0"
|
||||
|
||||
assert-plus@1.0.0, assert-plus@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525"
|
||||
integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=
|
||||
|
||||
asynckit@^0.4.0:
|
||||
version "0.4.0"
|
||||
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
|
||||
integrity sha1-x57Zf380y48robyXkLzDZkdLS3k=
|
||||
|
||||
aws-sign2@~0.7.0:
|
||||
version "0.7.0"
|
||||
resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8"
|
||||
integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=
|
||||
|
||||
aws4@^1.8.0:
|
||||
version "1.8.0"
|
||||
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f"
|
||||
integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==
|
||||
|
||||
bcrypt-pbkdf@^1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e"
|
||||
integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=
|
||||
dependencies:
|
||||
tweetnacl "^0.14.3"
|
||||
|
||||
buffer-from@^1.0.0:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
|
||||
integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==
|
||||
|
||||
builtin-modules@^1.0.0:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"
|
||||
integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=
|
||||
|
||||
camelcase-keys@^2.0.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7"
|
||||
integrity sha1-MIvur/3ygRkFHvodkyITyRuPkuc=
|
||||
dependencies:
|
||||
camelcase "^2.0.0"
|
||||
map-obj "^1.0.0"
|
||||
|
||||
camelcase@^2.0.0:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f"
|
||||
integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=
|
||||
|
||||
caseless@~0.12.0:
|
||||
version "0.12.0"
|
||||
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
|
||||
integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=
|
||||
|
||||
code-point-at@^1.0.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
|
||||
integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=
|
||||
|
||||
combined-stream@^1.0.6, combined-stream@~1.0.6:
|
||||
version "1.0.7"
|
||||
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828"
|
||||
integrity sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==
|
||||
dependencies:
|
||||
delayed-stream "~1.0.0"
|
||||
|
||||
concat-stream@1.6.2:
|
||||
version "1.6.2"
|
||||
resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34"
|
||||
integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==
|
||||
dependencies:
|
||||
buffer-from "^1.0.0"
|
||||
inherits "^2.0.3"
|
||||
readable-stream "^2.2.2"
|
||||
typedarray "^0.0.6"
|
||||
|
||||
core-util-is@1.0.2, core-util-is@~1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
|
||||
integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=
|
||||
|
||||
currently-unhandled@^0.4.1:
|
||||
version "0.4.1"
|
||||
resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea"
|
||||
integrity sha1-mI3zP+qxke95mmE2nddsF635V+o=
|
||||
dependencies:
|
||||
array-find-index "^1.0.1"
|
||||
|
||||
dashdash@^1.12.0:
|
||||
version "1.14.1"
|
||||
resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0"
|
||||
integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=
|
||||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
|
||||
debug@2.6.9, debug@^2.1.3, debug@^2.2.0:
|
||||
version "2.6.9"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
|
||||
integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==
|
||||
dependencies:
|
||||
ms "2.0.0"
|
||||
|
||||
debug@^3.0.0:
|
||||
version "3.2.6"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b"
|
||||
integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==
|
||||
dependencies:
|
||||
ms "^2.1.1"
|
||||
|
||||
decamelize@^1.1.2:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
|
||||
integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=
|
||||
|
||||
deep-extend@^0.6.0:
|
||||
version "0.6.0"
|
||||
resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac"
|
||||
integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==
|
||||
|
||||
delayed-stream@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
|
||||
integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk=
|
||||
|
||||
ecc-jsbn@~0.1.1:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9"
|
||||
integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=
|
||||
dependencies:
|
||||
jsbn "~0.1.0"
|
||||
safer-buffer "^2.1.0"
|
||||
|
||||
electron-download@^4.1.0:
|
||||
version "4.1.1"
|
||||
resolved "https://registry.yarnpkg.com/electron-download/-/electron-download-4.1.1.tgz#02e69556705cc456e520f9e035556ed5a015ebe8"
|
||||
integrity sha512-FjEWG9Jb/ppK/2zToP+U5dds114fM1ZOJqMAR4aXXL5CvyPE9fiqBK/9YcwC9poIFQTEJk/EM/zyRwziziRZrg==
|
||||
dependencies:
|
||||
debug "^3.0.0"
|
||||
env-paths "^1.0.0"
|
||||
fs-extra "^4.0.1"
|
||||
minimist "^1.2.0"
|
||||
nugget "^2.0.1"
|
||||
path-exists "^3.0.0"
|
||||
rc "^1.2.1"
|
||||
semver "^5.4.1"
|
||||
sumchecker "^2.0.2"
|
||||
|
||||
electron@^4.0.1:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/electron/-/electron-4.0.1.tgz#c41eaee9e081c2e5e4a4a4a761b7577a77d2eb18"
|
||||
integrity sha512-kBWDLn1Vq8Tm6+/HpQc8gkjX7wJyQI8v/lf2kAirfi0Q4cXh6vBjozFvV1U/9gGCbyKnIDM+m8/wpyJIjg4w7g==
|
||||
dependencies:
|
||||
"@types/node" "^10.12.18"
|
||||
electron-download "^4.1.0"
|
||||
extract-zip "^1.0.3"
|
||||
|
||||
env-paths@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-1.0.0.tgz#4168133b42bb05c38a35b1ae4397c8298ab369e0"
|
||||
integrity sha1-QWgTO0K7BcOKNbGuQ5fIKYqzaeA=
|
||||
|
||||
error-ex@^1.2.0:
|
||||
version "1.3.2"
|
||||
resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf"
|
||||
integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==
|
||||
dependencies:
|
||||
is-arrayish "^0.2.1"
|
||||
|
||||
extend@~3.0.2:
|
||||
version "3.0.2"
|
||||
resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa"
|
||||
integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==
|
||||
|
||||
extract-zip@^1.0.3:
|
||||
version "1.6.7"
|
||||
resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-1.6.7.tgz#a840b4b8af6403264c8db57f4f1a74333ef81fe9"
|
||||
integrity sha1-qEC0uK9kAyZMjbV/Txp0Mz74H+k=
|
||||
dependencies:
|
||||
concat-stream "1.6.2"
|
||||
debug "2.6.9"
|
||||
mkdirp "0.5.1"
|
||||
yauzl "2.4.1"
|
||||
|
||||
extsprintf@1.3.0:
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05"
|
||||
integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=
|
||||
|
||||
extsprintf@^1.2.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f"
|
||||
integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8=
|
||||
|
||||
fast-deep-equal@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49"
|
||||
integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=
|
||||
|
||||
fast-json-stable-stringify@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2"
|
||||
integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I=
|
||||
|
||||
fd-slicer@~1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.0.1.tgz#8b5bcbd9ec327c5041bf9ab023fd6750f1177e65"
|
||||
integrity sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=
|
||||
dependencies:
|
||||
pend "~1.2.0"
|
||||
|
||||
find-up@^1.0.0:
|
||||
version "1.1.2"
|
||||
resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f"
|
||||
integrity sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=
|
||||
dependencies:
|
||||
path-exists "^2.0.0"
|
||||
pinkie-promise "^2.0.0"
|
||||
|
||||
forever-agent@~0.6.1:
|
||||
version "0.6.1"
|
||||
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
|
||||
integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=
|
||||
|
||||
form-data@~2.3.2:
|
||||
version "2.3.3"
|
||||
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6"
|
||||
integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==
|
||||
dependencies:
|
||||
asynckit "^0.4.0"
|
||||
combined-stream "^1.0.6"
|
||||
mime-types "^2.1.12"
|
||||
|
||||
fs-extra@^4.0.1:
|
||||
version "4.0.3"
|
||||
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94"
|
||||
integrity sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==
|
||||
dependencies:
|
||||
graceful-fs "^4.1.2"
|
||||
jsonfile "^4.0.0"
|
||||
universalify "^0.1.0"
|
||||
|
||||
get-stdin@^4.0.1:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe"
|
||||
integrity sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=
|
||||
|
||||
getpass@^0.1.1:
|
||||
version "0.1.7"
|
||||
resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa"
|
||||
integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=
|
||||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
|
||||
graceful-fs@^4.1.2, graceful-fs@^4.1.6:
|
||||
version "4.1.15"
|
||||
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00"
|
||||
integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==
|
||||
|
||||
har-schema@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92"
|
||||
integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=
|
||||
|
||||
har-validator@~5.1.0:
|
||||
version "5.1.3"
|
||||
resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080"
|
||||
integrity sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==
|
||||
dependencies:
|
||||
ajv "^6.5.5"
|
||||
har-schema "^2.0.0"
|
||||
|
||||
hosted-git-info@^2.1.4:
|
||||
version "2.7.1"
|
||||
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047"
|
||||
integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==
|
||||
|
||||
http-signature@~1.2.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1"
|
||||
integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=
|
||||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
jsprim "^1.2.2"
|
||||
sshpk "^1.7.0"
|
||||
|
||||
indent-string@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-2.1.0.tgz#8e2d48348742121b4a8218b7a137e9a52049dc80"
|
||||
integrity sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=
|
||||
dependencies:
|
||||
repeating "^2.0.0"
|
||||
|
||||
inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
|
||||
integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=
|
||||
|
||||
ini@~1.3.0:
|
||||
version "1.3.5"
|
||||
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927"
|
||||
integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==
|
||||
|
||||
is-arrayish@^0.2.1:
|
||||
version "0.2.1"
|
||||
resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d"
|
||||
integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=
|
||||
|
||||
is-builtin-module@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe"
|
||||
integrity sha1-VAVy0096wxGfj3bDDLwbHgN6/74=
|
||||
dependencies:
|
||||
builtin-modules "^1.0.0"
|
||||
|
||||
is-finite@^1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa"
|
||||
integrity sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=
|
||||
dependencies:
|
||||
number-is-nan "^1.0.0"
|
||||
|
||||
is-fullwidth-code-point@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb"
|
||||
integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs=
|
||||
dependencies:
|
||||
number-is-nan "^1.0.0"
|
||||
|
||||
is-typedarray@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
|
||||
integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=
|
||||
|
||||
is-utf8@^0.2.0:
|
||||
version "0.2.1"
|
||||
resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72"
|
||||
integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=
|
||||
|
||||
isarray@0.0.1:
|
||||
version "0.0.1"
|
||||
resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf"
|
||||
integrity sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=
|
||||
|
||||
isarray@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
|
||||
integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=
|
||||
|
||||
isstream@~0.1.2:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
|
||||
integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=
|
||||
|
||||
jsbn@~0.1.0:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
|
||||
integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM=
|
||||
|
||||
json-schema-traverse@^0.4.1:
|
||||
version "0.4.1"
|
||||
resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660"
|
||||
integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==
|
||||
|
||||
json-schema@0.2.3:
|
||||
version "0.2.3"
|
||||
resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13"
|
||||
integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=
|
||||
|
||||
json-stringify-safe@~5.0.1:
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
|
||||
integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=
|
||||
|
||||
jsonfile@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb"
|
||||
integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=
|
||||
optionalDependencies:
|
||||
graceful-fs "^4.1.6"
|
||||
|
||||
jsprim@^1.2.2:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2"
|
||||
integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=
|
||||
dependencies:
|
||||
assert-plus "1.0.0"
|
||||
extsprintf "1.3.0"
|
||||
json-schema "0.2.3"
|
||||
verror "1.10.0"
|
||||
|
||||
load-json-file@^1.0.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0"
|
||||
integrity sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=
|
||||
dependencies:
|
||||
graceful-fs "^4.1.2"
|
||||
parse-json "^2.2.0"
|
||||
pify "^2.0.0"
|
||||
pinkie-promise "^2.0.0"
|
||||
strip-bom "^2.0.0"
|
||||
|
||||
loud-rejection@^1.0.0:
|
||||
version "1.6.0"
|
||||
resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f"
|
||||
integrity sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=
|
||||
dependencies:
|
||||
currently-unhandled "^0.4.1"
|
||||
signal-exit "^3.0.0"
|
||||
|
||||
map-obj@^1.0.0, map-obj@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d"
|
||||
integrity sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=
|
||||
|
||||
meow@^3.1.0:
|
||||
version "3.7.0"
|
||||
resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb"
|
||||
integrity sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=
|
||||
dependencies:
|
||||
camelcase-keys "^2.0.0"
|
||||
decamelize "^1.1.2"
|
||||
loud-rejection "^1.0.0"
|
||||
map-obj "^1.0.1"
|
||||
minimist "^1.1.3"
|
||||
normalize-package-data "^2.3.4"
|
||||
object-assign "^4.0.1"
|
||||
read-pkg-up "^1.0.1"
|
||||
redent "^1.0.0"
|
||||
trim-newlines "^1.0.0"
|
||||
|
||||
mime-db@~1.37.0:
|
||||
version "1.37.0"
|
||||
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.37.0.tgz#0b6a0ce6fdbe9576e25f1f2d2fde8830dc0ad0d8"
|
||||
integrity sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==
|
||||
|
||||
mime-types@^2.1.12, mime-types@~2.1.19:
|
||||
version "2.1.21"
|
||||
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.21.tgz#28995aa1ecb770742fe6ae7e58f9181c744b3f96"
|
||||
integrity sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==
|
||||
dependencies:
|
||||
mime-db "~1.37.0"
|
||||
|
||||
minimist@0.0.8:
|
||||
version "0.0.8"
|
||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
|
||||
integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=
|
||||
|
||||
minimist@^1.1.0, minimist@^1.1.3, minimist@^1.2.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
|
||||
integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=
|
||||
|
||||
mkdirp@0.5.1:
|
||||
version "0.5.1"
|
||||
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
|
||||
integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=
|
||||
dependencies:
|
||||
minimist "0.0.8"
|
||||
|
||||
ms@2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
|
||||
integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=
|
||||
|
||||
ms@^2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a"
|
||||
integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==
|
||||
|
||||
normalize-package-data@^2.3.2, normalize-package-data@^2.3.4:
|
||||
version "2.4.0"
|
||||
resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f"
|
||||
integrity sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==
|
||||
dependencies:
|
||||
hosted-git-info "^2.1.4"
|
||||
is-builtin-module "^1.0.0"
|
||||
semver "2 || 3 || 4 || 5"
|
||||
validate-npm-package-license "^3.0.1"
|
||||
|
||||
nugget@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/nugget/-/nugget-2.0.1.tgz#201095a487e1ad36081b3432fa3cada4f8d071b0"
|
||||
integrity sha1-IBCVpIfhrTYIGzQy+jytpPjQcbA=
|
||||
dependencies:
|
||||
debug "^2.1.3"
|
||||
minimist "^1.1.0"
|
||||
pretty-bytes "^1.0.2"
|
||||
progress-stream "^1.1.0"
|
||||
request "^2.45.0"
|
||||
single-line-log "^1.1.2"
|
||||
throttleit "0.0.2"
|
||||
|
||||
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"
|
||||
integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=
|
||||
|
||||
oauth-sign@~0.9.0:
|
||||
version "0.9.0"
|
||||
resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455"
|
||||
integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==
|
||||
|
||||
object-assign@^4.0.1:
|
||||
version "4.1.1"
|
||||
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
|
||||
integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=
|
||||
|
||||
object-keys@~0.4.0:
|
||||
version "0.4.0"
|
||||
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-0.4.0.tgz#28a6aae7428dd2c3a92f3d95f21335dd204e0336"
|
||||
integrity sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=
|
||||
|
||||
parse-json@^2.2.0:
|
||||
version "2.2.0"
|
||||
resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9"
|
||||
integrity sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=
|
||||
dependencies:
|
||||
error-ex "^1.2.0"
|
||||
|
||||
path-exists@^2.0.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b"
|
||||
integrity sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=
|
||||
dependencies:
|
||||
pinkie-promise "^2.0.0"
|
||||
|
||||
path-exists@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515"
|
||||
integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=
|
||||
|
||||
path-type@^1.0.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441"
|
||||
integrity sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=
|
||||
dependencies:
|
||||
graceful-fs "^4.1.2"
|
||||
pify "^2.0.0"
|
||||
pinkie-promise "^2.0.0"
|
||||
|
||||
pend@~1.2.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50"
|
||||
integrity sha1-elfrVQpng/kRUzH89GY9XI4AelA=
|
||||
|
||||
performance-now@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
|
||||
integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=
|
||||
|
||||
pify@^2.0.0:
|
||||
version "2.3.0"
|
||||
resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
|
||||
integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw=
|
||||
|
||||
pinkie-promise@^2.0.0:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa"
|
||||
integrity sha1-ITXW36ejWMBprJsXh3YogihFD/o=
|
||||
dependencies:
|
||||
pinkie "^2.0.0"
|
||||
|
||||
pinkie@^2.0.0:
|
||||
version "2.0.4"
|
||||
resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870"
|
||||
integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA=
|
||||
|
||||
pretty-bytes@^1.0.2:
|
||||
version "1.0.4"
|
||||
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-1.0.4.tgz#0a22e8210609ad35542f8c8d5d2159aff0751c84"
|
||||
integrity sha1-CiLoIQYJrTVUL4yNXSFZr/B1HIQ=
|
||||
dependencies:
|
||||
get-stdin "^4.0.1"
|
||||
meow "^3.1.0"
|
||||
|
||||
process-nextick-args@~2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa"
|
||||
integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==
|
||||
|
||||
progress-stream@^1.1.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/progress-stream/-/progress-stream-1.2.0.tgz#2cd3cfea33ba3a89c9c121ec3347abe9ab125f77"
|
||||
integrity sha1-LNPP6jO6OonJwSHsM0er6asSX3c=
|
||||
dependencies:
|
||||
speedometer "~0.1.2"
|
||||
through2 "~0.2.3"
|
||||
|
||||
psl@^1.1.24:
|
||||
version "1.1.31"
|
||||
resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184"
|
||||
integrity sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==
|
||||
|
||||
punycode@^1.4.1:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
|
||||
integrity sha1-wNWmOycYgArY4esPpSachN1BhF4=
|
||||
|
||||
punycode@^2.1.0:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
|
||||
integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==
|
||||
|
||||
qs@~6.5.2:
|
||||
version "6.5.2"
|
||||
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36"
|
||||
integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==
|
||||
|
||||
rc@^1.2.1:
|
||||
version "1.2.8"
|
||||
resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed"
|
||||
integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==
|
||||
dependencies:
|
||||
deep-extend "^0.6.0"
|
||||
ini "~1.3.0"
|
||||
minimist "^1.2.0"
|
||||
strip-json-comments "~2.0.1"
|
||||
|
||||
read-pkg-up@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02"
|
||||
integrity sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=
|
||||
dependencies:
|
||||
find-up "^1.0.0"
|
||||
read-pkg "^1.0.0"
|
||||
|
||||
read-pkg@^1.0.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28"
|
||||
integrity sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=
|
||||
dependencies:
|
||||
load-json-file "^1.0.0"
|
||||
normalize-package-data "^2.3.2"
|
||||
path-type "^1.0.0"
|
||||
|
||||
readable-stream@^2.2.2:
|
||||
version "2.3.6"
|
||||
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf"
|
||||
integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==
|
||||
dependencies:
|
||||
core-util-is "~1.0.0"
|
||||
inherits "~2.0.3"
|
||||
isarray "~1.0.0"
|
||||
process-nextick-args "~2.0.0"
|
||||
safe-buffer "~5.1.1"
|
||||
string_decoder "~1.1.1"
|
||||
util-deprecate "~1.0.1"
|
||||
|
||||
readable-stream@~1.1.9:
|
||||
version "1.1.14"
|
||||
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9"
|
||||
integrity sha1-fPTFTvZI44EwhMY23SB54WbAgdk=
|
||||
dependencies:
|
||||
core-util-is "~1.0.0"
|
||||
inherits "~2.0.1"
|
||||
isarray "0.0.1"
|
||||
string_decoder "~0.10.x"
|
||||
|
||||
redent@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde"
|
||||
integrity sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=
|
||||
dependencies:
|
||||
indent-string "^2.1.0"
|
||||
strip-indent "^1.0.1"
|
||||
|
||||
repeating@^2.0.0:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda"
|
||||
integrity sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=
|
||||
dependencies:
|
||||
is-finite "^1.0.0"
|
||||
|
||||
request@^2.45.0:
|
||||
version "2.88.0"
|
||||
resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef"
|
||||
integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==
|
||||
dependencies:
|
||||
aws-sign2 "~0.7.0"
|
||||
aws4 "^1.8.0"
|
||||
caseless "~0.12.0"
|
||||
combined-stream "~1.0.6"
|
||||
extend "~3.0.2"
|
||||
forever-agent "~0.6.1"
|
||||
form-data "~2.3.2"
|
||||
har-validator "~5.1.0"
|
||||
http-signature "~1.2.0"
|
||||
is-typedarray "~1.0.0"
|
||||
isstream "~0.1.2"
|
||||
json-stringify-safe "~5.0.1"
|
||||
mime-types "~2.1.19"
|
||||
oauth-sign "~0.9.0"
|
||||
performance-now "^2.1.0"
|
||||
qs "~6.5.2"
|
||||
safe-buffer "^5.1.2"
|
||||
tough-cookie "~2.4.3"
|
||||
tunnel-agent "^0.6.0"
|
||||
uuid "^3.3.2"
|
||||
|
||||
safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
|
||||
version "5.1.2"
|
||||
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
|
||||
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
|
||||
|
||||
safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
|
||||
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
|
||||
|
||||
"semver@2 || 3 || 4 || 5", semver@^5.4.1:
|
||||
version "5.6.0"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004"
|
||||
integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==
|
||||
|
||||
signal-exit@^3.0.0:
|
||||
version "3.0.2"
|
||||
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"
|
||||
integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=
|
||||
|
||||
single-line-log@^1.1.2:
|
||||
version "1.1.2"
|
||||
resolved "https://registry.yarnpkg.com/single-line-log/-/single-line-log-1.1.2.tgz#c2f83f273a3e1a16edb0995661da0ed5ef033364"
|
||||
integrity sha1-wvg/Jzo+GhbtsJlWYdoO1e8DM2Q=
|
||||
dependencies:
|
||||
string-width "^1.0.1"
|
||||
|
||||
spdx-correct@^3.0.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4"
|
||||
integrity sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==
|
||||
dependencies:
|
||||
spdx-expression-parse "^3.0.0"
|
||||
spdx-license-ids "^3.0.0"
|
||||
|
||||
spdx-exceptions@^2.1.0:
|
||||
version "2.2.0"
|
||||
resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977"
|
||||
integrity sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==
|
||||
|
||||
spdx-expression-parse@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0"
|
||||
integrity sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==
|
||||
dependencies:
|
||||
spdx-exceptions "^2.1.0"
|
||||
spdx-license-ids "^3.0.0"
|
||||
|
||||
spdx-license-ids@^3.0.0:
|
||||
version "3.0.3"
|
||||
resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz#81c0ce8f21474756148bbb5f3bfc0f36bf15d76e"
|
||||
integrity sha512-uBIcIl3Ih6Phe3XHK1NqboJLdGfwr1UN3k6wSD1dZpmPsIkb8AGNbZYJ1fOBk834+Gxy8rpfDxrS6XLEMZMY2g==
|
||||
|
||||
speedometer@~0.1.2:
|
||||
version "0.1.4"
|
||||
resolved "https://registry.yarnpkg.com/speedometer/-/speedometer-0.1.4.tgz#9876dbd2a169d3115402d48e6ea6329c8816a50d"
|
||||
integrity sha1-mHbb0qFp0xFUAtSObqYynIgWpQ0=
|
||||
|
||||
sshpk@^1.7.0:
|
||||
version "1.16.0"
|
||||
resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.0.tgz#1d4963a2fbffe58050aa9084ca20be81741c07de"
|
||||
integrity sha512-Zhev35/y7hRMcID/upReIvRse+I9SVhyVre/KTJSJQWMz3C3+G+HpO7m1wK/yckEtujKZ7dS4hkVxAnmHaIGVQ==
|
||||
dependencies:
|
||||
asn1 "~0.2.3"
|
||||
assert-plus "^1.0.0"
|
||||
bcrypt-pbkdf "^1.0.0"
|
||||
dashdash "^1.12.0"
|
||||
ecc-jsbn "~0.1.1"
|
||||
getpass "^0.1.1"
|
||||
jsbn "~0.1.0"
|
||||
safer-buffer "^2.0.2"
|
||||
tweetnacl "~0.14.0"
|
||||
|
||||
string-width@^1.0.1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
|
||||
integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=
|
||||
dependencies:
|
||||
code-point-at "^1.0.0"
|
||||
is-fullwidth-code-point "^1.0.0"
|
||||
strip-ansi "^3.0.0"
|
||||
|
||||
string_decoder@~0.10.x:
|
||||
version "0.10.31"
|
||||
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94"
|
||||
integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=
|
||||
|
||||
string_decoder@~1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"
|
||||
integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==
|
||||
dependencies:
|
||||
safe-buffer "~5.1.0"
|
||||
|
||||
strip-ansi@^3.0.0:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
|
||||
integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=
|
||||
dependencies:
|
||||
ansi-regex "^2.0.0"
|
||||
|
||||
strip-bom@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e"
|
||||
integrity sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=
|
||||
dependencies:
|
||||
is-utf8 "^0.2.0"
|
||||
|
||||
strip-indent@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-1.0.1.tgz#0c7962a6adefa7bbd4ac366460a638552ae1a0a2"
|
||||
integrity sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=
|
||||
dependencies:
|
||||
get-stdin "^4.0.1"
|
||||
|
||||
strip-json-comments@~2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
|
||||
integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo=
|
||||
|
||||
sumchecker@^2.0.2:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/sumchecker/-/sumchecker-2.0.2.tgz#0f42c10e5d05da5d42eea3e56c3399a37d6c5b3e"
|
||||
integrity sha1-D0LBDl0F2l1C7qPlbDOZo31sWz4=
|
||||
dependencies:
|
||||
debug "^2.2.0"
|
||||
|
||||
throttleit@0.0.2:
|
||||
version "0.0.2"
|
||||
resolved "https://registry.yarnpkg.com/throttleit/-/throttleit-0.0.2.tgz#cfedf88e60c00dd9697b61fdd2a8343a9b680eaf"
|
||||
integrity sha1-z+34jmDADdlpe2H90qg0OptoDq8=
|
||||
|
||||
through2@~0.2.3:
|
||||
version "0.2.3"
|
||||
resolved "https://registry.yarnpkg.com/through2/-/through2-0.2.3.tgz#eb3284da4ea311b6cc8ace3653748a52abf25a3f"
|
||||
integrity sha1-6zKE2k6jEbbMis42U3SKUqvyWj8=
|
||||
dependencies:
|
||||
readable-stream "~1.1.9"
|
||||
xtend "~2.1.1"
|
||||
|
||||
tough-cookie@~2.4.3:
|
||||
version "2.4.3"
|
||||
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781"
|
||||
integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==
|
||||
dependencies:
|
||||
psl "^1.1.24"
|
||||
punycode "^1.4.1"
|
||||
|
||||
trim-newlines@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613"
|
||||
integrity sha1-WIeWa7WCpFA6QetST301ARgVphM=
|
||||
|
||||
tunnel-agent@^0.6.0:
|
||||
version "0.6.0"
|
||||
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd"
|
||||
integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=
|
||||
dependencies:
|
||||
safe-buffer "^5.0.1"
|
||||
|
||||
tweetnacl@^0.14.3, tweetnacl@~0.14.0:
|
||||
version "0.14.5"
|
||||
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
|
||||
integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=
|
||||
|
||||
typedarray@^0.0.6:
|
||||
version "0.0.6"
|
||||
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
|
||||
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
|
||||
|
||||
universalify@^0.1.0:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66"
|
||||
integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==
|
||||
|
||||
uri-js@^4.2.2:
|
||||
version "4.2.2"
|
||||
resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0"
|
||||
integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==
|
||||
dependencies:
|
||||
punycode "^2.1.0"
|
||||
|
||||
util-deprecate@~1.0.1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
|
||||
integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=
|
||||
|
||||
uuid@^3.3.2:
|
||||
version "3.3.2"
|
||||
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131"
|
||||
integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==
|
||||
|
||||
validate-npm-package-license@^3.0.1:
|
||||
version "3.0.4"
|
||||
resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a"
|
||||
integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==
|
||||
dependencies:
|
||||
spdx-correct "^3.0.0"
|
||||
spdx-expression-parse "^3.0.0"
|
||||
|
||||
verror@1.10.0:
|
||||
version "1.10.0"
|
||||
resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400"
|
||||
integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=
|
||||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
core-util-is "1.0.2"
|
||||
extsprintf "^1.2.0"
|
||||
|
||||
xtend@~2.1.1:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.yarnpkg.com/xtend/-/xtend-2.1.2.tgz#6efecc2a4dad8e6962c4901b337ce7ba87b5d28b"
|
||||
integrity sha1-bv7MKk2tjmlixJAbM3znuoe10os=
|
||||
dependencies:
|
||||
object-keys "~0.4.0"
|
||||
|
||||
yauzl@2.4.1:
|
||||
version "2.4.1"
|
||||
resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.4.1.tgz#9528f442dab1b2284e58b4379bb194e22e0c4005"
|
||||
integrity sha1-lSj0QtqxsihOWLQ3m7GU4i4MQAU=
|
||||
dependencies:
|
||||
fd-slicer "~1.0.1"
|
@ -1,14 +1,15 @@
|
||||
import { exec } from "child_process";
|
||||
import { promisify } from "util";
|
||||
import { field, logger, time, Time } from "@coder/logger";
|
||||
import { escapePath } from "@coder/node-browser";
|
||||
import { escapePath } from "@coder/server";
|
||||
import { retry } from "./retry";
|
||||
|
||||
export interface IClientOptions {
|
||||
mkDirs?: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Client represents a general abstraction of an IDE client.
|
||||
* A general abstraction of an IDE client.
|
||||
*
|
||||
* Everything the client provides is asynchronous so you can wait on what
|
||||
* you need from it without blocking anything else.
|
||||
@ -36,6 +37,11 @@ export class Client {
|
||||
await promisify(exec)(`mkdir -p ${options.mkDirs.map(escapePath).join(" ")}`);
|
||||
}
|
||||
});
|
||||
|
||||
// Prevent Firefox from trying to reconnect when the page unloads.
|
||||
window.addEventListener("unload", () => {
|
||||
retry.block();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
4
packages/ide/src/fill/child_process.ts
Normal file
4
packages/ide/src/fill/child_process.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import { CP } from "@coder/server";
|
||||
import { client } from "./client";
|
||||
|
||||
export = new CP(client);
|
157
packages/ide/src/fill/client.ts
Normal file
157
packages/ide/src/fill/client.ts
Normal file
@ -0,0 +1,157 @@
|
||||
import { Emitter } from "@coder/events";
|
||||
import { logger, field } from "@coder/logger";
|
||||
import { Client, ReadWriteConnection } from "@coder/server";
|
||||
import { retry } from "../retry";
|
||||
|
||||
/**
|
||||
* A connection based on a web socket. Automatically reconnects and buffers
|
||||
* messages during connection.
|
||||
*/
|
||||
class Connection implements ReadWriteConnection {
|
||||
|
||||
private activeSocket: WebSocket | undefined;
|
||||
private readonly messageEmitter: Emitter<Uint8Array>;
|
||||
private readonly closeEmitter: Emitter<void>;
|
||||
private readonly upEmitter: Emitter<void>;
|
||||
private readonly downEmitter: Emitter<void>;
|
||||
private readonly messageBuffer: Uint8Array[];
|
||||
private socketTimeoutDelay = 60 * 1000;
|
||||
private retryName = "Web socket";
|
||||
private isUp: boolean | undefined;
|
||||
private closed: boolean | undefined;
|
||||
|
||||
public constructor() {
|
||||
this.messageEmitter = new Emitter();
|
||||
this.closeEmitter = new Emitter();
|
||||
this.upEmitter = new Emitter();
|
||||
this.downEmitter = new Emitter();
|
||||
this.messageBuffer = [];
|
||||
retry.register(this.retryName, () => this.connect());
|
||||
this.connect().catch(() => {
|
||||
retry.block(this.retryName);
|
||||
retry.run(this.retryName);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a function to be called when the connection goes up.
|
||||
*/
|
||||
public onUp(cb: () => void): void {
|
||||
this.upEmitter.event(cb);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a function to be called when the connection goes down.
|
||||
*/
|
||||
public onDown(cb: () => void): void {
|
||||
this.downEmitter.event(cb);
|
||||
}
|
||||
|
||||
public send(data: Buffer | Uint8Array): void {
|
||||
if (this.closed) {
|
||||
throw new Error("web socket is closed");
|
||||
}
|
||||
if (!this.activeSocket || this.activeSocket.readyState !== this.activeSocket.OPEN) {
|
||||
this.messageBuffer.push(data);
|
||||
} else {
|
||||
this.activeSocket.send(data);
|
||||
}
|
||||
}
|
||||
|
||||
public onMessage(cb: (data: Uint8Array | Buffer) => void): void {
|
||||
this.messageEmitter.event(cb);
|
||||
}
|
||||
|
||||
public onClose(cb: () => void): void {
|
||||
this.closeEmitter.event(cb);
|
||||
}
|
||||
|
||||
public close(): void {
|
||||
this.closed = true;
|
||||
this.dispose();
|
||||
this.closeEmitter.emit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Connect to the server.
|
||||
*/
|
||||
private async connect(): Promise<void> {
|
||||
const socket = await this.openSocket();
|
||||
|
||||
socket.addEventListener("message", (event: MessageEvent) => {
|
||||
this.messageEmitter.emit(event.data);
|
||||
});
|
||||
|
||||
socket.addEventListener("close", (event) => {
|
||||
if (this.isUp) {
|
||||
this.isUp = false;
|
||||
this.downEmitter.emit(undefined);
|
||||
}
|
||||
logger.warn(
|
||||
"Web socket closed",
|
||||
field("code", event.code),
|
||||
field("reason", event.reason),
|
||||
field("wasClean", event.wasClean),
|
||||
);
|
||||
if (!this.closed) {
|
||||
retry.block(this.retryName);
|
||||
retry.run(this.retryName);
|
||||
}
|
||||
});
|
||||
|
||||
// Send any messages that were queued while we were waiting to connect.
|
||||
while (this.messageBuffer.length > 0) {
|
||||
socket.send(this.messageBuffer.shift()!);
|
||||
}
|
||||
|
||||
if (!this.isUp) {
|
||||
this.isUp = true;
|
||||
this.upEmitter.emit(undefined);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Open a web socket, disposing the previous connection if any.
|
||||
*/
|
||||
private async openSocket(): Promise<WebSocket> {
|
||||
this.dispose();
|
||||
const socket = new WebSocket("websocket");
|
||||
socket.binaryType = "arraybuffer";
|
||||
this.activeSocket = socket;
|
||||
|
||||
const socketWaitTimeout = window.setTimeout(() => {
|
||||
socket.close();
|
||||
}, this.socketTimeoutDelay);
|
||||
|
||||
await new Promise((resolve, reject): void => {
|
||||
const onClose = (): void => {
|
||||
clearTimeout(socketWaitTimeout);
|
||||
socket.removeEventListener("close", onClose);
|
||||
reject();
|
||||
};
|
||||
socket.addEventListener("close", onClose);
|
||||
|
||||
socket.addEventListener("open", async () => {
|
||||
clearTimeout(socketWaitTimeout);
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
|
||||
return socket;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dispose the current connection.
|
||||
*/
|
||||
private dispose(): void {
|
||||
if (this.activeSocket) {
|
||||
this.activeSocket.close();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* A client for proxying Node APIs based on web sockets.
|
||||
*/
|
||||
export const client = new Client(new Connection());
|
@ -66,3 +66,18 @@
|
||||
.msgbox > .button-wrapper > button:not(:last-child) {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.msgbox-overlay {
|
||||
align-items: center;
|
||||
background: rgba(0, 0, 0, 0.4);
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
left: 0;
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
transition: 300ms opacity ease;
|
||||
z-index: 15;
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
import { IDisposable } from "@coder/disposable";
|
||||
import { Emitter } from "@coder/emitter";
|
||||
import { Emitter } from "@coder/events";
|
||||
|
||||
import "./dialog.scss";
|
||||
|
||||
@ -36,11 +36,11 @@ export class Dialog {
|
||||
|
||||
private options: IDialogOptions;
|
||||
private overlay: HTMLElement;
|
||||
private cachedActiveElement: HTMLElement;
|
||||
private input: HTMLInputElement;
|
||||
private cachedActiveElement: HTMLElement | undefined;
|
||||
private input: HTMLInputElement | undefined;
|
||||
private actionEmitter: Emitter<IDialogAction>;
|
||||
private errors: HTMLElement;
|
||||
private buttons: HTMLElement[];
|
||||
private buttons: HTMLElement[] | undefined;
|
||||
|
||||
public constructor(options: IDialogOptions) {
|
||||
this.options = options;
|
||||
@ -105,9 +105,8 @@ export class Dialog {
|
||||
msgBox.appendChild(buttonWrapper);
|
||||
}
|
||||
|
||||
|
||||
this.overlay = document.createElement("div");
|
||||
this.overlay.style.cssText = `display: flex; align-items: center; justify-content: center; top: 0; left: 0; right: 0; bottom: 0; z-index: 15; position: absolute; background: rgba(0, 0, 0, 0.4); opacity: 0; transition: 300ms opacity ease;`;
|
||||
this.overlay.className = "msgbox-overlay";
|
||||
this.overlay.appendChild(msgBox);
|
||||
|
||||
setTimeout(() => {
|
||||
@ -125,7 +124,7 @@ export class Dialog {
|
||||
/**
|
||||
* Input value if this dialog has an input.
|
||||
*/
|
||||
public get inputValue(): string {
|
||||
public get inputValue(): string | undefined {
|
||||
return this.input ? this.input.value : undefined;
|
||||
}
|
||||
|
||||
@ -153,10 +152,10 @@ export class Dialog {
|
||||
document.addEventListener("keydown", this.onKeydown);
|
||||
if (this.input) {
|
||||
this.input.focus();
|
||||
if (this.options.input.selection) {
|
||||
if (this.options.input && this.options.input.selection) {
|
||||
this.input.setSelectionRange(
|
||||
this.options.input.selection.start,
|
||||
this.options.input.selection.end
|
||||
this.options.input.selection.end,
|
||||
);
|
||||
}
|
||||
} else if (this.buttons) {
|
||||
@ -173,7 +172,7 @@ export class Dialog {
|
||||
this.overlay.remove();
|
||||
document.removeEventListener("keydown", this.onKeydown);
|
||||
this.cachedActiveElement.focus();
|
||||
this.cachedActiveElement = null;
|
||||
this.cachedActiveElement = undefined;
|
||||
}
|
||||
}
|
||||
|
4
packages/ide/src/fill/fs.ts
Normal file
4
packages/ide/src/fill/fs.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import { FS } from "@coder/server";
|
||||
import { client } from "./client";
|
||||
|
||||
export = new FS(client);
|
3
packages/ide/src/fill/net.ts
Normal file
3
packages/ide/src/fill/net.ts
Normal file
@ -0,0 +1,3 @@
|
||||
import { Net } from "@coder/server";
|
||||
|
||||
export = new Net();
|
5
packages/ide/src/fill/util.ts
Normal file
5
packages/ide/src/fill/util.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import { implementation as promisify } from "util.promisify";
|
||||
|
||||
export {
|
||||
promisify,
|
||||
}
|
@ -2,7 +2,7 @@ import { exec } from "child_process";
|
||||
import { appendFile } from "fs";
|
||||
import { promisify } from "util";
|
||||
import { logger, Logger } from "@coder/logger";
|
||||
import { escapePath } from "@coder/node-browser";
|
||||
import { escapePath } from "@coder/server";
|
||||
import { IURI } from "./uri";
|
||||
|
||||
/**
|
||||
|
@ -1,5 +0,0 @@
|
||||
{
|
||||
"name": "@coder/node-browser",
|
||||
"description": "A browser implementation of async Node APIs.",
|
||||
"main": "src/index.ts"
|
||||
}
|
@ -1,184 +0,0 @@
|
||||
import * as cp from "child_process";
|
||||
import * as stream from "stream";
|
||||
import * as events from "events";
|
||||
import * as net from "net";
|
||||
import { useBuffer, throwUnimplementedError, throwSyncError } from "./util";
|
||||
|
||||
/**
|
||||
* Readable stream.
|
||||
*/
|
||||
class Readable extends stream.Readable {
|
||||
|
||||
/**
|
||||
* Read a chunk.
|
||||
*/
|
||||
public _read(_size: number): void {
|
||||
// There is nothing to actually read.
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of ChildProcess for the browser.
|
||||
*/
|
||||
class ChildProcess extends events.EventEmitter implements cp.ChildProcess {
|
||||
|
||||
public connected: boolean = true;
|
||||
public killed: boolean = false;
|
||||
public pid = 0;
|
||||
public stdin: stream.Writable;
|
||||
public stdout: Readable;
|
||||
public stderr: Readable;
|
||||
public stdio: [stream.Writable, stream.Readable, stream.Readable];
|
||||
|
||||
private emitter = new events.EventEmitter();
|
||||
|
||||
public constructor(private session) {
|
||||
super();
|
||||
|
||||
this.emitter = new events.EventEmitter();
|
||||
this.stdin = new stream.Writable();
|
||||
this.stdin._write = (
|
||||
chunk: any, // tslint:disable-line no-any so we can match the Node API.
|
||||
_encoding: string,
|
||||
callback: (error?: Error) => void,
|
||||
): void => {
|
||||
session.sendStdin(chunk.toString());
|
||||
callback();
|
||||
};
|
||||
this.stdout = new Readable();
|
||||
this.stderr = new Readable();
|
||||
this.stdio = [this.stdin, this.stdout, this.stderr];
|
||||
|
||||
session.onDone((exitCode) => {
|
||||
this.emitter.emit("exit", exitCode);
|
||||
});
|
||||
|
||||
session.onDisconnect(() => {
|
||||
this.emitter.emit("exit", -1);
|
||||
});
|
||||
|
||||
session.onStdout((data) => {
|
||||
this.stdout.emit("data", data);
|
||||
});
|
||||
|
||||
session.onStderr((data) => {
|
||||
this.stderr.emit("data", data);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Kill the session.
|
||||
*/
|
||||
public kill(): void {
|
||||
this.session.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* Not implemented.
|
||||
*/
|
||||
public disconnect(): void {
|
||||
throwUnimplementedError();
|
||||
}
|
||||
|
||||
/**
|
||||
* Not implemented.
|
||||
*/
|
||||
public ref(): void {
|
||||
throwUnimplementedError();
|
||||
}
|
||||
|
||||
/**
|
||||
* Not implemented.
|
||||
*/
|
||||
public unref(): void {
|
||||
throwUnimplementedError();
|
||||
}
|
||||
|
||||
/**
|
||||
* Not implemented.
|
||||
*/
|
||||
public send(
|
||||
_message: any, // tslint:disable-line no-any so we can match the Node API.
|
||||
_sendHandle?: net.Socket | net.Server | ((error: Error) => void),
|
||||
_options?: cp.MessageOptions | ((error: Error) => void),
|
||||
_callback?: (error: Error) => void,
|
||||
): boolean {
|
||||
throw throwUnimplementedError();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add event listener.
|
||||
*/
|
||||
public on(
|
||||
eventName: string,
|
||||
callback: (...args: any[]) => void, // tslint:disable-line no-any so we can match the Node API.
|
||||
): this {
|
||||
this.emitter.on(eventName, callback);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// tslint:disable only-arrow-functions
|
||||
function exec(
|
||||
command: string,
|
||||
options?: { encoding?: BufferEncoding | string | "buffer" | null } & cp.ExecOptions | null | ((error: Error | null, stdout: string, stderr: string) => void) | ((error: Error | null, stdout: Buffer, stderr: Buffer) => void),
|
||||
callback?: ((error: Error | null, stdout: string, stderr: string) => void) | ((error: Error | null, stdout: Buffer, stderr: Buffer) => void),
|
||||
): cp.ChildProcess {
|
||||
const process = new ChildProcess(wush.execute({ command }));
|
||||
|
||||
let stdout = "";
|
||||
process.stdout.on("data", (data) => {
|
||||
stdout += data.toString();
|
||||
});
|
||||
|
||||
let stderr = "";
|
||||
process.stderr.on("data", (data) => {
|
||||
stderr += data.toString();
|
||||
});
|
||||
|
||||
process.on("exit", (exitCode) => {
|
||||
const error = exitCode !== 0 ? new Error(stderr) : null;
|
||||
if (typeof options === "function") {
|
||||
callback = options;
|
||||
}
|
||||
// @ts-ignore not sure how to make this work.
|
||||
callback(
|
||||
error,
|
||||
useBuffer(options) ? Buffer.from(stdout) : stdout,
|
||||
useBuffer(options) ? Buffer.from(stderr) : stderr,
|
||||
);
|
||||
});
|
||||
|
||||
return process;
|
||||
}
|
||||
|
||||
function fork(modulePath: string): cp.ChildProcess {
|
||||
return new ChildProcess(wush.execute({
|
||||
command: `node ${modulePath}`,
|
||||
}));
|
||||
}
|
||||
|
||||
function spawn(_command: string, _args?: ReadonlyArray<string> | cp.SpawnOptions, _options?: cp.SpawnOptions): cp.ChildProcess {
|
||||
throw new Error("not implemented");
|
||||
}
|
||||
// tslint:enable only-arrow-functions
|
||||
|
||||
// To satisfy the types.
|
||||
// tslint:disable no-any
|
||||
exec.__promisify__ = undefined as any;
|
||||
// tslint:enable no-any
|
||||
|
||||
const exp: typeof cp = {
|
||||
exec,
|
||||
execFile: throwUnimplementedError,
|
||||
execFileSync: throwSyncError,
|
||||
execSync: throwSyncError,
|
||||
fork,
|
||||
spawn,
|
||||
spawnSync: throwSyncError,
|
||||
};
|
||||
|
||||
export = exp;
|
@ -1,719 +0,0 @@
|
||||
import { ChildProcess } from "child_process";
|
||||
import * as fs from "fs";
|
||||
import { EventEmitter } from "events";
|
||||
import { promisify } from "util";
|
||||
import { Writable } from "stream";
|
||||
import { exec } from "./child_process";
|
||||
import {
|
||||
bashCommand, throwUnimplementedError, throwSyncError, escapePath,
|
||||
useBuffer, NewlineInputBuffer, Queue,
|
||||
} from "./util";
|
||||
|
||||
/**
|
||||
* An open file.
|
||||
*/
|
||||
interface IOpenFile {
|
||||
readonly path: fs.PathLike;
|
||||
position: number | undefined;
|
||||
}
|
||||
|
||||
type ReaddirCallback = (error?: NodeJS.ErrnoException, files?: string[]) => void;
|
||||
|
||||
/**
|
||||
* Queue for readdir.
|
||||
*/
|
||||
class ReaddirQueue extends Queue<ReaddirCallback> {
|
||||
|
||||
public async run(items: Map<string, ReaddirCallback[]>): Promise<void> {
|
||||
const keys = Array.from(items.keys());
|
||||
try {
|
||||
const stdio = await promisify(exec)(`bash -c '${keys.map((key) => `cd ${escapePath(key)} && ls -1a; echo;`).join(" ")}'`);
|
||||
stdio.stdout.trim().split("\n\n").forEach((split, index) => {
|
||||
const path = keys[index];
|
||||
const cbs = items.get(path)!;
|
||||
if (split.indexOf("does not exist") !== -1) {
|
||||
cbs.forEach((cb) => {
|
||||
cb({
|
||||
code: "ENOENT",
|
||||
message: "No such file or directory " + path,
|
||||
name: "Not found",
|
||||
});
|
||||
});
|
||||
} else {
|
||||
const files = split.trim().split("\n");
|
||||
cbs.forEach((cb) => {
|
||||
cb(undefined, files.filter((f) => f !== "." && f !== ".."));
|
||||
});
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
items.forEach((cbs) => cbs.forEach((cb) => cb(new Error("failed to ls"))));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
type StatCallback = (error?: NodeJS.ErrnoException, stats?: fs.Stats) => void;
|
||||
|
||||
/**
|
||||
* Queue for stat.
|
||||
*/
|
||||
class StatQueue extends Queue<StatCallback> {
|
||||
|
||||
public constructor() {
|
||||
super(100);
|
||||
}
|
||||
|
||||
public async run(items: Map<string, StatCallback[]>): Promise<void> {
|
||||
try {
|
||||
const stats = await this.stat(Array.from(items.keys()));
|
||||
items.forEach((callbacks, path) => {
|
||||
if (stats.has(path)) {
|
||||
callbacks.forEach((cb) => {
|
||||
cb(undefined, stats.get(path));
|
||||
});
|
||||
} else {
|
||||
callbacks.forEach((cb) => {
|
||||
cb({
|
||||
code: "ENOENT",
|
||||
message: "No such file or directory " + path,
|
||||
name: "Not found",
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
items.forEach((callbacks) => {
|
||||
callbacks.forEach((cb) => {
|
||||
cb({
|
||||
code: "ECMDFAIL",
|
||||
message: "failed to stat",
|
||||
name: "failed to stat",
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform stat on multiple paths. Invalid files are ignored.
|
||||
*/
|
||||
private async stat(paths: string[]): Promise<Map<string, fs.Stats>> {
|
||||
const map = new Map<string, fs.Stats>();
|
||||
const pathsStr = paths.map(escapePath).join(" ");
|
||||
const resp = await promisify(exec)(
|
||||
`bash -c "stat ${pathsStr} -c \\\\'%n\\\\',%s,%F,%Y,%a,%g,%u,%X,%W,%d,%i,%b,%B,%Z,%h,%t"`,
|
||||
);
|
||||
resp.stdout.split("\n").forEach((stat) => {
|
||||
const matches = stat.trim().match(/(^'.*'|[^',\s]+)(?=\s*,|\s*$)/g);
|
||||
if (!matches || matches.length < 16) {
|
||||
return;
|
||||
}
|
||||
|
||||
const name = matches[0].substring(1, matches[0].length -1);
|
||||
const size = parseInt(matches[1], 10);
|
||||
const fileType = matches[2];
|
||||
const mtime = new Date(parseInt(matches[3], 10) * 1000);
|
||||
const mode = parseInt(matches[4], 10);
|
||||
const gid = parseInt(matches[5], 10);
|
||||
const uid = parseInt(matches[6], 10);
|
||||
const atime = new Date(parseInt(matches[7], 10) * 1000);
|
||||
const birthtime = new Date(parseInt(matches[8], 10) * 1000);
|
||||
const dev = parseInt(matches[9], 10);
|
||||
const ino = parseInt(matches[10], 10);
|
||||
const blocks = parseInt(matches[11], 10);
|
||||
const blksize = parseInt(matches[12], 10);
|
||||
const ctime = new Date(parseInt(matches[13], 10) * 1000);
|
||||
const nlink = parseInt(matches[14], 10);
|
||||
const rdev = parseInt(matches[15], 10);
|
||||
|
||||
map.set(name, {
|
||||
atime: atime,
|
||||
atimeMs: atime.getTime(),
|
||||
birthtime,
|
||||
birthtimeMs: birthtime.getTime(),
|
||||
blksize,
|
||||
blocks,
|
||||
ctime,
|
||||
ctimeMs: ctime.getTime(),
|
||||
dev,
|
||||
gid,
|
||||
ino,
|
||||
isBlockDevice: (): boolean => fileType === "block special file",
|
||||
isCharacterDevice: (): boolean => fileType === "character special file",
|
||||
isDirectory: (): boolean => fileType === "directory",
|
||||
isFIFO: (): boolean => fileType === "fifo",
|
||||
isFile: (): boolean => fileType === "regular file",
|
||||
isSocket: (): boolean => fileType === "socket",
|
||||
isSymbolicLink: (): boolean => fileType === "symbolic link",
|
||||
mode,
|
||||
mtime,
|
||||
mtimeMs: mtime.getTime(),
|
||||
nlink,
|
||||
rdev,
|
||||
size,
|
||||
uid,
|
||||
});
|
||||
});
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
type ReadFileCallback = (err: NodeJS.ErrnoException, content: string) => void;
|
||||
|
||||
/**
|
||||
* Queue for readFile.
|
||||
*/
|
||||
class ReadFileQueue extends Queue<ReadFileCallback> {
|
||||
|
||||
public constructor() {
|
||||
super(100);
|
||||
}
|
||||
|
||||
public async run(items: Map<string, ReadFileCallback[]>): Promise<void> {
|
||||
try {
|
||||
throwUnimplementedError();
|
||||
} catch (error) {
|
||||
items.forEach((cbs) => cbs.forEach((cb) => cb(error, "")));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class Watcher extends EventEmitter implements fs.FSWatcher {
|
||||
|
||||
public constructor(private readonly process: ChildProcess) {
|
||||
super();
|
||||
}
|
||||
|
||||
public close(): void {
|
||||
this.process.kill();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class WriteStream extends Writable implements fs.WriteStream {
|
||||
|
||||
public path: string;
|
||||
|
||||
private process: ChildProcess;
|
||||
|
||||
public constructor(path: fs.PathLike) {
|
||||
super();
|
||||
|
||||
this.path = path.toString();
|
||||
this.process = exec(`cat > ${escapePath(this.path)}`);
|
||||
setTimeout(() => {
|
||||
// Set timeout so listeners have time to register.
|
||||
this.emit("open");
|
||||
}, 0);
|
||||
this.process.on("exit", () => {
|
||||
this.emit("close");
|
||||
});
|
||||
}
|
||||
|
||||
public get bytesWritten(): number {
|
||||
throw throwUnimplementedError();
|
||||
}
|
||||
|
||||
// tslint:disable-next-line no-any
|
||||
public _write(chunk: any, _encoding: string, callback: () => void): void {
|
||||
this.process.stdin.write(chunk);
|
||||
callback();
|
||||
}
|
||||
|
||||
public close(): void {
|
||||
this.process.kill();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Used to identify files by descriptor.
|
||||
let lastFileDescriptor = 0;
|
||||
const readdirQueue = new ReaddirQueue();
|
||||
const readFileQueue = new ReadFileQueue();
|
||||
const statQueue = new StatQueue();
|
||||
const openFiles = new Map<number, IOpenFile>();
|
||||
|
||||
// tslint:disable only-arrow-functions
|
||||
// A common pattern is to exec and call the callback with an error or null.
|
||||
function execAndCallback(command: string, callback: (err: NodeJS.ErrnoException) => void): void {
|
||||
promisify(exec)(command).then(() => {
|
||||
callback(null as any); // tslint:disable-line no-any
|
||||
}).catch((error) => {
|
||||
callback(error);
|
||||
});
|
||||
}
|
||||
|
||||
function appendFile(
|
||||
path: fs.PathLike | number,
|
||||
data: any, // tslint:disable-line no-any
|
||||
options?: { encoding?: string | null; mode?: string | number; flag?: string; } | string | undefined | null | ((err: NodeJS.ErrnoException) => void),
|
||||
callback?: (err: NodeJS.ErrnoException) => void,
|
||||
): void {
|
||||
if (typeof options === "function") {
|
||||
callback = options;
|
||||
}
|
||||
|
||||
if (typeof path === "number") {
|
||||
if (!openFiles.has(path)) {
|
||||
// @ts-ignore not sure how to make this work.
|
||||
return callback(new Error("not open"), undefined as any); // tslint:disable-line no-any
|
||||
}
|
||||
path = openFiles.get(path)!.path;
|
||||
}
|
||||
|
||||
const process = exec(`${data ? "cat >>" : "touch"} ${escapePath(path.toString())}`, (error) => {
|
||||
callback!(error as any); // tslint:disable-line no-any
|
||||
});
|
||||
if (data) {
|
||||
process.stdin.write(data);
|
||||
}
|
||||
}
|
||||
|
||||
function close(fd: number, callback: (err: NodeJS.ErrnoException) => void): void {
|
||||
if (!openFiles.has(fd)) {
|
||||
return callback(new Error("file wasnt open"));
|
||||
}
|
||||
|
||||
openFiles.delete(fd);
|
||||
callback(null as any); // tslint:disable-line no-any
|
||||
}
|
||||
|
||||
function createWriteStream(path: fs.PathLike, _options?: string | {
|
||||
flags?: string;
|
||||
encoding?: string;
|
||||
fd?: number;
|
||||
mode?: number;
|
||||
}): fs.WriteStream {
|
||||
return new WriteStream(path);
|
||||
}
|
||||
|
||||
function exists(path: fs.PathLike, callback: (exists: boolean) => void): void {
|
||||
const pathStr = escapePath(path.toString());
|
||||
const command = bashCommand(
|
||||
`if [ -d ${pathStr} ]; then echo true;`
|
||||
+ ` elif [ -f ${pathStr} ]; then echo true;`
|
||||
+ ` elif [ -s ${pathStr} ]; then echo true;`
|
||||
+ "fi",
|
||||
);
|
||||
promisify(exec)(command).then((stdio) => {
|
||||
callback(stdio.stdout.trim() === "true");
|
||||
}).catch(() => {
|
||||
callback(false);
|
||||
});
|
||||
}
|
||||
|
||||
function fstat(fd: number, callback: (err: NodeJS.ErrnoException, stats: fs.Stats) => void): void {
|
||||
if (!openFiles.has(fd)) {
|
||||
return callback(new Error("not open"), null as any); // tslint:disable-line no-any
|
||||
}
|
||||
stat(openFiles.get(fd)!.path, callback);
|
||||
}
|
||||
|
||||
function futimes(
|
||||
fd: number,
|
||||
atime: string | number | Date,
|
||||
mtime: string | number | Date,
|
||||
callback: (err: NodeJS.ErrnoException) => void,
|
||||
): void {
|
||||
if (!openFiles.has(fd)) {
|
||||
return callback(new Error("not opened"));
|
||||
}
|
||||
|
||||
const openFile = openFiles.get(fd)!;
|
||||
const command = [
|
||||
{ flag: "a", time: atime },
|
||||
{ flag: "m", time: mtime },
|
||||
]
|
||||
.filter((item) => !!item.time)
|
||||
.map((item) => `touch -${item.flag} --date="${item.time}" ${escapePath(openFile.path.toString())}`)
|
||||
.join(";");
|
||||
|
||||
if (command.length === 0) {
|
||||
return callback(new Error("atime or mtime required"));
|
||||
}
|
||||
|
||||
execAndCallback(command, callback);
|
||||
}
|
||||
|
||||
function lstat(path: fs.PathLike, callback: (err: NodeJS.ErrnoException, stats: fs.Stats) => void): void {
|
||||
stat(path, callback);
|
||||
}
|
||||
|
||||
function mkdir(
|
||||
path: fs.PathLike, mode: number | string | fs.MakeDirectoryOptions | undefined | null | ((err: NodeJS.ErrnoException) => void),
|
||||
callback?: (err: NodeJS.ErrnoException) => void,
|
||||
): void {
|
||||
execAndCallback(
|
||||
`mkdir -p ${escapePath(path.toString())}`,
|
||||
typeof mode === "function" ? mode : callback!,
|
||||
);
|
||||
}
|
||||
|
||||
function open(
|
||||
path: fs.PathLike,
|
||||
flags: string | number, mode: number | string | undefined | null | ((err: NodeJS.ErrnoException, fd: number) => void),
|
||||
callback?: (err: NodeJS.ErrnoException, fd: number) => void,
|
||||
): void {
|
||||
if (typeof mode === "function") {
|
||||
callback = mode;
|
||||
}
|
||||
|
||||
// Don't touch if read-only.
|
||||
const promise = flags !== "r"
|
||||
? promisify(exec)(`touch ${escapePath(path.toString())}`)
|
||||
.then(() => Promise.resolve())
|
||||
.catch((error) => {
|
||||
if (error.message.indexOf("No such file or directory") !== -1) {
|
||||
return Promise.reject({
|
||||
code: "ENOENT",
|
||||
message: "No such file or directory " + path,
|
||||
name: "Not found",
|
||||
});
|
||||
}
|
||||
|
||||
return Promise.reject(error);
|
||||
})
|
||||
: Promise.resolve();
|
||||
|
||||
promise.then(() => {
|
||||
const id = lastFileDescriptor++;
|
||||
openFiles.set(id, {
|
||||
path,
|
||||
position: undefined,
|
||||
});
|
||||
callback!(null as any, id); // tslint:disable-line no-any
|
||||
}).catch((error) => {
|
||||
callback!(error, undefined as any); // tslint:disable-line no-any
|
||||
});
|
||||
}
|
||||
|
||||
function read<TBuffer extends fs.BinaryData>(
|
||||
fd: number,
|
||||
buffer: TBuffer,
|
||||
offset: number,
|
||||
length: number,
|
||||
position: number | null,
|
||||
callback?: (err: NodeJS.ErrnoException, bytesRead: number, buffer: TBuffer) => void,
|
||||
): void {
|
||||
if (!openFiles.has(fd)) {
|
||||
if (callback) {
|
||||
// tslint:disable-next-line no-any
|
||||
callback(new Error("not opened"), undefined as any, undefined as any);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const hasPosition = typeof position === "number";
|
||||
const openFile = openFiles.get(fd)!;
|
||||
|
||||
if (!hasPosition) {
|
||||
position = openFile.position || 0;
|
||||
}
|
||||
|
||||
readFile(openFile.path, (error, data) => {
|
||||
if (error) {
|
||||
if (callback) {
|
||||
// tslint:disable-next-line no-any
|
||||
callback(error, undefined as any, undefined as any);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const output = data.slice(position!, position! + length);
|
||||
if (output.length !== 0) {
|
||||
// TODO: seems to be no more set with v10, but need to decide if we'll be running v10.
|
||||
buffer.set(output, offset);
|
||||
}
|
||||
|
||||
if (!hasPosition) {
|
||||
if (typeof openFile.position !== "undefined") {
|
||||
openFile.position += output.length;
|
||||
} else {
|
||||
openFile.position = output.length;
|
||||
}
|
||||
openFiles.set(fd, openFile);
|
||||
}
|
||||
|
||||
if (callback) {
|
||||
callback(null as any, output.length, buffer); // tslint:disable-line no-any
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function readFile(
|
||||
path: fs.PathLike | number,
|
||||
options: { encoding?: string | null; flag?: string; } | string | undefined | null | ((err: NodeJS.ErrnoException, data: Buffer) => void),
|
||||
callback?: ((err: NodeJS.ErrnoException, data: Buffer | string) => void) | ((err: NodeJS.ErrnoException, data: Buffer) => void) | ((err: NodeJS.ErrnoException, data: string) => void),
|
||||
): void {
|
||||
if (typeof options === "function") {
|
||||
callback = options;
|
||||
}
|
||||
|
||||
if (typeof path === "number") {
|
||||
if (!openFiles.has(path)) {
|
||||
// @ts-ignore not sure how to make this work.
|
||||
return callback(new Error("not open"), undefined as any); // tslint:disable-line no-any
|
||||
}
|
||||
path = openFiles.get(path)!.path;
|
||||
}
|
||||
|
||||
readFileQueue.add(path.toString(), (error, result) => {
|
||||
// @ts-ignore not sure how to make this work.
|
||||
callback(
|
||||
error,
|
||||
result && useBuffer(options) ? Buffer.from(result) : result,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
function readdir(
|
||||
path: fs.PathLike,
|
||||
options: { encoding?: string | null, withFileTypes?: boolean } | string | undefined | null | ((err: NodeJS.ErrnoException, files: string[]) => void),
|
||||
callback?: ((err: NodeJS.ErrnoException, files: string[]) => void) | ((err: NodeJS.ErrnoException, files: Buffer[]) => void) | ((err: NodeJS.ErrnoException, files: fs.Dirent[]) => void)
|
||||
): void {
|
||||
if (typeof options === "function") {
|
||||
callback = options;
|
||||
}
|
||||
readdirQueue.add(path.toString(), (error, files) => {
|
||||
if (typeof options === "function") {
|
||||
callback = options;
|
||||
}
|
||||
// @ts-ignore not sure how to make this work.
|
||||
callback(
|
||||
error,
|
||||
files && useBuffer(options)
|
||||
? files.map((f) => Buffer.from(f))
|
||||
: files,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
function realpath(
|
||||
path: fs.PathLike,
|
||||
options: { encoding?: string | null } | string | undefined | null | ((err: NodeJS.ErrnoException, resolvedPath: string) => void),
|
||||
callback?: ((err: NodeJS.ErrnoException, resolvedPath: string) => void) | ((err: NodeJS.ErrnoException, resolvedPath: Buffer) => void) | ((err: NodeJS.ErrnoException, resolvedPath: string | Buffer) => void),
|
||||
): void {
|
||||
if (typeof options === "function") {
|
||||
callback = options;
|
||||
}
|
||||
// @ts-ignore not sure how to make this work.
|
||||
callback(
|
||||
null,
|
||||
useBuffer(options) ? Buffer.from(path.toString()) : path.toString(),
|
||||
);
|
||||
}
|
||||
|
||||
function rename(oldPath: fs.PathLike, newPath: fs.PathLike, callback: (err: NodeJS.ErrnoException) => void): void {
|
||||
promisify(exec)(`mv ${escapePath(oldPath.toString())} ${escapePath(newPath.toString())}`).then(() => {
|
||||
callback(null as any); // tslint:disable-line no-any
|
||||
}).catch((error) => {
|
||||
callback(error.message.indexOf("No such file or directory") !== -1 ? {
|
||||
code: "ENOENT",
|
||||
message: "No such file or directory " + oldPath,
|
||||
name: "Not found",
|
||||
} : error);
|
||||
});
|
||||
}
|
||||
|
||||
function rmdir(path: fs.PathLike, callback: (err: NodeJS.ErrnoException) => void): void {
|
||||
execAndCallback(`rmdir ${escapePath(path.toString())}`, callback);
|
||||
}
|
||||
|
||||
function stat(path: fs.PathLike, callback: (err: NodeJS.ErrnoException, stats: fs.Stats) => void): void {
|
||||
statQueue.add(path.toString(), (error, stats) => {
|
||||
callback(error as any, stats as any); // tslint:disable-line no-any
|
||||
});
|
||||
}
|
||||
|
||||
function unlink(path: fs.PathLike, callback: (err: NodeJS.ErrnoException) => void): void {
|
||||
execAndCallback(`unlink ${escapePath(path.toString())}`, callback);
|
||||
}
|
||||
|
||||
function watch(
|
||||
filename: fs.PathLike,
|
||||
options: { encoding?: string | null, persistent?: boolean, recursive?: boolean } | string | undefined | null | ((event: string, filename: string) => void),
|
||||
listener?: ((event: string, filename: string) => void) | ((event: string, filename: Buffer) => void),
|
||||
): fs.FSWatcher {
|
||||
const buffer = new NewlineInputBuffer((msg): void => {
|
||||
msg = msg.trim();
|
||||
const index = msg.lastIndexOf(":");
|
||||
const events = msg.substring(index + 1).split(",");
|
||||
const baseFilename = msg.substring(0, index).split("/").pop();
|
||||
events.forEach((event) => {
|
||||
switch (event) {
|
||||
// Rename is emitted when a file appears or disappears in the directory.
|
||||
case "CREATE":
|
||||
case "DELETE":
|
||||
case "MOVED_FROM":
|
||||
case "MOVED_TO":
|
||||
watcher.emit("rename", baseFilename);
|
||||
break;
|
||||
case "CLOSE_WRITE":
|
||||
watcher.emit("change", baseFilename);
|
||||
break;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
const process = exec(`inotifywait ${escapePath(filename.toString())} -m --format "%w%f:%e"`);
|
||||
process.on("exit", (exitCode) => {
|
||||
watcher.emit("error", new Error(`process terminated unexpectedly with code ${exitCode}`));
|
||||
});
|
||||
process.stdout.on("data", (data) => {
|
||||
buffer.push(data);
|
||||
});
|
||||
|
||||
const watcher = new Watcher(process);
|
||||
watcher.on("change", (filename) => {
|
||||
// @ts-ignore not sure how to make this work.
|
||||
listener("change", useBuffer(options) ? Buffer.from(filename) : filename);
|
||||
});
|
||||
watcher.on("rename", (filename) => {
|
||||
// @ts-ignore not sure how to make this work.
|
||||
listener("rename", useBuffer(options) ? Buffer.from(filename) : filename);
|
||||
});
|
||||
|
||||
return watcher;
|
||||
}
|
||||
|
||||
function writeFile(
|
||||
path: fs.PathLike | number,
|
||||
data: any, // tslint:disable-line no-any
|
||||
options: { encoding?: string | null; mode?: number | string; flag?: string; } | string | undefined | null | ((err: NodeJS.ErrnoException) => void),
|
||||
callback?: (err: NodeJS.ErrnoException) => void,
|
||||
): void {
|
||||
if (typeof options === "function") {
|
||||
callback = options;
|
||||
}
|
||||
|
||||
if (typeof path === "number") {
|
||||
if (!openFiles.has(path)) {
|
||||
// @ts-ignore not sure how to make this work.
|
||||
return callback(new Error("not open"), undefined as any); // tslint:disable-line no-any
|
||||
}
|
||||
path = openFiles.get(path)!.path;
|
||||
}
|
||||
|
||||
const process = exec(`${data ? "cat >" : "touch"} ${escapePath(path.toString())}`, (error) => {
|
||||
callback!(error as any); // tslint:disable-line no-any
|
||||
});
|
||||
if (data) {
|
||||
process.stdin.write(data);
|
||||
}
|
||||
}
|
||||
// tslint:enable only-arrow-functions
|
||||
|
||||
// Just to satisfy the types.
|
||||
// tslint:disable no-any
|
||||
appendFile.__promisify__ = undefined as any;
|
||||
close.__promisify__ = undefined as any;
|
||||
exists.__promisify__ = undefined as any;
|
||||
fstat.__promisify__ = undefined as any;
|
||||
futimes.__promisify__ = undefined as any;
|
||||
lstat.__promisify__ = undefined as any;
|
||||
mkdir.__promisify__ = undefined as any;
|
||||
open.__promisify__ = undefined as any;
|
||||
read.__promisify__ = undefined as any;
|
||||
readFile.__promisify__ = undefined as any;
|
||||
readdir.__promisify__ = undefined as any;
|
||||
realpath.__promisify__ = undefined as any;
|
||||
rename.__promisify__ = undefined as any;
|
||||
rmdir.__promisify__ = undefined as any;
|
||||
stat.__promisify__ = undefined as any;
|
||||
unlink.__promisify__ = undefined as any;
|
||||
writeFile.__promisify__ = undefined as any;
|
||||
realpath.native = undefined as any;
|
||||
// tslint:enable no-any
|
||||
|
||||
const exp: typeof fs = {
|
||||
constants: fs.constants,
|
||||
Stats: fs.Stats,
|
||||
ReadStream: fs.ReadStream,
|
||||
WriteStream: fs.WriteStream,
|
||||
Dirent: fs.Dirent,
|
||||
promises: fs.promises,
|
||||
|
||||
access: throwUnimplementedError,
|
||||
accessSync: throwSyncError,
|
||||
appendFile,
|
||||
appendFileSync: throwSyncError,
|
||||
chmod: throwUnimplementedError,
|
||||
chmodSync: throwSyncError,
|
||||
chown: throwUnimplementedError,
|
||||
chownSync: throwSyncError,
|
||||
close,
|
||||
copyFile: throwUnimplementedError,
|
||||
copyFileSync: throwSyncError,
|
||||
closeSync: throwSyncError,
|
||||
createReadStream: throwUnimplementedError,
|
||||
createWriteStream,
|
||||
exists,
|
||||
existsSync: throwSyncError,
|
||||
fchmod: throwUnimplementedError,
|
||||
fchmodSync: throwSyncError,
|
||||
fchown: throwUnimplementedError,
|
||||
fchownSync: throwSyncError,
|
||||
fdatasync: throwUnimplementedError,
|
||||
fdatasyncSync: throwSyncError,
|
||||
fstat,
|
||||
fstatSync: throwSyncError,
|
||||
fsync: throwUnimplementedError,
|
||||
fsyncSync: throwSyncError,
|
||||
ftruncate: throwUnimplementedError,
|
||||
ftruncateSync: throwSyncError,
|
||||
futimes,
|
||||
futimesSync: throwSyncError,
|
||||
lchmod: throwUnimplementedError,
|
||||
lchmodSync: throwSyncError,
|
||||
lchown: throwUnimplementedError,
|
||||
lchownSync: throwSyncError,
|
||||
link: throwUnimplementedError,
|
||||
linkSync: throwSyncError,
|
||||
lstat,
|
||||
lstatSync: throwSyncError,
|
||||
mkdir,
|
||||
mkdirSync: throwSyncError,
|
||||
mkdtemp: throwUnimplementedError,
|
||||
mkdtempSync: throwSyncError,
|
||||
open,
|
||||
openSync: throwSyncError,
|
||||
read,
|
||||
readFile,
|
||||
readFileSync: throwSyncError,
|
||||
readSync: throwSyncError,
|
||||
readdir,
|
||||
readdirSync: throwSyncError,
|
||||
readlink: throwUnimplementedError,
|
||||
readlinkSync: throwSyncError,
|
||||
realpath,
|
||||
realpathSync: throwSyncError,
|
||||
rename,
|
||||
renameSync: throwSyncError,
|
||||
rmdir,
|
||||
rmdirSync: throwSyncError,
|
||||
stat,
|
||||
statSync: throwSyncError,
|
||||
symlink: throwUnimplementedError,
|
||||
symlinkSync: throwSyncError,
|
||||
truncate: throwUnimplementedError,
|
||||
truncateSync: throwSyncError,
|
||||
unlink,
|
||||
unlinkSync: throwSyncError,
|
||||
unwatchFile: throwUnimplementedError,
|
||||
utimes: throwUnimplementedError,
|
||||
utimesSync: throwSyncError,
|
||||
watch,
|
||||
watchFile: throwUnimplementedError,
|
||||
write: throwUnimplementedError,
|
||||
writeFile,
|
||||
writeFileSync: throwSyncError,
|
||||
writeSync: throwSyncError,
|
||||
};
|
||||
|
||||
export = exp;
|
@ -1,2 +0,0 @@
|
||||
import { bashCommand, escapePath, isBrowserEnvironment } from "./util";
|
||||
export { bashCommand, escapePath, isBrowserEnvironment };
|
@ -1,70 +0,0 @@
|
||||
import * as net from "net";
|
||||
|
||||
/**
|
||||
* Implementation of Socket for the browser.
|
||||
*/
|
||||
class Socket extends net.Socket {
|
||||
|
||||
public connect(): this {
|
||||
throw new Error("not implemented");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of Server for the browser.
|
||||
*/
|
||||
class Server extends net.Server {
|
||||
|
||||
public listen(
|
||||
_port?: number | any | net.ListenOptions, // tslint:disable-line no-any so we can match the Node API.
|
||||
_hostname?: string | number | Function,
|
||||
_backlog?: number | Function,
|
||||
_listeningListener?: Function,
|
||||
): this {
|
||||
throw new Error("not implemented");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// tslint:disable only-arrow-functions
|
||||
function connect(): net.Socket {
|
||||
throw new Error("not implemented");
|
||||
}
|
||||
|
||||
function createConnection(): net.Socket {
|
||||
throw new Error("not implemented");
|
||||
}
|
||||
|
||||
function isIP(_input: string): number {
|
||||
throw new Error("not implemented");
|
||||
}
|
||||
|
||||
function isIPv4(_input: string): boolean {
|
||||
throw new Error("not implemented");
|
||||
}
|
||||
|
||||
function isIPv6(_input: string): boolean {
|
||||
throw new Error("not implemented");
|
||||
}
|
||||
|
||||
function createServer(
|
||||
_options?: { allowHalfOpen?: boolean, pauseOnConnect?: boolean } | ((socket: net.Socket) => void),
|
||||
_connectionListener?: (socket: net.Socket) => void,
|
||||
): Server {
|
||||
return new Server();
|
||||
}
|
||||
// tslint:enable only-arrow-functions
|
||||
|
||||
const exp: typeof net = {
|
||||
Socket,
|
||||
Server,
|
||||
connect,
|
||||
createConnection,
|
||||
isIP,
|
||||
isIPv4,
|
||||
isIPv6,
|
||||
createServer,
|
||||
};
|
||||
|
||||
export = exp;
|
@ -1,138 +0,0 @@
|
||||
// The type doesn't matter for these since we're just throwing.
|
||||
// tslint:disable no-any
|
||||
export const throwUnimplementedError = (): any => {
|
||||
throw new Error("not implemented");
|
||||
};
|
||||
// In case the types except the promisify property.
|
||||
throwUnimplementedError.__promisify__ = undefined as any;
|
||||
// This one seems to be a mistake in the types for `link`.
|
||||
throwUnimplementedError.link = undefined as any;
|
||||
export const throwSyncError = (): any => {
|
||||
throw new Error("sync is not supported");
|
||||
};
|
||||
// realpath & realpathSync.
|
||||
throwSyncError.native = undefined as any;
|
||||
// tslint:enable no-any
|
||||
|
||||
/**
|
||||
* Return true if the options specify to use a Buffer instead of string.
|
||||
*/
|
||||
export const useBuffer = (options: { encoding?: string | null } | string | undefined | null | Function): boolean => {
|
||||
return options === "buffer"
|
||||
|| (!!options && typeof options !== "string" && typeof options !== "function"
|
||||
&& (options.encoding === "buffer" || options.encoding === null));
|
||||
};
|
||||
|
||||
/**
|
||||
* Run a command with bash.
|
||||
*/
|
||||
export const bashCommand = (command: string): string => {
|
||||
return `bash -c "${command.replace(/"/g, "\\\"")}"`;
|
||||
};
|
||||
|
||||
/**
|
||||
* Return true if we're in a browser environment (including web workers).
|
||||
*/
|
||||
export const isBrowserEnvironment = (): boolean => {
|
||||
return typeof process === "undefined" || typeof process.stdout === "undefined";
|
||||
};
|
||||
|
||||
/**
|
||||
* Escape a path. This prevents any issues with file names that have quotes,
|
||||
* spaces, braces, etc.
|
||||
*/
|
||||
export const escapePath = (path: string): string => {
|
||||
return `'${path.replace(/'/g, "'\\''")}'`;
|
||||
};
|
||||
|
||||
/**
|
||||
* This queues up items then runs on all the items at once after a timeout. Each
|
||||
* item has a callback that expects the response for that item which is the
|
||||
* extending class's responsibility to call.
|
||||
*
|
||||
* You can also specify a maximum number of items to keep in the queue.
|
||||
*/
|
||||
export abstract class Queue<T> {
|
||||
|
||||
private items: Map<string, T[]>;
|
||||
private timeout: number | NodeJS.Timer | undefined;
|
||||
private max: number | undefined;
|
||||
private timeoutDelay = 1;
|
||||
|
||||
public constructor(max?: number) {
|
||||
this.items = new Map();
|
||||
this.max = max;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an item to the queue.
|
||||
*/
|
||||
public add(key: string, callback: T): void {
|
||||
if (this.items.has(key)) {
|
||||
this.items.get(key)!.push(callback);
|
||||
} else {
|
||||
this.items.set(key, [callback]);
|
||||
}
|
||||
|
||||
const run = (): void => {
|
||||
// tslint:disable-next-line no-any because NodeJS.Timer is valid.
|
||||
clearTimeout(this.timeout as any);
|
||||
this.timeout = undefined;
|
||||
const newMap = new Map(this.items);
|
||||
this.items.clear();
|
||||
this.run(newMap);
|
||||
};
|
||||
|
||||
if (typeof this.max !== "undefined" && this.items.size >= this.max) {
|
||||
return run();
|
||||
}
|
||||
|
||||
if (typeof this.timeout === "undefined") {
|
||||
this.timeout = setTimeout(() => {
|
||||
run();
|
||||
}, this.timeoutDelay);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Run on the specified items then call their callbacks.
|
||||
*/
|
||||
protected abstract run(items: Map<string, T[]>): void;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Class for safely taking input and turning it into separate messages.
|
||||
* Assumes that messages are split by newlines.
|
||||
*/
|
||||
export class NewlineInputBuffer {
|
||||
|
||||
private callback: (msg: string) => void;
|
||||
private buffer: string | undefined;
|
||||
|
||||
public constructor(callback: (msg: string) => void) {
|
||||
this.callback = callback;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add data to be buffered.
|
||||
*/
|
||||
public push(data: string | Uint8Array): void {
|
||||
let input = typeof data === "string" ? data : data.toString();
|
||||
if (this.buffer) {
|
||||
input = this.buffer + input;
|
||||
this.buffer = undefined;
|
||||
}
|
||||
const lines = input.split("\n");
|
||||
const length = lines.length - 1;
|
||||
const lastLine = lines[length];
|
||||
if (lastLine.length > 0) {
|
||||
this.buffer = lastLine;
|
||||
}
|
||||
lines.pop(); // This is either the line we buffered or an empty string.
|
||||
for (let i = 0; i < length; ++i) {
|
||||
this.callback(lines[i]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
@ -1,16 +1,11 @@
|
||||
{
|
||||
"scripts": {
|
||||
"build:rules": "cd ./rules && yarn build",
|
||||
"postinstall": "ts-node ./scripts/src/install-packages.ts && yarn build:rules",
|
||||
"test": "jest"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^23.3.12",
|
||||
"jest": "^23.6.0",
|
||||
"ts-jest": "^23.10.5",
|
||||
"ts-node": "^7.0.1",
|
||||
"tslint": "^5.12.1",
|
||||
"typescript-tslint-plugin": "^0.2.1"
|
||||
"ts-jest": "^23.10.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"xmlhttprequest": "1.8.0"
|
||||
@ -23,10 +18,10 @@
|
||||
"json"
|
||||
],
|
||||
"setupFiles": [
|
||||
"<rootDir>/scripts/src/test-setup.js"
|
||||
"<rootDir>/../scripts/test-setup.js"
|
||||
],
|
||||
"moduleNameMapper": {
|
||||
"^.+\\.(s?css|png|svg)$": "<rootDir>/scripts/src/dummy.js",
|
||||
"^.+\\.(s?css|png|svg)$": "<rootDir>/../scripts/dummy.js",
|
||||
"@coder/(.*)/testing": "<rootDir>/$1/testing",
|
||||
"@coder/(.*)": "<rootDir>/$1/src"
|
||||
},
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"name": "server",
|
||||
"name": "@coder/server",
|
||||
"main": "src/index.ts",
|
||||
"dependencies": {
|
||||
"express": "^4.16.4",
|
||||
"node-pty": "^0.8.0",
|
@ -30,13 +30,13 @@ export class Client {
|
||||
});
|
||||
}
|
||||
|
||||
public evaluate<R>(func: () => R): Promise<R>;
|
||||
public evaluate<R, T1>(func: (a1: T1) => R, a1: T1): Promise<R>;
|
||||
public evaluate<R, T1, T2>(func: (a1: T1, a2: T2) => R, a1: T1, a2: T2): Promise<R>;
|
||||
public evaluate<R, T1, T2, T3>(func: (a1: T1, a2: T2, a3: T3) => R, a1: T1, a2: T2, a3: T3): Promise<R>;
|
||||
public evaluate<R, T1, T2, T3, T4>(func: (a1: T1, a2: T2, a3: T3, a4: T4) => R, a1: T1, a2: T2, a3: T3, a4: T4): Promise<R>;
|
||||
public evaluate<R, T1, T2, T3, T4, T5>(func: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5) => R, a1: T1, a2: T2, a3: T3, a4: T4, a5: T5): Promise<R>;
|
||||
public evaluate<R, T1, T2, T3, T4, T5, T6>(func: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6) => R, a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6): Promise<R>;
|
||||
public evaluate<R>(func: () => R | Promise<R>): Promise<R>;
|
||||
public evaluate<R, T1>(func: (a1: T1) => R | Promise<R>, a1: T1): Promise<R>;
|
||||
public evaluate<R, T1, T2>(func: (a1: T1, a2: T2) => R | Promise<R>, a1: T1, a2: T2): Promise<R>;
|
||||
public evaluate<R, T1, T2, T3>(func: (a1: T1, a2: T2, a3: T3) => R | Promise<R>, a1: T1, a2: T2, a3: T3): Promise<R>;
|
||||
public evaluate<R, T1, T2, T3, T4>(func: (a1: T1, a2: T2, a3: T3, a4: T4) => R | Promise<R>, a1: T1, a2: T2, a3: T3, a4: T4): Promise<R>;
|
||||
public evaluate<R, T1, T2, T3, T4, T5>(func: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5) => R | Promise<R>, a1: T1, a2: T2, a3: T3, a4: T4, a5: T5): Promise<R>;
|
||||
public evaluate<R, T1, T2, T3, T4, T5, T6>(func: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6) => R | Promise<R>, a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6): Promise<R>;
|
||||
/**
|
||||
* Evaluates a function on the server.
|
||||
* To pass variables, ensure they are serializable and passed through the included function.
|
||||
@ -49,7 +49,7 @@ export class Client {
|
||||
* @param func Function to evaluate
|
||||
* @returns {Promise} Promise rejected or resolved from the evaluated function
|
||||
*/
|
||||
public evaluate<R, T1, T2, T3, T4, T5, T6>(func: (a1?: T1, a2?: T2, a3?: T3, a4?: T4, a5?: T5, a6?: T6) => R, a1?: T1, a2?: T2, a3?: T3, a4?: T4, a5?: T5, a6?: T6): Promise<R> {
|
||||
public evaluate<R, T1, T2, T3, T4, T5, T6>(func: (a1?: T1, a2?: T2, a3?: T3, a4?: T4, a5?: T5, a6?: T6) => R | Promise<R>, a1?: T1, a2?: T2, a3?: T3, a4?: T4, a5?: T5, a6?: T6): Promise<R> {
|
||||
const newEval = new NewEvalMessage();
|
||||
const id = this.evalId++;
|
||||
newEval.setId(id);
|
52
packages/protocol/src/browser/modules/child_process.ts
Normal file
52
packages/protocol/src/browser/modules/child_process.ts
Normal file
@ -0,0 +1,52 @@
|
||||
import * as cp from "child_process";
|
||||
import { Client } from "../client";
|
||||
import { useBuffer } from "./util";
|
||||
|
||||
export class CP {
|
||||
|
||||
public constructor(
|
||||
private readonly client: Client,
|
||||
) { }
|
||||
|
||||
public exec(
|
||||
command: string,
|
||||
options?: { encoding?: BufferEncoding | string | "buffer" | null } & cp.ExecOptions | null | ((error: Error | null, stdout: string, stderr: string) => void) | ((error: Error | null, stdout: Buffer, stderr: Buffer) => void),
|
||||
callback?: ((error: Error | null, stdout: string, stderr: string) => void) | ((error: Error | null, stdout: Buffer, stderr: Buffer) => void),
|
||||
): cp.ChildProcess {
|
||||
const process = this.client.spawn(command);
|
||||
|
||||
let stdout = "";
|
||||
process.stdout.on("data", (data) => {
|
||||
stdout += data.toString();
|
||||
});
|
||||
|
||||
let stderr = "";
|
||||
process.stderr.on("data", (data) => {
|
||||
stderr += data.toString();
|
||||
});
|
||||
|
||||
process.on("exit", (exitCode) => {
|
||||
const error = exitCode !== 0 ? new Error(stderr) : null;
|
||||
if (typeof options === "function") {
|
||||
callback = options;
|
||||
}
|
||||
// @ts-ignore not sure how to make this work.
|
||||
callback(
|
||||
error,
|
||||
useBuffer(options) ? Buffer.from(stdout) : stdout,
|
||||
useBuffer(options) ? Buffer.from(stderr) : stderr,
|
||||
);
|
||||
});
|
||||
|
||||
return process;
|
||||
}
|
||||
|
||||
public fork(modulePath: string): cp.ChildProcess {
|
||||
return this.client.fork(modulePath);
|
||||
}
|
||||
|
||||
public spawn(command: string, args?: ReadonlyArray<string> | cp.SpawnOptions, _options?: cp.SpawnOptions): cp.ChildProcess {
|
||||
return this.client.spawn(command, args, options);
|
||||
}
|
||||
|
||||
}
|
577
packages/protocol/src/browser/modules/fs.ts
Normal file
577
packages/protocol/src/browser/modules/fs.ts
Normal file
@ -0,0 +1,577 @@
|
||||
import * as fs from "fs";
|
||||
import { Client } from "../client";
|
||||
|
||||
/**
|
||||
* Implements the native fs module
|
||||
* Doesn't use `implements typeof import("fs")` to remove need for __promisify__ impls
|
||||
*/
|
||||
export class FS {
|
||||
|
||||
public constructor(
|
||||
private readonly client: Client,
|
||||
) { }
|
||||
|
||||
public access(path: fs.PathLike, mode: number | undefined, callback: (err: NodeJS.ErrnoException) => void): void {
|
||||
this.client.evaluate((path, mode) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
return util.promisify(fs.access)(path, mode);
|
||||
}, path, mode).then(() => {
|
||||
callback(undefined!);
|
||||
}).catch((ex) => {
|
||||
callback(ex);
|
||||
});
|
||||
}
|
||||
|
||||
public appendFile(file: fs.PathLike | number, data: any, options: { encoding?: string | null, mode?: string | number, flag?: string } | string | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void {
|
||||
this.client.evaluate((path, data, options) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
return util.promisify(fs.appendFile)(path, data, options);
|
||||
}, file, data, options).then(() => {
|
||||
callback(undefined!);
|
||||
}).catch((ex) => {
|
||||
callback(ex);
|
||||
});
|
||||
}
|
||||
|
||||
public chmod(path: fs.PathLike, mode: string | number, callback: (err: NodeJS.ErrnoException) => void): void {
|
||||
this.client.evaluate((path, mode) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
return util.promisify(fs.chmod)(path, mode);
|
||||
}, path, mode).then(() => {
|
||||
callback(undefined!);
|
||||
}).catch((ex) => {
|
||||
callback(ex);
|
||||
});
|
||||
}
|
||||
|
||||
public chown(path: fs.PathLike, uid: number, gid: number, callback: (err: NodeJS.ErrnoException) => void): void {
|
||||
this.client.evaluate((path, uid, gid) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
return util.promisify(fs.chown)(path, uid, gid);
|
||||
}, path, uid, gid).then(() => {
|
||||
callback(undefined!);
|
||||
}).catch((ex) => {
|
||||
callback(ex);
|
||||
});
|
||||
}
|
||||
|
||||
public close(fd: number, callback: (err: NodeJS.ErrnoException) => void): void {
|
||||
this.client.evaluate((fd) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
return util.promisify(fs.close)(fd);
|
||||
}, fd).then(() => {
|
||||
callback(undefined!);
|
||||
}).catch((ex) => {
|
||||
callback(ex);
|
||||
});
|
||||
}
|
||||
|
||||
public copyFile(src: fs.PathLike, dest: fs.PathLike, callback: (err: NodeJS.ErrnoException) => void): void {
|
||||
this.client.evaluate((src, dest) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
return util.promisify(fs.copyFile)(src, dest);
|
||||
}, src, dest).then(() => {
|
||||
callback(undefined!);
|
||||
}).catch((ex) => {
|
||||
callback(ex);
|
||||
});
|
||||
}
|
||||
|
||||
public createWriteStream(): void {
|
||||
throw new Error("not implemented");
|
||||
}
|
||||
|
||||
public exists(path: fs.PathLike, callback: (exists: boolean) => void): void {
|
||||
this.client.evaluate((path) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
return util.promisify(fs.exists)(path);
|
||||
}, path).then((r) => {
|
||||
callback(r);
|
||||
}).catch(() => {
|
||||
callback(false);
|
||||
});
|
||||
}
|
||||
|
||||
public fchmod(fd: number, mode: string | number, callback: (err: NodeJS.ErrnoException) => void): void {
|
||||
this.client.evaluate((fd, mode) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
return util.promisify(fs.fchmod)(fd, mode);
|
||||
}, fd, mode).then(() => {
|
||||
callback(undefined!);
|
||||
}).catch((ex) => {
|
||||
callback(ex);
|
||||
});
|
||||
}
|
||||
|
||||
public fchown(fd: number, uid: number, gid: number, callback: (err: NodeJS.ErrnoException) => void): void {
|
||||
this.client.evaluate((fd, uid, gid) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
return util.promisify(fs.fchown)(fd, uid, gid);
|
||||
}, fd, uid, gid).then(() => {
|
||||
callback(undefined!);
|
||||
}).catch((ex) => {
|
||||
callback(ex);
|
||||
});
|
||||
}
|
||||
|
||||
public fdatasync(fd: number, callback: (err: NodeJS.ErrnoException) => void): void {
|
||||
this.client.evaluate((fd) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
return util.promisify(fs.fdatasync)(fd);
|
||||
}, fd).then(() => {
|
||||
callback(undefined!);
|
||||
}).catch((ex) => {
|
||||
callback(ex);
|
||||
});
|
||||
}
|
||||
|
||||
public fstat(fd: number, callback: (err: NodeJS.ErrnoException, stats: fs.Stats) => void): void {
|
||||
this.client.evaluate(async (fd) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
const stats = await util.promisify(fs.fstat)(fd);
|
||||
return {
|
||||
...stats,
|
||||
_isBlockDevice: stats.isBlockDevice(),
|
||||
_isCharacterDevice: stats.isCharacterDevice(),
|
||||
_isDirectory: stats.isDirectory(),
|
||||
_isFIFO: stats.isFIFO(),
|
||||
_isFile: stats.isFile(),
|
||||
_isSocket: stats.isSocket(),
|
||||
_isSymbolicLink: stats.isSymbolicLink(),
|
||||
};
|
||||
}, fd).then((stats) => {
|
||||
callback(undefined!, Stats.fromObject(stats));
|
||||
}).catch((ex) => {
|
||||
callback(ex, undefined!);
|
||||
});
|
||||
}
|
||||
|
||||
public fsync(fd: number, callback: (err: NodeJS.ErrnoException) => void): void {
|
||||
this.client.evaluate((fd) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
return util.promisify(fs.fsync)(fd);
|
||||
}, fd).then(() => {
|
||||
callback(undefined!);
|
||||
}).catch((ex) => {
|
||||
callback(ex);
|
||||
});
|
||||
}
|
||||
|
||||
public ftruncate(fd: number, len: number | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void {
|
||||
this.client.evaluate((fd, len) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
return util.promisify(fs.ftruncate)(fd, len);
|
||||
}, fd, len).then(() => {
|
||||
callback(undefined!);
|
||||
}).catch((ex) => {
|
||||
callback(ex);
|
||||
});
|
||||
}
|
||||
|
||||
public futimes(fd: number, atime: string | number | Date, mtime: string | number | Date, callback: (err: NodeJS.ErrnoException) => void): void {
|
||||
this.client.evaluate((fd, atime, mtime) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
return util.promisify(fs.futimes)(fd, atime, mtime);
|
||||
}, fd, atime, mtime).then(() => {
|
||||
callback(undefined!);
|
||||
}).catch((ex) => {
|
||||
callback(ex);
|
||||
});
|
||||
}
|
||||
|
||||
public lchmod(path: fs.PathLike, mode: string | number, callback: (err: NodeJS.ErrnoException) => void): void {
|
||||
this.client.evaluate((path, mode) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
return util.promisify(fs.lchmod)(path, mode);
|
||||
}, path, mode).then(() => {
|
||||
callback(undefined!);
|
||||
}).catch((ex) => {
|
||||
callback(ex);
|
||||
});
|
||||
}
|
||||
|
||||
public lchown(path: fs.PathLike, uid: number, gid: number, callback: (err: NodeJS.ErrnoException) => void): void {
|
||||
this.client.evaluate((path, uid, gid) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
return util.promisify(fs.lchown)(path, uid, gid);
|
||||
}, path, uid, gid).then(() => {
|
||||
callback(undefined!);
|
||||
}).catch((ex) => {
|
||||
callback(ex);
|
||||
});
|
||||
}
|
||||
|
||||
public link(existingPath: fs.PathLike, newPath: fs.PathLike, callback: (err: NodeJS.ErrnoException) => void): void {
|
||||
this.client.evaluate((existingPath, newPath) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
return util.promisify(fs.link)(existingPath, newPath);
|
||||
}, existingPath, newPath).then(() => {
|
||||
callback(undefined!);
|
||||
}).catch((ex) => {
|
||||
callback(ex);
|
||||
});
|
||||
}
|
||||
|
||||
public lstat(path: fs.PathLike, callback: (err: NodeJS.ErrnoException, stats: fs.Stats) => void): void {
|
||||
this.client.evaluate(async (path) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
const stats = await util.promisify(fs.lstat)(path);
|
||||
return {
|
||||
...stats,
|
||||
_isBlockDevice: stats.isBlockDevice(),
|
||||
_isCharacterDevice: stats.isCharacterDevice(),
|
||||
_isDirectory: stats.isDirectory(),
|
||||
_isFIFO: stats.isFIFO(),
|
||||
_isFile: stats.isFile(),
|
||||
_isSocket: stats.isSocket(),
|
||||
_isSymbolicLink: stats.isSymbolicLink(),
|
||||
};
|
||||
}, path).then((stats) => {
|
||||
callback(undefined!, Stats.fromObject(stats));
|
||||
}).catch((ex) => {
|
||||
callback(ex, undefined!);
|
||||
});
|
||||
}
|
||||
|
||||
public mkdir(path: fs.PathLike, mode: number | string | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void {
|
||||
this.client.evaluate((path, mode) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
return util.promisify(fs.mkdir)(path, mode);
|
||||
}, path, mode).then(() => {
|
||||
callback(undefined!);
|
||||
}).catch((ex) => {
|
||||
callback(ex);
|
||||
});
|
||||
}
|
||||
|
||||
public mkdtemp(prefix: string, options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException, folder: string) => void): void {
|
||||
this.client.evaluate((prefix, options) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
return util.promisify(fs.mkdtemp)(prefix, options);
|
||||
}, prefix, options).then((folder) => {
|
||||
callback(undefined!, folder);
|
||||
}).catch((ex) => {
|
||||
callback(ex, undefined!);
|
||||
});
|
||||
}
|
||||
|
||||
public open(path: fs.PathLike, flags: string | number, mode: string | number | undefined | null, callback: (err: NodeJS.ErrnoException, fd: number) => void): void {
|
||||
this.client.evaluate((path, flags, mode) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
return util.promisify(fs.open)(path, flags, mode);
|
||||
}, path, flags, mode).then((fd) => {
|
||||
callback(undefined!, fd);
|
||||
}).catch((ex) => {
|
||||
callback(ex, undefined!);
|
||||
});
|
||||
}
|
||||
|
||||
public read<TBuffer extends Buffer | Uint8Array>(fd: number, buffer: TBuffer, offset: number, length: number, position: number | null, callback: (err: NodeJS.ErrnoException, bytesRead: number, buffer: TBuffer) => void): void {
|
||||
this.client.evaluate(async (fd, bufferLength, length, position) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
const buffer = new Buffer(length);
|
||||
const resp = await util.promisify(fs.read)(fd, buffer, 0, length, position);
|
||||
|
||||
return {
|
||||
bytesRead: resp.bytesRead,
|
||||
content: buffer.toString("utf8"),
|
||||
};
|
||||
}, fd, buffer.byteLength, length, position).then((resp) => {
|
||||
const newBuf = Buffer.from(resp.content, "utf8");
|
||||
buffer.set(newBuf, offset);
|
||||
callback(undefined!, resp.bytesRead, newBuf as TBuffer);
|
||||
}).catch((ex) => {
|
||||
callback(ex, undefined!, undefined!);
|
||||
});
|
||||
}
|
||||
|
||||
public readFile(path: fs.PathLike | number, options: string | { encoding?: string | null | undefined; flag?: string | undefined; } | null | undefined, callback: (err: NodeJS.ErrnoException, data: string | Buffer) => void): void {
|
||||
this.client.evaluate(async (path, options) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
const value = await util.promisify(fs.readFile)(path, options);
|
||||
|
||||
return value.toString();
|
||||
}, path, options).then((buffer) => {
|
||||
callback(undefined!, buffer);
|
||||
}).catch((ex) => {
|
||||
callback(ex, undefined!);
|
||||
});
|
||||
}
|
||||
|
||||
public readdir(path: fs.PathLike, options: { encoding: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException, files: string[]) => void): void {
|
||||
this.client.evaluate((path, options) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
return util.promisify(fs.readdir)(path, options);
|
||||
}, path, options).then((files) => {
|
||||
callback(undefined!, files);
|
||||
}).catch((ex) => {
|
||||
callback(ex, undefined!);
|
||||
});
|
||||
}
|
||||
|
||||
public readlink(path: fs.PathLike, options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException, linkString: string) => void): void {
|
||||
this.client.evaluate((path, options) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
return util.promisify(fs.readlink)(path, options);
|
||||
}, path, options).then((linkString) => {
|
||||
callback(undefined!, linkString);
|
||||
}).catch((ex) => {
|
||||
callback(ex, undefined!);
|
||||
});
|
||||
}
|
||||
|
||||
public realpath(path: fs.PathLike, options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => void): void {
|
||||
this.client.evaluate((path, options) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
return util.promisify(fs.realpath)(path, options);
|
||||
}, path, options).then((resolvedPath) => {
|
||||
callback(undefined!, resolvedPath);
|
||||
}).catch((ex) => {
|
||||
callback(ex, undefined!);
|
||||
});
|
||||
}
|
||||
|
||||
public rename(oldPath: fs.PathLike, newPath: fs.PathLike, callback: (err: NodeJS.ErrnoException) => void): void {
|
||||
this.client.evaluate((oldPath, newPath) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
return util.promisify(fs.rename)(oldPath, newPath);
|
||||
}, oldPath, newPath).then(() => {
|
||||
callback(undefined!);
|
||||
}).catch((ex) => {
|
||||
callback(ex);
|
||||
});
|
||||
}
|
||||
|
||||
public rmdir(path: fs.PathLike, callback: (err: NodeJS.ErrnoException) => void): void {
|
||||
this.client.evaluate((path) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
return util.promisify(fs.rmdir)(path);
|
||||
}, path).then(() => {
|
||||
callback(undefined!);
|
||||
}).catch((ex) => {
|
||||
callback(ex);
|
||||
});
|
||||
}
|
||||
|
||||
public stat(path: fs.PathLike, callback: (err: NodeJS.ErrnoException, stats: fs.Stats) => void): void {
|
||||
this.client.evaluate(async (path) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
const stats = await util.promisify(fs.stat)(path);
|
||||
return {
|
||||
...stats,
|
||||
_isBlockDevice: stats.isBlockDevice(),
|
||||
_isCharacterDevice: stats.isCharacterDevice(),
|
||||
_isDirectory: stats.isDirectory(),
|
||||
_isFIFO: stats.isFIFO(),
|
||||
_isFile: stats.isFile(),
|
||||
_isSocket: stats.isSocket(),
|
||||
_isSymbolicLink: stats.isSymbolicLink(),
|
||||
};
|
||||
}, path).then((stats) => {
|
||||
callback(undefined!, Stats.fromObject(stats));
|
||||
}).catch((ex) => {
|
||||
callback(ex, undefined!);
|
||||
});
|
||||
}
|
||||
|
||||
public symlink(target: fs.PathLike, path: fs.PathLike, type: fs.symlink.Type | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void {
|
||||
this.client.evaluate((target, path, type) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
return util.promisify(fs.symlink)(target, path, type);
|
||||
}, target, path, type).then(() => {
|
||||
callback(undefined!);
|
||||
}).catch((ex) => {
|
||||
callback(ex);
|
||||
});
|
||||
}
|
||||
|
||||
public truncate(path: fs.PathLike, len: number | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void {
|
||||
this.client.evaluate((path, len) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
return util.promisify(fs.truncate)(path, len);
|
||||
}, path, len).then(() => {
|
||||
callback(undefined!);
|
||||
}).catch((ex) => {
|
||||
callback(ex);
|
||||
});
|
||||
}
|
||||
|
||||
public unlink(path: fs.PathLike, callback: (err: NodeJS.ErrnoException) => void): void {
|
||||
this.client.evaluate((path) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
return util.promisify(fs.unlink)(path);
|
||||
}, path).then(() => {
|
||||
callback(undefined!);
|
||||
}).catch((ex) => {
|
||||
callback(ex);
|
||||
});
|
||||
}
|
||||
|
||||
public utimes(path: fs.PathLike, atime: string | number | Date, mtime: string | number | Date, callback: (err: NodeJS.ErrnoException) => void): void {
|
||||
this.client.evaluate((path, atime, mtime) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
return util.promisify(fs.utimes)(path, atime, mtime);
|
||||
}, path, atime, mtime).then(() => {
|
||||
callback(undefined!);
|
||||
}).catch((ex) => {
|
||||
callback(ex);
|
||||
});
|
||||
}
|
||||
|
||||
public write<TBuffer extends Buffer | Uint8Array>(fd: number, buffer: TBuffer, offset: number | undefined, length: number | undefined, position: number | undefined, callback: (err: NodeJS.ErrnoException, written: number, buffer: TBuffer) => void): void {
|
||||
this.client.evaluate(async (fd, buffer, offset, length, position) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
const resp = await util.promisify(fs.write)(fd, Buffer.from(buffer, "utf8"), offset, length, position);
|
||||
|
||||
return {
|
||||
bytesWritten: resp.bytesWritten,
|
||||
content: resp.buffer.toString("utf8"),
|
||||
}
|
||||
}, fd, buffer.toString(), offset, length, position).then((r) => {
|
||||
callback(undefined!, r.bytesWritten, Buffer.from(r.content, "utf8") as TBuffer);
|
||||
}).catch((ex) => {
|
||||
callback(ex, undefined!, undefined!);
|
||||
});
|
||||
}
|
||||
|
||||
public writeFile(path: fs.PathLike | number, data: any, options: { encoding?: string | null; mode?: number | string; flag?: string; } | string | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void {
|
||||
this.client.evaluate((path, data, options) => {
|
||||
const fs = require("fs") as typeof import("fs");
|
||||
const util = require("util") as typeof import("util");
|
||||
return util.promisify(fs.writeFile)(path, data, options);
|
||||
}, path, data, options).then(() => {
|
||||
callback(undefined!);
|
||||
}).catch((ex) => {
|
||||
callback(ex);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
class Stats implements fs.Stats {
|
||||
|
||||
public static fromObject(object: any): Stats {
|
||||
return new Stats(object);
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
public readonly dev: number;
|
||||
// @ts-ignore
|
||||
public readonly ino: number;
|
||||
// @ts-ignore
|
||||
public readonly mode: number;
|
||||
// @ts-ignore
|
||||
public readonly nlink: number;
|
||||
// @ts-ignore
|
||||
public readonly uid: number;
|
||||
// @ts-ignore
|
||||
public readonly gid: number;
|
||||
// @ts-ignore
|
||||
public readonly rdev: number;
|
||||
// @ts-ignore
|
||||
public readonly size: number;
|
||||
// @ts-ignore
|
||||
public readonly blksize: number;
|
||||
// @ts-ignore
|
||||
public readonly blocks: number;
|
||||
// @ts-ignore
|
||||
public readonly atimeMs: number;
|
||||
// @ts-ignore
|
||||
public readonly mtimeMs: number;
|
||||
// @ts-ignore
|
||||
public readonly ctimeMs: number;
|
||||
// @ts-ignore
|
||||
public readonly birthtimeMs: number;
|
||||
// @ts-ignore
|
||||
public readonly atime: Date;
|
||||
// @ts-ignore
|
||||
public readonly mtime: Date;
|
||||
// @ts-ignore
|
||||
public readonly ctime: Date;
|
||||
// @ts-ignore
|
||||
public readonly birthtime: Date;
|
||||
// @ts-ignore
|
||||
private readonly _isFile: boolean;
|
||||
// @ts-ignore
|
||||
private readonly _isDirectory: boolean;
|
||||
// @ts-ignore
|
||||
private readonly _isBlockDevice: boolean;
|
||||
// @ts-ignore
|
||||
private readonly _isCharacterDevice: boolean;
|
||||
// @ts-ignore
|
||||
private readonly _isSymbolicLink: boolean;
|
||||
// @ts-ignore
|
||||
private readonly _isFIFO: boolean;
|
||||
// @ts-ignore
|
||||
private readonly _isSocket: boolean;
|
||||
|
||||
private constructor(stats: object) {
|
||||
Object.assign(this, stats);
|
||||
}
|
||||
|
||||
public isFile(): boolean {
|
||||
return this._isFile;
|
||||
}
|
||||
|
||||
public isDirectory(): boolean {
|
||||
return this._isDirectory;
|
||||
}
|
||||
|
||||
public isBlockDevice(): boolean {
|
||||
return this._isBlockDevice;
|
||||
}
|
||||
|
||||
public isCharacterDevice(): boolean {
|
||||
return this._isCharacterDevice;
|
||||
}
|
||||
|
||||
public isSymbolicLink(): boolean {
|
||||
return this._isSymbolicLink;
|
||||
}
|
||||
|
||||
public isFIFO(): boolean {
|
||||
return this._isFIFO;
|
||||
}
|
||||
|
||||
public isSocket(): boolean {
|
||||
return this._isSocket;
|
||||
}
|
||||
|
||||
public toObject(): object {
|
||||
return JSON.parse(JSON.stringify(this));
|
||||
}
|
||||
|
||||
}
|
72
packages/protocol/src/browser/modules/net.ts
Normal file
72
packages/protocol/src/browser/modules/net.ts
Normal file
@ -0,0 +1,72 @@
|
||||
import * as net from "net";
|
||||
|
||||
/**
|
||||
* Implementation of Socket for the browser.
|
||||
*/
|
||||
class Socket extends net.Socket {
|
||||
|
||||
public connect(): this {
|
||||
throw new Error("not implemented");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of Server for the browser.
|
||||
*/
|
||||
class Server extends net.Server {
|
||||
|
||||
public listen(
|
||||
_port?: number | any | net.ListenOptions, // tslint:disable-line no-any so we can match the Node API.
|
||||
_hostname?: string | number | Function,
|
||||
_backlog?: number | Function,
|
||||
_listeningListener?: Function,
|
||||
): this {
|
||||
throw new Error("not implemented");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
type NodeNet = typeof net;
|
||||
|
||||
/**
|
||||
* Implementation of net for the browser.
|
||||
*/
|
||||
export class Net implements NodeNet {
|
||||
|
||||
public get Socket(): typeof net.Socket {
|
||||
return Socket;
|
||||
}
|
||||
|
||||
public get Server(): typeof net.Server {
|
||||
return Server;
|
||||
}
|
||||
|
||||
public connect(): net.Socket {
|
||||
throw new Error("not implemented");
|
||||
}
|
||||
|
||||
public createConnection(): net.Socket {
|
||||
throw new Error("not implemented");
|
||||
}
|
||||
|
||||
public isIP(_input: string): number {
|
||||
throw new Error("not implemented");
|
||||
}
|
||||
|
||||
public isIPv4(_input: string): boolean {
|
||||
throw new Error("not implemented");
|
||||
}
|
||||
|
||||
public isIPv6(_input: string): boolean {
|
||||
throw new Error("not implemented");
|
||||
}
|
||||
|
||||
public createServer(
|
||||
_options?: { allowHalfOpen?: boolean, pauseOnConnect?: boolean } | ((socket: net.Socket) => void),
|
||||
_connectionListener?: (socket: net.Socket) => void,
|
||||
): Server {
|
||||
return new Server();
|
||||
}
|
||||
|
||||
}
|
8
packages/protocol/src/browser/modules/util.ts
Normal file
8
packages/protocol/src/browser/modules/util.ts
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Return true if the options specify to use a Buffer instead of string.
|
||||
*/
|
||||
export const useBuffer = (options: { encoding?: string | null } | string | undefined | null | Function): boolean => {
|
||||
return options === "buffer"
|
||||
|| (!!options && typeof options !== "string" && typeof options !== "function"
|
||||
&& (options.encoding === "buffer" || options.encoding === null));
|
||||
};
|
14
packages/protocol/src/common/util.ts
Normal file
14
packages/protocol/src/common/util.ts
Normal file
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Return true if we're in a browser environment (including web workers).
|
||||
*/
|
||||
export const isBrowserEnvironment = (): boolean => {
|
||||
return typeof process === "undefined" || typeof process.stdout === "undefined";
|
||||
};
|
||||
|
||||
/**
|
||||
* Escape a path. This prevents any issues with file names that have quotes,
|
||||
* spaces, braces, etc.
|
||||
*/
|
||||
export const escapePath = (path: string): string => {
|
||||
return `'${path.replace(/'/g, "'\\''")}'`;
|
||||
};
|
6
packages/protocol/src/index.ts
Normal file
6
packages/protocol/src/index.ts
Normal file
@ -0,0 +1,6 @@
|
||||
export * from "./browser/client";
|
||||
export * from "./browser/modules/child_process";
|
||||
export * from "./browser/modules/fs";
|
||||
export * from "./browser/modules/net";
|
||||
export * from "./common/connection";
|
||||
export * from "./common/util";
|
@ -51,7 +51,7 @@ export const evaluate = async (connection: SendableConnection, message: NewEvalM
|
||||
connection.send(serverMsg.serializeBinary());
|
||||
};
|
||||
try {
|
||||
const value = vm.runInNewContext(`(${message.getFunction()})(${argStr.join(",")})`, { require, setTimeout }, {
|
||||
const value = vm.runInNewContext(`(${message.getFunction()})(${argStr.join(",")})`, { Buffer, require, setTimeout }, {
|
||||
timeout: message.getTimeout() || 30000,
|
||||
});
|
||||
sendResp(await value);
|
643
packages/protocol/test/modules/fs.test.ts
Normal file
643
packages/protocol/test/modules/fs.test.ts
Normal file
@ -0,0 +1,643 @@
|
||||
import * as nativeFs from "fs";
|
||||
import * as os from "os";
|
||||
import * as path from "path";
|
||||
import { createClient } from "../helpers";
|
||||
import { FS } from "../../src/browser/modules/fs";
|
||||
|
||||
describe("fs", () => {
|
||||
const client = createClient();
|
||||
const fs = new FS(client);
|
||||
const testFile = path.join(__dirname, "fs.test.ts");
|
||||
const tmpFile = () => path.join(os.tmpdir(), `tmpfile-${Math.random()}`);
|
||||
const createTmpFile = (): string => {
|
||||
const tf = tmpFile();
|
||||
nativeFs.writeFileSync(tf, "");
|
||||
return tf;
|
||||
};
|
||||
|
||||
describe("access", () => {
|
||||
it("should access file", (done) => {
|
||||
fs.access(testFile, undefined, (err) => {
|
||||
expect(err).toBeUndefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should fail to access file", (done) => {
|
||||
fs.access(tmpFile(), undefined, (err) => {
|
||||
expect(err).toBeDefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("append", () => {
|
||||
it("should append to file", (done) => {
|
||||
const file = createTmpFile();
|
||||
fs.appendFile(file, "howdy", undefined, (err) => {
|
||||
expect(err).toBeUndefined();
|
||||
const content = nativeFs.readFileSync(file).toString();
|
||||
expect(content).toEqual("howdy");
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should fail to append to file", (done) => {
|
||||
fs.appendFile(tmpFile(), "howdy", undefined, (err) => {
|
||||
expect(err).toBeDefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("chmod", () => {
|
||||
it("should chmod file", (done) => {
|
||||
fs.chmod(createTmpFile(), "755", (err) => {
|
||||
expect(err).toBeUndefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should fail to chmod file", (done) => {
|
||||
fs.chmod(tmpFile(), "755", (err) => {
|
||||
expect(err).toBeDefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("chown", () => {
|
||||
it("should chown file", (done) => {
|
||||
fs.chown(createTmpFile(), 1, 1, (err) => {
|
||||
expect(err).toBeUndefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should fail to chown file", (done) => {
|
||||
fs.chown(tmpFile(), 1, 1, (err) => {
|
||||
expect(err).toBeDefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("close", () => {
|
||||
it("should close file", (done) => {
|
||||
const file = createTmpFile();
|
||||
const id = nativeFs.openSync(file, "r");
|
||||
fs.close(id, (err) => {
|
||||
expect(err).toBeUndefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should fail to close file", (done) => {
|
||||
fs.close(99999999, (err) => {
|
||||
expect(err).toBeDefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("copyFile", () => {
|
||||
it("should copy file", (done) => {
|
||||
const file = createTmpFile();
|
||||
fs.copyFile(file, tmpFile(), (err) => {
|
||||
expect(err).toBeUndefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should fail to copy file", (done) => {
|
||||
fs.copyFile(tmpFile(), tmpFile(), (err) => {
|
||||
expect(err).toBeDefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("exists", () => {
|
||||
it("should output file exists", (done) => {
|
||||
fs.exists(testFile, (exists) => {
|
||||
expect(exists).toBeTruthy();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should output file does not exist", (done) => {
|
||||
fs.exists(tmpFile(), (exists) => {
|
||||
expect(exists).toBeFalsy();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("fchmod", () => {
|
||||
it("should fchmod", (done) => {
|
||||
const file = createTmpFile();
|
||||
const id = nativeFs.openSync(file, "r");
|
||||
fs.fchmod(id, "755", (err) => {
|
||||
expect(err).toBeUndefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should fail to fchmod", (done) => {
|
||||
fs.fchmod(2242342, "755", (err) => {
|
||||
expect(err).toBeDefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("fchown", () => {
|
||||
it("should fchown", (done) => {
|
||||
const file = createTmpFile();
|
||||
const id = nativeFs.openSync(file, "r");
|
||||
fs.fchown(id, 1, 1, (err) => {
|
||||
expect(err).toBeUndefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should fail to fchown", (done) => {
|
||||
fs.fchown(99999, 1, 1, (err) => {
|
||||
expect(err).toBeDefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("fdatasync", () => {
|
||||
it("should fdatasync", (done) => {
|
||||
const file = createTmpFile();
|
||||
const id = nativeFs.openSync(file, "r");
|
||||
fs.fdatasync(id, (err) => {
|
||||
expect(err).toBeUndefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should fail to fdatasync", (done) => {
|
||||
fs.fdatasync(99999, (err) => {
|
||||
expect(err).toBeDefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("fstat", () => {
|
||||
it("should fstat", (done) => {
|
||||
const id = nativeFs.openSync(testFile, "r");
|
||||
fs.fstat(id, (err, stats) => {
|
||||
expect(err).toBeUndefined();
|
||||
expect(stats.size).toBeGreaterThan(0);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should fail to fstat", (done) => {
|
||||
fs.fstat(9999, (err) => {
|
||||
expect(err).toBeDefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("fsync", () => {
|
||||
it("should fsync", (done) => {
|
||||
const file = createTmpFile();
|
||||
const id = nativeFs.openSync(file, "r");
|
||||
fs.fsync(id, (err) => {
|
||||
expect(err).toBeUndefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should fail to fsync", (done) => {
|
||||
fs.fsync(99999, (err) => {
|
||||
expect(err).toBeDefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("ftruncate", () => {
|
||||
it("should ftruncate", (done) => {
|
||||
const file = createTmpFile();
|
||||
const id = nativeFs.openSync(file, "w");
|
||||
fs.ftruncate(id, 1, (err) => {
|
||||
expect(err).toBeUndefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should fail to ftruncate", (done) => {
|
||||
fs.ftruncate(99999, 9999, (err) => {
|
||||
expect(err).toBeDefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("futimes", () => {
|
||||
it("should futimes", (done) => {
|
||||
const file = createTmpFile();
|
||||
const id = nativeFs.openSync(file, "w");
|
||||
fs.futimes(id, 1, 1, (err) => {
|
||||
expect(err).toBeUndefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should fail to futimes", (done) => {
|
||||
fs.futimes(99999, 9999, 9999, (err) => {
|
||||
expect(err).toBeDefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("lchmod", () => {
|
||||
it("should lchmod file", (done) => {
|
||||
fs.lchmod(createTmpFile(), "755", (err) => {
|
||||
expect(err).toBeUndefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should fail to lchmod file", (done) => {
|
||||
fs.lchmod(tmpFile(), "755", (err) => {
|
||||
expect(err).toBeDefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("lchown", () => {
|
||||
it("should lchown file", (done) => {
|
||||
fs.lchown(createTmpFile(), 1, 1, (err) => {
|
||||
expect(err).toBeUndefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should fail to lchown file", (done) => {
|
||||
fs.lchown(tmpFile(), 1, 1, (err) => {
|
||||
expect(err).toBeDefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("link", () => {
|
||||
it("should link file", (done) => {
|
||||
const newFile = createTmpFile();
|
||||
const targetFile = tmpFile();
|
||||
fs.link(newFile, targetFile, (err) => {
|
||||
expect(err).toBeUndefined();
|
||||
expect(nativeFs.existsSync(targetFile)).toBeTruthy();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should fail to link file", (done) => {
|
||||
fs.link(tmpFile(), tmpFile(), (err) => {
|
||||
expect(err).toBeDefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("lstat", () => {
|
||||
it("should lstat", (done) => {
|
||||
fs.lstat(testFile, (err, stats) => {
|
||||
expect(err).toBeUndefined();
|
||||
expect(stats.size).toBeGreaterThan(0);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should fail to lstat", (done) => {
|
||||
fs.lstat(path.join(__dirname, "no-exist"), (err, stats) => {
|
||||
expect(err).toBeDefined();
|
||||
expect(stats).toBeUndefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("mkdir", () => {
|
||||
const target = tmpFile();
|
||||
it("should create directory", (done) => {
|
||||
fs.mkdir(target, undefined, (err) => {
|
||||
expect(err).toBeUndefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should fail to create directory", (done) => {
|
||||
fs.mkdir(target, undefined, (err) => {
|
||||
expect(err).toBeDefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("mkdtemp", () => {
|
||||
it("should create temp dir", (done) => {
|
||||
fs.mkdtemp(path.join(os.tmpdir(), "example"), undefined, (err, folder) => {
|
||||
expect(err).toBeUndefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("open", () => {
|
||||
it("should open file", (done) => {
|
||||
fs.open(testFile, "r", undefined, (err, fd) => {
|
||||
expect(err).toBeUndefined();
|
||||
expect(fd).toBeDefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should fail to open file", (done) => {
|
||||
fs.open("asdfoksfg", "r", undefined, (err, fd) => {
|
||||
expect(err).toBeDefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("read", () => {
|
||||
it("should read file", async () => {
|
||||
const fd = nativeFs.openSync(testFile, "r");
|
||||
const stat = nativeFs.fstatSync(fd);
|
||||
const buffer = new Buffer(stat.size);
|
||||
let bytesRead = 0;
|
||||
let chunkSize = 2048;
|
||||
while (bytesRead < stat.size) {
|
||||
if ((bytesRead + chunkSize) > stat.size) {
|
||||
chunkSize = stat.size - bytesRead;
|
||||
}
|
||||
|
||||
await new Promise((res, rej) => {
|
||||
fs.read(fd, buffer, bytesRead, chunkSize, bytesRead, (err) => {
|
||||
if (err) {
|
||||
rej(err);
|
||||
} else {
|
||||
res();
|
||||
}
|
||||
});
|
||||
});
|
||||
bytesRead += chunkSize;
|
||||
}
|
||||
|
||||
expect(buffer.toString()).toEqual(nativeFs.readFileSync(testFile).toString());
|
||||
});
|
||||
|
||||
it("should fail to read file", (done) => {
|
||||
fs.read(99999, new Buffer(10), 9999, 999, 999, (err) => {
|
||||
expect(err).toBeDefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("readFile", () => {
|
||||
it("should read file", (done) => {
|
||||
fs.readFile(testFile, undefined, (err, data) => {
|
||||
expect(err).toBeUndefined();
|
||||
expect(data.toString()).toEqual(nativeFs.readFileSync(testFile).toString());
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should fail to read file", (done) => {
|
||||
fs.readFile("donkey", undefined, (err) => {
|
||||
expect(err).toBeDefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("readdir", () => {
|
||||
it("should read directory", (done) => {
|
||||
fs.readdir(__dirname, undefined, (err, paths) => {
|
||||
expect(err).toBeUndefined();
|
||||
expect(paths.length).toBeGreaterThan(0);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should fail to read directory", (done) => {
|
||||
fs.readdir("moocow", undefined, (err) => {
|
||||
expect(err).toBeDefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("readlink", () => {
|
||||
it("should read link", (done) => {
|
||||
const srcFile = createTmpFile();
|
||||
const linkedFile = tmpFile();
|
||||
nativeFs.symlinkSync(srcFile, linkedFile);
|
||||
fs.readlink(linkedFile, undefined, (err, link) => {
|
||||
expect(err).toBeUndefined();
|
||||
expect(link).toEqual(srcFile);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should fail to read link", (done) => {
|
||||
fs.readlink(tmpFile(), undefined, (err) => {
|
||||
expect(err).toBeDefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("realpath", () => {
|
||||
it("should read real path", (done) => {
|
||||
const srcFile = createTmpFile();
|
||||
const linkedFile = tmpFile();
|
||||
nativeFs.symlinkSync(srcFile, linkedFile);
|
||||
fs.realpath(linkedFile, undefined, (err, link) => {
|
||||
expect(err).toBeUndefined();
|
||||
expect(link).toEqual(srcFile);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should fail to read real path", (done) => {
|
||||
fs.realpath(tmpFile(), undefined, (err) => {
|
||||
expect(err).toBeDefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("rename", () => {
|
||||
it("should rename file", (done) => {
|
||||
const srcFile = createTmpFile();
|
||||
const targetFile = tmpFile();
|
||||
fs.rename(srcFile, targetFile, (err) => {
|
||||
expect(err).toBeUndefined();
|
||||
expect(nativeFs.existsSync(targetFile)).toBeTruthy();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should fail to rename file", (done) => {
|
||||
fs.rename(tmpFile(), tmpFile(), (err) => {
|
||||
expect(err).toBeDefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("rmdir", () => {
|
||||
it("should rmdir", (done) => {
|
||||
const srcFile = tmpFile();
|
||||
nativeFs.mkdirSync(srcFile);
|
||||
fs.rmdir(srcFile, (err) => {
|
||||
expect(err).toBeUndefined();
|
||||
expect(nativeFs.existsSync(srcFile)).toBeFalsy();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should fail to rmdir", (done) => {
|
||||
fs.rmdir(tmpFile(), (err) => {
|
||||
expect(err).toBeDefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("stat", () => {
|
||||
it("should stat", (done) => {
|
||||
fs.stat(testFile, (err, stats) => {
|
||||
expect(err).toBeUndefined();
|
||||
expect(stats.size).toBeGreaterThan(0);
|
||||
expect(stats.isFile()).toBeTruthy();
|
||||
expect(stats.isFIFO()).toBeFalsy();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should fail to stat", (done) => {
|
||||
fs.stat(path.join(__dirname, "no-exist"), (err, stats) => {
|
||||
expect(err).toBeDefined();
|
||||
expect(stats).toBeUndefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("symlink", () => {
|
||||
it("should symlink file", (done) => {
|
||||
const newFile = createTmpFile();
|
||||
const targetFile = tmpFile();
|
||||
fs.symlink(newFile, targetFile, "file", (err) => {
|
||||
expect(err).toBeUndefined();
|
||||
expect(nativeFs.existsSync(targetFile)).toBeTruthy();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should fail to symlink file", (done) => {
|
||||
fs.symlink(tmpFile(), tmpFile(), "file", (err) => {
|
||||
expect(err).toBeDefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("truncate", () => {
|
||||
it("should truncate file", (done) => {
|
||||
const newFile = tmpFile();
|
||||
nativeFs.writeFileSync(newFile, "hiiiiii");
|
||||
fs.truncate(newFile, 2, (err) => {
|
||||
expect(err).toBeUndefined();
|
||||
expect(nativeFs.statSync(newFile).size).toEqual(2);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should fail to truncate file", (done) => {
|
||||
fs.truncate(tmpFile(), 0, (err) => {
|
||||
expect(err).toBeDefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("unlink", () => {
|
||||
it("should unlink file", (done) => {
|
||||
const newFile = createTmpFile();
|
||||
const targetFile = tmpFile();
|
||||
nativeFs.symlinkSync(newFile, targetFile, "file");
|
||||
fs.unlink(targetFile, (err) => {
|
||||
expect(err).toBeUndefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should fail to unlink file", (done) => {
|
||||
fs.unlink(tmpFile(), (err) => {
|
||||
expect(err).toBeDefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("utimes", () => {
|
||||
it("should update times on file", (done) => {
|
||||
fs.utimes(createTmpFile(), 100, 100, (err) => {
|
||||
expect(err).toBeUndefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should fail to update times", (done) => {
|
||||
fs.utimes(tmpFile(), 100, 100, (err) => {
|
||||
expect(err).toBeDefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("write", () => {
|
||||
it("should write to file", (done) => {
|
||||
const file = createTmpFile();
|
||||
const fd = nativeFs.openSync(file, "w");
|
||||
fs.write(fd, Buffer.from("hi"), undefined, undefined, undefined, (err, written) => {
|
||||
expect(err).toBeUndefined();
|
||||
expect(written).toEqual(2);
|
||||
nativeFs.closeSync(fd);
|
||||
expect(nativeFs.readFileSync(file).toString()).toEqual("hi");
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should fail to write to file", (done) => {
|
||||
fs.write(100000, Buffer.from("wowow"), undefined, undefined, undefined, (err) => {
|
||||
expect(err).toBeDefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("writeFile", () => {
|
||||
it("should write file", (done) => {
|
||||
fs.writeFile(createTmpFile(), "howdy", undefined, (err) => {
|
||||
expect(err).toBeUndefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
@ -1,7 +0,0 @@
|
||||
{
|
||||
"name": "@coder/rules",
|
||||
"description": "Custom linting rules.",
|
||||
"scripts": {
|
||||
"build": "tsc -p ."
|
||||
}
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
@ -13,14 +13,14 @@ const load = (): Promise<void> => {
|
||||
parse: (raw: string): IURI => URI.parse(raw),
|
||||
});
|
||||
|
||||
reject(new Error("not finished"));
|
||||
const client = new Client({
|
||||
mkDirs: [
|
||||
"~/vscode/extensions",
|
||||
"~/.config/User",
|
||||
],
|
||||
});
|
||||
|
||||
// export const client = new Client({
|
||||
// mkDirs: [
|
||||
// "~/vscode/extensions",
|
||||
// "~/.config/User",
|
||||
// ],
|
||||
// });
|
||||
resolve();
|
||||
|
||||
// const importTime = time(1500);
|
||||
// import(/* webpackPrefetch: true */ "./workbench").then((module) => {
|
||||
|
@ -165,7 +165,7 @@ array-unique@^0.3.2:
|
||||
resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428"
|
||||
integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=
|
||||
|
||||
arrify@^1.0.0, arrify@^1.0.1:
|
||||
arrify@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d"
|
||||
integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=
|
||||
@ -224,7 +224,7 @@ aws4@^1.8.0:
|
||||
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f"
|
||||
integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==
|
||||
|
||||
babel-code-frame@^6.22.0, babel-code-frame@^6.26.0:
|
||||
babel-code-frame@^6.26.0:
|
||||
version "6.26.0"
|
||||
resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b"
|
||||
integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=
|
||||
@ -469,12 +469,12 @@ bser@^2.0.0:
|
||||
dependencies:
|
||||
node-int64 "^0.4.0"
|
||||
|
||||
buffer-from@1.x, buffer-from@^1.0.0, buffer-from@^1.1.0:
|
||||
buffer-from@1.x, buffer-from@^1.0.0:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
|
||||
integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==
|
||||
|
||||
builtin-modules@^1.0.0, builtin-modules@^1.1.1:
|
||||
builtin-modules@^1.0.0:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"
|
||||
integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=
|
||||
@ -527,7 +527,7 @@ chalk@^1.1.3:
|
||||
strip-ansi "^3.0.0"
|
||||
supports-color "^2.0.0"
|
||||
|
||||
chalk@^2.0.0, chalk@^2.0.1, chalk@^2.3.0:
|
||||
chalk@^2.0.0, chalk@^2.0.1:
|
||||
version "2.4.2"
|
||||
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
|
||||
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
|
||||
@ -602,11 +602,6 @@ combined-stream@^1.0.6, combined-stream@~1.0.6:
|
||||
dependencies:
|
||||
delayed-stream "~1.0.0"
|
||||
|
||||
commander@^2.12.1:
|
||||
version "2.19.0"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a"
|
||||
integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==
|
||||
|
||||
commander@~2.17.1:
|
||||
version "2.17.1"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf"
|
||||
@ -783,7 +778,7 @@ detect-newline@^2.1.0:
|
||||
resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2"
|
||||
integrity sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I=
|
||||
|
||||
diff@^3.1.0, diff@^3.2.0:
|
||||
diff@^3.2.0:
|
||||
version "3.5.0"
|
||||
resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12"
|
||||
integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==
|
||||
@ -1126,7 +1121,7 @@ gauge@~2.7.3:
|
||||
strip-ansi "^3.0.1"
|
||||
wide-align "^1.1.0"
|
||||
|
||||
get-caller-file@^1.0.1, get-caller-file@^1.0.2:
|
||||
get-caller-file@^1.0.1:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a"
|
||||
integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==
|
||||
@ -2189,7 +2184,7 @@ lru-cache@^4.0.1:
|
||||
pseudomap "^1.0.2"
|
||||
yallist "^2.1.2"
|
||||
|
||||
make-error@1.x, make-error@^1.1.1:
|
||||
make-error@1.x:
|
||||
version "1.3.5"
|
||||
resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.5.tgz#efe4e81f6db28cadd605c70f29c831b58ef776c8"
|
||||
integrity sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g==
|
||||
@ -2344,14 +2339,6 @@ mkdirp@0.x, mkdirp@^0.5.0, mkdirp@^0.5.1:
|
||||
dependencies:
|
||||
minimist "0.0.8"
|
||||
|
||||
mock-require@^3.0.2:
|
||||
version "3.0.2"
|
||||
resolved "https://registry.yarnpkg.com/mock-require/-/mock-require-3.0.2.tgz#7ce759b559e3b194be5f20a5b1cece0eb363f53d"
|
||||
integrity sha512-aD/Y1ZFHqw5pHg3HVQ50dLbfaAAcytS6sqLuhP51Dk3TSPdFb2VkSAa3mjrHifLIlGAtwQHJHINafAyqAne7vA==
|
||||
dependencies:
|
||||
get-caller-file "^1.0.2"
|
||||
normalize-path "^2.1.1"
|
||||
|
||||
ms@2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
|
||||
@ -2961,7 +2948,7 @@ resolve@1.1.7:
|
||||
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b"
|
||||
integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=
|
||||
|
||||
resolve@1.x, resolve@^1.3.2:
|
||||
resolve@1.x:
|
||||
version "1.9.0"
|
||||
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.9.0.tgz#a14c6fdfa8f92a7df1d996cb7105fa744658ea06"
|
||||
integrity sha512-TZNye00tI67lwYvzxCxHGjwTNlUV70io54/Ed4j6PscB8xVfuBJpRenI/o6dVk0cY0PYTY27AgCoGGxRnYuItQ==
|
||||
@ -3435,50 +3422,6 @@ ts-jest@^23.10.5:
|
||||
semver "^5.5"
|
||||
yargs-parser "10.x"
|
||||
|
||||
ts-node@^7.0.1:
|
||||
version "7.0.1"
|
||||
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-7.0.1.tgz#9562dc2d1e6d248d24bc55f773e3f614337d9baf"
|
||||
integrity sha512-BVwVbPJRspzNh2yfslyT1PSbl5uIk03EZlb493RKHN4qej/D06n1cEhjlOJG69oFsE7OT8XjpTUcYf6pKTLMhw==
|
||||
dependencies:
|
||||
arrify "^1.0.0"
|
||||
buffer-from "^1.1.0"
|
||||
diff "^3.1.0"
|
||||
make-error "^1.1.1"
|
||||
minimist "^1.2.0"
|
||||
mkdirp "^0.5.1"
|
||||
source-map-support "^0.5.6"
|
||||
yn "^2.0.0"
|
||||
|
||||
tslib@^1.8.0, tslib@^1.8.1:
|
||||
version "1.9.3"
|
||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286"
|
||||
integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==
|
||||
|
||||
tslint@^5.12.1:
|
||||
version "5.12.1"
|
||||
resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.12.1.tgz#8cec9d454cf8a1de9b0a26d7bdbad6de362e52c1"
|
||||
integrity sha512-sfodBHOucFg6egff8d1BvuofoOQ/nOeYNfbp7LDlKBcLNrL3lmS5zoiDGyOMdT7YsEXAwWpTdAHwOGOc8eRZAw==
|
||||
dependencies:
|
||||
babel-code-frame "^6.22.0"
|
||||
builtin-modules "^1.1.1"
|
||||
chalk "^2.3.0"
|
||||
commander "^2.12.1"
|
||||
diff "^3.2.0"
|
||||
glob "^7.1.1"
|
||||
js-yaml "^3.7.0"
|
||||
minimatch "^3.0.4"
|
||||
resolve "^1.3.2"
|
||||
semver "^5.3.0"
|
||||
tslib "^1.8.0"
|
||||
tsutils "^2.27.2"
|
||||
|
||||
tsutils@^2.27.2:
|
||||
version "2.29.0"
|
||||
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99"
|
||||
integrity sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==
|
||||
dependencies:
|
||||
tslib "^1.8.1"
|
||||
|
||||
tunnel-agent@^0.6.0:
|
||||
version "0.6.0"
|
||||
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd"
|
||||
@ -3498,15 +3441,6 @@ type-check@~0.3.2:
|
||||
dependencies:
|
||||
prelude-ls "~1.1.2"
|
||||
|
||||
typescript-tslint-plugin@^0.2.1:
|
||||
version "0.2.1"
|
||||
resolved "https://registry.yarnpkg.com/typescript-tslint-plugin/-/typescript-tslint-plugin-0.2.1.tgz#6a0361cd311bdc9dcec2e70c8a54cab16829e47f"
|
||||
integrity sha512-j0Tn/2GlAwnaklSNMOZRNpv96j6IWkQF6RuTJ5WowfNlgdYqnJpSaVFwT22INwJiPDDGKNe/aATT0qkU0pWM4w==
|
||||
dependencies:
|
||||
minimatch "^3.0.4"
|
||||
mock-require "^3.0.2"
|
||||
vscode-languageserver "^5.1.0"
|
||||
|
||||
uglify-js@^3.1.4:
|
||||
version "3.4.9"
|
||||
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.9.tgz#af02f180c1207d76432e473ed24a28f4a782bae3"
|
||||
@ -3585,37 +3519,6 @@ verror@1.10.0:
|
||||
core-util-is "1.0.2"
|
||||
extsprintf "^1.2.0"
|
||||
|
||||
vscode-jsonrpc@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-4.0.0.tgz#a7bf74ef3254d0a0c272fab15c82128e378b3be9"
|
||||
integrity sha512-perEnXQdQOJMTDFNv+UF3h1Y0z4iSiaN9jIlb0OqIYgosPCZGYh/MCUlkFtV2668PL69lRDO32hmvL2yiidUYg==
|
||||
|
||||
vscode-languageserver-protocol@3.14.1:
|
||||
version "3.14.1"
|
||||
resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.14.1.tgz#b8aab6afae2849c84a8983d39a1cf742417afe2f"
|
||||
integrity sha512-IL66BLb2g20uIKog5Y2dQ0IiigW0XKrvmWiOvc0yXw80z3tMEzEnHjaGAb3ENuU7MnQqgnYJ1Cl2l9RvNgDi4g==
|
||||
dependencies:
|
||||
vscode-jsonrpc "^4.0.0"
|
||||
vscode-languageserver-types "3.14.0"
|
||||
|
||||
vscode-languageserver-types@3.14.0:
|
||||
version "3.14.0"
|
||||
resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.14.0.tgz#d3b5952246d30e5241592b6dde8280e03942e743"
|
||||
integrity sha512-lTmS6AlAlMHOvPQemVwo3CezxBp0sNB95KNPkqp3Nxd5VFEnuG1ByM0zlRWos0zjO3ZWtkvhal0COgiV1xIA4A==
|
||||
|
||||
vscode-languageserver@^5.1.0:
|
||||
version "5.2.1"
|
||||
resolved "https://registry.yarnpkg.com/vscode-languageserver/-/vscode-languageserver-5.2.1.tgz#0d2feddd33f92aadf5da32450df498d52f6f14eb"
|
||||
integrity sha512-GuayqdKZqAwwaCUjDvMTAVRPJOp/SLON3mJ07eGsx/Iq9HjRymhKWztX41rISqDKhHVVyFM+IywICyZDla6U3A==
|
||||
dependencies:
|
||||
vscode-languageserver-protocol "3.14.1"
|
||||
vscode-uri "^1.0.6"
|
||||
|
||||
vscode-uri@^1.0.6:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-1.0.6.tgz#6b8f141b0bbc44ad7b07e94f82f168ac7608ad4d"
|
||||
integrity sha512-sLI2L0uGov3wKVb9EB+vIQBl9tVP90nqRvxSoJ35vI3NjxE8jfsE5DSOhWgSunHSZmKS4OCi2jrtfxK7uyp2ww==
|
||||
|
||||
w3c-hr-time@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz#82ac2bff63d950ea9e3189a58a65625fedf19045"
|
||||
@ -3787,8 +3690,3 @@ yargs@^11.0.0:
|
||||
which-module "^2.0.0"
|
||||
y18n "^3.2.1"
|
||||
yargs-parser "^9.0.2"
|
||||
|
||||
yn@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/yn/-/yn-2.0.0.tgz#e5adabc8acf408f6385fc76495684c88e6af689a"
|
||||
integrity sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { exec } from "child_process";
|
||||
import { existsSync, readdirSync } from "fs";
|
||||
import { join, resolve } from "path";
|
||||
import { logger, field } from "../../logger";
|
||||
import { logger, field } from "../packages/logger";
|
||||
|
||||
/**
|
||||
* Install dependencies for a single package.
|
||||
@ -39,4 +39,4 @@ const handlePackages = (dir: string): void => {
|
||||
});
|
||||
};
|
||||
|
||||
handlePackages(resolve(__dirname, "..", ".."));
|
||||
handlePackages(resolve(__dirname, "..", "packages"));
|
32
scripts/vscode.css.patch
Normal file
32
scripts/vscode.css.patch
Normal file
@ -0,0 +1,32 @@
|
||||
diff --git a/src/vs/base/browser/ui/iconLabel/iconlabel.css b/src/vs/base/browser/ui/iconLabel/iconlabel.css
|
||||
index 651843fcc9..aa31b52cb9 100644
|
||||
--- a/src/vs/base/browser/ui/iconLabel/iconlabel.css
|
||||
+++ b/src/vs/base/browser/ui/iconLabel/iconlabel.css
|
||||
@@ -32,6 +32,7 @@
|
||||
.monaco-icon-label > .monaco-icon-label-description-container {
|
||||
overflow: hidden; /* this causes the label/description to shrink first if decorations are enabled */
|
||||
text-overflow: ellipsis;
|
||||
+ margin-right: auto;
|
||||
}
|
||||
|
||||
.monaco-icon-label > .monaco-icon-label-description-container > .label-name {
|
||||
@@ -39,6 +40,12 @@
|
||||
white-space: pre; /* enable to show labels that include multiple whitespaces */
|
||||
}
|
||||
|
||||
+.monaco-icon-label > .decorations-wrapper {
|
||||
+ display: flex;
|
||||
+ flex-direction: row;
|
||||
+ padding-right: 12px;
|
||||
+}
|
||||
+
|
||||
.monaco-icon-label > .monaco-icon-label-description-container > .label-description {
|
||||
opacity: .7;
|
||||
margin-left: 0.5em;
|
||||
@@ -56,6 +63,5 @@
|
||||
font-size: 90%;
|
||||
font-weight: 600;
|
||||
padding: 0 12px 0 5px;
|
||||
- margin-left: auto;
|
||||
text-align: center;
|
||||
}
|
8653
scripts/vscode.patch
Normal file
8653
scripts/vscode.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -16,12 +16,12 @@ const PreloadWebpackPlugin = require("preload-webpack-plugin");
|
||||
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
||||
|
||||
const root = __dirname;
|
||||
const nodeFills = path.join(root, "packages", "node-browser", "src");
|
||||
const fills = path.join(root, "packages", "ide", "src", "fill");
|
||||
const vscodeFills = path.join(root, "packages", "vscode", "src", "fill");
|
||||
|
||||
module.exports = {
|
||||
context: root,
|
||||
devtool: "eval",
|
||||
devtool: "source-map",
|
||||
entry: "./packages/app/src/index.ts",
|
||||
mode: isCi ? "production" : "development",
|
||||
output: {
|
||||
@ -71,25 +71,25 @@ module.exports = {
|
||||
"native-keymap": path.join(vscodeFills, "native-keymap.ts"),
|
||||
"node-pty": path.join(vscodeFills, "node-pty.ts"),
|
||||
|
||||
"gc-signals": path.join(nodeFills, "empty.ts"),
|
||||
"selenium-webdriver": path.join(nodeFills, "empty.ts"),
|
||||
"vscode": path.join(nodeFills, "empty.ts"),
|
||||
"vscode-fsevents": path.join(nodeFills, "empty.ts"),
|
||||
"vsda": path.join(nodeFills, "empty.ts"),
|
||||
"windows-foreground-love": path.join(nodeFills, "empty.ts"),
|
||||
"windows-mutex": path.join(nodeFills, "empty.ts"),
|
||||
"windows-process-tree": path.join(nodeFills, "empty.ts"),
|
||||
"gc-signals": path.join(fills, "empty.ts"),
|
||||
"selenium-webdriver": path.join(fills, "empty.ts"),
|
||||
"vscode": path.join(fills, "empty.ts"),
|
||||
"vscode-fsevents": path.join(fills, "empty.ts"),
|
||||
"vsda": path.join(fills, "empty.ts"),
|
||||
"windows-foreground-love": path.join(fills, "empty.ts"),
|
||||
"windows-mutex": path.join(fills, "empty.ts"),
|
||||
"windows-process-tree": path.join(fills, "empty.ts"),
|
||||
|
||||
"crypto": "crypto-browserify",
|
||||
"http": "http-browserify",
|
||||
"os": "os-browserify",
|
||||
"util": path.join(root, "node_modules", "util"),
|
||||
|
||||
"child_process": path.join(nodeFills, "child_process.ts"),
|
||||
"fs": path.join(nodeFills, "fs.ts"),
|
||||
"net": path.join(nodeFills, "net.ts"),
|
||||
"child_process": path.join(fills, "child_process.ts"),
|
||||
"fs": path.join(fills, "fs.ts"),
|
||||
"net": path.join(fills, "net.ts"),
|
||||
"util": path.join(fills, "util.ts"),
|
||||
|
||||
"electron": path.join(root, "packages", "electron-browser", "src", "electron.ts"),
|
||||
"electron": path.join(fills, "electron.ts"),
|
||||
|
||||
"@coder": path.join(root, "packages"),
|
||||
"vs": path.join(root, "lib", "vscode", "src", "vs"),
|
||||
|
158
yarn.lock
158
yarn.lock
@ -268,6 +268,13 @@ are-we-there-yet@~1.1.2:
|
||||
delegates "^1.0.0"
|
||||
readable-stream "^2.0.6"
|
||||
|
||||
argparse@^1.0.7:
|
||||
version "1.0.10"
|
||||
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
|
||||
integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==
|
||||
dependencies:
|
||||
sprintf-js "~1.0.2"
|
||||
|
||||
arr-diff@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520"
|
||||
@ -330,6 +337,11 @@ array-unique@^0.3.2:
|
||||
resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428"
|
||||
integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=
|
||||
|
||||
arrify@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d"
|
||||
integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=
|
||||
|
||||
asn1.js@^4.0.0:
|
||||
version "4.10.1"
|
||||
resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0"
|
||||
@ -615,7 +627,7 @@ browserify-zlib@^0.2.0:
|
||||
dependencies:
|
||||
pako "~1.0.5"
|
||||
|
||||
buffer-from@^1.0.0:
|
||||
buffer-from@^1.0.0, buffer-from@^1.1.0:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
|
||||
integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==
|
||||
@ -639,7 +651,7 @@ buffer@^4.3.0:
|
||||
ieee754 "^1.1.4"
|
||||
isarray "^1.0.0"
|
||||
|
||||
builtin-modules@^1.0.0:
|
||||
builtin-modules@^1.0.0, builtin-modules@^1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"
|
||||
integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=
|
||||
@ -877,7 +889,7 @@ commander@2.17.x, commander@~2.17.1:
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf"
|
||||
integrity sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==
|
||||
|
||||
commander@^2.18.0:
|
||||
commander@^2.12.1, commander@^2.18.0:
|
||||
version "2.19.0"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a"
|
||||
integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==
|
||||
@ -1279,6 +1291,11 @@ detect-node@^2.0.4:
|
||||
resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.0.4.tgz#014ee8f8f669c5c58023da64b8179c083a28c46c"
|
||||
integrity sha512-ZIzRpLJrOj7jjP2miAtgqIfmzbxa4ZOr5jJc601zklsfEx9oTzmmj2nVpIPRpNlRTIh8lc1kyViIY7BWSGNmKw==
|
||||
|
||||
diff@^3.1.0, diff@^3.2.0:
|
||||
version "3.5.0"
|
||||
resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12"
|
||||
integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==
|
||||
|
||||
diffie-hellman@^5.0.0:
|
||||
version "5.0.3"
|
||||
resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875"
|
||||
@ -1490,6 +1507,11 @@ eslint-scope@^4.0.0:
|
||||
esrecurse "^4.1.0"
|
||||
estraverse "^4.1.1"
|
||||
|
||||
esprima@^4.0.0:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
|
||||
integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==
|
||||
|
||||
esrecurse@^4.1.0:
|
||||
version "4.2.1"
|
||||
resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf"
|
||||
@ -1916,7 +1938,7 @@ gaze@^1.0.0:
|
||||
dependencies:
|
||||
globule "^1.0.0"
|
||||
|
||||
get-caller-file@^1.0.1:
|
||||
get-caller-file@^1.0.1, get-caller-file@^1.0.2:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a"
|
||||
integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==
|
||||
@ -1958,7 +1980,7 @@ glob-parent@^3.1.0:
|
||||
is-glob "^3.1.0"
|
||||
path-dirname "^1.0.0"
|
||||
|
||||
glob@^7.0.0, glob@^7.0.3, glob@^7.1.2, glob@^7.1.3, glob@~7.1.1:
|
||||
glob@^7.0.0, glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@~7.1.1:
|
||||
version "7.1.3"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1"
|
||||
integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==
|
||||
@ -2658,6 +2680,14 @@ js-tokens@^3.0.2:
|
||||
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
|
||||
integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls=
|
||||
|
||||
js-yaml@^3.7.0:
|
||||
version "3.12.1"
|
||||
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.1.tgz#295c8632a18a23e054cf5c9d3cecafe678167600"
|
||||
integrity sha512-um46hB9wNOKlwkHgiuyEVAybXBjwFUV0Z/RaHJblRd9DXltue9FTYvzCr9ErQrK9Adz5MU4gHWVaNUfdmrC8qA==
|
||||
dependencies:
|
||||
argparse "^1.0.7"
|
||||
esprima "^4.0.0"
|
||||
|
||||
jsbn@~0.1.0:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
|
||||
@ -2900,6 +2930,11 @@ make-dir@^1.0.0:
|
||||
dependencies:
|
||||
pify "^3.0.0"
|
||||
|
||||
make-error@^1.1.1:
|
||||
version "1.3.5"
|
||||
resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.5.tgz#efe4e81f6db28cadd605c70f29c831b58ef776c8"
|
||||
integrity sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g==
|
||||
|
||||
map-age-cleaner@^0.1.1:
|
||||
version "0.1.3"
|
||||
resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a"
|
||||
@ -3130,6 +3165,14 @@ mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0:
|
||||
dependencies:
|
||||
minimist "0.0.8"
|
||||
|
||||
mock-require@^3.0.2:
|
||||
version "3.0.2"
|
||||
resolved "https://registry.yarnpkg.com/mock-require/-/mock-require-3.0.2.tgz#7ce759b559e3b194be5f20a5b1cece0eb363f53d"
|
||||
integrity sha512-aD/Y1ZFHqw5pHg3HVQ50dLbfaAAcytS6sqLuhP51Dk3TSPdFb2VkSAa3mjrHifLIlGAtwQHJHINafAyqAne7vA==
|
||||
dependencies:
|
||||
get-caller-file "^1.0.2"
|
||||
normalize-path "^2.1.1"
|
||||
|
||||
moment@^2.22.1:
|
||||
version "2.23.0"
|
||||
resolved "https://registry.yarnpkg.com/moment/-/moment-2.23.0.tgz#759ea491ac97d54bac5ad776996e2a58cc1bc225"
|
||||
@ -3671,6 +3714,11 @@ path-key@^2.0.0, path-key@^2.0.1:
|
||||
resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40"
|
||||
integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=
|
||||
|
||||
path-parse@^1.0.6:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c"
|
||||
integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==
|
||||
|
||||
path-to-regexp@0.1.7:
|
||||
version "0.1.7"
|
||||
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c"
|
||||
@ -4181,6 +4229,13 @@ resolve-url@^0.2.1:
|
||||
resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a"
|
||||
integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=
|
||||
|
||||
resolve@^1.3.2:
|
||||
version "1.9.0"
|
||||
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.9.0.tgz#a14c6fdfa8f92a7df1d996cb7105fa744658ea06"
|
||||
integrity sha512-TZNye00tI67lwYvzxCxHGjwTNlUV70io54/Ed4j6PscB8xVfuBJpRenI/o6dVk0cY0PYTY27AgCoGGxRnYuItQ==
|
||||
dependencies:
|
||||
path-parse "^1.0.6"
|
||||
|
||||
ret@~0.1.10:
|
||||
version "0.1.15"
|
||||
resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc"
|
||||
@ -4496,7 +4551,7 @@ source-map-resolve@^0.5.0:
|
||||
source-map-url "^0.4.0"
|
||||
urix "^0.1.0"
|
||||
|
||||
source-map-support@~0.5.6:
|
||||
source-map-support@^0.5.6, source-map-support@~0.5.6:
|
||||
version "0.5.10"
|
||||
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.10.tgz#2214080bc9d51832511ee2bab96e3c2f9353120c"
|
||||
integrity sha512-YfQ3tQFTK/yzlGJuX8pTwa4tifQj4QS2Mj7UegOu8jAz59MqIiMGPXxQhVQiIMNzayuUSF/jEuVnfFF5JqybmQ==
|
||||
@ -4582,6 +4637,11 @@ split-string@^3.0.1, split-string@^3.0.2:
|
||||
dependencies:
|
||||
extend-shallow "^3.0.0"
|
||||
|
||||
sprintf-js@~1.0.2:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
|
||||
integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=
|
||||
|
||||
sshpk@^1.7.0:
|
||||
version "1.16.0"
|
||||
resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.0.tgz#1d4963a2fbffe58050aa9084ca20be81741c07de"
|
||||
@ -4917,11 +4977,50 @@ ts-loader@^5.3.3:
|
||||
micromatch "^3.1.4"
|
||||
semver "^5.0.1"
|
||||
|
||||
tslib@^1.9.0:
|
||||
ts-node@^7.0.1:
|
||||
version "7.0.1"
|
||||
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-7.0.1.tgz#9562dc2d1e6d248d24bc55f773e3f614337d9baf"
|
||||
integrity sha512-BVwVbPJRspzNh2yfslyT1PSbl5uIk03EZlb493RKHN4qej/D06n1cEhjlOJG69oFsE7OT8XjpTUcYf6pKTLMhw==
|
||||
dependencies:
|
||||
arrify "^1.0.0"
|
||||
buffer-from "^1.1.0"
|
||||
diff "^3.1.0"
|
||||
make-error "^1.1.1"
|
||||
minimist "^1.2.0"
|
||||
mkdirp "^0.5.1"
|
||||
source-map-support "^0.5.6"
|
||||
yn "^2.0.0"
|
||||
|
||||
tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0:
|
||||
version "1.9.3"
|
||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286"
|
||||
integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==
|
||||
|
||||
tslint@^5.12.1:
|
||||
version "5.12.1"
|
||||
resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.12.1.tgz#8cec9d454cf8a1de9b0a26d7bdbad6de362e52c1"
|
||||
integrity sha512-sfodBHOucFg6egff8d1BvuofoOQ/nOeYNfbp7LDlKBcLNrL3lmS5zoiDGyOMdT7YsEXAwWpTdAHwOGOc8eRZAw==
|
||||
dependencies:
|
||||
babel-code-frame "^6.22.0"
|
||||
builtin-modules "^1.1.1"
|
||||
chalk "^2.3.0"
|
||||
commander "^2.12.1"
|
||||
diff "^3.2.0"
|
||||
glob "^7.1.1"
|
||||
js-yaml "^3.7.0"
|
||||
minimatch "^3.0.4"
|
||||
resolve "^1.3.2"
|
||||
semver "^5.3.0"
|
||||
tslib "^1.8.0"
|
||||
tsutils "^2.27.2"
|
||||
|
||||
tsutils@^2.27.2:
|
||||
version "2.29.0"
|
||||
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99"
|
||||
integrity sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==
|
||||
dependencies:
|
||||
tslib "^1.8.1"
|
||||
|
||||
tty-browserify@0.0.0:
|
||||
version "0.0.0"
|
||||
resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6"
|
||||
@ -4952,6 +5051,15 @@ typedarray@^0.0.6:
|
||||
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
|
||||
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
|
||||
|
||||
typescript-tslint-plugin@^0.2.1:
|
||||
version "0.2.1"
|
||||
resolved "https://registry.yarnpkg.com/typescript-tslint-plugin/-/typescript-tslint-plugin-0.2.1.tgz#6a0361cd311bdc9dcec2e70c8a54cab16829e47f"
|
||||
integrity sha512-j0Tn/2GlAwnaklSNMOZRNpv96j6IWkQF6RuTJ5WowfNlgdYqnJpSaVFwT22INwJiPDDGKNe/aATT0qkU0pWM4w==
|
||||
dependencies:
|
||||
minimatch "^3.0.4"
|
||||
mock-require "^3.0.2"
|
||||
vscode-languageserver "^5.1.0"
|
||||
|
||||
typescript@^3.2.2:
|
||||
version "3.2.2"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.2.2.tgz#fe8101c46aa123f8353523ebdcf5730c2ae493e5"
|
||||
@ -5135,6 +5243,37 @@ vm-browserify@0.0.4:
|
||||
dependencies:
|
||||
indexof "0.0.1"
|
||||
|
||||
vscode-jsonrpc@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-4.0.0.tgz#a7bf74ef3254d0a0c272fab15c82128e378b3be9"
|
||||
integrity sha512-perEnXQdQOJMTDFNv+UF3h1Y0z4iSiaN9jIlb0OqIYgosPCZGYh/MCUlkFtV2668PL69lRDO32hmvL2yiidUYg==
|
||||
|
||||
vscode-languageserver-protocol@3.14.1:
|
||||
version "3.14.1"
|
||||
resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.14.1.tgz#b8aab6afae2849c84a8983d39a1cf742417afe2f"
|
||||
integrity sha512-IL66BLb2g20uIKog5Y2dQ0IiigW0XKrvmWiOvc0yXw80z3tMEzEnHjaGAb3ENuU7MnQqgnYJ1Cl2l9RvNgDi4g==
|
||||
dependencies:
|
||||
vscode-jsonrpc "^4.0.0"
|
||||
vscode-languageserver-types "3.14.0"
|
||||
|
||||
vscode-languageserver-types@3.14.0:
|
||||
version "3.14.0"
|
||||
resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.14.0.tgz#d3b5952246d30e5241592b6dde8280e03942e743"
|
||||
integrity sha512-lTmS6AlAlMHOvPQemVwo3CezxBp0sNB95KNPkqp3Nxd5VFEnuG1ByM0zlRWos0zjO3ZWtkvhal0COgiV1xIA4A==
|
||||
|
||||
vscode-languageserver@^5.1.0:
|
||||
version "5.2.1"
|
||||
resolved "https://registry.yarnpkg.com/vscode-languageserver/-/vscode-languageserver-5.2.1.tgz#0d2feddd33f92aadf5da32450df498d52f6f14eb"
|
||||
integrity sha512-GuayqdKZqAwwaCUjDvMTAVRPJOp/SLON3mJ07eGsx/Iq9HjRymhKWztX41rISqDKhHVVyFM+IywICyZDla6U3A==
|
||||
dependencies:
|
||||
vscode-languageserver-protocol "3.14.1"
|
||||
vscode-uri "^1.0.6"
|
||||
|
||||
vscode-uri@^1.0.6:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-1.0.6.tgz#6b8f141b0bbc44ad7b07e94f82f168ac7608ad4d"
|
||||
integrity sha512-sLI2L0uGov3wKVb9EB+vIQBl9tVP90nqRvxSoJ35vI3NjxE8jfsE5DSOhWgSunHSZmKS4OCi2jrtfxK7uyp2ww==
|
||||
|
||||
watchpack@^1.5.0:
|
||||
version "1.6.0"
|
||||
resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.6.0.tgz#4bc12c2ebe8aa277a71f1d3f14d685c7b446cd00"
|
||||
@ -5472,3 +5611,8 @@ yargs@^7.0.0:
|
||||
which-module "^1.0.0"
|
||||
y18n "^3.2.1"
|
||||
yargs-parser "^5.0.0"
|
||||
|
||||
yn@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/yn/-/yn-2.0.0.tgz#e5adabc8acf408f6385fc76495684c88e6af689a"
|
||||
integrity sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=
|
||||
|
Loading…
Reference in New Issue
Block a user