@explorable-viz/fluid 0.7.86 → 0.7.88

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.
@@ -26044,7 +26044,6 @@ var mkCommand = (m) => {
26044
26044
  const $0 = v.cmdCommands;
26045
26045
  return $Tuple(v.cmdGroup, $Tuple(arrayMap(fst)($0), $Tuple((v1) => lookup4(v1)($0), void 0)));
26046
26046
  };
26047
- var flagFieldsHasName = { name: (n) => (fields) => ({ flagNames: [n, ...fields.flagNames], flagActive: fields.flagActive }) };
26048
26047
  var modSemigroup = {
26049
26048
  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)))
26050
26049
  };
@@ -28415,14 +28414,32 @@ var execParserPure = (pprefs) => (pinfo) => (args) => {
28415
28414
  };
28416
28415
 
28417
28416
  // output-es/Fluid/index.js
28418
- var $Command = (tag, _1, _2) => ({ tag, _1, _2 });
28419
- var $Program = (_1) => ({ tag: "Program", _1 });
28417
+ var $BundleArgs = (_1, _2) => ({ tag: "BundleArgs", _1, _2 });
28418
+ var $Command = (tag, _1) => ({ tag, _1 });
28419
+ var $EvalArgs = (_1) => ({ tag: "EvalArgs", _1 });
28420
28420
  var loadProgCxt3 = /* @__PURE__ */ loadProgCxt2(monadAffAff)(monadErrorAff);
28421
28421
  var prepConfig3 = /* @__PURE__ */ prepConfig2(monadAffAff)(monadErrorAff);
28422
28422
  var graphEval2 = /* @__PURE__ */ graphEval(monadErrorAff);
28423
28423
  var fromFoldable29 = /* @__PURE__ */ (() => fromFoldableImpl(foldableList.foldr))();
28424
28424
  var Evaluate = (value0) => $Command("Evaluate", value0);
28425
- var Publish = (value0) => (value1) => $Command("Publish", value0, value1);
28425
+ var BundleWebsite = (value0) => $Command("BundleWebsite", value0);
28426
+ var parseLocal = /* @__PURE__ */ $Parser(
28427
+ "AltP",
28428
+ /* @__PURE__ */ flag$p(true)(/* @__PURE__ */ (() => {
28429
+ const $0 = help("Are you running fluid as a library?");
28430
+ const $1 = $0._2._1.tag === "Nothing" ? Nothing : $0._2._1;
28431
+ const $2 = $0._2._2.tag === "Nothing" ? Nothing : $0._2._2;
28432
+ return $Mod(
28433
+ (x) => $0._1({
28434
+ flagNames: [$OptName("OptShort", "l"), $OptName("OptLong", "local"), ...x.flagNames],
28435
+ flagActive: x.flagActive
28436
+ }),
28437
+ $DefaultProp($1.tag === "Nothing" ? Nothing : $1, $2.tag === "Nothing" ? Nothing : $2),
28438
+ (x) => $0._3(x)
28439
+ );
28440
+ })()),
28441
+ /* @__PURE__ */ $Parser("NilP", false)
28442
+ );
28426
28443
  var parseImports = /* @__PURE__ */ $Parser(
28427
28444
  "BindP",
28428
28445
  /* @__PURE__ */ manyM(/* @__PURE__ */ option(readerAsk)(/* @__PURE__ */ (() => {
@@ -28440,9 +28457,28 @@ var parseImports = /* @__PURE__ */ $Parser(
28440
28457
  );
28441
28458
  })()))
28442
28459
  );
