firefly-compiler 0.5.49 → 0.5.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/bin/Release.ff +3 -3
  2. package/bin/firefly.mjs +1 -1
  3. package/compiler/Builder.ff +11 -5
  4. package/compiler/Compiler.ff +14 -3
  5. package/compiler/JsEmitter.ff +6 -11
  6. package/compiler/Main.ff +10 -15
  7. package/compiler/ModuleCache.ff +2 -1
  8. package/core/Buffer.ff +26 -4
  9. package/core/BuildSystem.ff +49 -46
  10. package/core/JsValue.ff +5 -0
  11. package/experimental/date/Date.ff +604 -0
  12. package/experimental/date/Main.ff +51 -0
  13. package/experimental/random/AsciiBuffer.ff +15 -0
  14. package/experimental/rhymeapp/Main.ff +2 -3
  15. package/experimental/site/Main.ff +2 -2
  16. package/experimental/site2/Main.ff +2 -2
  17. package/firefly.sh +1 -1
  18. package/fireflysite/CommunityOverview.ff +3 -3
  19. package/fireflysite/CountingButtonDemo.ff +3 -3
  20. package/fireflysite/ExamplesOverview.ff +3 -12
  21. package/fireflysite/FrontPage.ff +3 -3
  22. package/fireflysite/GettingStarted.ff +3 -3
  23. package/fireflysite/Guide.ff +7 -187
  24. package/fireflysite/Html.ff +66 -0
  25. package/fireflysite/Main.ff +13 -77
  26. package/fireflysite/MatchingPasswordsDemo.ff +3 -3
  27. package/fireflysite/Menu.ff +59 -0
  28. package/fireflysite/PackagesOverview.ff +3 -3
  29. package/fireflysite/PostgresqlDemo.ff +3 -3
  30. package/fireflysite/RouteFront.ff +30 -0
  31. package/fireflysite/RouteNonMarkdown.ff +48 -0
  32. package/fireflysite/RouteReference.ff +40 -0
  33. package/fireflysite/Router.ff +33 -0
  34. package/fireflysite/Website.ff +133 -0
  35. package/fireflysite/assets/markdown/reference/{FunctionsAndMethods.md → functions-and-methods.md} +1 -1
  36. package/fireflysite/assets/markdown/reference/{StatementsAndExpressions.md → statements-and-expressions.md} +0 -1
  37. package/fireflysite/assets/markdown/reference/{StructuredConcurrency.md → structured-concurrency.md} +0 -1
  38. package/fireflysite/assets/markdown/reference.md +3 -0
  39. package/graph/.firefly/package.ff +1 -0
  40. package/graph/Graph.ff +79 -0
  41. package/lsp/CompletionHandler.ff +2 -2
  42. package/lux/CssTest.ff +2 -2
  43. package/lux/Main.ff +2 -2
  44. package/lux/Main2.ff +2 -2
  45. package/output/js/ff/compiler/Builder.mjs +44 -12
  46. package/output/js/ff/compiler/Compiler.mjs +28 -10
  47. package/output/js/ff/compiler/Dependencies.mjs +0 -2
  48. package/output/js/ff/compiler/DependencyLock.mjs +0 -2
  49. package/output/js/ff/compiler/Deriver.mjs +0 -2
  50. package/output/js/ff/compiler/Dictionaries.mjs +0 -2
  51. package/output/js/ff/compiler/Environment.mjs +0 -2
  52. package/output/js/ff/compiler/Inference.mjs +0 -2
  53. package/output/js/ff/compiler/JsEmitter.mjs +12 -30
  54. package/output/js/ff/compiler/JsImporter.mjs +0 -2
  55. package/output/js/ff/compiler/LspHook.mjs +0 -2
  56. package/output/js/ff/compiler/Main.mjs +24 -47
  57. package/output/js/ff/compiler/Main.run.mjs +25 -0
  58. package/output/js/ff/compiler/ModuleCache.mjs +4 -6
  59. package/output/js/ff/compiler/Parser.mjs +0 -2
  60. package/output/js/ff/compiler/Patterns.mjs +0 -2
  61. package/output/js/ff/compiler/Resolver.mjs +0 -2
  62. package/output/js/ff/compiler/Substitution.mjs +0 -2
  63. package/output/js/ff/compiler/Syntax.mjs +0 -2
  64. package/output/js/ff/compiler/Token.mjs +0 -2
  65. package/output/js/ff/compiler/Tokenizer.mjs +0 -2
  66. package/output/js/ff/compiler/Unification.mjs +0 -2
  67. package/output/js/ff/compiler/Wildcards.mjs +0 -2
  68. package/output/js/ff/compiler/Workspace.mjs +0 -2
  69. package/output/js/ff/core/Any.mjs +0 -2
  70. package/output/js/ff/core/Array.mjs +0 -2
  71. package/output/js/ff/core/AssetSystem.mjs +0 -2
  72. package/output/js/ff/core/Atomic.mjs +0 -2
  73. package/output/js/ff/core/Bool.mjs +0 -2
  74. package/output/js/ff/core/BrowserSystem.mjs +0 -2
  75. package/output/js/ff/core/Buffer.mjs +50 -10
  76. package/output/js/ff/core/BuildSystem.mjs +92 -72
  77. package/output/js/ff/core/Channel.mjs +0 -2
  78. package/output/js/ff/core/Char.mjs +0 -2
  79. package/output/js/ff/core/Core.mjs +0 -2
  80. package/output/js/ff/core/Crypto.mjs +0 -2
  81. package/output/js/ff/core/Date.mjs +0 -2
  82. package/output/js/ff/core/Duration.mjs +0 -2
  83. package/output/js/ff/core/Equal.mjs +0 -2
  84. package/output/js/ff/core/Error.mjs +0 -2
  85. package/output/js/ff/core/FileHandle.mjs +0 -2
  86. package/output/js/ff/core/Float.mjs +0 -2
  87. package/output/js/ff/core/HttpClient.mjs +0 -2
  88. package/output/js/ff/core/Int.mjs +0 -2
  89. package/output/js/ff/core/IntMap.mjs +0 -2
  90. package/output/js/ff/core/Js.mjs +0 -2
  91. package/output/js/ff/core/JsSystem.mjs +0 -2
  92. package/output/js/ff/core/JsValue.mjs +8 -2
  93. package/output/js/ff/core/Json.mjs +0 -2
  94. package/output/js/ff/core/List.mjs +0 -2
  95. package/output/js/ff/core/Lock.mjs +0 -2
  96. package/output/js/ff/core/Log.mjs +0 -2
  97. package/output/js/ff/core/Map.mjs +0 -2
  98. package/output/js/ff/core/NodeSystem.mjs +0 -2
  99. package/output/js/ff/core/Nothing.mjs +0 -2
  100. package/output/js/ff/core/Option.mjs +0 -2
  101. package/output/js/ff/core/Ordering.mjs +0 -2
  102. package/output/js/ff/core/Pair.mjs +0 -2
  103. package/output/js/ff/core/Path.mjs +0 -2
  104. package/output/js/ff/core/Queue.mjs +0 -2
  105. package/output/js/ff/core/Random.mjs +0 -2
  106. package/output/js/ff/core/RbMap.mjs +0 -2
  107. package/output/js/ff/core/Serializable.mjs +0 -2
  108. package/output/js/ff/core/Set.mjs +0 -2
  109. package/output/js/ff/core/Show.mjs +0 -2
  110. package/output/js/ff/core/SourceLocation.mjs +0 -2
  111. package/output/js/ff/core/Stream.mjs +0 -2
  112. package/output/js/ff/core/String.mjs +0 -2
  113. package/output/js/ff/core/StringMap.mjs +0 -2
  114. package/output/js/ff/core/Task.mjs +0 -2
  115. package/output/js/ff/core/Try.mjs +0 -2
  116. package/output/js/ff/core/Unit.mjs +0 -2
  117. package/package.json +1 -1
  118. package/vscode/client/src/extension.ts +1 -1
  119. package/vscode/package.json +1 -1
  120. package/vscode/snippets.json +2 -2
  121. package/webserver/WebRoute.ff +51 -14
  122. package/fireflysite/ReferenceAll.ff +0 -18
  123. /package/fireflysite/assets/markdown/reference/{BaseTypes.md → base-types.md} +0 -0
  124. /package/fireflysite/assets/markdown/reference/{EmittedJavascript.md → emitted-javascript.md} +0 -0
  125. /package/fireflysite/assets/markdown/reference/{Exceptions.md → exceptions.md} +0 -0
  126. /package/fireflysite/assets/markdown/reference/{JavascriptInterop.md → javascript-interop.md} +0 -0
  127. /package/fireflysite/assets/markdown/reference/{ModulesAndPackages.md → modules-and-packages.md} +0 -0
  128. /package/fireflysite/assets/markdown/reference/{PatternMatching.md → pattern-matching.md} +0 -0
  129. /package/fireflysite/assets/markdown/reference/{TraitsAndInstances.md → traits-and-instances.md} +0 -0
  130. /package/fireflysite/assets/markdown/reference/{UserDefinedTypes.md → user-defined-types.md} +0 -0
  131. /package/fireflysite/assets/markdown/scratch/{ControlFlow.md → control-flow.md} +0 -0
  132. /package/fireflysite/assets/markdown/{reference/OldStructuredConcurrency.md → scratch/old-structured-concurrency.md} +0 -0
