Skip to content

Commit

Permalink
chore: fix scripts setup. WAT
Browse files Browse the repository at this point in the history
  • Loading branch information
Kent C. Dodds committed May 7, 2018
1 parent 486549f commit 52d93e7
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 68 deletions.
11 changes: 3 additions & 8 deletions .github/ISSUE_TEMPLATE.md
Expand Up @@ -11,20 +11,17 @@ never done that before, that's great! Check this free short video tutorial to
learn how: http://kcd.im/pull-request
-->

- `match-sorter` version:
- `node` version:
- `npm` (or `yarn`) version:
* `match-sorter` version:
* `node` version:
* `npm` (or `yarn`) version:

Relevant code or config

```javascript

```

What you did:



What happened:

<!-- Please provide the full error message/screenshots/anything -->
Expand All @@ -38,6 +35,4 @@ minimal amount of code possible.

Problem description:



Suggested solution:
15 changes: 11 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Expand Up @@ -15,21 +15,28 @@ merge of your pull request!
-->

<!-- What changes are being made? (What feature/bug is being fixed here?) -->

**What**:

<!-- Why are these changes necessary? -->

**Why**:

<!-- How were these changes implemented? -->

**How**:

<!-- Have you done all of these things? -->

**Checklist**:

<!-- add "N/A" to the end of each line that's irrelevant to your changes -->

<!-- to check an item, place an "x" in the box like so: "- [x] Documentation" -->
- [ ] Documentation
- [ ] Tests
- [ ] Ready to be merged <!-- In your opinion, is this ready to be merged as soon as it's reviewed? -->
- [ ] Added myself to contributors table <!-- this is optional, see the contributing guidelines for instructions -->

* [ ] Documentation
* [ ] Tests
* [ ] Ready to be merged <!-- In your opinion, is this ready to be merged as soon as it's reviewed? -->
* [ ] Added myself to contributors table <!-- this is optional, see the contributing guidelines for instructions -->

<!-- feel free to add additional comments -->
4 changes: 1 addition & 3 deletions .travis.yml
Expand Up @@ -8,8 +8,6 @@ notifications:
node_js: '8'
install: npm install
script: npm run validate
after_success:
- npx codecov
- npx -p semantic-release@7 -c "semantic-release pre && npm publish && semantic-release post"
after_success: kcd-scripts travis-after-success
branches:
only: master
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Expand Up @@ -2,15 +2,15 @@

Thanks for being willing to contribute!

**Working on your first Pull Request?** You can learn how from this *free* series
**Working on your first Pull Request?** You can learn how from this _free_ series
[How to Contribute to an Open Source Project on GitHub][egghead]

## Project setup

1. Fork and clone the repo
2. `$ npm install` to install dependencies
3. `$ npm run validate` to validate you've got it working
4. Create a branch for your PR
1. Fork and clone the repo
2. `$ npm install` to install dependencies
3. `$ npm run validate` to validate you've got it working
4. Create a branch for your PR

> Tip: Keep your `master` branch pointing at the original repository and make
> pull requests from branches on your fork. To do this, run:
Expand Down
41 changes: 19 additions & 22 deletions README.md
@@ -1,25 +1,3 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->

<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

