summaryrefslogtreecommitdiff
path: root/cli/js
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js')
-rw-r--r--cli/js/compiler.ts14
-rw-r--r--cli/js/compiler/api.ts (renamed from cli/js/compiler_api.ts)6
-rw-r--r--cli/js/compiler/bootstrap.ts (renamed from cli/js/compiler_bootstrap.ts)6
-rw-r--r--cli/js/compiler/bundler.ts (renamed from cli/js/compiler_bundler.ts)10
-rw-r--r--cli/js/compiler/host.ts (renamed from cli/js/compiler_host.ts)10
-rw-r--r--cli/js/compiler/imports.ts (renamed from cli/js/compiler_imports.ts)16
-rw-r--r--cli/js/compiler/sourcefile.ts (renamed from cli/js/compiler_sourcefile.ts)7
-rw-r--r--cli/js/compiler/ts_global.d.ts (renamed from cli/js/ts_global.d.ts)0
-rw-r--r--cli/js/compiler/type_directives.ts (renamed from cli/js/compiler_type_directives.ts)0
-rw-r--r--cli/js/compiler/util.ts (renamed from cli/js/compiler_util.ts)20
-rw-r--r--cli/js/deno.ts4
-rw-r--r--cli/js/globals.ts8
-rw-r--r--cli/js/mock_builtin.js2
-rw-r--r--cli/js/repl.ts2
-rw-r--r--cli/js/symbols.ts2
-rw-r--r--cli/js/testing.ts2
-rw-r--r--cli/js/web/README.md8
-rw-r--r--cli/js/web/console.ts (renamed from cli/js/console.ts)10
-rw-r--r--cli/js/web/console_table.ts (renamed from cli/js/console_table.ts)4
-rw-r--r--cli/js/web/headers.ts2
-rw-r--r--cli/js/web/performance.ts (renamed from cli/js/performance.ts)2
-rw-r--r--cli/js/web/timers.ts (renamed from cli/js/timers.ts)6
-rw-r--r--cli/js/web/url.ts2
-rw-r--r--cli/js/web/workers.ts (renamed from cli/js/workers.ts)10
24 files changed, 74 insertions, 79 deletions
diff --git a/cli/js/compiler.ts b/cli/js/compiler.ts
index 80ea16fb0..ed156ef0a 100644
--- a/cli/js/compiler.ts
+++ b/cli/js/compiler.ts
@@ -11,23 +11,23 @@
// to properly setup runtime.
// NOTE: this import has side effects!
-import "./ts_global.d.ts";
+import "./compiler/ts_global.d.ts";
-import { TranspileOnlyResult } from "./compiler_api.ts";
-import { TS_SNAPSHOT_PROGRAM } from "./compiler_bootstrap.ts";
-import { setRootExports } from "./compiler_bundler.ts";
+import { TranspileOnlyResult } from "./compiler/api.ts";
+import { TS_SNAPSHOT_PROGRAM } from "./compiler/bootstrap.ts";
+import { setRootExports } from "./compiler/bundler.ts";
import {
CompilerHostTarget,
defaultBundlerOptions,
defaultRuntimeCompileOptions,
defaultTranspileOptions,
Host
-} from "./compiler_host.ts";
+} from "./compiler/host.ts";
import {
processImports,
processLocalImports,
resolveModules
-} from "./compiler_imports.ts";
+} from "./compiler/imports.ts";
import {
createWriteFile,
CompilerRequestType,
@@ -36,7 +36,7 @@ import {
WriteFileState,
processConfigureResponse,
base64ToUint8Array
-} from "./compiler_util.ts";
+} from "./compiler/util.ts";
import { Diagnostic, DiagnosticItem } from "./diagnostics.ts";
import { fromTypeScriptDiagnostic } from "./diagnostics_util.ts";
import { assert } from "./util.ts";
diff --git a/cli/js/compiler_api.ts b/cli/js/compiler/api.ts
index 8282f0717..e6e1d5eee 100644
--- a/cli/js/compiler_api.ts
+++ b/cli/js/compiler/api.ts
@@ -3,9 +3,9 @@
// This file contains the runtime APIs which will dispatch work to the internal
// compiler within Deno.
-import { DiagnosticItem } from "./diagnostics.ts";
-import * as util from "./util.ts";
-import * as runtimeCompilerOps from "./ops/runtime_compiler.ts";
+import { DiagnosticItem } from "../diagnostics.ts";
+import * as util from "../util.ts";
+import * as runtimeCompilerOps from "../ops/runtime_compiler.ts";
/** A specific subset TypeScript compiler options that can be supported by
* the Deno TypeScript compiler. */
diff --git a/cli/js/compiler_bootstrap.ts b/cli/js/compiler/bootstrap.ts
index c502e2e01..d4642d041 100644
--- a/cli/js/compiler_bootstrap.ts
+++ b/cli/js/compiler/bootstrap.ts
@@ -1,8 +1,8 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
-import { CompilerHostTarget, Host } from "./compiler_host.ts";
-import { ASSETS } from "./compiler_sourcefile.ts";
-import { getAsset } from "./compiler_util.ts";
+import { CompilerHostTarget, Host } from "./host.ts";
+import { ASSETS } from "./sourcefile.ts";
+import { getAsset } from "./util.ts";
// NOTE: target doesn't really matter here,
// this is in fact a mock host created just to
diff --git a/cli/js/compiler_bundler.ts b/cli/js/compiler/bundler.ts
index 3a9d3a212..ab987a7fc 100644
--- a/cli/js/compiler_bundler.ts
+++ b/cli/js/compiler/bundler.ts
@@ -1,12 +1,8 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
-import { SYSTEM_LOADER } from "./compiler_bootstrap.ts";
-import {
- commonPath,
- normalizeString,
- CHAR_FORWARD_SLASH
-} from "./compiler_util.ts";
-import { assert } from "./util.ts";
+import { SYSTEM_LOADER } from "./bootstrap.ts";
+import { commonPath, normalizeString, CHAR_FORWARD_SLASH } from "./util.ts";
+import { assert } from "../util.ts";
/** Local state of what the root exports are of a root module. */
let rootExports: string[] | undefined;
diff --git a/cli/js/compiler_host.ts b/cli/js/compiler/host.ts
index 413ffa6e1..8032d83b3 100644
--- a/cli/js/compiler_host.ts
+++ b/cli/js/compiler/host.ts
@@ -1,10 +1,10 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
-import { ASSETS, MediaType, SourceFile } from "./compiler_sourcefile.ts";
-import { OUT_DIR, WriteFileCallback, getAsset } from "./compiler_util.ts";
-import { cwd } from "./ops/fs/dir.ts";
-import { assert, notImplemented } from "./util.ts";
-import * as util from "./util.ts";
+import { ASSETS, MediaType, SourceFile } from "./sourcefile.ts";
+import { OUT_DIR, WriteFileCallback, getAsset } from "./util.ts";
+import { cwd } from "../ops/fs/dir.ts";
+import { assert, notImplemented } from "../util.ts";
+import * as util from "../util.ts";
/** Specifies the target that the host should use to inform the TypeScript
* compiler of what types should be used to validate the program against. */
diff --git a/cli/js/compiler_imports.ts b/cli/js/compiler/imports.ts
index a5f3cd17e..077303b61 100644
--- a/cli/js/compiler_imports.ts
+++ b/cli/js/compiler/imports.ts
@@ -1,15 +1,11 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
-import {
- MediaType,
- SourceFile,
- SourceFileJson
-} from "./compiler_sourcefile.ts";
-import { normalizeString, CHAR_FORWARD_SLASH } from "./compiler_util.ts";
-import { cwd } from "./ops/fs/dir.ts";
-import { assert } from "./util.ts";
-import * as util from "./util.ts";
-import * as compilerOps from "./ops/compiler.ts";
+import { MediaType, SourceFile, SourceFileJson } from "./sourcefile.ts";
+import { normalizeString, CHAR_FORWARD_SLASH } from "./util.ts";
+import { cwd } from "../ops/fs/dir.ts";
+import { assert } from "../util.ts";
+import * as util from "../util.ts";
+import * as compilerOps from "../ops/compiler.ts";
/** Resolve a path to the final path segment passed. */
function resolvePath(...pathSegments: string[]): string {
diff --git a/cli/js/compiler_sourcefile.ts b/cli/js/compiler/sourcefile.ts
index cc7d4aa3e..cfa09cde3 100644
--- a/cli/js/compiler_sourcefile.ts
+++ b/cli/js/compiler/sourcefile.ts
@@ -1,10 +1,7 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
-import {
- getMappedModuleName,
- parseTypeDirectives
-} from "./compiler_type_directives.ts";
-import { assert, log } from "./util.ts";
+import { getMappedModuleName, parseTypeDirectives } from "./type_directives.ts";
+import { assert, log } from "../util.ts";
// Warning! The values in this enum are duplicated in `cli/msg.rs`
// Update carefully!
diff --git a/cli/js/ts_global.d.ts b/cli/js/compiler/ts_global.d.ts
index 7b9d84c7a..7b9d84c7a 100644
--- a/cli/js/ts_global.d.ts
+++ b/cli/js/compiler/ts_global.d.ts
diff --git a/cli/js/compiler_type_directives.ts b/cli/js/compiler/type_directives.ts
index 0f4ce932c..0f4ce932c 100644
--- a/cli/js/compiler_type_directives.ts
+++ b/cli/js/compiler/type_directives.ts
diff --git a/cli/js/compiler_util.ts b/cli/js/compiler/util.ts
index 3cc661d6c..c1afbd581 100644
--- a/cli/js/compiler_util.ts
+++ b/cli/js/compiler/util.ts
@@ -1,15 +1,15 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
-import { bold, cyan, yellow } from "./colors.ts";
-import { CompilerOptions } from "./compiler_api.ts";
-import { buildBundle } from "./compiler_bundler.ts";
-import { ConfigureResponse, Host } from "./compiler_host.ts";
-import { SourceFile } from "./compiler_sourcefile.ts";
-import { atob, TextEncoder } from "./web/text_encoding.ts";
-import * as compilerOps from "./ops/compiler.ts";
-import * as util from "./util.ts";
-import { assert } from "./util.ts";
-import { writeFileSync } from "./write_file.ts";
+import { bold, cyan, yellow } from "../colors.ts";
+import { CompilerOptions } from "./api.ts";
+import { buildBundle } from "./bundler.ts";
+import { ConfigureResponse, Host } from "./host.ts";
+import { SourceFile } from "./sourcefile.ts";
+import { atob, TextEncoder } from "../web/text_encoding.ts";
+import * as compilerOps from "../ops/compiler.ts";
+import * as util from "../util.ts";
+import { assert } from "../util.ts";
+import { writeFileSync } from "../write_file.ts";
/** Type for the write fall callback that allows delegation from the compiler
* host on writing files. */
diff --git a/cli/js/deno.ts b/cli/js/deno.ts
index f0115f261..4f56bb7d1 100644
--- a/cli/js/deno.ts
+++ b/cli/js/deno.ts
@@ -11,8 +11,8 @@ export {
export { build, OperatingSystem, Arch } from "./build.ts";
export { chmodSync, chmod } from "./ops/fs/chmod.ts";
export { chownSync, chown } from "./ops/fs/chown.ts";
-export { transpileOnly, compile, bundle } from "./compiler_api.ts";
-export { inspect } from "./console.ts";
+export { transpileOnly, compile, bundle } from "./compiler/api.ts";
+export { inspect } from "./web/console.ts";
export { copyFileSync, copyFile } from "./ops/fs/copy_file.ts";
export {
Diagnostic,
diff --git a/cli/js/globals.ts b/cli/js/globals.ts
index 7033afd92..8d122878f 100644
--- a/cli/js/globals.ts
+++ b/cli/js/globals.ts
@@ -1,7 +1,7 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
import * as blob from "./web/blob.ts";
-import * as consoleTypes from "./console.ts";
+import * as consoleTypes from "./web/console.ts";
import * as customEvent from "./web/custom_event.ts";
import * as domTypes from "./web/dom_types.ts";
import * as domFile from "./web/dom_file.ts";
@@ -11,11 +11,11 @@ import * as formData from "./web/form_data.ts";
import * as fetchTypes from "./web/fetch.ts";
import * as headers from "./web/headers.ts";
import * as textEncoding from "./web/text_encoding.ts";
-import * as timers from "./timers.ts";
+import * as timers from "./web/timers.ts";
import * as url from "./web/url.ts";
import * as urlSearchParams from "./web/url_search_params.ts";
-import * as workers from "./workers.ts";
-import * as performanceUtil from "./performance.ts";
+import * as workers from "./web/workers.ts";
+import * as performanceUtil from "./web/performance.ts";
import * as request from "./web/request.ts";
// These imports are not exposed and therefore are fine to just import the
diff --git a/cli/js/mock_builtin.js b/cli/js/mock_builtin.js
deleted file mode 100644
index 0f5bd2a44..000000000
--- a/cli/js/mock_builtin.js
+++ /dev/null
@@ -1,2 +0,0 @@
-// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
-export default undefined;
diff --git a/cli/js/repl.ts b/cli/js/repl.ts
index 8325159dd..581834cfd 100644
--- a/cli/js/repl.ts
+++ b/cli/js/repl.ts
@@ -1,7 +1,7 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
import { exit } from "./ops/os.ts";
import { core } from "./core.ts";
-import { stringifyArgs } from "./console.ts";
+import { stringifyArgs } from "./web/console.ts";
import { startRepl, readline } from "./ops/repl.ts";
import { close } from "./ops/resources.ts";
diff --git a/cli/js/symbols.ts b/cli/js/symbols.ts
index 4a8a6abfe..9d8928cf2 100644
--- a/cli/js/symbols.ts
+++ b/cli/js/symbols.ts
@@ -1,6 +1,6 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
import { internalSymbol } from "./internals.ts";
-import { customInspect } from "./console.ts";
+import { customInspect } from "./web/console.ts";
/** Special Deno related symbols. */
export const symbols = {
diff --git a/cli/js/testing.ts b/cli/js/testing.ts
index f851b8fcc..f1318f0ce 100644
--- a/cli/js/testing.ts
+++ b/cli/js/testing.ts
@@ -1,7 +1,7 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
import { red, green, bgRed, gray, italic } from "./colors.ts";
import { exit } from "./ops/os.ts";
-import { Console } from "./console.ts";
+import { Console } from "./web/console.ts";
function formatDuration(time = 0): string {
const timeStr = `(${time}ms)`;
diff --git a/cli/js/web/README.md b/cli/js/web/README.md
new file mode 100644
index 000000000..865f4e0fb
--- /dev/null
+++ b/cli/js/web/README.md
@@ -0,0 +1,8 @@
+# Deno Web APIs
+
+This directory facilities Web APIs that are available in Deno.
+
+Please note, that some of implementations might not be completely aligned with
+specification.
+
+Some of the Web APIs are using ops under the hood, eg. `console`, `performance`.
diff --git a/cli/js/console.ts b/cli/js/web/console.ts
index 60329ab00..601d5fd09 100644
--- a/cli/js/console.ts
+++ b/cli/js/web/console.ts
@@ -1,10 +1,10 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
-import { isTypedArray } from "./util.ts";
-import { TypedArray } from "./types.ts";
-import { TextEncoder } from "./web/text_encoding.ts";
-import { File, stdout } from "./files.ts";
+import { isTypedArray } from "../util.ts";
+import { TypedArray } from "../types.ts";
+import { TextEncoder } from "./text_encoding.ts";
+import { File, stdout } from "../files.ts";
import { cliTable } from "./console_table.ts";
-import { exposeForTest } from "./internals.ts";
+import { exposeForTest } from "../internals.ts";
type ConsoleContext = Set<unknown>;
type ConsoleOptions = Partial<{
diff --git a/cli/js/console_table.ts b/cli/js/web/console_table.ts
index 882f1243b..276d77f1d 100644
--- a/cli/js/console_table.ts
+++ b/cli/js/web/console_table.ts
@@ -1,8 +1,8 @@
// Copyright Joyent, Inc. and other Node contributors. MIT license.
// Forked from Node's lib/internal/cli_table.js
-import { TextEncoder } from "./web/text_encoding.ts";
-import { hasOwnProperty } from "./util.ts";
+import { TextEncoder } from "./text_encoding.ts";
+import { hasOwnProperty } from "../util.ts";
const encoder = new TextEncoder();
diff --git a/cli/js/web/headers.ts b/cli/js/web/headers.ts
index 65d52cacd..652dd2de6 100644
--- a/cli/js/web/headers.ts
+++ b/cli/js/web/headers.ts
@@ -2,7 +2,7 @@
import * as domTypes from "./dom_types.ts";
import { DomIterableMixin } from "./dom_iterable.ts";
import { requiredArguments } from "../util.ts";
-import { customInspect } from "../console.ts";
+import { customInspect } from "./console.ts";
// From node-fetch
// Copyright (c) 2016 David Frank. MIT License.
diff --git a/cli/js/performance.ts b/cli/js/web/performance.ts
index 7aaa35952..cb4daa846 100644
--- a/cli/js/performance.ts
+++ b/cli/js/web/performance.ts
@@ -1,5 +1,5 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
-import { now as opNow } from "./ops/timers.ts";
+import { now as opNow } from "../ops/timers.ts";
export class Performance {
/** Returns a current time from Deno's start in milliseconds.
diff --git a/cli/js/timers.ts b/cli/js/web/timers.ts
index 844a0b204..806b7c160 100644
--- a/cli/js/timers.ts
+++ b/cli/js/web/timers.ts
@@ -1,7 +1,7 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
-import { assert } from "./util.ts";
-import { startGlobalTimer, stopGlobalTimer } from "./ops/timers.ts";
-import { RBTree } from "./rbtree.ts";
+import { assert } from "../util.ts";
+import { startGlobalTimer, stopGlobalTimer } from "../ops/timers.ts";
+import { RBTree } from "../rbtree.ts";
const { console } = globalThis;
diff --git a/cli/js/web/url.ts b/cli/js/web/url.ts
index 076ec81f1..6ef6b367c 100644
--- a/cli/js/web/url.ts
+++ b/cli/js/web/url.ts
@@ -2,7 +2,7 @@
import * as urlSearchParams from "./url_search_params.ts";
import * as domTypes from "./dom_types.ts";
import { getRandomValues } from "../ops/get_random_values.ts";
-import { customInspect } from "../console.ts";
+import { customInspect } from "./console.ts";
interface URLParts {
protocol: string;
diff --git a/cli/js/workers.ts b/cli/js/web/workers.ts
index 818c0ecf4..256090d57 100644
--- a/cli/js/workers.ts
+++ b/cli/js/web/workers.ts
@@ -5,15 +5,15 @@ import {
hostTerminateWorker,
hostPostMessage,
hostGetMessage
-} from "./ops/worker_host.ts";
-import { log } from "./util.ts";
-import { TextDecoder, TextEncoder } from "./web/text_encoding.ts";
+} from "../ops/worker_host.ts";
+import { log } from "../util.ts";
+import { TextDecoder, TextEncoder } from "./text_encoding.ts";
/*
import { blobURLMap } from "./web/url.ts";
import { blobBytesWeakMap } from "./web/blob.ts";
*/
-import { Event } from "./web/event.ts";
-import { EventTarget } from "./web/event_target.ts";
+import { Event } from "./event.ts";
+import { EventTarget } from "./event_target.ts";
const encoder = new TextEncoder();
const decoder = new TextDecoder();