@@ -99,16 +99,6 @@ import * as ff_core_Unit from "../../ff/core/Unit.mjs"
99
99
  // type BuildSystem
100
100
 
101
101
 
102
- // type BrowserCode
103
- export function BrowserCode(packageGroup_, packageName_, mainFile_, assetSystem_) {
104
- return {packageGroup_, packageName_, mainFile_, assetSystem_};
105
- }
106
-
107
- // type BrowserBundle
108
- export function BrowserBundle(assetSystem_) {
109
- return {assetSystem_};
110
- }
111
-
112
102
 
113
103
 
114
104
  export function internalCallEsBuild_(self_, mainJsFile_, outputPath_, minify_, sourceMap_) {
@@ -116,6 +106,11 @@ const esbuild_ = import$0;
116
106
  esbuild_.build({stdin: {contents: (("import {$run$} from './" + mainJsFile_) + "';"), resolveDir: "."}, bundle: true, minify: minify_, sourcemap: sourceMap_, platform: "browser", target: "es2017", external: ["../../../node_modules/*"], outfile: outputPath_})
117
107
  }
118
108
 
109
+ export function internalBrowserCallEsBuild_(self_, mainJsFiles_, outputPath_, minify_, sourceMap_) {
110
+ const esbuild_ = import$0;
111
+ esbuild_.build({entryPoints: mainJsFiles_, bundle: true, minify: minify_, sourcemap: sourceMap_, platform: "browser", target: "es2017", outdir: outputPath_, outExtension: {[".js"]: ".bundle.js"}})
112
+ }
113
+
119
114
  export function internalNodeCallEsBuild_(self_, mainJsFile_, outputPath_, minify_) {
120
115
  const esbuild_ = import$0;
121
116
  esbuild_.build({entryPoints: [mainJsFile_], bundle: true, minify: minify_, sourcemap: true, platform: "node", target: "es2017", external: ["../../../node_modules/*"], outfile: outputPath_})
@@ -138,13 +133,25 @@ return ff_core_Path.Path_readStream(file_)
138
133
  })))