* [match-sorter](#match-sorter)
* [The problem](#the-problem)
* [This solution](#this-solution)
* [Getting Started](#getting-started)
* [Installation](#installation)
* [Usage](#usage)
* [Advanced options](#advanced-options)
* [keys: `[string]`](#keys-string)
* [threshold: `number`](#threshold-number)
* [keepDiacritics: `boolean`](#keepdiacritics-boolean)
* [Using ES6?](#using-es6)
* [Inspiration](#inspiration)
* [Other Solutions](#other-solutions)
* [Contributors](#contributors)
* [LICENSE](#license)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

<div align="center">
<h1>match-sorter</h1>

Expand Down Expand Up @@ -75,6 +53,25 @@ To explain the ranking system, I'll use countries as an example:

This ranking seems to make sense in people's minds. At least it does in mine. Feedback welcome!

<!-- START doctoc generated TOC please keep comment here to allow auto update -->

<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

* [Getting Started](#getting-started)
* [Installation](#installation)
* [Usage](#usage)
* [Advanced options](#advanced-options)
* [keys: `[string]`](#keys-string)
* [threshold: `number`](#threshold-number)
* [keepDiacritics: `boolean`](#keepdiacritics-boolean)
* [Using ES6?](#using-es6)
* [Inspiration](#inspiration)
* [Other Solutions](#other-solutions)
* [Contributors](#contributors)
* [LICENSE](#license)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## Getting Started

### Installation
Expand Down
2 changes: 1 addition & 1 deletion other/CODE_OF_CONDUCT.md
Expand Up @@ -23,7 +23,7 @@ include:
Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
Expand Down
4 changes: 2 additions & 2 deletions other/EXAMPLES.md
@@ -1,4 +1,4 @@
# Examples

- [With React-Select](https://jsbin.com/vewoka/edit?js,output)
- [Basic example](https://jsbin.com/bihepe/edit?html,js,console)
* [With React-Select](https://jsbin.com/vewoka/edit?js,output)
* [Basic example](https://jsbin.com/bihepe/edit?html,js,console)
6 changes: 3 additions & 3 deletions other/ROADMAP.md
Expand Up @@ -2,12 +2,12 @@

## Want to do

- Implement possibility to get highlights for matched items. Something like https://github.com/moroshko/autosuggest-highlight#match
* Implement possibility to get highlights for matched items. Something like https://github.com/moroshko/autosuggest-highlight#match

## Might do

- Perf optimizations. Definitely some optimizations that could be made, but are they worth it? I'd like to get some benchmarks running!
* Perf optimizations. Definitely some optimizations that could be made, but are they worth it? I'd like to get some benchmarks running!

## Wont do

- Harm
* Harm
34 changes: 16 additions & 18 deletions other/__tests__/dist-test.js
Expand Up @@ -9,29 +9,27 @@
*/
import assert from 'assert'

import cjsImport, {rankings as cjsRankings} from '../dist/cjs'
import umdImport, {rankings as umdRankings} from '../dist/umd/match-sorter'
import cjsImport, {rankings as cjsRankings} from '../../dist/match-sorter.cjs'
import umdImport, {rankings as umdRankings} from '../../dist/match-sorter.umd'

const cjsRequire = require('../dist/cjs')
const umdRequire = require('../dist/umd/match-sorter')
const cjsRequire = require('../../dist/match-sorter.cjs')
const umdRequire = require('../../dist/match-sorter.umd')

assert(
isMatchSorterFunction(cjsImport) && isRankingsObject(cjsRankings),
'CJS build has a problem with ES6 modules',
)
test('built version works', () => {
assert(
isMatchSorterFunction(cjsImport) && isRankingsObject(cjsRankings),
'CJS build has a problem with ES6 modules',
)

assert(isMatchSorterFunction(cjsRequire), 'CJS build has a problem with CJS')
assert(isMatchSorterFunction(cjsRequire), 'CJS build has a problem with CJS')

assert(
isMatchSorterFunction(umdImport) && isRankingsObject(umdRankings),
'UMD build has a problem with ES6 modules',
)
assert(
isMatchSorterFunction(umdImport) && isRankingsObject(umdRankings),
'UMD build has a problem with ES6 modules',
)

assert(isMatchSorterFunction(umdRequire), 'UMD build has a problem with CJS')

// TODO: how could we validate the AMD/global modules?

console.log('Built modules look good 👍')
assert(isMatchSorterFunction(umdRequire), 'UMD build has a problem with CJS')
})

function isMatchSorterFunction(thing) {
if (typeof thing !== 'function') {
Expand Down
5 changes: 3 additions & 2 deletions package.json
Expand Up @@ -15,7 +15,8 @@
"test:update": "npm run test:cover -s -- --updateSnapshot",
"test:build": "kcd-scripts test --config other/jest.config.js --no-watch",
"build-and-test": "npm run build -s && npm run test:build -s",
"validate": "kcd-scripts validate lint,build-and-test,test:cover,test:ts",
"validate": "kcd-scripts validate lint,build-and-test,test:cover",
"setup": "npm install && npm run validate",
"precommit": "kcd-scripts precommit"
},
"files": ["dist"],
Expand All @@ -33,7 +34,7 @@
"diacritic": "0.0.2"
},
"devDependencies": {
"kcd-scripts": "^0.37.0"
"kcd-scripts": "^0.38.1"
},
"eslintConfig": {
"extends": ["./node_modules/kcd-scripts/eslint.js"]
Expand Down

0 comments on commit 52d93e7

Please sign in to comment.