Skip to content

Commit

Permalink
refactor(forms): integrate cerebral-forms in Monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
henri-hulski committed Oct 24, 2016
1 parent fa7289e commit 619cab1
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 88 deletions.
3 changes: 2 additions & 1 deletion .cz-config.js
Expand Up @@ -28,7 +28,8 @@ module.exports = {
{name: 'cerebral-router'},
{name: 'function-tree'},
{name: 'demos'},
{name: 'todomvc'}
{name: 'todomvc'},
{name: 'forms'}
],

// it needs to match the value for field type. Eg.: 'fix'
Expand Down
8 changes: 0 additions & 8 deletions packages/cerebral-forms/.gitignore

This file was deleted.

23 changes: 0 additions & 23 deletions packages/cerebral-forms/lib/package.json

This file was deleted.

43 changes: 19 additions & 24 deletions packages/cerebral-forms/package.json
@@ -1,43 +1,38 @@
{
"name": "cerebral-forms",
"version": "1.0.0-alpha.1",
"description": "Signals, actions and state factories to create forms",
"main": "lib/index.js",
"scripts": {
"test": "mocha --compilers js:babel-register 'tests/**/*.js'",
"test": "../../node_modules/.bin/mocha --compilers js:../../node_modules/babel-register 'tests/**/*.js'",
"test:watch": "npm run test -- --watch",
"prebuild": "npm run test",
"build": "babel src/ --out-dir=lib/ -s",
"coverage": "nyc --reporter=lcov --reporter=text npm run test",
"lint": "standard"
"build": "BABEL_ENV=production ../../node_modules/.bin/babel src/ --out-dir=lib/ -s",
"coverage": "../../node_modules/.bin/nyc --reporter=lcov --reporter=text npm run test",
"prepublish": "npm run build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/cerebral/cerebral-forms.git"
"url": "git+https://github.com/cerebral/cerebral.git"
},
"keywords": [
"cerebral",
"forms"
],
"author": "Christian Alfoni",
"author": "Christian Alfoni <christianalfoni@gmail.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/cerebral/cerebral-forms/issues"
"homepage": "https://github.com/cerebral/cerebral/tree/master/packages/cerebral-forms#readme",
"peerDependencies": {
"cerebral": "^2.0.0-alpha.4"
},
"homepage": "https://github.com/cerebral/cerebral-forms#readme",
"devDependencies": {
"assert": "^1.4.1",
"babel-cli": "^6.16.0",
"babel-core": "^6.17.0",
"babel-eslint": "^7.0.0",
"babel-preset-es2015": "^6.16.0",
"babel-preset-react": "^6.16.0",
"babel-register": "^6.16.3",
"cerebral": "^2.0.0-alpha.3",
"mocha": "^3.1.0",
"nyc": "^8.3.1",
"standard": "^8.3.0"
"cerebral": "^2.0.0-alpha.4"
},
"standard": {
"parser": "babel-eslint"
},
"private": true
"nyc": {
"exclude": [
"node_modules",
"lib",
"tests"
]
}
}
28 changes: 0 additions & 28 deletions packages/cerebral-forms/rollup.config.js

This file was deleted.

8 changes: 4 additions & 4 deletions packages/cerebral-forms/tests/validate.js
@@ -1,6 +1,6 @@
/* eslint-env mocha */
import {Controller} from 'cerebral'
import {set} from 'cerebral/operators'
import {set, state, input} from 'cerebral/operators'
import {form, validateField, validateForm} from '../src'
import assert from 'assert'

Expand Down Expand Up @@ -95,7 +95,7 @@ describe('validate', () => {
},
signals: {
fieldChanged: [
set('state:form.name.value', 'input:value'),
set(state`form.name.value`, input`value`),
validateField('form.name')
]
}
Expand All @@ -120,7 +120,7 @@ describe('validate', () => {
},
signals: {
fieldChanged: [
set('state:form.firstName.value', 'input:value'),
set(state`form.firstName.value`, input`value`),
validateField('form.firstName')
]
}
Expand All @@ -143,7 +143,7 @@ describe('validate', () => {
},
signals: {
fieldChanged: [
set('state:form.name.value', 'input:value')
set(state`form.name.value`, input`value`)
],
formSubmitted: [
validateForm('form')
Expand Down

0 comments on commit 619cab1

Please sign in to comment.