139
134
  }
140
135
 
136
+ export function internalListPath_(path_) {
137
+ return ff_core_Stream.Stream_flatMap(ff_core_Path.Path_entries(path_), ((file_) => {
138
+ if(ff_core_Path.PathEntry_isDirectory(file_)) {
139
+ return ff_core_BuildSystem.internalListPath_(ff_core_Path.PathEntry_path(file_))
140
+ } else {
141
+ return ff_core_List.List_toStream([ff_core_Path.PathEntry_path(file_)], false)
142
+ }
143
+ }))
144
+ }
145
+
141
146
  export function internalPath_(buildSystem_, absoluteOrRelative_) {
142
147
  const nodePath_ = import$1;
143
148
  return ff_core_Path.Path(nodePath_.resolve(absoluteOrRelative_))
144
149
  }
145
150
 
146
- export function internalCompile_(buildSystem_, mainFile_, target_) {
147
- $firefly_compiler["buildViaBuildSystem_$"](buildSystem_, ff_core_BuildSystem.internalPath_(buildSystem_, buildSystem_["fireflyPath_"]), ff_core_Path.Path_base(mainFile_), target_, $task)
151
+ export function internalCompile_(buildSystem_, mainFiles_, target_) {
152
+ $firefly_compiler["buildViaBuildSystem_$"](buildSystem_, ff_core_BuildSystem.internalPath_(buildSystem_, buildSystem_["fireflyPath_"]), ff_core_List.List_map(mainFiles_, ((_w1) => {
153
+ return ff_core_Path.Path_base(_w1)
154
+ })), target_, $task)
148
155
  }
149
156
 
150
157
  export function internalMainPackagePair_(buildSystem_) {
@@ -156,6 +163,11 @@ const esbuild_ = import$0;
156
163
  esbuild_.build({stdin: {contents: (("import {$run$} from './" + mainJsFile_) + "';"), resolveDir: "."}, bundle: true, minify: minify_, sourcemap: sourceMap_, platform: "browser", target: "es2017", external: ["../../../node_modules/*"], outfile: outputPath_})
157
164
  }
158
165
 
166
+ export async function internalBrowserCallEsBuild_$(self_, mainJsFiles_, outputPath_, minify_, sourceMap_, $task) {
167
+ const esbuild_ = import$0;
168
+ (await esbuild_.build({entryPoints: mainJsFiles_, bundle: true, minify: minify_, sourcemap: sourceMap_, platform: "browser", target: "es2017", outdir: outputPath_, outExtension: {[".js"]: ".bundle.js"}}))
169
+ }
170
+
159
171
  export async function internalNodeCallEsBuild_$(self_, mainJsFile_, outputPath_, minify_, $task) {
160
172
  const esbuild_ = import$0;
161
173
  esbuild_.build({entryPoints: [mainJsFile_], bundle: true, minify: minify_, sourcemap: true, platform: "node", target: "es2017", external: ["../../../node_modules/*"], outfile: outputPath_})
@@ -178,24 +190,60 @@ return (await ff_core_Path.Path_readStream$(file_, $task))
178
190
  }), $task)), $task))
179
191
  }
180
192
 
