Skip to content

Commit

Permalink
Remove DjinniModule from generator, again
Browse files Browse the repository at this point in the history
  • Loading branch information
mutagene committed Nov 22, 2023
1 parent 65e90a1 commit d77aee4
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 53 deletions.
2 changes: 0 additions & 2 deletions src/it/resources/expected/all_datatypes/generated-files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

2 changes: 0 additions & 2 deletions src/it/resources/expected/deprecation/generated-files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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

2 changes: 0 additions & 2 deletions src/it/resources/expected/my_enum/generated-files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

2 changes: 0 additions & 2 deletions src/it/resources/expected/my_flags/generated-files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

2 changes: 0 additions & 2 deletions src/it/resources/expected/my_record/generated-files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Original file line number Diff line number Diff line change
Expand Up @@ -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
37 changes: 0 additions & 37 deletions src/main/scala/djinni/TsGenerator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
)
}
}

0 comments on commit d77aee4

Please sign in to comment.