Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new package trello #37

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 44 additions & 1 deletion packages/core/src/statements/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,50 @@ import _ from 'lodash';
import Validator from 'validatorjs';

/**
* Take `Object` and throw the same object if all rules pass
* From a `Object`, throw the same object if all rules pass
*
* Input file:
*
* ```json
* [{
* a: 1,
* b: 'titi',
* },
* {
* a: 2,
* b: 'toto',
* },
* {
* a: false,
* },
* ]
* ```
*
* Script:
*
* ```ini
* [validate]
* path = a
* rule = required|number
*
* path = a
* rule = required|string
*
* ```
*
* Output:
*
* ```json
* [{
* a: 1,
* b: 'titi',
* },
* {
* a: 2,
* b: 'toto',
* },
* }]
* ```
*
* @name validate
* @param {String} [path] path of the field
Expand Down
16 changes: 16 additions & 0 deletions packages/trello/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"parser": "babel-eslint",
"env": {
"browser": true,
"mocha": true,
"node": true
},
"extends": "airbnb-base",
"rules": {
"indent": ["error", 4],
"max-len": ["error", {"code": 120, "tabWidth": 4, "ignoreUrls": true}],
"no-underscore-dangle": ["error", { "allow": ["_id"] }],
"import/no-extraneous-dependencies": "off",
"no-param-reassign": ["error", { "props": false }]
}
}
11 changes: 11 additions & 0 deletions packages/trello/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
*.tgz
*.swp
*.swo
README.html
node_modules
coverage/
*.sw?
lib
benchmark
.nyc_output/
examples/
6 changes: 6 additions & 0 deletions packages/trello/.local.vimrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
" https://github.com/thinca/vim-localrc/blob/master/doc/localrc.txt
set formatoptions+=tl
set expandtab
set tabstop=4
set softtabstop=4
set shiftwidth=4
5 changes: 5 additions & 0 deletions packages/trello/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
coverage/
bench/
examples/
test/
.nyc_output/
29 changes: 29 additions & 0 deletions packages/trello/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# trello for EZS plugin

This package cannot be used alone. EZS has to be installed.

## Example

```js
#!/usr/bin/env ezs

[use]
plugin = trello

[trello]
param = A
param = 1
```

## Installation

$ git clone https://github.com/touv/node-trello.git
$ cd node-trello
$ npm install -g ezs
$ npm install
$ npm link
$ npm run build
$ echo "trello do nothing !" | ./examples/trello.ezs

## Statements

18 changes: 18 additions & 0 deletions packages/trello/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
presets: [
[
'@babel/preset-env', {
targets: {
node: 'current',
},
loose: true,
},
],
],
plugins: [
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-syntax-import-meta',
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-json-strings',
],
};
14 changes: 14 additions & 0 deletions packages/trello/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const { defaults } = require('jest-config');

module.exports = {
...defaults,
testMatch: [
'**/test?(s)/**/*.[jt]s?(x)',
'**/__tests__/**/*.[jt]s?(x)',
'**/?(*.)+(spec|test).[tj]s?(x)',
],
testPathIgnorePatterns: ['/node_modules/', 'locals.js', '/config.js/', '/src/'],
collectCoverage: false,
coveragePathIgnorePatterns: ['/node_modules/', '/test/', '/lib/'],
coverageReporters: ['lcov', 'text-summary'],
};
Loading