0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-04 01:44:26 -05:00

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
This commit is contained in:
Ryan Dahl 2019-03-11 20:34:48 -04:00 committed by GitHub
parent 8828bb8c0e
commit ae4405d747
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 14 deletions

View file

@ -1,33 +1,30 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. // 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. // Do not add unsupported platforms.
/** Build related information */ /** Build related information */
export interface BuildInfo { export interface BuildInfo {
/** The operating system CPU architecture. */ /** The CPU architecture. */
arch: "x64"; arch: Arch;
/** The operating system platform. */ /** The operating system. */
os: OSType; os: OperatingSystem;
/** The arguments passed to GN during build. See `gn help buildargs`. */ /** The arguments passed to GN during build. See `gn help buildargs`. */
args: string; 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. // 'build' is injected by rollup.config.js at compile time.
export const build: BuildInfo = { export const build: BuildInfo = {
/* eslint-disable @typescript-eslint/no-explicit-any */
// These string will be replaced by rollup // These string will be replaced by rollup
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
arch: `ROLLUP_REPLACE_ARCH` as any, arch: `ROLLUP_REPLACE_ARCH` as any,
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
os: `ROLLUP_REPLACE_OS` as any, os: `ROLLUP_REPLACE_OS` as any,
args: `ROLLUP_REPLACE_GN_ARGS` args: `ROLLUP_REPLACE_GN_ARGS`
/* eslint-enable @typescript-eslint/no-explicit-any */
}; };
// TODO(kevinkassimo): deprecate Deno.platform // TODO(kevinkassimo): deprecate Deno.platform

View file

@ -63,7 +63,7 @@ export { metrics, Metrics } from "./metrics";
export { resources } from "./resources"; export { resources } from "./resources";
export { run, RunOptions, Process, ProcessStatus } from "./process"; export { run, RunOptions, Process, ProcessStatus } from "./process";
export { inspect } from "./console"; export { inspect } from "./console";
export { build, platform, OSType } from "./build"; export { build, platform, OperatingSystem, Arch } from "./build";
export { version } from "./version"; export { version } from "./version";
export const args: string[] = []; export const args: string[] = [];