Skip to content

Commit

Permalink
feat(Filterion): Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
maxprilutskiy committed Apr 3, 2020
0 parents commit 42a5438
Show file tree
Hide file tree
Showing 19 changed files with 8,275 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# EditorConfig configuration
# http://editorconfig.org
#

root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
build
coverage
assets
22 changes: 22 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = {
root: true,
env: {
node: true,
browser: true,
jest: true,
},
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'jest'],
extends: [
'eslint:recommended',
'plugin:jest/recommended',

'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/eslint-recommended',
],
rules: {
quotes: ['error', 'single'],
'no-multiple-empty-lines': ['error', { max: 1 }],
'no-multi-spaces': ['error']
},
};
62 changes: 62 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
build/

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next
13 changes: 13 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"branches": [
"master"
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/git",
"@semantic-release/github",
"@semantic-release/npm",
]
}
26 changes: 26 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
language: node_js
node_js:
- 12.16.1

branches:
only:
- master

install:
- yarn

script:
- yarn lint
- yarn test --coverage
- bash <(curl -s https://codecov.io/bash)
- yarn build

deploy:
- provider: script
script: yarn semantic-release
skip_cleanup: true
on:
branch: master

cache:
yarn: true
Empty file added CHANGELOG.md
Empty file.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 Max Prilutskiy

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<p align="center">
<img width="200" src="/assets/logo.svg?sanitize=true">
</p>

<h1 align="center">
Filterion

[![Build Status](https://travis-ci.com/prilutskiy/filterion.svg?branch=master)](https://travis-ci.com/prilutskiy/filterion)
[![codecov](https://codecov.io/gh/prilutskiy/filterion/branch/master/graph/badge.svg)](https://codecov.io/gh/prilutskiy/filterion)
[![CodeFactor](https://www.codefactor.io/repository/github/prilutskiy/filterion/badge)](https://www.codefactor.io/repository/github/prilutskiy/filterion)

</h1>

<div align="center">
Immutable data structure for filter criteria management.

</div>

## Install

Install `filterion` using yarn or npm:

```bash
$ yarn add filterion
# or
$ npm i filterion
```

Then require it into any module:

```javascript
import { Filterion } from 'filterion';

const filter = new Filterion()
.add('device', 'iPhone')
.add('price', 100, '>')
.add('price', 200, '<');

console.log(filter.payload);

/*
{
device: { '=': [ 'iPhone' ] },
price: { '>': [ 100 ], '<': [ 200 ] }
}
*/
```
1 change: 1 addition & 0 deletions assets/logo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json"
],
"transform": {
"^.+\\.(ts|tsx)$": "ts-jest"
},
"testMatch": [
"**/*.spec.(ts|tsx)"
]
}
39 changes: 39 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "filterion",
"version": "0.0.0",
"description": "Data structure for filter criteria management",
"main": "build/index.js",
"types": "build/index.d.ts",
"repository": "https://github.com/prilutskiy/filterion",
"author": "Max Prilutskiy",
"license": "MIT",
"private": false,
"devDependencies": {
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/commit-analyzer": "^8.0.1",
"@semantic-release/git": "^9.0.0",
"@semantic-release/github": "^7.0.5",
"@semantic-release/npm": "^7.0.5",
"@semantic-release/release-notes-generator": "^9.0.1",
"@types/jest": "^25.1.5",
"@typescript-eslint/eslint-plugin": "^2.24.0",
"@typescript-eslint/parser": "^2.26.0",
"eslint": "^6.8.0",
"eslint-plugin-jest": "^23.8.2",
"jest": "^25.2.6",
"semantic-release": "^17.0.4",
"ts-jest": "^25.3.0",
"typescript": "^3.8.3"
},
"dependencies": {},
"scripts": {
"purge": "rm -rf node_modules",
"clean": "rm -rf build coverage",
"build": "tsc",
"test": "jest",
"lint": "eslint . --ext .js,.ts"
},
"files": [
"build"
]
}

0 comments on commit 42a5438

Please sign in to comment.