diff --git a/CHANGELOG.md b/CHANGELOG.md index 1419827ae..124aad641 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ - Hovering over a function definition will now display the function signature, or the type of the hovered argument. - Use `import type` for importing types from typescript declarations. +- Use `.d.mts` extension for typescript declarations to match `.mjs`. ## v0.30.4 - 2023-07-26 diff --git a/compiler-core/src/codegen.rs b/compiler-core/src/codegen.rs index b35f1428e..f8d6dc932 100644 --- a/compiler-core/src/codegen.rs +++ b/compiler-core/src/codegen.rs @@ -181,7 +181,7 @@ impl<'a> JavaScript<'a> { tracing::debug!("Generated JS prelude"); if self.typescript == TypeScriptDeclarations::Emit { writer.write( - &self.output_directory.join("gleam.d.ts"), + &self.output_directory.join("gleam.d.mts"), javascript::PRELUDE_TS_DEF, )?; tracing::debug!("Generated TS prelude"); @@ -195,7 +195,7 @@ impl<'a> JavaScript<'a> { module: &Module, js_name: &str, ) -> Result<()> { - let name = format!("{js_name}.d.ts"); + let name = format!("{js_name}.d.mts"); let path = self.output_directory.join(name); let output = javascript::ts_declaration(&module.ast, &module.input_path, &module.code); tracing::debug!(name = ?js_name, "Generated TS declaration"); diff --git a/compiler-core/src/javascript.rs b/compiler-core/src/javascript.rs index a0e9276f4..705aa4e97 100644 --- a/compiler-core/src/javascript.rs +++ b/compiler-core/src/javascript.rs @@ -21,8 +21,8 @@ use self::import::{Imports, Member}; const INDENT: isize = 2; -pub const PRELUDE: &str = include_str!("../templates/prelude.js"); -pub const PRELUDE_TS_DEF: &str = include_str!("../templates/prelude.d.ts"); +pub const PRELUDE: &str = include_str!("../templates/prelude.mjs"); +pub const PRELUDE_TS_DEF: &str = include_str!("../templates/prelude.d.mts"); pub type Output<'a> = Result, Error>; diff --git a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_strings__bit_string_typescript.snap b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_strings__bit_string_typescript.snap index 675f3662a..a27c08c51 100644 --- a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_strings__bit_string_typescript.snap +++ b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_strings__bit_string_typescript.snap @@ -3,7 +3,7 @@ source: compiler-core/src/javascript/tests/bit_strings.rs assertion_line: 148 expression: "\npub fn go(x) {\n <>\n}\n" --- -import type * as _ from "../gleam.d.ts"; +import type * as _ from "../gleam.d.mts"; export function go(x: _.BitString): _.BitString; diff --git a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_strings__utf8_codepoint_typescript.snap b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_strings__utf8_codepoint_typescript.snap index 1dbb9f3d1..ec74ddca9 100644 --- a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_strings__utf8_codepoint_typescript.snap +++ b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_strings__utf8_codepoint_typescript.snap @@ -3,7 +3,7 @@ source: compiler-core/src/javascript/tests/bit_strings.rs assertion_line: 126 expression: "\npub fn go(x) {\n <>\n}\n" --- -import type * as _ from "../gleam.d.ts"; +import type * as _ from "../gleam.d.mts"; export function go(x: _.UtfCodepoint): _.BitString; diff --git a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bools__shadowed_bools_and_nil_typescript.snap b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bools__shadowed_bools_and_nil_typescript.snap index 45e8b78b4..054e80582 100644 --- a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bools__shadowed_bools_and_nil_typescript.snap +++ b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bools__shadowed_bools_and_nil_typescript.snap @@ -3,7 +3,7 @@ source: compiler-core/src/javascript/tests/bools.rs assertion_line: 81 expression: "\npub type True { True False Nil }\npub fn go(x, y) {\n let assert True = x\n let assert False = x\n let assert Nil = y\n}\n" --- -import type * as _ from "../gleam.d.ts"; +import type * as _ from "../gleam.d.mts"; export class True extends _.CustomType {} diff --git a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__const_with_fields_typescript.snap b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__const_with_fields_typescript.snap index 25653f67a..93256538e 100644 --- a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__const_with_fields_typescript.snap +++ b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__const_with_fields_typescript.snap @@ -3,7 +3,7 @@ source: compiler-core/src/javascript/tests/custom_types.rs assertion_line: 154 expression: "\npub type Mine {\n Mine(a: Int, b: Int)\n}\n\npub const labels = Mine(b: 2, a: 1)\npub const no_labels = Mine(3, 4)\n" --- -import type * as _ from "../gleam.d.ts"; +import type * as _ from "../gleam.d.mts"; export class Mine extends _.CustomType { constructor(a: number, b: number); diff --git a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__long_name_variant_mixed_labels_typescript.snap b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__long_name_variant_mixed_labels_typescript.snap index de8153af0..12f7817ae 100644 --- a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__long_name_variant_mixed_labels_typescript.snap +++ b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__long_name_variant_mixed_labels_typescript.snap @@ -3,7 +3,7 @@ source: compiler-core/src/javascript/tests/custom_types.rs assertion_line: 225 expression: "\npub type TypeWithALongNameAndSeveralArguments{\n TypeWithALongNameAndSeveralArguments(String, String, String, a: String, b: String)\n}\n\npub const local = TypeWithALongNameAndSeveralArguments(\"one\", \"two\", \"three\", \"four\", \"five\")\n" --- -import type * as _ from "../gleam.d.ts"; +import type * as _ from "../gleam.d.mts"; export class TypeWithALongNameAndSeveralArguments extends _.CustomType { constructor( diff --git a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__opaque_types_typescript.snap b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__opaque_types_typescript.snap index 02635b1ab..4b3fe72ef 100644 --- a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__opaque_types_typescript.snap +++ b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__opaque_types_typescript.snap @@ -3,7 +3,7 @@ source: compiler-core/src/javascript/tests/custom_types.rs assertion_line: 662 expression: "pub opaque type Animal {\n Cat(goes_outside: Bool)\n Dog(plays_fetch: Bool)\n}\n" --- -import type * as _ from "../gleam.d.ts"; +import type * as _ from "../gleam.d.mts"; class Cat extends _.CustomType { constructor(goes_outside: boolean); diff --git a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__unapplied_record_constructors_typescript.snap b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__unapplied_record_constructors_typescript.snap index 8add7ed1a..e4ac36c28 100644 --- a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__unapplied_record_constructors_typescript.snap +++ b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__unapplied_record_constructors_typescript.snap @@ -3,7 +3,7 @@ source: compiler-core/src/javascript/tests/custom_types.rs assertion_line: 650 expression: "pub type Cat { Cat(name: String) }\n\npub fn return_unapplied_cat() {\n Cat\n}\n" --- -import type * as _ from "../gleam.d.ts"; +import type * as _ from "../gleam.d.mts"; export class Cat extends _.CustomType { constructor(name: string); diff --git a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__unnamed_fields_typescript.snap b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__unnamed_fields_typescript.snap index 5fb7a4b46..e7f087bb8 100644 --- a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__unnamed_fields_typescript.snap +++ b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__unnamed_fields_typescript.snap @@ -3,7 +3,7 @@ source: compiler-core/src/javascript/tests/custom_types.rs assertion_line: 195 expression: "\npub type Ip{\n Ip(String)\n}\n\npub const local = Ip(\"0.0.0.0\")\n\n" --- -import type * as _ from "../gleam.d.ts"; +import type * as _ from "../gleam.d.mts"; export class Ip extends _.CustomType { constructor(argument$0: string); diff --git a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__unqualified_imported_no_label_typescript.snap b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__unqualified_imported_no_label_typescript.snap index ed169e706..9d4c17c3a 100644 --- a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__unqualified_imported_no_label_typescript.snap +++ b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__unqualified_imported_no_label_typescript.snap @@ -3,7 +3,7 @@ source: compiler-core/src/javascript/tests/custom_types.rs assertion_line: 416 expression: "import other.{Two}\npub fn main() {\n Two(1)\n}" --- -import type * as other from "../other.d.ts"; +import type * as other from "../other.d.mts"; export function main(): other.One$; diff --git a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__zero_arity_imported_typscript.snap b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__zero_arity_imported_typscript.snap index bc8326366..51787b9bc 100644 --- a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__zero_arity_imported_typscript.snap +++ b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__zero_arity_imported_typscript.snap @@ -3,7 +3,7 @@ source: compiler-core/src/javascript/tests/custom_types.rs assertion_line: 49 expression: "import other\npub fn main() {\n other.Two\n}" --- -import type * as other from "../other.d.ts"; +import type * as other from "../other.d.mts"; export function main(): other.One$; diff --git a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__zero_arity_imported_unqualified_aliased_typescript.snap b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__zero_arity_imported_unqualified_aliased_typescript.snap index 7f4ef58e0..834446fb2 100644 --- a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__zero_arity_imported_unqualified_aliased_typescript.snap +++ b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__zero_arity_imported_unqualified_aliased_typescript.snap @@ -3,7 +3,7 @@ source: compiler-core/src/javascript/tests/custom_types.rs assertion_line: 93 expression: "import other.{Two as Three}\npub fn main() {\n Three\n}" --- -import type * as other from "../other.d.ts"; +import type * as other from "../other.d.mts"; export function main(): other.One$; diff --git a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__zero_arity_imported_unqualified_typescript.snap b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__zero_arity_imported_unqualified_typescript.snap index 74df94638..5020d7be5 100644 --- a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__zero_arity_imported_unqualified_typescript.snap +++ b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__zero_arity_imported_unqualified_typescript.snap @@ -3,7 +3,7 @@ source: compiler-core/src/javascript/tests/custom_types.rs assertion_line: 71 expression: "import other.{Two}\npub fn main() {\n Two\n}" --- -import type * as other from "../other.d.ts"; +import type * as other from "../other.d.mts"; export function main(): other.One$; diff --git a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__generics__record_generics_typescript.snap b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__generics__record_generics_typescript.snap index 7b64a8f7e..a11d6b62b 100644 --- a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__generics__record_generics_typescript.snap +++ b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__generics__record_generics_typescript.snap @@ -3,7 +3,7 @@ source: compiler-core/src/javascript/tests/generics.rs assertion_line: 15 expression: "pub type Animal(t) {\n Cat(type_: t)\n Dog(type_: t)\n}\n\npub fn main() {\n Cat(type_: 6)\n}\n" --- -import type * as _ from "../gleam.d.ts"; +import type * as _ from "../gleam.d.mts"; export class Cat extends _.CustomType { constructor(type_: I); diff --git a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__generics__result_typescript.snap b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__generics__result_typescript.snap index 0b3f85e21..7c3dfb3a4 100644 --- a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__generics__result_typescript.snap +++ b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__generics__result_typescript.snap @@ -3,7 +3,7 @@ source: compiler-core/src/javascript/tests/generics.rs assertion_line: 40 expression: "pub fn map(result, fun) {\n case result {\n Ok(a) -> Ok(fun(a))\n Error(e) -> Error(e)\n }\n }" --- -import type * as _ from "../gleam.d.ts"; +import type * as _ from "../gleam.d.mts"; export function map(result: _.Result, fun: (x0: T) => V): _.Result< V, diff --git a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__lists__list_constants_typescript.snap b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__lists__list_constants_typescript.snap index 18df4b4e8..d7a28041f 100644 --- a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__lists__list_constants_typescript.snap +++ b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__lists__list_constants_typescript.snap @@ -3,7 +3,7 @@ source: compiler-core/src/javascript/tests/lists.rs assertion_line: 52 expression: "\npub const a = []\npub const b = [1, 2, 3]\n" --- -import type * as _ from "../gleam.d.ts"; +import type * as _ from "../gleam.d.mts"; export const a: _.List; diff --git a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__modules__imported_custom_types_do_get_rendered_in_typescript.snap b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__modules__imported_custom_types_do_get_rendered_in_typescript.snap index f6f903a8e..e6908deba 100644 --- a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__modules__imported_custom_types_do_get_rendered_in_typescript.snap +++ b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__modules__imported_custom_types_do_get_rendered_in_typescript.snap @@ -3,8 +3,8 @@ source: compiler-core/src/javascript/tests/modules.rs assertion_line: 182 expression: "import one/two/three.{Custom, One, Two}\n\npub fn go() -> List(Custom) { [One, Two] }\n" --- -import type * as _ from "../gleam.d.ts"; -import type * as three from "../one/two/three.d.ts"; +import type * as _ from "../gleam.d.mts"; +import type * as three from "../one/two/three.d.mts"; export function go(): _.List; diff --git a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__prelude__qualified_nil_typescript.snap b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__prelude__qualified_nil_typescript.snap index 0b00de7f7..70f272460 100644 --- a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__prelude__qualified_nil_typescript.snap +++ b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__prelude__qualified_nil_typescript.snap @@ -3,7 +3,7 @@ source: compiler-core/src/javascript/tests/prelude.rs assertion_line: 41 expression: "import gleam\npub fn go() { gleam.Nil }\n" --- -import type * as gleam from "../gleam.d.ts"; +import type * as gleam from "../gleam.d.mts"; export function go(): null; diff --git a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__prelude__qualified_ok_typescript.snap b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__prelude__qualified_ok_typescript.snap index 7a208f891..405b2851c 100644 --- a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__prelude__qualified_ok_typescript.snap +++ b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__prelude__qualified_ok_typescript.snap @@ -3,8 +3,8 @@ source: compiler-core/src/javascript/tests/prelude.rs assertion_line: 14 expression: "import gleam\npub fn go() { gleam.Ok(1) }\n" --- -import type * as _ from "../gleam.d.ts"; -import type * as gleam from "../gleam.d.ts"; +import type * as _ from "../gleam.d.mts"; +import type * as gleam from "../gleam.d.mts"; export function go(): _.Result; diff --git a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__type_alias__type_alias.snap b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__type_alias__type_alias.snap index 17a96b1bb..a1e331003 100644 --- a/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__type_alias__type_alias.snap +++ b/compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__type_alias__type_alias.snap @@ -3,7 +3,7 @@ source: compiler-core/src/javascript/tests/type_alias.rs assertion_line: 5 expression: "\npub type Headers = List(#(String, String))\n" --- -import type * as _ from "../gleam.d.ts"; +import type * as _ from "../gleam.d.mts"; export type Headers = _.List<[string, string]>; diff --git a/compiler-core/src/javascript/typescript.rs b/compiler-core/src/javascript/typescript.rs index 18d8ec424..0c4323ac5 100644 --- a/compiler-core/src/javascript/typescript.rs +++ b/compiler-core/src/javascript/typescript.rs @@ -280,16 +280,16 @@ impl<'a> TypeScriptGenerator<'a> { if package == self.module.type_info.package || package.is_empty() { // Same package match self.current_module_name_segments_count { - 1 => format!("./{module}.d.ts"), + 1 => format!("./{module}.d.mts"), _ => { let prefix = "../".repeat(self.current_module_name_segments_count - 1); - format!("{prefix}{module}.d.ts") + format!("{prefix}{module}.d.mts") } } } else { // Different package let prefix = "../".repeat(self.current_module_name_segments_count); - format!("{prefix}{package}/{module}.d.ts") + format!("{prefix}{package}/{module}.d.mts") } } diff --git a/compiler-core/templates/prelude.d.ts b/compiler-core/templates/prelude.d.mts similarity index 100% rename from compiler-core/templates/prelude.d.ts rename to compiler-core/templates/prelude.d.mts diff --git a/compiler-core/templates/prelude.js b/compiler-core/templates/prelude.mjs similarity index 100% rename from compiler-core/templates/prelude.js rename to compiler-core/templates/prelude.mjs diff --git a/test-package-compiler/src/lib.rs b/test-package-compiler/src/lib.rs index f5dc30c1c..db5a25592 100644 --- a/test-package-compiler/src/lib.rs +++ b/test-package-compiler/src/lib.rs @@ -110,7 +110,7 @@ impl TestCompileOutput { match content { _ if extension == Some("cache") => buffer.push_str("<.cache binary>"), - _ if path.ends_with("gleam.mjs") || path.ends_with("gleam.d.ts") => { + _ if path.ends_with("gleam.mjs") || path.ends_with("gleam.d.mts") => { buffer.push_str("") } diff --git a/test-package-compiler/src/snapshots/test_package_compiler__generated_tests__javascript_d_ts.snap b/test-package-compiler/src/snapshots/test_package_compiler__generated_tests__javascript_d_ts.snap index f3b66b3f8..4ecfa69af 100644 --- a/test-package-compiler/src/snapshots/test_package_compiler__generated_tests__javascript_d_ts.snap +++ b/test-package-compiler/src/snapshots/test_package_compiler__generated_tests__javascript_d_ts.snap @@ -9,14 +9,14 @@ expression: "./cases/javascript_d_ts" //// /out/lib/the_package/_gleam_artefacts/hello.cache_meta <29 byte binary> -//// /out/lib/the_package/gleam.d.ts +//// /out/lib/the_package/gleam.d.mts //// /out/lib/the_package/gleam.mjs -//// /out/lib/the_package/hello.d.ts -import type * as _ from "./gleam.d.ts"; +//// /out/lib/the_package/hello.d.mts +import type * as _ from "./gleam.d.mts"; export class Woo extends _.CustomType {} diff --git a/test-package-compiler/src/snapshots/test_package_compiler__generated_tests__javascript_import.snap b/test-package-compiler/src/snapshots/test_package_compiler__generated_tests__javascript_import.snap index 397b57cd5..de7dafe3e 100644 --- a/test-package-compiler/src/snapshots/test_package_compiler__generated_tests__javascript_import.snap +++ b/test-package-compiler/src/snapshots/test_package_compiler__generated_tests__javascript_import.snap @@ -15,14 +15,14 @@ expression: "./cases/javascript_import" //// /out/lib/the_package/_gleam_artefacts/two.cache_meta <44 byte binary> -//// /out/lib/the_package/gleam.d.ts +//// /out/lib/the_package/gleam.d.mts //// /out/lib/the_package/gleam.mjs -//// /out/lib/the_package/one/two.d.ts -import type * as _ from "../gleam.d.ts"; +//// /out/lib/the_package/one/two.d.mts +import type * as _ from "../gleam.d.mts"; export class A extends _.CustomType {} @@ -35,8 +35,8 @@ import { CustomType as $CustomType } from "../gleam.mjs"; export class A extends $CustomType {} -//// /out/lib/the_package/two.d.ts -import type * as two from "./one/two.d.ts"; +//// /out/lib/the_package/two.d.mts +import type * as two from "./one/two.d.mts"; export const x: two.A$; diff --git a/test/javascript_prelude/Makefile b/test/javascript_prelude/Makefile index 09bdebb04..88cd7b20f 100644 --- a/test/javascript_prelude/Makefile +++ b/test/javascript_prelude/Makefile @@ -1,6 +1,6 @@ .PHONY: test test: @echo test/javascript_prelude - @cp ../../compiler-core/templates/prelude.js prelude.mjs + @cp ../../compiler-core/templates/prelude.mjs prelude.mjs @node main.mjs @rm prelude.mjs