diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2019-03-11 20:34:48 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-11 20:34:48 -0400 |
commit | ae4405d747f8a990e1dd31b7bb1166ca7fad9921 (patch) | |
tree | 9655b016219bb0264698f8066224ed4fc64b1b4f /js | |
parent | 8828bb8c0e743d9ac2b13a144ea4565d6d2ea7fc (diff) |
Make some renames in js/build.ts (#1912)
* Replace Deno.OSType enum with Deno.OperatingSystem type alias
* Add arm64 to supported CPU architectures
* add type alias for cpu arch Deno.Arch
Diffstat (limited to 'js')
-rw-r--r-- | js/build.ts | 23 | ||||
-rw-r--r-- | js/deno.ts | 2 |
2 files changed, 11 insertions, 14 deletions
diff --git a/js/build.ts b/js/build.ts index e883cdba0..6866e42a2 100644 --- a/js/build.ts +++ b/js/build.ts @@ -1,33 +1,30 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. +export type OperatingSystem = "mac" | "win" | "linux"; + +export type Arch = "x64" | "arm64"; + // Do not add unsupported platforms. /** Build related information */ export interface BuildInfo { - /** The operating system CPU architecture. */ - arch: "x64"; + /** The CPU architecture. */ + arch: Arch; - /** The operating system platform. */ - os: OSType; + /** The operating system. */ + os: OperatingSystem; /** The arguments passed to GN during build. See `gn help buildargs`. */ args: string; } -/** The operating system platform. */ -export enum OSType { - mac = "mac", - win = "win", - linux = "linux" -} - // 'build' is injected by rollup.config.js at compile time. export const build: BuildInfo = { - /* eslint-disable @typescript-eslint/no-explicit-any */ // These string will be replaced by rollup + /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ arch: `ROLLUP_REPLACE_ARCH` as any, + /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ os: `ROLLUP_REPLACE_OS` as any, args: `ROLLUP_REPLACE_GN_ARGS` - /* eslint-enable @typescript-eslint/no-explicit-any */ }; // TODO(kevinkassimo): deprecate Deno.platform diff --git a/js/deno.ts b/js/deno.ts index a9f5f2018..d663ca55c 100644 --- a/js/deno.ts +++ b/js/deno.ts @@ -63,7 +63,7 @@ export { metrics, Metrics } from "./metrics"; export { resources } from "./resources"; export { run, RunOptions, Process, ProcessStatus } from "./process"; export { inspect } from "./console"; -export { build, platform, OSType } from "./build"; +export { build, platform, OperatingSystem, Arch } from "./build"; export { version } from "./version"; export const args: string[] = []; |