193
+ export async function internalListPath_$(path_, $task) {
194
+ return (await ff_core_Stream.Stream_flatMap$((await ff_core_Path.Path_entries$(path_, $task)), (async (file_, $task) => {
195
+ if((await ff_core_Path.PathEntry_isDirectory$(file_, $task))) {
196
+ return (await ff_core_BuildSystem.internalListPath_$((await ff_core_Path.PathEntry_path$(file_, $task)), $task))
197
+ } else {
198
+ return (await ff_core_List.List_toStream$([(await ff_core_Path.PathEntry_path$(file_, $task))], false, $task))
199
+ }
200
+ }), $task))
201
+ }
202
+
181
203
  export async function internalPath_$(buildSystem_, absoluteOrRelative_, $task) {
182
204
  const nodePath_ = import$1;
183
205
  return ff_core_Path.Path(nodePath_.resolve(absoluteOrRelative_))
184
206
  }
185
207
 
186
- export async function internalCompile_$(buildSystem_, mainFile_, target_, $task) {
187
- (await $firefly_compiler["buildViaBuildSystem_$"](buildSystem_, (await ff_core_BuildSystem.internalPath_$(buildSystem_, buildSystem_["fireflyPath_"], $task)), (await ff_core_Path.Path_base$(mainFile_, $task)), target_, $task))
208
+ export async function internalCompile_$(buildSystem_, mainFiles_, target_, $task) {
209
+ (await $firefly_compiler["buildViaBuildSystem_$"](buildSystem_, (await ff_core_BuildSystem.internalPath_$(buildSystem_, buildSystem_["fireflyPath_"], $task)), (await ff_core_List.List_map$(mainFiles_, (async (_w1, $task) => {
210
+ return (await ff_core_Path.Path_base$(_w1, $task))
211
+ }), $task)), target_, $task))
188
212
  }
189
213
 
190
214
  export async function internalMainPackagePair_$(buildSystem_, $task) {
191
215
  return ff_core_Pair.Pair(buildSystem_["mainPackagePair_"]["group_"], buildSystem_["mainPackagePair_"]["name_"])
192
216
  }
193
217
 
194
- export function BuildSystem_compileForBrowser(self_, mainFile_) {
195
- ff_core_BuildSystem.internalCompile_(self_, ff_core_BuildSystem.internalPath_(self_, mainFile_), "browser");
218
+ export function BuildSystem_compileForBrowser(self_, mainFiles_) {
219
+ ff_core_BuildSystem.internalCompile_(self_, ff_core_List.List_map(mainFiles_, ((_w1) => {
220
+ return ff_core_BuildSystem.internalPath_(self_, _w1)
221
+ })), "browser");
196
222
  const streams_ = ff_core_BuildSystem.internalListDirectory_(ff_core_BuildSystem.internalPath_(self_, ".firefly/output/browser"));
197
223
  const mainPackagePair_ = ff_core_BuildSystem.internalMainPackagePair_(self_);
198
- return ff_core_BuildSystem.BrowserCode(mainPackagePair_.first_, mainPackagePair_.second_, ff_core_BuildSystem.internalPath_(self_, mainFile_), ff_core_AssetSystem.AssetSystem(ff_core_List.List_toMap(streams_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)))
224
+ return ff_core_AssetSystem.AssetSystem(ff_core_List.List_toMap(streams_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String))
225
+ }
226
+
227
+ export function BuildSystem_bundleForBrowser(self_, mainFiles_, minify_ = true, sourceMaps_ = false) {
228
+ ff_core_BuildSystem.internalCompile_(self_, ff_core_List.List_map(mainFiles_, ((_w1) => {
229
+ return ff_core_BuildSystem.internalPath_(self_, _w1)
230
+ })), "browser");
231
+ const browserOutputPath_ = ff_core_BuildSystem.internalPath_(self_, ".firefly/output/browser");
232
+ const runPaths_ = ff_core_Stream.Stream_toList(ff_core_Stream.Stream_filter(ff_core_BuildSystem.internalListPath_(browserOutputPath_), ((_w1) => {
233
+ return ff_core_String.String_endsWith(ff_core_Path.Path_base(_w1), ".run.mjs")
234
+ })));
235
+ const outputPath_ = ff_core_Option.Option_grab(ff_core_Path.Path_parent(ff_core_List.List_grabFirst(runPaths_)));
236
+ ff_core_BuildSystem.internalBrowserCallEsBuild_(self_, ff_core_List.List_map(runPaths_, ((_w1) => {
237
+ return ff_core_Path.Path_absolute(_w1)
238
+ })), ff_core_Path.Path_absolute(outputPath_), minify_, sourceMaps_);
239
+ const bundlePaths_ = ff_core_Stream.Stream_toList(ff_core_Stream.Stream_filter(ff_core_BuildSystem.internalListPath_(browserOutputPath_), ((_w1) => {
240
+ return ff_core_String.String_endsWith(ff_core_Path.Path_base(_w1), ".bundle.js")
241
+ })));
242
+ return ff_core_AssetSystem.AssetSystem(ff_core_List.List_toMap(ff_core_List.List_map(bundlePaths_, ((p_) => {
243
+ return ff_core_Pair.Pair(("/" + ff_core_String.String_replace(ff_core_Path.Path_relativeTo(p_, browserOutputPath_), "\\", "/")), (() => {
244
+ return ff_core_Path.Path_readStream(p_)
245
+ }))
246
+ })), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String))
199
247
  }
200
248
 
201
249
  export function BuildSystem_buildMode(self_) {
@@ -227,11 +275,35 @@ export function BuildSystem_crypto(self_) {
227
275
  return crypto
228
276
  }
229
277
 
230
- export async function BuildSystem_compileForBrowser$(self_, mainFile_, $task) {
231
- (await ff_core_BuildSystem.internalCompile_$(self_, (await ff_core_BuildSystem.internalPath_$(self_, mainFile_, $task)), "browser", $task));
278
+ export async function BuildSystem_compileForBrowser$(self_, mainFiles_, $task) {
279
+ (await ff_core_BuildSystem.internalCompile_$(self_, (await ff_core_List.List_map$(mainFiles_, (async (_w1, $task) => {
280
+ return (await ff_core_BuildSystem.internalPath_$(self_, _w1, $task))
281
+ }), $task)), "browser", $task));
232
282
  const streams_ = (await ff_core_BuildSystem.internalListDirectory_$((await ff_core_BuildSystem.internalPath_$(self_, ".firefly/output/browser", $task)), $task));
233
283
  const mainPackagePair_ = (await ff_core_BuildSystem.internalMainPackagePair_$(self_, $task));
234
- return ff_core_BuildSystem.BrowserCode(mainPackagePair_.first_, mainPackagePair_.second_, (await ff_core_BuildSystem.internalPath_$(self_, mainFile_, $task)), ff_core_AssetSystem.AssetSystem(ff_core_List.List_toMap(streams_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)))
284
+ return ff_core_AssetSystem.AssetSystem(ff_core_List.List_toMap(streams_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String))
285
+ }
286
+
287
+ export async function BuildSystem_bundleForBrowser$(self_, mainFiles_, minify_ = true, sourceMaps_ = false, $task) {
288
+ (await ff_core_BuildSystem.internalCompile_$(self_, (await ff_core_List.List_map$(mainFiles_, (async (_w1, $task) => {
289
+ return (await ff_core_BuildSystem.internalPath_$(self_, _w1, $task))
290
+ }), $task)), "browser", $task));
291
+ const browserOutputPath_ = (await ff_core_BuildSystem.internalPath_$(self_, ".firefly/output/browser", $task));
292
+ const runPaths_ = (await ff_core_Stream.Stream_toList$((await ff_core_Stream.Stream_filter$((await ff_core_BuildSystem.internalListPath_$(browserOutputPath_, $task)), (async (_w1, $task) => {
293
+ return ff_core_String.String_endsWith((await ff_core_Path.Path_base$(_w1, $task)), ".run.mjs")
294
+ }), $task)), $task));
295
+ const outputPath_ = ff_core_Option.Option_grab((await ff_core_Path.Path_parent$(ff_core_List.List_grabFirst(runPaths_), $task)));
296
+ (await ff_core_BuildSystem.internalBrowserCallEsBuild_$(self_, (await ff_core_List.List_map$(runPaths_, (async (_w1, $task) => {
297
+ return (await ff_core_Path.Path_absolute$(_w1, $task))
298
+ }), $task)), (await ff_core_Path.Path_absolute$(outputPath_, $task)), minify_, sourceMaps_, $task));
299
+ const bundlePaths_ = (await ff_core_Stream.Stream_toList$((await ff_core_Stream.Stream_filter$((await ff_core_BuildSystem.internalListPath_$(browserOutputPath_, $task)), (async (_w1, $task) => {
300
+ return ff_core_String.String_endsWith((await ff_core_Path.Path_base$(_w1, $task)), ".bundle.js")
301
+ }), $task)), $task));
302
+ return ff_core_AssetSystem.AssetSystem(ff_core_List.List_toMap((await ff_core_List.List_map$(bundlePaths_, (async (p_, $task) => {
303
+ return ff_core_Pair.Pair(("/" + ff_core_String.String_replace((await ff_core_Path.Path_relativeTo$(p_, browserOutputPath_, $task)), "\\", "/")), (async ($task) => {
304
+ return (await ff_core_Path.Path_readStream$(p_, $task))
305
+ }))
306
+ }), $task)), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String))
235
307
  }
236
308
 
237
309
  export async function BuildSystem_buildMode$(self_, $task) {
@@ -263,56 +335,4 @@ export async function BuildSystem_crypto$(self_, $task) {
263
335
  return crypto
264
336
  }
265
337
 
266
- export function BrowserCode_assets(self_) {
267
- return self_.assetSystem_
268
- }
269
-
270
- export function BrowserCode_bundle(self_, minify_ = true, sourceMap_ = false) {
271
- const prefix_ = ".firefly/output/browser";
272
- const mainJsBaseFile_ = (ff_core_Option.Option_grab(ff_core_String.String_removeLast(ff_core_Path.Path_base(self_.mainFile_), ".ff")) + ".mjs");
273
- const mainJsFile_ = ((((((prefix_ + "/") + self_.packageGroup_) + "/") + self_.packageName_) + "/") + mainJsBaseFile_);
274
- const mainDirectory_ = ff_core_Option.Option_grab(ff_core_Path.Path_parent(self_.mainFile_));
275
- const file_ = (prefix_ + "/Main.bundle.js");
276
- ff_core_BuildSystem.internalCallEsBuild_(self_, mainJsFile_, file_, minify_, sourceMap_);
277
- const assets_ = ff_core_AssetSystem.AssetSystem(ff_core_List.List_toMap([ff_core_Pair.Pair(ff_core_String.String_dropFirst(file_, prefix_.length), (() => {
278
- return ff_core_Path.Path_readStream(ff_core_Path.Path_path(mainDirectory_, file_))
279
- })), ...(sourceMap_
280
- ? [ff_core_Pair.Pair((ff_core_String.String_dropFirst(file_, prefix_.length) + ".map"), (() => {
281
- return ff_core_Path.Path_readStream(ff_core_Path.Path_path(mainDirectory_, (file_ + ".map")))
282
- }))]
283
- : [])], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String));
284
- return ff_core_BuildSystem.BrowserBundle(assets_)
285
- }
286
-
287
- export async function BrowserCode_assets$(self_, $task) {
288
- return self_.assetSystem_
289
- }
290
-
291
- export async function BrowserCode_bundle$(self_, minify_ = true, sourceMap_ = false, $task) {
292
- const prefix_ = ".firefly/output/browser";
293
- const mainJsBaseFile_ = (ff_core_Option.Option_grab(ff_core_String.String_removeLast((await ff_core_Path.Path_base$(self_.mainFile_, $task)), ".ff")) + ".mjs");
294
- const mainJsFile_ = ((((((prefix_ + "/") + self_.packageGroup_) + "/") + self_.packageName_) + "/") + mainJsBaseFile_);
295
- const mainDirectory_ = ff_core_Option.Option_grab((await ff_core_Path.Path_parent$(self_.mainFile_, $task)));
296
- const file_ = (prefix_ + "/Main.bundle.js");
297
- (await ff_core_BuildSystem.internalCallEsBuild_$(self_, mainJsFile_, file_, minify_, sourceMap_, $task));
298
- const assets_ = ff_core_AssetSystem.AssetSystem(ff_core_List.List_toMap([ff_core_Pair.Pair(ff_core_String.String_dropFirst(file_, prefix_.length), (async ($task) => {
299
- return (await ff_core_Path.Path_readStream$((await ff_core_Path.Path_path$(mainDirectory_, file_, $task)), $task))
300
- })), ...(sourceMap_
301
- ? [ff_core_Pair.Pair((ff_core_String.String_dropFirst(file_, prefix_.length) + ".map"), (async ($task) => {
302
- return (await ff_core_Path.Path_readStream$((await ff_core_Path.Path_path$(mainDirectory_, (file_ + ".map"), $task)), $task))
303
- }))]
304
- : [])], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String));
305
- return ff_core_BuildSystem.BrowserBundle(assets_)
306
- }
307
-
308
- export function BrowserBundle_assets(self_) {
309
- return self_.assetSystem_
310
- }
311
-
312
- export async function BrowserBundle_assets$(self_, $task) {
313
- return self_.assetSystem_
314
- }
315
-
316
-
317
-
318
338
 
@@ -425,5 +425,3 @@ return (await ff_core_Channel.internalRunChannelAction_$(self_, ff_core_Option.S
425
425
  }
426
426
 
427
427
 
428
-
429
-
@@ -151,5 +151,3 @@ return String.fromCharCode(self_)
151
151
  }
152
152
 
153
153
 
154
-
155
-
@@ -290,5 +290,3 @@ async anyTag_$($task) {
290
290
  return ff_core_Any.internalAnyTag_((("ff:core/Core.GrabException" + "[") + "]"))
291
291
  }
292
292
  };
293
-
294
-
@@ -250,5 +250,3 @@ return (v_ === 0)
250
250
  }
251
251
 
252
252
 
253
-
254
-
@@ -1005,5 +1005,3 @@ async deserializeUsing_$(serialization_, $task) {
1005
1005
  return ff_core_Date.newRfc9557_(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_))
1006
1006
  }
1007
1007
  };
1008
-
1009
-
@@ -118,5 +118,3 @@ async show_$(value_, $task) {
118
118
  return ff_core_Duration.Duration_show(value_, 3)
119
119
  }
120
120
  };
