summaryrefslogtreecommitdiff
path: root/js/deno.ts
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2019-09-02 17:07:11 -0400
committerGitHub <noreply@github.com>2019-09-02 17:07:11 -0400
commitd43b43ca781b025b9a6a54827ea3ef193972ef24 (patch)
tree84173b6a653802a41c23145dd3b2048d9075e2a4 /js/deno.ts
parent56508f113d9fe61ffcce4cbbb85e3d6961888e1d (diff)
Refactor snapshot build (#2825)
Instead of using core/snapshot_creator.rs, instead two crates are introduced which allow building the snapshot during build.rs. Rollup is removed and replaced with our own bundler. This removes the Node build dependency. Modules in //js now use Deno-style imports with file extensions, rather than Node style extensionless imports. This improves incremental build time when changes are made to //js files by about 40 seconds.
Diffstat (limited to 'js/deno.ts')
-rw-r--r--js/deno.ts90
1 files changed, 54 insertions, 36 deletions
diff --git a/js/deno.ts b/js/deno.ts
index 65a93c467..efccb7741 100644
--- a/js/deno.ts
+++ b/js/deno.ts
@@ -1,8 +1,8 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
// Public deno module.
-export { noColor, pid, env, exit, isTTY, execPath, homeDir } from "./os";
-export { chdir, cwd } from "./dir";
+export { env, exit, isTTY, execPath, homeDir } from "./os.ts";
+export { chdir, cwd } from "./dir.ts";
export {
File,
open,
@@ -18,7 +18,7 @@ export {
seekSync,
close,
OpenMode
-} from "./files";
+} from "./files.ts";
export {
EOF,
copy,
@@ -37,40 +37,46 @@ export {
WriteSeeker,
ReadWriteCloser,
ReadWriteSeeker
-} from "./io";
-export { Buffer, readAll, readAllSync, writeAll, writeAllSync } from "./buffer";
-export { mkdirSync, mkdir } from "./mkdir";
+} from "./io.ts";
+export {
+ Buffer,
+ readAll,
+ readAllSync,
+ writeAll,
+ writeAllSync
+} from "./buffer.ts";
+export { mkdirSync, mkdir } from "./mkdir.ts";
export {
makeTempDirSync,
makeTempDir,
MakeTempDirOptions
-} from "./make_temp_dir";
-export { chmodSync, chmod } from "./chmod";
-export { chownSync, chown } from "./chown";
-export { utimeSync, utime } from "./utime";
-export { removeSync, remove, RemoveOption } from "./remove";
-export { renameSync, rename } from "./rename";
-export { readFileSync, readFile } from "./read_file";
-export { readDirSync, readDir } from "./read_dir";
-export { copyFileSync, copyFile } from "./copy_file";
-export { readlinkSync, readlink } from "./read_link";
-export { statSync, lstatSync, stat, lstat } from "./stat";
-export { linkSync, link } from "./link";
-export { symlinkSync, symlink } from "./symlink";
-export { writeFileSync, writeFile, WriteFileOptions } from "./write_file";
-export { applySourceMap } from "./error_stack";
-export { ErrorKind, DenoError } from "./errors";
+} from "./make_temp_dir.ts";
+export { chmodSync, chmod } from "./chmod.ts";
+export { chownSync, chown } from "./chown.ts";
+export { utimeSync, utime } from "./utime.ts";
+export { removeSync, remove, RemoveOption } from "./remove.ts";
+export { renameSync, rename } from "./rename.ts";
+export { readFileSync, readFile } from "./read_file.ts";
+export { readDirSync, readDir } from "./read_dir.ts";
+export { copyFileSync, copyFile } from "./copy_file.ts";
+export { readlinkSync, readlink } from "./read_link.ts";
+export { statSync, lstatSync, stat, lstat } from "./stat.ts";
+export { linkSync, link } from "./link.ts";
+export { symlinkSync, symlink } from "./symlink.ts";
+export { writeFileSync, writeFile, WriteFileOptions } from "./write_file.ts";
+export { applySourceMap } from "./error_stack.ts";
+export { ErrorKind, DenoError } from "./errors.ts";
export {
permissions,
revokePermission,
Permission,
Permissions
-} from "./permissions";
-export { truncateSync, truncate } from "./truncate";
-export { FileInfo } from "./file_info";
-export { connect, dial, listen, Listener, Conn } from "./net";
-export { metrics, Metrics } from "./metrics";
-export { resources } from "./resources";
+} from "./permissions.ts";
+export { truncateSync, truncate } from "./truncate.ts";
+export { FileInfo } from "./file_info.ts";
+export { connect, dial, listen, Listener, Conn } from "./net.ts";
+export { metrics, Metrics } from "./metrics.ts";
+export { resources } from "./resources.ts";
export {
kill,
run,
@@ -78,23 +84,35 @@ export {
Process,
ProcessStatus,
Signal
-} from "./process";
-export { inspect, customInspect } from "./console";
-export { build, platform, OperatingSystem, Arch } from "./build";
-export { version } from "./version";
+} from "./process.ts";
+export { inspect, customInspect } from "./console.ts";
+export { build, platform, OperatingSystem, Arch } from "./build.ts";
+export { version } from "./version.ts";
export const args: string[] = [];
// These are internal Deno APIs. We are marking them as internal so they do not
// appear in the runtime type library.
/** @internal */
-export { core } from "./core";
+export { core } from "./core.ts";
/** @internal */
-export { setPrepareStackTrace } from "./error_stack";
+export { setPrepareStackTrace } from "./error_stack.ts";
// TODO Don't expose Console nor stringifyArgs.
/** @internal */
-export { Console, stringifyArgs } from "./console";
+export { Console, stringifyArgs } from "./console.ts";
// TODO Don't expose DomIterableMixin.
/** @internal */
-export { DomIterableMixin } from "./mixins/dom_iterable";
+export { DomIterableMixin } from "./mixins/dom_iterable.ts";
+
+/** The current process id of the runtime. */
+export let pid: number;
+
+/** Reflects the NO_COLOR environment variable: https://no-color.org/ */
+export let noColor: boolean;
+
+// TODO(ry) This should not be exposed to Deno.
+export function _setGlobals(pid_: number, noColor_: boolean): void {
+ pid = pid_;
+ noColor = noColor_;
+}