2019-01-01 19:58:40 -05:00
|
|
|
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
|
2019-09-03 22:12:21 -04:00
|
|
|
use serde_json;
|
2018-12-13 16:16:58 -05:00
|
|
|
pub const DENO: &str = env!("CARGO_PKG_VERSION");
|
2018-08-17 16:34:30 -04:00
|
|
|
|
2018-11-05 01:21:21 -05:00
|
|
|
pub fn v8() -> &'static str {
|
2019-03-30 19:30:40 -04:00
|
|
|
deno::v8_version()
|
2018-08-17 16:34:30 -04:00
|
|
|
}
|
2019-09-03 22:12:21 -04:00
|
|
|
|
|
|
|
pub fn typescript() -> String {
|
|
|
|
// TODO: By using include_str! we are including the package.json into
|
|
|
|
// the deno binary using serde to decode it at runtime. This is suboptimal
|
|
|
|
// in space and time. We need to extract the TypeScript version at compile
|
|
|
|
// time instead. This will be easier after #2608.
|
|
|
|
let data = include_str!("../node_modules/typescript/package.json");
|
|
|
|
let pkg: serde_json::Value = serde_json::from_str(data).unwrap();
|
|
|
|
pkg["version"].as_str().unwrap().to_string()
|
|
|
|
}
|