@explorable-viz/fluid 0.7.16 → 0.7.18

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.
@@ -0,0 +1,29 @@
1
+ {
2
+ "parserOptions": {
3
+ "ecmaVersion": 6,
4
+ "sourceType": "module"
5
+ },
6
+ "extends": "eslint:recommended",
7
+ "env": {
8
+ "node": true
9
+ },
10
+ "rules": {
11
+ "strict": [2, "global"],
12
+ "block-scoped-var": 2,
13
+ "consistent-return": 2,
14
+ "eqeqeq": [2, "smart"],
15
+ "guard-for-in": 2,
16
+ "no-caller": 2,
17
+ "no-extend-native": 2,
18
+ "no-loop-func": 2,
19
+ "no-new": 2,
20
+ "no-param-reassign": 2,
21
+ "no-return-assign": 2,
22
+ "no-unused-expressions": 2,
23
+ "no-use-before-define": 2,
24
+ "radix": [2, "always"],
25
+ "indent": [2, 2],
26
+ "quotes": [2, "double"],
27
+ "semi": [2, "always"]
28
+ }
29
+ }
@@ -0,0 +1,8 @@
1
+ /.*
2
+ !/.gitignore
3
+ !/.eslintrc.json
4
+ !/.github/
5
+ /bower_components/
6
+ /node_modules/
7
+ /output/
8
+ package-lock.json
@@ -257,8 +257,17 @@ var pureE = function(a) {
257
257
  return a;
258
258
  };
259
259
  };
260
+ var bindE = function(a) {
261
+ return function(f) {
262
+ return function() {
263
+ return f(a())();
264
+ };
265
+ };
266
+ };
260
267
 
261
268
  // output-es/Effect/index.js
