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.
- package/bin/Release.ff +3 -3
- package/bin/firefly.mjs +1 -1
- package/compiler/Builder.ff +11 -5
- package/compiler/Compiler.ff +14 -3
- package/compiler/JsEmitter.ff +6 -11
- package/compiler/Main.ff +10 -15
- package/compiler/ModuleCache.ff +2 -1
- package/core/Buffer.ff +26 -4
- package/core/BuildSystem.ff +49 -46
- package/core/JsValue.ff +5 -0
- package/experimental/date/Date.ff +604 -0
- package/experimental/date/Main.ff +51 -0
- package/experimental/random/AsciiBuffer.ff +15 -0
- package/experimental/rhymeapp/Main.ff +2 -3
- package/experimental/site/Main.ff +2 -2
- package/experimental/site2/Main.ff +2 -2
- package/firefly.sh +1 -1
- package/fireflysite/CommunityOverview.ff +3 -3
- package/fireflysite/CountingButtonDemo.ff +3 -3
- package/fireflysite/ExamplesOverview.ff +3 -12
- package/fireflysite/FrontPage.ff +3 -3
- package/fireflysite/GettingStarted.ff +3 -3
- package/fireflysite/Guide.ff +7 -187
- package/fireflysite/Html.ff +66 -0
- package/fireflysite/Main.ff +13 -77
- package/fireflysite/MatchingPasswordsDemo.ff +3 -3
- package/fireflysite/Menu.ff +59 -0
- package/fireflysite/PackagesOverview.ff +3 -3
- package/fireflysite/PostgresqlDemo.ff +3 -3
- package/fireflysite/RouteFront.ff +30 -0
- package/fireflysite/RouteNonMarkdown.ff +48 -0
- package/fireflysite/RouteReference.ff +40 -0
- package/fireflysite/Router.ff +33 -0
- package/fireflysite/Website.ff +133 -0
- package/fireflysite/assets/markdown/reference/{FunctionsAndMethods.md → functions-and-methods.md} +1 -1
- package/fireflysite/assets/markdown/reference/{StatementsAndExpressions.md → statements-and-expressions.md} +0 -1
- package/fireflysite/assets/markdown/reference/{StructuredConcurrency.md → structured-concurrency.md} +0 -1
- package/fireflysite/assets/markdown/reference.md +3 -0
- package/graph/.firefly/package.ff +1 -0
- package/graph/Graph.ff +79 -0
- package/lsp/CompletionHandler.ff +2 -2
- package/lux/CssTest.ff +2 -2
- package/lux/Main.ff +2 -2
- package/lux/Main2.ff +2 -2
- package/output/js/ff/compiler/Builder.mjs +44 -12
- package/output/js/ff/compiler/Compiler.mjs +28 -10
- package/output/js/ff/compiler/Dependencies.mjs +0 -2
- package/output/js/ff/compiler/DependencyLock.mjs +0 -2
- package/output/js/ff/compiler/Deriver.mjs +0 -2
- package/output/js/ff/compiler/Dictionaries.mjs +0 -2
- package/output/js/ff/compiler/Environment.mjs +0 -2
- package/output/js/ff/compiler/Inference.mjs +0 -2
- package/output/js/ff/compiler/JsEmitter.mjs +12 -30
- package/output/js/ff/compiler/JsImporter.mjs +0 -2
- package/output/js/ff/compiler/LspHook.mjs +0 -2
- package/output/js/ff/compiler/Main.mjs +24 -47
- package/output/js/ff/compiler/Main.run.mjs +25 -0
- package/output/js/ff/compiler/ModuleCache.mjs +4 -6
- package/output/js/ff/compiler/Parser.mjs +0 -2
- package/output/js/ff/compiler/Patterns.mjs +0 -2
- package/output/js/ff/compiler/Resolver.mjs +0 -2
- package/output/js/ff/compiler/Substitution.mjs +0 -2
- package/output/js/ff/compiler/Syntax.mjs +0 -2
- package/output/js/ff/compiler/Token.mjs +0 -2
- package/output/js/ff/compiler/Tokenizer.mjs +0 -2
- package/output/js/ff/compiler/Unification.mjs +0 -2
- package/output/js/ff/compiler/Wildcards.mjs +0 -2
- package/output/js/ff/compiler/Workspace.mjs +0 -2
- package/output/js/ff/core/Any.mjs +0 -2
- package/output/js/ff/core/Array.mjs +0 -2
- package/output/js/ff/core/AssetSystem.mjs +0 -2
- package/output/js/ff/core/Atomic.mjs +0 -2
- package/output/js/ff/core/Bool.mjs +0 -2
- package/output/js/ff/core/BrowserSystem.mjs +0 -2
- package/output/js/ff/core/Buffer.mjs +50 -10
- package/output/js/ff/core/BuildSystem.mjs +92 -72
- package/output/js/ff/core/Channel.mjs +0 -2
- package/output/js/ff/core/Char.mjs +0 -2
- package/output/js/ff/core/Core.mjs +0 -2
- package/output/js/ff/core/Crypto.mjs +0 -2
- package/output/js/ff/core/Date.mjs +0 -2
- package/output/js/ff/core/Duration.mjs +0 -2
- package/output/js/ff/core/Equal.mjs +0 -2
- package/output/js/ff/core/Error.mjs +0 -2
- package/output/js/ff/core/FileHandle.mjs +0 -2
- package/output/js/ff/core/Float.mjs +0 -2
- package/output/js/ff/core/HttpClient.mjs +0 -2
- package/output/js/ff/core/Int.mjs +0 -2
- package/output/js/ff/core/IntMap.mjs +0 -2
- package/output/js/ff/core/Js.mjs +0 -2
- package/output/js/ff/core/JsSystem.mjs +0 -2
- package/output/js/ff/core/JsValue.mjs +8 -2
- package/output/js/ff/core/Json.mjs +0 -2
- package/output/js/ff/core/List.mjs +0 -2
- package/output/js/ff/core/Lock.mjs +0 -2
- package/output/js/ff/core/Log.mjs +0 -2
- package/output/js/ff/core/Map.mjs +0 -2
- package/output/js/ff/core/NodeSystem.mjs +0 -2
- package/output/js/ff/core/Nothing.mjs +0 -2
- package/output/js/ff/core/Option.mjs +0 -2
- package/output/js/ff/core/Ordering.mjs +0 -2
- package/output/js/ff/core/Pair.mjs +0 -2
- package/output/js/ff/core/Path.mjs +0 -2
- package/output/js/ff/core/Queue.mjs +0 -2
- package/output/js/ff/core/Random.mjs +0 -2
- package/output/js/ff/core/RbMap.mjs +0 -2
- package/output/js/ff/core/Serializable.mjs +0 -2
- package/output/js/ff/core/Set.mjs +0 -2
- package/output/js/ff/core/Show.mjs +0 -2
- package/output/js/ff/core/SourceLocation.mjs +0 -2
- package/output/js/ff/core/Stream.mjs +0 -2
- package/output/js/ff/core/String.mjs +0 -2
- package/output/js/ff/core/StringMap.mjs +0 -2
- package/output/js/ff/core/Task.mjs +0 -2
- package/output/js/ff/core/Try.mjs +0 -2
- package/output/js/ff/core/Unit.mjs +0 -2
- package/package.json +1 -1
- package/vscode/client/src/extension.ts +1 -1
- package/vscode/package.json +1 -1
- package/vscode/snippets.json +2 -2
- package/webserver/WebRoute.ff +51 -14
- package/fireflysite/ReferenceAll.ff +0 -18
- /package/fireflysite/assets/markdown/reference/{BaseTypes.md → base-types.md} +0 -0
- /package/fireflysite/assets/markdown/reference/{EmittedJavascript.md → emitted-javascript.md} +0 -0
- /package/fireflysite/assets/markdown/reference/{Exceptions.md → exceptions.md} +0 -0
- /package/fireflysite/assets/markdown/reference/{JavascriptInterop.md → javascript-interop.md} +0 -0
- /package/fireflysite/assets/markdown/reference/{ModulesAndPackages.md → modules-and-packages.md} +0 -0
- /package/fireflysite/assets/markdown/reference/{PatternMatching.md → pattern-matching.md} +0 -0
- /package/fireflysite/assets/markdown/reference/{TraitsAndInstances.md → traits-and-instances.md} +0 -0
- /package/fireflysite/assets/markdown/reference/{UserDefinedTypes.md → user-defined-types.md} +0 -0
- /package/fireflysite/assets/markdown/scratch/{ControlFlow.md → control-flow.md} +0 -0
- /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_,
|
|
147
|
-
$firefly_compiler["buildViaBuildSystem_$"](buildSystem_, ff_core_BuildSystem.internalPath_(buildSystem_, buildSystem_["fireflyPath_"]),
|
|
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_,
|
|
187
|
-
(await $firefly_compiler["buildViaBuildSystem_$"](buildSystem_, (await ff_core_BuildSystem.internalPath_$(buildSystem_, buildSystem_["fireflyPath_"], $task)), (await
|
|
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_,
|
|
195
|
-
ff_core_BuildSystem.internalCompile_(self_,
|
|
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
|
|
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_,
|
|
231
|
-
(await ff_core_BuildSystem.internalCompile_$(self_, (await
|
|
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
|
|
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
|
|
package/output/js/ff/core/Js.mjs
CHANGED
|
@@ -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
|
-
|
|
@@ -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
|
-
|
package/package.json
CHANGED
|
@@ -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;
|
package/vscode/package.json
CHANGED
package/vscode/snippets.json
CHANGED
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"}",
|
|
67
67
|
"",
|
|
68
68
|
"buildMain(system: BuildSystem) {",
|
|
69
|
-
" let
|
|
70
|
-
" let assets = AssetSystem.create().addAssets(\"/js\",
|
|
69
|
+
" let browserAssets = system.compileForBrowser([\"WebApp.ff\"])",
|
|
70
|
+
" let assets = AssetSystem.create().addAssets(\"/js\", browserAssets)",
|
|
71
71
|
" system.setAssets(assets)",
|
|
72
72
|
"}",
|
|
73
73
|
"",
|