lawspec 0.31.0 → 0.31.3
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/CHANGELOG.md +116 -1
- package/README.md +86 -4
- package/api.mjs +14 -9
- package/authoring.mjs +899 -0
- package/beam-coverage.mjs +190 -65
- package/beam-doctor.mjs +343 -124
- package/bin/lawspec.mjs +1955 -657
- package/build.json +135 -129
- package/component-packages.mjs +662 -176
- package/component.d.ts +82 -20
- package/component.mjs +317 -94
- package/core.wasm +2 -2
- package/core_jsffi.js +5 -5
- package/doctor.mjs +558 -299
- package/examples-command.mjs +44 -23
- package/failure-database.mjs +60 -17
- package/files.mjs +122 -62
- package/index.d.ts +585 -312
- package/input-files.mjs +90 -25
- package/launcher.mjs +72 -31
- package/learn/adapters.mjs +226 -0
- package/learn/app.mjs +1279 -0
- package/learn/assert.mjs +33 -0
- package/learn/assets.mjs +15 -0
- package/learn/browser-runtime.mjs +58 -0
- package/learn/bundle.mjs +118 -0
- package/learn/compile-worker.mjs +106 -0
- package/learn/compiler.mjs +230 -0
- package/learn/coverage.json +8259 -0
- package/learn/curriculum.json +2955 -0
- package/learn/fantomas-worker.mjs +25 -0
- package/learn/format-worker.mjs +148 -0
- package/learn/fsharp.mjs +83 -0
- package/learn/harness-host.mjs +22 -0
- package/learn/index.html +326 -0
- package/learn/lawspec-core.mjs +223 -0
- package/learn/lawspec-language.mjs +69 -0
- package/learn/node-test.mjs +11 -0
- package/learn/presentation.mjs +73 -0
- package/learn/runner.mjs +72 -0
- package/learn/sandbox-frame.html +34 -0
- package/learn/sandbox.mjs +91 -0
- package/learn/store.mjs +141 -0
- package/learn/story.mjs +42 -0
- package/learn/style-options.json +16 -0
- package/learn/style.css +1023 -0
- package/learn/theme.js +77 -0
- package/learn/typescript.mjs +53 -0
- package/learn/vendor/@fontsource-atkinson-hyperlegible-LICENSE.txt +93 -0
- package/learn/vendor/@fontsource-atkinson-hyperlegible-mono-LICENSE.txt +93 -0
- package/learn/vendor/@fontsource-overpass-LICENSE.txt +93 -0
- package/learn/vendor/assemblies.json +1 -0
- package/learn/vendor/editor-worker.js +30 -0
- package/learn/vendor/editor.css +1 -0
- package/learn/vendor/editor.mjs +931 -0
- package/learn/vendor/esbuild-wasm-LICENSE.txt +21 -0
- package/learn/vendor/esbuild.mjs +2683 -0
- package/learn/vendor/esbuild.wasm +0 -0
- package/learn/vendor/fable-library/Array.js +1347 -0
- package/learn/vendor/fable-library/Async.js +134 -0
- package/learn/vendor/fable-library/AsyncBuilder.js +183 -0
- package/learn/vendor/fable-library/BigInt.js +306 -0
- package/learn/vendor/fable-library/BitConverter.js +138 -0
- package/learn/vendor/fable-library/Boolean.js +22 -0
- package/learn/vendor/fable-library/CHANGELOG.md +242 -0
- package/learn/vendor/fable-library/Char.js +202 -0
- package/learn/vendor/fable-library/Choice.js +184 -0
- package/learn/vendor/fable-library/CollectionUtil.js +182 -0
- package/learn/vendor/fable-library/ConditionalWeakTable.js +21 -0
- package/learn/vendor/fable-library/Date.js +841 -0
- package/learn/vendor/fable-library/DateOffset.js +261 -0
- package/learn/vendor/fable-library/DateOnly.js +124 -0
- package/learn/vendor/fable-library/Decimal.js +238 -0
- package/learn/vendor/fable-library/Double.js +47 -0
- package/learn/vendor/fable-library/Encoding.js +185 -0
- package/learn/vendor/fable-library/Event.js +93 -0
- package/learn/vendor/fable-library/FSharp.Collections.js +45 -0
- package/learn/vendor/fable-library/FSharp.Core.CompilerServices.js +27 -0
- package/learn/vendor/fable-library/FSharp.Core.js +156 -0
- package/learn/vendor/fable-library/Global.js +29 -0
- package/learn/vendor/fable-library/Guid.js +161 -0
- package/learn/vendor/fable-library/Int32.js +135 -0
- package/learn/vendor/fable-library/List.js +1323 -0
- package/learn/vendor/fable-library/Long.js +47 -0
- package/learn/vendor/fable-library/MailboxProcessor.js +94 -0
- package/learn/vendor/fable-library/Map.js +1396 -0
- package/learn/vendor/fable-library/MapUtil.js +130 -0
- package/learn/vendor/fable-library/MutableMap.js +339 -0
- package/learn/vendor/fable-library/MutableSet.js +233 -0
- package/learn/vendor/fable-library/Native.js +14 -0
- package/learn/vendor/fable-library/Numeric.js +75 -0
- package/learn/vendor/fable-library/Observable.js +113 -0
- package/learn/vendor/fable-library/Option.js +104 -0
- package/learn/vendor/fable-library/README.md +3 -0
- package/learn/vendor/fable-library/Random.js +172 -0
- package/learn/vendor/fable-library/Range.js +45 -0
- package/learn/vendor/fable-library/Reflection.js +479 -0
- package/learn/vendor/fable-library/RegExp.js +141 -0
- package/learn/vendor/fable-library/Result.js +165 -0
- package/learn/vendor/fable-library/Seq.js +1417 -0
- package/learn/vendor/fable-library/Seq2.js +111 -0
- package/learn/vendor/fable-library/Set.js +1816 -0
- package/learn/vendor/fable-library/String.js +674 -0
- package/learn/vendor/fable-library/System.Collections.Generic.js +333 -0
- package/learn/vendor/fable-library/System.Text.js +200 -0
- package/learn/vendor/fable-library/System.js +289 -0
- package/learn/vendor/fable-library/TimeOnly.js +122 -0
- package/learn/vendor/fable-library/TimeSpan.js +180 -0
- package/learn/vendor/fable-library/Timer.js +67 -0
- package/learn/vendor/fable-library/Types.js +198 -0
- package/learn/vendor/fable-library/Unicode.13.0.0.js +4 -0
- package/learn/vendor/fable-library/Uri.js +165 -0
- package/learn/vendor/fable-library/Util.js +796 -0
- package/learn/vendor/fable-library/big.d.ts +338 -0
- package/learn/vendor/fable-library/lib/big.js +825 -0
- package/learn/vendor/fable-library/package.json +24 -0
- package/learn/vendor/fable-library/quotation.js +618 -0
- package/learn/vendor/fable.js +430 -0
- package/learn/vendor/fantomas/FSharp.Core.uawo19tl4c.wasm +0 -0
- package/learn/vendor/fantomas/Fantomas.Core.stnanlnpyw.wasm +0 -0
- package/learn/vendor/fantomas/Fantomas.FCS.lqohfu5o9y.wasm +0 -0
- package/learn/vendor/fantomas/LawSpec.Learn.Formatter.poiijdbsl9.wasm +0 -0
- package/learn/vendor/fantomas/Microsoft.CSharp.mp8lhr6rez.wasm +0 -0
- package/learn/vendor/fantomas/Microsoft.VisualBasic.0e5fchkecn.wasm +0 -0
- package/learn/vendor/fantomas/Microsoft.VisualBasic.Core.17wn27qal2.wasm +0 -0
- package/learn/vendor/fantomas/Microsoft.Win32.Primitives.9d566sle9e.wasm +0 -0
- package/learn/vendor/fantomas/Microsoft.Win32.Registry.52dy96yk8i.wasm +0 -0
- package/learn/vendor/fantomas/System.AppContext.jwujeh069z.wasm +0 -0
- package/learn/vendor/fantomas/System.Buffers.y0isk1x97h.wasm +0 -0
- package/learn/vendor/fantomas/System.Collections.Concurrent.x5koi7bzem.wasm +0 -0
- package/learn/vendor/fantomas/System.Collections.Immutable.diwg7advch.wasm +0 -0
- package/learn/vendor/fantomas/System.Collections.NonGeneric.4089xs440e.wasm +0 -0
- package/learn/vendor/fantomas/System.Collections.Specialized.hj81u7zblb.wasm +0 -0
- package/learn/vendor/fantomas/System.Collections.nvrdeoknr1.wasm +0 -0
- package/learn/vendor/fantomas/System.ComponentModel.Annotations.yatcnfjeuk.wasm +0 -0
- package/learn/vendor/fantomas/System.ComponentModel.DataAnnotations.led9l5awu3.wasm +0 -0
- package/learn/vendor/fantomas/System.ComponentModel.EventBasedAsync.hpvp6cf4de.wasm +0 -0
- package/learn/vendor/fantomas/System.ComponentModel.Primitives.v7cajwpaqo.wasm +0 -0
- package/learn/vendor/fantomas/System.ComponentModel.TypeConverter.xk1hnyt762.wasm +0 -0
- package/learn/vendor/fantomas/System.ComponentModel.rrnda1lucx.wasm +0 -0
- package/learn/vendor/fantomas/System.Configuration.bn9vghjcq8.wasm +0 -0
- package/learn/vendor/fantomas/System.Console.09ajpiafhz.wasm +0 -0
- package/learn/vendor/fantomas/System.Core.wc649o5mw9.wasm +0 -0
- package/learn/vendor/fantomas/System.Data.Common.s4cowzd9a9.wasm +0 -0
- package/learn/vendor/fantomas/System.Data.DataSetExtensions.5fm360ikxl.wasm +0 -0
- package/learn/vendor/fantomas/System.Data.fsu4j4t4jw.wasm +0 -0
- package/learn/vendor/fantomas/System.Diagnostics.Contracts.p74re5oxzn.wasm +0 -0
- package/learn/vendor/fantomas/System.Diagnostics.Debug.622sixg49n.wasm +0 -0
- package/learn/vendor/fantomas/System.Diagnostics.DiagnosticSource.2j35bc2g2b.wasm +0 -0
- package/learn/vendor/fantomas/System.Diagnostics.FileVersionInfo.7n0wdvltaa.wasm +0 -0
- package/learn/vendor/fantomas/System.Diagnostics.Process.8iffh49mew.wasm +0 -0
- package/learn/vendor/fantomas/System.Diagnostics.StackTrace.1yz88vico8.wasm +0 -0
- package/learn/vendor/fantomas/System.Diagnostics.TextWriterTraceListener.ua8iuh2vhj.wasm +0 -0
- package/learn/vendor/fantomas/System.Diagnostics.Tools.roy5445ugj.wasm +0 -0
- package/learn/vendor/fantomas/System.Diagnostics.TraceSource.6qx1ldzz7g.wasm +0 -0
- package/learn/vendor/fantomas/System.Diagnostics.Tracing.b4799zpaas.wasm +0 -0
- package/learn/vendor/fantomas/System.Drawing.8gcjjqj0pu.wasm +0 -0
- package/learn/vendor/fantomas/System.Drawing.Primitives.y2uveru2yk.wasm +0 -0
- package/learn/vendor/fantomas/System.Dynamic.Runtime.023zrvzh9x.wasm +0 -0
- package/learn/vendor/fantomas/System.Formats.Asn1.znpklkbgqv.wasm +0 -0
- package/learn/vendor/fantomas/System.Formats.Tar.5yybjepfi2.wasm +0 -0
- package/learn/vendor/fantomas/System.Globalization.Calendars.10g6hyjy3k.wasm +0 -0
- package/learn/vendor/fantomas/System.Globalization.Extensions.hrinfrismg.wasm +0 -0
- package/learn/vendor/fantomas/System.Globalization.uvs4rah8fk.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.4j645gw40d.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.Compression.2z7vdt6tfb.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.Compression.Brotli.fv80xs79j3.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.Compression.FileSystem.88jdddz3sw.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.Compression.ZipFile.jkn9avr4vo.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.FileSystem.AccessControl.yme0uhbu37.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.FileSystem.DriveInfo.qas7wf73rs.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.FileSystem.Primitives.d1jmhkzu0e.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.FileSystem.Watcher.z570derp0d.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.FileSystem.o6jtz51fup.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.IsolatedStorage.hqyeyb5ipe.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.MemoryMappedFiles.zhamjnusxd.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.Pipelines.wrmw5vws31.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.Pipes.AccessControl.qcancj8gj2.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.Pipes.zhcyguvwkr.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.UnmanagedMemoryStream.o8cpjnlard.wasm +0 -0
- package/learn/vendor/fantomas/System.Linq.AsyncEnumerable.hyc0b7okjw.wasm +0 -0
- package/learn/vendor/fantomas/System.Linq.Expressions.ldibvm0efj.wasm +0 -0
- package/learn/vendor/fantomas/System.Linq.Parallel.2buevezvch.wasm +0 -0
- package/learn/vendor/fantomas/System.Linq.Queryable.cvq43g1awj.wasm +0 -0
- package/learn/vendor/fantomas/System.Linq.lz6mvi0hm2.wasm +0 -0
- package/learn/vendor/fantomas/System.Memory.3jekerw0ga.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.Http.Json.8k237kkwec.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.Http.cityx2bvcl.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.HttpListener.s1jreclykx.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.Mail.cmlj4c0gto.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.NameResolution.q3gf18q13l.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.NetworkInformation.xaz5tjw7d0.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.Ping.a40atim1h0.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.Primitives.i88i20r8sr.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.Quic.hx06eo5xkj.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.Requests.hkjxlfe5f5.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.Security.ch34yya69o.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.ServerSentEvents.0u7o0jk3p1.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.ServicePoint.xbhxnytx4l.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.Sockets.hzgzlvkc9l.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.WebClient.84i8nwzbgu.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.WebHeaderCollection.326nl7s9g3.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.WebProxy.oq3mgkkqef.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.WebSockets.2cx1v74vg8.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.WebSockets.Client.rafzkktw8j.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.w1hpj3bo6r.wasm +0 -0
- package/learn/vendor/fantomas/System.Numerics.Vectors.oyv7biw9ux.wasm +0 -0
- package/learn/vendor/fantomas/System.Numerics.lyu36wqn19.wasm +0 -0
- package/learn/vendor/fantomas/System.ObjectModel.kxu80demuu.wasm +0 -0
- package/learn/vendor/fantomas/System.Private.CoreLib.1vy46s12u6.wasm +0 -0
- package/learn/vendor/fantomas/System.Private.DataContractSerialization.ao8k9iu77a.wasm +0 -0
- package/learn/vendor/fantomas/System.Private.Uri.itn0n2zjd0.wasm +0 -0
- package/learn/vendor/fantomas/System.Private.Xml.19nzpxrx8w.wasm +0 -0
- package/learn/vendor/fantomas/System.Private.Xml.Linq.tw5eq1hjvo.wasm +0 -0
- package/learn/vendor/fantomas/System.Reflection.DispatchProxy.7lajnj8s8c.wasm +0 -0
- package/learn/vendor/fantomas/System.Reflection.Emit.7liz9zln06.wasm +0 -0
- package/learn/vendor/fantomas/System.Reflection.Emit.ILGeneration.1ut3qgacw8.wasm +0 -0
- package/learn/vendor/fantomas/System.Reflection.Emit.Lightweight.d0gvllb1jj.wasm +0 -0
- package/learn/vendor/fantomas/System.Reflection.Extensions.zr5bhwfczd.wasm +0 -0
- package/learn/vendor/fantomas/System.Reflection.Metadata.ff6np6mz2j.wasm +0 -0
- package/learn/vendor/fantomas/System.Reflection.Primitives.igpmvwv78c.wasm +0 -0
- package/learn/vendor/fantomas/System.Reflection.TypeExtensions.qouojzlnp9.wasm +0 -0
- package/learn/vendor/fantomas/System.Reflection.mk3jyxvh13.wasm +0 -0
- package/learn/vendor/fantomas/System.Resources.Reader.41ppfyz2vc.wasm +0 -0
- package/learn/vendor/fantomas/System.Resources.ResourceManager.sfwvfmw1ea.wasm +0 -0
- package/learn/vendor/fantomas/System.Resources.Writer.3uvs9tp38z.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.CompilerServices.Unsafe.puz1xm53oc.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.CompilerServices.VisualC.9qdau315py.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.Extensions.i7gntui96b.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.Handles.00oxj4o6ov.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.InteropServices.JavaScript.9kq1vofond.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.InteropServices.RuntimeInformation.my7qeqbhfh.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.InteropServices.vqp80tnwc7.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.Intrinsics.u0samjybfo.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.Loader.n6zxw1b98a.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.Numerics.o40sjhz59x.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.Serialization.Formatters.1esvva4te3.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.Serialization.Json.4n7u09advh.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.Serialization.Primitives.xs2bo91wvk.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.Serialization.Xml.ny21jmziti.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.Serialization.qcxaur5wqs.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.odq454d6j9.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.AccessControl.8yfnzmqzaq.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.Claims.8ogy0860de.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.Cryptography.Algorithms.8zijp1svfw.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.Cryptography.Cng.yxagtt77no.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.Cryptography.Csp.uhfbvvau84.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.Cryptography.Encoding.2ywrusvy8q.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.Cryptography.OpenSsl.oa268u7i92.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.Cryptography.Primitives.5uhvqe8puk.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.Cryptography.X509Certificates.6i7pxilopt.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.Cryptography.d0quqk1iyr.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.Principal.Windows.gpqua4rz29.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.Principal.i20kfklf3g.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.SecureString.x2y8tzci3c.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.e83vvh6sl2.wasm +0 -0
- package/learn/vendor/fantomas/System.ServiceModel.Web.poglliv2no.wasm +0 -0
- package/learn/vendor/fantomas/System.ServiceProcess.yro5uj2opo.wasm +0 -0
- package/learn/vendor/fantomas/System.Text.Encoding.CodePages.2wchx40i7z.wasm +0 -0
- package/learn/vendor/fantomas/System.Text.Encoding.Extensions.8utaw61kn5.wasm +0 -0
- package/learn/vendor/fantomas/System.Text.Encoding.cxdyfepnpj.wasm +0 -0
- package/learn/vendor/fantomas/System.Text.Encodings.Web.37ehbi7cye.wasm +0 -0
- package/learn/vendor/fantomas/System.Text.Json.ixiaa8hd3h.wasm +0 -0
- package/learn/vendor/fantomas/System.Text.RegularExpressions.2fhfmkk6vf.wasm +0 -0
- package/learn/vendor/fantomas/System.Threading.6pry74a050.wasm +0 -0
- package/learn/vendor/fantomas/System.Threading.AccessControl.76zfdfy8go.wasm +0 -0
- package/learn/vendor/fantomas/System.Threading.Channels.gpxnr01lmp.wasm +0 -0
- package/learn/vendor/fantomas/System.Threading.Overlapped.aqpl8tzdyc.wasm +0 -0
- package/learn/vendor/fantomas/System.Threading.Tasks.Dataflow.ytwttt7fzh.wasm +0 -0
- package/learn/vendor/fantomas/System.Threading.Tasks.Extensions.0deavcb00v.wasm +0 -0
- package/learn/vendor/fantomas/System.Threading.Tasks.Parallel.tjwtxugso0.wasm +0 -0
- package/learn/vendor/fantomas/System.Threading.Tasks.fu4qd5h3qy.wasm +0 -0
- package/learn/vendor/fantomas/System.Threading.Thread.klaua2by9m.wasm +0 -0
- package/learn/vendor/fantomas/System.Threading.ThreadPool.mkzm212njz.wasm +0 -0
- package/learn/vendor/fantomas/System.Threading.Timer.yp49llu5h2.wasm +0 -0
- package/learn/vendor/fantomas/System.Transactions.Local.vz6cgeh4w7.wasm +0 -0
- package/learn/vendor/fantomas/System.Transactions.ipwm3rsy66.wasm +0 -0
- package/learn/vendor/fantomas/System.ValueTuple.7ol6ljuhx8.wasm +0 -0
- package/learn/vendor/fantomas/System.Web.HttpUtility.itlvncjd96.wasm +0 -0
- package/learn/vendor/fantomas/System.Web.np8uzzakvl.wasm +0 -0
- package/learn/vendor/fantomas/System.Windows.18nzio44t3.wasm +0 -0
- package/learn/vendor/fantomas/System.Xml.45jprtg1pa.wasm +0 -0
- package/learn/vendor/fantomas/System.Xml.Linq.v9v8udncm1.wasm +0 -0
- package/learn/vendor/fantomas/System.Xml.ReaderWriter.a9mr08uzci.wasm +0 -0
- package/learn/vendor/fantomas/System.Xml.Serialization.03juoguwgc.wasm +0 -0
- package/learn/vendor/fantomas/System.Xml.XDocument.c9dhjnzqjb.wasm +0 -0
- package/learn/vendor/fantomas/System.Xml.XPath.XDocument.138b12i1pm.wasm +0 -0
- package/learn/vendor/fantomas/System.Xml.XPath.pvxm9341ce.wasm +0 -0
- package/learn/vendor/fantomas/System.Xml.XmlDocument.450wsyxvl0.wasm +0 -0
- package/learn/vendor/fantomas/System.Xml.XmlSerializer.y3t2n0tce7.wasm +0 -0
- package/learn/vendor/fantomas/System.gjriafnqmz.wasm +0 -0
- package/learn/vendor/fantomas/WindowsBase.8zsce9qxfb.wasm +0 -0
- package/learn/vendor/fantomas/cs/FSharp.Core.resources.9ehmavdel7.wasm +0 -0
- package/learn/vendor/fantomas/de/FSharp.Core.resources.2ofmxloa01.wasm +0 -0
- package/learn/vendor/fantomas/dotnet.js +1233 -0
- package/learn/vendor/fantomas/dotnet.native.b6l13xorvf.js +16 -0
- package/learn/vendor/fantomas/dotnet.native.rw4kynp763.wasm +0 -0
- package/learn/vendor/fantomas/dotnet.runtime.v06hirbjsv.js +4 -0
- package/learn/vendor/fantomas/es/FSharp.Core.resources.hkr5ggb4tr.wasm +0 -0
- package/learn/vendor/fantomas/fr/FSharp.Core.resources.43soen28ow.wasm +0 -0
- package/learn/vendor/fantomas/icudt_CJK.tjcz0u77k5.dat +0 -0
- package/learn/vendor/fantomas/icudt_EFIGS.tptq2av103.dat +0 -0
- package/learn/vendor/fantomas/icudt_no_CJK.lfu7j35m59.dat +0 -0
- package/learn/vendor/fantomas/it/FSharp.Core.resources.m60n5ls7oq.wasm +0 -0
- package/learn/vendor/fantomas/ja/FSharp.Core.resources.o6oof69v14.wasm +0 -0
- package/learn/vendor/fantomas/ko/FSharp.Core.resources.q6l4snlu9o.wasm +0 -0
- package/learn/vendor/fantomas/mscorlib.8ptuc08eli.wasm +0 -0
- package/learn/vendor/fantomas/netstandard.eymp85mooh.wasm +0 -0
- package/learn/vendor/fantomas/pl/FSharp.Core.resources.8bni0w6j8b.wasm +0 -0
- package/learn/vendor/fantomas/pt-BR/FSharp.Core.resources.k849vqm41u.wasm +0 -0
- package/learn/vendor/fantomas/ru/FSharp.Core.resources.jz9rhhtsla.wasm +0 -0
- package/learn/vendor/fantomas/tr/FSharp.Core.resources.wn6vbvjm1u.wasm +0 -0
- package/learn/vendor/fantomas/zh-Hans/FSharp.Core.resources.z7zzbso094.wasm +0 -0
- package/learn/vendor/fantomas/zh-Hant/FSharp.Core.resources.iammfsi7ls.wasm +0 -0
- package/learn/vendor/fast-check-LICENSE.txt +21 -0
- package/learn/vendor/fast-check.mjs +37 -0
- package/learn/vendor/fonts/atkinson-hyperlegible-latin-400-normal.woff2 +0 -0
- package/learn/vendor/fonts/atkinson-hyperlegible-latin-700-normal.woff2 +0 -0
- package/learn/vendor/fonts/atkinson-hyperlegible-mono-latin-400-normal.woff2 +0 -0
- package/learn/vendor/fonts/overpass-latin-600-normal.woff2 +0 -0
- package/learn/vendor/fonts/overpass-latin-700-normal.woff2 +0 -0
- package/learn/vendor/formatter-licenses/DotNet-LICENSE.txt +23 -0
- package/learn/vendor/formatter-licenses/DotNet-THIRD-PARTY-NOTICES.txt +1418 -0
- package/learn/vendor/formatter-licenses/FSharp-LICENSE.txt +23 -0
- package/learn/vendor/formatter-licenses/Fantomas-LICENSE.txt +202 -0
- package/learn/vendor/formatter-licenses/README.md +12 -0
- package/learn/vendor/manifest.json +1354 -0
- package/learn/vendor/metadata/Browser.Blob.dll +0 -0
- package/learn/vendor/metadata/Browser.Dom.dll +0 -0
- package/learn/vendor/metadata/Browser.Event.dll +0 -0
- package/learn/vendor/metadata/Browser.Gamepad.dll +0 -0
- package/learn/vendor/metadata/Browser.WebGL.dll +0 -0
- package/learn/vendor/metadata/Browser.WebStorage.dll +0 -0
- package/learn/vendor/metadata/FSharp.Core.dll +0 -0
- package/learn/vendor/metadata/Fable.Core.dll +0 -0
- package/learn/vendor/metadata/Fable.Repl.Lib.dll +0 -0
- package/learn/vendor/metadata/System.Collections.Concurrent.dll +0 -0
- package/learn/vendor/metadata/System.Collections.dll +0 -0
- package/learn/vendor/metadata/System.ComponentModel.Primitives.dll +0 -0
- package/learn/vendor/metadata/System.ComponentModel.TypeConverter.dll +0 -0
- package/learn/vendor/metadata/System.ComponentModel.dll +0 -0
- package/learn/vendor/metadata/System.Console.dll +0 -0
- package/learn/vendor/metadata/System.Core.dll +0 -0
- package/learn/vendor/metadata/System.Diagnostics.Debug.dll +0 -0
- package/learn/vendor/metadata/System.Diagnostics.Tools.dll +0 -0
- package/learn/vendor/metadata/System.Diagnostics.Tracing.dll +0 -0
- package/learn/vendor/metadata/System.Globalization.dll +0 -0
- package/learn/vendor/metadata/System.IO.dll +0 -0
- package/learn/vendor/metadata/System.Net.Requests.dll +0 -0
- package/learn/vendor/metadata/System.Net.WebClient.dll +0 -0
- package/learn/vendor/metadata/System.Numerics.dll +0 -0
- package/learn/vendor/metadata/System.Reflection.Extensions.dll +0 -0
- package/learn/vendor/metadata/System.Reflection.Metadata.dll +0 -0
- package/learn/vendor/metadata/System.Reflection.Primitives.dll +0 -0
- package/learn/vendor/metadata/System.Reflection.TypeExtensions.dll +0 -0
- package/learn/vendor/metadata/System.Reflection.dll +0 -0
- package/learn/vendor/metadata/System.Runtime.Extensions.dll +0 -0
- package/learn/vendor/metadata/System.Runtime.InteropServices.dll +0 -0
- package/learn/vendor/metadata/System.Runtime.Numerics.dll +0 -0
- package/learn/vendor/metadata/System.Runtime.dll +0 -0
- package/learn/vendor/metadata/System.Text.Encoding.Extensions.dll +0 -0
- package/learn/vendor/metadata/System.Text.Encoding.dll +0 -0
- package/learn/vendor/metadata/System.Text.RegularExpressions.dll +0 -0
- package/learn/vendor/metadata/System.Threading.Tasks.dll +0 -0
- package/learn/vendor/metadata/System.Threading.Thread.dll +0 -0
- package/learn/vendor/metadata/System.Threading.dll +0 -0
- package/learn/vendor/metadata/System.ValueTuple.dll +0 -0
- package/learn/vendor/metadata/System.dll +0 -0
- package/learn/vendor/metadata/mscorlib.dll +0 -0
- package/learn/vendor/metadata/netstandard.dll +0 -0
- package/learn/vendor/monaco-editor-LICENSE.txt +21 -0
- package/learn/vendor/prettier/babel.mjs +16 -0
- package/learn/vendor/prettier/brace-style.mjs +376 -0
- package/learn/vendor/prettier/estree.mjs +44 -0
- package/learn/vendor/prettier/standalone.mjs +29 -0
- package/learn/vendor/prettier/typescript.mjs +22 -0
- package/learn/vendor/prettier-LICENSE.txt +7 -0
- package/learn/vendor/prettier-plugin-brace-style-LICENSE.txt +21 -0
- package/learn/vendor/typescript-LICENSE.txt +55 -0
- package/learn/vendor/typescript-libs.json +1 -0
- package/learn/vendor/typescript.mjs +451 -0
- package/learn/vendor/zod-LICENSE.txt +21 -0
- package/learn/web-format.mjs +8 -0
- package/learn.mjs +126 -0
- package/lsp.mjs +444 -133
- package/mcp.mjs +250 -0
- package/native-evidence.mjs +668 -182
- package/native-examples.mjs +56 -19
- package/native-host.mjs +136 -42
- package/native-parsers/clojure.LICENSE +121 -0
- package/native-parsers/clojure.wasm +0 -0
- package/native-parsers/csharp.LICENSE +21 -0
- package/native-parsers/csharp.wasm +0 -0
- package/native-parsers/elixir.LICENSE +176 -0
- package/native-parsers/elixir.wasm +0 -0
- package/native-parsers/erlang.LICENSE +201 -0
- package/native-parsers/erlang.wasm +0 -0
- package/native-parsers/fsharp.LICENSE +21 -0
- package/native-parsers/fsharp.wasm +0 -0
- package/native-parsers/gleam.LICENSE +202 -0
- package/native-parsers/gleam.wasm +0 -0
- package/native-parsers/go.LICENSE +21 -0
- package/native-parsers/go.wasm +0 -0
- package/native-parsers/groovy.LICENSE +21 -0
- package/native-parsers/groovy.wasm +0 -0
- package/native-parsers/haskell.LICENSE +21 -0
- package/native-parsers/haskell.wasm +0 -0
- package/native-parsers/java.LICENSE +21 -0
- package/native-parsers/java.wasm +0 -0
- package/native-parsers/javascript.LICENSE +21 -0
- package/native-parsers/javascript.wasm +0 -0
- package/native-parsers/kotlin.LICENSE +9 -0
- package/native-parsers/kotlin.wasm +0 -0
- package/native-parsers/lock.json +114 -0
- package/native-parsers/prolog.LICENSE +21 -0
- package/native-parsers/prolog.wasm +0 -0
- package/native-parsers/python.LICENSE +21 -0
- package/native-parsers/python.wasm +0 -0
- package/native-parsers/rust.LICENSE +21 -0
- package/native-parsers/rust.wasm +0 -0
- package/native-parsers/scala.LICENSE +21 -0
- package/native-parsers/scala.wasm +0 -0
- package/native-parsers/swift.LICENSE +21 -0
- package/native-parsers/swift.wasm +0 -0
- package/native-parsers/typescript.LICENSE +21 -0
- package/native-parsers/typescript.wasm +0 -0
- package/node-events-reporter.mjs +41 -17
- package/package.json +5 -3
- package/project.mjs +338 -0
- package/proof.d.ts +93 -19
- package/proof.mjs +1538 -447
- package/read-only-hpack.mjs +6 -5
- package/scala-build-state.mjs +131 -41
- package/scala-coverage.mjs +57 -34
- package/scalars.mjs +23 -8
- package/templates.mjs +566 -617
- package/test-command.mjs +1671 -521
package/component.d.ts
CHANGED
|
@@ -1,15 +1,47 @@
|
|
|
1
1
|
// Generated from templates/npm/component.d.ts by lawspec-dev generate. Do not edit.
|
|
2
|
-
export interface Identity
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
export interface Identity
|
|
3
|
+
{
|
|
4
|
+
name: string;
|
|
5
|
+
version: string;
|
|
6
|
+
}
|
|
7
|
+
export interface DependencySource
|
|
8
|
+
{
|
|
9
|
+
version: string;
|
|
10
|
+
path?: string;
|
|
11
|
+
git?: string;
|
|
12
|
+
rev?: string;
|
|
13
|
+
tagPrefix?: string;
|
|
14
|
+
subdir?: string;
|
|
15
|
+
archive?: string;
|
|
16
|
+
sha256?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ContractRequirement
|
|
19
|
+
{
|
|
20
|
+
contract: string;
|
|
21
|
+
abilities?: string[];
|
|
22
|
+
declarations?: string[];
|
|
23
|
+
settings?: string[];
|
|
24
|
+
}
|
|
25
|
+
export interface ComponentTarget
|
|
26
|
+
{
|
|
27
|
+
name?: string;
|
|
28
|
+
language: import('./index.js').Target;
|
|
29
|
+
root: string;
|
|
30
|
+
sourceDir?: string;
|
|
31
|
+
testDir?: string;
|
|
32
|
+
python?: string;
|
|
33
|
+
maven?: string;
|
|
34
|
+
gradle?: string;
|
|
35
|
+
rustc?: string;
|
|
36
|
+
cargo?: string;
|
|
37
|
+
scala?: string;
|
|
38
|
+
swift?: string;
|
|
39
|
+
clojure?: string;
|
|
40
|
+
dotnet?: string;
|
|
10
41
|
nativeBindings?: import('./index.js').NativeBindings;
|
|
11
42
|
}
|
|
12
|
-
export interface ComponentManifest
|
|
43
|
+
export interface ComponentManifest
|
|
44
|
+
{
|
|
13
45
|
manifestVersion: 1;
|
|
14
46
|
component?: Identity;
|
|
15
47
|
package?: Identity;
|
|
@@ -23,24 +55,54 @@ export interface ComponentManifest {
|
|
|
23
55
|
provides?: ContractRequirement[];
|
|
24
56
|
requires?: Record<string, ContractRequirement>;
|
|
25
57
|
verification?: import('./index.js').Verification;
|
|
58
|
+
authoringExceptions?: import('./index.js').AdviceException[];
|
|
26
59
|
generation?: Partial<import('./index.js').Generation>;
|
|
27
60
|
machineBits?: 32 | 64;
|
|
28
61
|
cache?: boolean;
|
|
29
62
|
attestation?: string;
|
|
30
63
|
description?: string;
|
|
31
64
|
}
|
|
32
|
-
export interface ResolutionOptions
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
65
|
+
export interface ResolutionOptions
|
|
66
|
+
{
|
|
67
|
+
locked?: boolean;
|
|
68
|
+
offline?: boolean;
|
|
69
|
+
update?: boolean | string;
|
|
70
|
+
}
|
|
71
|
+
export interface ResolvedContract extends ContractRequirement
|
|
72
|
+
{
|
|
73
|
+
version: string;
|
|
74
|
+
digest: string;
|
|
75
|
+
versionRequirement?: string;
|
|
76
|
+
}
|
|
77
|
+
export interface ComponentDescriptor
|
|
78
|
+
{
|
|
79
|
+
format: 'lawspec-component';
|
|
80
|
+
version: 1;
|
|
81
|
+
manifest: string;
|
|
82
|
+
root: string;
|
|
83
|
+
component: Identity | null;
|
|
84
|
+
package: Identity | null;
|
|
85
|
+
fingerprint: string;
|
|
86
|
+
manifestDigest: string;
|
|
87
|
+
targets: ComponentTarget[];
|
|
88
|
+
provides: ResolvedContract[];
|
|
89
|
+
requires: Record<string, ResolvedContract>;
|
|
90
|
+
dependencies: unknown[];
|
|
91
|
+
laws: unknown[];
|
|
92
|
+
declarations: string[];
|
|
40
93
|
}
|
|
41
94
|
/** Parses EDN data; readManifest also validates the component schema. */
|
|
42
|
-
export function parseManifest(
|
|
43
|
-
|
|
95
|
+
export function parseManifest(
|
|
96
|
+
text: string,
|
|
97
|
+
file?: string,
|
|
98
|
+
): Record<string, unknown>;
|
|
99
|
+
export function writeManifest(
|
|
100
|
+
value: ComponentManifest | Record<string, unknown>,
|
|
101
|
+
options?: {compact?: boolean},
|
|
102
|
+
): string;
|
|
44
103
|
export function readManifest(file: string): Promise<ComponentManifest>;
|
|
45
104
|
export function findManifest(start?: string): Promise<string>;
|
|
46
|
-
export function resolveComponent(
|
|
105
|
+
export function resolveComponent(
|
|
106
|
+
file: string,
|
|
107
|
+
options?: ResolutionOptions,
|
|
108
|
+
): Promise<ComponentDescriptor>;
|
package/component.mjs
CHANGED
|
@@ -11,31 +11,56 @@ import {fingerprintInputs} from './input-files.mjs';
|
|
|
11
11
|
|
|
12
12
|
export const manifestName = 'lawspec.edn';
|
|
13
13
|
export const lockName = 'lawspec.lock.edn';
|
|
14
|
-
const camel = key =>
|
|
15
|
-
|
|
14
|
+
const camel = key =>
|
|
15
|
+
key.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
16
|
+
const kebab = key =>
|
|
17
|
+
key.replace(/[A-Z]/g, letter => '-' + letter.toLowerCase());
|
|
16
18
|
const own = (value, key) => Object.prototype.hasOwnProperty.call(value, key);
|
|
17
|
-
const fail = (message, file) =>
|
|
19
|
+
const fail = (message, file) =>
|
|
20
|
+
{
|
|
18
21
|
const error = new Error(`${file ? file + ': ' : ''}${message}`);
|
|
19
|
-
error.diagnostics = [
|
|
22
|
+
error.diagnostics = [
|
|
23
|
+
{
|
|
24
|
+
code: 'manifest',
|
|
25
|
+
message,
|
|
26
|
+
...(file ? {at: {file, line: 1, column: 1}} : {}),
|
|
27
|
+
},
|
|
28
|
+
];
|
|
20
29
|
throw error;
|
|
21
30
|
};
|
|
22
31
|
|
|
23
|
-
export function parseManifest(text, file)
|
|
32
|
+
export function parseManifest(text, file)
|
|
33
|
+
{
|
|
24
34
|
let values, parser;
|
|
25
|
-
try
|
|
35
|
+
try
|
|
36
|
+
{
|
|
26
37
|
parser = new EDNListParser();
|
|
27
38
|
values = parser.next('(' + text + '\n)\n');
|
|
28
|
-
}
|
|
39
|
+
}
|
|
40
|
+
catch (error)
|
|
41
|
+
{
|
|
42
|
+
fail(`Invalid EDN: ${error.message}`, file);
|
|
43
|
+
}
|
|
29
44
|
if (!parser.isDone() || values.length !== 1 || !Array.isArray(values[0]?.map))
|
|
30
45
|
fail('Expected exactly one complete EDN map', file);
|
|
31
|
-
function convert(value)
|
|
32
|
-
|
|
46
|
+
function convert(value)
|
|
47
|
+
{
|
|
48
|
+
if (
|
|
49
|
+
value === null ||
|
|
50
|
+
typeof value === 'string' ||
|
|
51
|
+
typeof value === 'boolean'
|
|
52
|
+
)
|
|
53
|
+
return value;
|
|
33
54
|
if (typeof value === 'number' && Number.isSafeInteger(value)) return value;
|
|
34
55
|
if (Array.isArray(value)) return value.map(convert);
|
|
35
|
-
if (value && typeof value === 'object' && own(value, 'key'))
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
56
|
+
if (value && typeof value === 'object' && own(value, 'key'))
|
|
57
|
+
return value.key;
|
|
58
|
+
if (value && typeof value === 'object' && own(value, 'map'))
|
|
59
|
+
{
|
|
60
|
+
const entries = [],
|
|
61
|
+
seen = new Set();
|
|
62
|
+
for (const [key, entry] of value.map)
|
|
63
|
+
{
|
|
39
64
|
if (typeof key !== 'string' && !(key && typeof key.key === 'string'))
|
|
40
65
|
fail('Manifest map keys must be strings or keywords', file);
|
|
41
66
|
const name = typeof key === 'string' ? key : camel(key.key);
|
|
@@ -45,143 +70,316 @@ export function parseManifest(text, file) {
|
|
|
45
70
|
}
|
|
46
71
|
return Object.fromEntries(entries);
|
|
47
72
|
}
|
|
48
|
-
fail(
|
|
73
|
+
fail(
|
|
74
|
+
'Unsupported manifest EDN value; use maps, vectors, keywords, strings, integers, booleans or nil',
|
|
75
|
+
file,
|
|
76
|
+
);
|
|
49
77
|
}
|
|
50
78
|
return convert(values[0]);
|
|
51
79
|
}
|
|
52
80
|
|
|
53
|
-
export function writeManifest(value, options = {})
|
|
54
|
-
|
|
81
|
+
export function writeManifest(value, options = {})
|
|
82
|
+
{
|
|
83
|
+
if (options?.compact !== undefined && typeof options.compact !== 'boolean')
|
|
84
|
+
throw new TypeError('compact must be a boolean');
|
|
55
85
|
const identifiers = new Set(['language', 'layers']);
|
|
56
|
-
function convert(value, parent)
|
|
86
|
+
function convert(value, parent)
|
|
87
|
+
{
|
|
57
88
|
if (Array.isArray(value)) return value.map(entry => convert(entry, parent));
|
|
58
|
-
if (value && typeof value === 'object')
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
89
|
+
if (value && typeof value === 'object')
|
|
90
|
+
return {
|
|
91
|
+
map: Object.entries(value)
|
|
92
|
+
.filter(([, entry]) => entry !== undefined)
|
|
93
|
+
.map(([key, entry]) => [
|
|
94
|
+
/^[a-z][A-Za-z0-9]*$/.test(key) ? {key: kebab(key)} : key,
|
|
95
|
+
convert(entry, key),
|
|
96
|
+
]),
|
|
97
|
+
};
|
|
98
|
+
return typeof value === 'string' && identifiers.has(parent)
|
|
99
|
+
? {key: value}
|
|
100
|
+
: value;
|
|
63
101
|
}
|
|
64
|
-
function layout(value, depth)
|
|
65
|
-
|
|
102
|
+
function layout(value, depth)
|
|
103
|
+
{
|
|
104
|
+
const indent = ' '.repeat(depth),
|
|
105
|
+
child = indent + ' ';
|
|
66
106
|
if (value && !Array.isArray(value) && value.map)
|
|
67
|
-
return
|
|
68
|
-
|
|
69
|
-
|
|
107
|
+
return (
|
|
108
|
+
'{\n' +
|
|
109
|
+
value.map
|
|
110
|
+
.map(
|
|
111
|
+
([key, entry]) =>
|
|
112
|
+
child + toEDNString(key) + ' ' + layout(entry, depth + 1),
|
|
113
|
+
)
|
|
114
|
+
.join('\n') +
|
|
115
|
+
'\n' +
|
|
116
|
+
indent +
|
|
117
|
+
'}'
|
|
118
|
+
);
|
|
119
|
+
if (
|
|
120
|
+
Array.isArray(value) &&
|
|
121
|
+
value.some(entry => entry && typeof entry === 'object')
|
|
122
|
+
)
|
|
123
|
+
return (
|
|
124
|
+
'[\n' +
|
|
125
|
+
value.map(entry => child + layout(entry, depth + 1)).join('\n') +
|
|
126
|
+
'\n' +
|
|
127
|
+
indent +
|
|
128
|
+
']'
|
|
129
|
+
);
|
|
70
130
|
return toEDNString(value);
|
|
71
131
|
}
|
|
72
132
|
const converted = convert(value);
|
|
73
|
-
return (
|
|
133
|
+
return (
|
|
134
|
+
(options?.compact === true
|
|
135
|
+
? toEDNString(converted)
|
|
136
|
+
: layout(converted, 0)) + '\n'
|
|
137
|
+
);
|
|
74
138
|
}
|
|
75
139
|
|
|
76
140
|
let core;
|
|
77
|
-
async function coreRequest(request)
|
|
141
|
+
async function coreRequest(request)
|
|
142
|
+
{
|
|
78
143
|
core ??= loadCore();
|
|
79
144
|
const result = await (await core)({schemaVersion: 5, ...request});
|
|
80
|
-
if (result.diagnostics?.length)
|
|
81
|
-
|
|
145
|
+
if (result.diagnostics?.length)
|
|
146
|
+
{
|
|
147
|
+
const error = new Error(
|
|
148
|
+
result.diagnostics.map(item => item.message).join('\n'),
|
|
149
|
+
);
|
|
82
150
|
error.diagnostics = result.diagnostics;
|
|
83
151
|
throw error;
|
|
84
152
|
}
|
|
85
153
|
return result;
|
|
86
154
|
}
|
|
87
155
|
|
|
88
|
-
export async function readManifest(file)
|
|
89
|
-
|
|
156
|
+
export async function readManifest(file)
|
|
157
|
+
{
|
|
158
|
+
if (path.extname(file) !== '.edn')
|
|
159
|
+
fail(
|
|
160
|
+
'LawSpec component and package manifests must use lawspec.edn; JSON configuration is no longer supported',
|
|
161
|
+
file,
|
|
162
|
+
);
|
|
90
163
|
const manifest = parseManifest(await readFile(file, 'utf8'), file);
|
|
91
|
-
try
|
|
92
|
-
|
|
164
|
+
try
|
|
165
|
+
{
|
|
166
|
+
return (await coreRequest({method: 'componentManifest', manifest}))
|
|
167
|
+
.manifest;
|
|
168
|
+
}
|
|
169
|
+
catch (error)
|
|
170
|
+
{
|
|
93
171
|
error.message = `${file}: ${error.message}`;
|
|
94
|
-
error.diagnostics = error.diagnostics?.map(item => ({
|
|
172
|
+
error.diagnostics = error.diagnostics?.map(item => ({
|
|
173
|
+
...item,
|
|
174
|
+
at: {file, line: 1, column: 1},
|
|
175
|
+
}));
|
|
95
176
|
throw error;
|
|
96
177
|
}
|
|
97
178
|
}
|
|
98
179
|
|
|
99
|
-
export async function findManifest(start = process.cwd())
|
|
180
|
+
export async function findManifest(start = process.cwd())
|
|
181
|
+
{
|
|
100
182
|
let directory = path.resolve(start);
|
|
101
|
-
for (;;)
|
|
183
|
+
for (;;)
|
|
184
|
+
{
|
|
102
185
|
const candidate = path.join(directory, manifestName);
|
|
103
|
-
if (
|
|
186
|
+
if (
|
|
187
|
+
await stat(candidate).then(
|
|
188
|
+
info => info.isFile(),
|
|
189
|
+
() => false,
|
|
190
|
+
)
|
|
191
|
+
)
|
|
192
|
+
return candidate;
|
|
104
193
|
for (const old of ['lawspec.json', 'lawspec-package.json'])
|
|
105
|
-
if (
|
|
106
|
-
|
|
194
|
+
if (
|
|
195
|
+
await stat(path.join(directory, old)).then(
|
|
196
|
+
info => info.isFile(),
|
|
197
|
+
() => false,
|
|
198
|
+
)
|
|
199
|
+
)
|
|
200
|
+
fail(
|
|
201
|
+
`${old} is no longer supported; use lawspec.edn`,
|
|
202
|
+
path.join(directory, old),
|
|
203
|
+
);
|
|
107
204
|
const parent = path.dirname(directory);
|
|
108
|
-
if (parent === directory)
|
|
205
|
+
if (parent === directory)
|
|
206
|
+
fail('No lawspec.edn found in this directory or its parents', start);
|
|
109
207
|
directory = parent;
|
|
110
208
|
}
|
|
111
209
|
}
|
|
112
210
|
|
|
113
|
-
export async function packageVersions(range, versions)
|
|
114
|
-
|
|
211
|
+
export async function packageVersions(range, versions)
|
|
212
|
+
{
|
|
213
|
+
return (await coreRequest({method: 'packageVersions', range, versions}))
|
|
214
|
+
.versions;
|
|
115
215
|
}
|
|
116
216
|
|
|
117
|
-
export const dependencyRanges = manifest =>
|
|
118
|
-
|
|
119
|
-
|
|
217
|
+
export const dependencyRanges = manifest =>
|
|
218
|
+
Object.fromEntries(
|
|
219
|
+
Object.entries(manifest.dependencies ?? {}).map(([name, value]) => [
|
|
220
|
+
name,
|
|
221
|
+
typeof value === 'string' ? value : value.version,
|
|
222
|
+
]),
|
|
223
|
+
);
|
|
224
|
+
export const contentDigest = value =>
|
|
225
|
+
createHash('sha256').update(value).digest('hex');
|
|
226
|
+
export function canonical(value)
|
|
227
|
+
{
|
|
120
228
|
if (Array.isArray(value)) return '[' + value.map(canonical).join(',') + ']';
|
|
121
|
-
if (value && typeof value === 'object')
|
|
229
|
+
if (value && typeof value === 'object')
|
|
230
|
+
return (
|
|
231
|
+
'{' +
|
|
232
|
+
Object.keys(value)
|
|
233
|
+
.sort()
|
|
234
|
+
.map(key => JSON.stringify(key) + ':' + canonical(value[key]))
|
|
235
|
+
.join(',') +
|
|
236
|
+
'}'
|
|
237
|
+
);
|
|
122
238
|
return JSON.stringify(value);
|
|
123
239
|
}
|
|
124
240
|
|
|
125
|
-
export async function componentInput(file, options = {})
|
|
126
|
-
|
|
241
|
+
export async function componentInput(file, options = {})
|
|
242
|
+
{
|
|
243
|
+
const manifest = await readManifest(file),
|
|
244
|
+
root = path.dirname(path.resolve(file));
|
|
127
245
|
const {resolveDependencies} = await import('./component-packages.mjs');
|
|
128
246
|
const dependencies = await resolveDependencies(file, manifest, options);
|
|
129
247
|
const sources = await collectSources(root, manifest.sources, root);
|
|
130
|
-
return {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
248
|
+
return {
|
|
249
|
+
manifest,
|
|
250
|
+
root,
|
|
251
|
+
input: {
|
|
252
|
+
sources,
|
|
253
|
+
languageProfile: manifest.languageProfile,
|
|
254
|
+
verification: manifest.verification ?? {layers: []},
|
|
255
|
+
...(manifest.package ? {package: manifest.package} : {}),
|
|
256
|
+
dependencies: dependencyRanges(manifest),
|
|
257
|
+
packages: dependencies.packages,
|
|
258
|
+
generation: manifest.generation,
|
|
259
|
+
machineBits: manifest.machineBits ?? 64,
|
|
260
|
+
projectVersion: manifest.component?.version ?? manifest.package?.version,
|
|
261
|
+
},
|
|
262
|
+
dependencies,
|
|
263
|
+
};
|
|
138
264
|
}
|
|
139
265
|
|
|
140
|
-
export async function resolveComponent(file, options = {})
|
|
141
|
-
|
|
266
|
+
export async function resolveComponent(file, options = {})
|
|
267
|
+
{
|
|
268
|
+
const {manifest, root, input, dependencies} = await componentInput(
|
|
269
|
+
file,
|
|
270
|
+
options,
|
|
271
|
+
);
|
|
142
272
|
const compiler = await createCompiler();
|
|
143
|
-
const relativeCache = path.relative(
|
|
273
|
+
const relativeCache = path.relative(
|
|
274
|
+
await realpath(process.cwd()),
|
|
275
|
+
path.join(await realpath(root), '.lawspec', 'cache'),
|
|
276
|
+
);
|
|
144
277
|
let cacheDirectory;
|
|
145
|
-
if (
|
|
146
|
-
|
|
278
|
+
if (
|
|
279
|
+
manifest.cache !== false &&
|
|
280
|
+
relativeCache !== '..' &&
|
|
281
|
+
!relativeCache.startsWith('..' + path.sep) &&
|
|
282
|
+
!path.isAbsolute(relativeCache)
|
|
283
|
+
)
|
|
284
|
+
{
|
|
285
|
+
const build = contentDigest(
|
|
286
|
+
await readFile(new URL('./core.wasm', import.meta.url)),
|
|
287
|
+
).slice(0, 16);
|
|
147
288
|
cacheDirectory = path.join(relativeCache, build).split(path.sep).join('/');
|
|
148
289
|
await mkdir(path.join(process.cwd(), cacheDirectory), {recursive: true});
|
|
149
|
-
await writeFile(
|
|
290
|
+
await writeFile(
|
|
291
|
+
path.join(process.cwd(), relativeCache, '.gitignore'),
|
|
292
|
+
'*\n',
|
|
293
|
+
);
|
|
150
294
|
}
|
|
151
|
-
const request = {
|
|
152
|
-
...
|
|
295
|
+
const request = {
|
|
296
|
+
...input,
|
|
297
|
+
verification: {layers: []},
|
|
298
|
+
...(cacheDirectory === undefined ? {} : {cacheDirectory}),
|
|
299
|
+
};
|
|
153
300
|
const checked = await compiler.check(request);
|
|
154
|
-
if (checked.diagnostics?.length)
|
|
155
|
-
|
|
301
|
+
if (checked.diagnostics?.length)
|
|
302
|
+
{
|
|
303
|
+
const error = new Error(
|
|
304
|
+
checked.diagnostics.map(item => item.message).join('\n'),
|
|
305
|
+
);
|
|
156
306
|
error.diagnostics = checked.diagnostics;
|
|
157
307
|
throw error;
|
|
158
308
|
}
|
|
159
|
-
for (const target of manifest.targets ?? [])
|
|
309
|
+
for (const target of manifest.targets ?? [])
|
|
310
|
+
{
|
|
160
311
|
if (target.nativeBindings === undefined) continue;
|
|
161
|
-
const bound = await compiler.check({
|
|
162
|
-
|
|
163
|
-
|
|
312
|
+
const bound = await compiler.check({
|
|
313
|
+
...request,
|
|
314
|
+
nativeBindings: target.nativeBindings,
|
|
315
|
+
});
|
|
316
|
+
if (bound.diagnostics?.length)
|
|
317
|
+
{
|
|
318
|
+
const error = new Error(
|
|
319
|
+
bound.diagnostics.map(item => item.message).join('\n'),
|
|
320
|
+
);
|
|
164
321
|
error.diagnostics = bound.diagnostics;
|
|
165
322
|
throw error;
|
|
166
323
|
}
|
|
167
324
|
}
|
|
168
325
|
const declarations = new Set([
|
|
169
|
-
...(checked.units ?? [])
|
|
326
|
+
...(checked.units ?? [])
|
|
327
|
+
.flatMap(unit => [
|
|
328
|
+
...(unit.declarations ?? []),
|
|
329
|
+
...(unit.abilities ?? []),
|
|
330
|
+
])
|
|
331
|
+
.map(item => item.id),
|
|
170
332
|
...(checked.laws ?? []).map(item => item.id),
|
|
171
333
|
]);
|
|
172
|
-
const contracts = new Map(
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
334
|
+
const contracts = new Map(
|
|
335
|
+
Object.entries(dependencies.lock.roots).map(([name, id]) => [
|
|
336
|
+
name,
|
|
337
|
+
dependencies.lock.packages.find(item => item.id === id),
|
|
338
|
+
]),
|
|
339
|
+
);
|
|
340
|
+
if (manifest.package)
|
|
341
|
+
{
|
|
342
|
+
const {packageDigest, resolvedPackageDigest} =
|
|
343
|
+
await import('./component-packages.mjs');
|
|
344
|
+
contracts.set(manifest.package.name, {
|
|
345
|
+
...manifest.package,
|
|
346
|
+
digest: resolvedPackageDigest(
|
|
347
|
+
await packageDigest(root),
|
|
348
|
+
Object.fromEntries(
|
|
349
|
+
Object.entries(dependencies.lock.roots).map(([name, id]) =>
|
|
350
|
+
{
|
|
351
|
+
const selected = dependencies.lock.packages.find(
|
|
352
|
+
entry => entry.id === id,
|
|
353
|
+
);
|
|
354
|
+
return [
|
|
355
|
+
name,
|
|
356
|
+
dependencies.identities.find(
|
|
357
|
+
entry =>
|
|
358
|
+
entry.name === selected.name &&
|
|
359
|
+
entry.version === selected.version,
|
|
360
|
+
).digest,
|
|
361
|
+
];
|
|
362
|
+
}),
|
|
363
|
+
),
|
|
364
|
+
),
|
|
365
|
+
});
|
|
180
366
|
}
|
|
181
|
-
for (const [name, requirement] of [
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
367
|
+
for (const [name, requirement] of [
|
|
368
|
+
...Object.entries(manifest.requires ?? {}),
|
|
369
|
+
...(manifest.provides ?? []).map((value, index) => [
|
|
370
|
+
`provides[${index}]`,
|
|
371
|
+
value,
|
|
372
|
+
]),
|
|
373
|
+
])
|
|
374
|
+
{
|
|
375
|
+
if (!contracts.has(requirement.contract))
|
|
376
|
+
fail(`${name}: contract ${requirement.contract} is not resolved`, file);
|
|
377
|
+
for (const declaration of [
|
|
378
|
+
...(requirement.abilities ?? []),
|
|
379
|
+
...(requirement.declarations ?? []),
|
|
380
|
+
])
|
|
381
|
+
if (!declarations.has(declaration))
|
|
382
|
+
fail(`${name}: unknown declaration ${declaration}`, file);
|
|
185
383
|
}
|
|
186
384
|
const identity = {
|
|
187
385
|
manifest,
|
|
@@ -189,20 +387,45 @@ export async function resolveComponent(file, options = {}) {
|
|
|
189
387
|
dependencies: dependencies.identities,
|
|
190
388
|
inputs: await fingerprintInputs(root, manifest.inputs ?? []),
|
|
191
389
|
};
|
|
192
|
-
const contractView = value =>
|
|
390
|
+
const contractView = value =>
|
|
391
|
+
{
|
|
193
392
|
const selected = contracts.get(value.contract);
|
|
194
|
-
const content = dependencies.identities.find(
|
|
195
|
-
|
|
196
|
-
|
|
393
|
+
const content = dependencies.identities.find(
|
|
394
|
+
item => item.name === selected.name && item.version === selected.version,
|
|
395
|
+
);
|
|
396
|
+
return {
|
|
397
|
+
...value,
|
|
398
|
+
version: selected.version,
|
|
399
|
+
digest: content?.digest ?? selected.digest,
|
|
400
|
+
...(manifest.dependencies?.[value.contract]
|
|
401
|
+
? {
|
|
402
|
+
versionRequirement:
|
|
403
|
+
typeof manifest.dependencies[value.contract] === 'string'
|
|
404
|
+
? manifest.dependencies[value.contract]
|
|
405
|
+
: manifest.dependencies[value.contract].version,
|
|
406
|
+
}
|
|
407
|
+
: {}),
|
|
408
|
+
};
|
|
197
409
|
};
|
|
198
410
|
return {
|
|
199
|
-
format: 'lawspec-component',
|
|
200
|
-
|
|
411
|
+
format: 'lawspec-component',
|
|
412
|
+
version: 1,
|
|
413
|
+
manifest: path.resolve(file),
|
|
414
|
+
root,
|
|
415
|
+
component: manifest.component ?? null,
|
|
416
|
+
package: manifest.package ?? null,
|
|
201
417
|
fingerprint: contentDigest(canonical(identity)),
|
|
202
418
|
manifestDigest: contentDigest(await readFile(file)),
|
|
203
|
-
targets: manifest.targets ?? [],
|
|
204
|
-
|
|
419
|
+
targets: manifest.targets ?? [],
|
|
420
|
+
provides: (manifest.provides ?? []).map(contractView),
|
|
421
|
+
requires: Object.fromEntries(
|
|
422
|
+
Object.entries(manifest.requires ?? {}).map(([name, value]) => [
|
|
423
|
+
name,
|
|
424
|
+
contractView(value),
|
|
425
|
+
]),
|
|
426
|
+
),
|
|
205
427
|
dependencies: dependencies.identities,
|
|
206
|
-
laws: checked.laws ?? [],
|
|
428
|
+
laws: checked.laws ?? [],
|
|
429
|
+
declarations: [...declarations].sort(),
|
|
207
430
|
};
|
|
208
431
|
}
|
package/core.wasm
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/core.wasm
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 92408858 bytes
|
|
4
|
+
sha256: d6ed18b5786d73d33a409ff29b68fcbd5a1f11e9ea08efdb8c252aa3e47cdc10
|
package/core_jsffi.js
CHANGED
|
@@ -92,11 +92,11 @@ newJSVal: (v) => __ghc_wasm_jsffi_jsval_manager.newJSVal(v),
|
|
|
92
92
|
getJSVal: (k) => __ghc_wasm_jsffi_jsval_manager.getJSVal(k),
|
|
93
93
|
freeJSVal: (k) => __ghc_wasm_jsffi_jsval_manager.freeJSVal(k),
|
|
94
94
|
scheduleWork: () => setImmediate(__exports.rts_schedulerLoop),
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
95
|
+
ZC1ZClawspeczmwasmzm0zi31zi3zminplacezmlawspeczmwasmZCMainZC: ($1) => (($1.parts.push($1.decoder.decode()), $1.parts.join(''))),
|
|
96
|
+
ZC2ZClawspeczmwasmzm0zi31zi3zminplacezmlawspeczmwasmZCMainZC: ($1,$2,$3) => ($1.parts.push($1.decoder.decode(new Uint8Array(__exports.memory.buffer, $2 >>> 0, $3), {stream: true}))),
|
|
97
|
+
ZC3ZClawspeczmwasmzm0zi31zi3zminplacezmlawspeczmwasmZCMainZC: () => (({decoder: new TextDecoder('utf-8', {fatal: true}), parts: []})),
|
|
98
|
+
ZC4ZClawspeczmwasmzm0zi31zi3zminplacezmlawspeczmwasmZCMainZC: ($1,$2,$3) => ((new TextEncoder()).encodeInto($1, new Uint8Array(__exports.memory.buffer, $2 >>> 0, $3)).written),
|
|
99
|
+
ZC5ZClawspeczmwasmzm0zi31zi3zminplacezmlawspeczmwasmZCMainZC: ($1) => ($1.length),
|
|
100
100
|
ZC0ZCghczminternalZCGHCziInternalziWasmziPrimziExportsZC: ($1,$2) => ($1.reject(new WebAssembly.RuntimeError($2))),
|
|
101
101
|
ZC18ZCghczminternalZCGHCziInternalziWasmziPrimziExportsZC: ($1,$2) => ($1.resolve($2)),
|
|
102
102
|
ZC20ZCghczminternalZCGHCziInternalziWasmziPrimziExportsZC: ($1) => {$1.throwTo = () => {};},
|