Skip to content

Commit

Permalink
deps: update deps (#39)
Browse files Browse the repository at this point in the history
* deps: update deps

* deps: update deno_std to 0.106.0
  • Loading branch information
Mesteery authored Aug 28, 2021
1 parent 6cbc8eb commit 53ae999
Show file tree
Hide file tree
Showing 24 changed files with 50 additions and 267 deletions.
4 changes: 2 additions & 2 deletions nodelibs/deno/assert.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from 'https://deno.land/std@0.105.0/node/assert.ts';
export { default } from 'https://deno.land/std@0.105.0/node/assert.ts';
export * from 'https://deno.land/std@0.106.0/node/assert.ts';
export { default } from 'https://deno.land/std@0.106.0/node/assert.ts';
4 changes: 2 additions & 2 deletions nodelibs/deno/buffer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export * from 'https://deno.land/std@0.105.0/node/buffer.ts';
import { default as buffer } from 'https://deno.land/std@0.105.0/node/buffer.ts';
export * from 'https://deno.land/std@0.106.0/node/buffer.ts';
import { default as buffer } from 'https://deno.land/std@0.106.0/node/buffer.ts';
export const kMaxLength = 4294967296;
buffer.kMaxLength = kMaxLength;
export default buffer;
4 changes: 2 additions & 2 deletions nodelibs/deno/child_process.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from 'https://deno.land/std@0.105.0/node/child_process.ts';
export { default } from 'https://deno.land/std@0.105.0/node/child_process.ts';
export * from 'https://deno.land/std@0.106.0/node/child_process.ts';
export { default } from 'https://deno.land/std@0.106.0/node/child_process.ts';
4 changes: 2 additions & 2 deletions nodelibs/deno/console.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from 'https://deno.land/std@0.105.0/node/console.ts';
export { default } from 'https://deno.land/std@0.105.0/node/console.ts';
export * from 'https://deno.land/std@0.106.0/node/console.ts';
export { default } from 'https://deno.land/std@0.106.0/node/console.ts';
4 changes: 2 additions & 2 deletions nodelibs/deno/crypto.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// TODO: update this when deno_std/node will export webcrypto (when Node.js Web Crypto API is stable)
export * from 'https://deno.land/std@0.105.0/node/crypto.ts';
export * from 'https://deno.land/std@0.106.0/node/crypto.ts';
export const webcrypto = globalThis.crypto;
import crypto from 'https://deno.land/std@0.105.0/node/crypto.ts';
import crypto from 'https://deno.land/std@0.106.0/node/crypto.ts';
export default {
...crypto,
webcrypto: globalThis.crypto,
Expand Down
4 changes: 2 additions & 2 deletions nodelibs/deno/events.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from 'https://deno.land/std@0.105.0/node/events.ts';
export { default } from 'https://deno.land/std@0.105.0/node/events.ts';
export * from 'https://deno.land/std@0.106.0/node/events.ts';
export { default } from 'https://deno.land/std@0.106.0/node/events.ts';
6 changes: 3 additions & 3 deletions nodelibs/deno/fs.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { notImplemented } from 'https://deno.land/std@0.105.0/node/_utils.ts';
export * from 'https://deno.land/std@0.105.0/node/fs.ts';
import fs from 'https://deno.land/std@0.105.0/node/fs.ts';
import { notImplemented } from 'https://deno.land/std@0.106.0/node/_utils.ts';
export * from 'https://deno.land/std@0.106.0/node/fs.ts';
import fs from 'https://deno.land/std@0.106.0/node/fs.ts';
import * as promises from './fs/promises.ts';

export { promises }
Expand Down
4 changes: 2 additions & 2 deletions nodelibs/deno/module.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from 'https://deno.land/std@0.105.0/node/module.ts';
export { default } from 'https://deno.land/std@0.105.0/node/module.ts';
export * from 'https://deno.land/std@0.106.0/node/module.ts';
export { default } from 'https://deno.land/std@0.106.0/node/module.ts';
4 changes: 2 additions & 2 deletions nodelibs/deno/os.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from 'https://deno.land/std@0.105.0/node/os.ts';
export { default } from 'https://deno.land/std@0.105.0/node/os.ts';
export * from 'https://deno.land/std@0.106.0/node/os.ts';
export { default } from 'https://deno.land/std@0.106.0/node/os.ts';
4 changes: 2 additions & 2 deletions nodelibs/deno/path.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from 'https://deno.land/std@0.105.0/node/path.ts';
export { default } from 'https://deno.land/std@0.105.0/node/path.ts';
export * from 'https://deno.land/std@0.106.0/node/path.ts';
export { default } from 'https://deno.land/std@0.106.0/node/path.ts';
2 changes: 1 addition & 1 deletion nodelibs/deno/path/posix.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { posix } from 'https://deno.land/std@0.105.0/node/path.ts';
import { posix } from 'https://deno.land/std@0.106.0/node/path.ts';

export const {
resolve,
Expand Down
2 changes: 1 addition & 1 deletion nodelibs/deno/path/win32.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { win32 } from 'https://deno.land/std@0.105.0/node/path.ts';
import { win32 } from 'https://deno.land/std@0.106.0/node/path.ts';

export const {
resolve,
Expand Down
11 changes: 2 additions & 9 deletions nodelibs/deno/perf_hooks.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
export * from from 'https://deno.land/std@0.105.0/node/perf_hooks.ts';
// TODO: update this when deno_std/node will default-export PerformanceEntry
import performance, {
PerformanceEntry,
} from 'https://deno.land/std@0.105.0/node/perf_hooks.ts';
export default {
...performance,
PerformanceEntry,
} as typeof performance & { PerformanceEntry: typeof PerformanceEntry };
export * from 'https://deno.land/std@0.106.0/node/perf_hooks.ts';
export { default } from 'https://deno.land/std@0.106.0/node/perf_hooks.ts';
214 changes: 2 additions & 212 deletions nodelibs/deno/process.ts
Original file line number Diff line number Diff line change
@@ -1,212 +1,2 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
import { notImplemented } from 'https://deno.land/std@0.105.0/node/_utils.ts';
import { fileURLToPath } from 'https://deno.land/std@0.105.0/node/url.ts';
import { Readable, Writable } from 'https://deno.land/std@0.105.0/node/stream.ts';
import { Buffer } from 'https://deno.land/std@0.105.0/node/buffer.ts';

/** https://nodejs.org/api/process.html#process_process_arch */
export const arch = Deno.build.arch;

/** https://nodejs.org/api/process.html#process_process_chdir_directory */
export const chdir = Deno.chdir;

/** https://nodejs.org/api/process.html#process_process_cwd */
export const cwd = Deno.cwd;

/** https://nodejs.org/api/process.html#process_process_exit_code */
export const exit = Deno.exit;

/** https://nodejs.org/api/process.html#process_process_pid */
export const pid = Deno.pid;

/** https://nodejs.org/api/process.html#process_process_platform */
export const platform = Deno.build.os === "windows" ? "win32" : Deno.build.os;

/** https://nodejs.org/api/process.html#process_process_version */
export const version = `v14.17.3`;

/** https://nodejs.org/api/process.html#process_process_versions */
export const versions = {
node: '14.17.3',
/*
uv
zlib
brotli
ares
modules
nghttp2
napi
llhttp
openssl
cldr
icu
tz
unicode
*/
...Deno.version,
};

/** https://nodejs.org/api/process.html#process_process_nexttick_callback_args */
export function nextTick(this: unknown, cb: () => void): void;
export function nextTick<T extends Array<unknown>>(
this: unknown,
cb: (...args: T) => void,
...args: T
): void;
export function nextTick<T extends Array<unknown>>(
this: unknown,
cb: (...args: T) => void,
...args: T
) {
if (args) {
queueMicrotask(() => cb.call(this, ...args));
} else {
queueMicrotask(cb);
}
}


interface _Readable extends Readable {
get isTTY(): boolean;
destroySoon: Readable['destroy'],
fd: number;
_isStdio: false | undefined
};

interface _Writable extends Writable {
get isTTY(): boolean;
get columns(): number;
get rows(): number
destroySoon: Writable['destroy'],
fd: number;
_isStdio: true,
};

// https://github.com/nodejs/node/blob/00738314828074243c9a52a228ab4c68b04259ef/lib/internal/bootstrap/switches/is_main_thread.js#L41
function createWritableStdioStream(writer: typeof Deno.stdout): _Writable {
const stream = new Writable({
write(buf: Uint8Array, enc: string, cb) {
writer.writeSync(buf instanceof Uint8Array ? buf : Buffer.from(buf, enc));
cb();
},
destroy(err, cb) {
cb(err);
this._undestroy();
if (!this._writableState.emitClose) {
queueMicrotask(() => this.emit('close'));
}
},
}) as _Writable;
stream.fd = writer.rid;
stream.destroySoon = stream.destroy;
stream._isStdio = true;
stream.once('close', () => writer.close());
Object.defineProperties(stream, {
columns: {
enumerable: true,
configurable: true,
get(): number {
return Deno.consoleSize(writer.rid).columns;
},
},
rows: {
enumerable: true,
configurable: true,
get(): number {
return Deno.consoleSize(writer.rid).rows;
},
},
isTTY: {
enumerable: true,
configurable: true,
get(): boolean {
return Deno.isatty(writer.rid);
},
},
});
return stream;
}

export const stdin = new Readable({
// @ts-ignore
read(this: Readable, size: number) {
const p = Buffer.alloc(size || 16 * 1024);
const length = Deno.stdin.readSync(p);
this.push(length === null ? null : p.slice(0, length));
}
}) as _Readable;
stdin.on('close', () => Deno.stdin.close());
stdin.fd = Deno.stdin.rid;
Object.defineProperty(stdin, 'isTTY', {
enumerable: true,
configurable: true,
get() {
return Deno.isatty(Deno.stdin.rid);
},
});

export const stderr = createWritableStdioStream(Deno.stderr);
export const stdout = createWritableStdioStream(Deno.stdout);

/** https://nodejs.org/api/process.html#process_process */
// @deprecated `import { process } from 'process'` for backwards compatibility with old deno versions
export const process = {
arch,
chdir,
cwd,
exit,
pid,
platform,
version,
versions,
stdin,
stderr,
stdout,
/** https://nodejs.org/api/process.html#process_process_events */
// on is not exported by node, it is only available within process:
// node --input-type=module -e "import { on } from 'process'; console.log(on)"
// deno-lint-ignore ban-types
on(_event: string, _callback: Function): void {
// TODO(rsp): to be implemented
notImplemented();
},

/** https://nodejs.org/api/process.html#process_process_argv */
get argv(): string[] {
// Getter delegates --allow-env and --allow-read until request
// Getter also allows the export Proxy instance to function as intended
return argv = [Deno.execPath(), Deno.mainModule.startsWith('file:') ? fileURLToPath(Deno.mainModule) : Deno.mainModule, ...Deno.args];
},

/** https://nodejs.org/api/process.html#process_process_env */
get env(): { [index: string]: string } {
// Getter delegates --allow-env and --allow-read until request
// Getter also allows the export Proxy instance to function as intended
return env = Deno.env.toObject();
},
nextTick,
};

/**
* https://nodejs.org/api/process.html#process_process_argv
* @example `import { argv } from './std/node/process.ts'; console.log(argv)`
*/
// Proxy delegates --allow-env and --allow-read to request time, even for exports
export let argv: any;

/**
* https://nodejs.org/api/process.html#process_process_env
* @example `import { env } from './std/node/process.ts'; console.log(env)`
*/
// Proxy delegates --allow-env and --allow-read to request time, even for exports
export let env: any;

// import process from './std/node/process.ts'
export default process;

Object.defineProperty(process, Symbol.toStringTag, {
enumerable: false,
writable: true,
configurable: false,
value: "process",
});
export * from 'https://deno.land/std@0.106.0/node/process.ts';
export { default } from 'https://deno.land/std@0.106.0/node/process.ts';
4 changes: 2 additions & 2 deletions nodelibs/deno/querystring.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from 'https://deno.land/std@0.105.0/node/querystring.ts';
export { default } from 'https://deno.land/std@0.105.0/node/querystring.ts';
export * from 'https://deno.land/std@0.106.0/node/querystring.ts';
export { default } from 'https://deno.land/std@0.106.0/node/querystring.ts';
4 changes: 2 additions & 2 deletions nodelibs/deno/stream.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from 'https://deno.land/std@0.105.0/node/stream.ts';
export { default } from 'https://deno.land/std@0.105.0/node/stream.ts';
export * from 'https://deno.land/std@0.106.0/node/stream.ts';
export { default } from 'https://deno.land/std@0.106.0/node/stream.ts';
4 changes: 2 additions & 2 deletions nodelibs/deno/string_decoder.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from 'https://deno.land/std@0.105.0/node/string_decoder.ts';
export { default } from 'https://deno.land/std@0.105.0/node/string_decoder.ts';
export * from 'https://deno.land/std@0.106.0/node/string_decoder.ts';
export { default } from 'https://deno.land/std@0.106.0/node/string_decoder.ts';
4 changes: 2 additions & 2 deletions nodelibs/deno/timers.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from 'https://deno.land/std@0.105.0/node/timers.ts';
export { default } from 'https://deno.land/std@0.105.0/node/timers.ts';
export * from 'https://deno.land/std@0.106.0/node/timers.ts';
export { default } from 'https://deno.land/std@0.106.0/node/timers.ts';
4 changes: 2 additions & 2 deletions nodelibs/deno/tty.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from 'https://deno.land/std@0.105.0/node/tty.ts';
export { default } from 'https://deno.land/std@0.105.0/node/tty.ts';
export * from 'https://deno.land/std@0.106.0/node/tty.ts';
export { default } from 'https://deno.land/std@0.106.0/node/tty.ts';
4 changes: 2 additions & 2 deletions nodelibs/deno/url.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from 'https://deno.land/std@0.105.0/node/url.ts';
export { default } from 'https://deno.land/std@0.105.0/node/url.ts';
export * from 'https://deno.land/std@0.106.0/node/url.ts';
export { default } from 'https://deno.land/std@0.106.0/node/url.ts';
4 changes: 2 additions & 2 deletions nodelibs/deno/util.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from 'https://deno.land/std@0.105.0/node/util.ts';
export { default } from 'https://deno.land/std@0.105.0/node/util.ts';
export * from 'https://deno.land/std@0.106.0/node/util.ts';
export { default } from 'https://deno.land/std@0.106.0/node/util.ts';
4 changes: 2 additions & 2 deletions nodelibs/deno/util/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { types } from 'https://deno.land/std@0.105.0/node/util.ts';
export { types as default } from 'https://deno.land/std@0.105.0/node/util.ts';
import { types } from 'https://deno.land/std@0.106.0/node/util.ts';
export { types as default } from 'https://deno.land/std@0.106.0/node/util.ts';

export const {
// isExternal,
Expand Down
4 changes: 2 additions & 2 deletions nodelibs/deno/worker_threads.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference lib="webworker"/>

import { resolve, toFileUrl } from 'https://deno.land/std@0.105.0/path/mod.ts';
import { EventEmitter } from 'https://deno.land/std@0.105.0/node/events.ts';
import { resolve, toFileUrl } from 'https://deno.land/std@0.106.0/path/mod.ts';
import { EventEmitter } from 'https://deno.land/std@0.106.0/node/events.ts';

function unimplemented(name: string) {
throw new Error(
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
"@jspm/plugin-rollup": "github:jspm/rollup-plugin-jspm#main",
"assert": "^2.0.0",
"browserify-zlib": "^0.2.0",
"buffer": "^6.0.2",
"buffer": "^6.0.3",
"console-browserify": "^1.2.0",
"constants-browserify": "^1.0.0",
"crypto-browserify": "^3.12.0",
"diagnostics_channel": "^1.0.0",
"domain-browser": "^4.19.0",
"domain-browser": "^4.22.0",
"events": "^3.2.0",
"glob": "^7.1.7",
"https-browserify": "^1.0.0",
Expand All @@ -26,10 +26,10 @@
"path-browserify": "^1.0.1",
"process": "^0.11.10",
"punycode": "^2.1.1",
"querystring": "^0.2.0",
"rollup": "^2.55.1",
"querystring": "^0.2.1",
"rollup": "^2.56.3",
"stream-browserify": "^3.0.0",
"stream-http": "^3.1.1",
"stream-http": "^3.2.0",
"string_decoder": "^1.3.0",
"timers-browserify": "^2.0.12",
"tty-browserify": "^0.0.1",
Expand Down

0 comments on commit 53ae999

Please sign in to comment.