28460
+ var parseBundleArgs = /* @__PURE__ */ (() => $Parser(
28461
+ "MultP",
28462
+ $MultPE(
28463
+ parserFunctor.map((v) => (v1) => $BundleArgs(v, v1))(parserFunctor.map(Folder)(option(readerAsk)((() => {
28464
+ const $0 = help("root directory of website under dist/");
28465
+ const $1 = $0._2._2.tag === "Nothing" ? Nothing : $0._2._2;
28466
+ return $Mod(
28467
+ (x) => $0._1({
28468
+ optNames: [$OptName("OptShort", "w"), $OptName("OptLong", "website"), ...x.optNames],
28469
+ optCompleter: x.optCompleter,
28470
+ optNoArgError: x.optNoArgError
28471
+ }),
28472
+ $DefaultProp($Maybe("Just", "Misc"), $1.tag === "Nothing" ? Nothing : $1),
28473
+ (x) => $0._3(x)
28474
+ );
28475
+ })()))),
28476
+ parseLocal
28477
+ )
28478
+ ))();
28443
28479
  var evaluate = (v) => {
28444
28480
  const $0 = v._1.fileName;
28445
- const fluidSrcPaths = [v._1.prefix, ...v._1.library ? ["node_modules/@explorable-viz/fluid/dist/fluid/fluid"] : []];
28481
+ const fluidSrcPaths = [v._1.fluidSrcPath, ...v._1.local ? ["node_modules/@explorable-viz/fluid/dist/fluid/fluid"] : []];
28446
28482
  return _bind(loadProgCxt3(fluidSrcPaths)(v._1.imports)(v._1.datasets))((progCxt) => _bind(prepConfig3(fluidSrcPaths)($0)(progCxt))((v1) => _bind(graphEval2(v1.gconfig)(v1.e))((v2) => _pure($Val(
28447
28483
  void 0,
28448
28484
  functorBaseVal.map((v$1) => {
@@ -28460,12 +28496,22 @@ var copyOptions = {
28460
28496
  encoding: Nothing,
28461
28497
  shell: Nothing
28462
28498
  };
28463
- var publish = (website) => (library) => exec2((library ? "./node_modules/@explorable-viz/fluid/script/bundle-website.sh -w " : "./script/bundle-website.sh -w ") + (library ? website + " -r" : website + ""))(copyOptions)((v) => {
28464
- if (v.error.tag === "Just") {
28465
- return log(showErrorImpl(v.error._1));
28499
+ var callback = (v) => {
28500
+ if (v.tag === "Left") {
28501
+ return log(showErrorImpl(v._1));
28466
28502
  }
28467
- if (v.error.tag === "Nothing") {
28468
- const $0 = toString2(monadEffect)(ASCII)(v.stdout);
28503
+ if (v.tag === "Right") {
28504
+ return () => {
28505
+ };
28506
+ }
28507
+ fail();
28508
+ };
28509
+ var bundleWebsite = (v) => exec2((v._2 ? "./node_modules/@explorable-viz/fluid/script/bundle-website.sh -w " : "./script/bundle-website.sh -w ") + (v._2 ? v._1 + " -l" : v._1 + ""))(copyOptions)((v1) => {
28510
+ if (v1.error.tag === "Just") {
28511
+ return log(showErrorImpl(v1.error._1));
28512
+ }
28513
+ if (v1.error.tag === "Nothing") {
28514
+ const $0 = toString2(monadEffect)(ASCII)(v1.stdout);
28469
28515
  return () => {
28470
28516
  const $1 = $0();
28471
28517
  return log($1)();
@@ -28477,19 +28523,9 @@ var dispatchCommand = (v) => {
28477
28523
  if (v.tag === "Evaluate") {
28478
28524
  return _bind(evaluate(v._1))((v1) => _liftEffect(log(intercalate4("\n")(removeDocWS(prettyVal(highlightableUnit).pretty(v1)).lines))));
28479
28525
  }
28480
- if (v.tag === "Publish") {
28526
+ if (v.tag === "BundleWebsite") {
28481
28527
  return _map((v$1) => {
28482
- })(_liftEffect(publish(v._1)(v._2)));
28483
- }
28484
- fail();
28485
- };
28486
- var callback = (v) => {
28487
- if (v.tag === "Left") {
28488
- return log(showErrorImpl(v._1));
28489
- }
28490
- if (v.tag === "Right") {
28491
- return () => {
28492
- };
28528
+ })(_liftEffect(bundleWebsite(v._1)));
28493
28529
  }
28494
28530
  fail();
28495
28531
  };
@@ -28536,7 +28572,7 @@ var parseDatasets = /* @__PURE__ */ $Parser(
28536
28572
  );
28537
28573
  })()))
28538
28574
  );
28539
- var program = /* @__PURE__ */ (() => $Parser(
28575
+ var parseEvaluate = /* @__PURE__ */ (() => $Parser(
28540
28576
  "MultP",
28541
28577
  $MultPE(
28542
28578
  $Parser(
@@ -28548,23 +28584,7 @@ var program = /* @__PURE__ */ (() => $Parser(
28548
28584
  $Parser(
28549
28585
  "MultP",
28550
28586
  $MultPE(
28551
- parserFunctor.map((v) => (v1) => (v2) => (v3) => (v4) => $Program({ library: v, imports: v1, datasets: v2, fileName: v3, prefix: v4 }))($Parser(
28552
- "AltP",
28553
- flag$p(true)((() => {
28554
- const $0 = help("Are you running fluid as a library?");
28555
- const $1 = $0._2._1.tag === "Nothing" ? Nothing : $0._2._1;
28556
- const $2 = $0._2._2.tag === "Nothing" ? Nothing : $0._2._2;
28557
- return $Mod(
28558
- (x) => $0._1({
28559
- flagNames: [$OptName("OptShort", "l"), $OptName("OptLong", "library"), ...x.flagNames],
28560
- flagActive: x.flagActive
28561
- }),
28562
- $DefaultProp($1.tag === "Nothing" ? Nothing : $1, $2.tag === "Nothing" ? Nothing : $2),
28563
- (x) => $0._3(x)
28564
- );
28565
- })()),
28566
- $Parser("NilP", false)
28567
- )),
28587
+ parserFunctor.map((v) => (v1) => (v2) => (v3) => (v4) => $EvalArgs({ local: v, imports: v1, datasets: v2, fileName: v3, fluidSrcPath: v4 }))(parseLocal),
28568
28588
  parserFunctor.map(fromFoldable29)(parseImports)
28569
28589
  )
28570
28590
  ),
@@ -28588,12 +28608,12 @@ var program = /* @__PURE__ */ (() => $Parser(
28588
28608
  )
28589
28609
  ),
28590
28610
  parserFunctor.map(Folder)(option(readerAsk)((() => {
28591
- const $0 = help("The prefix for the file");
28611
+ const $0 = help("The path containing the program files");
28592
28612
  const $1 = $0._2._1.tag === "Nothing" ? Nothing : $0._2._1;
28593
28613
  const $2 = $0._2._2.tag === "Nothing" ? Nothing : $0._2._2;
28594
28614
  return $Mod(
28595
28615
  (x) => $0._1({
28596
- optNames: [$OptName("OptShort", "p"), $OptName("OptLong", "prefix"), ...x.optNames],
28616
+ optNames: [$OptName("OptShort", "p"), $OptName("OptLong", "fluid-src-path"), ...x.optNames],
28597
28617
  optCompleter: x.optCompleter,
28598
28618
  optNoArgError: x.optNoArgError
28599
28619
  }),
@@ -28603,44 +28623,7 @@ var program = /* @__PURE__ */ (() => $Parser(
28603
28623
  })()))
28604
28624
  )
28605
28625
  ))();
28606
- var commands = /* @__PURE__ */ (() => ({
28607
- publish: $Parser(
28608
- "MultP",
28609
- $MultPE(
28610
- parserFunctor.map(Publish)(parserFunctor.map(Folder)(option(readerAsk)((() => {
28611
- const $0 = help("root directory of website under dist/");
28612
- const $1 = $0._2._2.tag === "Nothing" ? Nothing : $0._2._2;
28613
- return $Mod(
28614
- (x) => $0._1({
28615
- optNames: [$OptName("OptShort", "w"), $OptName("OptLong", "website"), ...x.optNames],
28616
- optCompleter: x.optCompleter,
28617
- optNoArgError: x.optNoArgError
28618
- }),
28619
- $DefaultProp($Maybe("Just", "Misc"), $1.tag === "Nothing" ? Nothing : $1),
28620
- (x) => $0._3(x)
28621
- );
28622
- })()))),
28623
- $Parser(
28624
- "AltP",
28625
- flag$p(true)(foldableArray.foldMap(modMonoid)(identity3)([
28626
- $Mod(
28627
- flagFieldsHasName.name($OptName("OptLong", "local")),
28628
- $DefaultProp(Nothing, Nothing),
28629
- identity26
28630
- ),
28631
- $Mod(
28632
- flagFieldsHasName.name($OptName("OptShort", "l")),
28633
- $DefaultProp(Nothing, Nothing),
28634
- identity26
28635
- ),
28636
- help("Are you publishing from source (false), or an npm package (true)?")
28637
- ])),
28638
- $Parser("NilP", false)
28639
- )
28640
- )
28641
- ),
28642
- evaluate: parserFunctor.map(Evaluate)(program)
28643
- }))();
28626
+ var commands = /* @__PURE__ */ (() => ({ bundleWebsite: parserFunctor.map(BundleWebsite)(parseBundleArgs), evaluate: parserFunctor.map(Evaluate)(parseEvaluate) }))();
28644
28627
  var commandParser = /* @__PURE__ */ subparser(/* @__PURE__ */ (() => {
28645
28628
  const $0 = command("evaluate")(progDesc("Evaluate a file")({
28646
28629
  infoParser: commands.evaluate,
@@ -28651,8 +28634,8 @@ var commandParser = /* @__PURE__ */ subparser(/* @__PURE__ */ (() => {
28651
28634
  infoFailureCode: $$Error,
28652
28635
  infoPolicy: Intersperse
28653
28636
  }));
28654
- const $1 = command("publish")(progDesc("Publish a file")({
28655
- infoParser: commands.publish,
28637
+ const $1 = command("bundle-website")(progDesc("Bundle a website to dist")({
28638
+ infoParser: commands.bundleWebsite,
28656
28639
  infoFullDesc: true,
28657
28640
  infoProgDesc: mempty12,
28658
28641
  infoHeader: mempty12,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@explorable-viz/fluid",
3
- "version": "0.7.86",
3
+ "version": "0.7.88",
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": {
@@ -3,10 +3,10 @@ set -xeu
3
3
 
4
4
  PREFIX=""
5
5
 
6
- while getopts "w:r" opt; do
6
+ while getopts "w:l" opt; do
7
7
  case $opt in
8
8
  w) WEBSITE="$OPTARG";;
9
- r) PREFIX=node_modules/@explorable-viz/fluid;;
9
+ l) PREFIX=node_modules/@explorable-viz/fluid;;
10
10
  esac
11
11
  done
12
12