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
上级 da27bc0f
......@@ -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",
......
{
"name": "@coder/electron-browser",
"description": "A browser implementation of Electron's API.",
"main": "src/index.ts",
"devDependencies": {
"electron": "^4.0.1"
}
}
此差异已折叠。
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();
});
}
/**
......
import { CP } from "@coder/server";
import { client } from "./client";
export = new CP(client);
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;
}
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;
}
}
......
import { FS } from "@coder/server";
import { client } from "./client";
export = new FS(client);
import { Net } from "@coder/server";
export = new Net();
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";
/**
......
{
"name": "@coder/node-browser",
"description": "A browser implementation of async Node APIs.",
"main": "src/index.ts"
}
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;
此差异已折叠。
import { bashCommand, escapePath, isBrowserEnvironment } from "./util";
export { bashCommand, escapePath, isBrowserEnvironment };
// 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]);
}
}
}
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
{
"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"
},
......
{
"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);
......
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);
}
}
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));
}
}
......@@ -27,44 +27,46 @@ class Server extends net.Server {
}
// tslint:disable only-arrow-functions
function connect(): net.Socket {
throw new Error("not implemented");
}
type NodeNet = typeof net;
function createConnection(): net.Socket {
throw new Error("not implemented");
}
/**
* Implementation of net for the browser.
*/
export class Net implements NodeNet {
function isIP(_input: string): number {
throw new Error("not implemented");
}
public get Socket(): typeof net.Socket {
return Socket;
}
function isIPv4(_input: string): boolean {
throw new Error("not implemented");
}
public get Server(): typeof net.Server {
return Server;
}
function isIPv6(_input: string): boolean {
throw new Error("not implemented");
}
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();
}
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;
/**
* 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));
};
/**
* 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, "'\\''")}'`;
};
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);
......
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();
});
});
});
});
\ No newline at end of file
{
"name": "@coder/rules",
"description": "Custom linting rules.",
"scripts": {
"build": "tsc -p ."
}
}
# 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=
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"));
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;
}
此差异已折叠。
......@@ -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"),
......
......@@ -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=
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册