tsrs 0.18.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a87e1838e8352dbcb61cde9ed300cb2eca9f7b14006b6bb9f2aabe5f2565e16f
4
- data.tar.gz: c14fe5ae5cb01af608eb90bff51ec4626530f7f8b1e47e80eb0482c539edede0
3
+ metadata.gz: 59135a58bd39405322e9e41d9486e7f3d9cce5e2b3cb2e8eed1fd6c361597743
4
+ data.tar.gz: 8cb64f1a13674c9989e711cee5e8a8743b5184f7da65af35a892669c33205175
5
5
  SHA512:
6
- metadata.gz: 89c7cdc9f86f30d75517d16b45aeda776edc21fce6b466a8fa014f0d0c47fc0c6e376fbc44b4f8764187b147aceae99f831c0c30d55e097a9ecd900cc9b082f9
7
- data.tar.gz: 8d21641227464c5ec4f33bff52da3a610c0ecc6b07bff8136cfda261426c663886c7b51e055c4ab84c91820e18ac130a4347591d3675982e6064536d0214d1c8
6
+ metadata.gz: f43c83244f9b97f3db58bdd80d704612e81e6665f94a59f7dfc45adce3d6a39a99c671ebe8420723cb76228d6c3580c097ddc5e0993493718b57ef6e2999c648
7
+ data.tar.gz: 3cb21d674b7e124758fc4d84d9ee11e980866597d54f7f8d2ba07befbabbb13c6df3a605d822fc26b8b5de6913bad987a1fe96049df19de5f7219c6eb4754d97
data/lib/tsrs/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tsrs
4
- VERSION = "0.18.0"
4
+ VERSION = "0.20.0"
5
5
  end
@@ -2,4 +2,4 @@
2
2
  # The TypeScript version tsrs's release builds stamp (`nightly` in [workspace.metadata.typescript] of tsrs's
3
3
  # Cargo.toml), so tsbuildinfo files and typesVersions matching agree with the tsrs npm package.
4
4
  # See .github/workflows/upstream.yml.
