From 52d93e7e0709171920740c602afb8c33c83adc97 Mon Sep 17 00:00:00 2001 From: "Kent C. Dodds" Date: Mon, 7 May 2018 14:59:57 -0600 Subject: [PATCH] chore: fix scripts setup. WAT --- .github/ISSUE_TEMPLATE.md | 11 +++------ .github/PULL_REQUEST_TEMPLATE.md | 15 ++++++++---- .travis.yml | 4 +--- CONTRIBUTING.md | 10 ++++---- README.md | 41 +++++++++++++++----------------- other/CODE_OF_CONDUCT.md | 2 +- other/EXAMPLES.md | 4 ++-- other/ROADMAP.md | 6 ++--- other/__tests__/dist-test.js | 34 +++++++++++++------------- package.json | 5 ++-- 10 files changed, 64 insertions(+), 68 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 90c8cd0..f3fc4a0 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -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: @@ -38,6 +35,4 @@ minimal amount of code possible. Problem description: - - Suggested solution: diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index e421002..aa0dc2b 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -15,21 +15,28 @@ merge of your pull request! --> + **What**: + **Why**: + **How**: + **Checklist**: + + -- [ ] Documentation -- [ ] Tests -- [ ] Ready to be merged -- [ ] Added myself to contributors table + +* [ ] Documentation +* [ ] Tests +* [ ] Ready to be merged +* [ ] Added myself to contributors table diff --git a/.travis.yml b/.travis.yml index ba01b79..08be7ec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 447a9d9..c372813 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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: diff --git a/README.md b/README.md index 2106678..69869e3 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,3 @@ - - - - -* [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) - - -

match-sorter

@@ -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! + + + + +* [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) + + + ## Getting Started ### Installation diff --git a/other/CODE_OF_CONDUCT.md b/other/CODE_OF_CONDUCT.md index e724218..afe2432 100644 --- a/other/CODE_OF_CONDUCT.md +++ b/other/CODE_OF_CONDUCT.md @@ -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 diff --git a/other/EXAMPLES.md b/other/EXAMPLES.md index 785e7b2..020e6d5 100644 --- a/other/EXAMPLES.md +++ b/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) diff --git a/other/ROADMAP.md b/other/ROADMAP.md index 141a6cb..45f051d 100644 --- a/other/ROADMAP.md +++ b/other/ROADMAP.md @@ -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 diff --git a/other/__tests__/dist-test.js b/other/__tests__/dist-test.js index 2d606aa..7ed6385 100644 --- a/other/__tests__/dist-test.js +++ b/other/__tests__/dist-test.js @@ -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') { diff --git a/package.json b/package.json index 873f3b7..09ead17 100644 --- a/package.json +++ b/package.json @@ -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"], @@ -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"]