121
-
122
-
@@ -161,5 +161,3 @@ async equals_$(x_, y_, $task) {
161
161
  return (x_ === y_)
162
162
  }
163
163
  };
164
-
165
-
@@ -148,5 +148,3 @@ return ff_core_Option.Some(self_.ffException)
148
148
  }
149
149
 
150
150
 
151
-
152
-
@@ -218,5 +218,3 @@ if(dataOnly_) {
218
218
  }
219
219
 
220
220
 
221
-
222
-
@@ -511,5 +511,3 @@ async anyTag_$($task) {
511
511
  return ff_core_Any.internalAnyTag_((("ff:core/Float.Float" + "[") + "]"))
512
512
  }
513
513
  };
514
-
515
-
@@ -415,5 +415,3 @@ return (new DataView((await self_.response.arrayBuffer())))
415
415
  }
416
416
 
417
417
 
418
-
419
-
@@ -279,5 +279,3 @@ async anyTag_$($task) {
279
279
  return ff_core_Any.internalAnyTag_((("ff:core/Int.Int" + "[") + "]"))
280
280
  }
281
281
  };
282
-
283
-
@@ -354,5 +354,3 @@ return
354
354
  }
355
355
 
356
356
 
357
-
358
-
@@ -747,5 +747,3 @@ return ff_core_Core.panic_("This call should have been eliminated by the compile
747
747
 
748
748
 
749
749
 
750
-
751
-
@@ -360,5 +360,3 @@ return (async (a_1, a_2, a_3, a_4, a_5, a_6, a_7, a_8, a_9) => await body_(a_1,
360
360
  }
361
361
 
362
362
 
363
-
364
-
@@ -411,6 +411,10 @@ export function JsValue_new9(self_, a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_,
411
411
  return (new self_(a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_))
412
412
  }
413
413
 
414
+ export function JsValue_new10(self_, a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_, a10_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, ff_core_JsValue_IsJsValue$A5, ff_core_JsValue_IsJsValue$A6, ff_core_JsValue_IsJsValue$A7, ff_core_JsValue_IsJsValue$A8, ff_core_JsValue_IsJsValue$A9, ff_core_JsValue_IsJsValue$A10) {
415
+ return (new self_(a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_, a10_))
416
+ }
417
+
414
418
  export function JsValue_grabPairs(self_) {
415
419
  if((!ff_core_JsValue.JsValue_isObject(self_))) {
416
420
  throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Core.GrabException(), ff_core_Core.ff_core_Any_HasAnyTag$ff_core_Core_GrabException)})
@@ -778,6 +782,10 @@ export async function JsValue_new9$(self_, a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8
778
782
  return (new self_(a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_))
779
783
  }
780
784
 
785
+ export async function JsValue_new10$(self_, a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_, a10_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, ff_core_JsValue_IsJsValue$A5, ff_core_JsValue_IsJsValue$A6, ff_core_JsValue_IsJsValue$A7, ff_core_JsValue_IsJsValue$A8, ff_core_JsValue_IsJsValue$A9, ff_core_JsValue_IsJsValue$A10, $task) {
786
+ return (new self_(a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_, a10_))
787
+ }
788
+
781
789
  export async function JsValue_grabPairs$(self_, $task) {
782
790
  if((!ff_core_JsValue.JsValue_isObject(self_))) {
783
791
  throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Core.GrabException(), ff_core_Core.ff_core_Any_HasAnyTag$ff_core_Core_GrabException)})
