build: remove npm replace with yarn (#14176)
* build: remove npm * build(yarn): only build silently on prod * build(yarn): replace npm with yarn in makes and docs * build: remove mentions of npm * build: add yarn.lock * build(yarn): lower minor version requirement * chore: remove package-lock.json * chore: add package-lock.json to gitignore * build(node): allow newer node * docs: update README.mdpull/14046/head
parent
ea27736eaf
commit
d457865704
|
@ -27,9 +27,9 @@ influxd.bolt
|
|||
|
||||
ui/node_modules
|
||||
ui/npm-error.log
|
||||
ui/yarn.lock
|
||||
ui/build
|
||||
ui/.cache
|
||||
ui/package-lock.json
|
||||
|
||||
# e2e test artifacts
|
||||
ui/cypress/screenshots
|
||||
|
|
|
@ -48,8 +48,8 @@ This project requires Go 1.11 and Go module support.
|
|||
Set `GO111MODULE=on` or build the project outside of your `GOPATH` for it to succeed.
|
||||
|
||||
If you are getting an `error loading module requirements` error with `bzr executable file not found in $PATH”` on `make`, `brew install bazaar` (on macOS) before continuing.
|
||||
This error will also be returned if you have not installed `npm`.
|
||||
On macOS, `brew install npm` will install `npm`. As necessary, also install `brew install protobuf`.
|
||||
This error will also be returned if you have not installed `yarn`.
|
||||
On macOS, `brew install yarn` will install `yarn`. As necessary, also install `brew install protobuf`.
|
||||
|
||||
For information about modules, please refer to the [wiki](https://github.com/golang/go/wiki/Modules).
|
||||
|
||||
|
|
|
@ -46,11 +46,11 @@ canned/bin_gen.go: canned/*.json
|
|||
go generate -x ./canned
|
||||
|
||||
.jssrc: $(UISOURCES)
|
||||
cd ui && npm run build
|
||||
cd ui && yarn build
|
||||
@touch .jssrc
|
||||
|
||||
.dev-jssrc: $(UISOURCES)
|
||||
cd ui && npm run build:dev
|
||||
cd ui && yarn build:dev
|
||||
@touch .dev-jssrc
|
||||
|
||||
dep: .jsdep .godep
|
||||
|
@ -67,8 +67,8 @@ endif
|
|||
gdm restore
|
||||
@touch .godep
|
||||
|
||||
.jsdep: ui/package-lock.json
|
||||
cd ui && npm i
|
||||
.jsdep: ui/yarn.lock
|
||||
cd ui && yarn install
|
||||
@touch .jsdep
|
||||
|
||||
gen: bolt/internal/internal.proto
|
||||
|
@ -83,7 +83,7 @@ gotestrace:
|
|||
go test -race ./...
|
||||
|
||||
jstest:
|
||||
cd ui && npm test
|
||||
cd ui && yarn test
|
||||
|
||||
run: ${BINARY}
|
||||
./chronograf
|
||||
|
@ -93,7 +93,7 @@ run-dev: ${BINARY}
|
|||
|
||||
clean:
|
||||
if [ -f ${BINARY} ] ; then rm ${BINARY} ; fi
|
||||
cd ui && npm run clean
|
||||
cd ui && yarn clean
|
||||
cd ui && rm -rf node_modules
|
||||
rm -f dist/dist_gen.go canned/bin_gen.go server/swagger_gen.go
|
||||
@rm -f .godep .jsdep .jssrc .dev-jssrc .bindata
|
||||
|
|
|
@ -46,7 +46,7 @@ MAINTAINER = "contact@influxdb.com"
|
|||
VENDOR = "InfluxData"
|
||||
DESCRIPTION = "Open source monitoring and visualization UI for the entire TICK stack."
|
||||
|
||||
prereqs = [ 'git', 'go', 'npm' ]
|
||||
prereqs = [ 'git', 'go', 'yarn' ]
|
||||
go_vet_command = "go tool vet ./"
|
||||
optional_prereqs = [ 'fpm', 'rpmbuild', 'gpg' ]
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* git checkout -b “branch name”
|
||||
* open the repo in vs code
|
||||
* update the wrapper class with correct api call and return value
|
||||
* run ‘npm run build && npm run lint’ in the influxdb2-js dir
|
||||
* run ‘yarn build && yarn lint’ in the influxdb2-js dir
|
||||
* git add the changed files
|
||||
* send a pr for the update to brandon?
|
||||
* git pull master on influxdb repo
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* update swagger.yml with your change
|
||||
* once the change is merged in master, cd into influxdb2-js dir
|
||||
* get latest from master and create a separate branch
|
||||
* run ‘npm run generate’ command in influxdb2-js dir
|
||||
* npm run buid && npm run lint
|
||||
* run ‘yarn generate’ command in influxdb2-js dir
|
||||
* yarn buid && yarn lint
|
||||
* git status
|
||||
* git add .
|
||||
* git commit -m “message”
|
||||
|
|
14
ui/Makefile
14
ui/Makefile
|
@ -3,24 +3,24 @@ UISOURCES := $(shell find . -type f -not \( -path ./build/\* -o -path ./node_mod
|
|||
all: build
|
||||
|
||||
node_modules:
|
||||
npm i
|
||||
yarn install
|
||||
|
||||
e2e: node_modules
|
||||
npm run test:junit
|
||||
yarn test:junit
|
||||
|
||||
build: node_modules $(UISOURCES)
|
||||
npm run build
|
||||
yarn build
|
||||
|
||||
lint: node_modules $(UISOURCES)
|
||||
npm run lint
|
||||
yarn lint
|
||||
|
||||
test:
|
||||
npm test
|
||||
yarn test
|
||||
|
||||
clean:
|
||||
npm run clean
|
||||
yarn clean
|
||||
|
||||
run:
|
||||
npm start
|
||||
yarn start
|
||||
|
||||
.PHONY: all clean test run lint junit
|
||||
|
|
10
ui/README.md
10
ui/README.md
|
@ -4,20 +4,20 @@
|
|||
To add a new package, run
|
||||
|
||||
```sh
|
||||
npm i packageName
|
||||
yarn add packageName
|
||||
```
|
||||
|
||||
### Adding devDependency
|
||||
|
||||
```sh
|
||||
npm i packageName -D
|
||||
yarn add packageName --dev
|
||||
```
|
||||
|
||||
### Updating a package
|
||||
First, run
|
||||
|
||||
```sh
|
||||
npm outdated
|
||||
yarn outdated
|
||||
```
|
||||
|
||||
... to determine which packages may need upgrading.
|
||||
|
@ -28,8 +28,8 @@ to test.
|
|||
To upgrade a single package named `packageName`:
|
||||
|
||||
```sh
|
||||
npm upgrade packageName
|
||||
yarn upgrade packageName
|
||||
```
|
||||
|
||||
## Testing
|
||||
Tests can be run via command line with `npm test`, from within the `/ui` directory. For more detailed reporting, use `yarn 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`.
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -9,15 +9,15 @@
|
|||
"url": "github:influxdata/chronograf"
|
||||
},
|
||||
"engines": {
|
||||
"npm": "~6.8",
|
||||
"node": "~10.5"
|
||||
"node": ">=10.5.0",
|
||||
"yarn": ">=1.16.0"
|
||||
},
|
||||
"alias": {
|
||||
"src": "./src"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "npm --no-progress i && GIT_SHA=$(git rev-parse HEAD) parcel watch --no-autoinstall -d build src/index.html",
|
||||
"build": "npm --no-progress i && GIT_SHA=$(git rev-parse HEAD) parcel build -d build --log-level 2 src/index.html",
|
||||
"start": "yarn install && GIT_SHA=$(git rev-parse HEAD) parcel watch --no-autoinstall -d build src/index.html",
|
||||
"build": "yarn install --silent && GIT_SHA=$(git rev-parse HEAD) parcel build -d build --log-level 2 src/index.html",
|
||||
"clean": "rm -rf ./build && rm -rf ./.cache && rm -rf node_modules && rm -rf cypress/screenshots && rm -rf cypress/videos && rm -f junit-results/* ",
|
||||
"test": "jest --maxWorkers=2",
|
||||
"test:watch": "jest --watch --verbose false",
|
||||
|
@ -26,8 +26,8 @@
|
|||
"test:junit": "cypress run --reporter junit --reporter-options 'mochaFile=junit-results/test-output-[hash].xml'",
|
||||
"test:ju:report": "junit-viewer --results=junit-results --save-file=cypress/site/junit-report.html",
|
||||
"test:ju:clean": "rm junit-results/*.xml",
|
||||
"test:ju:all": "npm run test:ju:clean && npm run test:junit; npm run test:ju:report;",
|
||||
"lint": "npm run tsc && npm run eslint",
|
||||
"test:ju:all": "yarn test:ju:clean && yarn test:junit; yarn test:ju:report;",
|
||||
"lint": "yarn tsc && yarn eslint",
|
||||
"eslint": "eslint '{src,cypress}/**/*.{ts,tsx}'",
|
||||
"eslint:fix": "eslint --fix '{src,cypress}/**/*.{ts,tsx}'",
|
||||
"tsc": "tsc -p ./tsconfig.json --noEmit --pretty --skipLibCheck",
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue