@@ -405,6 +405,15 @@ bundleModule maybeModuleName maybeTargetPath noBuild buildOpts usePsa = do
405
405
DoBuild -> Run. withBuildEnv usePsa buildOpts $ build (Just bundleAction)
406
406
NoBuild -> Run. getEnv >>= (flip runRIO) bundleAction
407
407
408
+ docsSearchTemplate :: (HasType LogFunc env , HasType PursCmd env ) => RIO env Text
409
+ docsSearchTemplate = ifM (Purs. hasMinPursVersion " 0.14.0" )
410
+ (pure Templates. docsSearch0011)
411
+ (pure Templates. docsSearch0010)
412
+
413
+ docsSearchAppTemplate :: (HasType LogFunc env , HasType PursCmd env ) => RIO env Text
414
+ docsSearchAppTemplate = ifM (Purs. hasMinPursVersion " 0.14.0" )
415
+ (pure Templates. docsSearchApp0011)
416
+ (pure Templates. docsSearchApp0010)
408
417
409
418
-- | Generate docs for the `sourcePaths` and run `purescript-docs-search build-index` to patch them.
410
419
docs
@@ -424,8 +433,8 @@ docs format noSearch open = do
424
433
when isHTMLFormat $ do
425
434
when (noSearch == AddSearch ) $ do
426
435
logInfo " Making the documentation searchable..."
427
- writeTextFile " .spago/purescript-docs-search" Templates. docsSearch
428
- writeTextFile " .spago/docs-search-app.js" Templates. docsSearchApp
436
+ writeTextFile " .spago/purescript-docs-search" =<< docsSearchTemplate
437
+ writeTextFile " .spago/docs-search-app.js" =<< docsSearchAppTemplate
429
438
let cmd = " node .spago/purescript-docs-search build-index --package-name " <> surroundQuote name
430
439
logDebug $ " Running `" <> display cmd <> " `"
431
440
shell cmd empty >>= \ case
@@ -463,7 +472,7 @@ search = do
463
472
, PursArg " docs"
464
473
]
465
474
466
- writeTextFile " .spago/purescript-docs-search" Templates. docsSearch
475
+ writeTextFile " .spago/purescript-docs-search" =<< docsSearchTemplate
467
476
let cmd = " node .spago/purescript-docs-search search --package-name " <> surroundQuote name
468
477
logDebug $ " Running `" <> display cmd <> " `"
469
478
viewShell $ callCommand $ Text. unpack cmd
0 commit comments