@@ -892,5 +900,3 @@ export const ff_core_JsValue_IsJsValue$ff_core_Buffer_Buffer = {
892
900
  export const ff_core_JsValue_IsJsValue$ff_core_Nothing_Nothing = {
893
901
 
894
902
  };
895
-
896
-
@@ -1205,5 +1205,3 @@ async deserializeUsing_$(serialization_, $task) {
1205
1205
  return ff_core_Option.Option_grab(ff_core_Json.read_(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_)))
1206
1206
  }
1207
1207
  };
1208
-
1209
-
@@ -1214,5 +1214,3 @@ async anyTag_$($task) {
1214
1214
  return ff_core_Any.internalAnyTag_(((("ff:core/List.List" + "[") + ff_core_Any.AnyTag_show(ff_core_Any_HasAnyTag$T.anyTag_())) + "]"))
1215
1215
  }
1216
1216
  }}
1217
-
1218
-
@@ -347,5 +347,3 @@ ff_core_Queue.Queue_clear(self_.queue_)
347
347
  }
348
348
 
349
349
 
350
-
351
-
@@ -173,5 +173,3 @@ process.stderr.write((value_ + "\n"))
173
173
 
174
174
 
175
175
 
176
-
177
-
@@ -448,5 +448,3 @@ async show_$(value_, $task) {
448
448
  return (ff_core_Show.ff_core_Show_Show$ff_core_List_List(ff_core_Show.ff_core_Show_Show$ff_core_Pair_Pair(ff_core_Show_Show$K, ff_core_Show_Show$V)).show_(ff_core_Map.Map_pairs(value_, ff_core_Ordering_Order$K)) + ".toMap()")
449
449
  }
