@glutinum/cli 0.12.0 → 0.14.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.
Files changed (273) hide show
  1. package/README.md +35 -3
  2. package/dist/Glutinum.Converter/Abbreviations.js +246 -0
  3. package/dist/Glutinum.Converter/FsharpAST.js +98 -34
  4. package/dist/Glutinum.Converter/Generate.js +55 -8
  5. package/dist/Glutinum.Converter/GlueAST.js +446 -30
  6. package/dist/Glutinum.Converter/Log.js +7 -8
  7. package/dist/Glutinum.Converter/Merge.js +683 -31
  8. package/dist/Glutinum.Converter/Packages.js +308 -0
  9. package/dist/Glutinum.Converter/Printer.js +332 -170
  10. package/dist/Glutinum.Converter/Read.js +279 -6
  11. package/dist/Glutinum.Converter/Reader/ClassDeclaration.js +13 -7
  12. package/dist/Glutinum.Converter/Reader/Declaration.js +102 -17
  13. package/dist/Glutinum.Converter/Reader/Documentation.js +168 -73
  14. package/dist/Glutinum.Converter/Reader/EnumDeclaration.js +7 -51
  15. package/dist/Glutinum.Converter/Reader/ExportAssignment.js +64 -15
  16. package/dist/Glutinum.Converter/Reader/ExportDeclaration.js +165 -0
  17. package/dist/Glutinum.Converter/Reader/FunctionDeclaration.js +30 -5
  18. package/dist/Glutinum.Converter/Reader/IndexedAccessType.js +122 -4
  19. package/dist/Glutinum.Converter/Reader/InterfaceDeclaration.js +83 -7
  20. package/dist/Glutinum.Converter/Reader/MappedTypeNode.js +8 -8
  21. package/dist/Glutinum.Converter/Reader/ModuleDeclaration.js +11 -8
  22. package/dist/Glutinum.Converter/Reader/NamedTupleMember.js +3 -2
  23. package/dist/Glutinum.Converter/Reader/Node.js +24 -10
  24. package/dist/Glutinum.Converter/Reader/Parameters.js +110 -7
  25. package/dist/Glutinum.Converter/Reader/Report.js +31 -12
  26. package/dist/Glutinum.Converter/Reader/TypeAliasDeclaration.js +4 -3
  27. package/dist/Glutinum.Converter/Reader/TypeNode.js +1527 -248
  28. package/dist/Glutinum.Converter/Reader/TypeOperatorNode.js +75 -20
  29. package/dist/Glutinum.Converter/Reader/TypeParameters.js +8 -5
  30. package/dist/Glutinum.Converter/Reader/TypeQueryNode.js +184 -50
  31. package/dist/Glutinum.Converter/Reader/TypeScriptReader.js +32 -13
  32. package/dist/Glutinum.Converter/Reader/Types.js +180 -0
  33. package/dist/Glutinum.Converter/Reader/UnionTypeNode.js +99 -43
  34. package/dist/Glutinum.Converter/Reader/Utils.js +1143 -55
  35. package/dist/Glutinum.Converter/Reader/VariableStatement.js +59 -14
  36. package/dist/Glutinum.Converter/Transform.js +8710 -1137
  37. package/dist/Glutinum.Converter/TypeScript.Extensions.js +3 -3
  38. package/dist/Glutinum.Converter/TypeScript.js +3 -3
  39. package/dist/Glutinum.Converter/Utils/Keywords.js +6 -6
  40. package/dist/Glutinum.Converter/Utils/List.js +3 -3
  41. package/dist/Glutinum.Converter/Utils/Naming.js +76 -14
  42. package/dist/Glutinum.Converter/Utils/String.js +7 -3
  43. package/dist/Program.js +230 -72
  44. package/package.json +4 -4
  45. package/src/Glutinum.Converter/js/bootstrap.js +109 -2
  46. package/src/Glutinum.Converter/js/host.js +144 -0
  47. package/src/Glutinum.Converter/js/npm.js +137 -0
  48. package/src/Glutinum.Converter/js/resolve.js +402 -0
  49. package/dist/Glutinum.Converter/FsharpAST.js.map +0 -1
  50. package/dist/Glutinum.Converter/Generate.js.map +0 -1
  51. package/dist/Glutinum.Converter/GlueAST.js.map +0 -1
  52. package/dist/Glutinum.Converter/Log.js.map +0 -1
  53. package/dist/Glutinum.Converter/Merge.js.map +0 -1
  54. package/dist/Glutinum.Converter/Printer.js.map +0 -1
  55. package/dist/Glutinum.Converter/Read.js.map +0 -1
  56. package/dist/Glutinum.Converter/Reader/ClassDeclaration.js.map +0 -1
  57. package/dist/Glutinum.Converter/Reader/Declaration.js.map +0 -1
  58. package/dist/Glutinum.Converter/Reader/Documentation.js.map +0 -1
  59. package/dist/Glutinum.Converter/Reader/EnumDeclaration.js.map +0 -1
  60. package/dist/Glutinum.Converter/Reader/ExportAssignment.js.map +0 -1
  61. package/dist/Glutinum.Converter/Reader/FunctionDeclaration.js.map +0 -1
  62. package/dist/Glutinum.Converter/Reader/IndexedAccessType.js.map +0 -1
  63. package/dist/Glutinum.Converter/Reader/InterfaceDeclaration.js.map +0 -1
  64. package/dist/Glutinum.Converter/Reader/MappedTypeNode.js.map +0 -1
  65. package/dist/Glutinum.Converter/Reader/ModuleDeclaration.js.map +0 -1
  66. package/dist/Glutinum.Converter/Reader/NamedTupleMember.js.map +0 -1
  67. package/dist/Glutinum.Converter/Reader/Node.js.map +0 -1
  68. package/dist/Glutinum.Converter/Reader/Parameters.js.map +0 -1
  69. package/dist/Glutinum.Converter/Reader/Report.js.map +0 -1
  70. package/dist/Glutinum.Converter/Reader/TypeAliasDeclaration.js.map +0 -1
  71. package/dist/Glutinum.Converter/Reader/TypeNode.js.map +0 -1
  72. package/dist/Glutinum.Converter/Reader/TypeOperatorNode.js.map +0 -1
  73. package/dist/Glutinum.Converter/Reader/TypeParameters.js.map +0 -1
  74. package/dist/Glutinum.Converter/Reader/TypeQueryNode.js.map +0 -1
  75. package/dist/Glutinum.Converter/Reader/TypeScriptReader.js.map +0 -1
  76. package/dist/Glutinum.Converter/Reader/UnionTypeNode.js.map +0 -1
  77. package/dist/Glutinum.Converter/Reader/Utils.js.map +0 -1
  78. package/dist/Glutinum.Converter/Reader/VariableStatement.js.map +0 -1
  79. package/dist/Glutinum.Converter/Transform.js.map +0 -1
  80. package/dist/Glutinum.Converter/TypeScript.Extensions.js.map +0 -1
  81. package/dist/Glutinum.Converter/TypeScript.js.map +0 -1
  82. package/dist/Glutinum.Converter/Utils/Keywords.js.map +0 -1
  83. package/dist/Glutinum.Converter/Utils/List.js.map +0 -1
  84. package/dist/Glutinum.Converter/Utils/Naming.js.map +0 -1
  85. package/dist/Glutinum.Converter/Utils/String.js.map +0 -1
  86. package/dist/Program.js.map +0 -1
  87. package/dist/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs +0 -57
  88. package/dist/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs.js +0 -105
  89. package/dist/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs.js.map +0 -1
  90. package/dist/fable_modules/Fable.Promise.3.2.0/Fable.Promise.fableproj +0 -20
  91. package/dist/fable_modules/Fable.Promise.3.2.0/Promise.fs +0 -766
  92. package/dist/fable_modules/Fable.Promise.3.2.0/Promise.fs.js +0 -218
  93. package/dist/fable_modules/Fable.Promise.3.2.0/Promise.fs.js.map +0 -1
  94. package/dist/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs +0 -31
  95. package/dist/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.js +0 -20
  96. package/dist/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.js.map +0 -1
  97. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AssemblyInfo.fs +0 -19
  98. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Async.fs +0 -207
  99. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Async.fs.js +0 -127
  100. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Async.fs.js.map +0 -1
  101. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOption.fs +0 -81
  102. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOptionCE.fs +0 -183
  103. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOptionCE.fs.js +0 -37
  104. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOptionCE.fs.js.map +0 -1
  105. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOptionOp.fs +0 -24
  106. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResult.fs +0 -439
  107. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultCE.fs +0 -217
  108. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultCE.fs.js +0 -18
  109. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultCE.fs.js.map +0 -1
  110. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOp.fs +0 -24
  111. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOption.fs +0 -75
  112. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOption.fs.js +0 -26
  113. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOption.fs.js.map +0 -1
  114. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOptionCE.fs +0 -238
  115. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOptionCE.fs.js +0 -18
  116. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOptionCE.fs.js.map +0 -1
  117. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOptionOp.fs +0 -24
  118. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidation.fs +0 -190
  119. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidationCE.fs +0 -194
  120. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidationCE.fs.js +0 -18
  121. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidationCE.fs.js.map +0 -1
  122. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidationOp.fs +0 -35
  123. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/FsToolkit.ErrorHandling.fableproj +0 -51
  124. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/List.fs +0 -218
  125. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/List.fs.js +0 -358
  126. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/List.fs.js.map +0 -1
  127. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Option.fs +0 -331
  128. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionCE.fs +0 -186
  129. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionCE.fs.js +0 -18
  130. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionCE.fs.js.map +0 -1
  131. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionOp.fs +0 -21
  132. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Result.fs +0 -644
  133. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Result.fs.js +0 -45
  134. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Result.fs.js.map +0 -1
  135. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultCE.fs +0 -155
  136. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultCE.fs.js +0 -23
  137. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultCE.fs.js.map +0 -1
  138. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOp.fs +0 -45
  139. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOption.fs +0 -201
  140. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOption.fs.js +0 -65
  141. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOption.fs.js.map +0 -1
  142. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOptionCE.fs +0 -146
  143. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOptionCE.fs.js +0 -18
  144. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOptionCE.fs.js.map +0 -1
  145. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOptionOp.fs +0 -57
  146. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Seq.fs +0 -19
  147. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Seq.fs.js +0 -31
  148. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Seq.fs.js.map +0 -1
  149. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Shims.fs +0 -22
  150. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Shims.fs.js +0 -18
  151. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Shims.fs.js.map +0 -1
  152. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Validation.fs +0 -172
  153. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValidationCE.fs +0 -148
  154. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValidationCE.fs.js +0 -18
  155. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValidationCE.fs.js.map +0 -1
  156. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValidationOp.fs +0 -35
  157. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValueOption.fs +0 -151
  158. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValueOptionCE.fs +0 -165
  159. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Debug/netstandard2.1/.NETStandard,Version=v2.1.AssemblyAttributes.fs +0 -3
  160. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Debug/netstandard2.1/FsToolkit.ErrorHandling.AssemblyInfo.fs +0 -20
  161. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Release/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +0 -3
  162. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Release/netstandard2.0/FsToolkit.ErrorHandling.AssemblyInfo.fs +0 -20
  163. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Release/netstandard2.1/.NETStandard,Version=v2.1.AssemblyAttributes.fs +0 -3
  164. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Release/netstandard2.1/FsToolkit.ErrorHandling.AssemblyInfo.fs +0 -20
  165. package/dist/fable_modules/fable-library-js.4.14.0/Array.d.ts +0 -123
  166. package/dist/fable_modules/fable-library-js.4.14.0/Array.js +0 -1242
  167. package/dist/fable_modules/fable-library-js.4.14.0/Async.d.ts +0 -32
  168. package/dist/fable_modules/fable-library-js.4.14.0/Async.js +0 -158
  169. package/dist/fable_modules/fable-library-js.4.14.0/AsyncBuilder.d.ts +0 -59
  170. package/dist/fable_modules/fable-library-js.4.14.0/AsyncBuilder.js +0 -183
  171. package/dist/fable_modules/fable-library-js.4.14.0/BigInt.d.ts +0 -115
  172. package/dist/fable_modules/fable-library-js.4.14.0/BigInt.js +0 -282
  173. package/dist/fable_modules/fable-library-js.4.14.0/BitConverter.d.ts +0 -27
  174. package/dist/fable_modules/fable-library-js.4.14.0/BitConverter.js +0 -138
  175. package/dist/fable_modules/fable-library-js.4.14.0/Boolean.d.ts +0 -3
  176. package/dist/fable_modules/fable-library-js.4.14.0/Boolean.js +0 -21
  177. package/dist/fable_modules/fable-library-js.4.14.0/CHANGELOG.md +0 -37
  178. package/dist/fable_modules/fable-library-js.4.14.0/Char.d.ts +0 -65
  179. package/dist/fable_modules/fable-library-js.4.14.0/Char.js +0 -169
  180. package/dist/fable_modules/fable-library-js.4.14.0/Choice.d.ts +0 -121
  181. package/dist/fable_modules/fable-library-js.4.14.0/Choice.js +0 -184
  182. package/dist/fable_modules/fable-library-js.4.14.0/Date.d.ts +0 -70
  183. package/dist/fable_modules/fable-library-js.4.14.0/Date.js +0 -749
  184. package/dist/fable_modules/fable-library-js.4.14.0/DateOffset.d.ts +0 -63
  185. package/dist/fable_modules/fable-library-js.4.14.0/DateOffset.js +0 -268
  186. package/dist/fable_modules/fable-library-js.4.14.0/DateOnly.d.ts +0 -18
  187. package/dist/fable_modules/fable-library-js.4.14.0/DateOnly.js +0 -124
  188. package/dist/fable_modules/fable-library-js.4.14.0/Decimal.d.ts +0 -45
  189. package/dist/fable_modules/fable-library-js.4.14.0/Decimal.js +0 -212
  190. package/dist/fable_modules/fable-library-js.4.14.0/Double.d.ts +0 -11
  191. package/dist/fable_modules/fable-library-js.4.14.0/Double.js +0 -46
  192. package/dist/fable_modules/fable-library-js.4.14.0/Encoding.d.ts +0 -12
  193. package/dist/fable_modules/fable-library-js.4.14.0/Encoding.js +0 -173
  194. package/dist/fable_modules/fable-library-js.4.14.0/Event.d.ts +0 -31
  195. package/dist/fable_modules/fable-library-js.4.14.0/Event.js +0 -93
  196. package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Collections.d.ts +0 -7
  197. package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Collections.js +0 -27
  198. package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.CompilerServices.d.ts +0 -12
  199. package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.CompilerServices.js +0 -27
  200. package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.d.ts +0 -17
  201. package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.js +0 -69
  202. package/dist/fable_modules/fable-library-js.4.14.0/Global.d.ts +0 -24
  203. package/dist/fable_modules/fable-library-js.4.14.0/Global.js +0 -8
  204. package/dist/fable_modules/fable-library-js.4.14.0/Guid.d.ts +0 -10
  205. package/dist/fable_modules/fable-library-js.4.14.0/Guid.js +0 -142
  206. package/dist/fable_modules/fable-library-js.4.14.0/Int32.d.ts +0 -28
  207. package/dist/fable_modules/fable-library-js.4.14.0/Int32.js +0 -135
  208. package/dist/fable_modules/fable-library-js.4.14.0/List.d.ts +0 -143
  209. package/dist/fable_modules/fable-library-js.4.14.0/List.js +0 -1273
  210. package/dist/fable_modules/fable-library-js.4.14.0/Long.d.ts +0 -3
  211. package/dist/fable_modules/fable-library-js.4.14.0/Long.js +0 -46
  212. package/dist/fable_modules/fable-library-js.4.14.0/MailboxProcessor.d.ts +0 -25
  213. package/dist/fable_modules/fable-library-js.4.14.0/MailboxProcessor.js +0 -93
  214. package/dist/fable_modules/fable-library-js.4.14.0/Map.d.ts +0 -178
  215. package/dist/fable_modules/fable-library-js.4.14.0/Map.js +0 -1396
  216. package/dist/fable_modules/fable-library-js.4.14.0/MapUtil.d.ts +0 -10
  217. package/dist/fable_modules/fable-library-js.4.14.0/MapUtil.js +0 -112
  218. package/dist/fable_modules/fable-library-js.4.14.0/MutableMap.d.ts +0 -52
  219. package/dist/fable_modules/fable-library-js.4.14.0/MutableMap.js +0 -327
  220. package/dist/fable_modules/fable-library-js.4.14.0/MutableSet.d.ts +0 -39
  221. package/dist/fable_modules/fable-library-js.4.14.0/MutableSet.js +0 -233
  222. package/dist/fable_modules/fable-library-js.4.14.0/Native.d.ts +0 -2
  223. package/dist/fable_modules/fable-library-js.4.14.0/Native.js +0 -8
  224. package/dist/fable_modules/fable-library-js.4.14.0/Numeric.d.ts +0 -19
  225. package/dist/fable_modules/fable-library-js.4.14.0/Numeric.js +0 -71
  226. package/dist/fable_modules/fable-library-js.4.14.0/Observable.d.ts +0 -32
  227. package/dist/fable_modules/fable-library-js.4.14.0/Observable.js +0 -113
  228. package/dist/fable_modules/fable-library-js.4.14.0/Option.d.ts +0 -28
  229. package/dist/fable_modules/fable-library-js.4.14.0/Option.js +0 -96
  230. package/dist/fable_modules/fable-library-js.4.14.0/README.md +0 -3
  231. package/dist/fable_modules/fable-library-js.4.14.0/Random.d.ts +0 -37
  232. package/dist/fable_modules/fable-library-js.4.14.0/Random.js +0 -170
  233. package/dist/fable_modules/fable-library-js.4.14.0/Range.d.ts +0 -12
  234. package/dist/fable_modules/fable-library-js.4.14.0/Range.js +0 -45
  235. package/dist/fable_modules/fable-library-js.4.14.0/Reflection.d.ts +0 -119
  236. package/dist/fable_modules/fable-library-js.4.14.0/Reflection.js +0 -461
  237. package/dist/fable_modules/fable-library-js.4.14.0/RegExp.d.ts +0 -10
  238. package/dist/fable_modules/fable-library-js.4.14.0/RegExp.js +0 -132
  239. package/dist/fable_modules/fable-library-js.4.14.0/Result.d.ts +0 -37
  240. package/dist/fable_modules/fable-library-js.4.14.0/Result.js +0 -165
  241. package/dist/fable_modules/fable-library-js.4.14.0/Seq.d.ts +0 -165
  242. package/dist/fable_modules/fable-library-js.4.14.0/Seq.js +0 -1379
  243. package/dist/fable_modules/fable-library-js.4.14.0/Seq2.d.ts +0 -18
  244. package/dist/fable_modules/fable-library-js.4.14.0/Seq2.js +0 -111
  245. package/dist/fable_modules/fable-library-js.4.14.0/Set.d.ts +0 -190
  246. package/dist/fable_modules/fable-library-js.4.14.0/Set.js +0 -1789
  247. package/dist/fable_modules/fable-library-js.4.14.0/String.d.ts +0 -50
  248. package/dist/fable_modules/fable-library-js.4.14.0/String.js +0 -543
  249. package/dist/fable_modules/fable-library-js.4.14.0/System.Collections.Generic.d.ts +0 -79
  250. package/dist/fable_modules/fable-library-js.4.14.0/System.Collections.Generic.js +0 -317
  251. package/dist/fable_modules/fable-library-js.4.14.0/System.Text.d.ts +0 -38
  252. package/dist/fable_modules/fable-library-js.4.14.0/System.Text.js +0 -162
  253. package/dist/fable_modules/fable-library-js.4.14.0/SystemException.d.ts +0 -5
  254. package/dist/fable_modules/fable-library-js.4.14.0/SystemException.js +0 -5
  255. package/dist/fable_modules/fable-library-js.4.14.0/TimeOnly.d.ts +0 -15
  256. package/dist/fable_modules/fable-library-js.4.14.0/TimeOnly.js +0 -122
  257. package/dist/fable_modules/fable-library-js.4.14.0/TimeSpan.d.ts +0 -34
  258. package/dist/fable_modules/fable-library-js.4.14.0/TimeSpan.js +0 -177
  259. package/dist/fable_modules/fable-library-js.4.14.0/Timer.d.ts +0 -19
  260. package/dist/fable_modules/fable-library-js.4.14.0/Timer.js +0 -67
  261. package/dist/fable_modules/fable-library-js.4.14.0/Types.d.ts +0 -58
  262. package/dist/fable_modules/fable-library-js.4.14.0/Types.js +0 -208
  263. package/dist/fable_modules/fable-library-js.4.14.0/Unicode.13.0.0.d.ts +0 -2
  264. package/dist/fable_modules/fable-library-js.4.14.0/Unicode.13.0.0.js +0 -4
  265. package/dist/fable_modules/fable-library-js.4.14.0/Uri.d.ts +0 -29
  266. package/dist/fable_modules/fable-library-js.4.14.0/Uri.js +0 -142
  267. package/dist/fable_modules/fable-library-js.4.14.0/Util.d.ts +0 -207
  268. package/dist/fable_modules/fable-library-js.4.14.0/Util.js +0 -770
  269. package/dist/fable_modules/fable-library-js.4.14.0/big.d.ts +0 -338
  270. package/dist/fable_modules/fable-library-js.4.14.0/lib/big.d.ts +0 -5
  271. package/dist/fable_modules/fable-library-js.4.14.0/lib/big.js +0 -826
  272. package/dist/fable_modules/fable-library-js.4.14.0/package.json +0 -24
  273. package/dist/fable_modules/project_cracked.json +0 -1
