-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(runtime): move std modules to a separate sub-folder and add …
…shell.ts entry file (#91)
- Loading branch information
Showing
24 changed files
with
167 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
/// <reference path="./types.d.ts" /> | ||
|
||
import { dzx } from "./src/cli/mod.ts"; | ||
|
||
if (import.meta.main) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/// <reference path="./types.d.ts" /> | ||
/// <reference path="./src/cli/globals.d.ts" /> | ||
|
||
import { initGlobals } from "./src/runtime/globals.ts"; | ||
import { initGlobals } from "./src/cli/globals.ts"; | ||
|
||
initGlobals(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from "./src/runtime/mod.ts"; | ||
export * from "./src/std/mod.ts"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./src/runtime/mod.ts"; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import * as std from "../std/mod.ts"; | ||
import * as runtime from "../runtime/mod.ts"; | ||
|
||
export function initGlobals() { | ||
Object.assign(self, std); | ||
Object.assign(self, runtime); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { isAbsolute, join } from "../deps.ts"; | ||
|
||
export function addProtocol(script: string): string { | ||
const hasProtocol: boolean = script.startsWith("http://") || | ||
script.startsWith("https://") || | ||
script.startsWith("file://"); | ||
|
||
if (!hasProtocol) { | ||
const filePath = isAbsolute(script) ? script : join(Deno.cwd(), script); | ||
|
||
script = "file://" + filePath; | ||
} | ||
|
||
return script; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,17 @@ | ||
export * as async from "https://deno.land/std@0.140.0/async/mod.ts"; | ||
export { | ||
type DebouncedFunction, | ||
type Deferred, | ||
deferred, | ||
type DelayOptions, | ||
} from "https://deno.land/std@0.140.0/async/mod.ts"; | ||
export * as path from "https://deno.land/std@0.140.0/path/mod.ts"; | ||
export type { | ||
FormatInputPathObject, | ||
GlobOptions, | ||
GlobToRegExpOptions, | ||
ParsedPath, | ||
} from "https://deno.land/std@0.140.0/path/mod.ts"; | ||
export * as io from "https://deno.land/std@0.140.0/io/mod.ts"; | ||
export { BufReader } from "https://deno.land/std@0.140.0/io/buffer.ts"; | ||
export type { | ||
ReadableStreamFromReaderOptions as IOReadableStreamFromReaderOptions, | ||
ReadLineResult, | ||
WritableStreamFromWriterOptions as IOWritableStreamFromWriterOptions, | ||
} from "https://deno.land/std@0.140.0/io/mod.ts"; | ||
export * as streams from "https://deno.land/std@0.140.0/streams/mod.ts"; | ||
export { writeAll } from "https://deno.land/std@0.140.0/streams/mod.ts"; | ||
export type { | ||
ReadableStreamFromReaderOptions, | ||
WritableStreamFromWriterOptions, | ||
} from "https://deno.land/std@0.140.0/streams/mod.ts"; | ||
export * as fs from "https://deno.land/std@0.140.0/fs/mod.ts"; | ||
export type { | ||
CopyOptions, | ||
ExpandGlobOptions, | ||
WalkEntry, | ||
WalkOptions, | ||
} from "https://deno.land/std@0.140.0/fs/mod.ts"; | ||
export * as log from "https://deno.land/std@0.140.0/log/mod.ts"; | ||
export type { | ||
FormatterFunction, | ||
HandlerOptions, | ||
LevelName, | ||
LogConfig, | ||
LogMode, | ||
} from "https://deno.land/std@0.140.0/log/mod.ts"; | ||
export * as flags from "https://deno.land/std@0.140.0/flags/mod.ts"; | ||
export type { | ||
Args, | ||
ParseOptions, | ||
} from "https://deno.land/std@0.140.0/flags/mod.ts"; | ||
export { concat } from "https://deno.land/std@0.140.0/bytes/mod.ts"; | ||
export { | ||
bold, | ||
brightBlue, | ||
brightYellow, | ||
red, | ||
white, | ||
} from "https://deno.land/std@0.140.0/fmt/colors.ts"; | ||
export { BufReader } from "https://deno.land/std@0.140.0/io/buffer.ts"; | ||
export { join, sep } from "https://deno.land/std@0.140.0/path/mod.ts"; | ||
export { colors } from "https://deno.land/x/cliffy@v0.24.2/ansi/colors.ts"; | ||
export { default as shq } from "https://esm.sh/shq@1.0.2"; | ||
export { concat } from "https://deno.land/std@0.140.0/bytes/mod.ts"; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { red } from "../deps.ts"; | ||
|
||
export interface DzxErrorOptions { | ||
// deno-lint-ignore ban-types | ||
context?: Function; | ||
} | ||
|
||
export function createError( | ||
message: string | Error, | ||
{ context }: DzxErrorOptions = {}, | ||
): Error { | ||
const err = message instanceof Error ? message : new Error(red(message)); | ||
|
||
if (context) { | ||
Error.captureStackTrace(err, context); | ||
} | ||
|
||
return err; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.