Change some remaining npm mentions to yarn
While `npm` is still installed as part of the build process, most of the scripts and documentation should be using yarn. Change `npm` to `yarn` where appropriate. Signed-off-by: Nathan L Smith <smith@nlsmith.com>pull/10616/head
parent
c307715840
commit
0e297de362
|
@ -21,7 +21,7 @@ We really like to receive feature requests, as it helps us prioritize our work.
|
||||||
|
|
||||||
Contributing to the source code
|
Contributing to the source code
|
||||||
-------------------------------
|
-------------------------------
|
||||||
Chronograf is built using Go for its API backend and serving the front-end assets. The front-end visualization is built with React and uses NPM for package management. The assumption is that all your Go development are done in `$GOPATH/src`. `GOPATH` can be any directory under which Chronograf and all its dependencies will be cloned. For full details on the project structure, follow along below.
|
Chronograf is built using Go for its API backend and serving the front-end assets. The front-end visualization is built with React and uses Yarn for package management. The assumption is that all your Go development are done in `$GOPATH/src`. `GOPATH` can be any directory under which Chronograf and all its dependencies will be cloned. For full details on the project structure, follow along below.
|
||||||
|
|
||||||
Submitting a pull request
|
Submitting a pull request
|
||||||
-------------------------
|
-------------------------
|
||||||
|
@ -43,9 +43,9 @@ Signing the CLA
|
||||||
If you are going to be contributing back to Chronograf please take a second to sign our CLA, which can be found
|
If you are going to be contributing back to Chronograf please take a second to sign our CLA, which can be found
|
||||||
[on our website](https://influxdata.com/community/cla/).
|
[on our website](https://influxdata.com/community/cla/).
|
||||||
|
|
||||||
Installing NPM
|
Installing Yarn
|
||||||
--------------
|
--------------
|
||||||
You'll need to install NPM to manage the JavaScript modules that the front-end uses. This varies depending on what platform you're developing on, but you should be able to find an installer on [the NPM downloads page](https://nodejs.org/en/download/).
|
You'll need to install Yarn to manage the JavaScript modules that the front-end uses. This varies depending on what platform you're developing on, but you should be able to find an installer on [the Yarn installation page](https://yarnpkg.com/en/docs/install).
|
||||||
|
|
||||||
Installing Go
|
Installing Go
|
||||||
-------------
|
-------------
|
||||||
|
@ -105,7 +105,7 @@ Retaining the directory structure `$GOPATH/src/github.com/influxdata` is necessa
|
||||||
|
|
||||||
Build and Test
|
Build and Test
|
||||||
--------------
|
--------------
|
||||||
Make sure you have `go` and `npm` installed and the project structure as shown above. We provide a `Makefile` to get up and running quickly, so all you'll need to do is run the following:
|
Make sure you have `go` and `yarn` installed and the project structure as shown above. We provide a `Makefile` to get up and running quickly, so all you'll need to do is run the following:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd $GOPATH/src/github.com/influxdata/chronograf
|
cd $GOPATH/src/github.com/influxdata/chronograf
|
||||||
|
|
8
Makefile
8
Makefile
|
@ -60,11 +60,11 @@ canned/bin_gen.go: canned/*.json
|
||||||
go generate -x ./canned
|
go generate -x ./canned
|
||||||
|
|
||||||
.jssrc: $(UISOURCES)
|
.jssrc: $(UISOURCES)
|
||||||
cd ui && npm run build
|
cd ui && yarn run build
|
||||||
@touch .jssrc
|
@touch .jssrc
|
||||||
|
|
||||||
.dev-jssrc: $(UISOURCES)
|
.dev-jssrc: $(UISOURCES)
|
||||||
cd ui && npm run build:dev
|
cd ui && yarn run build:dev
|
||||||
@touch .dev-jssrc
|
@touch .dev-jssrc
|
||||||
|
|
||||||
dep: .jsdep .godep
|
dep: .jsdep .godep
|
||||||
|
@ -98,7 +98,7 @@ gotestrace:
|
||||||
go test -race `go list ./... | grep -v /vendor/`
|
go test -race `go list ./... | grep -v /vendor/`
|
||||||
|
|
||||||
jstest:
|
jstest:
|
||||||
cd ui && npm test
|
cd ui && yarn test
|
||||||
|
|
||||||
run: ${BINARY}
|
run: ${BINARY}
|
||||||
./chronograf
|
./chronograf
|
||||||
|
@ -108,7 +108,7 @@ run-dev: chronogiraffe
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
if [ -f ${BINARY} ] ; then rm ${BINARY} ; fi
|
if [ -f ${BINARY} ] ; then rm ${BINARY} ; fi
|
||||||
cd ui && npm run clean
|
cd ui && yarn run clean
|
||||||
cd ui && rm -rf node_modules
|
cd ui && rm -rf node_modules
|
||||||
rm -f dist/dist_gen.go canned/bin_gen.go server/swagger_gen.go
|
rm -f dist/dist_gen.go canned/bin_gen.go server/swagger_gen.go
|
||||||
@rm -f .godep .jsdep .jssrc .dev-jssrc .bindata
|
@rm -f .godep .jsdep .jssrc .dev-jssrc .bindata
|
||||||
|
|
|
@ -33,4 +33,4 @@ yarn upgrade packageName
|
||||||
```
|
```
|
||||||
|
|
||||||
## Testing
|
## Testing
|
||||||
Tests can be run via command line with `npm test`, from within the `/ui` directory. For more detailed reporting, use `npm test -- --reporters=verbose`.
|
Tests can be run via command line with `yarn test`, from within the `/ui` directory. For more detailed reporting, use `yarn test -- --reporters=verbose`.
|
||||||
|
|
|
@ -16,7 +16,7 @@ module.exports = function(config) {
|
||||||
'spec/index.js': ['webpack', 'sourcemap'],
|
'spec/index.js': ['webpack', 'sourcemap'],
|
||||||
},
|
},
|
||||||
// For more detailed reporting on tests, you can add 'verbose' and/or 'progress'.
|
// For more detailed reporting on tests, you can add 'verbose' and/or 'progress'.
|
||||||
// This can also be done via the command line with `npm test -- --reporters=verbose`.
|
// This can also be done via the command line with `yarn test -- --reporters=verbose`.
|
||||||
reporters: ['dots'],
|
reporters: ['dots'],
|
||||||
webpack: {
|
webpack: {
|
||||||
devtool: 'inline-source-map',
|
devtool: 'inline-source-map',
|
||||||
|
|
|
@ -9,13 +9,13 @@
|
||||||
"url": "github:influxdata/chronograf"
|
"url": "github:influxdata/chronograf"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "npm run clean && env NODE_ENV=production node_modules/webpack/bin/webpack.js -p --config ./webpack/prodConfig.js",
|
"build": "yarn run clean && env NODE_ENV=production node_modules/webpack/bin/webpack.js -p --config ./webpack/prodConfig.js",
|
||||||
"build:dev": "node_modules/webpack/bin/webpack.js --config ./webpack/devConfig.js",
|
"build:dev": "node_modules/webpack/bin/webpack.js --config ./webpack/devConfig.js",
|
||||||
"start": "node_modules/webpack/bin/webpack.js -w --config ./webpack/devConfig.js",
|
"start": "node_modules/webpack/bin/webpack.js -w --config ./webpack/devConfig.js",
|
||||||
"lint": "node_modules/eslint/bin/eslint.js src/",
|
"lint": "node_modules/eslint/bin/eslint.js src/",
|
||||||
"test": "karma start",
|
"test": "karma start",
|
||||||
"test:lint": "npm run lint; npm run test",
|
"test:lint": "yarn run lint; yarn run test",
|
||||||
"test:dev": "nodemon --exec npm run test:lint",
|
"test:dev": "nodemon --exec yarn run test:lint",
|
||||||
"clean": "rm -rf build",
|
"clean": "rm -rf build",
|
||||||
"storybook": "node ./storybook",
|
"storybook": "node ./storybook",
|
||||||
"prettier": "prettier --single-quote --trailing-comma es5 --bracket-spacing false --semi false --write \"{src,spec}/**/*.js\"; eslint src --fix"
|
"prettier": "prettier --single-quote --trailing-comma es5 --bracket-spacing false --semi false --write \"{src,spec}/**/*.js\"; eslint src --fix"
|
||||||
|
|
Loading…
Reference in New Issue