@@ -1,5 +1,6 @@
1
- import { ofArray, iterate } from "../fable_modules/fable-library-js.4.14.0/List.js";
2
- import { printf, toConsole } from "../fable_modules/fable-library-js.4.14.0/String.js";
1
+
2
+ import { ofArray, iterate } from "../fable_modules/fable-library-js.5.17.2/List.js";
3
+ import { printf, toConsole } from "../fable_modules/fable-library-js.5.17.2/String.js";
3
4
 
4
5
  export function TypeScript_Ts_SyntaxKind__SyntaxKind_get_Name(this$) {
5
6
  switch (this$) {
@@ -742,4 +743,3 @@ export function TypeScript_Ts_TypeFlags__TypeFlags_Debug(this$) {
742
743
  }, ofArray([[1, "Any"], [2, "Unknown"], [4, "String"], [8, "Number"], [16, "Boolean"], [32, "Enum"], [64, "BigInt"], [128, "StringLiteral"], [256, "NumberLiteral"], [512, "BooleanLiteral"], [1024, "EnumLiteral"], [2048, "BigIntLiteral"], [4096, "ESSymbol"], [8192, "UniqueESSymbol"], [16384, "Void"], [32768, "Undefined"], [65536, "Null"], [131072, "Never"], [262144, "TypeParameter"], [524288, "Object"], [1048576, "Union"], [2097152, "Intersection"], [4194304, "Index"], [8388608, "IndexedAccess"], [16777216, "Conditional"], [33554432, "Substitution"], [67108864, "NonPrimitive"], [134217728, "TemplateLiteral"], [268435456, "StringMapping"], [2944, "Literal"], [109472, "Unit"], [2976, "Freshable"], [384, "StringOrNumberLiteral"], [117724, "PossiblyFalsy"], [402653316, "StringLike"], [296, "NumberLike"], [2112, "BigIntLike"], [528, "BooleanLike"], [1056, "EnumLike"], [12288, "ESSymbolLike"], [49152, "VoidLike"], [3145728, "UnionOrIntersection"], [3670016, "StructuredType"], [8650752, "TypeVariable"], [58982400, "InstantiableNonPrimitive"], [406847488, "InstantiablePrimitive"], [465829888, "Instantiable"], [469499904, "StructuredOrInstantiable"]]));
743
744
  }