5
- TSRS_TS_VERSION = "7.1.0-dev.20260930.4"
5
+ TSRS_TS_VERSION = "7.1.0-beta"
data/rust/Cargo.lock CHANGED
@@ -697,8 +697,8 @@ dependencies = [
697
697
 
698
698
  [[package]]
699
699
  name = "tsrs_api"
700
- version = "0.18.0"
701
- source = "git+https://github.com/oxc-project/tsrs?tag=v0.18.0#5f92808bc92bb97b06212153ab73d28d551c0b9b"
700
+ version = "0.20.0"
701
+ source = "git+https://github.com/oxc-project/tsrs?tag=v0.20.0#d197eeea709616d61930c2bd5eac048471e404b8"
702
702
  dependencies = [
703
703
  "rustc-hash",
704
704
  "tsrs_api_codec",
@@ -709,6 +709,7 @@ dependencies = [
709
709
  "tsrs_compiler",
710
710
  "tsrs_core",
711
711
  "tsrs_diagnostics",
712
+ "tsrs_execute",
712
713
  "tsrs_ls",
713
714
  "tsrs_lsproto",
714
715
  "tsrs_module",
@@ -721,8 +722,8 @@ dependencies = [
721
722
 
722
723
  [[package]]
723
724
  name = "tsrs_api_codec"
724
- version = "0.18.0"
725
- source = "git+https://github.com/oxc-project/tsrs?tag=v0.18.0#5f92808bc92bb97b06212153ab73d28d551c0b9b"
725
+ version = "0.20.0"
726
+ source = "git+https://github.com/oxc-project/tsrs?tag=v0.20.0#d197eeea709616d61930c2bd5eac048471e404b8"
726
727
  dependencies = [
727
728
  "rustc-hash",
728
729
  "tsrs_ast",
@@ -731,8 +732,8 @@ dependencies = [
731
732
 
732
733
  [[package]]
733
734
  name = "tsrs_api_transport"
734
- version = "0.18.0"
735
- source = "git+https://github.com/oxc-project/tsrs?tag=v0.18.0#5f92808bc92bb97b06212153ab73d28d551c0b9b"
735
+ version = "0.20.0"
736
+ source = "git+https://github.com/oxc-project/tsrs?tag=v0.20.0#d197eeea709616d61930c2bd5eac048471e404b8"
736
737
  dependencies = [
737
738
  "base64",
738
739
  "rustc-hash",
@@ -740,12 +741,13 @@ dependencies = [
740
741
  "serde_json",
741
742
  "tsrs_core",
742
743
  "tsrs_vfs",
744
+ "windows-sys",
743
745
  ]
744
746
 
745
747
  [[package]]
746
748
  name = "tsrs_ast"
747
- version = "0.18.0"
748
- source = "git+https://github.com/oxc-project/tsrs?tag=v0.18.0#5f92808bc92bb97b06212153ab73d28d551c0b9b"
749
+ version = "0.20.0"
750
+ source = "git+https://github.com/oxc-project/tsrs?tag=v0.20.0#d197eeea709616d61930c2bd5eac048471e404b8"
749
751
  dependencies = [
750
752
  "bitflags",
751
753
  "hashbrown",
@@ -758,8 +760,8 @@ dependencies = [
758
760
 
759
761
  [[package]]
760
762
  name = "tsrs_astnav"
761
- version = "0.18.0"
762
- source = "git+https://github.com/oxc-project/tsrs?tag=v0.18.0#5f92808bc92bb97b06212153ab73d28d551c0b9b"
763
+ version = "0.20.0"
764
+ source = "git+https://github.com/oxc-project/tsrs?tag=v0.20.0#d197eeea709616d61930c2bd5eac048471e404b8"
763
765
  dependencies = [
764
766
  "tsrs_ast",
765
767
  "tsrs_core",
@@ -768,8 +770,8 @@ dependencies = [
768
770
 
769
771
  [[package]]
770
772
  name = "tsrs_binder"
771
- version = "0.18.0"
772
- source = "git+https://github.com/oxc-project/tsrs?tag=v0.18.0#5f92808bc92bb97b06212153ab73d28d551c0b9b"
773
+ version = "0.20.0"
774
+ source = "git+https://github.com/oxc-project/tsrs?tag=v0.20.0#d197eeea709616d61930c2bd5eac048471e404b8"
773
775
  dependencies = [
774
776
  "bitflags",
775
777
  "rustc-hash",
@@ -781,12 +783,13 @@ dependencies = [
781
783
 
782
784
  [[package]]
783
785
  name = "tsrs_checker"
784
- version = "0.18.0"
785
- source = "git+https://github.com/oxc-project/tsrs?tag=v0.18.0#5f92808bc92bb97b06212153ab73d28d551c0b9b"
786
+ version = "0.20.0"
787
+ source = "git+https://github.com/oxc-project/tsrs?tag=v0.20.0#d197eeea709616d61930c2bd5eac048471e404b8"
786
788
  dependencies = [
787
789
  "bitflags",
788
790
  "hashbrown",
789
791
  "rustc-hash",
792
+ "smallvec",
790
793
  "tsrs_ast",
791
794
  "tsrs_astnav",
792
795
  "tsrs_binder",
@@ -804,8 +807,8 @@ dependencies = [
804
807
 
805
808
  [[package]]
806
809
  name = "tsrs_compiler"
807
- version = "0.18.0"
808
- source = "git+https://github.com/oxc-project/tsrs?tag=v0.18.0#5f92808bc92bb97b06212153ab73d28d551c0b9b"
810
+ version = "0.20.0"
811
+ source = "git+https://github.com/oxc-project/tsrs?tag=v0.20.0#d197eeea709616d61930c2bd5eac048471e404b8"
809
812
  dependencies = [
810
813
  "rayon",
811
814
  "rustc-hash",
@@ -830,8 +833,8 @@ dependencies = [
830
833
 
831
834
  [[package]]
832
835
  name = "tsrs_contentmapper"
833
- version = "0.18.0"
834
- source = "git+https://github.com/oxc-project/tsrs?tag=v0.18.0#5f92808bc92bb97b06212153ab73d28d551c0b9b"
836
+ version = "0.20.0"
837
+ source = "git+https://github.com/oxc-project/tsrs?tag=v0.20.0#d197eeea709616d61930c2bd5eac048471e404b8"
835
838
  dependencies = [
836
839
  "rustc-hash",
837
840
  "tsrs_ast",
@@ -846,8 +849,8 @@ dependencies = [
846
849
 
847
850
  [[package]]
848
851
  name = "tsrs_core"
849
- version = "0.18.0"
850
- source = "git+https://github.com/oxc-project/tsrs?tag=v0.18.0#5f92808bc92bb97b06212153ab73d28d551c0b9b"
852
+ version = "0.20.0"
853
+ source = "git+https://github.com/oxc-project/tsrs?tag=v0.20.0#d197eeea709616d61930c2bd5eac048471e404b8"
851
854
  dependencies = [
852
855
  "dragonbox_ecma",
853
856
  "hashbrown",
@@ -864,8 +867,8 @@ dependencies = [
864
867
 
865
868
  [[package]]
866
869
  name = "tsrs_declarations"
867
- version = "0.18.0"
868
- source = "git+https://github.com/oxc-project/tsrs?tag=v0.18.0#5f92808bc92bb97b06212153ab73d28d551c0b9b"
870
+ version = "0.20.0"
871
+ source = "git+https://github.com/oxc-project/tsrs?tag=v0.20.0#d197eeea709616d61930c2bd5eac048471e404b8"
869
872
  dependencies = [
870
873
  "rustc-hash",
871
874
  "tsrs_ast",
@@ -881,16 +884,16 @@ dependencies = [
881
884
 
882
885
  [[package]]
883
886
  name = "tsrs_diagnostics"
884
- version = "0.18.0"
885
- source = "git+https://github.com/oxc-project/tsrs?tag=v0.18.0#5f92808bc92bb97b06212153ab73d28d551c0b9b"
887
+ version = "0.20.0"
888
+ source = "git+https://github.com/oxc-project/tsrs?tag=v0.20.0#d197eeea709616d61930c2bd5eac048471e404b8"
886
889
  dependencies = [
887
890
  "rustc-hash",
888
891
  ]
889
892
 
890
893
  [[package]]
891
894
  name = "tsrs_execute"
892
- version = "0.18.0"
893
- source = "git+https://github.com/oxc-project/tsrs?tag=v0.18.0#5f92808bc92bb97b06212153ab73d28d551c0b9b"
895
+ version = "0.20.0"
896
+ source = "git+https://github.com/oxc-project/tsrs?tag=v0.20.0#d197eeea709616d61930c2bd5eac048471e404b8"
894
897
  dependencies = [
895
898
  "libc",
896
899
  "rustc-hash",
@@ -908,8 +911,8 @@ dependencies = [
908
911
 
909
912
  [[package]]
910
913
  name = "tsrs_fswatch"
911
- version = "0.18.0"
912
- source = "git+https://github.com/oxc-project/tsrs?tag=v0.18.0#5f92808bc92bb97b06212153ab73d28d551c0b9b"
914
+ version = "0.20.0"
915
+ source = "git+https://github.com/oxc-project/tsrs?tag=v0.20.0#d197eeea709616d61930c2bd5eac048471e404b8"
913
916
  dependencies = [
914
917
  "libc",
915
918
  "rustc-hash",
@@ -918,8 +921,8 @@ dependencies = [
918
921
 
919
922
  [[package]]
920
923
  name = "tsrs_incremental"
921
- version = "0.18.0"
922
- source = "git+https://github.com/oxc-project/tsrs?tag=v0.18.0#5f92808bc92bb97b06212153ab73d28d551c0b9b"
924
+ version = "0.20.0"
925
+ source = "git+https://github.com/oxc-project/tsrs?tag=v0.20.0#d197eeea709616d61930c2bd5eac048471e404b8"
923
926
  dependencies = [
924
927
  "bitflags",
925
928
  "rayon",
@@ -939,8 +942,8 @@ dependencies = [
939
942
 
940
943
  [[package]]
941
944
  name = "tsrs_ipc"
942
- version = "0.18.0"
943
- source = "git+https://github.com/oxc-project/tsrs?tag=v0.18.0#5f92808bc92bb97b06212153ab73d28d551c0b9b"
945
+ version = "0.20.0"
946
+ source = "git+https://github.com/oxc-project/tsrs?tag=v0.20.0#d197eeea709616d61930c2bd5eac048471e404b8"
944
947
  dependencies = [
945
948
  "rustc-hash",
946
949
  "tsrs_core",
@@ -948,8 +951,8 @@ dependencies = [
948
951
 
949
952
  [[package]]
950
953
  name = "tsrs_ls"
951
- version = "0.18.0"
952
- source = "git+https://github.com/oxc-project/tsrs?tag=v0.18.0#5f92808bc92bb97b06212153ab73d28d551c0b9b"
954
+ version = "0.20.0"
955
+ source = "git+https://github.com/oxc-project/tsrs?tag=v0.20.0#d197eeea709616d61930c2bd5eac048471e404b8"
953
956
  dependencies = [
954
957
  "bitflags",
955
958
  "indexmap",
@@ -976,8 +979,8 @@ dependencies = [
976
979
 
977
980
  [[package]]
978
981
  name = "tsrs_lsproto"
979
- version = "0.18.0"
980
- source = "git+https://github.com/oxc-project/tsrs?tag=v0.18.0#5f92808bc92bb97b06212153ab73d28d551c0b9b"
982
+ version = "0.20.0"
983
+ source = "git+https://github.com/oxc-project/tsrs?tag=v0.20.0#d197eeea709616d61930c2bd5eac048471e404b8"
981
984
  dependencies = [
982
985
  "rustc-hash",
983
986
  "tsrs_core",
@@ -986,10 +989,11 @@ dependencies = [
986
989
 
987
990
  [[package]]
988
991
  name = "tsrs_module"
989
- version = "0.18.0"
990
- source = "git+https://github.com/oxc-project/tsrs?tag=v0.18.0#5f92808bc92bb97b06212153ab73d28d551c0b9b"
992
+ version = "0.20.0"
993
+ source = "git+https://github.com/oxc-project/tsrs?tag=v0.20.0#d197eeea709616d61930c2bd5eac048471e404b8"
991
994
  dependencies = [
992
995
  "bitflags",
996
+ "hashbrown",
993
997
  "rustc-hash",
994
998
  "tsrs_ast",
995
999
  "tsrs_core",
@@ -999,8 +1003,8 @@ dependencies = [
999
1003
 
1000
1004
  [[package]]
1001
1005
  name = "tsrs_modulespecifiers"
1002
- version = "0.18.0"
1003
- source = "git+https://github.com/oxc-project/tsrs?tag=v0.18.0#5f92808bc92bb97b06212153ab73d28d551c0b9b"
1006
+ version = "0.20.0"
1007
+ source = "git+https://github.com/oxc-project/tsrs?tag=v0.20.0#d197eeea709616d61930c2bd5eac048471e404b8"
1004
1008
  dependencies = [
1005
1009
  "regex",
1006
1010
  "rustc-hash",
@@ -1012,8 +1016,8 @@ dependencies = [
1012
1016
 
1013
1017
  [[package]]
1014
1018
  name = "tsrs_parser"
1015
- version = "0.18.0"
1016
- source = "git+https://github.com/oxc-project/tsrs?tag=v0.18.0#5f92808bc92bb97b06212153ab73d28d551c0b9b"
1019
+ version = "0.20.0"
1020
+ source = "git+https://github.com/oxc-project/tsrs?tag=v0.20.0#d197eeea709616d61930c2bd5eac048471e404b8"
1017
1021
  dependencies = [
1018
1022
  "bitflags",
1019
1023
  "rustc-hash",
@@ -1025,8 +1029,8 @@ dependencies = [
1025
1029
 
1026
1030
  [[package]]
1027
1031
  name = "tsrs_printer"
1028
- version = "0.18.0"
1029
- source = "git+https://github.com/oxc-project/tsrs?tag=v0.18.0#5f92808bc92bb97b06212153ab73d28d551c0b9b"
1032
+ version = "0.20.0"
1033
+ source = "git+https://github.com/oxc-project/tsrs?tag=v0.20.0#d197eeea709616d61930c2bd5eac048471e404b8"
1030
1034
  dependencies = [
1031
1035
  "bitflags",
1032
1036
  "rustc-hash",
@@ -1038,8 +1042,8 @@ dependencies = [
1038
1042
 
1039
1043
  [[package]]
1040
1044
  name = "tsrs_project"
1041
- version = "0.18.0"
1042
- source = "git+https://github.com/oxc-project/tsrs?tag=v0.18.0#5f92808bc92bb97b06212153ab73d28d551c0b9b"
1045
+ version = "0.20.0"
1046
+ source = "git+https://github.com/oxc-project/tsrs?tag=v0.20.0#d197eeea709616d61930c2bd5eac048471e404b8"
1043
1047
  dependencies = [
1044
1048
  "rustc-hash",
1045
1049
  "tsrs_ast",
@@ -1061,8 +1065,8 @@ dependencies = [
1061
1065
 
1062
1066
  [[package]]
1063
1067
  name = "tsrs_projectutil"
1064
- version = "0.18.0"
1065
- source = "git+https://github.com/oxc-project/tsrs?tag=v0.18.0#5f92808bc92bb97b06212153ab73d28d551c0b9b"
1068
+ version = "0.20.0"
1069
+ source = "git+https://github.com/oxc-project/tsrs?tag=v0.20.0#d197eeea709616d61930c2bd5eac048471e404b8"
1066
1070
  dependencies = [
1067
1071
  "rustc-hash",
1068
1072
  "tsrs_core",
@@ -1070,8 +1074,8 @@ dependencies = [
1070
1074
 
1071
1075
  [[package]]
1072
1076
  name = "tsrs_pseudochecker"
1073
- version = "0.18.0"
1074
- source = "git+https://github.com/oxc-project/tsrs?tag=v0.18.0#5f92808bc92bb97b06212153ab73d28d551c0b9b"
1077
+ version = "0.20.0"
1078
+ source = "git+https://github.com/oxc-project/tsrs?tag=v0.20.0#d197eeea709616d61930c2bd5eac048471e404b8"
1075
1079
  dependencies = [
1076
1080
  "tsrs_ast",
1077
1081
  "tsrs_core",
@@ -1079,8 +1083,8 @@ dependencies = [
1079
1083
 
1080
1084
  [[package]]
1081
1085
  name = "tsrs_scanner"
1082
- version = "0.18.0"
1083
- source = "git+https://github.com/oxc-project/tsrs?tag=v0.18.0#5f92808bc92bb97b06212153ab73d28d551c0b9b"
1086
+ version = "0.20.0"
1087
+ source = "git+https://github.com/oxc-project/tsrs?tag=v0.20.0#d197eeea709616d61930c2bd5eac048471e404b8"
1084
1088
  dependencies = [
1085
1089
  "bitflags",
1086
1090
  "memchr",
@@ -1092,8 +1096,8 @@ dependencies = [
1092
1096
 
1093
1097
  [[package]]
1094
1098
  name = "tsrs_sourcemap"
1095
- version = "0.18.0"
1096
- source = "git+https://github.com/oxc-project/tsrs?tag=v0.18.0#5f92808bc92bb97b06212153ab73d28d551c0b9b"
1099
+ version = "0.20.0"
1100
+ source = "git+https://github.com/oxc-project/tsrs?tag=v0.20.0#d197eeea709616d61930c2bd5eac048471e404b8"
1097
1101
  dependencies = [
1098
1102
  "rustc-hash",
1099
1103
  "tsrs_ast",
@@ -1103,8 +1107,8 @@ dependencies = [
1103
1107
 
1104
1108
  [[package]]
1105
1109
  name = "tsrs_spanmap"
1106
- version = "0.18.0"
1107
- source = "git+https://github.com/oxc-project/tsrs?tag=v0.18.0#5f92808bc92bb97b06212153ab73d28d551c0b9b"
1110
+ version = "0.20.0"
1111
+ source = "git+https://github.com/oxc-project/tsrs?tag=v0.20.0#d197eeea709616d61930c2bd5eac048471e404b8"
1108
1112
  dependencies = [
1109
1113
  "bitflags",
1110
1114
  "tsrs_core",
@@ -1112,8 +1116,8 @@ dependencies = [
1112
1116
 
1113
1117
  [[package]]
1114
1118
  name = "tsrs_transformers"
1115
- version = "0.18.0"
1116
- source = "git+https://github.com/oxc-project/tsrs?tag=v0.18.0#5f92808bc92bb97b06212153ab73d28d551c0b9b"
1119
+ version = "0.20.0"
1120
+ source = "git+https://github.com/oxc-project/tsrs?tag=v0.20.0#d197eeea709616d61930c2bd5eac048471e404b8"
1117
1121
  dependencies = [
1118
1122
  "bitflags",
1119
1123
  "rustc-hash",
@@ -1128,8 +1132,8 @@ dependencies = [
1128
1132
 
1129
1133
  [[package]]
1130
1134
  name = "tsrs_tsoptions"
1131
- version = "0.18.0"
1132
- source = "git+https://github.com/oxc-project/tsrs?tag=v0.18.0#5f92808bc92bb97b06212153ab73d28d551c0b9b"
1135
+ version = "0.20.0"
1136
+ source = "git+https://github.com/oxc-project/tsrs?tag=v0.20.0#d197eeea709616d61930c2bd5eac048471e404b8"
1133
1137
  dependencies = [
1134
1138
  "rustc-hash",
1135
1139
  "tsrs_ast",
@@ -1144,8 +1148,8 @@ dependencies = [
1144
1148
 
1145
1149
  [[package]]
1146
1150
  name = "tsrs_vfs"
1147
- version = "0.18.0"
1148
- source = "git+https://github.com/oxc-project/tsrs?tag=v0.18.0#5f92808bc92bb97b06212153ab73d28d551c0b9b"
1151
+ version = "0.20.0"
1152
+ source = "git+https://github.com/oxc-project/tsrs?tag=v0.20.0#d197eeea709616d61930c2bd5eac048471e404b8"
1149
1153
  dependencies = [
1150
1154
  "bitflags",
1151
1155
  "rayon",
data/rust/Cargo.toml CHANGED
@@ -16,15 +16,15 @@ crate-type = ["cdylib", "staticlib", "rlib"]
16
16
 
17
17
  # tsrs does not publish its crates, so they come from the release tag. See .github/workflows/upstream.yml.
18
18
  [dependencies]
19
- tsrs_api = { git = "https://github.com/oxc-project/tsrs", tag = "v0.18.0" }
20
- tsrs_ast = { git = "https://github.com/oxc-project/tsrs", tag = "v0.18.0" }
21
- tsrs_compiler = { git = "https://github.com/oxc-project/tsrs", tag = "v0.18.0" }
22
- tsrs_contentmapper = { git = "https://github.com/oxc-project/tsrs", tag = "v0.18.0" }
23
- tsrs_core = { git = "https://github.com/oxc-project/tsrs", tag = "v0.18.0" }
24
- tsrs_execute = { git = "https://github.com/oxc-project/tsrs", tag = "v0.18.0" }
25
- tsrs_project = { git = "https://github.com/oxc-project/tsrs", tag = "v0.18.0" }
26
- tsrs_tsoptions = { git = "https://github.com/oxc-project/tsrs", tag = "v0.18.0" }
27
- tsrs_vfs = { git = "https://github.com/oxc-project/tsrs", tag = "v0.18.0" }
19
+ tsrs_api = { git = "https://github.com/oxc-project/tsrs", tag = "v0.20.0" }
20
+ tsrs_ast = { git = "https://github.com/oxc-project/tsrs", tag = "v0.20.0" }
21
+ tsrs_compiler = { git = "https://github.com/oxc-project/tsrs", tag = "v0.20.0" }
22
+ tsrs_contentmapper = { git = "https://github.com/oxc-project/tsrs", tag = "v0.20.0" }
23
+ tsrs_core = { git = "https://github.com/oxc-project/tsrs", tag = "v0.20.0" }
24
+ tsrs_execute = { git = "https://github.com/oxc-project/tsrs", tag = "v0.20.0" }
25
+ tsrs_project = { git = "https://github.com/oxc-project/tsrs", tag = "v0.20.0" }
26
+ tsrs_tsoptions = { git = "https://github.com/oxc-project/tsrs", tag = "v0.20.0" }
27
+ tsrs_vfs = { git = "https://github.com/oxc-project/tsrs", tag = "v0.20.0" }
28
28
  serde = { version = "1", features = ["derive"] }
29
29
  serde_json = "1"
30
30
 
data/rust/src/lib.rs CHANGED
@@ -85,7 +85,7 @@ pub unsafe extern "C" fn tsrs_session_check(session: *const TsrsSession, options
85
85
  };
86
86
 
87
87
  let options = options.to_string();
88
- let session = session.session();
88
+ let session = session.retain();
89
89
 
90
90
  guard(move || worker::run(move || session::check(&session, &options)))
91
91
  }
data/rust/src/session.rs CHANGED
@@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
4
4
  use serde_json::value::RawValue;
5
5
  use tsrs_api::{Handler, Response, Session, SessionOptions};
6
6
  use tsrs_core::context::{with_checker_lifetime, CheckerLifetime, Context};
7
- use tsrs_core::json::Value;
7
+ use tsrs_core::json::{JsonMap, Value};
8
8
  use tsrs_core::tspath;
9
9
  use tsrs_vfs::{bundled, osvfs, FS};
10
10
 
@@ -15,6 +15,7 @@ use crate::status::Status;
15
15
 
16
16
  pub struct TsrsSession {
17
17
  session: Arc<Session>,
18
+ current_directory: String,
18
19
  }
19
20
 
20
21
  #[derive(Deserialize)]
@@ -31,15 +32,19 @@ struct CheckPayload {
31
32
 
32
33
  pub fn new(cwd: &str) -> TsrsSession {
33
34
  let fs: Arc<dyn FS> = Arc::new(bundled::wrap_fs(osvfs::fs()));
35
+ let current_directory = tspath::normalize_path(cwd);
34
36
 
35
37
  let session = Session::new(SessionOptions::new(
36
- tspath::normalize_path(cwd),
38
+ current_directory.clone(),
37
39
  bundled::default_lib_path(),
38
40
  fs,
39
41
  false,
40
42
  ));
41
43
 
42
- TsrsSession { session }
44
+ TsrsSession {
45
+ session,
46
+ current_directory,
47
+ }
43
48
  }
44
49
 
45
50
  impl TsrsSession {
@@ -50,6 +55,7 @@ impl TsrsSession {
50
55
  pub fn retain(&self) -> TsrsSession {
51
56
  TsrsSession {
52
57
  session: self.session(),
58
+ current_directory: self.current_directory.clone(),
53
59
  }
54
60
  }
55
61
 
@@ -58,16 +64,17 @@ impl TsrsSession {
58
64
  }
59
65
  }
60
66
 
61
- pub fn check(session: &Session, request_json: &str) -> TsrsResult {
67
+ pub fn check(session: &TsrsSession, request_json: &str) -> TsrsResult {
62
68
  let request: CheckRequest = match serde_json::from_str(request_json) {
63
69
  Ok(request) => request,
64
70
  Err(error) => return TsrsResult::error(TsrsErrorCode::Option, error.to_string()),
65
71
  };
66
72
 
67
- let project = tspath::get_normalized_absolute_path(&request.project, session.current_directory());
73
+ let project = tspath::get_normalized_absolute_path(&request.project, &session.current_directory);
68
74
  let params = object("openProjects", Value::Array(vec![Value::String(project.clone())]));
75
+ let session = session.session();
69
76
 
70
- let created = match call(session, "createSnapshot", &params) {
77
+ let created = match call(&session, "createSnapshot", &params) {
71
78
  Ok(created) => created,
72
79
  Err(message) => return TsrsResult::error(TsrsErrorCode::Check, message),
73
80
  };
@@ -76,9 +83,9 @@ pub fn check(session: &Session, request_json: &str) -> TsrsResult {
76
83
  return TsrsResult::error(TsrsErrorCode::Internal, "createSnapshot returned no snapshot");
77
84
  };
78
85
 
79
- let outcome = diagnostics(session, snapshot, &created, &project);
86
+ let outcome = diagnostics(&session, snapshot, &created, &project);
80
87
 
81
- let _ = call(session, "release", &object("snapshot", Value::Number(snapshot as f64)));
88
+ let _ = call(&session, "release", &object("snapshot", Value::Number(snapshot as f64)));
82
89
 
83
90
  match outcome {
84
91
  Ok((status, diagnostics)) => {
@@ -129,7 +136,7 @@ fn diagnostics(
129
136
  let status = if all.is_empty() {
130
137
  ExitStatus::Success
131
138
  } else {
132
- ExitStatus::DiagnosticsPresent_OutputsGenerated
139
+ ExitStatus::DiagnosticsPresentOutputsGenerated
133
140
  };
134
141
 
135
142
  let responses = tsrs_api::diagnostics::diagnostic_responses(&all);
@@ -171,7 +178,7 @@ fn call(session: &Session, method: &str, params: &Value) -> Result<Value, String
171
178
  }
172
179
 
173
180
  fn object(key: &str, value: Value) -> Value {
174
- let mut map = tsrs_core::collections::OrderedMap::default();
181
+ let mut map = JsonMap::default();
175
182
 
176
183
  map.insert(key.to_string(), value);
177
184
 
data/rust/src/status.rs CHANGED
@@ -11,10 +11,10 @@ impl From<ExitStatus> for Status {
11
11
  fn from(status: ExitStatus) -> Self {
12
12
  let name = match status {
13
13
  ExitStatus::Success => "success",
14
- ExitStatus::DiagnosticsPresent_OutputsSkipped => "diagnostics_present_outputs_skipped",
15
- ExitStatus::DiagnosticsPresent_OutputsGenerated => "diagnostics_present_outputs_generated",
16
- ExitStatus::InvalidProject_OutputsSkipped => "invalid_project_outputs_skipped",
17
- ExitStatus::ProjectReferenceCycle_OutputsSkipped => "project_reference_cycle_outputs_skipped",
14
+ ExitStatus::DiagnosticsPresentOutputsSkipped => "diagnostics_present_outputs_skipped",
15
+ ExitStatus::DiagnosticsPresentOutputsGenerated => "diagnostics_present_outputs_generated",
16
+ ExitStatus::InvalidProjectOutputsSkipped => "invalid_project_outputs_skipped",
17
+ ExitStatus::ProjectReferenceCycleOutputsSkipped => "project_reference_cycle_outputs_skipped",
18
18
  ExitStatus::NotImplemented => "not_implemented",
19
19
  };
20
20
 
@@ -1,5 +1,8 @@
1
+ use serde::Deserialize;
1
2
  use serde::Serialize;
2
3
  use serde_json::value::RawValue;
4
+ use tsrs_api::{Handler, Response};
5
+ use tsrs_core::json::{JsonMap, Value};
3
6
 
4
7
  use crate::options::{self, TranspileRequest};
5
8
  use crate::result::{TsrsErrorCode, TsrsResult};
@@ -11,6 +14,14 @@ struct TranspilePayload {
11
14
  diagnostics: Box<RawValue>,
12
15
  }
13
16
 
17
+ #[derive(Deserialize)]
18
+ #[serde(rename_all = "camelCase")]
19
+ struct ApiTranspileResponse {
20
+ output_text: String,
21
+ source_map_text: Option<String>,
22
+ diagnostics: Option<Box<RawValue>>,
23
+ }
24
+
14
25
  pub fn transpile(source: String, request_json: String, declaration: bool) -> TsrsResult {
15
26
  let request: TranspileRequest = match serde_json::from_str(&request_json) {
16
27
  Ok(request) => request,
@@ -35,28 +46,47 @@ fn run(source: &str, request: &TranspileRequest, declaration: bool) -> TsrsResul
35
46
  Err(message) => return TsrsResult::error(TsrsErrorCode::Option, message),
36
47
  };
37
48
 
38
- let output = match tsrs_api::transpile::transpile(
39
- source,
40
- Some(&compiler_options),
41
- &request.file_name,
42
- request.report_diagnostics,
43
- declaration,
44
- ) {
45
- Ok(output) => output,
46
- Err(error) => return TsrsResult::error(TsrsErrorCode::Transpile, error.to_string()),
49
+ let mut options = JsonMap::default();
50
+ options.insert(
51
+ "compilerOptions".to_string(),
52
+ tsrs_tsoptions::gojson::compiler_options_to_go_json(&compiler_options),
53
+ );
54
+ options.insert("fileName".to_string(), Value::String(request.file_name.clone()));
55
+ options.insert("reportDiagnostics".to_string(), Value::Bool(request.report_diagnostics));
56
+
57
+ let mut params = JsonMap::default();
58
+ params.insert("input".to_string(), Value::String(source.to_string()));
59
+ params.insert("options".to_string(), Value::Object(options));
60
+ let params = match tsrs_core::json::marshal(&Value::Object(params)) {
61
+ Ok(params) => params,
62
+ Err(error) => return TsrsResult::error(TsrsErrorCode::Internal, error),
47
63
  };
48
64
 
49
- let diagnostics = tsrs_core::json::Value::Array(output.diagnostics);
65
+ let session = crate::session::new("/").session();
66
+ let method = if declaration {
67
+ "transpileDeclaration"
68
+ } else {
69
+ "transpileModule"
70
+ };
71
+ let response = match session.handle_request(method, params.as_bytes()) {
72
+ Ok(Response::Json(response)) => response,
73
+ Ok(Response::Binary(_)) => {
74
+ return TsrsResult::error(TsrsErrorCode::Internal, "transpilation returned a binary response");
75
+ }
76
+ Err(error) => return TsrsResult::error(TsrsErrorCode::Transpile, error.to_string()),
77
+ };
50
78
 
51
- let diagnostics = match tsrs_core::json::marshal(&diagnostics).map(RawValue::from_string) {
52
- Ok(Ok(diagnostics)) => diagnostics,
53
- _ => return TsrsResult::error(TsrsErrorCode::Internal, "the diagnostics could not be serialized"),
79
+ let output: ApiTranspileResponse = match serde_json::from_str(&response) {
80
+ Ok(output) => output,
81
+ Err(error) => return TsrsResult::error(TsrsErrorCode::Internal, error.to_string()),
54
82
  };
55
83
 
56
84
  let payload = TranspilePayload {
57
85
  code: output.output_text,
58
- map: (!output.source_map_text.is_empty()).then_some(output.source_map_text),
59
- diagnostics,
86
+ map: output.source_map_text.filter(|map| !map.is_empty()),
87
+ diagnostics: output
88
+ .diagnostics
89
+ .unwrap_or_else(|| RawValue::from_string("[]".to_string()).expect("a valid empty JSON array")),
60
90
  };
61
91
 
62
92
  match serde_json::to_string(&payload) {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tsrs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.0
4
+ version: 0.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marco Roth