diff --git a/.travis.yml b/.travis.yml index eaff4d5..4febb76 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,10 +23,10 @@ install: - spago install script: -- spago build -- spago test -- spago docs - npm run build +- npm test +# Check if it the app is able to build the search index for itself. +- spago docs - ./dist/purescript-docs-search build-index deploy: diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..9af155e --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,22 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.0.4] - 2019-07-25 + +New features: +- Reduce the package size by using a minifier. +- Add `version` command to print the app version. +- **S** hotkey now `.select()`s everything in the search field, insetead of just `.focus()`ing (#11). + +## [0.0.3] - 2019-07-23 + +Bugfixes: +- Fix stack safety issue (#8). + +## [0.0.2] - 2019-07-21 + +## [0.0.1] - 2019-07-20 diff --git a/package.json b/package.json index 89f1c9b..ebf2061 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,7 @@ { "name": "purescript-docs-search", - "version": "0.0.3", + "version": "0.0.4", "description": "Search frontend for the documentation generated by the PureScript compiler.", - "main": "dist/main.js", "directories": { "test": "test" }, @@ -10,9 +9,10 @@ "purescript-docs-search": "dist/purescript-docs-search" }, "files": [ - "dist/main.js", + "dist/purescript-docs-search", "dist/docs-search-app.js", - "README.md" + "README.md", + "CHANGELOG.md" ], "scripts": { "test": "spago test", @@ -25,7 +25,9 @@ "chmod-main": "chmod +x dist/purescript-docs-search", "build-main": "npm run bundle-main && npm run parcel-main && npm run add-shebang && rm dist/main.js && npm run chmod-main", "build": "npm run build-app && npm run build-main", - "clean": "rm -rf dist" + "clean": "rm -rf dist", + "check-version": "[ \"$(./dist/purescript-docs-search version)\" = \"$npm_package_version\" ]", + "test": "spago test && npm run check-version" }, "repository": { "type": "git", diff --git a/src/Docs/Search/Main.purs b/src/Docs/Search/Main.purs index abe61be..6204589 100644 --- a/src/Docs/Search/Main.purs +++ b/src/Docs/Search/Main.purs @@ -12,6 +12,7 @@ import Data.List.NonEmpty as NonEmpty import Data.Maybe (Maybe, fromMaybe, optional) import Data.Unfoldable (class Unfoldable) import Effect (Effect) +import Effect.Console (log) import Options.Applicative (Parser, command, execParser, fullDesc, helper, info, long, metavar, progDesc, strOption, subparser, value, (<**>)) import Options.Applicative as CA @@ -24,6 +25,7 @@ main = do case fromMaybe defaultCommands args of BuildIndex cfg -> IndexBuilder.run cfg Search cfg -> Interactive.run cfg + Version -> log "0.0.4" getArgs :: Effect (Maybe Commands) getArgs = execParser opts @@ -39,6 +41,7 @@ data Commands , generatedDocs :: String } | Search { docsFiles :: Array String } + | Version derive instance genericCommands :: Generic Commands _ @@ -57,6 +60,11 @@ commands = optional $ subparser ( progDesc "Run the search engine." ) ) + <> command "version" + ( info (pure Version) + ( progDesc "Show purescript-docs-search version." + ) + ) ) buildIndex :: Parser Commands