744
745
 
745
- //# sourceMappingURL=TypeScript.Extensions.js.map
@@ -1,4 +1,5 @@
1
- import { class_type } from "../fable_modules/fable-library-js.4.14.0/Reflection.js";
1
+
2
+ import { class_type } from "../fable_modules/fable-library-js.5.17.2/Reflection.js";
2
3
 
3
4
  export class Ts_NoisTypeNodede {
4
5
  constructor() {
@@ -6,7 +7,6 @@ export class Ts_NoisTypeNodede {
6
7
  }
7
8
 
8
9
  export function Ts_NoisTypeNodede_$reflection() {
9
- return class_type("TypeScript.Ts.NoisTypeNodede", void 0, Ts_NoisTypeNodede);
10
+ return class_type("TypeScript.Ts.NoisTypeNodede", undefined, Ts_NoisTypeNodede);
10
11
  }
11
12
 
12
- //# sourceMappingURL=TypeScript.js.map
@@ -1,9 +1,9 @@
1
- import { ofList } from "../../fable_modules/fable-library-js.4.14.0/Set.js";
2
- import { ofArray } from "../../fable_modules/fable-library-js.4.14.0/List.js";
3
- import { comparePrimitives } from "../../fable_modules/fable-library-js.4.14.0/Util.js";
4
1
 
5
- export const fsharp = ofList(ofArray(["abstract", "and", "as", "assert", "base", "begin", "class", "default", "delegate", "do", "done", "downcast", "downto", "elif", "else", "end", "exception", "extern", "false", "finally", "for", "fun", "function", "global", "if", "in", "inherit", "inline", "interface", "internal", "lazy", "let", "match", "member", "module", "mutable", "namespace", "new", "null", "of", "open", "or", "override", "private", "public", "rec", "return", "sig", "static", "struct", "then", "to", "true", "try", "type", "upcast", "use", "val", "void", "when", "while", "with", "yield", "atomic", "break", "checked", "component", "const", "constraint", "constructor", "continue", "eager", "fixed", "fori", "functor", "include", "measure", "method", "mixin", "object", "parallel", "params", "process", "protected", "pure", "recursive", "sealed", "tailcall", "trait", "virtual", "volatile"]), {
6
- Compare: comparePrimitives,
2
+ import { ofList } from "../../fable_modules/fable-library-js.5.17.2/Set.js";
3
+ import { ofArray } from "../../fable_modules/fable-library-js.5.17.2/List.js";
4
+ import { comparePrimitives } from "../../fable_modules/fable-library-js.5.17.2/Util.js";
5
+
6
+ export const fsharp = ofList(ofArray(["abstract", "and", "as", "assert", "base", "begin", "class", "default", "delegate", "do", "done", "downcast", "downto", "elif", "else", "end", "exception", "extern", "false", "finally", "for", "fun", "function", "global", "if", "in", "inherit", "inline", "interface", "internal", "lazy", "let", "match", "member", "module", "mutable", "namespace", "new", "null", "of", "open", "or", "override", "private", "public", "rec", "return", "sig", "static", "struct", "then", "to", "true", "try", "type", "upcast", "use", "val", "void", "when", "while", "with", "yield", "atomic", "break", "checked", "component", "const", "constraint", "constructor", "continue", "eager", "fixed", "fori", "functor", "include", "measure", "method", "mixin", "object", "parallel", "params", "process", "protected", "pure", "recursive", "sealed", "tailcall", "trait", "virtual", "volatile", "mod", "land", "lor", "lxor", "lsl", "lsr", "asr"]), {
7
+ Compare: (x, y) => (comparePrimitives(x, y) | 0),
7
8
  });
8
9
 
9
- //# sourceMappingURL=Keywords.js.map
@@ -1,5 +1,6 @@
1
- import { skipWhile, empty, tail, head, isEmpty, cons, reverse } from "../../fable_modules/fable-library-js.4.14.0/List.js";
2
- import { isNullOrEmpty } from "../../fable_modules/fable-library-js.4.14.0/String.js";
1
+
2
+ import { skipWhile, empty, tail, head, isEmpty, cons, reverse } from "../../fable_modules/fable-library-js.5.17.2/List.js";
3
+ import { isNullOrEmpty } from "../../fable_modules/fable-library-js.5.17.2/String.js";
3
4
 
4
5
  export function removeConsecutiveEmptyLines(list) {
5
6
  const loop = (acc_mut, _arg_mut) => {
@@ -59,4 +60,3 @@ export function trimEmptyLines(list) {
59
60
  return reverse(skipWhile(isNullOrEmpty, reverse(skipWhile(isNullOrEmpty, list))));
60
61
  }
61
62
 
62
- //# sourceMappingURL=List.js.map
@@ -1,9 +1,11 @@
1
- import { isDigit } from "../../fable_modules/fable-library-js.4.14.0/Char.js";
2
- import { FSharpSet__Contains } from "../../fable_modules/fable-library-js.4.14.0/Set.js";
1
+
2
+ import { isLetterOrDigit, isDigit } from "../../fable_modules/fable-library-js.5.17.2/Char.js";
3
+ import { exists } from "../../fable_modules/fable-library-js.5.17.2/Seq.js";
4
+ import { FSharpSet__Contains } from "../../fable_modules/fable-library-js.5.17.2/Set.js";
3
5
  import { fsharp } from "./Keywords.js";
4
- import { replace, substring, isNullOrEmpty } from "../../fable_modules/fable-library-js.4.14.0/String.js";
5
- import { Record } from "../../fable_modules/fable-library-js.4.14.0/Types.js";
6
- import { record_type, bool_type, string_type } from "../../fable_modules/fable-library-js.4.14.0/Reflection.js";
6
+ import { isNullOrWhiteSpace, replace, substring, isNullOrEmpty, concat } from "../../fable_modules/fable-library-js.5.17.2/String.js";
7
+ import { Record } from "../../fable_modules/fable-library-js.5.17.2/Types.js";
8
+ import { record_type, bool_type, string_type } from "../../fable_modules/fable-library-js.5.17.2/Reflection.js";
7
9
 
8
10
  function startWithDigit(name) {
9
11
  if (name.length > 0) {
@@ -15,8 +17,11 @@ function startWithDigit(name) {
15
17
  }
16
18
 
17
19
  function escapeName(name) {
18
- if ((((((((name.indexOf("-") >= 0) ? true : (name.indexOf("$") >= 0)) ? true : (name.indexOf("#") >= 0)) ? true : (name.indexOf("<") >= 0)) ? true : (name.indexOf(">") >= 0)) ? true : (name.indexOf(" ") >= 0)) ? true : startWithDigit(name)) ? true : FSharpSet__Contains(fsharp, name)) {
19
- return `\`\`${name}\`\``;
20
+ if (((name.length > 4) && name.startsWith("``")) && name.endsWith("``")) {
21
+ return name;
22
+ }
23
+ else if ((((name === "_") ? true : exists((c) => !((isLetterOrDigit(c) ? true : (c === "_")) ? true : (c === "\'")), name.split(""))) ? true : startWithDigit(name)) ? true : FSharpSet__Contains(fsharp, name)) {
24
+ return concat("``", name, "``");
20
25
  }
21
26
  else {
22
27
  return name;
@@ -27,7 +32,7 @@ export function removeSurroundingQuotes(text) {
27
32
  if (isNullOrEmpty(text)) {
28
33
  return "";
29
34
  }
30
- else if (text.length < 1) {
35
+ else if (text.length < 2) {
31
36
  return text;
32
37
  }
33
38
  else {
@@ -65,14 +70,43 @@ export function removeSurroundingQuotes(text) {
65
70
  }
66
71
  }
67
72
 
68
- export function replaceDot(text) {
73
+ function replaceDot(text) {
69
74
  return replace(text, ".", "_");
70
75
  }
71
76
 
72
- export function replaceAt(text) {
77
+ function replaceAt(text) {
73
78
  return replace(text, "@", "_AT_");
74
79
  }
75
80
 
81
+ function replaceControlChars(text) {
82
+ return replace(replace(replace(text, "\r", "_CARRIAGE_RETURN_"), "\n", "_NEWLINE_"), "\t", "_TAB_");
83
+ }
84
+
85
+ function replaceEmpty(text) {
86
+ if (isNullOrWhiteSpace(text)) {
87
+ return "_EMPTY_";
88
+ }
89
+ else {
90
+ return text;
91
+ }
92
+ }
93
+
94
+ function replacePlus(text) {
95
+ return replace(text, "+", "_PLUS_");
96
+ }
97
+
98
+ function replaceDollar(text) {
99
+ return replace(text, "$", "_DOLLAR_");
100
+ }
101
+
102
+ function replaceForwardSlash(text) {
103
+ return replace(text, "/", "_SLASH_");
104
+ }
105
+
106
+ function replaceTypeNameInvalidChars(text) {
107
+ return replace(replace(replace(replace(replace(replace(replace(replace(text, "\\", "_BACKSLASH_"), "*", "_STAR_"), "&", "_AMP_"), "[", "_LBRACKET_"), "]", "_RBRACKET_"), "\"", "_QUOTE_"), "\'", "_APOSTROPHE_"), "`", "_BACKTICK_");
108
+ }
109
+
76
110
  export class SanitizeNameResult extends Record {
77
111
  constructor(Name, IsDifferent) {
78
112
  super();
@@ -85,14 +119,42 @@ export function SanitizeNameResult_$reflection() {
85
119
  return record_type("Naming.SanitizeNameResult", [], SanitizeNameResult, () => [["Name", string_type], ["IsDifferent", bool_type]]);
86
120
  }
87
121
 
122
+ function sanitizeWith(extraReplace, name) {
123
+ if (((name.length > 4) && name.startsWith("``")) && name.endsWith("``")) {
124
+ return new SanitizeNameResult(name, false);
125
+ }
126
+ else {
127
+ const sanitizedName = extraReplace(removeSurroundingQuotes(replacePlus(replaceEmpty(replaceControlChars(replaceAt(replaceDot(name)))))));
128
+ const isDifferent = name !== sanitizedName;
129
+ return new SanitizeNameResult(escapeName(sanitizedName), isDifferent);
130
+ }
131
+ }
132
+
88
133
  export function sanitizeNameWithResult(name) {
89
- const sanitizedName = removeSurroundingQuotes(replaceAt(replaceDot(name)));
90
- const isDifferent = name !== sanitizedName;
91
- return new SanitizeNameResult(escapeName(sanitizedName), isDifferent);
134
+ return sanitizeWith((x) => x, name);
135
+ }
136
+
137
+ /**
138
+ * Like <see cref="sanitizeNameWithResult"/> but also replaces characters that
139
+ * are invalid in F# namespace, module, type or union case names (<c>$</c> and
140
+ * <c>/</c>). Use this for type-level names and union/enum case names, not for
141
+ * member names.
142
+ */
143
+ export function sanitizeTypeNameWithResult(name) {
144
+ return sanitizeWith((arg_1) => replaceTypeNameInvalidChars(replaceForwardSlash(replaceDollar(arg_1))), name);
92
145
  }
93
146
 
94
147
  export function sanitizeName(name) {
95
148
  return sanitizeNameWithResult(name).Name;
96
149
  }
97
150
 
98
- //# sourceMappingURL=Naming.js.map
151
+ /**
152
+ * Like <see cref="sanitizeName"/> but also replaces characters that are
153
+ * invalid in F# namespace, module, type or union case names (<c>$</c> and
154
+ * <c>/</c>). Use this for type-level names and union/enum case names, not for
155
+ * member names.
156
+ */
157
+ export function sanitizeTypeName(name) {
158
+ return sanitizeTypeNameWithResult(name).Name;
159
+ }
160
+
@@ -1,10 +1,15 @@
1
- import { trim, replace as replace_1 } from "../../fable_modules/fable-library-js.4.14.0/String.js";
2
- import { ofArray } from "../../fable_modules/fable-library-js.4.14.0/List.js";
1
+
2
+ import { trim, replace as replace_1 } from "../../fable_modules/fable-library-js.5.17.2/String.js";
3
+ import { ofArray } from "../../fable_modules/fable-library-js.5.17.2/List.js";
3
4
 
4
5
  export function replace(oldValue, newValue, input) {
5
6
  return replace_1(input, oldValue, newValue);
6
7
  }
7
8
 
9
+ export function normalizePath(path) {
10
+ return replace_1(path, "\\", "/");
11
+ }
12
+
8
13
  export function removeSingleQuote(text) {
9
14
  return trim(text, "\'");
10
15
  }
@@ -25,4 +30,3 @@ export function splitLines(text) {
25
30
  return ofArray(replace_1(replace_1(text, "\r\n", "\n"), "\r", "\n").split("\n"));
26
31
  }
27
32
 
28
- //# sourceMappingURL=String.js.map
package/dist/Program.js CHANGED
@@ -1,12 +1,17 @@
1
- import { error, success, info, log } from "./Glutinum.Converter/Log.js";
2
- import { tail, head, isEmpty, ofArray } from "./fable_modules/fable-library-js.4.14.0/List.js";
3
- import { generateBindingFile } from "./Glutinum.Converter/Generate.js";
1
+
2
+ import { success, info, error, log } from "./Glutinum.Converter/Log.js";
3
+ import { generateBindingFile, generatePackagesFromDisk } from "./Glutinum.Converter/Generate.js";
4
+ import { length, exists, filter, contains, cons, singleton, append, reverse, ofArray, tail as tail_5, head, isEmpty, empty } from "./fable_modules/fable-library-js.5.17.2/List.js";
5
+ import { item, equalsWith } from "./fable_modules/fable-library-js.5.17.2/Array.js";
6
+ import { stringHash, defaultOf } from "./fable_modules/fable-library-js.5.17.2/Util.js";
7
+ import { defaultOptions, GenerateOptions } from "./Glutinum.Converter/Packages.js";
8
+ import { join, concat } from "./fable_modules/fable-library-js.5.17.2/String.js";
4
9
  import * as path from "path";
5
10
  import * as fs from "fs";
6
11
 
7
12
  export function printHelp() {
8
- const helpText = "\nGenerate Fable bindings from TypeScript definitions - https://github.com/glutinum-org/cl\n\nUSAGE\n\n glutinum <input> [--out-file <output>]\n glue <input> [--out-file <output>]\n\nOPTIONS\n\n --out-file <output> Destination file to write in\n If not specified, the result will be printed to stdout\n -h, --help Print this help message\n\nEXAMPLES\n\n glutinum ./node_modules/my-lib/index.d.ts --out-file ./Glutinum.MyLib.fs\n glutinum ./node_modules/my-lib/index.d.ts\n ";
9
- log(`${helpText}`);
13
+ const helpText = "\nGenerate Fable bindings from TypeScript definitions - https://github.com/glutinum-org/cl\n\nUSAGE\n\n glutinum <input>... [--out-file <output>]\n glutinum --all [--out-file <output>]\n glue <input>... [--out-file <output>]\n\n <input> can be:\n - an installed package name (e.g. chalk, @types/vscode)\n - a path to a package directory (e.g. ./node_modules/chalk)\n - a path to a .d.ts file (e.g. ./node_modules/chalk/source/index.d.ts)\n\n Several packages are generated in the same file, each one with every\n package it depends on. A .d.ts file is generated alone.\n --all generates every package installed in the nearest node_modules.\n\n The types of @types/node and @types/web (the DOM) are referenced from the\n Glutinum.Node and Glutinum.Web bindings, unless asked for or --no-externals.\n\nOPTIONS\n\n --out-file <output> Destination file to write in\n If not specified, the result will be printed to stdout\n --no-externals Generate @types/node and @types/web with the packages\n using them instead of referencing their bindings\n --external <package> Reference <package> from its own binding instead of\n generating it, `Glutinum.<Module>` is derived from its\n name unless given as <package>=<Module>\n Can be repeated\n --module-name <name> Full name of the generated module, `Glutinum.Types.TypeScript`,\n instead of `Glutinum.<Module>` derived from the package name\n --include <names> Comma-separated declarations to keep, the others are dropped\n Can be repeated\n --no-lib Create the program without the TypeScript library, for a\n package made of its files\n -h, --help Print this help message\n\nEXAMPLES\n\n glutinum chalk --out-file ./Glutinum.Chalk.fs\n glutinum vscode vscode-languageclient --out-file ./Glutinum.Vscode.fs\n glutinum leaflet --external @types/geojson --out-file ./Glutinum.Leaflet.fs\n glutinum --all --out-file ./Glutinum.fs\n glutinum ./node_modules/my-lib/index.d.ts\n ";
14
+ log(helpText);
10
15
  }
11
16
 
12
17
  function getVersion() {
@@ -16,9 +21,50 @@ function getVersion() {
16
21
  ;
17
22
  }
18
23
 
24
+ function generate(options, inputs) {
25
+ let matchResult, input_1, inputs_1;
26
+ if (!isEmpty(inputs)) {
27
+ if (head(inputs) === "--all") {
28
+ if (isEmpty(tail_5(inputs))) {
29
+ matchResult = 0;
30
+ }
31
+ else {
32
+ matchResult = 2;
33
+ inputs_1 = inputs;
34
+ }
35
+ }
36
+ else if (isEmpty(tail_5(inputs))) {
37
+ if (head(inputs).endsWith(".d.ts")) {
38
+ matchResult = 1;
39
+ input_1 = head(inputs);
40
+ }
41
+ else {
42
+ matchResult = 2;
43
+ inputs_1 = inputs;
44
+ }
45
+ }
46
+ else {
47
+ matchResult = 2;
48
+ inputs_1 = inputs;
49
+ }
50
+ }
51
+ else {
52
+ matchResult = 2;
53
+ inputs_1 = inputs;
54
+ }
55
+ switch (matchResult) {
56
+ case 0:
57
+ return generatePackagesFromDisk(options, empty());
58
+ case 1:
59
+ return generateBindingFile(input_1);
60
+ default:
61
+ return generatePackagesFromDisk(options, inputs_1);
62
+ }
63
+ }
64
+
19
65
  (function (argv) {
20
66
  const argv_1 = ofArray(argv);
21
- let matchResult, input, outFile, input_1;
67
+ let matchResult;
22
68
  if (!isEmpty(argv_1)) {
23
69
  switch (head(argv_1)) {
24
70
  case "-h":
@@ -28,54 +74,16 @@ function getVersion() {
28
74
  break;
29
75
  }
30
76
  case "--version": {
31
- if (!isEmpty(tail(argv_1))) {
32
- if (head(tail(argv_1)) === "--out-file") {
33
- if (!isEmpty(tail(tail(argv_1)))) {
34
- if (isEmpty(tail(tail(tail(argv_1))))) {
35
- matchResult = 2;
36
- input = head(argv_1);
37
- outFile = head(tail(tail(argv_1)));
38
- }
39
- else {
40
- matchResult = 4;
41
- }
42
- }
43
- else {
44
- matchResult = 4;
45
- }
46
- }
47
- else {
48
- matchResult = 4;
49
- }
77
+ if (isEmpty(tail_5(argv_1))) {
78
+ matchResult = 1;
50
79
  }
51
80
  else {
52
- matchResult = 1;
81
+ matchResult = 2;
53
82
  }
54
83
  break;
55
84
  }
56
85
  default:
57
- if (isEmpty(tail(argv_1))) {
58
- matchResult = 3;
59
- input_1 = head(argv_1);
60
- }
61
- else if (head(tail(argv_1)) === "--out-file") {
62
- if (!isEmpty(tail(tail(argv_1)))) {
63
- if (isEmpty(tail(tail(tail(argv_1))))) {
64
- matchResult = 2;
65
- input = head(argv_1);
66
- outFile = head(tail(tail(argv_1)));
67
- }
68
- else {
69
- matchResult = 4;
70
- }
71
- }
72
- else {
73
- matchResult = 4;
74
- }
75
- }
76
- else {
77
- matchResult = 4;
78
- }
86
+ matchResult = 2;
79
87
  }
80
88
  }
81
89
  else {
@@ -87,34 +95,184 @@ function getVersion() {
87
95
  return 0;
88
96
  }
89
97
  case 1: {
90
- log(`${getVersion()}`);
91
- return 0;
92
- }
93
- case 2: {
94
- info(`Generating binding file for ${input}`);
95
- const res = generateBindingFile(input);
96
- const outFileDir = path.dirname(outFile);
97
- fs.mkdirSync(outFileDir, {
98
- recursive: true,
99
- });
100
- fs.writeFileSync(outFile, res);
101
- info(`Bindings written to: ${path.join(process.cwd(), outFile)}`);
102
- success("Success!");
103
- return 0;
104
- }
105
- case 3: {
106
- info(`Generating binding file for ${input_1}`);
107
- const res_1 = generateBindingFile(input_1);
108
- process.stdout.write(res_1);
109
- success("Success!");
98
+ log(getVersion());
110
99
  return 0;
111
100
  }
112
101
  default: {
113
- error("Invalid arguments");
114
- printHelp();
115
- return 1;
102
+ let patternInput;
103
+ const matchValue = reverse(argv_1);
104
+ let matchResult_1, inputs, outFile;
105
+ if (!isEmpty(matchValue)) {
106
+ if (!isEmpty(tail_5(matchValue))) {
107
+ if (head(tail_5(matchValue)) === "--out-file") {
108
+ matchResult_1 = 0;
109
+ inputs = tail_5(tail_5(matchValue));
110
+ outFile = head(matchValue);
111
+ }
112
+ else {
113
+ matchResult_1 = 1;
114
+ }
115
+ }
116
+ else {
117
+ matchResult_1 = 1;
118
+ }
119
+ }
120
+ else {
121
+ matchResult_1 = 1;
122
+ }
123
+ switch (matchResult_1) {
124
+ case 0: {
125
+ patternInput = [reverse(inputs), outFile];
126
+ break;
127
+ }
128
+ default:
129
+ patternInput = [argv_1, undefined];
130
+ }
131
+ const outFile_1 = patternInput[1];
132
+ const takeOptions = (args_mut, options_mut, rest_mut) => {
133
+ takeOptions:
134
+ while (true) {
135
+ const args = args_mut, options = options_mut, rest = rest_mut;
136
+ let matchValue_1;
137
+ let matchResult_2, tail, value, tail_1, value_1, tail_2, tail_3, value_2, arg, tail_4;
138
+ if (isEmpty(args)) {
139
+ matchResult_2 = 5;
140
+ }
141
+ else {
142
+ switch (head(args)) {
143
+ case "--external": {
144
+ if (!isEmpty(tail_5(args))) {
145
+ matchResult_2 = 0;
146
+ tail = tail_5(tail_5(args));
147
+ value = head(tail_5(args));
148
+ }
149
+ else {
150
+ matchResult_2 = 4;
151
+ arg = head(args);
152
+ tail_4 = tail_5(args);
153
+ }
154
+ break;
155
+ }
156
+ case "--module-name": {
157
+ if (!isEmpty(tail_5(args))) {
158
+ matchResult_2 = 1;
159
+ tail_1 = tail_5(tail_5(args));
160
+ value_1 = head(tail_5(args));
161
+ }
162
+ else {
163
+ matchResult_2 = 4;
164
+ arg = head(args);
165
+ tail_4 = tail_5(args);
166
+ }
167
+ break;
168
+ }
169
+ case "--no-lib": {
170
+ matchResult_2 = 2;
171
+ tail_2 = tail_5(args);
172
+ break;
173
+ }
174
+ case "--include": {
175
+ if (!isEmpty(tail_5(args))) {
176
+ matchResult_2 = 3;
177
+ tail_3 = tail_5(tail_5(args));
178
+ value_2 = head(tail_5(args));
179
+ }
180
+ else {
181
+ matchResult_2 = 4;
182
+ arg = head(args);
183
+ tail_4 = tail_5(args);
184
+ }
185
+ break;
186
+ }
187
+ default: {
188
+ matchResult_2 = 4;
189
+ arg = head(args);
190
+ tail_4 = tail_5(args);
191
+ }
192
+ }
193
+ }
194
+ switch (matchResult_2) {
195
+ case 0: {
196
+ args_mut = tail;
197
+ options_mut = (new GenerateOptions(options.ExternalPackages, append(options.Externals, singleton((matchValue_1 = value.split("="), (!equalsWith((x, y) => (x === y), matchValue_1, defaultOf()) && (matchValue_1.length === 2)) ? [item(0, matchValue_1), item(1, matchValue_1)] : [value, undefined]))), options.ModuleName, options.Include, options.NoLib));
198
+ rest_mut = rest;
199
+ continue takeOptions;
200
+ }
201
+ case 1: {
202
+ args_mut = tail_1;
203
+ options_mut = (new GenerateOptions(options.ExternalPackages, options.Externals, value_1, options.Include, options.NoLib));
204
+ rest_mut = rest;
205
+ continue takeOptions;
206
+ }
207
+ case 2: {
208
+ args_mut = tail_2;
209
+ options_mut = (new GenerateOptions(options.ExternalPackages, options.Externals, options.ModuleName, options.Include, true));
210
+ rest_mut = rest;
211
+ continue takeOptions;
212
+ }
213
+ case 3: {
214
+ args_mut = tail_3;
215
+ options_mut = (new GenerateOptions(options.ExternalPackages, options.Externals, options.ModuleName, append(options.Include, ofArray(value_2.split(","))), options.NoLib));
216
+ rest_mut = rest;
217
+ continue takeOptions;
218
+ }
219
+ case 4: {
220
+ args_mut = tail_4;
221
+ options_mut = options;
222
+ rest_mut = cons(arg, rest);
223
+ continue takeOptions;
224
+ }
225
+ default:
226
+ return [options, reverse(rest)];
227
+ }
228
+ break;
229
+ }
230
+ };
231
+ const patternInput_1 = takeOptions(patternInput[0], defaultOptions, empty());
232
+ const options_1 = patternInput_1[0];
233
+ const inputs_2 = patternInput_1[1];
234
+ const options_2 = new GenerateOptions(!contains("--no-externals", inputs_2, {
235
+ Equals: (x_1, y_1) => (x_1 === y_1),
236
+ GetHashCode: (x_1) => (stringHash(x_1) | 0),
237
+ }), options_1.Externals, options_1.ModuleName, options_1.Include, options_1.NoLib);
238
+ const inputs_3 = filter((input) => (input !== "--no-externals"), inputs_2);
239
+ const hasUnknownOption = exists((input_1) => {
240
+ if (input_1.startsWith("-")) {
241
+ return input_1 !== "--all";
242
+ }
243
+ else {
244
+ return false;
245
+ }
246
+ }, inputs_3);
247
+ const mixesFileAndPackages = (length(inputs_3) > 1) && exists((input_2) => input_2.endsWith(".d.ts"), inputs_3);
248
+ if (isEmpty(inputs_3) ? true : hasUnknownOption) {
249
+ error("Invalid arguments");
250
+ printHelp();
251
+ return 1;
252
+ }
253
+ else if (mixesFileAndPackages) {
254
+ error("A .d.ts file is generated alone, it can\'t be combined with other inputs");
255
+ return 1;
256
+ }
257
+ else {
258
+ info(concat("Generating binding file for ", join(", ", inputs_3)));
259
+ const res = generate(options_2, inputs_3);
260
+ if (outFile_1 == null) {
261
+ process.stdout.write(res);
262
+ }
263
+ else {
264
+ const outFile_2 = outFile_1;
265
+ const outFileDir = path.dirname(outFile_2);
266
+ fs.mkdirSync(outFileDir, {
267
+ recursive: true,
268
+ });
269
+ fs.writeFileSync(outFile_2, res);
270
+ info(concat("Bindings written to: ", path.join(process.cwd(), outFile_2)));
271
+ }
272
+ success("Success!");
273
+ return 0;
274
+ }
116
275
  }
117
276
  }
118
277
  })(typeof process === 'object' ? process.argv.slice(2) : []);
119
278
 
120
- //# sourceMappingURL=Program.js.map
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@glutinum/cli",
3
- "version": "0.12.0",
3
+ "version": "0.14.0",
4
4
  "description": "TypeScript definition to F# bindings converter",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "engines": {
8
8
  "node": ">=16",
9
- "pnpm": "8"
9
+ "pnpm": "11"
10
10
  },
11
11
  "bin": {
12
12
  "glue": "./cli.js",
@@ -43,6 +43,7 @@
43
43
  "lz-string": "^1.5.0",
44
44
  "monaco-editor": "^0.46.0",
45
45
  "nodemon": "^3.1.0",
46
+ "playwright": "^1.63.0",
46
47
  "react": "^18.2.0",
47
48
  "react-dom": "^18.2.0",
48
49
  "sass": "^1.75.0",
@@ -51,7 +52,6 @@
51
52
  },
52
53
  "dependencies": {
53
54
  "@ts-morph/bootstrap": "^0.22.0",
54
- "chalk": "^5.3.0",
55
- "typescript": "^5.2.2"
55
+ "chalk": "^5.3.0"
56
56
  }
57
57
  }