Skip to content

Commit

Permalink
split off CONTRIBUTING.md
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
Boldewyn committed Feb 8, 2017
1 parent 270610d commit 3ebd12f
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 90 deletions.
82 changes: 82 additions & 0 deletions CONTRIBUTING.md
@@ -0,0 +1,82 @@
# Contributing to Hyperform

Cool, thanks for joining in and welcome aboard! If you have Node.js and `make`
installed, you are ready to start.

**Before you start editing:** If you don’t directly fix an already reported
issue, please do open a new one before! Otherwise there might be the chance,
that your work is not fully aligned with Hyperform’s goals, and your time
wasted.

## Set-Up

Log in to [GitHub](https://github.com) and fork
[Hyperform](https://github.com/hyperform/hyperform) (button in the upper-right
corner). Then switch to your terminal:

```sh
$ git clone git@github.com:YourUserName/hyperform.git
$ cd hyperform
$ npm install
$ node_modules/.bin/jspm install
# now you're ready to go. Try your first build to see if everything works:
$ make -B && git status
```

Git should show no file changes. Start editing the files in `src` and build
again with `make`.

## Testing Your Edit

For this you need a [SauceLabs](https://saucelabs.com/) account. It’s free to
register and allows testing in a bunch of browsers concurrently. Export your
SauceLabs API token from your profile page to your shell:

```sh
$ export SAUCE_USERNAME=your_saucelabs_user
$ export SAUCE_ACCESS_KEY=your_api_key
```

Then you can run all tests with a single command:

```sh
$ make test
```

If you do not want to create a SauceLabs account, you can also do the tests
manually:

```sh
$ make test-syntax
$ make test-unit
```

and then open `test/functional/index.html` in your browser and verify, that
all tests return green.

**Attention:** The functional tests are performed on `dist/hyperform.js`. Don’t
forget to `make` that file prior to testing!

## Keeping a Look at the File Size

If you have [`gnuplot`](http://gnuplot.sourceforge.net/) installed, try

```sh
$ make cmpsize
```

This produces a nice little chart of how the size of `dist/hyperform.min.js`
changed over time. If you notice a huge peak at the very end, maybe there could
be one or the other byte shoved off before you commit :wink:.

## Submitting a Pull Request

See [Github’s help page](https://help.github.com/articles/using-pull-requests/)
on how that works exactly (with screenshots!). Please try to make title and
description of the change request meaningful.

## If Something Goes Wrong

If you encounter any problem, grab Manuel on
[Twitter](https://twitter.com/m_strehl) or via
[e-mail](http://www.manuel-strehl.de/about/contact).
95 changes: 5 additions & 90 deletions README.md
Expand Up @@ -82,16 +82,7 @@ hyperform(window);
Configure settings as second argument:

```js
hyperform(window, {
strict: false, // default. En- or disable some high-level APIs

revalidate: 'oninput', // default. Whether fields should be
// re-validated automatically. Valid values:
// `oninput`, `onsubmit`, and `never`.

valid_event: true, // default. Whether the non-standard `valid`
// event should be triggered
});
hyperform(window, { revalidate: 'never' });
```

If you only need a certain feature once, you can access it directly by name:
Expand All @@ -102,6 +93,9 @@ if (hyperform.willValidate(some_input_element)) {
}
```

[The full documentation](https://hyperform.js.org/docs/) provides you with all
the nitty-gritty details and tricks.

### What About the UI?

You might be wondering, how to get nifty datepickers and range sliders and
Expand Down Expand Up @@ -168,86 +162,7 @@ Hyperform is fully tested and supported in

## Contributing

Cool, yes! Welcome aboard! If you have Node.js and `make` installed, you are
ready to start.

**Before you start editing:** If you don’t directly fix an already reported
issue, please do open a new one before! Otherwise there might be the chance,
that your work is not fully aligned with Hyperform’s goals, and your time
wasted.

### Set-Up

Log in to [GitHub](https://github.com) and fork
[Hyperform](https://github.com/hyperform/hyperform) (button in the upper-right
corner). Then switch to your terminal:

```sh
$ git clone git@github.com:YourUserName/hyperform.git
$ cd hyperform
$ npm install
$ node_modules/.bin/jspm install
# now you're ready to go. Try your first build to see if everything works:
$ make -B && git status
```

Git should show no file changes. Start editing the files in `src` and build
again with `make`.

### Testing Your Edit

For this you need a [SauceLabs](https://saucelabs.com/) account. It’s free to
register and allows testing in a bunch of browsers concurrently. Export your
SauceLabs API token from your profile page to your shell:

```sh
$ export SAUCE_USERNAME=your_saucelabs_user
$ export SAUCE_ACCESS_KEY=your_api_key
```

Then you can run all tests with a single command:

```sh
$ make test
```

If you do not want to create a SauceLabs account, you can also do the tests
manually:

```sh
$ make test-syntax
$ make test-unit
```

and then open `test/functional/index.html` in your browser and verify, that
all tests return green.

**Attention:** The functional tests are performed on `dist/hyperform.js`. Don’t
forget to `make` that file prior to testing!

### Keeping a Look at the File Size

If you have [`gnuplot`](http://gnuplot.sourceforge.net/) installed, try

```sh
$ make cmpsize
```

This produces a nice little chart of how the size of `dist/hyperform.min.js`
changed over time. If you notice a huge peak at the very end, maybe there could
be one or the other byte shoved off before you commit :wink:.

### Submitting a Pull Request

See [Github’s help page](https://help.github.com/articles/using-pull-requests/)
on how that works exactly (with screenshots!). Please try to make title and
description of the change request meaningful.

### If Something Goes Wrong

If you encounter any problem, grab Manuel on
[Twitter](https://twitter.com/m_strehl) or via
[e-mail](http://www.manuel-strehl.de/about/contact).
Cool, yes! Head over to the [contributing guide](CONTRIBUTING.md) for details.

## License

Expand Down

0 comments on commit 3ebd12f

Please sign in to comment.