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/learn/app.mjs
ADDED
|
@@ -0,0 +1,1279 @@
|
|
|
1
|
+
// ref:DEC-learn-course-hierarchy
|
|
2
|
+
import {execute} from './sandbox.mjs';
|
|
3
|
+
import {expectationProblems} from './story.mjs';
|
|
4
|
+
import {describeCheck, runSummary, observedCall} from './presentation.mjs';
|
|
5
|
+
import {
|
|
6
|
+
openStore,
|
|
7
|
+
draftKey,
|
|
8
|
+
courseVersion,
|
|
9
|
+
refreshProvidedLaws,
|
|
10
|
+
} from './store.mjs';
|
|
11
|
+
import {monaco} from './vendor/editor.mjs';
|
|
12
|
+
const $ = id => document.getElementById(id);
|
|
13
|
+
const node = (tag, text, attributes = {}) =>
|
|
14
|
+
{
|
|
15
|
+
const el = document.createElement(tag);
|
|
16
|
+
el.textContent = text;
|
|
17
|
+
for (const [key, value] of Object.entries(attributes))
|
|
18
|
+
{
|
|
19
|
+
el.setAttribute(key, value);
|
|
20
|
+
}
|
|
21
|
+
return el;
|
|
22
|
+
};
|
|
23
|
+
const started = performance.now();
|
|
24
|
+
const runScopes = {
|
|
25
|
+
all: 'All checks',
|
|
26
|
+
examples: 'Examples + boundaries',
|
|
27
|
+
sample: 'Sampled properties',
|
|
28
|
+
};
|
|
29
|
+
globalThis.MonacoEnvironment = {
|
|
30
|
+
getWorker: () =>
|
|
31
|
+
new Worker(new URL('./vendor/editor-worker.js', import.meta.url)),
|
|
32
|
+
};
|
|
33
|
+
const course = await (
|
|
34
|
+
await fetch(new URL('./curriculum.json', import.meta.url))
|
|
35
|
+
).json();
|
|
36
|
+
let store;
|
|
37
|
+
try
|
|
38
|
+
{
|
|
39
|
+
store = await openStore();
|
|
40
|
+
}
|
|
41
|
+
catch (error)
|
|
42
|
+
{
|
|
43
|
+
$('message').textContent = 'Draft storage is unavailable: ' + error.message;
|
|
44
|
+
throw error;
|
|
45
|
+
}
|
|
46
|
+
const params = new URLSearchParams(location.hash.slice(1));
|
|
47
|
+
let lesson =
|
|
48
|
+
(params.get('course') === course.version &&
|
|
49
|
+
course.lessons.find(row => row.id === params.get('lesson'))) ||
|
|
50
|
+
course.lessons[0];
|
|
51
|
+
let sceneIndex =
|
|
52
|
+
params.get('course') === course.version
|
|
53
|
+
? Math.max(
|
|
54
|
+
0,
|
|
55
|
+
lesson.stages.findIndex(row => row.id === params.get('scene')),
|
|
56
|
+
)
|
|
57
|
+
: 0;
|
|
58
|
+
const scene = () => lesson.stages[sceneIndex];
|
|
59
|
+
const key = () => draftKey(lesson.id, track, language, scene().id);
|
|
60
|
+
const focusFile = () =>
|
|
61
|
+
['Solution', 'Tests'].includes(scene().focus)
|
|
62
|
+
? scene().focus === 'Tests'
|
|
63
|
+
? 'Tests.lawspec'
|
|
64
|
+
: 'Solution.' +
|
|
65
|
+
{fsharp: 'fs', typescript: 'ts', javascript: 'js'}[language]
|
|
66
|
+
: scene().focus;
|
|
67
|
+
let language = ['fsharp', 'typescript', 'javascript'].includes(
|
|
68
|
+
params.get('language'),
|
|
69
|
+
)
|
|
70
|
+
? params.get('language')
|
|
71
|
+
: 'fsharp';
|
|
72
|
+
let track = course.tracks.some(row => row.id === params.get('track'))
|
|
73
|
+
? params.get('track')
|
|
74
|
+
: 'shared';
|
|
75
|
+
let draft,
|
|
76
|
+
currentFile,
|
|
77
|
+
model,
|
|
78
|
+
suppress = false,
|
|
79
|
+
controller,
|
|
80
|
+
worker,
|
|
81
|
+
formatWorker,
|
|
82
|
+
runId = 0,
|
|
83
|
+
lastRun,
|
|
84
|
+
lastFailure,
|
|
85
|
+
generated = [],
|
|
86
|
+
hint = 0,
|
|
87
|
+
saveQueue = Promise.resolve();
|
|
88
|
+
let replacementFiles = null;
|
|
89
|
+
function forgetReplacement()
|
|
90
|
+
{
|
|
91
|
+
replacementFiles = null;
|
|
92
|
+
$('undo-replacement').hidden = true;
|
|
93
|
+
}
|
|
94
|
+
function replaceFiles(files)
|
|
95
|
+
{
|
|
96
|
+
if (
|
|
97
|
+
!Object.entries(files).every(
|
|
98
|
+
([name, content]) => draft.files[name] === content,
|
|
99
|
+
)
|
|
100
|
+
)
|
|
101
|
+
{
|
|
102
|
+
replacementFiles = structuredClone(draft.files);
|
|
103
|
+
$('undo-replacement').hidden = false;
|
|
104
|
+
}
|
|
105
|
+
draft.files = structuredClone(files);
|
|
106
|
+
}
|
|
107
|
+
const editor = monaco.editor.create($('editor'), {
|
|
108
|
+
theme: 'lawspec-' + document.documentElement.dataset.theme,
|
|
109
|
+
fontFamily: '"Atkinson Hyperlegible Mono", monospace',
|
|
110
|
+
fontSize: 14,
|
|
111
|
+
lineHeight: 22,
|
|
112
|
+
fontLigatures: false,
|
|
113
|
+
minimap: {enabled: false},
|
|
114
|
+
automaticLayout: true,
|
|
115
|
+
scrollBeyondLastLine: false,
|
|
116
|
+
tabSize: 4,
|
|
117
|
+
wordWrap: 'on',
|
|
118
|
+
accessibilitySupport: 'auto',
|
|
119
|
+
});
|
|
120
|
+
// Theme changes preserve drafts, selection and execution results. ref:DEC-learn-theme
|
|
121
|
+
document.addEventListener('lawspec-theme-change', () =>
|
|
122
|
+
{
|
|
123
|
+
monaco.editor.setTheme('lawspec-' + document.documentElement.dataset.theme);
|
|
124
|
+
if (generatedSelection)
|
|
125
|
+
{
|
|
126
|
+
awaitGenerated(generatedSelection);
|
|
127
|
+
}
|
|
128
|
+
renderStoryCode();
|
|
129
|
+
});
|
|
130
|
+
let generatedSelection,
|
|
131
|
+
colorization = 0,
|
|
132
|
+
storyColorization = 0;
|
|
133
|
+
document.fonts.load('400 14px "Atkinson Hyperlegible Mono"').then(() =>
|
|
134
|
+
{
|
|
135
|
+
monaco.editor.remeasureFonts();
|
|
136
|
+
editor.layout();
|
|
137
|
+
});
|
|
138
|
+
function message(text, error = false)
|
|
139
|
+
{
|
|
140
|
+
$('message').textContent = text;
|
|
141
|
+
$('message').className = error ? 'error' : '';
|
|
142
|
+
}
|
|
143
|
+
function busy(value)
|
|
144
|
+
{
|
|
145
|
+
for (const id of [
|
|
146
|
+
'run',
|
|
147
|
+
'examples',
|
|
148
|
+
'sample',
|
|
149
|
+
'load-stage',
|
|
150
|
+
'solution',
|
|
151
|
+
'complete',
|
|
152
|
+
])
|
|
153
|
+
{
|
|
154
|
+
$(id).disabled = value;
|
|
155
|
+
}
|
|
156
|
+
$('cancel').disabled = !value;
|
|
157
|
+
$('cancel').hidden = !value;
|
|
158
|
+
$('run').setAttribute('aria-busy', String(value));
|
|
159
|
+
}
|
|
160
|
+
function clearExecution()
|
|
161
|
+
{
|
|
162
|
+
$('teaching-feedback').hidden = true;
|
|
163
|
+
lastRun = null;
|
|
164
|
+
lastFailure = null;
|
|
165
|
+
$('replay-hint').textContent = '';
|
|
166
|
+
generated = [];
|
|
167
|
+
generatedSelection = undefined;
|
|
168
|
+
$('generated-files').replaceChildren();
|
|
169
|
+
$('generated').textContent = '';
|
|
170
|
+
$('replay').disabled = true;
|
|
171
|
+
$('regression').disabled = true;
|
|
172
|
+
$('outcomes').replaceChildren();
|
|
173
|
+
$('diagnostics').textContent = '';
|
|
174
|
+
}
|
|
175
|
+
function invalidate()
|
|
176
|
+
{
|
|
177
|
+
clearExecution();
|
|
178
|
+
$('completion').textContent = '';
|
|
179
|
+
draft.completed = false;
|
|
180
|
+
$('result-status').textContent = 'Edited · rerun required';
|
|
181
|
+
$('outcomes').replaceChildren();
|
|
182
|
+
$('diagnostics').textContent = '';
|
|
183
|
+
controller?.abort();
|
|
184
|
+
}
|
|
185
|
+
function save({required = false} = {})
|
|
186
|
+
{
|
|
187
|
+
const identity = key(),
|
|
188
|
+
value = structuredClone(draft);
|
|
189
|
+
$('save-status').textContent = 'Saving…';
|
|
190
|
+
saveQueue = saveQueue
|
|
191
|
+
.catch(() =>
|
|
192
|
+
{})
|
|
193
|
+
.then(() => store.put(identity, value))
|
|
194
|
+
.then(() =>
|
|
195
|
+
{
|
|
196
|
+
$('save-status').textContent = 'Saved on device';
|
|
197
|
+
})
|
|
198
|
+
.catch(error =>
|
|
199
|
+
{
|
|
200
|
+
$('save-status').textContent = 'Save failed';
|
|
201
|
+
message(error.message, true);
|
|
202
|
+
if (required) throw error;
|
|
203
|
+
});
|
|
204
|
+
return saveQueue;
|
|
205
|
+
}
|
|
206
|
+
function languageFor(name)
|
|
207
|
+
{
|
|
208
|
+
return name.endsWith('.lawspec')
|
|
209
|
+
? 'lawspec'
|
|
210
|
+
: name.endsWith('.fs')
|
|
211
|
+
? 'fsharp'
|
|
212
|
+
: name.endsWith('.ts')
|
|
213
|
+
? 'typescript'
|
|
214
|
+
: /\.m?js$/.test(name)
|
|
215
|
+
? 'javascript'
|
|
216
|
+
: name.endsWith('.json')
|
|
217
|
+
? 'json'
|
|
218
|
+
: 'plaintext';
|
|
219
|
+
}
|
|
220
|
+
function selectFile(name)
|
|
221
|
+
{
|
|
222
|
+
currentFile = name;
|
|
223
|
+
suppress = true;
|
|
224
|
+
if (model)
|
|
225
|
+
{
|
|
226
|
+
editor.setModel(null);
|
|
227
|
+
model.dispose();
|
|
228
|
+
}
|
|
229
|
+
model = monaco.editor.createModel(draft.files[name], languageFor(name));
|
|
230
|
+
editor.setModel(model);
|
|
231
|
+
$('current-file').textContent = name;
|
|
232
|
+
$('harness-help').hidden = name !== 'Harness.lawspec';
|
|
233
|
+
$('harness-explanation').replaceChildren(
|
|
234
|
+
...[
|
|
235
|
+
course.harnessExplanation.role,
|
|
236
|
+
'This walkthrough describes the supplied harness for this step. Your edited source above determines the inputs actually used.',
|
|
237
|
+
...scene().harnessNotes,
|
|
238
|
+
course.harnessExplanation.declaration,
|
|
239
|
+
course.harnessExplanation.scope,
|
|
240
|
+
course.harnessExplanation.execution,
|
|
241
|
+
].map(text => node('p', text)),
|
|
242
|
+
);
|
|
243
|
+
for (const button of $('files').querySelectorAll('button'))
|
|
244
|
+
{
|
|
245
|
+
const selected = button.dataset.file === name;
|
|
246
|
+
button.setAttribute('aria-selected', String(selected));
|
|
247
|
+
button.tabIndex = selected ? 0 : -1;
|
|
248
|
+
}
|
|
249
|
+
editor
|
|
250
|
+
.getDomNode()
|
|
251
|
+
.setAttribute('aria-labelledby', 'file-' + name.replaceAll('.', '-'));
|
|
252
|
+
editor.updateOptions({
|
|
253
|
+
ariaLabel:
|
|
254
|
+
name +
|
|
255
|
+
' · ' +
|
|
256
|
+
{fsharp: 'F#', typescript: 'TypeScript', javascript: 'JavaScript'}[
|
|
257
|
+
language
|
|
258
|
+
] +
|
|
259
|
+
' project',
|
|
260
|
+
});
|
|
261
|
+
model.onDidChangeContent(() =>
|
|
262
|
+
{
|
|
263
|
+
if (suppress)
|
|
264
|
+
{
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
draft.files[currentFile] = model.getValue();
|
|
268
|
+
forgetReplacement();
|
|
269
|
+
invalidate();
|
|
270
|
+
renderStoryCode();
|
|
271
|
+
save();
|
|
272
|
+
});
|
|
273
|
+
suppress = false;
|
|
274
|
+
}
|
|
275
|
+
function suppliedScene()
|
|
276
|
+
{
|
|
277
|
+
return (
|
|
278
|
+
Number($('seed').value) === (scene().run.seed ?? 424242) &&
|
|
279
|
+
Object.entries(scene().projects[language]).every(
|
|
280
|
+
([name, content]) => draft.files[name] === content,
|
|
281
|
+
)
|
|
282
|
+
);
|
|
283
|
+
}
|
|
284
|
+
async function renderStoryCode()
|
|
285
|
+
{
|
|
286
|
+
if (!draft)
|
|
287
|
+
{
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
const revision = ++storyColorization,
|
|
291
|
+
file = focusFile(),
|
|
292
|
+
content = draft.files[file];
|
|
293
|
+
$('story-file').textContent = file + ' · open in editor';
|
|
294
|
+
$('story-state').textContent = suppliedScene()
|
|
295
|
+
? 'Source for this step'
|
|
296
|
+
: 'Your edited version · the story describes the resettable example';
|
|
297
|
+
$('expect').textContent = suppliedScene()
|
|
298
|
+
? scene().expect
|
|
299
|
+
: 'You changed this project. Run to observe your code; Reset this step reproduces the supplied example.';
|
|
300
|
+
const colored = await monaco.editor.colorize(content, languageFor(file), {});
|
|
301
|
+
if (revision === storyColorization)
|
|
302
|
+
{
|
|
303
|
+
$('story-code').innerHTML = colored;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
function showStage()
|
|
307
|
+
{
|
|
308
|
+
const stage = scene();
|
|
309
|
+
$('symbol').hidden = !stage.symbol;
|
|
310
|
+
$('symbol').textContent = stage.symbol ?? '';
|
|
311
|
+
for (const button of $('stage').querySelectorAll('button'))
|
|
312
|
+
{
|
|
313
|
+
button.setAttribute(
|
|
314
|
+
'aria-current',
|
|
315
|
+
Number(button.dataset.stage) === sceneIndex ? 'step' : 'false',
|
|
316
|
+
);
|
|
317
|
+
}
|
|
318
|
+
$('story').replaceChildren(...stage.story.map(text => node('p', text)));
|
|
319
|
+
for (const id of ['action', 'reason', 'expect', 'recovery'])
|
|
320
|
+
{
|
|
321
|
+
$(id).textContent = stage[id];
|
|
322
|
+
}
|
|
323
|
+
$('stage-title').textContent = stage.title;
|
|
324
|
+
$('code-step').textContent =
|
|
325
|
+
`Step ${sceneIndex + 1} of ${lesson.stages.length} · ${stage.title}`;
|
|
326
|
+
$('explanation').textContent =
|
|
327
|
+
(stage.syntax ??
|
|
328
|
+
'Tests and generation strategies are written in LawSpec. Only the implementation changes language.') +
|
|
329
|
+
' ' +
|
|
330
|
+
lesson.implementationSyntax[language];
|
|
331
|
+
$('naming-guide').textContent = course.namingGuide;
|
|
332
|
+
$('run-scope').textContent = runScopes[stage.run.mode];
|
|
333
|
+
$('examples').hidden = stage.run.mode === 'examples';
|
|
334
|
+
$('sample').hidden = stage.run.mode !== 'all';
|
|
335
|
+
document.querySelector('.alternate-runs').hidden =
|
|
336
|
+
$('examples').hidden && $('sample').hidden;
|
|
337
|
+
$('previous-scene').disabled = sceneIndex === 0 || Boolean(controller);
|
|
338
|
+
$('next-scene').disabled =
|
|
339
|
+
sceneIndex === lesson.stages.length - 1 || Boolean(controller);
|
|
340
|
+
renderStoryCode();
|
|
341
|
+
}
|
|
342
|
+
function lockNavigation(value)
|
|
343
|
+
{
|
|
344
|
+
for (const button of document.querySelectorAll(
|
|
345
|
+
'#lessons button,#languages button,#files button,#previous-scene,#next-scene',
|
|
346
|
+
))
|
|
347
|
+
{
|
|
348
|
+
button.disabled = value;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
async function navigate(
|
|
352
|
+
change,
|
|
353
|
+
{preserveView = false, preserveFile = false} = {},
|
|
354
|
+
)
|
|
355
|
+
{
|
|
356
|
+
const view = document.documentElement.dataset.workspaceView,
|
|
357
|
+
position = $('lesson-reader').scrollTop,
|
|
358
|
+
selectedFile = preserveFile ? currentFile : undefined;
|
|
359
|
+
lockNavigation(true);
|
|
360
|
+
await save();
|
|
361
|
+
change();
|
|
362
|
+
await load(selectedFile);
|
|
363
|
+
setWorkspaceView(preserveView ? view : 'read');
|
|
364
|
+
$('lesson-reader').scrollTop = preserveView ? position : 0;
|
|
365
|
+
if (!preserveView)
|
|
366
|
+
{
|
|
367
|
+
$('stage-title').focus({preventScroll: true});
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
async function load(selectedFile)
|
|
371
|
+
{
|
|
372
|
+
forgetReplacement();
|
|
373
|
+
lockNavigation(true);
|
|
374
|
+
$('lesson-reader').scrollTop = 0;
|
|
375
|
+
$('code-panel').querySelector('.results').scrollTop = 0;
|
|
376
|
+
controller?.abort();
|
|
377
|
+
await saveQueue;
|
|
378
|
+
draft = (await store.get(key())) ?? {
|
|
379
|
+
files: structuredClone(scene().projects[language]),
|
|
380
|
+
stage: sceneIndex,
|
|
381
|
+
completed: false,
|
|
382
|
+
};
|
|
383
|
+
if (!draft.files)
|
|
384
|
+
{
|
|
385
|
+
throw new Error('Invalid saved draft');
|
|
386
|
+
}
|
|
387
|
+
const refreshed = refreshProvidedLaws(
|
|
388
|
+
draft,
|
|
389
|
+
scene().previousProjects?.[language],
|
|
390
|
+
scene().projects[language],
|
|
391
|
+
);
|
|
392
|
+
lastRun = null;
|
|
393
|
+
lastFailure = null;
|
|
394
|
+
hint = 0;
|
|
395
|
+
generated = [];
|
|
396
|
+
generatedSelection = undefined;
|
|
397
|
+
$('outcomes').replaceChildren();
|
|
398
|
+
$('teaching-feedback').hidden = true;
|
|
399
|
+
$('generated-files').replaceChildren();
|
|
400
|
+
$('generated').textContent = '';
|
|
401
|
+
$('diagnostics').textContent = '';
|
|
402
|
+
$('replay').disabled = true;
|
|
403
|
+
$('regression').disabled = true;
|
|
404
|
+
$('hint-text').textContent = '';
|
|
405
|
+
$('title').textContent = lesson.title;
|
|
406
|
+
$('lesson-number').textContent =
|
|
407
|
+
`STEP ${sceneIndex + 1} OF ${lesson.stages.length}`;
|
|
408
|
+
for (const id of ['slogan', 'vision', 'news', 'contributions'])
|
|
409
|
+
{
|
|
410
|
+
$(id).textContent = lesson[id];
|
|
411
|
+
}
|
|
412
|
+
renderOutline();
|
|
413
|
+
$('languages').replaceChildren(
|
|
414
|
+
...[
|
|
415
|
+
['fsharp', 'F#', 'F#'],
|
|
416
|
+
['typescript', 'TypeScript', 'TS'],
|
|
417
|
+
['javascript', 'JavaScript', 'JS'],
|
|
418
|
+
].map(([id, label, short]) =>
|
|
419
|
+
{
|
|
420
|
+
const button = node('button', '', {
|
|
421
|
+
role: 'tab',
|
|
422
|
+
id: 'language-' + id,
|
|
423
|
+
'aria-label': label,
|
|
424
|
+
'aria-selected': String(language === id),
|
|
425
|
+
tabindex: language === id ? '0' : '-1',
|
|
426
|
+
'aria-controls': 'editor',
|
|
427
|
+
title: label,
|
|
428
|
+
});
|
|
429
|
+
button.append(
|
|
430
|
+
node('span', label, {class: 'language-long'}),
|
|
431
|
+
node('span', short, {class: 'language-short', 'aria-hidden': 'true'}),
|
|
432
|
+
);
|
|
433
|
+
button.onclick = () =>
|
|
434
|
+
navigate(
|
|
435
|
+
() =>
|
|
436
|
+
{
|
|
437
|
+
language = id;
|
|
438
|
+
},
|
|
439
|
+
{preserveView: true, preserveFile: true},
|
|
440
|
+
);
|
|
441
|
+
return button;
|
|
442
|
+
}),
|
|
443
|
+
);
|
|
444
|
+
const ext = {fsharp: 'fs', typescript: 'ts', javascript: 'js'}[language];
|
|
445
|
+
const views = [
|
|
446
|
+
['Tests.lawspec', 'Laws'],
|
|
447
|
+
[`Solution.${ext}`, 'Solution'],
|
|
448
|
+
['Harness.lawspec', 'Harness'],
|
|
449
|
+
];
|
|
450
|
+
const preferred = selectedFile?.startsWith('Solution.')
|
|
451
|
+
? 'Solution.' + ext
|
|
452
|
+
: (selectedFile ??
|
|
453
|
+
(scene().editor === 'Tests' ? 'Tests.lawspec' : 'Solution.' + ext));
|
|
454
|
+
$('files').replaceChildren(
|
|
455
|
+
...views.map(([name, label]) =>
|
|
456
|
+
{
|
|
457
|
+
const button = node('button', label, {
|
|
458
|
+
type: 'button',
|
|
459
|
+
role: 'tab',
|
|
460
|
+
id: 'file-' + name.replaceAll('.', '-'),
|
|
461
|
+
'data-file': name,
|
|
462
|
+
'aria-controls': 'editor',
|
|
463
|
+
title: name,
|
|
464
|
+
});
|
|
465
|
+
button.onclick = () => selectFile(name);
|
|
466
|
+
return button;
|
|
467
|
+
}),
|
|
468
|
+
);
|
|
469
|
+
$('attribution').replaceChildren(
|
|
470
|
+
...lesson.attribution.map(row =>
|
|
471
|
+
{
|
|
472
|
+
const p = node('p', '');
|
|
473
|
+
p.append(
|
|
474
|
+
node('a', row.title, {
|
|
475
|
+
href: row.url,
|
|
476
|
+
target: '_blank',
|
|
477
|
+
rel: 'noopener',
|
|
478
|
+
}),
|
|
479
|
+
node('span', ' — ' + row.use),
|
|
480
|
+
);
|
|
481
|
+
return p;
|
|
482
|
+
}),
|
|
483
|
+
);
|
|
484
|
+
$('execution-label').textContent =
|
|
485
|
+
language === 'fsharp'
|
|
486
|
+
? 'F# → Fable → JavaScript · LawSpec JS harness + fast-check'
|
|
487
|
+
: 'JavaScript execution · LawSpec JS harness + fast-check';
|
|
488
|
+
$('completion').textContent = draft.completed
|
|
489
|
+
? ' Learning milestone saved.'
|
|
490
|
+
: '';
|
|
491
|
+
$('result-status').textContent = 'Ready · no current run';
|
|
492
|
+
message(
|
|
493
|
+
refreshed
|
|
494
|
+
? 'The unchanged starter Laws and Harness now use English names. Your implementation and milestones were kept. Predict the result, then run.'
|
|
495
|
+
: 'Predict the result for this step, then run the selected checks.',
|
|
496
|
+
);
|
|
497
|
+
$('save-status').textContent = 'Saved on device';
|
|
498
|
+
$('run-options').open = false;
|
|
499
|
+
$('replay-hint').textContent = '';
|
|
500
|
+
$('saved-notebook').hidden = track === 'shared';
|
|
501
|
+
$('saved-notebook').textContent =
|
|
502
|
+
'Current saved notebook: ' +
|
|
503
|
+
course.tracks.find(row => row.id === track).title +
|
|
504
|
+
'.';
|
|
505
|
+
selectFile(preferred);
|
|
506
|
+
lockNavigation(false);
|
|
507
|
+
showStage();
|
|
508
|
+
history.replaceState(
|
|
509
|
+
null,
|
|
510
|
+
'',
|
|
511
|
+
'#' +
|
|
512
|
+
new URLSearchParams({
|
|
513
|
+
course: course.version,
|
|
514
|
+
lesson: lesson.id,
|
|
515
|
+
scene: scene().id,
|
|
516
|
+
language,
|
|
517
|
+
track,
|
|
518
|
+
}),
|
|
519
|
+
);
|
|
520
|
+
}
|
|
521
|
+
/** Present authored lessons and the current lesson's steps as one course outline. ref:DEC-learn-course-hierarchy */
|
|
522
|
+
function renderOutline()
|
|
523
|
+
{
|
|
524
|
+
const groups = course.navigation.map(group =>
|
|
525
|
+
{
|
|
526
|
+
const section = node('section', '', {
|
|
527
|
+
'aria-labelledby': 'outline-' + group.id,
|
|
528
|
+
});
|
|
529
|
+
section.append(node('h3', group.title, {id: 'outline-' + group.id}));
|
|
530
|
+
const list = node('ol', '');
|
|
531
|
+
for (const id of group.lessons)
|
|
532
|
+
{
|
|
533
|
+
const row = course.lessons.find(item => item.id === id),
|
|
534
|
+
active = row === lesson,
|
|
535
|
+
index = course.lessons.indexOf(row),
|
|
536
|
+
item = node('li', '');
|
|
537
|
+
const button = node('button', '', {
|
|
538
|
+
'data-lesson': id,
|
|
539
|
+
'aria-current': active ? 'true' : 'false',
|
|
540
|
+
class: active ? 'active' : '',
|
|
541
|
+
});
|
|
542
|
+
button.append(
|
|
543
|
+
node('span', String(index + 1).padStart(2, '0'), {
|
|
544
|
+
class: 'lesson-index',
|
|
545
|
+
}),
|
|
546
|
+
node('span', row.title),
|
|
547
|
+
);
|
|
548
|
+
button.onclick = () =>
|
|
549
|
+
navigate(() =>
|
|
550
|
+
{
|
|
551
|
+
lesson = row;
|
|
552
|
+
sceneIndex = 0;
|
|
553
|
+
});
|
|
554
|
+
item.append(button);
|
|
555
|
+
if (active)
|
|
556
|
+
{
|
|
557
|
+
const steps = node('ol', '', {
|
|
558
|
+
id: 'stage',
|
|
559
|
+
'aria-label': 'Steps in ' + row.title,
|
|
560
|
+
});
|
|
561
|
+
for (const [i, step] of row.stages.entries())
|
|
562
|
+
{
|
|
563
|
+
const li = node('li', ''),
|
|
564
|
+
control = node('button', '', {
|
|
565
|
+
'data-stage': String(i),
|
|
566
|
+
'aria-current': i === sceneIndex ? 'step' : 'false',
|
|
567
|
+
});
|
|
568
|
+
control.append(
|
|
569
|
+
node('span', String(i + 1), {class: 'step-number'}),
|
|
570
|
+
node('span', step.title),
|
|
571
|
+
);
|
|
572
|
+
control.onclick = () =>
|
|
573
|
+
navigate(() =>
|
|
574
|
+
{
|
|
575
|
+
sceneIndex = i;
|
|
576
|
+
});
|
|
577
|
+
li.append(control);
|
|
578
|
+
steps.append(li);
|
|
579
|
+
}
|
|
580
|
+
item.append(steps);
|
|
581
|
+
}
|
|
582
|
+
list.append(item);
|
|
583
|
+
}
|
|
584
|
+
section.append(list);
|
|
585
|
+
return section;
|
|
586
|
+
});
|
|
587
|
+
$('lessons').replaceChildren(...groups);
|
|
588
|
+
}
|
|
589
|
+
/** Switch compact views without replacing either pane or losing the current editor model. ref:DEC-learn-workspace-focus */
|
|
590
|
+
function setWorkspaceView(view)
|
|
591
|
+
{
|
|
592
|
+
document.documentElement.dataset.workspaceView = view;
|
|
593
|
+
for (const button of $('workspace-views').querySelectorAll('[role=tab]'))
|
|
594
|
+
{
|
|
595
|
+
const active = button.dataset.view === view;
|
|
596
|
+
button.setAttribute('aria-selected', String(active));
|
|
597
|
+
button.tabIndex = active ? 0 : -1;
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
for (const button of $('workspace-views').querySelectorAll('[data-view]'))
|
|
601
|
+
{
|
|
602
|
+
button.onclick = () => setWorkspaceView(button.dataset.view);
|
|
603
|
+
}
|
|
604
|
+
$('workspace-views').addEventListener('keydown', event =>
|
|
605
|
+
{
|
|
606
|
+
if (!['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key))
|
|
607
|
+
{
|
|
608
|
+
return;
|
|
609
|
+
}
|
|
610
|
+
const tabs = [...$('workspace-views').querySelectorAll('[role=tab]')],
|
|
611
|
+
index = tabs.indexOf(document.activeElement);
|
|
612
|
+
if (index < 0)
|
|
613
|
+
{
|
|
614
|
+
return;
|
|
615
|
+
}
|
|
616
|
+
event.preventDefault();
|
|
617
|
+
const next =
|
|
618
|
+
event.key === 'Home'
|
|
619
|
+
? 0
|
|
620
|
+
: event.key === 'End'
|
|
621
|
+
? tabs.length - 1
|
|
622
|
+
: (index + (event.key === 'ArrowRight' ? 1 : -1) + tabs.length) %
|
|
623
|
+
tabs.length;
|
|
624
|
+
tabs[next].click();
|
|
625
|
+
tabs[next].focus();
|
|
626
|
+
});
|
|
627
|
+
$('course-status').textContent = course.checkpoint;
|
|
628
|
+
$('roadmap').append(...course.roadmap.map(text => node('li', text)));
|
|
629
|
+
$('planned-tracks').append(
|
|
630
|
+
...course.tracks
|
|
631
|
+
.filter(row => row.status === 'after review')
|
|
632
|
+
.map(row =>
|
|
633
|
+
{
|
|
634
|
+
const item = node('li', '');
|
|
635
|
+
item.append(node('b', row.title), node('span', ' — ' + row.scope));
|
|
636
|
+
return item;
|
|
637
|
+
}),
|
|
638
|
+
);
|
|
639
|
+
$('future-attribution').append(
|
|
640
|
+
node('h3', 'Further reading'),
|
|
641
|
+
...course.futureAttribution.map(row =>
|
|
642
|
+
{
|
|
643
|
+
const p = node('p', '');
|
|
644
|
+
p.append(
|
|
645
|
+
node('a', row.title, {href: row.url, target: '_blank', rel: 'noopener'}),
|
|
646
|
+
node('span', ' — ' + row.use),
|
|
647
|
+
);
|
|
648
|
+
return p;
|
|
649
|
+
}),
|
|
650
|
+
);
|
|
651
|
+
for (const group of [$('files'), $('languages')])
|
|
652
|
+
{
|
|
653
|
+
group.addEventListener('keydown', async event =>
|
|
654
|
+
{
|
|
655
|
+
if (!['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key))
|
|
656
|
+
{
|
|
657
|
+
return;
|
|
658
|
+
}
|
|
659
|
+
const tabs = [...group.querySelectorAll('[role=tab]:not(:disabled)')];
|
|
660
|
+
const index = tabs.indexOf(document.activeElement);
|
|
661
|
+
if (index < 0)
|
|
662
|
+
{
|
|
663
|
+
return;
|
|
664
|
+
}
|
|
665
|
+
event.preventDefault();
|
|
666
|
+
const next =
|
|
667
|
+
event.key === 'Home'
|
|
668
|
+
? 0
|
|
669
|
+
: event.key === 'End'
|
|
670
|
+
? tabs.length - 1
|
|
671
|
+
: (index + (event.key === 'ArrowRight' ? 1 : -1) + tabs.length) %
|
|
672
|
+
tabs.length;
|
|
673
|
+
await tabs[next].onclick();
|
|
674
|
+
group.querySelector('[aria-selected="true"]')?.focus();
|
|
675
|
+
});
|
|
676
|
+
}
|
|
677
|
+
$('story-file').onclick = () =>
|
|
678
|
+
{
|
|
679
|
+
selectFile(focusFile());
|
|
680
|
+
setWorkspaceView('code');
|
|
681
|
+
editor.focus();
|
|
682
|
+
};
|
|
683
|
+
$('previous-scene').onclick = () =>
|
|
684
|
+
navigate(() =>
|
|
685
|
+
{
|
|
686
|
+
sceneIndex = Math.max(0, sceneIndex - 1);
|
|
687
|
+
});
|
|
688
|
+
$('next-scene').onclick = () =>
|
|
689
|
+
navigate(() =>
|
|
690
|
+
{
|
|
691
|
+
sceneIndex = Math.min(lesson.stages.length - 1, sceneIndex + 1);
|
|
692
|
+
});
|
|
693
|
+
$('load-stage').onclick = () =>
|
|
694
|
+
{
|
|
695
|
+
replaceFiles(scene().projects[language]);
|
|
696
|
+
$('seed').value = String(scene().run.seed ?? 424242);
|
|
697
|
+
invalidate();
|
|
698
|
+
selectFile(focusFile());
|
|
699
|
+
showStage();
|
|
700
|
+
save();
|
|
701
|
+
message('This step’s source restored. Predict its result, then run.');
|
|
702
|
+
};
|
|
703
|
+
$('undo-replacement').onclick = () =>
|
|
704
|
+
{
|
|
705
|
+
if (!replacementFiles)
|
|
706
|
+
{
|
|
707
|
+
return;
|
|
708
|
+
}
|
|
709
|
+
draft.files = replacementFiles;
|
|
710
|
+
forgetReplacement();
|
|
711
|
+
invalidate();
|
|
712
|
+
selectFile(currentFile);
|
|
713
|
+
showStage();
|
|
714
|
+
save();
|
|
715
|
+
message(
|
|
716
|
+
'Your previous files are restored, including any kept regression cases. Rerun to observe their current results.',
|
|
717
|
+
);
|
|
718
|
+
};
|
|
719
|
+
$('hint').onclick = () =>
|
|
720
|
+
{
|
|
721
|
+
$('hint-text').textContent =
|
|
722
|
+
lesson.hints[Math.min(hint++, lesson.hints.length - 1)];
|
|
723
|
+
};
|
|
724
|
+
$('solution').onclick = async () =>
|
|
725
|
+
{
|
|
726
|
+
if (sceneIndex !== lesson.stages.length - 1)
|
|
727
|
+
{
|
|
728
|
+
await navigate(() =>
|
|
729
|
+
{
|
|
730
|
+
sceneIndex = lesson.stages.length - 1;
|
|
731
|
+
});
|
|
732
|
+
}
|
|
733
|
+
replaceFiles(lesson.solutions[language]);
|
|
734
|
+
invalidate();
|
|
735
|
+
selectFile(
|
|
736
|
+
Object.keys(draft.files).find(name => name.startsWith('Solution.')),
|
|
737
|
+
);
|
|
738
|
+
showStage();
|
|
739
|
+
await save();
|
|
740
|
+
setWorkspaceView('code');
|
|
741
|
+
message(
|
|
742
|
+
'Complete solution loaded in the final step. Run the unchanged checks and compare the implementation with the failing version.',
|
|
743
|
+
);
|
|
744
|
+
};
|
|
745
|
+
$('seed').onchange = () =>
|
|
746
|
+
{
|
|
747
|
+
invalidate();
|
|
748
|
+
renderStoryCode();
|
|
749
|
+
message('Seed changed. Run again to get current evidence.');
|
|
750
|
+
};
|
|
751
|
+
/** Keep formatting and compilation cancellable, with separate worker lifetimes. ref:DEC-learn-format-before-run */
|
|
752
|
+
function requestWorker(kind, request, signal)
|
|
753
|
+
{
|
|
754
|
+
if (signal.aborted)
|
|
755
|
+
return Promise.reject(new DOMException(kind + ' cancelled', 'AbortError'));
|
|
756
|
+
const formatting = kind === 'Formatting';
|
|
757
|
+
let activeWorker;
|
|
758
|
+
if (formatting)
|
|
759
|
+
{
|
|
760
|
+
activeWorker = formatWorker ??= new Worker(
|
|
761
|
+
new URL('./format-worker.mjs', import.meta.url),
|
|
762
|
+
{type: 'module'},
|
|
763
|
+
);
|
|
764
|
+
}
|
|
765
|
+
else
|
|
766
|
+
{
|
|
767
|
+
activeWorker = worker ??= new Worker(
|
|
768
|
+
new URL('./compile-worker.mjs', import.meta.url),
|
|
769
|
+
{type: 'module'},
|
|
770
|
+
);
|
|
771
|
+
}
|
|
772
|
+
const terminate = () =>
|
|
773
|
+
{
|
|
774
|
+
activeWorker.terminate();
|
|
775
|
+
if (formatting)
|
|
776
|
+
{
|
|
777
|
+
formatWorker = null;
|
|
778
|
+
}
|
|
779
|
+
else
|
|
780
|
+
{
|
|
781
|
+
worker = null;
|
|
782
|
+
}
|
|
783
|
+
};
|
|
784
|
+
return new Promise((resolve, reject) =>
|
|
785
|
+
{
|
|
786
|
+
const id = ++runId;
|
|
787
|
+
const clean = () =>
|
|
788
|
+
{
|
|
789
|
+
signal.removeEventListener('abort', abort);
|
|
790
|
+
activeWorker.removeEventListener('message', listen);
|
|
791
|
+
activeWorker.removeEventListener('error', error);
|
|
792
|
+
clearTimeout(timer);
|
|
793
|
+
};
|
|
794
|
+
const abort = () =>
|
|
795
|
+
{
|
|
796
|
+
clean();
|
|
797
|
+
terminate();
|
|
798
|
+
reject(new DOMException(kind + ' cancelled', 'AbortError'));
|
|
799
|
+
};
|
|
800
|
+
const listen = ({data}) =>
|
|
801
|
+
{
|
|
802
|
+
if (data.id !== id)
|
|
803
|
+
{
|
|
804
|
+
return;
|
|
805
|
+
}
|
|
806
|
+
if (data.progress)
|
|
807
|
+
{
|
|
808
|
+
message(data.progress);
|
|
809
|
+
return;
|
|
810
|
+
}
|
|
811
|
+
clean();
|
|
812
|
+
data.error ? reject(new Error(data.error)) : resolve(data.result);
|
|
813
|
+
};
|
|
814
|
+
const error = event =>
|
|
815
|
+
{
|
|
816
|
+
clean();
|
|
817
|
+
terminate();
|
|
818
|
+
reject(new Error(event.message));
|
|
819
|
+
};
|
|
820
|
+
const timer = setTimeout(() =>
|
|
821
|
+
{
|
|
822
|
+
clean();
|
|
823
|
+
terminate();
|
|
824
|
+
reject(new Error(kind + ' timed out; your draft is saved.'));
|
|
825
|
+
}, 120000);
|
|
826
|
+
signal.addEventListener('abort', abort, {once: true});
|
|
827
|
+
activeWorker.addEventListener('message', listen);
|
|
828
|
+
activeWorker.addEventListener('error', error);
|
|
829
|
+
activeWorker.postMessage({...request, id});
|
|
830
|
+
});
|
|
831
|
+
}
|
|
832
|
+
function renderResult(compiled, result, elapsed)
|
|
833
|
+
{
|
|
834
|
+
$('code-panel').querySelector('.results').scrollTop = 0;
|
|
835
|
+
$('diagnostics').textContent = JSON.stringify(
|
|
836
|
+
{
|
|
837
|
+
diagnostics: compiled.diagnostics,
|
|
838
|
+
mandatoryDefinitionValidation: compiled.definitionValidation,
|
|
839
|
+
compilerEvidence: compiled.evidence,
|
|
840
|
+
execution: compiled.execution,
|
|
841
|
+
harnessReports: result?.harnessReports,
|
|
842
|
+
executedChecks: result?.tests,
|
|
843
|
+
timingMilliseconds: Math.round(elapsed),
|
|
844
|
+
},
|
|
845
|
+
null,
|
|
846
|
+
2,
|
|
847
|
+
);
|
|
848
|
+
generated = compiled.generated ?? [];
|
|
849
|
+
$('generated-files').replaceChildren(
|
|
850
|
+
...generated.map(row =>
|
|
851
|
+
{
|
|
852
|
+
const button = node('button', row.path, {type: 'button'});
|
|
853
|
+
button.onclick = () => awaitGenerated(row);
|
|
854
|
+
return button;
|
|
855
|
+
}),
|
|
856
|
+
);
|
|
857
|
+
awaitGenerated(generated[0]);
|
|
858
|
+
$('outcomes').replaceChildren();
|
|
859
|
+
if (!result)
|
|
860
|
+
{
|
|
861
|
+
$('result-status').textContent = 'Checks could not run';
|
|
862
|
+
$('diagnostic-panel').open = true;
|
|
863
|
+
message(
|
|
864
|
+
'Compilation did not produce executable checks. Read the diagnostics and repair the source.',
|
|
865
|
+
true,
|
|
866
|
+
);
|
|
867
|
+
return;
|
|
868
|
+
}
|
|
869
|
+
$('result-status').textContent = result.ok
|
|
870
|
+
? 'Checks passed'
|
|
871
|
+
: 'Check the failure';
|
|
872
|
+
message(runSummary(result, elapsed));
|
|
873
|
+
for (const row of result.tests)
|
|
874
|
+
{
|
|
875
|
+
const check = describeCheck(row.name, compiled.checks);
|
|
876
|
+
const line = node(
|
|
877
|
+
'p',
|
|
878
|
+
`${row.ok ? '✓' : '×'} ${check.label} · ${row.status}`,
|
|
879
|
+
{
|
|
880
|
+
class: row.ok ? 'passed' : 'failed',
|
|
881
|
+
title: row.name,
|
|
882
|
+
},
|
|
883
|
+
);
|
|
884
|
+
line.append(node('span', ' · ' + check.kind, {class: 'muted'}));
|
|
885
|
+
$('outcomes').append(line);
|
|
886
|
+
if (row.calls?.length && (!row.ok || !result.properties.length))
|
|
887
|
+
{
|
|
888
|
+
$('outcomes').append(
|
|
889
|
+
node(
|
|
890
|
+
'pre',
|
|
891
|
+
row.calls
|
|
892
|
+
.map(call => observedCall(compiled.binding, call, language))
|
|
893
|
+
.join('\n'),
|
|
894
|
+
),
|
|
895
|
+
);
|
|
896
|
+
}
|
|
897
|
+
if (row.error)
|
|
898
|
+
{
|
|
899
|
+
const error = node('details', '');
|
|
900
|
+
error.append(node('summary', 'Failure details'), node('pre', row.error));
|
|
901
|
+
$('outcomes').append(error);
|
|
902
|
+
if (row.status !== 'failed')
|
|
903
|
+
{
|
|
904
|
+
$('outcomes').append(node('p', row.error));
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
for (const row of result.properties)
|
|
909
|
+
{
|
|
910
|
+
const check = describeCheck(row.test, compiled.checks);
|
|
911
|
+
$('outcomes').append(
|
|
912
|
+
node(
|
|
913
|
+
'p',
|
|
914
|
+
`${check.label}: ${row.numRuns} generated trials; ${row.numShrinks} smaller failing cases kept · ${row.status}`,
|
|
915
|
+
{
|
|
916
|
+
class: row.status === 'passed' ? 'passed' : 'failed',
|
|
917
|
+
},
|
|
918
|
+
),
|
|
919
|
+
);
|
|
920
|
+
if (row.counterexample)
|
|
921
|
+
{
|
|
922
|
+
$('outcomes').append(
|
|
923
|
+
node(
|
|
924
|
+
'h3',
|
|
925
|
+
row.counterexampleDomain === 'law-inputs'
|
|
926
|
+
? 'Failing input after shrinking'
|
|
927
|
+
: 'Failing generator representation',
|
|
928
|
+
),
|
|
929
|
+
);
|
|
930
|
+
$('outcomes').append(
|
|
931
|
+
node('pre', JSON.stringify(row.inputs ?? row.counterexample, null, 2)),
|
|
932
|
+
);
|
|
933
|
+
const trace = node('details', '');
|
|
934
|
+
trace.append(
|
|
935
|
+
node('summary', 'How the failure was reduced'),
|
|
936
|
+
node(
|
|
937
|
+
'pre',
|
|
938
|
+
JSON.stringify(
|
|
939
|
+
{
|
|
940
|
+
seed: row.seed,
|
|
941
|
+
replayPath: row.path,
|
|
942
|
+
failedShrinkCandidates: row.failures,
|
|
943
|
+
observations: row.observations,
|
|
944
|
+
},
|
|
945
|
+
null,
|
|
946
|
+
2,
|
|
947
|
+
),
|
|
948
|
+
),
|
|
949
|
+
);
|
|
950
|
+
$('outcomes').append(trace);
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
if (result.samples?.length)
|
|
954
|
+
{
|
|
955
|
+
$('outcomes').append(
|
|
956
|
+
node(
|
|
957
|
+
'p',
|
|
958
|
+
'First generated inputs tried: ' + JSON.stringify(result.samples),
|
|
959
|
+
),
|
|
960
|
+
);
|
|
961
|
+
}
|
|
962
|
+
if (result.sampled && result.coverage)
|
|
963
|
+
{
|
|
964
|
+
const coverage = node('details', '');
|
|
965
|
+
coverage.append(
|
|
966
|
+
node('summary', 'Which inputs were tried?'),
|
|
967
|
+
node(
|
|
968
|
+
'p',
|
|
969
|
+
'Counts summarize values observed during property evaluation, including shrink attempts.',
|
|
970
|
+
),
|
|
971
|
+
node('pre', JSON.stringify(result.coverage, null, 2)),
|
|
972
|
+
);
|
|
973
|
+
$('outcomes').append(coverage);
|
|
974
|
+
}
|
|
975
|
+
$('teaching-feedback').hidden = false;
|
|
976
|
+
if (suppliedScene())
|
|
977
|
+
{
|
|
978
|
+
const problems = expectationProblems(result, scene().run);
|
|
979
|
+
$('teaching-feedback').textContent = problems.length
|
|
980
|
+
? 'This run differs from the supplied scene’s checked observation: ' +
|
|
981
|
+
problems.join(' ')
|
|
982
|
+
: scene().run.expect === 'failed'
|
|
983
|
+
? 'This step is meant to reveal a failing check. The failure above is the observation to explain, not a request to make every test green yet.'
|
|
984
|
+
: 'This run matches the supplied step’s expected passed outcome. A pass describes the checks and inputs tried.';
|
|
985
|
+
}
|
|
986
|
+
else
|
|
987
|
+
{
|
|
988
|
+
$('teaching-feedback').textContent =
|
|
989
|
+
'These results belong to your saved or edited files. The supplied step’s prediction may differ; explain what your checks actually observed.';
|
|
990
|
+
}
|
|
991
|
+
lastRun = {compiled, result, mode: result.mode};
|
|
992
|
+
const failure = result.sampled?.counterexample ? result.sampled : null;
|
|
993
|
+
if (failure)
|
|
994
|
+
{
|
|
995
|
+
$('run-options').open = true;
|
|
996
|
+
$('replay-hint').textContent = ' · failure ready to replay';
|
|
997
|
+
lastFailure = {...failure, files: JSON.stringify(draft.files)};
|
|
998
|
+
$('replay').disabled = false;
|
|
999
|
+
$('regression').disabled =
|
|
1000
|
+
!scene().regression || failure.counterexampleDomain !== 'law-inputs';
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
async function run(mode, path = '', replayTest = null)
|
|
1004
|
+
{
|
|
1005
|
+
if (controller)
|
|
1006
|
+
{
|
|
1007
|
+
return;
|
|
1008
|
+
}
|
|
1009
|
+
const active = new AbortController();
|
|
1010
|
+
controller = active;
|
|
1011
|
+
busy(true);
|
|
1012
|
+
$('run-scope').textContent = runScopes[mode];
|
|
1013
|
+
clearExecution();
|
|
1014
|
+
$('outcomes').replaceChildren();
|
|
1015
|
+
$('result-status').textContent = 'Running';
|
|
1016
|
+
message(
|
|
1017
|
+
'Compiling on your device. The first run loads the packaged compilers…',
|
|
1018
|
+
);
|
|
1019
|
+
const began = performance.now();
|
|
1020
|
+
try
|
|
1021
|
+
{
|
|
1022
|
+
$('result-status').textContent = 'Formatting';
|
|
1023
|
+
message('Formatting your files on this device before running…');
|
|
1024
|
+
const formatted = await requestWorker(
|
|
1025
|
+
'Formatting',
|
|
1026
|
+
{files: structuredClone(draft.files)},
|
|
1027
|
+
active.signal,
|
|
1028
|
+
);
|
|
1029
|
+
if (active.signal.aborted)
|
|
1030
|
+
{
|
|
1031
|
+
return;
|
|
1032
|
+
}
|
|
1033
|
+
if (!formatted.files)
|
|
1034
|
+
{
|
|
1035
|
+
renderResult(
|
|
1036
|
+
{diagnostics: formatted.diagnostics},
|
|
1037
|
+
null,
|
|
1038
|
+
performance.now() - began,
|
|
1039
|
+
);
|
|
1040
|
+
$('result-status').textContent = 'Formatting failed';
|
|
1041
|
+
message(
|
|
1042
|
+
'Fix the syntax errors shown in diagnostics. Your source has not been run.',
|
|
1043
|
+
true,
|
|
1044
|
+
);
|
|
1045
|
+
return;
|
|
1046
|
+
}
|
|
1047
|
+
const changed = Object.entries(formatted.files).some(
|
|
1048
|
+
([name, source]) => source !== draft.files[name],
|
|
1049
|
+
);
|
|
1050
|
+
draft.files = formatted.files;
|
|
1051
|
+
if (changed)
|
|
1052
|
+
{
|
|
1053
|
+
draft.completed = false;
|
|
1054
|
+
$('completion').textContent = '';
|
|
1055
|
+
suppress = true;
|
|
1056
|
+
editor.pushUndoStop();
|
|
1057
|
+
editor.executeEdits('format-before-run', [
|
|
1058
|
+
{range: model.getFullModelRange(), text: draft.files[currentFile]},
|
|
1059
|
+
]);
|
|
1060
|
+
editor.pushUndoStop();
|
|
1061
|
+
suppress = false;
|
|
1062
|
+
}
|
|
1063
|
+
await save({required: true});
|
|
1064
|
+
if (active.signal.aborted) return;
|
|
1065
|
+
await renderStoryCode();
|
|
1066
|
+
if (active.signal.aborted) return;
|
|
1067
|
+
$('result-status').textContent = 'Compiling';
|
|
1068
|
+
message(
|
|
1069
|
+
'Code formatted and saved. Compiling this snapshot on your device…',
|
|
1070
|
+
);
|
|
1071
|
+
const compiled = await requestWorker(
|
|
1072
|
+
'Compilation',
|
|
1073
|
+
{
|
|
1074
|
+
lesson: {id: lesson.id},
|
|
1075
|
+
language,
|
|
1076
|
+
files: structuredClone(draft.files),
|
|
1077
|
+
mode,
|
|
1078
|
+
seed: Number($('seed').value),
|
|
1079
|
+
path,
|
|
1080
|
+
replayTest,
|
|
1081
|
+
},
|
|
1082
|
+
active.signal,
|
|
1083
|
+
);
|
|
1084
|
+
if (active.signal.aborted)
|
|
1085
|
+
{
|
|
1086
|
+
return;
|
|
1087
|
+
}
|
|
1088
|
+
const result = compiled.code
|
|
1089
|
+
? await execute(compiled.code, {signal: active.signal})
|
|
1090
|
+
: null;
|
|
1091
|
+
if (active.signal.aborted)
|
|
1092
|
+
{
|
|
1093
|
+
return;
|
|
1094
|
+
}
|
|
1095
|
+
renderResult(compiled, result, performance.now() - began);
|
|
1096
|
+
}
|
|
1097
|
+
catch (error)
|
|
1098
|
+
{
|
|
1099
|
+
$('result-status').textContent =
|
|
1100
|
+
error.name === 'AbortError' ? 'Cancelled' : 'Execution incomplete';
|
|
1101
|
+
message(error.message, error.name !== 'AbortError');
|
|
1102
|
+
$('replay').disabled = true;
|
|
1103
|
+
$('regression').disabled = true;
|
|
1104
|
+
}
|
|
1105
|
+
finally
|
|
1106
|
+
{
|
|
1107
|
+
controller = null;
|
|
1108
|
+
busy(false);
|
|
1109
|
+
showStage();
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
$('run').onclick = () => run(scene().run.mode);
|
|
1113
|
+
$('examples').onclick = () => run('examples');
|
|
1114
|
+
$('sample').onclick = () => run('sample');
|
|
1115
|
+
$('cancel').onclick = () => controller?.abort();
|
|
1116
|
+
$('replay').onclick = () =>
|
|
1117
|
+
{
|
|
1118
|
+
if (lastFailure?.files === JSON.stringify(draft.files))
|
|
1119
|
+
{
|
|
1120
|
+
$('seed').value = String(lastFailure.seed);
|
|
1121
|
+
run('sample', lastFailure.path, lastFailure.test);
|
|
1122
|
+
}
|
|
1123
|
+
};
|
|
1124
|
+
$('regression').onclick = () =>
|
|
1125
|
+
{
|
|
1126
|
+
if (!lastFailure || !scene().regression)
|
|
1127
|
+
{
|
|
1128
|
+
return;
|
|
1129
|
+
}
|
|
1130
|
+
const input = lastFailure.counterexample?.[0],
|
|
1131
|
+
expected = scene().regression.expected,
|
|
1132
|
+
fn = lastRun.compiled.binding.name;
|
|
1133
|
+
const literal = value =>
|
|
1134
|
+
Array.isArray(value)
|
|
1135
|
+
? '[' + value.map(literal).join(', ') + ']'
|
|
1136
|
+
: String(value).toLowerCase();
|
|
1137
|
+
const source = draft.files['Tests.lawspec'];
|
|
1138
|
+
if (
|
|
1139
|
+
source.includes('law savedCounterexample ') ||
|
|
1140
|
+
source.includes('law "|keep this counterexample| ')
|
|
1141
|
+
)
|
|
1142
|
+
{
|
|
1143
|
+
message('A saved counterexample is already present in this step.');
|
|
1144
|
+
return;
|
|
1145
|
+
}
|
|
1146
|
+
const regression = `law "|keep this counterexample| is\n definition:\n ${fn} ${literal(input)} = ${literal(expected)}\n end definition\nend law\n`;
|
|
1147
|
+
if (!/end unit\s*$/.test(source))
|
|
1148
|
+
{
|
|
1149
|
+
message('Restore the unit terminator before saving the counterexample.');
|
|
1150
|
+
return;
|
|
1151
|
+
}
|
|
1152
|
+
draft.files['Tests.lawspec'] = source.replace(
|
|
1153
|
+
/end unit\s*$/,
|
|
1154
|
+
regression + 'end unit\n',
|
|
1155
|
+
);
|
|
1156
|
+
forgetReplacement();
|
|
1157
|
+
invalidate();
|
|
1158
|
+
selectFile('Tests.lawspec');
|
|
1159
|
+
showStage();
|
|
1160
|
+
save();
|
|
1161
|
+
message(
|
|
1162
|
+
'The observed counterexample is saved as a concrete LawSpec claim. In Test controls, choose Run examples + boundaries to observe it before repair.',
|
|
1163
|
+
);
|
|
1164
|
+
};
|
|
1165
|
+
$('complete').onclick = () =>
|
|
1166
|
+
{
|
|
1167
|
+
if (
|
|
1168
|
+
!lastRun?.result.ok ||
|
|
1169
|
+
lastRun.mode !== 'all' ||
|
|
1170
|
+
sceneIndex !== lesson.stages.length - 1
|
|
1171
|
+
)
|
|
1172
|
+
{
|
|
1173
|
+
message(
|
|
1174
|
+
'Finish the independent step and run all checks successfully before marking this learning milestone.',
|
|
1175
|
+
);
|
|
1176
|
+
return;
|
|
1177
|
+
}
|
|
1178
|
+
draft.completed = true;
|
|
1179
|
+
save();
|
|
1180
|
+
$('completion').textContent = ' Learning milestone saved · no proof claim.';
|
|
1181
|
+
};
|
|
1182
|
+
async function awaitGenerated(file)
|
|
1183
|
+
{
|
|
1184
|
+
const revision = ++colorization;
|
|
1185
|
+
generatedSelection = file;
|
|
1186
|
+
if (!file)
|
|
1187
|
+
{
|
|
1188
|
+
$('generated').textContent = '';
|
|
1189
|
+
return;
|
|
1190
|
+
}
|
|
1191
|
+
const rendered = await monaco.editor.colorize(
|
|
1192
|
+
file.content,
|
|
1193
|
+
languageFor(file.path),
|
|
1194
|
+
{},
|
|
1195
|
+
);
|
|
1196
|
+
if (
|
|
1197
|
+
generated.includes(file) &&
|
|
1198
|
+
generatedSelection === file &&
|
|
1199
|
+
revision === colorization
|
|
1200
|
+
)
|
|
1201
|
+
{
|
|
1202
|
+
$('generated').innerHTML = rendered;
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
$('export').onclick = async () =>
|
|
1206
|
+
{
|
|
1207
|
+
try
|
|
1208
|
+
{
|
|
1209
|
+
await save({required: true});
|
|
1210
|
+
const url = URL.createObjectURL(
|
|
1211
|
+
new Blob(
|
|
1212
|
+
[
|
|
1213
|
+
JSON.stringify(
|
|
1214
|
+
{...(await store.export()), codeLicenses: course.codeLicenses},
|
|
1215
|
+
null,
|
|
1216
|
+
2,
|
|
1217
|
+
),
|
|
1218
|
+
],
|
|
1219
|
+
{type: 'application/json'},
|
|
1220
|
+
),
|
|
1221
|
+
);
|
|
1222
|
+
const anchor = node('a', '', {
|
|
1223
|
+
href: url,
|
|
1224
|
+
download: `lawspec-learn-progress-${courseVersion}.json`,
|
|
1225
|
+
});
|
|
1226
|
+
anchor.click();
|
|
1227
|
+
setTimeout(() => URL.revokeObjectURL(url), 1000);
|
|
1228
|
+
$('progress-status').textContent =
|
|
1229
|
+
'Progress backup downloaded. Keep the JSON file to restore your work on another device.';
|
|
1230
|
+
}
|
|
1231
|
+
catch (error)
|
|
1232
|
+
{
|
|
1233
|
+
$('progress-status').textContent = 'Backup failed: ' + error.message;
|
|
1234
|
+
}
|
|
1235
|
+
};
|
|
1236
|
+
$('restore').onclick = () => $('import').click();
|
|
1237
|
+
$('import').onchange = async () =>
|
|
1238
|
+
{
|
|
1239
|
+
try
|
|
1240
|
+
{
|
|
1241
|
+
const file = $('import').files[0];
|
|
1242
|
+
if (!file)
|
|
1243
|
+
{
|
|
1244
|
+
return;
|
|
1245
|
+
}
|
|
1246
|
+
if (file.size > 5000000)
|
|
1247
|
+
{
|
|
1248
|
+
throw new Error('Progress backup is too large');
|
|
1249
|
+
}
|
|
1250
|
+
controller?.abort();
|
|
1251
|
+
await saveQueue;
|
|
1252
|
+
await store.import(JSON.parse(await file.text()), course);
|
|
1253
|
+
await load();
|
|
1254
|
+
$('progress-status').textContent =
|
|
1255
|
+
'Drafts and milestones restored. Rerun checks for current results.';
|
|
1256
|
+
message('Progress restored. Rerun to obtain current execution evidence.');
|
|
1257
|
+
}
|
|
1258
|
+
catch (error)
|
|
1259
|
+
{
|
|
1260
|
+
$('progress-status').textContent = 'Restore failed: ' + error.message;
|
|
1261
|
+
message(error.message, true);
|
|
1262
|
+
}
|
|
1263
|
+
finally
|
|
1264
|
+
{
|
|
1265
|
+
$('import').value = '';
|
|
1266
|
+
}
|
|
1267
|
+
};
|
|
1268
|
+
window.addEventListener('pagehide', () =>
|
|
1269
|
+
{
|
|
1270
|
+
controller?.abort();
|
|
1271
|
+
worker?.terminate();
|
|
1272
|
+
formatWorker?.terminate();
|
|
1273
|
+
});
|
|
1274
|
+
await load();
|
|
1275
|
+
document.documentElement.dataset.ready = 'true';
|
|
1276
|
+
performance.measure('learn-interface-ready', {
|
|
1277
|
+
start: started,
|
|
1278
|
+
end: performance.now(),
|
|
1279
|
+
});
|