Skip to content

Commit

Permalink
Bump all devDeps to latest versions
Browse files Browse the repository at this point in the history
Update version to 0.0.14.
Update CHANGELOG.md.
Add gh-pages.yml to deploy API docs to GH Pages and send code coverage to Codecov.
Add package.json and .yml entries to .editorconfig.
Remove dependencies badge and update build badge in README.md.
Change prebuild script to `npm run test:coverage`.
  • Loading branch information
fwextensions committed Feb 25, 2022
1 parent a8268a2 commit 2792c71
Show file tree
Hide file tree
Showing 6 changed files with 3,913 additions and 7,677 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,11 @@ indent_style = tab
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true

[*.yml]
indent_style = space
indent_size = 2

[package.json]
indent_style = space
indent_size = 2
40 changes: 40 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: GitHub Pages

on:
push:
branches:
- develop
pull_request:

jobs:
deploy:
runs-on: ubuntu-20.04
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up node
uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'npm'

- name: Install
run: npm ci

- name: Build docs
run: npm run build:docs

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs

- name: Run coverage
run: npm run test:coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [0.0.14](https://github.com/fwextensions/quick-score/releases/tag/v0.0.14) - 2022-02-24

### Fixed

- Update `devDependencies` to the latest versions.
- Add GitHub action to push docs to GitHub Pages and code coverage to Codecov.


## [0.0.13](https://github.com/fwextensions/quick-score/releases/tag/v0.0.13) - 2021-10-05

### Fixed
Expand All @@ -23,7 +31,7 @@
### Added

- Passing an empty array in the `keys` parameter will cause all of the keys on an item to be cached and searched, without having to specify each one.
- Paths to nested keys in the `keys` array can be specified as arrays of strings, instead of a dot-delimited path in a single string. Wrapping a single string in an array will cause any dots it contains to not be treated as a path.
- Paths to nested keys in the `keys` array can be specified as arrays of strings, instead of a dot-delimited path in a single string. Wrapping a single string in an array will cause any dots it contains to not be treated as a path.
- A new `sortKey` option can be used to specify on which key to sort identically-scored items, if a key other than the first one in `keys` is desired.
- A new `scoreValue` field is returned in the results from `search()`, which provides the string pointed to be `scoreKey`. This makes it easier to access the string when it's nested.

Expand Down Expand Up @@ -52,7 +60,7 @@
### Fixed

- Use the correct unpkg.com CDN URL in the readme.
- Highlight needing to access the methods through a global when loading the library via a `<script>` tag.
- Highlight needing to access the methods through a global when loading the library via a `<script>` tag.


## [0.0.7](https://github.com/fwextensions/quick-score/releases/tag/v0.0.7) - 2020-05-03
Expand Down
18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@

> `quick-score` is a JavaScript string-scoring and fuzzy-matching library based on the Quicksilver algorithm, designed for smart auto-complete.
[![Build Status][build-badge]][build]
[![Code Coverage][coverage-badge]][coverage]
[![Dependencies][dependencies-badge]][dependencies]
[![Build Status][build-badge]][build]
[![Minzip Size][size-badge]][size]
[![MIT License][license-badge]][license]
<!--[![Package][package-badge]][package]-->

QuickScore improves on the original Quicksilver algorithm by tuning the scoring for long strings, such as webpage titles or URLs, so that the order of the search results makes more sense. It's used by the [QuicKey extension for Chrome](https://chrome.google.com/webstore/detail/quickey-%E2%80%93-the-quick-tab-s/ldlghkoiihaelfnggonhjnfiabmaficg) to enable users to easily find an open tab via search.

Expand Down Expand Up @@ -35,7 +33,7 @@ Or you can load a particular release of the minified script directly from `unpkg
console.log(quickScore.quickScore("thought", "gh"));
</script>
```


## Usage

Expand Down Expand Up @@ -153,12 +151,12 @@ Each result item also has a `_` property, which caches transformed versions of t

### Ignoring diacritics and accents when scoring

If the strings you're matching against contain diacritics on some of the letters, like `à` or `ç`, you may want to count a match even when the query string contains the unaccented forms of those letters. The QuickScore library doesn't contain support for this by default, since it's only needed with certain strings and the code to remove accents would triple its size. But it's easy to combine QuickScore with other libraries to ignore diacritics.
If the strings you're matching against contain diacritics on some of the letters, like `à` or `ç`, you may want to count a match even when the query string contains the unaccented forms of those letters. The QuickScore library doesn't contain support for this by default, since it's only needed with certain strings and the code to remove accents would triple its size. But it's easy to combine QuickScore with other libraries to ignore diacritics.

One example is the [latinize](https://github.com/dundalek/latinize) [npm package](https://www.npmjs.com/package/latinize), which will strip accents from a string and can be used in a `transformString()` function that's passed as an option to the [QuickScore constructor](https://fwextensions.github.io/quick-score/QuickScore.html#QuickScore). This function takes a `string` parameter and returns a transformed version of that string:

```js
// including latinize.js on the page creates a global latinize() function
// including latinize.js on the page creates a global latinize() function
import {QuickScore} from "quick-score";

const items = ["Café", "Cafeteria"];
Expand Down Expand Up @@ -217,11 +215,11 @@ See the [API docs](https://fwextensions.github.io/quick-score/) for a full descr
[MIT](./LICENSE) © [John Dunning](https://github.com/fwextensions)


[build-badge]: https://img.shields.io/travis/com/fwextensions/quick-score.svg?style=flat-square
[build]: https://travis-ci.com/fwextensions/quick-score
[coverage-badge]: https://img.shields.io/codecov/c/github/fwextensions/quick-score.svg?style=flat-square
[build-badge]: https://github.com/fwextensions/quick-score/actions/workflows/gh-pages.yml/badge.svg?style=flat-square
[build]: https://github.com/fwextensions/quick-score/actions/workflows/gh-pages.yml
[coverage-badge]: https://img.shields.io/codecov/c/github/fwextensions/quick-score.svg?style=flat-square
[coverage]: https://codecov.io/gh/fwextensions/quick-score
[dependencies-badge]: https://img.shields.io/david/fwextensions/quick-score.svg?style=flat-square
[dependencies-badge]: https://img.shields.io/hackage-deps/v/quick-score?style=flat-square
[dependencies]: https://www.npmjs.com/package/quick-score
[license-badge]: https://img.shields.io/npm/l/quick-score.svg?style=flat-square
[license]: https://github.com/fwextensions/quick-score/blob/master/LICENSE
Expand Down
Loading

0 comments on commit 2792c71

Please sign in to comment.