From d77aee44287b977b667ebe908be2647d9e35d716 Mon Sep 17 00:00:00 2001 From: Alexis Glass Date: Wed, 22 Nov 2023 17:08:32 +0100 Subject: [PATCH] Remove DjinniModule from generator, again --- .../all_datatypes/generated-files.txt | 2 - .../expected/deprecation/generated-files.txt | 2 - .../my_client_interface/generated-files.txt | 2 - .../my_cpp_interface/generated-files.txt | 2 - .../expected/my_enum/generated-files.txt | 2 - .../expected/my_flags/generated-files.txt | 2 - .../expected/my_record/generated-files.txt | 2 - .../generated-files.txt | 2 - src/main/scala/djinni/TsGenerator.scala | 37 ------------------- 9 files changed, 53 deletions(-) diff --git a/src/it/resources/expected/all_datatypes/generated-files.txt b/src/it/resources/expected/all_datatypes/generated-files.txt index da10cb3f..b64ec327 100644 --- a/src/it/resources/expected/all_datatypes/generated-files.txt +++ b/src/it/resources/expected/all_datatypes/generated-files.txt @@ -42,7 +42,5 @@ src/it/resources/result/all_datatypes/wasm/enum_data.hpp src/it/resources/result/all_datatypes/wasm/enum_data.cpp src/it/resources/result/all_datatypes/wasm/all_datatypes.hpp src/it/resources/result/all_datatypes/wasm/all_datatypes.cpp -src/it/resources/result/all_datatypes/ts/DjinniModule.ts -src/it/resources/result/all_datatypes/ts/DjinniModule.js src/it/resources/result/all_datatypes/ts/module.ts diff --git a/src/it/resources/expected/deprecation/generated-files.txt b/src/it/resources/expected/deprecation/generated-files.txt index 8828e55e..e7d2d1dd 100644 --- a/src/it/resources/expected/deprecation/generated-files.txt +++ b/src/it/resources/expected/deprecation/generated-files.txt @@ -3,7 +3,5 @@ src/it/resources/result/deprecation/cpp-headers/my_flags.hpp src/it/resources/result/deprecation/cpp-headers/my_record.hpp src/it/resources/result/deprecation/cpp-headers/my_interface.hpp src/it/resources/result/deprecation/cpp/my_interface.cpp -src/it/resources/result/deprecation/ts/DjinniModule.ts -src/it/resources/result/deprecation/ts/DjinniModule.js src/it/resources/result/deprecation/ts/module.ts diff --git a/src/it/resources/expected/my_client_interface/generated-files.txt b/src/it/resources/expected/my_client_interface/generated-files.txt index 644b32e6..4386515e 100644 --- a/src/it/resources/expected/my_client_interface/generated-files.txt +++ b/src/it/resources/expected/my_client_interface/generated-files.txt @@ -16,6 +16,4 @@ src/it/resources/result/my_client_interface/cwrapper/cw__my_client_interface.cpp src/it/resources/result/my_client_interface/cffi/pycffi_lib_build.py src/it/resources/result/my_client_interface/wasm/my_client_interface.hpp src/it/resources/result/my_client_interface/wasm/my_client_interface.cpp -src/it/resources/result/my_client_interface/ts/DjinniModule.ts -src/it/resources/result/my_client_interface/ts/DjinniModule.js src/it/resources/result/my_client_interface/ts/module.ts diff --git a/src/it/resources/expected/my_cpp_interface/generated-files.txt b/src/it/resources/expected/my_cpp_interface/generated-files.txt index d1ecb356..6da61d50 100644 --- a/src/it/resources/expected/my_cpp_interface/generated-files.txt +++ b/src/it/resources/expected/my_cpp_interface/generated-files.txt @@ -18,7 +18,5 @@ src/it/resources/result/my_cpp_interface/cwrapper/cw__my_cpp_interface.cpp src/it/resources/result/my_cpp_interface/cffi/pycffi_lib_build.py src/it/resources/result/my_cpp_interface/wasm/my_cpp_interface.hpp src/it/resources/result/my_cpp_interface/wasm/my_cpp_interface.cpp -src/it/resources/result/my_cpp_interface/ts/DjinniModule.ts -src/it/resources/result/my_cpp_interface/ts/DjinniModule.js src/it/resources/result/my_cpp_interface/ts/module.ts diff --git a/src/it/resources/expected/my_enum/generated-files.txt b/src/it/resources/expected/my_enum/generated-files.txt index 09ede752..bd26c11a 100644 --- a/src/it/resources/expected/my_enum/generated-files.txt +++ b/src/it/resources/expected/my_enum/generated-files.txt @@ -13,7 +13,5 @@ src/it/resources/result/my_enum/cwrapper/dh__my_enum.hpp src/it/resources/result/my_enum/cwrapper/dh__my_enum.cpp src/it/resources/result/my_enum/wasm/my_enum.hpp src/it/resources/result/my_enum/wasm/my_enum.cpp -src/it/resources/result/my_enum/ts/DjinniModule.ts -src/it/resources/result/my_enum/ts/DjinniModule.js src/it/resources/result/my_enum/ts/module.ts diff --git a/src/it/resources/expected/my_flags/generated-files.txt b/src/it/resources/expected/my_flags/generated-files.txt index 6c8bb706..a5ab86f9 100644 --- a/src/it/resources/expected/my_flags/generated-files.txt +++ b/src/it/resources/expected/my_flags/generated-files.txt @@ -13,7 +13,5 @@ src/it/resources/result/my_flags/cwrapper/dh__my_flags.hpp src/it/resources/result/my_flags/cwrapper/dh__my_flags.cpp src/it/resources/result/my_flags/wasm/my_flags.hpp src/it/resources/result/my_flags/wasm/my_flags.cpp -src/it/resources/result/my_flags/ts/DjinniModule.ts -src/it/resources/result/my_flags/ts/DjinniModule.js src/it/resources/result/my_flags/ts/module.ts diff --git a/src/it/resources/expected/my_record/generated-files.txt b/src/it/resources/expected/my_record/generated-files.txt index 7d6611cc..22240298 100644 --- a/src/it/resources/expected/my_record/generated-files.txt +++ b/src/it/resources/expected/my_record/generated-files.txt @@ -26,7 +26,5 @@ src/it/resources/result/my_record/cwrapper/dh__my_record.hpp src/it/resources/result/my_record/cwrapper/dh__my_record.cpp src/it/resources/result/my_record/wasm/my_record.hpp src/it/resources/result/my_record/wasm/my_record.cpp -src/it/resources/result/my_record/ts/DjinniModule.ts -src/it/resources/result/my_record/ts/DjinniModule.js src/it/resources/result/my_record/ts/module.ts diff --git a/src/it/resources/expected/using_custom_datatypes/generated-files.txt b/src/it/resources/expected/using_custom_datatypes/generated-files.txt index 37399f02..11b501f7 100644 --- a/src/it/resources/expected/using_custom_datatypes/generated-files.txt +++ b/src/it/resources/expected/using_custom_datatypes/generated-files.txt @@ -34,6 +34,4 @@ src/it/resources/result/using_custom_datatypes/wasm/custom_datatype.hpp src/it/resources/result/using_custom_datatypes/wasm/custom_datatype.cpp src/it/resources/result/using_custom_datatypes/wasm/other_record.hpp src/it/resources/result/using_custom_datatypes/wasm/other_record.cpp -src/it/resources/result/using_custom_datatypes/ts/DjinniModule.ts -src/it/resources/result/using_custom_datatypes/ts/DjinniModule.js src/it/resources/result/using_custom_datatypes/ts/module.ts diff --git a/src/main/scala/djinni/TsGenerator.scala b/src/main/scala/djinni/TsGenerator.scala index 969db93b..129be312 100644 --- a/src/main/scala/djinni/TsGenerator.scala +++ b/src/main/scala/djinni/TsGenerator.scala @@ -254,7 +254,6 @@ class TsGenerator(spec: Spec) extends Generator(spec) { } // -------------------------------------------------------------------------- override def generate(idl: Seq[TypeDecl]) { - writeDjinniModuleFilesFile() createFile( spec.tsOutFolder.get, spec.tsModule + ".ts", @@ -349,40 +348,4 @@ class TsGenerator(spec: Spec) extends Generator(spec) { typeParams: Seq[TypeParam], i: Interface ) {} - - def writeDjinniModuleFile(f: IndentWriter => Unit, ext: String): Unit = { - createFileOnce( - spec.tsOutFolder.get, - s"DjinniModule.$ext", - (w: IndentWriter) => { - w.wl("// AUTOGENERATED FILE - DO NOT MODIFY!") - w.wl("// This file was generated by Djinni") - w.wl - f(w) - } - ) - } - - def writeDjinniModuleFilesFile(): Unit = { - val tsContent = Source - .fromResource("ts/DjinniModule.ts") - .getLines - .mkString("\n") - writeDjinniModuleFile( - w => { - w.wl(tsContent) - }, - "ts" - ) - val jsContent = Source - .fromResource("ts/DjinniModule.js") - .getLines - .mkString("\n") - writeDjinniModuleFile( - w => { - w.wl(jsContent) - }, - "js" - ) - } }