mirror of
https://github.com/denoland/std.git
synced 2024-11-22 04:59:05 +00:00
0.114.0
This commit is contained in:
parent
792e9a037e
commit
9d6d654a6c
41
Releases.md
41
Releases.md
@ -1,3 +1,44 @@
|
|||||||
|
### 0.114.0 / 2021.11.09
|
||||||
|
|
||||||
|
- BREAKING(http): update `serve`, add `serveListener`, deprecate
|
||||||
|
`listenAndServe` (#1506)
|
||||||
|
- BREAKING(std/collections): deprecate findLast (#1532)
|
||||||
|
- feat(http/file_server): add streaming support, fix empty file handling (#1479)
|
||||||
|
- feat(node): add readline module (#1453)
|
||||||
|
- feat(node): process.on and process.off for signals (#1466)
|
||||||
|
- feat(node/_fs): Add watchFile function (#1483)
|
||||||
|
- feat(node/http): HTTP Server/Response improvements (#1448)
|
||||||
|
- feat(node/querystring): implement qs.unescapeBuffer (#1516)
|
||||||
|
- feat(node): mock 'vm' module (#1501)
|
||||||
|
- feat(node): os.cpus() (#1500)
|
||||||
|
- feat(node): process.execArgv (#1499)
|
||||||
|
- fix(collections): prevent calling `Object.prototype.__proto__` in
|
||||||
|
collections/deep_merge.ts (#1504)
|
||||||
|
- fix(collections): remove default selector for `findSingle` (#1232)
|
||||||
|
- fix(crypto/digest): always return the underlying ArrayBuffer (#1515)
|
||||||
|
- fix(http/file_server): don't require --allow-read for showing help message
|
||||||
|
(#1521)
|
||||||
|
- fix(node): //@ts-ignore Error.captureStackTrace (#1533)
|
||||||
|
- fix(node): add proper module.export for 'module' (#1497)
|
||||||
|
- fix(node): child_process stdio for binary data (#1477)
|
||||||
|
- fix(node): fix flaky downloadFile test (#1460)
|
||||||
|
- fix(node): fix process.arch (#1498)
|
||||||
|
- fix(node): fix string representation of node errors (#1470)
|
||||||
|
- fix(node): isAlreadyClosed for child_process (#1469)
|
||||||
|
- fix(node/_tools): Better error and output logging (#1492)
|
||||||
|
- fix(node/_util): Deno.permissions is no longer called unless it exists.
|
||||||
|
(#1520)
|
||||||
|
- fix(node/events): enable remaining tests for EventEmitter (#1489)
|
||||||
|
- fix(node/events): make EventEmitter's public methods enumerable (#1530)
|
||||||
|
- fix(node/process): warn on not implemented event instead of throw (#1510)
|
||||||
|
- fix(node/querystring): improve `querystring.parse` (#1473)
|
||||||
|
- fix(node/querystring): Improve querystring.stringify (#1488)
|
||||||
|
- fix(node/querystring/stringify): invalid surrogate pair throws URIError
|
||||||
|
(#1505)
|
||||||
|
- fix(node/querystring/stringify): Remove initialValue (#1494)
|
||||||
|
- fix(signal): update signal module for canary API change (#1468)
|
||||||
|
- fix(testing): show special characters in assertEquals results (#1450)
|
||||||
|
|
||||||
### 0.113.0 / 2021.10.25
|
### 0.113.0 / 2021.10.25
|
||||||
|
|
||||||
- feat(collections/running_reduce): support `currentIndex` (#1431)
|
- feat(collections/running_reduce): support `currentIndex` (#1431)
|
||||||
|
@ -175,7 +175,10 @@ function isNonNullObject(value: unknown): value is NonNullable<object> {
|
|||||||
|
|
||||||
function getKeys<T extends object>(record: T): Array<keyof T> {
|
function getKeys<T extends object>(record: T): Array<keyof T> {
|
||||||
const ret = Object.getOwnPropertySymbols(record) as Array<keyof T>;
|
const ret = Object.getOwnPropertySymbols(record) as Array<keyof T>;
|
||||||
filterInPlace(ret, (key) => record.propertyIsEnumerable(key));
|
filterInPlace(
|
||||||
|
ret,
|
||||||
|
(key) => Object.prototype.propertyIsEnumerable.call(record, key),
|
||||||
|
);
|
||||||
ret.push(...(Object.keys(record) as Array<keyof T>));
|
ret.push(...(Object.keys(record) as Array<keyof T>));
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -301,7 +301,7 @@ Deno.test("serveWithUnorthodoxFilename", async function () {
|
|||||||
assert(res.headers.has("access-control-allow-origin"));
|
assert(res.headers.has("access-control-allow-origin"));
|
||||||
assert(res.headers.has("access-control-allow-headers"));
|
assert(res.headers.has("access-control-allow-headers"));
|
||||||
assertEquals(res.status, 200);
|
assertEquals(res.status, 200);
|
||||||
let _ = await res.text();
|
const _ = await res.text();
|
||||||
res = await fetch("http://localhost:4507/testdata/test%20file.txt");
|
res = await fetch("http://localhost:4507/testdata/test%20file.txt");
|
||||||
assert(res.headers.has("access-control-allow-origin"));
|
assert(res.headers.has("access-control-allow-origin"));
|
||||||
assert(res.headers.has("access-control-allow-headers"));
|
assert(res.headers.has("access-control-allow-headers"));
|
||||||
|
@ -2449,10 +2449,10 @@ export class ERR_INVALID_MODULE_SPECIFIER extends NodeTypeError {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class ERR_INVALID_PACKAGE_TARGET extends NodeError {
|
export class ERR_INVALID_PACKAGE_TARGET extends NodeError {
|
||||||
// deno-lint-ignore no-explicit-any
|
|
||||||
constructor(
|
constructor(
|
||||||
pkgPath: string,
|
pkgPath: string,
|
||||||
key: string,
|
key: string,
|
||||||
|
// deno-lint-ignore no-explicit-any
|
||||||
target: any,
|
target: any,
|
||||||
isImport?: boolean,
|
isImport?: boolean,
|
||||||
base?: string,
|
base?: string,
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// deno-lint-ignore-file
|
||||||
import foo from "./foo.js";
|
import foo from "./foo.js";
|
||||||
|
|
||||||
console.log(require);
|
console.log(require);
|
||||||
|
@ -61,7 +61,7 @@ for await (const file of dir) {
|
|||||||
]);
|
]);
|
||||||
test.close();
|
test.close();
|
||||||
|
|
||||||
let stderr = decoder.decode(rawStderr);
|
const stderr = decoder.decode(rawStderr);
|
||||||
if (rawStderr.length) console.error(stderr);
|
if (rawStderr.length) console.error(stderr);
|
||||||
if (rawOutput.length) console.log(decoder.decode(rawOutput));
|
if (rawOutput.length) console.log(decoder.decode(rawOutput));
|
||||||
|
|
||||||
|
@ -181,7 +181,9 @@ export class EventEmitter {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
err = inspect(err);
|
err = inspect(err);
|
||||||
} catch {}
|
} catch {
|
||||||
|
// pass
|
||||||
|
}
|
||||||
throw new ERR_UNHANDLED_ERROR(err);
|
throw new ERR_UNHANDLED_ERROR(err);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
|
||||||
|
// deno-lint-ignore-file no-var
|
||||||
import processModule from "./process.ts";
|
import processModule from "./process.ts";
|
||||||
import { Buffer as bufferModule } from "./buffer.ts";
|
import { Buffer as bufferModule } from "./buffer.ts";
|
||||||
import timers from "./timers.ts";
|
import timers from "./timers.ts";
|
||||||
|
@ -1371,7 +1371,7 @@ export function resolveMainPath(main: string): undefined | string {
|
|||||||
// Note extension resolution for the main entry point can be deprecated in a
|
// Note extension resolution for the main entry point can be deprecated in a
|
||||||
// future major.
|
// future major.
|
||||||
// Module._findPath is monkey-patchable here.
|
// Module._findPath is monkey-patchable here.
|
||||||
let mainPath = Module._findPath(path.resolve(main), [], true);
|
const mainPath = Module._findPath(path.resolve(main), [], true);
|
||||||
if (!mainPath) {
|
if (!mainPath) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -58,9 +58,9 @@ function throwInvalidSubpath(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// deno-lint-ignore no-explicit-any
|
|
||||||
function throwInvalidPackageTarget(
|
function throwInvalidPackageTarget(
|
||||||
subpath: string,
|
subpath: string,
|
||||||
|
// deno-lint-ignore no-explicit-any
|
||||||
target: any,
|
target: any,
|
||||||
packageJSONUrl: string,
|
packageJSONUrl: string,
|
||||||
internal: boolean,
|
internal: boolean,
|
||||||
@ -155,31 +155,37 @@ function legacyMainResolve(
|
|||||||
} else if (
|
} else if (
|
||||||
fileExists(guess = new URL(`./${packageConfig.main}.js`, packageJSONUrl))
|
fileExists(guess = new URL(`./${packageConfig.main}.js`, packageJSONUrl))
|
||||||
) {
|
) {
|
||||||
|
// pass
|
||||||
} else if (
|
} else if (
|
||||||
fileExists(
|
fileExists(
|
||||||
guess = new URL(`./${packageConfig.main}.json`, packageJSONUrl),
|
guess = new URL(`./${packageConfig.main}.json`, packageJSONUrl),
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
|
// pass
|
||||||
} else if (
|
} else if (
|
||||||
fileExists(
|
fileExists(
|
||||||
guess = new URL(`./${packageConfig.main}.node`, packageJSONUrl),
|
guess = new URL(`./${packageConfig.main}.node`, packageJSONUrl),
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
|
// pass
|
||||||
} else if (
|
} else if (
|
||||||
fileExists(
|
fileExists(
|
||||||
guess = new URL(`./${packageConfig.main}/index.js`, packageJSONUrl),
|
guess = new URL(`./${packageConfig.main}/index.js`, packageJSONUrl),
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
|
// pass
|
||||||
} else if (
|
} else if (
|
||||||
fileExists(
|
fileExists(
|
||||||
guess = new URL(`./${packageConfig.main}/index.json`, packageJSONUrl),
|
guess = new URL(`./${packageConfig.main}/index.json`, packageJSONUrl),
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
|
// pass
|
||||||
} else if (
|
} else if (
|
||||||
fileExists(
|
fileExists(
|
||||||
guess = new URL(`./${packageConfig.main}/index.node`, packageJSONUrl),
|
guess = new URL(`./${packageConfig.main}/index.node`, packageJSONUrl),
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
|
// pass
|
||||||
} else guess = undefined;
|
} else guess = undefined;
|
||||||
if (guess) {
|
if (guess) {
|
||||||
// TODO(bartlomieju):
|
// TODO(bartlomieju):
|
||||||
@ -189,11 +195,14 @@ function legacyMainResolve(
|
|||||||
}
|
}
|
||||||
// Fallthrough.
|
// Fallthrough.
|
||||||
}
|
}
|
||||||
if (fileExists(guess = new URL("./index.js", packageJSONUrl))) {}
|
if (fileExists(guess = new URL("./index.js", packageJSONUrl))) {
|
||||||
// So fs.
|
// pass
|
||||||
else if (fileExists(guess = new URL("./index.json", packageJSONUrl))) {}
|
} // So fs.
|
||||||
else if (fileExists(guess = new URL("./index.node", packageJSONUrl))) {}
|
else if (fileExists(guess = new URL("./index.json", packageJSONUrl))) {
|
||||||
else guess = undefined;
|
// pass
|
||||||
|
} else if (fileExists(guess = new URL("./index.node", packageJSONUrl))) {
|
||||||
|
// pass
|
||||||
|
} else guess = undefined;
|
||||||
if (guess) {
|
if (guess) {
|
||||||
// TODO(bartlomieju):
|
// TODO(bartlomieju):
|
||||||
// emitLegacyIndexDeprecation(guess, packageJSONUrl, base, packageConfig.main);
|
// emitLegacyIndexDeprecation(guess, packageJSONUrl, base, packageConfig.main);
|
||||||
@ -316,6 +325,8 @@ function packageResolve(
|
|||||||
// Cross-platform root check.
|
// Cross-platform root check.
|
||||||
} while (packageJSONPath.length !== lastPath.length);
|
} while (packageJSONPath.length !== lastPath.length);
|
||||||
|
|
||||||
|
// TODO(bartlomieju): this is false positive
|
||||||
|
// deno-lint-ignore no-unreachable
|
||||||
throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base));
|
throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -345,7 +356,9 @@ function resolvePackageTargetString(
|
|||||||
try {
|
try {
|
||||||
new URL(target);
|
new URL(target);
|
||||||
isURL = true;
|
isURL = true;
|
||||||
} catch {}
|
} catch {
|
||||||
|
// pass
|
||||||
|
}
|
||||||
if (!isURL) {
|
if (!isURL) {
|
||||||
const exportTarget = pattern
|
const exportTarget = pattern
|
||||||
? target.replace(patternRegEx, () => subpath)
|
? target.replace(patternRegEx, () => subpath)
|
||||||
@ -389,9 +402,9 @@ function isArrayIndex(key: string): boolean {
|
|||||||
return keyNum >= 0 && keyNum < 0xFFFF_FFFF;
|
return keyNum >= 0 && keyNum < 0xFFFF_FFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
// deno-lint-ignore no-explicit-any
|
|
||||||
function resolvePackageTarget(
|
function resolvePackageTarget(
|
||||||
packageJSONUrl: string,
|
packageJSONUrl: string,
|
||||||
|
// deno-lint-ignore no-explicit-any
|
||||||
target: any,
|
target: any,
|
||||||
subpath: string,
|
subpath: string,
|
||||||
packageSubpath: string,
|
packageSubpath: string,
|
||||||
@ -502,7 +515,7 @@ export function packageExportsResolve(
|
|||||||
packageConfig: PackageConfig,
|
packageConfig: PackageConfig,
|
||||||
base: string,
|
base: string,
|
||||||
conditions: Set<string>,
|
conditions: Set<string>,
|
||||||
// @ts-ignore
|
// @ts-ignore `URL` needs to be forced due to control flow
|
||||||
): URL {
|
): URL {
|
||||||
let exports = packageConfig.exports;
|
let exports = packageConfig.exports;
|
||||||
if (isConditionalExportsMainSugar(exports, packageJSONUrl, base)) {
|
if (isConditionalExportsMainSugar(exports, packageJSONUrl, base)) {
|
||||||
@ -601,7 +614,6 @@ export interface PackageConfig {
|
|||||||
exports?: any;
|
exports?: any;
|
||||||
// deno-lint-ignore no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
imports?: any;
|
imports?: any;
|
||||||
// deno-lint-ignore no-explicit-any
|
|
||||||
type?: string;
|
type?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -647,7 +659,7 @@ function getPackageConfig(
|
|||||||
throw new ERR_INVALID_PACKAGE_CONFIG(
|
throw new ERR_INVALID_PACKAGE_CONFIG(
|
||||||
path,
|
path,
|
||||||
(base ? `"${specifier}" from ` : "") + fileURLToPath(base || specifier),
|
(base ? `"${specifier}" from ` : "") + fileURLToPath(base || specifier),
|
||||||
// @ts-ignore
|
// @ts-ignore there's no assertion for type and `error` is thus `unknown`
|
||||||
error.message,
|
error.message,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -711,7 +723,7 @@ export function packageImportsResolve(
|
|||||||
name: string,
|
name: string,
|
||||||
base: string,
|
base: string,
|
||||||
conditions: Set<string>,
|
conditions: Set<string>,
|
||||||
// @ts-ignore
|
// @ts-ignore `URL` needs to be forced due to control flow
|
||||||
): URL {
|
): URL {
|
||||||
if (
|
if (
|
||||||
name === "#" || name.startsWith("#/") ||
|
name === "#" || name.startsWith("#/") ||
|
||||||
@ -794,8 +806,8 @@ export function packageImportsResolve(
|
|||||||
throwImportNotDefined(name, packageJSONUrl, base);
|
throwImportNotDefined(name, packageJSONUrl, base);
|
||||||
}
|
}
|
||||||
|
|
||||||
// deno-lint-ignore no-explicit-any
|
|
||||||
function isConditionalExportsMainSugar(
|
function isConditionalExportsMainSugar(
|
||||||
|
// deno-lint-ignore no-explicit-any
|
||||||
exports: any,
|
exports: any,
|
||||||
packageJSONUrl: string,
|
packageJSONUrl: string,
|
||||||
base: string,
|
base: string,
|
||||||
|
@ -383,9 +383,10 @@ class Process extends EventEmitter {
|
|||||||
nextTick = nextTick;
|
nextTick = nextTick;
|
||||||
|
|
||||||
/** https://nodejs.org/api/process.html#process_process_events */
|
/** https://nodejs.org/api/process.html#process_process_events */
|
||||||
//deno-lint-ignore ban-types
|
|
||||||
on(event: "exit", listener: (code: number) => void): this;
|
on(event: "exit", listener: (code: number) => void): this;
|
||||||
|
// deno-lint-ignore no-explicit-any
|
||||||
on(event: string, listener: (...args: any[]) => void): this;
|
on(event: string, listener: (...args: any[]) => void): this;
|
||||||
|
// deno-lint-ignore ban-types
|
||||||
on(event: typeof notImplementedEvents[number], listener: Function): this;
|
on(event: typeof notImplementedEvents[number], listener: Function): this;
|
||||||
// deno-lint-ignore no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
on(event: string, listener: (...args: any[]) => void): this {
|
on(event: string, listener: (...args: any[]) => void): this {
|
||||||
@ -400,9 +401,10 @@ class Process extends EventEmitter {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
//deno-lint-ignore ban-types
|
|
||||||
off(event: "exit", listener: (code: number) => void): this;
|
off(event: "exit", listener: (code: number) => void): this;
|
||||||
|
// deno-lint-ignore no-explicit-any
|
||||||
off(event: string, listener: (...args: any[]) => void): this;
|
off(event: string, listener: (...args: any[]) => void): this;
|
||||||
|
// deno-lint-ignore ban-types
|
||||||
off(event: typeof notImplementedEvents[number], listener: Function): this;
|
off(event: typeof notImplementedEvents[number], listener: Function): this;
|
||||||
// deno-lint-ignore no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
off(event: string, listener: (...args: any[]) => void): this {
|
off(event: string, listener: (...args: any[]) => void): this {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
// deno-lint-ignore no-explicit-any
|
// deno-lint-ignore-file no-explicit-any
|
||||||
|
|
||||||
import { notImplemented } from "./_utils.ts";
|
import { notImplemented } from "./_utils.ts";
|
||||||
|
|
||||||
|
@ -5,4 +5,4 @@
|
|||||||
* the cli's API is stable. In the future when std becomes stable, likely we
|
* the cli's API is stable. In the future when std becomes stable, likely we
|
||||||
* will match versions with cli as we have in the past.
|
* will match versions with cli as we have in the past.
|
||||||
*/
|
*/
|
||||||
export const VERSION = "0.113.0";
|
export const VERSION = "0.114.0";
|
||||||
|
Loading…
Reference in New Issue
Block a user