-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into greenkeeper/jshint-2.9.5
- Loading branch information
Showing
5 changed files
with
123 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |