This repository has been archived by the owner on Jul 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v3.0.0 - Rebuild scrollNav to use native JavaScript
Replaced jQuery with native JS and removed all production dependencies (development does require deps). Reduced the number of user options to simplify the API and reduced the amount of DOM manipulation to reduce likelihood of browser bugs. Includes a full set of test suites for all modules (unless noted).
- Loading branch information
1 parent
9ad1ed0
commit 3c27263
Showing
91 changed files
with
16,245 additions
and
15,523 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
test/coverage |
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,21 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es6": true | ||
}, | ||
"plugins": ["prettier"], | ||
"extends": ["eslint:recommended", "prettier"], | ||
"parserOptions": { | ||
"sourceType": "module", | ||
"ecmaVersion": 2017 | ||
}, | ||
"globals": { | ||
"module": false | ||
}, | ||
"rules": { | ||
"prettier/prettier": "error", | ||
"linebreak-style": ["error", "unix"], | ||
"quotes": ["error", "single"], | ||
"semi": ["error", "always"] | ||
} | ||
} |
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 |
---|---|---|
|
@@ -6,3 +6,6 @@ | |
/node_modules/ | ||
npm-debug.log | ||
bower_components | ||
|
||
## Test Coverage Files | ||
test/coverage/ |
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,10 @@ | ||
{ | ||
"collectCoverage": true, | ||
"coverageDirectory": "test/coverage", | ||
"collectCoverageFrom": ["src/**/*.js"], | ||
"coveragePathIgnorePatterns": ["/node_modules", "/src/scrollNav.v2-7-3.js"], | ||
"transform": { | ||
"^.+\\.js$": "<rootDir>/jest.transform.js" | ||
}, | ||
"setupFiles": ["<rootDir>/jest.setup.js"] | ||
} |
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,3 @@ | ||
{ | ||
"singleQuote": true | ||
} |
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,7 +1,8 @@ | ||
language: node_js | ||
node_js: | ||
- 0.10 | ||
before_script: | ||
- npm install -g grunt-cli | ||
- npm install semver | ||
- npm install util | ||
- "8" | ||
- "10" | ||
install: | ||
- npm install | ||
- npm install codecov | ||
- codecov |
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,31 +1,104 @@ | ||
# Contributing | ||
# Contributing Guideline | ||
|
||
## Important notes | ||
Please don't edit files in the `dist` subdirectory as they are generated via Grunt. You'll find source code in the `src` subdirectory! | ||
Thanks for contributing to scrollNav. Without you and the Open Source community | ||
this project wouldn't be possible. Before you get started, please familiarize | ||
yourself with the project and its standards. | ||
|
||
## Issue Reports | ||
|
||
If you're looking for a way to contribute to this project, your best bet is | ||
to [start with the current issues][1]. Whether it's a new feature you'd like | ||
added, a bug you've found, or a question about using the plugin, there's always | ||
a chance you're not alone. Take a look through both the open and closed issues | ||
before creating a new one yourself. | ||
|
||
### Improvements/features | ||
|
||
Before working on a new feature please submit an issue suggesting the feature | ||
and ensure that it is greenlighted. I'd hate for you to spend your time | ||
building a new feature that doesn't fit the project's scope or intentions. | ||
|
||
### Bugs | ||
|
||
Before submitting a bug report, please create a reproducable test, either as a | ||
failing unit test on your own fork, or by forking the starter demo from Codepen | ||
and adjusting as necessary. It's a whole lot easier to address issues if I can | ||
understand the situation. If it's not obvious what's broken in your demo, | ||
include step-by-step instructions on how to reproduce the problem within the | ||
issue description. | ||
|
||
## Pull Requests | ||
|
||
You've found a bug or had a feature greenlighted and you're ready to dig in and | ||
get to work. Congrats! This project was built and continues to improve from | ||
direct contributions from folks like you. Before you get too far, please be | ||
sure to read through and understand the steps below. | ||
|
||
### Important notes | ||
|
||
Please don't edit files in the `dist` subdirectory as they are generated via | ||
NPM script. You'll find source code in the `src` subdirectory. | ||
|
||
### Code style | ||
Regarding code style like indentation and whitespace, **follow the conventions you see used in the source already.** | ||
|
||
### PhantomJS | ||
While Grunt can run the included unit tests via [PhantomJS](http://phantomjs.org/), this shouldn't be considered a substitute for the real thing. Please be sure to test the `test/*.html` unit test file(s) in _actual_ browsers. | ||
This project utilizes [Prettier][11] to ensure a consistent code style. Write | ||
your changes however you prefer but be sure to run `npm run format` prior to | ||
submitting a Pull Request. Don't worry about making a lot of small commits, | ||
your changes will be squashed within Github when the Pull Request is merged. | ||
|
||
### Testing | ||
|
||
This project uses [Jest][12] for its unit tests. Prior to submitting a | ||
Pull Request, please ensure new functionality is tested and adjustments to | ||
previous functionality continue to pass. A failing test is better than no | ||
test at all and gives me a place to start reviewing. | ||
|
||
## Modifying the code | ||
First, ensure that you have the latest [Node.js](http://nodejs.org/) and [npm](http://npmjs.org/) installed. | ||
Additionally, it's a good idea to ensure your changes work in actual browsers. | ||
Including a demo on [Codepen][13] is a great way to ensure your changes are | ||
reviewed and merged in a timely manner. I've [created a base Pen][2] for you | ||
to fork and edit. | ||
|
||
Test that Grunt's CLI is installed by running `grunt --version`. If the command isn't found, run `npm install -g grunt-cli`. For more information about installing Grunt, see the [getting started guide](http://gruntjs.com/getting-started). | ||
### Modifying the code | ||
|
||
First, ensure that you are working with [Node.js][14] version 8 or later and | ||
[npm][15] version 5 or later. Older versions of Node are supported but it's | ||
best to work with the Long Term Support (LTS), currently version 8. | ||
|
||
1. Fork and clone the repo. | ||
1. Run `npm install` to install all dependencies (including Grunt). | ||
1. Run `grunt` to grunt this project. | ||
1. Run `npm install` to install the development dependencies. | ||
1. Create a new branch that's appropriately named. Please don't work directly | ||
in your `master` branch, it makes testing locally difficult. | ||
1. Add failing tests for the change you want to make in the `test/tests` | ||
directory. Run `npm test` to see the tests fail. | ||
1. Edit the source files in the `src` directory. | ||
1. Run `npm test` to see if the tests pass. Repeat steps 2-4 until done. | ||
1. Run `npm run build` to generate the transpiled files in the `dist` | ||
directory. | ||
1. Update the documentation to reflect any changes in functionality. | ||
1. Commit and push your the branch to Github. | ||
1. Navigate to your branch on Github and then to the | ||
`dist/scrollNav.min.js` file. | ||
1. Select the "Raw" button and copy the file URL. | ||
1. Fork the starter demo in Codepen and then click settings. | ||
1. Under "Add External Scripts/Pens" replace the existing | ||
`dist/scrollNav.min.js` file URL with your raw file URL. | ||
1. Test the interactions and ensure your intended changes work as expected. | ||
1. Submit a Pull Request making sure to write a descriptive comment and | ||
include your forked Codepen URL. | ||
|
||
**Note: If none of this makes sense, it's ok. Any contribution is a useful one, | ||
even if it's not accepted. Please feel free to reach out to me to ask for help | ||
or clarification, I'm [@jimmynotim on Twitter][21].** | ||
|
||
To view all available build tasks run `npm run` without any arguments. | ||
|
||
Assuming that you don't see any red, you're ready to go. Just be sure to run `grunt` after making any changes, to ensure that nothing is broken. | ||
[1]: https://github.com/jimmynotjim/scrollNav/issues | ||
[2]: https://codepen.io/jimmynotjim/pen/OZKeyd | ||
|
||
## Submitting pull requests | ||
[11]: https://prettier.io/ | ||
[12]: https://facebook.github.io/jest/ | ||
[13]: https://codepen.io/ | ||
[14]: http://nodejs.org/ | ||
[15]: http://npmjs.org/ | ||
|
||
1. Create a new branch, please don't work in your `master` branch directly. | ||
1. Add failing tests for the change you want to make. Run `grunt` to see the tests fail. | ||
1. Fix stuff. | ||
1. Run `grunt` to see if the tests pass. Repeat steps 2-4 until done. | ||
1. Open `test/*.html` unit test file(s) in actual browser to ensure tests pass everywhere. | ||
1. Update the documentation to reflect any changes. | ||
1. Push to your fork and submit a pull request. | ||
[21]: https://twitter.com/jimmynotjim |
Oops, something went wrong.