summaryrefslogtreecommitdiff
path: root/cli/build.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-01-14 09:36:19 -0500
committerGitHub <noreply@github.com>2023-01-14 09:36:19 -0500
commit1712a88e6998d058c11ee213dcf15cccc563a9b0 (patch)
tree91d76080bbeb6ad55740d3d622edb8b984f0d88f /cli/build.rs
parent429ccff6574edc5a7052e4dbaa19075dbb844de3 (diff)
refactor(tsc): do not store some typescript declaration file text in multiple places (#17410)
Diffstat (limited to 'cli/build.rs')
-rw-r--r--cli/build.rs58
1 files changed, 12 insertions, 46 deletions
diff --git a/cli/build.rs b/cli/build.rs
index 24898a7a1..4d82630e5 100644
--- a/cli/build.rs
+++ b/cli/build.rs
@@ -94,6 +94,7 @@ mod ts {
"es2018.regexp",
"es2019.array",
"es2019",
+ "es2019.intl",
"es2019.object",
"es2019.string",
"es2019.symbol",
@@ -116,6 +117,7 @@ mod ts {
"es2022.error",
"es2022.intl",
"es2022.object",
+ "es2022.sharedmemory",
"es2022.string",
"esnext",
"esnext.array",
@@ -150,6 +152,15 @@ mod ts {
build_libs.push(op_lib.to_owned());
}
+ // used in the tests to verify that after snapshotting it has the same number
+ // of lib files loaded and hasn't included any ones lazily loaded from Rust
+ std::fs::write(
+ PathBuf::from(env::var_os("OUT_DIR").unwrap())
+ .join("lib_file_names.json"),
+ serde_json::to_string(&build_libs).unwrap(),
+ )
+ .unwrap();
+
#[op]
fn op_build_info(state: &mut OpState) -> Value {
let build_specifier = "asset:///bootstrap.ts";
@@ -196,7 +207,7 @@ mod ts {
// we need a basic file to send to tsc to warm it up.
if args.specifier == build_specifier {
Ok(json!({
- "data": r#"console.log("hello deno!");"#,
+ "data": r#"Deno.writeTextFile("hello.txt", "hello deno!");"#,
"version": "1",
// this corresponds to `ts.ScriptKind.TypeScript`
"scriptKind": 3
@@ -423,51 +434,6 @@ fn main() {
println!("cargo:rustc-env=TS_VERSION={}", ts::version());
println!("cargo:rerun-if-env-changed=TS_VERSION");
- println!(
- "cargo:rustc-env=DENO_CONSOLE_LIB_PATH={}",
- deno_console::get_declaration().display()
- );
- println!(
- "cargo:rustc-env=DENO_URL_LIB_PATH={}",
- deno_url::get_declaration().display()
- );
- println!(
- "cargo:rustc-env=DENO_WEB_LIB_PATH={}",
- deno_web::get_declaration().display()
- );
- println!(
- "cargo:rustc-env=DENO_FETCH_LIB_PATH={}",
- deno_fetch::get_declaration().display()
- );
- println!(
- "cargo:rustc-env=DENO_WEBGPU_LIB_PATH={}",
- deno_webgpu_get_declaration().display()
- );
- println!(
- "cargo:rustc-env=DENO_WEBSOCKET_LIB_PATH={}",
- deno_websocket::get_declaration().display()
- );
- println!(
- "cargo:rustc-env=DENO_WEBSTORAGE_LIB_PATH={}",
- deno_webstorage::get_declaration().display()
- );
- println!(
- "cargo:rustc-env=DENO_CACHE_LIB_PATH={}",
- deno_cache::get_declaration().display()
- );
- println!(
- "cargo:rustc-env=DENO_CRYPTO_LIB_PATH={}",
- deno_crypto::get_declaration().display()
- );
- println!(
- "cargo:rustc-env=DENO_BROADCAST_CHANNEL_LIB_PATH={}",
- deno_broadcast_channel::get_declaration().display()
- );
- println!(
- "cargo:rustc-env=DENO_NET_LIB_PATH={}",
- deno_net::get_declaration().display()
- );
-
println!("cargo:rustc-env=TARGET={}", env::var("TARGET").unwrap());
println!("cargo:rustc-env=PROFILE={}", env::var("PROFILE").unwrap());