@explorable-viz/fluid 0.7.25 → 0.7.28

Sign up to get free protection for your applications and to get access to all the features.
@@ -25986,6 +25986,7 @@ var mkCommand = (m) => {
25986
25986
  const $0 = v.cmdCommands;
25987
25987
  return $Tuple(v.cmdGroup, $Tuple(arrayMap(fst)($0), $Tuple((v1) => lookup4(v1)($0), void 0)));
25988
25988
  };
25989
+ var flagFieldsHasName = { name: (n) => (fields) => ({ flagNames: [n, ...fields.flagNames], flagActive: fields.flagActive }) };
25989
25990
  var modSemigroup = {
25990
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)))
25991
25992
  };
@@ -28364,6 +28365,41 @@ var graphEval2 = /* @__PURE__ */ graphEval(monadErrorAff);
28364
28365
  var fromFoldable29 = /* @__PURE__ */ (() => fromFoldableImpl(foldableList.foldr))();
28365
28366
  var Evaluate = (value0) => $Command("Evaluate", value0);
28366
28367
  var Publish = (value0) => (value1) => $Command("Publish", value0, value1);
28368
+ var publish = /* @__PURE__ */ (() => $Parser(
28369
+ "MultP",
28370
+ $MultPE(
28371
+ parserFunctor.map(Publish)(parserFunctor.map(Folder)(option(readerAsk)((() => {
28372
+ const $0 = help("root directory of website under dist/");
28373
+ const $1 = $0._2._2.tag === "Nothing" ? Nothing : $0._2._2;
28374
+ return $Mod(
28375
+ (x) => $0._1({
28376
+ optNames: [$OptName("OptShort", "w"), $OptName("OptLong", "website"), ...x.optNames],
28377
+ optCompleter: x.optCompleter,
28378
+ optNoArgError: x.optNoArgError
28379
+ }),
28380
+ $DefaultProp($Maybe("Just", "Misc"), $1.tag === "Nothing" ? Nothing : $1),
28381
+ (x) => $0._3(x)
28382
+ );
28383
+ })()))),
28384
+ $Parser(
28385
+ "AltP",
28386
+ flag$p(true)(foldableArray.foldMap(modMonoid)(identity3)([
28387
+ $Mod(
28388
+ flagFieldsHasName.name($OptName("OptLong", "local")),
28389
+ $DefaultProp(Nothing, Nothing),
28390
+ identity26
28391
+ ),
28392
+ $Mod(
28393
+ flagFieldsHasName.name($OptName("OptShort", "l")),
28394
+ $DefaultProp(Nothing, Nothing),
28395
+ identity26
28396
+ ),
28397
+ help("Are you publishing from source (false), or an npm package (true)?")
28398
+ ])),
28399
+ $Parser("NilP", false)
28400
+ )
28401
+ )
28402
+ ))();
28367
28403
  var parseImports = /* @__PURE__ */ $Parser(
28368
28404
  "BindP",
28369
28405
  /* @__PURE__ */ manyM(/* @__PURE__ */ option(readerAsk)(/* @__PURE__ */ (() => {
@@ -28400,7 +28436,7 @@ var copyOptions = {
28400
28436
  encoding: Nothing,
28401
28437
  shell: Nothing
28402
28438
  };
28403
- var copyFiles = (website) => exec2("./node_modules/@explorable-viz/fluidscript/bundle-website.sh -w" + website + " -r true")(copyOptions)((v) => {
28439
+ var copyFiles = (website) => (b) => exec2(b ? "./node_modules/@explorable-viz/fluid/script/bundle-website.sh -w " + website + " -r true" : "./script/bundle-website.sh -w " + website)(copyOptions)((v) => {
28404
28440
  if (v.error.tag === "Just") {
28405
28441
  return log(showErrorImpl(v.error._1));
28406
28442
  }
@@ -28415,11 +28451,11 @@ var copyFiles = (website) => exec2("./node_modules/@explorable-viz/fluidscript/b
28415
28451
  });
28416
28452
  var dispatchCommand = (v) => {
28417
28453
  if (v.tag === "Evaluate") {
28418
- return output(v._1);
28454
+ return _map((v$1) => {
28455
+ })(output(v._1));
28419
28456
  }
28420
28457
  if (v.tag === "Publish") {
28421
- const $0 = v._1;
28422
- return _bind(_liftEffect(copyFiles(v._2)))(() => _bind(_liftEffect(log("Published")))(() => output($0)));
28458
+ return _bind(_liftEffect(copyFiles(v._1)(v._2)))(() => _liftEffect(log("Published")));
28423
28459
  }
28424
28460
  fail();
28425
28461
  };
@@ -28428,7 +28464,7 @@ var callback = (v) => {
28428
28464
  return log(showErrorImpl(v._1));
28429
28465
  }
28430
28466
  if (v.tag === "Right") {
28431
- return log(intercalate4("\n")(removeDocWS(prettyVal(highlightableUnit).pretty(v._1)).lines));
28467
+ return log("Success");
28432
28468
  }
28433
28469
  fail();
28434
28470
  };
@@ -28515,25 +28551,6 @@ var program = /* @__PURE__ */ (() => $Parser(
28515
28551
  })())
28516
28552
  )
28517
28553
  ))();
28518
- var publish = /* @__PURE__ */ (() => $Parser(
28519
- "MultP",
28520
- $MultPE(
28521
- parserFunctor.map(Publish)(program),
28522
- parserFunctor.map(Folder)(option(readerAsk)((() => {
28523
- const $0 = help("root directory of website under dist/");
28524
- const $1 = $0._2._2.tag === "Nothing" ? Nothing : $0._2._2;
28525
- return $Mod(
28526
- (x) => $0._1({
28527
- optNames: [$OptName("OptShort", "w"), $OptName("OptLong", "website"), ...x.optNames],
28528
- optCompleter: x.optCompleter,
28529
- optNoArgError: x.optNoArgError
28530
- }),
28531
- $DefaultProp($Maybe("Just", "Misc"), $1.tag === "Nothing" ? Nothing : $1),
28532
- (x) => $0._3(x)
28533
- );
28534
- })()))
28535
- )
28536
- ))();
28537
28554
  var commandParser = /* @__PURE__ */ subparser(/* @__PURE__ */ (() => {
28538
28555
  const $0 = command("evaluate")(progDesc("Evaluate a file")({
28539
28556
  infoParser: parserFunctor.map(Evaluate)(program),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@explorable-viz/fluid",
3
- "version": "0.7.25",
3
+ "version": "0.7.28",
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": {
@@ -21,7 +21,7 @@
21
21
  "dist/fluid/",
22
22
  "script/bundle-website.sh",
23
23
  "script/util/clean.sh",
24
- "script/util/lisp_case.sh"
24
+ "script/util/lisp-case.sh"
25
25
  ],
26
26
  "scripts": {
27
27
  "tidy": "./script/tidy.sh",
@@ -27,6 +27,11 @@ SRC_PATH=${WEBSITE//./\/}
27
27
  SRC_PATH_LISP_CASE=$($LISP_CASE "$SRC_PATH")
28
28
  echo "$SRC_PATH -> $SRC_PATH_LISP_CASE"
29
29
 
30
+ if [[ -e "website/$SRC_PATH.html" ]]; then
31
+ $CLEAN $SRC_PATH_LISP_CASE
32
+ cp website/$SRC_PATH.html dist/$SRC_PATH_LISP_CASE/index.html
33
+ fi
34
+
30
35
  shopt -s nullglob
31
36
 
32
37
  set +x
@@ -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"