@glutinum/cli 0.13.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.
- package/README.md +19 -1
- package/dist/Glutinum.Converter/Abbreviations.js +246 -0
- package/dist/Glutinum.Converter/FsharpAST.js +87 -28
- package/dist/Glutinum.Converter/Generate.js +55 -8
- package/dist/Glutinum.Converter/GlueAST.js +333 -34
- package/dist/Glutinum.Converter/Log.js +7 -8
- package/dist/Glutinum.Converter/Merge.js +683 -31
- package/dist/Glutinum.Converter/Packages.js +308 -0
- package/dist/Glutinum.Converter/Printer.js +323 -186
- package/dist/Glutinum.Converter/Read.js +279 -6
- package/dist/Glutinum.Converter/Reader/ClassDeclaration.js +13 -7
- package/dist/Glutinum.Converter/Reader/Declaration.js +102 -17
- package/dist/Glutinum.Converter/Reader/Documentation.js +168 -73
- package/dist/Glutinum.Converter/Reader/EnumDeclaration.js +7 -51
- package/dist/Glutinum.Converter/Reader/ExportAssignment.js +64 -15
- package/dist/Glutinum.Converter/Reader/ExportDeclaration.js +165 -0
- package/dist/Glutinum.Converter/Reader/FunctionDeclaration.js +30 -5
- package/dist/Glutinum.Converter/Reader/IndexedAccessType.js +122 -4
- package/dist/Glutinum.Converter/Reader/InterfaceDeclaration.js +83 -7
- package/dist/Glutinum.Converter/Reader/MappedTypeNode.js +8 -8
- package/dist/Glutinum.Converter/Reader/ModuleDeclaration.js +11 -9
- package/dist/Glutinum.Converter/Reader/NamedTupleMember.js +3 -2
- package/dist/Glutinum.Converter/Reader/Node.js +24 -10
- package/dist/Glutinum.Converter/Reader/Parameters.js +110 -7
- package/dist/Glutinum.Converter/Reader/Report.js +31 -12
- package/dist/Glutinum.Converter/Reader/TypeAliasDeclaration.js +4 -3
- package/dist/Glutinum.Converter/Reader/TypeNode.js +1524 -253
- package/dist/Glutinum.Converter/Reader/TypeOperatorNode.js +75 -20
- package/dist/Glutinum.Converter/Reader/TypeParameters.js +8 -5
- package/dist/Glutinum.Converter/Reader/TypeQueryNode.js +184 -50
- package/dist/Glutinum.Converter/Reader/TypeScriptReader.js +32 -13
- package/dist/Glutinum.Converter/Reader/Types.js +180 -0
- package/dist/Glutinum.Converter/Reader/UnionTypeNode.js +99 -43
- package/dist/Glutinum.Converter/Reader/Utils.js +1143 -55
- package/dist/Glutinum.Converter/Reader/VariableStatement.js +59 -14
- package/dist/Glutinum.Converter/Transform.js +8292 -1119
- package/dist/Glutinum.Converter/TypeScript.Extensions.js +3 -3
- package/dist/Glutinum.Converter/TypeScript.js +3 -3
- package/dist/Glutinum.Converter/Utils/Keywords.js +6 -6
- package/dist/Glutinum.Converter/Utils/List.js +3 -3
- package/dist/Glutinum.Converter/Utils/Naming.js +61 -12
- package/dist/Glutinum.Converter/Utils/String.js +7 -3
- package/dist/Program.js +230 -72
- package/package.json +4 -4
- package/src/Glutinum.Converter/js/bootstrap.js +109 -2
- package/src/Glutinum.Converter/js/host.js +144 -0
- package/src/Glutinum.Converter/js/npm.js +137 -0
- package/src/Glutinum.Converter/js/resolve.js +402 -0
- package/dist/Glutinum.Converter/FsharpAST.js.map +0 -1
- package/dist/Glutinum.Converter/Generate.js.map +0 -1
- package/dist/Glutinum.Converter/GlueAST.js.map +0 -1
- package/dist/Glutinum.Converter/Log.js.map +0 -1
- package/dist/Glutinum.Converter/Merge.js.map +0 -1
- package/dist/Glutinum.Converter/Printer.js.map +0 -1
- package/dist/Glutinum.Converter/Read.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/ClassDeclaration.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/Declaration.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/Documentation.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/EnumDeclaration.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/ExportAssignment.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/FunctionDeclaration.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/IndexedAccessType.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/InterfaceDeclaration.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/MappedTypeNode.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/ModuleDeclaration.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/NamedTupleMember.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/Node.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/Parameters.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/Report.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/TypeAliasDeclaration.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/TypeNode.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/TypeOperatorNode.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/TypeParameters.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/TypeQueryNode.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/TypeScriptReader.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/UnionTypeNode.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/Utils.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/VariableStatement.js.map +0 -1
- package/dist/Glutinum.Converter/Transform.js.map +0 -1
- package/dist/Glutinum.Converter/TypeScript.Extensions.js.map +0 -1
- package/dist/Glutinum.Converter/TypeScript.js.map +0 -1
- package/dist/Glutinum.Converter/Utils/Keywords.js.map +0 -1
- package/dist/Glutinum.Converter/Utils/List.js.map +0 -1
- package/dist/Glutinum.Converter/Utils/Naming.js.map +0 -1
- package/dist/Glutinum.Converter/Utils/String.js.map +0 -1
- package/dist/Program.js.map +0 -1
- package/dist/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs +0 -57
- package/dist/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs.js +0 -105
- package/dist/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs.js.map +0 -1
- package/dist/fable_modules/Fable.Promise.3.2.0/Fable.Promise.fableproj +0 -20
- package/dist/fable_modules/Fable.Promise.3.2.0/Promise.fs +0 -766
- package/dist/fable_modules/Fable.Promise.3.2.0/Promise.fs.js +0 -218
- package/dist/fable_modules/Fable.Promise.3.2.0/Promise.fs.js.map +0 -1
- package/dist/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs +0 -31
- package/dist/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.js +0 -20
- package/dist/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AssemblyInfo.fs +0 -19
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Async.fs +0 -207
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Async.fs.js +0 -127
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Async.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOption.fs +0 -81
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOptionCE.fs +0 -183
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOptionCE.fs.js +0 -37
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOptionCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOptionOp.fs +0 -24
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResult.fs +0 -439
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultCE.fs +0 -217
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultCE.fs.js +0 -18
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOp.fs +0 -24
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOption.fs +0 -75
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOption.fs.js +0 -26
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOption.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOptionCE.fs +0 -238
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOptionCE.fs.js +0 -18
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOptionCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOptionOp.fs +0 -24
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidation.fs +0 -190
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidationCE.fs +0 -194
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidationCE.fs.js +0 -18
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidationCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidationOp.fs +0 -35
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/FsToolkit.ErrorHandling.fableproj +0 -51
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/List.fs +0 -218
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/List.fs.js +0 -358
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/List.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Option.fs +0 -331
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionCE.fs +0 -186
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionCE.fs.js +0 -18
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionOp.fs +0 -21
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Result.fs +0 -644
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Result.fs.js +0 -45
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Result.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultCE.fs +0 -155
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultCE.fs.js +0 -23
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOp.fs +0 -45
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOption.fs +0 -201
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOption.fs.js +0 -65
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOption.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOptionCE.fs +0 -146
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOptionCE.fs.js +0 -18
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOptionCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOptionOp.fs +0 -57
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Seq.fs +0 -19
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Seq.fs.js +0 -31
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Seq.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Shims.fs +0 -22
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Shims.fs.js +0 -18
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Shims.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Validation.fs +0 -172
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValidationCE.fs +0 -148
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValidationCE.fs.js +0 -18
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValidationCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValidationOp.fs +0 -35
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValueOption.fs +0 -151
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValueOptionCE.fs +0 -165
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Debug/netstandard2.1/.NETStandard,Version=v2.1.AssemblyAttributes.fs +0 -3
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Debug/netstandard2.1/FsToolkit.ErrorHandling.AssemblyInfo.fs +0 -20
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Release/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +0 -3
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Release/netstandard2.0/FsToolkit.ErrorHandling.AssemblyInfo.fs +0 -20
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Release/netstandard2.1/.NETStandard,Version=v2.1.AssemblyAttributes.fs +0 -3
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Release/netstandard2.1/FsToolkit.ErrorHandling.AssemblyInfo.fs +0 -20
- package/dist/fable_modules/fable-library-js.4.14.0/Array.d.ts +0 -123
- package/dist/fable_modules/fable-library-js.4.14.0/Array.js +0 -1242
- package/dist/fable_modules/fable-library-js.4.14.0/Async.d.ts +0 -32
- package/dist/fable_modules/fable-library-js.4.14.0/Async.js +0 -158
- package/dist/fable_modules/fable-library-js.4.14.0/AsyncBuilder.d.ts +0 -59
- package/dist/fable_modules/fable-library-js.4.14.0/AsyncBuilder.js +0 -183
- package/dist/fable_modules/fable-library-js.4.14.0/BigInt.d.ts +0 -115
- package/dist/fable_modules/fable-library-js.4.14.0/BigInt.js +0 -282
- package/dist/fable_modules/fable-library-js.4.14.0/BitConverter.d.ts +0 -27
- package/dist/fable_modules/fable-library-js.4.14.0/BitConverter.js +0 -138
- package/dist/fable_modules/fable-library-js.4.14.0/Boolean.d.ts +0 -3
- package/dist/fable_modules/fable-library-js.4.14.0/Boolean.js +0 -21
- package/dist/fable_modules/fable-library-js.4.14.0/CHANGELOG.md +0 -37
- package/dist/fable_modules/fable-library-js.4.14.0/Char.d.ts +0 -65
- package/dist/fable_modules/fable-library-js.4.14.0/Char.js +0 -169
- package/dist/fable_modules/fable-library-js.4.14.0/Choice.d.ts +0 -121
- package/dist/fable_modules/fable-library-js.4.14.0/Choice.js +0 -184
- package/dist/fable_modules/fable-library-js.4.14.0/Date.d.ts +0 -70
- package/dist/fable_modules/fable-library-js.4.14.0/Date.js +0 -749
- package/dist/fable_modules/fable-library-js.4.14.0/DateOffset.d.ts +0 -63
- package/dist/fable_modules/fable-library-js.4.14.0/DateOffset.js +0 -268
- package/dist/fable_modules/fable-library-js.4.14.0/DateOnly.d.ts +0 -18
- package/dist/fable_modules/fable-library-js.4.14.0/DateOnly.js +0 -124
- package/dist/fable_modules/fable-library-js.4.14.0/Decimal.d.ts +0 -45
- package/dist/fable_modules/fable-library-js.4.14.0/Decimal.js +0 -212
- package/dist/fable_modules/fable-library-js.4.14.0/Double.d.ts +0 -11
- package/dist/fable_modules/fable-library-js.4.14.0/Double.js +0 -46
- package/dist/fable_modules/fable-library-js.4.14.0/Encoding.d.ts +0 -12
- package/dist/fable_modules/fable-library-js.4.14.0/Encoding.js +0 -173
- package/dist/fable_modules/fable-library-js.4.14.0/Event.d.ts +0 -31
- package/dist/fable_modules/fable-library-js.4.14.0/Event.js +0 -93
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Collections.d.ts +0 -7
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Collections.js +0 -27
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.CompilerServices.d.ts +0 -12
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.CompilerServices.js +0 -27
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.d.ts +0 -17
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.js +0 -69
- package/dist/fable_modules/fable-library-js.4.14.0/Global.d.ts +0 -24
- package/dist/fable_modules/fable-library-js.4.14.0/Global.js +0 -8
- package/dist/fable_modules/fable-library-js.4.14.0/Guid.d.ts +0 -10
- package/dist/fable_modules/fable-library-js.4.14.0/Guid.js +0 -142
- package/dist/fable_modules/fable-library-js.4.14.0/Int32.d.ts +0 -28
- package/dist/fable_modules/fable-library-js.4.14.0/Int32.js +0 -135
- package/dist/fable_modules/fable-library-js.4.14.0/List.d.ts +0 -143
- package/dist/fable_modules/fable-library-js.4.14.0/List.js +0 -1273
- package/dist/fable_modules/fable-library-js.4.14.0/Long.d.ts +0 -3
- package/dist/fable_modules/fable-library-js.4.14.0/Long.js +0 -46
- package/dist/fable_modules/fable-library-js.4.14.0/MailboxProcessor.d.ts +0 -25
- package/dist/fable_modules/fable-library-js.4.14.0/MailboxProcessor.js +0 -93
- package/dist/fable_modules/fable-library-js.4.14.0/Map.d.ts +0 -178
- package/dist/fable_modules/fable-library-js.4.14.0/Map.js +0 -1396
- package/dist/fable_modules/fable-library-js.4.14.0/MapUtil.d.ts +0 -10
- package/dist/fable_modules/fable-library-js.4.14.0/MapUtil.js +0 -112
- package/dist/fable_modules/fable-library-js.4.14.0/MutableMap.d.ts +0 -52
- package/dist/fable_modules/fable-library-js.4.14.0/MutableMap.js +0 -327
- package/dist/fable_modules/fable-library-js.4.14.0/MutableSet.d.ts +0 -39
- package/dist/fable_modules/fable-library-js.4.14.0/MutableSet.js +0 -233
- package/dist/fable_modules/fable-library-js.4.14.0/Native.d.ts +0 -2
- package/dist/fable_modules/fable-library-js.4.14.0/Native.js +0 -8
- package/dist/fable_modules/fable-library-js.4.14.0/Numeric.d.ts +0 -19
- package/dist/fable_modules/fable-library-js.4.14.0/Numeric.js +0 -71
- package/dist/fable_modules/fable-library-js.4.14.0/Observable.d.ts +0 -32
- package/dist/fable_modules/fable-library-js.4.14.0/Observable.js +0 -113
- package/dist/fable_modules/fable-library-js.4.14.0/Option.d.ts +0 -28
- package/dist/fable_modules/fable-library-js.4.14.0/Option.js +0 -96
- package/dist/fable_modules/fable-library-js.4.14.0/README.md +0 -3
- package/dist/fable_modules/fable-library-js.4.14.0/Random.d.ts +0 -37
- package/dist/fable_modules/fable-library-js.4.14.0/Random.js +0 -170
- package/dist/fable_modules/fable-library-js.4.14.0/Range.d.ts +0 -12
- package/dist/fable_modules/fable-library-js.4.14.0/Range.js +0 -45
- package/dist/fable_modules/fable-library-js.4.14.0/Reflection.d.ts +0 -119
- package/dist/fable_modules/fable-library-js.4.14.0/Reflection.js +0 -461
- package/dist/fable_modules/fable-library-js.4.14.0/RegExp.d.ts +0 -10
- package/dist/fable_modules/fable-library-js.4.14.0/RegExp.js +0 -132
- package/dist/fable_modules/fable-library-js.4.14.0/Result.d.ts +0 -37
- package/dist/fable_modules/fable-library-js.4.14.0/Result.js +0 -165
- package/dist/fable_modules/fable-library-js.4.14.0/Seq.d.ts +0 -165
- package/dist/fable_modules/fable-library-js.4.14.0/Seq.js +0 -1379
- package/dist/fable_modules/fable-library-js.4.14.0/Seq2.d.ts +0 -18
- package/dist/fable_modules/fable-library-js.4.14.0/Seq2.js +0 -111
- package/dist/fable_modules/fable-library-js.4.14.0/Set.d.ts +0 -190
- package/dist/fable_modules/fable-library-js.4.14.0/Set.js +0 -1789
- package/dist/fable_modules/fable-library-js.4.14.0/String.d.ts +0 -50
- package/dist/fable_modules/fable-library-js.4.14.0/String.js +0 -543
- package/dist/fable_modules/fable-library-js.4.14.0/System.Collections.Generic.d.ts +0 -79
- package/dist/fable_modules/fable-library-js.4.14.0/System.Collections.Generic.js +0 -317
- package/dist/fable_modules/fable-library-js.4.14.0/System.Text.d.ts +0 -38
- package/dist/fable_modules/fable-library-js.4.14.0/System.Text.js +0 -162
- package/dist/fable_modules/fable-library-js.4.14.0/SystemException.d.ts +0 -5
- package/dist/fable_modules/fable-library-js.4.14.0/SystemException.js +0 -5
- package/dist/fable_modules/fable-library-js.4.14.0/TimeOnly.d.ts +0 -15
- package/dist/fable_modules/fable-library-js.4.14.0/TimeOnly.js +0 -122
- package/dist/fable_modules/fable-library-js.4.14.0/TimeSpan.d.ts +0 -34
- package/dist/fable_modules/fable-library-js.4.14.0/TimeSpan.js +0 -177
- package/dist/fable_modules/fable-library-js.4.14.0/Timer.d.ts +0 -19
- package/dist/fable_modules/fable-library-js.4.14.0/Timer.js +0 -67
- package/dist/fable_modules/fable-library-js.4.14.0/Types.d.ts +0 -58
- package/dist/fable_modules/fable-library-js.4.14.0/Types.js +0 -208
- package/dist/fable_modules/fable-library-js.4.14.0/Unicode.13.0.0.d.ts +0 -2
- package/dist/fable_modules/fable-library-js.4.14.0/Unicode.13.0.0.js +0 -4
- package/dist/fable_modules/fable-library-js.4.14.0/Uri.d.ts +0 -29
- package/dist/fable_modules/fable-library-js.4.14.0/Uri.js +0 -142
- package/dist/fable_modules/fable-library-js.4.14.0/Util.d.ts +0 -207
- package/dist/fable_modules/fable-library-js.4.14.0/Util.js +0 -770
- package/dist/fable_modules/fable-library-js.4.14.0/big.d.ts +0 -338
- package/dist/fable_modules/fable-library-js.4.14.0/lib/big.d.ts +0 -5
- package/dist/fable_modules/fable-library-js.4.14.0/lib/big.js +0 -826
- package/dist/fable_modules/fable-library-js.4.14.0/package.json +0 -24
- package/dist/fable_modules/project_cracked.json +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { createProjectSync } from "@ts-morph/bootstrap";
|
|
1
|
+
import { createProjectSync, ts } from "@ts-morph/bootstrap";
|
|
2
|
+
import { describePackage, findPackageDir } from "./resolve.js";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
*
|
|
@@ -8,9 +9,115 @@ import { createProjectSync } from "@ts-morph/bootstrap";
|
|
|
8
9
|
*/
|
|
9
10
|
export default function createProgramForCLI(filePath, source) {
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
// `strict`, so that `T | undefined` is kept by the checker
|
|
13
|
+
const project = createProjectSync({ compilerOptions: { strict: true } })
|
|
12
14
|
|
|
13
15
|
project.createSourceFile(filePath, source)
|
|
14
16
|
|
|
15
17
|
return project.createProgram()
|
|
16
18
|
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Create a program from declaration files of the host, following their imports.
|
|
22
|
+
*
|
|
23
|
+
* @param {import("./host.js").Host} host
|
|
24
|
+
* @param {string[]} entryFiles
|
|
25
|
+
* @param {{ withoutDomLib?: boolean, noLib?: boolean }} options
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
28
|
+
export function createProgramFromFiles(host, entryFiles, options = {}) {
|
|
29
|
+
// ESNext, so that lib types such as `AsyncIterable` resolve instead of being left undefined.
|
|
30
|
+
// `types: []` stops TypeScript from loading every package under `node_modules/@types`.
|
|
31
|
+
// ESNext module + Bundler resolution: follows `exports` maps and node_modules
|
|
32
|
+
const compilerOptions = { target: 99, module: 99, moduleResolution: 100, types: [], strict: true }
|
|
33
|
+
|
|
34
|
+
// A package replacing the DOM lib (`@types/web`) redeclares its globals
|
|
35
|
+
if (options.withoutDomLib) {
|
|
36
|
+
compilerOptions.lib = ["lib.esnext.d.ts", "lib.decorators.d.ts", "lib.decorators.legacy.d.ts"]
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// A package made of the ES library files declares the library itself
|
|
40
|
+
if (options.noLib) {
|
|
41
|
+
compilerOptions.noLib = true
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const project = host.createProject(compilerOptions)
|
|
45
|
+
|
|
46
|
+
for (const entryFile of entryFiles) {
|
|
47
|
+
project.addSourceFileAtPathSync(entryFile)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
project.resolveSourceFileDependencies()
|
|
51
|
+
|
|
52
|
+
return project.createProgram()
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The files reachable from the entry files through imports and references, without
|
|
57
|
+
* going through a package of `excludedRuntimeNames` (`node` for `@types/node`).
|
|
58
|
+
*
|
|
59
|
+
* @param {import("./host.js").Host} host
|
|
60
|
+
* @param {import("typescript").Program} program
|
|
61
|
+
* @param {string[]} entryFiles
|
|
62
|
+
* @param {string[]} excludedRuntimeNames
|
|
63
|
+
* @returns {string[]}
|
|
64
|
+
*/
|
|
65
|
+
export function reachableFiles(host, program, entryFiles, excludedRuntimeNames) {
|
|
66
|
+
const runtimeNames = new Map();
|
|
67
|
+
|
|
68
|
+
const isExcluded = (fileName) => {
|
|
69
|
+
const dir = findPackageDir(host, fileName);
|
|
70
|
+
|
|
71
|
+
if (dir === null) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (!runtimeNames.has(dir)) {
|
|
76
|
+
const description = describePackage(host, dir);
|
|
77
|
+
runtimeNames.set(dir, description === null ? null : description.runtimeName);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return excludedRuntimeNames.includes(runtimeNames.get(dir));
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const seen = new Set();
|
|
84
|
+
const queue = [...entryFiles];
|
|
85
|
+
|
|
86
|
+
const visit = (fileName) => {
|
|
87
|
+
if (fileName !== undefined && !seen.has(fileName) && !isExcluded(fileName)) {
|
|
88
|
+
queue.push(fileName);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
while (queue.length > 0) {
|
|
93
|
+
const fileName = queue.pop();
|
|
94
|
+
|
|
95
|
+
if (seen.has(fileName)) {
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const sourceFile = program.getSourceFile(fileName);
|
|
100
|
+
|
|
101
|
+
if (sourceFile === undefined) {
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
seen.add(fileName);
|
|
106
|
+
|
|
107
|
+
for (const usage of sourceFile.imports ?? []) {
|
|
108
|
+
const mode = ts.getModeForUsageLocation(sourceFile, usage);
|
|
109
|
+
visit(program.getResolvedModule(sourceFile, usage.text, mode)?.resolvedModule?.resolvedFileName);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
for (const reference of sourceFile.referencedFiles ?? []) {
|
|
113
|
+
visit(host.path.resolve(host.path.dirname(sourceFile.fileName), reference.fileName));
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
for (const reference of sourceFile.typeReferenceDirectives ?? []) {
|
|
117
|
+
const resolved = program.getResolvedTypeReferenceDirective(sourceFile, reference.fileName, reference.resolutionMode);
|
|
118
|
+
visit(resolved?.resolvedTypeReferenceDirective?.resolvedFileName);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return [...seen];
|
|
123
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { createProjectSync, InMemoryFileSystemHost } from "@ts-morph/bootstrap";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @typedef {object} Host
|
|
5
|
+
* @property {string} cwd
|
|
6
|
+
* @property {{ join: (...parts: string[]) => string, dirname: (p: string) => string, basename: (p: string) => string, resolve: (...parts: string[]) => string }} path
|
|
7
|
+
* @property {{ fileExists: (p: string) => boolean, directoryExists: (p: string) => boolean, readFile: (p: string) => string, readDirectory: (p: string) => string[], realPath: (p: string) => string }} fs
|
|
8
|
+
* @property {(compilerOptions: object) => import("@ts-morph/bootstrap").Project} createProject
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* `/` separated paths, the only ones of the in-memory file system.
|
|
13
|
+
*/
|
|
14
|
+
export const posixPath = {
|
|
15
|
+
normalize(p) {
|
|
16
|
+
const absolute = p.startsWith("/");
|
|
17
|
+
const segments = [];
|
|
18
|
+
|
|
19
|
+
for (const segment of p.split("/")) {
|
|
20
|
+
if (segment === "" || segment === ".") {
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (segment === "..") {
|
|
25
|
+
if (segments.length > 0 && segments[segments.length - 1] !== "..") {
|
|
26
|
+
segments.pop();
|
|
27
|
+
} else if (!absolute) {
|
|
28
|
+
segments.push("..");
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
segments.push(segment);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const joined = segments.join("/");
|
|
38
|
+
|
|
39
|
+
return absolute ? "/" + joined : joined === "" ? "." : joined;
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
join(...parts) {
|
|
43
|
+
return posixPath.normalize(parts.filter((part) => part !== "").join("/"));
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
dirname(p) {
|
|
47
|
+
const normalized = posixPath.normalize(p);
|
|
48
|
+
const index = normalized.lastIndexOf("/");
|
|
49
|
+
|
|
50
|
+
if (index === -1) {
|
|
51
|
+
return ".";
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return index === 0 ? "/" : normalized.slice(0, index);
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
basename(p) {
|
|
58
|
+
const normalized = posixPath.normalize(p);
|
|
59
|
+
|
|
60
|
+
return normalized.slice(normalized.lastIndexOf("/") + 1);
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
resolve(...parts) {
|
|
64
|
+
let result = "/";
|
|
65
|
+
|
|
66
|
+
for (const part of parts) {
|
|
67
|
+
result = part.startsWith("/") ? part : result + "/" + part;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return posixPath.normalize(result);
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* A host over a ts-morph file system, the in-memory one in the browser.
|
|
76
|
+
*
|
|
77
|
+
* @param {import("@ts-morph/bootstrap").FileSystemHost} fileSystem
|
|
78
|
+
* @param {string} cwd
|
|
79
|
+
* @returns {Host}
|
|
80
|
+
*/
|
|
81
|
+
export function createFileSystemHost(fileSystem, cwd = "/") {
|
|
82
|
+
return {
|
|
83
|
+
cwd,
|
|
84
|
+
fileSystem,
|
|
85
|
+
path: posixPath,
|
|
86
|
+
fs: {
|
|
87
|
+
fileExists: (p) => fileSystem.fileExistsSync(p),
|
|
88
|
+
directoryExists: (p) => fileSystem.directoryExistsSync(p),
|
|
89
|
+
readFile: (p) => fileSystem.readFileSync(p, "utf8"),
|
|
90
|
+
readDirectory: (p) => fileSystem.readDirSync(p).map((entry) => entry.name),
|
|
91
|
+
realPath: (p) => {
|
|
92
|
+
try {
|
|
93
|
+
return fileSystem.realpathSync(p);
|
|
94
|
+
} catch {
|
|
95
|
+
return p;
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
createProject: (compilerOptions) =>
|
|
100
|
+
createProjectSync({ fileSystem, compilerOptions, skipAddingFilesFromTsConfig: true }),
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* @param {string} cwd
|
|
106
|
+
* @returns {Host}
|
|
107
|
+
*/
|
|
108
|
+
export function createInMemoryHost(cwd = "/") {
|
|
109
|
+
return createFileSystemHost(new InMemoryFileSystemHost(), cwd);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* The host of the CLI, over the disk.
|
|
114
|
+
*
|
|
115
|
+
* @param {typeof import("node:fs")} fs
|
|
116
|
+
* @param {typeof import("node:path")} path
|
|
117
|
+
* @param {string} cwd
|
|
118
|
+
* @returns {Host}
|
|
119
|
+
*/
|
|
120
|
+
export function createNodeHost(fs, path, cwd) {
|
|
121
|
+
return {
|
|
122
|
+
cwd,
|
|
123
|
+
path: {
|
|
124
|
+
join: (...parts) => path.join(...parts),
|
|
125
|
+
dirname: (p) => path.dirname(p),
|
|
126
|
+
basename: (p) => path.basename(p),
|
|
127
|
+
resolve: (...parts) => path.resolve(...parts),
|
|
128
|
+
},
|
|
129
|
+
fs: {
|
|
130
|
+
fileExists: (p) => fs.existsSync(p) && fs.statSync(p).isFile(),
|
|
131
|
+
directoryExists: (p) => fs.existsSync(p) && fs.statSync(p).isDirectory(),
|
|
132
|
+
readFile: (p) => fs.readFileSync(p, "utf8"),
|
|
133
|
+
readDirectory: (p) => fs.readdirSync(p),
|
|
134
|
+
realPath: (p) => {
|
|
135
|
+
try {
|
|
136
|
+
return fs.realpathSync(p);
|
|
137
|
+
} catch {
|
|
138
|
+
return p;
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
createProject: (compilerOptions) => createProjectSync({ compilerOptions, skipAddingFilesFromTsConfig: true }),
|
|
143
|
+
};
|
|
144
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
const DECLARATION_FILE = /\.d\.[cm]?ts$/;
|
|
2
|
+
const REGISTRY = "https://data.jsdelivr.com/v1/package";
|
|
3
|
+
const CDN = "https://cdn.jsdelivr.net/npm";
|
|
4
|
+
const CONCURRENCY = 8;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* `@types/foo` for `foo`, `@types/scope__foo` for `@scope/foo`
|
|
8
|
+
*
|
|
9
|
+
* @param {string} name
|
|
10
|
+
*/
|
|
11
|
+
export function typesPackageName(name) {
|
|
12
|
+
return "@types/" + name.replace(/^@/, "").replace("/", "__");
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* `chalk`, `chalk@5`, `@scope/name@^1.2`
|
|
17
|
+
*
|
|
18
|
+
* @param {string} spec
|
|
19
|
+
* @returns {{ name: string, range: string }}
|
|
20
|
+
*/
|
|
21
|
+
export function parsePackageSpec(spec) {
|
|
22
|
+
const at = spec.indexOf("@", 1);
|
|
23
|
+
|
|
24
|
+
if (at === -1) {
|
|
25
|
+
return { name: spec, range: "latest" };
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return { name: spec.slice(0, at), range: spec.slice(at + 1) || "latest" };
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Download the declaration files of a package and of the packages it depends on into
|
|
33
|
+
* `/node_modules` of the file system, like `npm install` would, from jsDelivr.
|
|
34
|
+
*
|
|
35
|
+
* @param {import("@ts-morph/bootstrap").FileSystemHost} fileSystem
|
|
36
|
+
* @param {string} spec package name, with an optional version range
|
|
37
|
+
* @param {{ fetch?: typeof fetch, onProgress?: (message: string) => void, skip?: string[] }} options
|
|
38
|
+
* @returns {Promise<{ name: string, version: string }>} the package installed for `spec`
|
|
39
|
+
*/
|
|
40
|
+
export async function installPackage(fileSystem, spec, options = {}) {
|
|
41
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
42
|
+
const onProgress = options.onProgress ?? (() => {});
|
|
43
|
+
// `@types/node` describes the runtime, it is not needed to generate a package
|
|
44
|
+
const skip = new Set(options.skip ?? ["@types/node"]);
|
|
45
|
+
const installed = new Map();
|
|
46
|
+
|
|
47
|
+
const getJson = async (url) => {
|
|
48
|
+
const response = await fetchImpl(url);
|
|
49
|
+
|
|
50
|
+
if (!response.ok) {
|
|
51
|
+
throw new Error(`${url}: ${response.status}`);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return await response.json();
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const getText = async (url) => {
|
|
58
|
+
const response = await fetchImpl(url);
|
|
59
|
+
|
|
60
|
+
if (!response.ok) {
|
|
61
|
+
throw new Error(`${url}: ${response.status}`);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return await response.text();
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const install = async (name, range) => {
|
|
68
|
+
if (installed.has(name) || skip.has(name)) {
|
|
69
|
+
return installed.get(name) ?? null;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const resolveResponse = await fetchImpl(`${REGISTRY}/resolve/npm/${name}@${encodeURIComponent(range)}`);
|
|
73
|
+
|
|
74
|
+
if (resolveResponse.status === 404) {
|
|
75
|
+
throw new Error(`No package named '${name}' on npm`);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (!resolveResponse.ok) {
|
|
79
|
+
throw new Error(`${resolveResponse.url}: ${resolveResponse.status}`);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const { version } = await resolveResponse.json();
|
|
83
|
+
|
|
84
|
+
if (version === null || version === undefined) {
|
|
85
|
+
throw new Error(`No version of '${name}' matches '${range}'`);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
installed.set(name, { name, version });
|
|
89
|
+
onProgress(`${name}@${version}: listing files`);
|
|
90
|
+
|
|
91
|
+
const { files } = await getJson(`${REGISTRY}/npm/${name}@${version}/flat`);
|
|
92
|
+
|
|
93
|
+
const wanted = files
|
|
94
|
+
.map((file) => file.name)
|
|
95
|
+
.filter((file) => DECLARATION_FILE.test(file) || file.endsWith("/package.json"));
|
|
96
|
+
|
|
97
|
+
let done = 0;
|
|
98
|
+
|
|
99
|
+
const worker = async () => {
|
|
100
|
+
while (wanted.length > 0) {
|
|
101
|
+
const file = wanted.shift();
|
|
102
|
+
const content = await getText(`${CDN}/${name}@${version}${file}`);
|
|
103
|
+
|
|
104
|
+
fileSystem.writeFileSync(`/node_modules/${name}${file}`, content);
|
|
105
|
+
done++;
|
|
106
|
+
onProgress(`${name}@${version}: ${done} files`);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
await Promise.all(Array.from({ length: CONCURRENCY }, worker));
|
|
111
|
+
|
|
112
|
+
const packageJson = JSON.parse(fileSystem.readFileSync(`/node_modules/${name}/package.json`, "utf8"));
|
|
113
|
+
|
|
114
|
+
const hasDeclarations = files.some((file) => DECLARATION_FILE.test(file.name));
|
|
115
|
+
|
|
116
|
+
// A package without declaration files (`ws`) is described by its `@types` package
|
|
117
|
+
if (!hasDeclarations && !name.startsWith("@types/")) {
|
|
118
|
+
try {
|
|
119
|
+
await install(typesPackageName(name), "latest");
|
|
120
|
+
} catch {
|
|
121
|
+
// No `@types` package either, the package stays untyped
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
for (const [dependency, dependencyRange] of Object.entries(packageJson.dependencies ?? {})) {
|
|
126
|
+
await install(dependency, dependencyRange);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return installed.get(name);
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const { name, range } = parsePackageSpec(spec);
|
|
133
|
+
const result = await install(name, range);
|
|
134
|
+
|
|
135
|
+
// `ws` itself has no declaration file: the package to generate is its `@types` package
|
|
136
|
+
return result;
|
|
137
|
+
}
|