450
450
  }}
451
-
452
-
@@ -523,5 +523,3 @@ async anyTag_$($task) {
523
523
  return ff_core_Any.internalAnyTag_((("ff:core/NodeSystem.ProcessException" + "[") + "]"))
524
524
  }
525
525
  };
526
-
527
-
@@ -106,5 +106,3 @@ import * as ff_core_Unit from "../../ff/core/Unit.mjs"
106
106
 
107
107
 
108
108
 
109
-
110
-
@@ -763,5 +763,3 @@ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serial
763
763
  }
764
764
  }
765
765
  }}
766
-
767
-
@@ -526,5 +526,3 @@ return false
526
526
  }
527
527
  }
528
528
  };
529
-
530
-
@@ -303,5 +303,3 @@ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serial
303
303
  }
304
304
  }
305
305
  }}
306
-
307
-
@@ -973,5 +973,3 @@ return self_.isSymbolicLink()
973
973
  }
974
974
 
975
975
 
976
-
977
-
@@ -302,5 +302,3 @@ return ff_core_Queue.Queue(ff_core_IntMap.IntMap_copy(self_.items_), self_.nextK
302
302
  }
303
303
 
304
304
 
305
-
306
-
@@ -370,5 +370,3 @@ return ff_core_List.List_grab(list_, ff_core_Random.Random_nextInt(self_, 0, lis
370
370
  }
371
371
 
372
372
 
373
-
374
-
@@ -1538,5 +1538,3 @@ return result_
1538
1538
  }