269
+ var monadEffect = { Applicative0: () => applicativeEffect, Bind1: () => bindEffect };
270
+ var bindEffect = { bind: bindE, Apply0: () => applyEffect };
262
271
  var applyEffect = {
263
272
  apply: (f) => (a) => () => {
264
273
  const f$p = f();
@@ -462,6 +471,17 @@ var iterate = (iter) => (f) => () => {
462
471
  }
463
472
  };
464
473
 
474
+ // output-es/Data.Maybe.First/index.js
475
+ var semigroupFirst = {
476
+ append: (v) => (v1) => {
477
+ if (v.tag === "Just") {
478
+ return v;
479
+ }
480
+ return v1;
481
+ }
482
+ };
483
+ var monoidFirst = { mempty: Nothing, Semigroup0: () => semigroupFirst };
484
+
465
485
  // output-es/Data.Foldable/foreign.js
466
486
  var foldrArray = function(f) {
467
487
  return function(init5) {
@@ -507,6 +527,15 @@ var foldrDefault = (dictFoldable) => {
507
527
  const foldMap2 = dictFoldable.foldMap(monoidEndo);
508
528
  return (c) => (u) => (xs) => foldMap2((x) => c(x))(xs)(u);
509
529
  };
530
+ var lookup = (dictFoldable) => {
531
+ const foldMap2 = dictFoldable.foldMap(monoidFirst);
532
+ return (dictEq) => (a) => foldMap2((v) => {
533
+ if (dictEq.eq(a)(v._1)) {
534
+ return $Maybe("Just", v._2);
535
+ }
536
+ return Nothing;
537
+ });
538
+ };
510
539
 
511
540
  // output-es/Data.Eq/foreign.js
512
541
  var refEq = function(r1) {
@@ -3271,7 +3300,7 @@ var toUnfoldable3 = (dictUnfoldable) => (m) => {
3271
3300
  };
3272
3301
  return dictUnfoldable.unfoldr(go)($List("Cons", m, Nil));
3273
3302
  };
3274
- var lookup = (dictOrd) => (k) => {
3303
+ var lookup2 = (dictOrd) => (k) => {
3275
3304
  const go = (go$a0$copy) => {
3276
3305
  let go$a0 = go$a0$copy, go$c = true, go$r;
3277
3306
  while (go$c) {
@@ -4160,7 +4189,7 @@ var $$delete = (dictOrd) => (k) => (m) => {
4160
4189
  fail();
4161
4190
  };
4162
4191
  var alter = (dictOrd) => (f) => (k) => (m) => {
4163
- const v = f(lookup(dictOrd)(k)(m));
4192
+ const v = f(lookup2(dictOrd)(k)(m));
4164
4193
  if (v.tag === "Nothing") {
4165
4194
  return $$delete(dictOrd)(k)(m);
4166
4195
  }
@@ -4198,7 +4227,7 @@ var size2 = (v) => size(v);
4198
4227
  var singleton2 = (a) => $$$Map("Two", Leaf2, a, void 0, Leaf2);
4199
4228
  var showSet = (dictShow) => ({ show: (s) => "(fromFoldable " + showArrayImpl(dictShow.show)(toUnfoldable1(s)) + ")" });
4200
4229
  var member = (dictOrd) => (a) => (v) => {
4201
- const $0 = lookup(dictOrd)(a)(v);
4230
+ const $0 = lookup2(dictOrd)(a)(v);
4202
4231
  if ($0.tag === "Nothing") {
4203
4232
  return false;
4204
4233
  }
@@ -9574,7 +9603,7 @@ var mutate = (f) => (m) => {
9574
9603
  };
9575
9604
  var member2 = ($0) => ($1) => _lookup(false, (v) => true, $0, $1);
9576
9605
  var mapWithKey = (f) => (m) => _mapWithKey(m, f);
9577
- var lookup2 = ($0) => ($1) => _lookup(Nothing, Just, $0, $1);
9606
+ var lookup3 = ($0) => ($1) => _lookup(Nothing, Just, $0, $1);
9578
9607
  var isSubmap = (dictEq) => (m1) => (m2) => all2((k) => (v) => _lookup(false, dictEq.eq(v), k, m2))(m1);
9579
9608
  var isEmpty2 = /* @__PURE__ */ all2((v) => (v1) => false);
9580
9609
  var insert2 = (k) => (v) => mutate(($0) => () => {
@@ -10043,7 +10072,7 @@ var mapObjectString = {
10043
10072
  })(),
10044
10073
  filterKeys,
10045
10074
  unionWith: unionWith2,
10046
- lookup: lookup2,
10075
+ lookup: lookup3,
10047
10076
  delete: $$delete2,
10048
10077
  insert: insert2,
10049
10078
  toUnfoldable: (dictUnfoldable) => toAscUnfoldable(dictUnfoldable),
@@ -11751,7 +11780,7 @@ var topologicalSort = (dictOrd) => (v) => {
11751
11780
  }
11752
11781
  if (v1._1._1.tag === "Visit") {
11753
11782
  if ((() => {
11754
- const $0 = lookup(dictOrd)(v1._1._1._1)(state.unvisited);
11783
+ const $0 = lookup2(dictOrd)(v1._1._1._1)(state.unvisited);
11755
11784
  if ($0.tag === "Nothing") {
11756
11785
  return false;
11757
11786
  }
@@ -11763,7 +11792,7 @@ var topologicalSort = (dictOrd) => (v) => {
11763
11792
  visit$a0 = { result: state.result, unvisited: $$delete(dictOrd)(v1._1._1._1)(state.unvisited) };
11764
11793
  visit$a1 = (() => {
11765
11794
  const $0 = fromFoldable6(listMap(Visit)((() => {
11766
- const $02 = lookup(dictOrd)(v1._1._1._1)(v);
11795
+ const $02 = lookup2(dictOrd)(v1._1._1._1)(v);
11767
11796
  if ($02.tag === "Nothing") {
11768
11797
  return Nil;
11769
11798
  }
@@ -12182,7 +12211,7 @@ var fwdSlice = (dictGraph) => {
12182
12211
  return pure($Step("Done", void 0));
12183
12212
  }
12184
12213
  if (v1.es.tag === "Cons") {
12185
- const $2 = lookup(ordVertex)(v1.es._1._1)(v1.pending);
12214
+ const $2 = lookup2(ordVertex)(v1.es._1._1)(v1.pending);
12186
12215
  const \u03B2s = (() => {
12187
12216
  if ($2.tag === "Nothing") {
12188
12217
  return $$$Map("Two", Leaf2, v1.es._1._2, void 0, Leaf2);
@@ -16410,7 +16439,7 @@ var helperMatch = (pss) => $NonEmpty(
16410
16439
  listMap((v) => $Tuple($NonEmpty(v._1, Nil), v._2))(pss._2)
16411
16440
  );
16412
16441
  var getPrec = (x) => {
16413
- const v = lookup(ordString)(x)(opDefs);
16442
+ const v = lookup2(ordString)(x)(opDefs);
16414
16443
  if (v.tag === "Just") {
16415
16444
  return v._1.prec;
16416
16445
  }
@@ -24775,6 +24804,8 @@ var concatM2 = (dictMonad) => foldrArray((() => {
24775
24804
  const $0 = dictMonad.Bind1();
24776
24805
  return (f) => (g) => (a) => $0.bind(f(a))(g);
24777
24806
  })())(dictMonad.Applicative0().pure);
24807
+ var Folder = (x) => x;
24808
+ var File = (x) => x;
24778
24809
  var parse = (dictMonadError) => {
24779
24810
  const $0 = dictMonadError.MonadThrow0();
24780
24811
  const $1 = $0.Monad0().Applicative0().pure;
@@ -24895,6 +24926,48 @@ function nullable(a, r, f) {
24895
24926
  return a == null ? r : f(a);
24896
24927
  }
24897
24928
 
24929
+ // output-es/Node.Buffer.Immutable/foreign.js
24930
+ function toStringImpl(enc) {
24931
+ return (buff) => {
24932
+ return buff.toString(enc);
24933
+ };
24934
+ }
24935
+
24936
+ // output-es/Node.Buffer.Immutable/index.js
24937
+ var toString = (x) => toStringImpl((() => {
24938
+ if (x === "ASCII") {
24939
+ return "ascii";
24940
+ }
24941
+ if (x === "UTF8") {
24942
+ return "utf8";
24943
+ }
24944
+ if (x === "UTF16LE") {
24945
+ return "utf16le";
24946
+ }
24947
+ if (x === "UCS2") {
24948
+ return "ucs2";
24949
+ }
24950
+ if (x === "Base64") {
24951
+ return "base64";
24952
+ }
24953
+ if (x === "Latin1") {
24954
+ return "latin1";
24955
+ }
24956
+ if (x === "Binary") {
24957
+ return "binary";
24958
+ }
24959
+ if (x === "Hex") {
24960
+ return "hex";
24961
+ }
24962
+ fail();
24963
+ })());
24964
+
24965
+ // output-es/Node.Buffer.Internal/index.js
24966
+ var toString2 = (dictMonad) => (m) => {
24967
+ const $0 = toString(m);
24968
+ return (buf) => dictMonad.Bind1().Apply0().Functor0().map($0)(dictMonad.Applicative0().pure(buf));
24969
+ };
24970
+
24898
24971
  // output-es/Node.FS.Constants/foreign.js
24899
24972
  import { constants } from "node:fs";
24900
24973
  var f_OK = constants.F_OK;
@@ -24997,6 +25070,132 @@ var loadFile = (v) => (v1) => (dictMonadAff) => {
24997
25070
  return (dictMonadError) => Monad0.Bind1().bind(dictMonadAff.liftAff(toAff2(readTextFile)(ASCII)(v + "/" + v1 + ".fld")))((buffer) => Monad0.Applicative0().pure(buffer));
24998
25071
  };
24999
25072
 
25073
+ // output-es/Node.ChildProcess/foreign.js
25074
+ import { spawn, exec, execFile, execSync, execFileSync, fork as cp_fork } from "child_process";
25075
+ function execImpl(command2) {
25076
+ return (opts) => (callback2) => () => exec(
25077
+ command2,
25078
+ opts,
25079
+ (err, stdout, stderr) => {
25080
+ callback2(err)(stdout)(stderr)();
25081
+ }
25082
+ );
25083
+ }
25084
+ var _undefined = void 0;
25085
+
25086
+ // output-es/Node.ChildProcess/index.js
25087
+ var convertExecOptions = (opts) => ({
25088
+ cwd: (() => {
25089
+ if (opts.cwd.tag === "Nothing") {
25090
+ return _undefined;
25091
+ }
25092
+ if (opts.cwd.tag === "Just") {
25093
+ return opts.cwd._1;
25094
+ }
25095
+ fail();
25096
+ })(),
25097
+ env: (() => {
25098
+ if (opts.env.tag === "Nothing") {
25099
+ return _undefined;
25100
+ }
25101
+ if (opts.env.tag === "Just") {
25102
+ return opts.env._1;
25103
+ }
25104
+ fail();
25105
+ })(),
25106
+ encoding: (() => {
25107
+ if (opts.encoding.tag === "Nothing") {
25108
+ return _undefined;
25109
+ }
25110
+ if (opts.encoding.tag === "Just") {
25111
+ if (opts.encoding._1 === "ASCII") {
25112
+ return "ascii";
25113
+ }
25114
+ if (opts.encoding._1 === "UTF8") {
25115
+ return "utf8";
25116
+ }
25117
+ if (opts.encoding._1 === "UTF16LE") {
25118
+ return "utf16le";
25119
+ }
25120
+ if (opts.encoding._1 === "UCS2") {
25121
+ return "ucs2";
25122
+ }
25123
+ if (opts.encoding._1 === "Base64") {
25124
+ return "base64";
25125
+ }
25126
+ if (opts.encoding._1 === "Latin1") {
25127
+ return "latin1";
25128
+ }
25129
+ if (opts.encoding._1 === "Binary") {
25130
+ return "binary";
25131
+ }
25132
+ if (opts.encoding._1 === "Hex") {
25133
+ return "hex";
25134
+ }
25135
+ }
25136
+ fail();
25137
+ })(),
25138
+ shell: (() => {
25139
+ if (opts.shell.tag === "Nothing") {
25140
+ return _undefined;
25141
+ }
25142
+ if (opts.shell.tag === "Just") {
25143
+ return opts.shell._1;
25144
+ }
25145
+ fail();
25146
+ })(),
25147
+ timeout: (() => {
25148
+ if (opts.timeout.tag === "Nothing") {
25149
+ return _undefined;
25150
+ }
25151
+ if (opts.timeout.tag === "Just") {
25152
+ return opts.timeout._1;
25153
+ }
25154
+ fail();
25155
+ })(),
25156
+ maxBuffer: (() => {
25157
+ if (opts.maxBuffer.tag === "Nothing") {
25158
+ return _undefined;
25159
+ }
25160
+ if (opts.maxBuffer.tag === "Just") {
25161
+ return opts.maxBuffer._1;
25162
+ }
25163
+ fail();
25164
+ })(),
25165
+ killSignal: (() => {
25166
+ if (opts.killSignal.tag === "Nothing") {
25167
+ return _undefined;
25168
+ }
25169
+ if (opts.killSignal.tag === "Just") {
25170
+ return opts.killSignal._1;
25171
+ }
25172
+ fail();
25173
+ })(),
25174
+ uid: (() => {
25175
+ if (opts.uid.tag === "Nothing") {
25176
+ return _undefined;
25177
+ }
25178
+ if (opts.uid.tag === "Just") {
25179
+ return opts.uid._1;
25180
+ }
25181
+ fail();
25182
+ })(),
25183
+ gid: (() => {
25184
+ if (opts.gid.tag === "Nothing") {
25185
+ return _undefined;
25186
+ }
25187
+ if (opts.gid.tag === "Just") {
25188
+ return opts.gid._1;
25189
+ }
25190
+ fail();
25191
+ })()
25192
+ });
25193
+ var exec2 = (cmd) => (opts) => (callback2) => execImpl(cmd)(convertExecOptions(opts))((err) => (stdout$p) => (stderr$p) => callback2({
25194
+ error: nullable(err, Nothing, Just),
25195
+ stdout: stdout$p,
25196
+ stderr: stderr$p
25197
+ }));
25198
+
25000
25199
  // output-es/Options.Applicative.Internal.Utils/index.js
25001
25200
  var whitespaceRegex = /* @__PURE__ */ (() => {
25002
25201
  const v = regex("\\s+")(noFlags);
@@ -25779,9 +25978,15 @@ var manyM = (p) => freeMonadRec.tailRecM((acc) => $Free(
25779
25978
  // output-es/Options.Applicative.Builder.Internal/index.js
25780
25979
  var $DefaultProp = (_1, _2) => ({ tag: "DefaultProp", _1, _2 });
25781
25980
  var $Mod = (_1, _2, _3) => ({ tag: "Mod", _1, _2, _3 });
25981
+ var lookup4 = /* @__PURE__ */ lookup(foldableArray)(eqString);
25782
25982
  var identity26 = (x) => x;
25783
25983
  var Mod = (value0) => (value1) => (value2) => $Mod(value0, value1, value2);
25784
25984
  var optionFieldsHasName = { name: (n) => (fields) => ({ optNames: [n, ...fields.optNames], optCompleter: fields.optCompleter, optNoArgError: fields.optNoArgError }) };
25985
+ var mkCommand = (m) => {
25986
+ const v = m._1({ cmdCommands: [], cmdGroup: Nothing });
25987
+ const $0 = v.cmdCommands;
25988
+ return $Tuple(v.cmdGroup, $Tuple(arrayMap(fst)($0), $Tuple((v1) => lookup4(v1)($0), void 0)));
25989
+ };
25785
25990
  var modSemigroup = {
25786
25991
  append: (v) => (v1) => $Mod((x) => v1._1(v._1(x)), $DefaultProp(v1._2._1.tag === "Nothing" ? v._2._1 : v1._2._1, v1._2._2.tag === "Nothing" ? v._2._2 : v1._2._2), (x) => v1._3(v._3(x)))
25787
25992
  };
@@ -25850,6 +26055,14 @@ var option = (r) => (m) => {
25850
26055
  m._2._2.tag === "Nothing" ? $0._2._2 : m._2._2
25851
26056
  ))((x) => m._3($0._3(x)))($OptReader("OptReader", $1.optNames, { crCompleter: $1.optCompleter, crReader: r }, $1.optNoArgError));
25852
26057
  };
26058
+ var subparser = (m) => {
26059
+ const $0 = optionMod((p) => ({ propMetaVar: "COMMAND", propDescMod: p.propDescMod, propHelp: p.propHelp, propShowDefault: p.propShowDefault, propVisibility: p.propVisibility }));
26060
+ const v1 = mkCommand(m);
26061
+ return mkParser($DefaultProp(
26062
+ m._2._1.tag === "Nothing" ? $0._2._1 : m._2._1,
26063
+ m._2._2.tag === "Nothing" ? $0._2._2 : m._2._2
26064
+ ))((x) => m._3($0._3(x)))($OptReader("CmdReader", v1._1, v1._2._1, v1._2._2._1));
26065
+ };
25853
26066
  var hidden = /* @__PURE__ */ optionMod((p) => ({
25854
26067
  propVisibility: min3(Hidden)(p.propVisibility),
25855
26068
  propDescMod: p.propDescMod,
@@ -25906,6 +26119,11 @@ var defaultPrefs = {
25906
26119
  prefBacktrack: Backtrack,
25907
26120
  prefColumns: 80
25908
26121
  };
26122
+ var command = (cmd) => (pinfo) => $Mod(
26123
+ (p) => ({ cmdCommands: [$Tuple(cmd, pinfo), ...p.cmdCommands], cmdGroup: p.cmdGroup }),
26124
+ $DefaultProp(Nothing, Nothing),
26125
+ identity26
26126
+ );
25909
26127
  var abortOption = (err) => (m) => {
25910
26128
  const $0 = fold3([
25911
26129
  $Mod(
@@ -25931,10 +26149,10 @@ var abortOption = (err) => (m) => {
25931
26149
  };
25932
26150
 
25933
26151
  // output-es/Node.Process/foreign.js
25934
- import process from "process";
26152
+ import process2 from "process";
25935
26153
  function exit(code) {
25936
26154
  return () => {
25937
- process.exit(code);
26155
+ process2.exit(code);
25938
26156
  };
25939
26157
  }
25940
26158
  function copyArray(xs) {
@@ -25942,7 +26160,7 @@ function copyArray(xs) {
25942
26160
  }
25943
26161
 
25944
26162
  // output-es/Node.Process/index.js
25945
- var argv = /* @__PURE__ */ (() => copyArray(process.argv))();
26163
+ var argv = /* @__PURE__ */ (() => copyArray(process2.argv))();
25946
26164
 
25947
26165
  // output-es/Node.Stream/foreign.js
25948
26166
  function writeStringImpl(w) {
@@ -28102,7 +28320,7 @@ var handleParseResult = (v) => {
28102
28320
  return () => {
28103
28321
  const progn = getProgName();
28104
28322
  const v1 = renderFailure($0)(progn);
28105
- writeString(v1._2 === "Success" ? process.stdout : process.stderr)(UTF8)(v1._1 + "\n")(mempty22)();
28323
+ writeString(v1._2 === "Success" ? process2.stdout : process2.stderr)(UTF8)(v1._1 + "\n")(mempty22)();
28106
28324
  return exit(boundedEnumExitCode.fromEnum(v1._2))();
28107
28325
  };
28108
28326
  }
@@ -28111,7 +28329,7 @@ var handleParseResult = (v) => {
28111
28329
  return () => {
28112
28330
  const progn = getProgName();
28113
28331
  const msg = $0.execCompletion(progn)();
28114
- writeString(process.stdout)(UTF8)(msg)(mempty22)();
28332
+ writeString(process2.stdout)(UTF8)(msg)(mempty22)();
28115
28333
  return exitSuccess();
28116
28334
  };
28117
28335
  }
@@ -28139,11 +28357,14 @@ var execParserPure = (pprefs) => (pinfo) => (args) => {
28139
28357
  };
28140
28358
 
28141
28359
  // output-es/Fluid/index.js
28360
+ var $Command = (tag, _1, _2, _3) => ({ tag, _1, _2, _3 });
28142
28361
  var $Program = (_1) => ({ tag: "Program", _1 });
28143
28362
  var loadProgCxt2 = /* @__PURE__ */ loadProgCxt(monadAffAff)(monadErrorAff)(loadFile);
28144
28363
  var prepConfig2 = /* @__PURE__ */ prepConfig(monadAffAff)(monadErrorAff)(loadFile);
28145
28364
  var graphEval2 = /* @__PURE__ */ graphEval(monadErrorAff);
28146
28365
  var fromFoldable29 = /* @__PURE__ */ (() => fromFoldableImpl(foldableList.foldr))();
28366
+ var Evaluate = (value0) => $Command("Evaluate", value0);
28367
+ var Publish = (value0) => (value1) => (value2) => $Command("Publish", value0, value1, value2);
28147
28368
  var parseImports = /* @__PURE__ */ $Parser(
28148
28369
  "BindP",
28149
28370
  /* @__PURE__ */ manyM(/* @__PURE__ */ option(readerAsk)(/* @__PURE__ */ (() => {
@@ -28169,6 +28390,40 @@ var output = (v) => {
28169
28390
  })(v2["out\u03B1"]._2)
28170
28391
  )))));
28171
28392
  };
28393
+ var execOptions = {
28394
+ cwd: Nothing,
28395
+ env: Nothing,
28396
+ timeout: Nothing,
28397
+ killSignal: Nothing,
28398
+ maxBuffer: Nothing,
28399
+ uid: Nothing,
28400
+ gid: Nothing,
28401
+ encoding: Nothing,
28402
+ shell: Nothing
28403
+ };
28404
+ var tester = (website) => exec2("yarn bundle-website " + website)(execOptions)((v) => {
28405
+ if (v.error.tag === "Just") {
28406
+ return log(showErrorImpl(v.error._1));
28407
+ }
28408
+ if (v.error.tag === "Nothing") {
28409
+ const $0 = toString2(monadEffect)(ASCII)(v.stdout);
28410
+ return () => {
28411
+ const out = $0();
28412
+ return log(out)();
28413
+ };
28414
+ }
28415
+ fail();
28416
+ });
28417
+ var dispatchCommand = (v) => {
28418
+ if (v.tag === "Evaluate") {
28419
+ return output(v._1);
28420
+ }
28421
+ if (v.tag === "Publish") {
28422
+ const $0 = v._1;
28423
+ return _bind(_liftEffect(tester(v._2)))(() => _bind(_liftEffect(log("Published")))(() => output($0)));
28424
+ }
28425
+ fail();
28426
+ };
28172
28427
  var callback = (v) => {
28173
28428
  if (v.tag === "Left") {
28174
28429
  return log(showErrorImpl(v._1));
@@ -28261,6 +28516,70 @@ var program = /* @__PURE__ */ (() => $Parser(
28261
28516
  })())
28262
28517
  )
28263
28518
  ))();
28519
+ var publish = /* @__PURE__ */ (() => $Parser(
28520
+ "MultP",
28521
+ $MultPE(
28522
+ $Parser(
28523
+ "MultP",
28524
+ $MultPE(
28525
+ parserFunctor.map(Publish)(program),
28526
+ parserFunctor.map(Folder)(option(readerAsk)((() => {
28527
+ const $0 = help("root directory under dist/");
28528
+ const $1 = $0._2._1.tag === "Nothing" ? Nothing : $0._2._1;
28529
+ const $2 = $0._2._2.tag === "Nothing" ? Nothing : $0._2._2;
28530
+ return $Mod(
28531
+ (x) => $0._1({
28532
+ optNames: [$OptName("OptShort", "r"), $OptName("OptLong", "root"), ...x.optNames],
28533
+ optCompleter: x.optCompleter,
28534
+ optNoArgError: x.optNoArgError
28535
+ }),
28536
+ $DefaultProp($1.tag === "Nothing" ? Nothing : $1, $2.tag === "Nothing" ? Nothing : $2),
28537
+ (x) => $0._3(x)
28538
+ );
28539
+ })()))
28540
+ )
28541
+ ),
28542
+ parserFunctor.map(File)(option(readerAsk)((() => {
28543
+ const $0 = help("Template for web-page");
28544
+ const $1 = $0._2._1.tag === "Nothing" ? Nothing : $0._2._1;
28545
+ const $2 = $0._2._2.tag === "Nothing" ? Nothing : $0._2._2;
28546
+ return $Mod(
28547
+ (x) => $0._1({
28548
+ optNames: [$OptName("OptShort", "t"), $OptName("OptLong", "template"), ...x.optNames],
28549
+ optCompleter: x.optCompleter,
28550
+ optNoArgError: x.optNoArgError
28551
+ }),
28552
+ $DefaultProp($1.tag === "Nothing" ? Nothing : $1, $2.tag === "Nothing" ? Nothing : $2),
28553
+ (x) => $0._3(x)
28554
+ );
28555
+ })()))
28556
+ )
28557
+ ))();
28558
+ var commandParser = /* @__PURE__ */ subparser(/* @__PURE__ */ (() => {
28559
+ const $0 = command("evaluate")(progDesc("Evaluate a file")({
28560
+ infoParser: parserFunctor.map(Evaluate)(program),
28561
+ infoFullDesc: true,
28562
+ infoProgDesc: mempty12,
28563
+ infoHeader: mempty12,
28564
+ infoFooter: mempty12,
28565
+ infoFailureCode: $$Error,
28566
+ infoPolicy: Intersperse
28567
+ }));
28568
+ const $1 = command("publish")(progDesc("Publish a file")({
28569
+ infoParser: publish,
28570
+ infoFullDesc: true,
28571
+ infoProgDesc: mempty12,
28572
+ infoHeader: mempty12,
28573
+ infoFooter: mempty12,
28574
+ infoFailureCode: $$Error,
28575
+ infoPolicy: Intersperse
28576
+ }));
28577
+ return $Mod(
28578
+ (x) => $1._1($0._1(x)),
28579
+ $DefaultProp($1._2._1.tag === "Nothing" ? $0._2._1 : $1._2._1, $1._2._2.tag === "Nothing" ? $0._2._2 : $1._2._2),
28580
+ (x) => $1._3($0._3(x))
28581
+ );
28582
+ })());
28264
28583
  var main = /* @__PURE__ */ (() => {
28265
28584
  const $0 = runAff(callback)(_bind(_liftEffect((() => {
28266
28585
  const $02 = header("parse - a simple parser")(progDesc("Parse a file")({
@@ -28268,7 +28587,7 @@ var main = /* @__PURE__ */ (() => {
28268
28587
  infoFailureCode: $$Error,
28269
28588
  infoFooter: mempty12,
28270
28589
  infoHeader: mempty12,
28271
- infoParser: apApplyFlipped(parserApply)(program)(helper),
28590
+ infoParser: apApplyFlipped(parserApply)(commandParser)(helper),
28272
28591
  infoPolicy: Intersperse,
28273
28592
  infoProgDesc: mempty12
28274
28593
  }));
@@ -28276,7 +28595,7 @@ var main = /* @__PURE__ */ (() => {
28276
28595
  const a$p = getArgs();
28277
28596
  return handleParseResult(execParserPure(defaultPrefs)($02)(a$p))();
28278
28597
  };
28279
- })()))(output));
28598
+ })()))(dispatchCommand));
28280
28599
  return () => {
28281
28600
  $0();
28282
28601
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@explorable-viz/fluid",
3
- "version": "0.7.16",
3
+ "version": "0.7.18",
4
4
  "description": "Fluid is an experimental programming language which integrates a bidirectional dynamic analysis to connect outputs to data sources in a fine-grained way. Fluid is implemented in PureScript and runs in the browser.",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -18,7 +18,10 @@
18
18
  },
19
19
  "homepage": "https://f.luid.org",
20
20
  "files": [
21
- "dist/fluid/"
21
+ "dist/fluid/",
22
+ "script/bundle-website.sh",
23
+ "script/util/",
24
+ "script/bundle-page.sh"
22
25
  ],
23
26
  "scripts": {
24
27
  "tidy": "./script/tidy.sh",
@@ -53,7 +56,6 @@
53
56
  "node": "^22.11.0",
54
57
  "node-process": "^1.0.1",
55
58
  "os": "^0.1.2",
56
- "purescript": "^0.15.10",
57
59
  "util": "^0.12.5"
58
60
  },
59
61
  "devDependencies": {
@@ -65,6 +67,7 @@
65
67
  "karma-mocha-reporter": "2.2.5",
66
68
  "mocha": "^10.0.0",
67
69
  "puppeteer": "^23.2.0",
70
+ "purescript": "^0.15.10",
68
71
  "purescript-language-server": "0.16.6",
69
72
  "purescript-psa": "0.8.2",
70
73
  "purs-backend-es": "1.4.2",
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env bash
2
+ # run from project root
3
+ set -xe
4
+
5
+ MODULE=$1
6
+ SRC_PATH=${MODULE//./\/}
7
+ SRC_PATH_LISP_CASE=$(./script/util/lisp-case.sh "$SRC_PATH")
8
+ echo "$SRC_PATH -> $SRC_PATH_LISP_CASE"
9
+
10
+ if [[ ! -e "website/$SRC_PATH.purs" ]]; then
11
+ ./script/util/clean.sh $SRC_PATH_LISP_CASE
12
+ cp website/$SRC_PATH.html dist/$SRC_PATH_LISP_CASE/index.html
13
+ else
14
+ ./script/util/bundle.sh $SRC_PATH_LISP_CASE Website.$MODULE
15
+
16
+ if [[ -e "website/$SRC_PATH.html" ]]; then
17
+ cp website/$SRC_PATH.html dist/$SRC_PATH_LISP_CASE/index.html
18
+ else
19
+ cp website/FluidOrg/template.html dist/$SRC_PATH_LISP_CASE/index.html
20
+ fi
21
+ fi
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env bash
2
+ # run from project root
3
+ set -xe
4
+
5
+ WEBSITE=$1
6
+ . script/bundle-page.sh $WEBSITE
7
+
8
+ # Only support one level of nesting for now
9
+ shopt -s nullglob
10
+
11
+ set +x
12
+ PAGES=($(for FILE in website/$WEBSITE/*.purs; do
13
+ basename "$FILE" | sed 's/\.[^.]*$//'
14
+ done | sort -u))
15
+ set -x
16
+
17
+ echo "Processing ${WEBSITE} pages: ${PAGES[@]}"
18
+
19
+ for PAGE in "${PAGES[@]}"; do
20
+ . script/bundle-page.sh $WEBSITE.$PAGE
21
+ done
22
+
23
+ WEBSITE_LISP_CASE=$(./script/util/lisp-case.sh "$WEBSITE")
24
+
25
+ set +x
26
+ TO_COPY=()
27
+ for CHILD in website/$WEBSITE/*; do
28
+ BASENAME="$(basename "$CHILD")"
29
+ if [[ "$BASENAME" =~ ^[a-z] ]]; then
30
+ TO_COPY+=("$CHILD")
31
+ fi
32
+ done
33
+ set -x
34
+
35
+ echo "Processing static files:"
36
+
37
+ for CHILD in "${TO_COPY[@]}"; do
38
+ BASENAME="$(basename "$CHILD")"
39
+ cp -rL "$CHILD" "dist/$WEBSITE_LISP_CASE/$BASENAME"
40
+ done
41
+
42
+ shopt -u nullglob
43
+ cp -r fluid dist/$WEBSITE_LISP_CASE
44
+ echo "Bundled website $WEBSITE"
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env bash
2
+ set -xe
3
+ yarn purs-backend-es bundle-app --main $2 --to dist/$1/fluid.js ${@:3} > /dev/null
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env bash
2
+ set -xe
3
+
4
+ rm -rf dist/$1
5
+ mkdir -p dist/$1
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env bash
2
+ set -xe
3
+
4
+ rm -rf output
5
+ rm -rf output-es
6
+ yarn tidy
7
+ yarn spago build --purs-args '--strict --censor-codes=UserDefinedWarning'
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env bash
2
+ set -e
3
+
4
+ toLispCase() {
5
+ INPUT="$1"
6
+ RESULT=$(echo "$INPUT" | sed -E 's/([a-z0-9])([A-Z])/\1-\2/g' | tr '[:upper:]' '[:lower:]')
7
+ echo "$RESULT"
8
+ }
9
+
10
+ toLispCase "$1"