Skip to content

Commit

Permalink
Merge branch 'master' into greenkeeper/jshint-2.9.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Macrofig authored Oct 3, 2017
2 parents 7d77eb0 + e16909b commit 9ec7ad0
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 52 deletions.
6 changes: 1 addition & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
language: node_js
node_js:
- "6"
- "5"
- "4"
- "iojs"
node_js: node
before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
85 changes: 85 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Contributing to can-define-validate-validatejs

Check out the [contribution guide on CanJS.com](https://canjs.com/doc/guides/contribute.html) for information on:

- [Code of Conduct](https://canjs.com/doc/guides/contribute.html#CodeofConduct)
- [Getting Help](https://canjs.com/doc/guides/contribute.html#GettingHelp)
- [Project Organization](https://canjs.com/doc/guides/contributing/project-organization.html)
- [Reporting Bugs](https://canjs.com/doc/guides/contributing/bug-report.html)
- [Suggesting Features](https://canjs.com/doc/guides/contributing/feature-suggestion.html)
- [Finding Ways to Contribute](https://canjs.com/doc/guides/contributing/finding-ways-to-contribute.html)

The rest of this guide has information that’s specific to this repository.

## Developing Locally

This section will walk you through setting up the [repository](https://github.com/canjs/can-define-validate-validatejs) on your computer.

### Signing up for GitHub

If you don’t already have a GitHub account, you’ll need to [create a new one](https://help.github.com/articles/signing-up-for-a-new-github-account/).

### Forking & cloning the repository

A “fork” is a copy of a repository in your personal GitHub account. “Cloning” is the process of getting the repository’s source code on your computer.

GitHub has a guide for [forking a repo](https://help.github.com/articles/fork-a-repo/). To fork can-define-validate-validatejs, you can start by going to its [fork page](https://github.com/canjs/can-define-validate-validatejs/fork).

Next, you’ll want to clone the repo. [GitHub’s cloning guide](https://help.github.com/articles/cloning-a-repository/) explains how to do this on Linux, Mac, or Windows.

GitHub’s guide will [instruct you](https://help.github.com/articles/fork-a-repo/#step-2-create-a-local-clone-of-your-fork) to clone it with a command like:

```shell
git clone https://github.com/YOUR-USERNAME/can-define-validate-validatejs
```

Make sure you replace `YOUR-USERNAME` with your GitHub username.

### Installing the dependencies

After you’ve forked & cloned the repository, you’ll need to install the project’s dependencies.

First, make sure you’ve [installed Node.js and npm](https://docs.npmjs.com/getting-started/installing-node).

If you just cloned the repo from the command line, you’ll want to switch to the folder with your clone:

```shell
cd can-define-validate-validatejs
```

Next, install the project’s dependencies with npm:

```shell
npm install
```

### Starting the development server

Run the following to start a dev server:

```shell
npm run develop
```

### Running the tests

You can manually run this repository’s tests in any browser by starting the dev server (see the section above) and visiting this page: http://localhost:8080/test/test.html

Firefox is used to run the repository’s automated tests from the command line. If you don’t already have it, [download Firefox](https://www.mozilla.org/en-US/firefox/new/). Mozilla has guides for installing it on [Linux](https://support.mozilla.org/t5/Install-and-Update/Install-Firefox-on-Linux/ta-p/2516), [Mac](https://support.mozilla.org/t5/Install-and-Update/How-to-download-and-install-Firefox-on-Mac/ta-p/3453), and [Windows](https://support.mozilla.org/t5/Install-and-Update/How-to-download-and-install-Firefox-on-Windows/ta-p/2210).

After Firefox is installed, you can run:

```shell
npm test
```

### Making a build

Run the following command to create a build:

```shell
npm run build
```

This will create a `dist/` folder that contains the AMD, CommonJS, and global module versions of the project.

9 changes: 9 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
The MIT License (MIT)

Copyright (c) 2017 Bitovi

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.
23 changes: 11 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "can-define-validate-validatejs",
"version": "0.0.5",
"version": "0.1.1",
"description": "Validation helpers for can-define maps and lists.",
"main": "can-define-validate-validatejs.js",
"scripts": {
Expand All @@ -10,12 +10,11 @@
"testee": "testee test.html --browsers firefox",
"test": "npm run jshint && npm run testee",
"jshint": "jshint *.js --config",
"release:pre": "npm version prerelease && npm run build && npm publish",
"release:pre": "npm version prerelease && npm run build && npm publish --tag=pre",
"release:patch": "npm version patch && npm run build && npm publish",
"release:minor": "npm version minor && npm run build && npm publish",
"release:major": "npm version major && npm run build && npm publish",
"build": "node build.js",
"document": "bit-docs",
"develop": "http-server -c-1"
},
"repository": {
Expand All @@ -37,13 +36,13 @@
"homepage": "https://github.com/canjs/can-define-validate-validatejs",
"devDependencies": {
"bit-docs": "^0.0.7",
"can-compute": "^3.0.5",
"http-server": "^0.9.0",
"can-compute": "^3.3.4",
"http-server": "^0.10.0",
"jshint": "^2.9.5",
"steal": "^1.0.8",
"steal": "^1.5.14",
"steal-qunit": "^1.0.0",
"steal-tools": "^1.0.1",
"testee": "^0.3.0"
"steal-tools": "^1.9.0",
"testee": "^0.7.0"
},
"browser": {},
"steal": {
Expand All @@ -60,9 +59,9 @@
"transpiler": "babel"
},
"dependencies": {
"can-define": "^1.0.15",
"can-util": "^3.2.2",
"can-validate": "^1.0.2",
"can-validate-validatejs": "^0.0.6"
"can-define": "^1.4.7",
"can-util": "^3.9.0",
"can-validate": "^1.1.0",
"can-validate-validatejs": "0.1.0"
}
}
52 changes: 17 additions & 35 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,28 @@
# `can-define-validate-validatejs`
# can-define-validate-validatejs

Create validator functions using [validate.js](https://validatejs.org/).

Usage and API info can be found on [CanJS.com](http://canjs.com/doc/can-validate-validatejs.html).

## Install

```sh
git clone [email protected]:canjs/can-define-validate-validatejs.git
cd ./can-define-validate-validatejs
npm install

# Start web server to play with demo
npm run develop
```
[![Join the chat at https://gitter.im/canjs/canjs](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/canjs/canjs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/canjs/can-define-validate-validatejs/blob/master/LICENSE.md)
[![npm version](https://badge.fury.io/js/can-define-validate-validatejs.svg)](https://www.npmjs.com/package/can-define-validate-validatejs)
[![Travis build status](https://travis-ci.org/canjs/can-define-validate-validatejs.svg?branch=master)](https://travis-ci.org/canjs/can-define-validate-validatejs)
[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/canjs/can-define-validate-validatejs?branch=master&svg=true)](https://ci.appveyor.com/project/matthewp/can-define-validate-validatejs)
[![Coverage status](https://coveralls.io/repos/github/canjs/can-define-validate-validatejs/badge.svg?branch=master)](https://coveralls.io/github/canjs/can-define-validate-validatejs?branch=master)
[![Greenkeeper badge](https://badges.greenkeeper.io/canjs/can-define-validate-validatejs.svg)](https://greenkeeper.io/)

### Build

Run `npm run build`

### Test

Run `npm run test`
Create validator functions using [validate.js](https://validatejs.org/).

This will run the jshint script before actually running tests.
## Documentation

To run just the tests, run `npm run testee`.
Read the [can-define-validate-validatejs API docs on CanJS.com](https://canjs.com/doc/can-define-validate-validatejs.html).

To run tests in the browser, run `npm run develop` and browse to `http://127.0.0.1:8080/test.html`
## Changelog

See the [latest releases on GitHub](https://github.com/canjs/can-define-validate-validatejs/releases).

## Usage
## Contributing

`npm install can-define-validate-validatejs --save`
The [contribution guide](https://github.com/canjs/can-define-validate-validatejs/blob/master/CONTRIBUTING.md) has information on getting help, reporting bugs, developing locally, and more.

```javascript
var ValidateDefine = require('can-define-validate-validatejs');
var Map = require('can-define/map/map');
## License

Map = ValidateDefine(Map);
var map = new Map({name: 'juan'});
[MIT](https://github.com/canjs/can-define-validate-validatejs/blob/master/LICENSE.md)

map.attr('name', ''); // setting value checks validity
map.errors();// one error
```

0 comments on commit 9ec7ad0

Please sign in to comment.