diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2019-09-15 18:36:27 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-15 18:36:27 -0400 |
commit | c9ef182886cc07d35a5b27fb89163d8cf21a6a47 (patch) | |
tree | 6ba1605daa7e9e8cac3f6b926374086906f571b5 /cli/version.rs | |
parent | 1d305c2ac785af6b28649f2023d5008e390eeca0 (diff) |
Make deno_cli installable via crates.io (#2946)
- Fixes cargo publish on deno_typescript, deno_cli_snapshots, and
deno_cli.
- Combines cli_snapshots and js into one directory.
- Extracts TS version at compile time rather than runtime
- Bumps version awkwardly - it was necessary to test end-to-end
publishing. Sorry.
- Adds git submodule deno_typescript/typescript
Diffstat (limited to 'cli/version.rs')
-rw-r--r-- | cli/version.rs | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/cli/version.rs b/cli/version.rs index 2c98a96d4..44e394d18 100644 --- a/cli/version.rs +++ b/cli/version.rs @@ -1,17 +1,7 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. -use serde_json; pub const DENO: &str = env!("CARGO_PKG_VERSION"); +pub const TYPESCRIPT: &str = deno_cli_snapshots::TS_VERSION; pub fn v8() -> &'static str { deno::v8_version() } - -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() -} |