Skip to content

Commit ce23a66

Browse files
committed
Add help texts for all options, bump version
1 parent d5db431 commit ce23a66

File tree

7 files changed

+33
-11
lines changed

7 files changed

+33
-11
lines changed

.github/workflows/build.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
- uses: actions/setup-node@v2
1414
with:
15-
node-version: "14"
15+
node-version: "18"
1616

1717
- uses: purescript-contrib/setup-purescript@main
1818

@@ -41,4 +41,4 @@ jobs:
4141
npm run build
4242
npm test
4343
spago docs --no-search
44-
./dist/purescript-docs-search build-index
44+
./dist/purescript-docs-search.cjs build-index

.github/workflows/release.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111

1212
- uses: actions/setup-node@v2
1313
with:
14-
node-version: "14"
14+
node-version: "18"
1515

1616
- uses: purescript-contrib/setup-purescript@main
1717

@@ -41,7 +41,7 @@ jobs:
4141
with:
4242
files: |
4343
dist/docs-search-app.js
44-
dist/purescript-docs-search
44+
dist/purescript-docs-search.cjs
4545
env:
4646
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4747

@@ -52,4 +52,4 @@ jobs:
5252
run: |
5353
mv ci-npmrc.txt .npmrc
5454
npm ci
55-
npm publish --non-interactive --access public
55+
npm publish --non-interactive --access public

CHANGELOG.md

+13
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.0.12 - 2022-08-31]
9+
10+
Changes:
11+
- Package structure change: `dist/purescript-docs-search.cjs` has been moved to `dist/purescript-docs-search.cjs` due to NodeJS restrictions for `type: module` packages.
12+
13+
New features:
14+
- Docs for each CLI option
15+
- New `--source-files` option that allows to specify `.purs` sources (see below)
16+
17+
Bugfixes:
18+
- Include modules with only re-exports in the module list ([#62](https://github.com/purescript/purescript-docs-search/issues/62))
19+
- Fix `docs.json` parser for some types
20+
821
## [0.0.11 - 2021-04-15]
922

1023
Changes:

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "purescript-docs-search",
33
"type": "module",
4-
"version": "0.0.11",
4+
"version": "0.0.12",
55
"description": "Search frontend for the documentation generated by the PureScript compiler.",
66
"directories": {
77
"test": "test"

src/Docs/Search/Config.purs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Prelude
77
import Data.Newtype (wrap)
88

99
version :: String
10-
version = "0.0.11"
10+
version = "0.0.12"
1111

1212
mkShapeScriptPath :: String -> String
1313
mkShapeScriptPath shape = "./index/types/" <> shape <> ".js"

src/Docs/Search/IndexBuilder.purs

+4
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@ decodeDocsJsons cfg@{ docsFiles } = do
192192
parseModuleHeaders :: Array String -> Aff (Array ModuleName)
193193
parseModuleHeaders globs = do
194194
files <- getPathsByGlobs globs
195+
196+
-- we are not checking if the globs match at least one file, because
197+
-- we want to support scenarios where there is no "current project"
198+
195199
concat <$> for files \filePath -> do
196200
fileContents <- readTextFile UTF8 filePath
197201
case parseModuleName fileContents of

src/Docs/Search/Main.purs

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
-- | The main module of the CLI interface app.
22
module Docs.Search.Main where
33

4-
import Prelude
5-
4+
import Docs.Search.Config as Config
65
import Docs.Search.IndexBuilder as IndexBuilder
76
import Docs.Search.Interactive as Interactive
8-
import Docs.Search.Config as Config
97
import Docs.Search.Types (PackageName(..))
108

9+
import Prelude
10+
1111
import Data.Generic.Rep (class Generic)
12-
import Data.Show.Generic (genericShow)
1312
import Data.List as List
1413
import Data.List.NonEmpty as NonEmpty
1514
import Data.Maybe (Maybe, fromMaybe, optional)
1615
import Data.Newtype (unwrap)
16+
import Data.Show.Generic (genericShow)
1717
import Data.Unfoldable (class Unfoldable)
1818
import Effect (Effect)
1919
import Effect.Console (log)
@@ -85,6 +85,7 @@ buildIndex = ado
8585
( long "generated-docs"
8686
<> metavar "DIR"
8787
<> value "./generated-docs/"
88+
<> help "Path to the generated documentation HTML that will be patched. Search app will be injected into each HTML document."
8889
)
8990
noPatch <- flag false true
9091
( long "no-patch"
@@ -108,6 +109,7 @@ docsFilesOption = fromMaybe defaultDocsFiles <$>
108109
( strOption
109110
( long "docs-files"
110111
<> metavar "GLOB"
112+
<> help "Glob that captures `docs.json` files that should be used to build the index"
111113
)
112114
)
113115
)
@@ -119,6 +121,7 @@ bowerFilesOption = fromMaybe defaultBowerFiles <$>
119121
( strOption
120122
( long "bower-jsons"
121123
<> metavar "GLOB"
124+
<> help "Glob that captures `bower.json` files. These files are used to build dependency trees to compute package popularity scores based on how many dependants a package has."
122125
)
123126
)
124127
)
@@ -129,6 +132,7 @@ packageNameOption =
129132
( long "package-name"
130133
<> metavar "PACKAGE"
131134
<> value (unwrap Config.defaultPackageName)
135+
<> help "Local package name as it should appear in the search results"
132136
)
133137

134138
sourceFilesOption :: Parser (Array String)
@@ -138,6 +142,7 @@ sourceFilesOption = fromMaybe defaultSourceFiles <$>
138142
( strOption
139143
( long "source-files"
140144
<> metavar "GLOB"
145+
<> help "Path to project source files, used for more precise module indexing (see #62). Default: src/**/*.purs"
141146
)
142147
)
143148
)

0 commit comments

Comments
 (0)