Merge pull request #16204 from Bouncey/feat/noGlobalPackages

Feat(dev): No more global npm packages
This commit is contained in:
Berkeley Martinez
2017-12-16 15:37:37 -08:00
committed by GitHub
3 changed files with 1089 additions and 1096 deletions

View File

@ -108,32 +108,32 @@ Do this prior to every time you create a branch for a PR:
1. Make sure you are on the `staging` branch
```shell
$ git status
On branch staging
Your branch is up-to-date with 'origin/staging'.
```
If your aren't on `staging`, resolve outstanding files / commits and checkout the `staging` branch
```shell
$ git status
On branch staging
Your branch is up-to-date with 'origin/staging'.
```
If your aren't on `staging`, resolve outstanding files / commits and checkout the `staging` branch
```shell
$ git checkout staging
```
```shell
$ git checkout staging
```
2. Do a pull with rebase against `upstream`
```shell
$ git pull --rebase upstream staging
```
```shell
$ git pull --rebase upstream staging
```
This will pull down all of the changes to the official staging branch, without making an additional commit in your local repo.
This will pull down all of the changes to the official staging branch, without making an additional commit in your local repo.
3. (_Optional_) Force push your updated staging branch to your GitHub fork
```shell
$ git push origin staging --force
```
```shell
$ git push origin staging --force
```
This will overwrite the staging branch of your fork.
This will overwrite the staging branch of your fork.
### Create A Branch
@ -173,8 +173,6 @@ Once you have freeCodeCamp cloned, before you start the application, you first n
# Install NPM dependencies
npm install
# Install Gulp globally
npm install -g gulp
```
Then you need to add the private environment variables (API Keys):
@ -196,7 +194,7 @@ Next you should setup MailHog, a local SMTP mail server that will catch all the
brew services start mailhog
```
To access your MailHog inbox, open your browser and navigate to [http://localhost:8025](http://localhost:8025). For any other questions related to MailHog or for instructions on custom configurations, check out the [MailHog](https://github.com/mailhog/MailHog) repository.
To access your MailHog inbox, open your browser and navigate to [http://localhost:8025](http://localhost:8025). For any other questions related to MailHog or for instructions on custom configurations, check out the [MailHog](https://github.com/mailhog/MailHog) repository.
Now you will need to start MongoDB, and then seed the database, then you can start the application:
@ -215,26 +213,26 @@ mongod
npm run only-once
# start the application
gulp
npm run develop
```
Now navigate to your browser and open
<http://localhost:3000>. If the app loads,
congratulations you're all set. Otherwise, let us know by asking in the [Contributors chat room](https://gitter.im/FreeCodeCamp/Contributors) on Gitter. There also might be an error in the console of your browser or in Bash / Terminal / Command Line that will help identify the problem. If the app launches but you are encountering errors with the UI itself, for example if fonts are not being loaded or if the code editor is not displaying properly, you may try the following:
```bash
# Remove all installed node modules
rm -rf node_modules
```bash
# Remove all installed node modules
rm -rf node_modules
# Reinstall npm packages
npm install
# Reinstall npm packages
npm install
# Seed the database (optional)
node seed
# Seed the database (optional)
node seed
# Re-start the application
gulp
```
# Re-start the application
npm run develop
```
### Make Changes
This bit is up to you!

2098
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -3,32 +3,33 @@
"version": "0.1.0",
"repository": "freecodecamp/freecodecamp",
"scripts": {
"only-once": "npm run create-rev && echo '/****/' && echo 'Seeding Database' && echo '/****/' && node seed && echo '/****/' && echo 'Seeding Completed' && echo '/****/'",
"create-rev": "node -e \"var fs = require('fs'); fs.access('./server/rev-manifest.json', function(err) { if (err) { console.log('\\n\\ncreating manifest\\n\\n'); return fs.writeFileSync('server/rev-manifest.json', '{}'); } console.log('\\n\\nrev-manifest present\\n\\n'); });\"",
"build": "NODE_ENV=production gulp build -p",
"start": "babel-node server/server.js",
"prestart-production": "gulp build -p",
"start-production": "node pm2Start",
"commit": "git-cz",
"commitmsg": "validate-commit-msg",
"cover": "babel-node ./node_modules/.bin/babel-istanbul cover tape common/**/*.test.js",
"coveralls": "npm run cover && istanbul-coveralls",
"create-rev": "node -e \"var fs = require('fs'); fs.access('./server/rev-manifest.json', function(err) { if (err) { console.log('\\n\\ncreating manifest\\n\\n'); return fs.writeFileSync('server/rev-manifest.json', '{}'); } console.log('\\n\\nrev-manifest present\\n\\n'); });\"",
"develop": "gulp",
"lint": "npm run lint-js && npm run lint-json",
"lint-challenges": "jsonlint-cli seed/challenges/**/*.json",
"lint-server": "jsonlint-cli server/*.json",
"lint-resources": "jsonlint-cli server/resources/*.json",
"lint-utils": "jsonlint-cli server/utils/*.json",
"prelint-js": "npm run create-rev",
"lint-js": "eslint --ext=.js,.jsx gulpfile.js server/ common/ config/ client/",
"lint-json": "npm run lint-server && npm run lint-challenges && npm run lint-resources && npm run lint-utils",
"only-once": "npm run create-rev && echo '/****/' && echo 'Seeding Database' && echo '/****/' && node seed && echo '/****/' && echo 'Seeding Completed' && echo '/****/'",
"prelint-js": "npm run create-rev",
"pretest": "npm run create-rev && npm run lint",
"prestart-production": "gulp build -p",
"snyk-protect": "snyk protect",
"start": "babel-node server/server.js",
"start-production": "node pm2Start",
"test-challenges": "babel-node seed/test-challenges.js | tap-spec",
"test": "npm run test-js && npm run test-challenges",
"test-js": "npm run test-js-client && npm run test-js-common && npm run test-js-server",
"test-js-client": "tape -r babel-register \"client/**/*.test.js\" | tap-spec",
"test-js-common": "tape -r babel-register \"common/**/*.test.js\" | tap-spec",
"test-js-server": "tape -r babel-register \"server/**/*.test.js\" | tap-spec",
"test": "npm run test-js && npm run test-challenges",
"cover": "babel-node ./node_modules/.bin/babel-istanbul cover tape common/**/*.test.js",
"coveralls": "npm run cover && istanbul-coveralls",
"commit": "git-cz",
"commitmsg": "validate-commit-msg"
"test-js-server": "tape -r babel-register \"server/**/*.test.js\" | tap-spec"
},
"license": "(BSD-3-Clause AND CC-BY-SA-4.0)",
"dependencies": {
@ -149,7 +150,7 @@
"del": "^2.2.0",
"eslint": "^4.10.0",
"eslint-config-freecodecamp": "^1.1.1",
"gulp": "^3.9.0",
"gulp": "^3.9.1",
"gulp-babel": "^6.1.1",
"gulp-concat": "^2.6.0",
"gulp-eslint": "^3.0.1",