Skip to content

Commit

Permalink
Added developers webclient
Browse files Browse the repository at this point in the history
  • Loading branch information
srslafazan committed Jan 5, 2021
1 parent 9ffe7dc commit 9a83460
Show file tree
Hide file tree
Showing 56 changed files with 20,215 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,6 @@ override.tf.json
# Include override files you do wish to add to version control using negated pattern
#
# !example_override.tf

*.gitignore

6 changes: 6 additions & 0 deletions developers/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# For use by Babel.
# Run "npx browserslist" to see the list of browsers returned
last 2 versions
> 1%
not dead
maintained node versions
16 changes: 16 additions & 0 deletions developers/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.js]
quote_type = single
16 changes: 16 additions & 0 deletions developers/.github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Before logging an issue:

* Ensure you have followed instructions in the [README](https://github.com/coryhouse/react-slingshot/blob/master/README.md)
* Read the [FAQ](https://github.com/coryhouse/react-slingshot/blob/master/docs/FAQ.md)
* Look through existing [open](https://github.com/coryhouse/react-slingshot/issues) and [closed](https://github.com/coryhouse/react-slingshot/issues?q=is%3Aissue+is%3Aclosed) issues to see if someone has reported the issue before
* Still stuck? Report a new issue

Node version:

npm version:

Operating system:

Command line used:

Steps to reproduce:
35 changes: 35 additions & 0 deletions developers/.github/ISSUE_TEMPLATE/Bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Bug report
about: Create a report to help us improve

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
17 changes: 17 additions & 0 deletions developers/.github/ISSUE_TEMPLATE/Feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
4 changes: 4 additions & 0 deletions developers/.istanbul.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
instrumentation:
excludes: ['*.spec.js']
extensions: ['.js']
include-all-sources: true
1 change: 1 addition & 0 deletions developers/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
save-exact=true
10 changes: 10 additions & 0 deletions developers/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: node_js
cache: yarn
node_js:
- "11"
- "10"
- "8"
script: yarn run test:CI
after_success:
# Send coverage data to coveralls.
- yarn run test:cover:CI
Empty file added developers/.watchmanconfig
Empty file.
47 changes: 47 additions & 0 deletions developers/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Contributing

## Quick Start

Fork this project, then:

```bash
npm install
npm start
```

Submit a pull request to the master branch to request merging your change.

## Branch Organization

All features should be worked out of a well named feature branch. Branch off the master branch. Submit a pull request to merge your work into the master branch when your work is ready for review.

## npm Scripts

This project uses npm scripts for automation

|Script|Description|
|------|-----------|
|start|Start local webserver to host the docs at localhost:3000|
|test|Run tests|

There are many other scripts in package.json, but these are the two you're most likely to run.

## Semantic Versioning

This project follows [semantic versioning](http://semver.org). We release patch versions for bugfixes, minor versions for new features, and major versions for any breaking changes.

## Proposing a Change

If you intend to change the public API, or make any non-trivial changes to the implementation, we recommend filing an issue. This lets us reach an agreement on your proposal before you put significant effort into it.

## Style Guide

ESLint will catch most styling issues that may exist in your code. You can check the status of your code styling by running npm start.

However, there are still some styles that the linter cannot pick up. If you are unsure about something, looking at [Airbnb's Style Guide](https://github.com/airbnb/javascript) will guide you in the right direction.

## Code Conventions

- Use semicolons ;
- 2 spaces for indentation (no tabs). Install the [Editorconfig](http://editorconfig.org) plugin for your editor to enforce this automatically.
- Prefer ' over "
20 changes: 20 additions & 0 deletions developers/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# contributors

## react-slingshot

---

* Atif Afzal ([atfzl](https://github.com/atfzl))
* Andrew Murray ([radarhere](https://github.com/radarhere))
* Barry Staes ([barrystaes](https://github.com/barrystaes))
* Benjamin Fleischer ([bf4](https://github.com/bf4))
* Dave Kerr ([hackerrdave](https://github.com/hackerrdave))
* demonkoryu ([demonkoryu](https://github.com/demonkoryu))
* Josh ([zone-ghost](https://github.com/zone-ghost))
* Kohei TAKATA ([kohei-takata](https://github.com/kohei-takata))
* Kyle Welch ([kwelch](https://github.com/kwelch))
* Marco Bettiolo ([bettiolo](https://github.com/bettiolo))
* Matt Wigdahl ([mlwigdahl](https://github.com/mlwigdahl))
* Nick Taylor ([nickytonline](https://github.com/nickytonline))
* ReadmeCritic ([readmecritic](https://github.com/readmecritic))
* Samuel Neff ([samuelneff](https://github.com/samuelneff))
22 changes: 22 additions & 0 deletions developers/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2015 Cory House

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.

20 changes: 20 additions & 0 deletions developers/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Pull Request Template

The code review checklist below is used for all pull requests.

1. Review the list before submitting your pull request.
2. Leave the list intact for the code reviewer's use.

## Checklist

- [ ] Latest code from master has been merged into the pull request branch
- [ ] Code is camelCased
- [ ] No commented out code (if required, place // TODO above with explanation)
- [ ] No linting issues
- [ ] Automated tests exist and pass
- [ ] Build is successful (`npm run build`)
- [ ] Works in IE 11, Chrome, Firefox, and Edge

## Thanks!

:heart:
153 changes: 153 additions & 0 deletions developers/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
<p align="center">
<img src="https://cloud.githubusercontent.com/assets/3129129/22811426/bb69dc06-ef0c-11e6-8092-a0bea9060b35.png"/>
</p>

---

[![Build status: Linux](https://img.shields.io/travis/coryhouse/react-slingshot.svg?style=flat-square)](https://travis-ci.org/coryhouse/react-slingshot)
[![Build status: Windows](https://img.shields.io/appveyor/ci/coryhouse/react-slingshot/master.svg?style=flat-square)](https://ci.appveyor.com/project/coryhouse/react-slingshot/branch/master)
[![Dependency Status](https://david-dm.org/coryhouse/react-slingshot.svg?style=flat-square)](https://david-dm.org/coryhouse/react-slingshot)
[![Coverage Status](https://img.shields.io/coveralls/coryhouse/react-slingshot/master.svg?style=flat-square)](https://coveralls.io/github/coryhouse/react-slingshot?branch=master)

A comprehensive starter kit for rapid application development using React.

Why Slingshot?

1. **One command to get started** - Type `npm start` to start development in your default browser.
2. **Rapid feedback** - Each time you hit save, changes hot reload and linting and automated tests run.
3. **One command line to check** - All feedback is displayed on a single command line.
4. **No more JavaScript fatigue** - Slingshot uses [the most popular and powerful libraries](#technologies) for working with React.
5. **Working example app** - The included example app shows how this all works together.
6. **Automated production build** - Type `npm run build` to do all this:

[![React Slingshot Production Build](https://img.youtube.com/vi/qlfDLsX-J0U/0.jpg)](https://www.youtube.com/watch?v=qlfDLsX-J0U)

# Get Started

1. **Initial Machine Setup**

First time running the starter kit? Then complete the [Initial Machine Setup](#initial-machine-setup).

2. **Click "Use this template"**

Click the green "Use this template" button at the top of this page and enter a name and description for your repo.

3. **Run the setup script**

`npm run setup`

4. **Run the example app**

`npm start -s`

This will run the automated build process, start up a webserver, and open the application in your default browser. When doing development with this kit, this command will continue watching all your files. Every time you hit save the code is rebuilt, linting runs, and tests run automatically. Note: The -s flag is optional. It enables silent mode which suppresses unnecessary messages during the build.

5. **Review the example app.**

This starter kit includes a working example app that calculates fuel savings. Note how all source code is placed under /src. Tests are placed alongside the file under test. The final built app is placed under /dist. These are the files you run in production.

6. **Delete the example app files.**

Once you're comfortable with how the example app works, you can [delete those files and begin creating your own app](./docs/FAQ.md#i-just-want-an-empty-starter-kit).

7. **Having issues?** See [Having Issues?](#having-issues-try-these-things-first).

## Initial Machine Setup

1. **Install [Node 8.0.0 or greater](https://nodejs.org)**

Need to run multiple versions of Node? Use [nvm](https://github.com/creationix/nvm).

2. **Install [Git](https://git-scm.com/downloads)**.

3. **[Disable safe write in your editor](https://webpack.js.org/guides/development/#adjusting-your-text-editor)** to assure hot reloading works properly.

4. Complete the steps below for your operating system:

### macOS

* Install [watchman](https://facebook.github.io/watchman/) via `brew install watchman` or fswatch via `brew install fswatch` to avoid [this issue](https://github.com/facebook/create-react-app/issues/871) which occurs if your macOS has no appropriate file watching service installed.

### Linux

* Run this to [increase the limit](http://stackoverflow.com/questions/16748737/grunt-watch-error-waiting-fatal-error-watch-enospc) on the number of files Linux will watch. [Here's why](https://github.com/coryhouse/react-slingshot/issues/6).

`echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p`.

### Windows

* **Install [Python 2.7](https://www.python.org/downloads/)**. Some node modules may rely on node-gyp, which requires Python on Windows.
* **Install C++ Compiler**. Browser-sync requires a C++ compiler on Windows.

[Visual Studio Express](https://www.visualstudio.com/en-US/products/visual-studio-express-vs) comes bundled with a free C++ compiler.

If you already have Visual Studio installed:
Open Visual Studio and go to File -> New -> Project -> Visual C++ -> Install Visual C++ Tools for Windows Desktop.
The C++ compiler is used to compile browser-sync (and perhaps other Node modules).

---

## Having Issues? Try these things first

1. Make sure you ran all steps in [Get started](#get-started) including the [initial machine setup](#initial-machine-setup).
2. Run `npm install` - If you forget to do this, you'll see this: `babel-node: command not found`.
3. Install the latest version of Node.
4. Make sure files with names that begin with a dot (.editorconfig, .gitignore, .npmrc) are copied to the project directory root. This is easy to overlook if you copy this repository manually.
5. Don't run the project from a symbolic link. It may cause issues with file watches.
6. Delete any .eslintrc that you're storing in your user directory. Also, disable any ESLint plugin / custom rules that you've enabled within your editor. These will conflict with the ESLint rules defined in this project.
7. Make sure you don't have NODE_ENV set to production on your machine. If you do then the [development dependencies won't be installed](https://github.com/coryhouse/react-slingshot/issues/400#issuecomment-290497767). Here's [how to check](http://stackoverflow.com/a/27939821/26180).
8. Install watchman with `brew install watchman` if you are having the following error after an initial `npm start -s`:

```bash
2017-09-05 00:44 node[68587] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2017-09-05 00:44 node[68587] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
events.js:160
throw er; // Unhandled 'error' event
^

Error: Error watching file for changes: EMFILE
at exports._errnoException (util.js:1022:11)
at FSEvent.FSWatcher._handle.onchange (fs.js:1406:11)
```

9. Tip: Things to check if you get an `npm run lint` error or build error:

* If ESW found an error or warning in your project (e.g. console statement or a missing semi-colon), the lint thread will exit with `Exit status 1`. To fix:

1. Change the `npm run lint` script to `"esw webpack.config.* src tools; exit 0"`
1. Change the `npm run lint:watch` script to `"esw webpack.config.* src tools --watch; exit 0"`

> Note: Adding `exit 0` will allow the npm scripts to ignore the status 1 and allow ESW to print all warnings and errors.
* Ensure the `eslint`/`esw` globally installed version matches the version used in the project. This will ensure the `esw` keyword is resolved.

10. Rebuild node-sass with `npm rebuild node-sass` if you are having and error like `Node Sass does not yet support your current environment on macOS XXX` after an initial `npm start -s`.

---

## Technologies

Slingshot offers a rich development experience using the following technologies:

| **Tech** | **Description** |**Learn More**|
|----------|-------|---|
| [React](https://facebook.github.io/react/) | Fast, composable client-side components. | [Pluralsight Course](https://www.pluralsight.com/courses/react-flux-building-applications) |
| [Redux](http://redux.js.org) | Enforces unidirectional data flows and immutable, hot reloadable store. Supports time-travel debugging. Lean alternative to [Facebook's Flux](https://facebook.github.io/flux/docs/overview.html).| [Getting Started with Redux](https://egghead.io/courses/getting-started-with-redux), [Building React Applications with Idiomatic Redux](https://egghead.io/courses/building-react-applications-with-idiomatic-redux), [Pluralsight Course](http://www.pluralsight.com/courses/react-redux-react-router-es6)|
| [React Router](https://github.com/reactjs/react-router) | A complete routing library for React | [Pluralsight Course](https://www.pluralsight.com/courses/react-flux-building-applications) |
| [Babel](http://babeljs.io) | Compiles ES6 to ES5. Enjoy the new version of JavaScript today. | [ES6 REPL](https://babeljs.io/repl/), [ES6 vs ES5](http://es6-features.org), [ES6 Katas](http://es6katas.org), [Pluralsight course](https://www.pluralsight.com/courses/javascript-fundamentals-es6) |
| [Webpack](https://webpack.js.org) | Bundles npm packages and our JS into a single file. Includes hot reloading via [react-transform-hmr](https://www.npmjs.com/package/react-transform-hmr). | [Quick Webpack How-to](https://github.com/petehunt/webpack-howto) [Pluralsight Course](https://www.pluralsight.com/courses/webpack-fundamentals)|
| [Browsersync](https://www.browsersync.io/) | Lightweight development HTTP server that supports synchronized testing and debugging on multiple devices. | [Intro vid](https://www.youtube.com/watch?time_continue=1&v=heNWfzc7ufQ)|
| [Jest](https://facebook.github.io/jest/) | Automated tests with built-in expect assertions and [Enzyme](https://github.com/airbnb/enzyme) for DOM testing without a browser using Node. | [Pluralsight Course](https://www.pluralsight.com/courses/testing-javascript) |
| [TrackJS](https://trackjs.com/) | JavaScript error tracking. | [Free trial](https://my.trackjs.com/signup)|
| [ESLint](http://eslint.org/)| Lint JS. Reports syntax and style issues. Using [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) for additional React specific linting rules. | |
| [SASS](http://sass-lang.com/) | Compiled CSS styles with variables, functions, and more. | [Pluralsight Course](https://www.pluralsight.com/courses/better-css)|
| [PostCSS](https://github.com/postcss/postcss) | Transform styles with JS plugins. Used to autoprefix CSS |
| [Editor Config](http://editorconfig.org) | Enforce consistent editor settings (spaces vs tabs, etc). | [IDE Plugins](http://editorconfig.org/#download) |
| [npm Scripts](https://docs.npmjs.com/misc/scripts)| Glues all this together in a handy automated build. | [Pluralsight course](https://www.pluralsight.com/courses/npm-build-tool-introduction), [Why not Gulp?](https://medium.com/@housecor/why-i-left-gulp-and-grunt-for-npm-scripts-3d6853dd22b8#.vtaziro8n) |
The starter kit includes a working example app that puts all of the above to use.
---
## Questions?
Check out the [FAQ](./docs/FAQ.md)
Loading

0 comments on commit 9a83460

Please sign in to comment.