Merge pull request #1665 from influxdata/remove-yarn

Remove yarn from project in favor of just npm
pull/10616/head
Brandon Farmer 2018-12-03 09:39:22 -08:00 committed by GitHub
commit 8e7614fbb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 13712 additions and 65 deletions

View File

@ -7,19 +7,18 @@ jobs:
steps:
- checkout
# Run yarn install, using Circle's cache if applicable.
# Run npm install, using Circle's cache if applicable.
- restore_cache:
name: Restore Yarn package cache
name: Restore npm package cache
keys:
# Only cache on exact yarn.lock match, as in Circle's yarn example:
# https://circleci.com/docs/2.0/yarn/
- chronograf-yarn-packages-{{ checksum "ui/yarn.lock" }}
# Only cache on exact package-lock.json match, as in Circle's yarn example:
- chronograf-npm-packages-{{ checksum "ui/package-lock.json" }}
- run: make node_modules
- save_cache:
name: Save Yarn package cache
key: chronograf-yarn-packages-{{ checksum "ui/yarn.lock" }}
key: chronograf-npm-packages-{{ checksum "ui/package-lock.json" }}
paths:
- ~/.cache/yarn
- ~/.cache/npm
- run: make test-js
- run: make chronograf_lint
@ -97,7 +96,7 @@ jobs:
- restore_cache:
name: Restore Yarn package cache
keys:
- chronograf-yarn-packages-{{ checksum "ui/yarn.lock" }}
- chronograf-npm-packages-{{ checksum "ui/package-lock.json" }}
- setup_remote_docker
- run: make test-integration

3
.gitignore vendored
View File

@ -19,7 +19,8 @@ influxd.bolt
/bin
ui/node_modules
ui/yarn-error.log
ui/npm-error.log
ui/yarn.lock
ui/build
ui/.cache

View File

@ -23,4 +23,4 @@ chronograf*.db
*_gen.go
canned/apps_gen.go
npm-debug.log
yarn-error.log
npm-error.log

View File

@ -183,13 +183,12 @@ docker pull chronograf:1.5.0.0
### From Source
* Chronograf works with go 1.10+, node 8.x, and yarn 1.5+.
* Chronograf works with go 1.10+, node 8.x
* Chronograf requires [Kapacitor](https://github.com/influxdata/kapacitor)
1.2.x+ to create and store alerts.
1. [Install Go](https://golang.org/doc/install)
1. [Install Node and NPM](https://nodejs.org/en/download/)
1. [Install yarn](https://yarnpkg.com/docs/install)
1. [Setup your GOPATH](https://golang.org/doc/code.html#GOPATH)
1. Build the Chronograf package:
```bash

View File

@ -4,7 +4,6 @@ VERSION ?= $(shell git describe --always --tags)
COMMIT ?= $(shell git rev-parse --short=8 HEAD)
GDM := $(shell command -v gdm 2> /dev/null)
GOBINDATA := $(shell go list -f {{.Root}} github.com/kevinburke/go-bindata 2> /dev/null)
YARN := $(shell command -v yarn 2> /dev/null)
SOURCES := $(shell find . -name '*.go' ! -name '*_gen.go')
UISOURCES := $(shell find ui -type f -not \( -path ui/build/\* -o -path ui/node_modules/\* -prune \) )
@ -68,13 +67,9 @@ endif
gdm restore
@touch .godep
.jsdep: ui/yarn.lock
ifndef YARN
$(error Please install yarn 0.19.1+)
else
cd ui && yarn --no-progress --no-emoji
.jsdep: ui/package-lock.json
cd ui && npm i
@touch .jsdep
endif
gen: bolt/internal/internal.proto
go generate -x ./bolt/internal

View File

@ -25,10 +25,6 @@ RUN wget -q https://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}-linux-x
tar -xvf node-${NODE_VERSION}-linux-x64.tar.gz -C / --strip-components=1; \
rm -f node-${NODE_VERSION}-linux-x64.tar.gz
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && sudo apt-get install yarn
# Install go
ENV GOPATH /root/go
ENV GO_VERSION 1.10

View File

@ -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','yarn' ]
prereqs = [ 'git', 'go', 'npm' ]
go_vet_command = "go tool vet ./"
optional_prereqs = [ 'fpm', 'rpmbuild', 'gpg' ]

View File

@ -1,45 +1,23 @@
YARN := $(shell command -v yarn 2> /dev/null)
UISOURCES := $(shell find . -type f -not \( -path ./build/\* -o -path ./node_modules/\* -o -path ./.cache/\* -o -name Makefile -prune \) )
all: build
node_modules: yarn.lock
ifndef YARN
$(error Please install yarn 0.19.1+)
else
yarn --no-progress --emoji false
endif
node_modules: package-lock.json
npm i
build: node_modules $(UISOURCES)
ifndef YARN
$(error Please install yarn 0.19.1+)
else
yarn run build
endif
npm run build
lint: node_modules $(UISOURCES)
ifndef YARN
$(error Please install yarn 0.19.1+)
else
yarn run lint
endif
npm run lint
test:
ifndef YARN
$(error Please install yarn 0.19.1+)
else
yarn test --runInBand
endif
npm test
clean:
ifndef YARN
$(error Please install yarn 0.19.1+)
else
yarn run clean
endif
npm run clean
run:
yarn run start
npm start
.PHONY: all clean test run lint

View File

@ -1,26 +1,23 @@
## Packages
We are using [yarn](https://yarnpkg.com/en/docs/install) 0.19.1.
Run `yarn run` to see a list of available tasks.
### Adding new packages
To add a new package, run
```sh
yarn add packageName
npm i packageName
```
### Adding devDependency
```sh
yarn add --dev packageName
npm i packageName -D
```
### Updating a package
First, run
```sh
yarn outdated
npm outdated
```
... to determine which packages may need upgrading.
@ -31,8 +28,8 @@ to test.
To upgrade a single package named `packageName`:
```sh
yarn upgrade packageName
npm upgrade packageName
```
## Testing
Tests can be run via command line with `yarn test`, from within the `/ui` directory. For more detailed reporting, use `yarn test -- --reporters=verbose`.
Tests can be run via command line with `npm test`, from within the `/ui` directory. For more detailed reporting, use `yarn test -- --reporters=verbose`.

13682
ui/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "chronograf-ui",
"version": "2.0",
"version": "2.0.0",
"private": false,
"license": "AGPL-3.0",
"description": "",
@ -12,13 +12,13 @@
"src": "./src"
},
"scripts": {
"start": "yarn install -s && parcel watch -d build src/index.html",
"start": "npm i && parcel watch -d build src/index.html",
"build": "parcel build -d build --no-source-maps --log-level 2 src/index.html",
"clean": "rm -rf ./build && rm -rf ./.cache && rm -rf node_modules",
"test": "jest",
"test": "jest --maxWorkers=2",
"test:watch": "jest --watch",
"test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand --watch",
"lint": "yarn run tslint && yarn run tsc",
"lint": "npm run tslint && yarn run tsc",
"tslint": "tslint -c ./tslint.json '{src,test}/**/*.ts?(x)'",
"tslint:fix": "tslint --fix -c ./tslint.json '{src,test}/**/*.ts?(x)'",
"tsc": "tsc -p ./tsconfig.json --noEmit --pretty",