1539
1539
 
1540
1540
 
1541
-
1542
-
@@ -441,5 +441,3 @@ async anyTag_$($task) {
441
441
  return ff_core_Any.internalAnyTag_((("ff:core/Serializable.DeserializationChecksumException" + "[") + "]"))
442
442
  }
443
443
  };
444
-
445
-
@@ -310,5 +310,3 @@ async show_$(value_, $task) {
310
310
  return (ff_core_Show.ff_core_Show_Show$ff_core_List_List(ff_core_Show_Show$A).show_(ff_core_Set.Set_toList(value_, ff_core_Ordering_Order$A)) + ".toSet()")
311
311
  }
312
312
  }}
313
-
314
-
@@ -191,5 +191,3 @@ async show_$(value_, $task) {
191
191
  return (((("Pair(" + ff_core_Show_Show$A.show_(value_.first_)) + ", ") + ff_core_Show_Show$B.show_(value_.second_)) + ")")
192
192
  }
193
193
  }}
194
-
195
-
@@ -271,5 +271,3 @@ async deserializeUsing_$(serialization_, $task) {
271
271
  return ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_)
272
272
  }
273
273
  };
274
-
275
-
@@ -1146,5 +1146,3 @@ return ff_core_Pair.Pair(ff_core_Array.Array_drain(buffers_), (await ff_core_Str
1146
1146
  }
1147
1147
 
1148
1148
 
1149
-
1150
-
@@ -635,5 +635,3 @@ async anyTag_$($task) {
635
635
  return ff_core_Any.internalAnyTag_((("ff:core/String.String" + "[") + "]"))
636
636
  }
637
637
  };
638
-
639
-
@@ -354,5 +354,3 @@ return
354
354
  }
355
355
 
356
356
 
357
-
358
-
@@ -392,5 +392,3 @@ const _w1 = for_a[for_i];
392
392
  }
393
393
 
394
394
 
395
-
396
-
@@ -499,5 +499,3 @@ return ff_core_Try.Failure(error_)
499
499
  }
500
500
 
501
501
 
502
-
503
-
@@ -139,5 +139,3 @@ return true
139
139
  }
140
140
  }
141
141
  };
142
-
143
-
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "description": "Firefly compiler",
5
5
  "author": "Firefly team",
6
6
  "license": "MIT",
7
- "version": "0.5.49",
7
+ "version": "0.5.51",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/Ahnfelt/firefly-boot"
@@ -17,7 +17,7 @@ export function activate(context: vscode.ExtensionContext) {
17
17
  ? path.join(context.extensionPath, 'firefly')
18
18
  : path.join(context.extensionPath, '..')
19
19
 
20
- const fireflyCompiler = fireflyPath + '/output/js/ff/compiler/Main.mjs';
20
+ const fireflyCompiler = fireflyPath + '/output/js/ff/compiler/Main.run.mjs';
21
21
 
22
22
  context.subscriptions.push(vscode.commands.registerCommand('extension.firefly-lang.getFireflyPath', config => {
23
23
  return fireflyPath;
@@ -4,7 +4,7 @@
4
4
  "description": "Firefly language support",
5
5
  "author": "Firefly team",
6
6
  "license": "MIT",
7
- "version": "0.5.49",
7
+ "version": "0.5.51",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/Ahnfelt/firefly-boot"
@@ -66,8 +66,8 @@
66
66
  "}",
67
67
  "",
68
68
  "buildMain(system: BuildSystem) {",
69
- " let browser = system.compileForBrowser(\"WebApp.ff\")",
70
- " let assets = AssetSystem.create().addAssets(\"/js\", browser.assets())",
69
+ " let browserAssets = system.compileForBrowser([\"WebApp.ff\"])",
70
+ " let assets = AssetSystem.create().addAssets(\"/js\", browserAssets)",
71
71
  " system.setAssets(assets)",
72
72
  "}",
73
73
  "",