This repo contains multiple JavaScript packages linked together by Yarn Workspaces (i.e. it is a monorepo).
The source code for the library published to npm as @influxdata/giraffe
is contained in the giraffe
workspace.
The /stories workspace in this repository contains a Storybook application, which is convenient place to test changes to Giraffe.
To run the Storybook during development:
-
In a terminal,
cd
into the /stories workspace and runyarn start
. This will start a Storybook development server. -
Visit http://localhost:50000 to see the storybook. Changes made either in the library source or in the stories source will be reflected automatically at that URL.
Just looking for how to render a graph in your UI? See Getting Started in the README.md
.
To run linting, cd
into either /giraffe or /stories and run:
yarn lint
To run formatting, which uses Prettier, cd
into either /giraffe or /stories and run:
yarn prettier --fix
To see the formatting issues without fixing, run the above without the --fix
option
To run unit tests, cd
into the /giraffe or /stories and run:
yarn test
Ensure that
- You have administrator access to this repo on GitHub
- You have permissions to publish to the influxdata organization on npm
- You have two factor authentication (2FA) turned on for your npm account. See additional steps related to this requirement
- You are logged into Yarn (
yarn login
) - You are on
master
and the working tree is clean
Then from the root of the repo, run the publish script:
./giraffe/publish
To publish, you must have two factor authentication turned on for your npm account. For assistance setting this up, visit npm's official docs on this topic.
Additionally, npm recently updated the way they recognize 2FA during publishing. If you have not done so previously for any other libraries, you may need to set up a publishing token by doing the following. After these steps are taken, then you will be able to publish successfully using the steps outlined above
- Log in to npmjs.org
- Click on your image avatar in the corner
- Select Access Tokens
- Click on the button Generate New Token
- Name the token and select type: Publish
- Click Generate Token when ready
- Copy the token string - this is your only chance to copy this string
- Go to your project's local repository
- Create a .npmrc file (if necessary) at the root of the repository
- Append this line in the .npmrc file:
//registry.npmjs.org/:_authToken=<access_token>
- Replace <access_token> with the token string
InfluxData takes security and our user's trust very seriously. If you believe you have found a security issue in any of our open source projects, please responsibly disclose it by contacting security@influxdata.com. More details about security vulnerability reporting, including our GPG key, can be found here.