diff --git a/.circleci/config.yml b/.circleci/config.yml index 96dfeaa..f7192dc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,58 +1,74 @@ -version: 2 +version: 2.1 +orbs: + gh: circleci/github-cli@1.0.3 jobs: - build: - docker: - - image: circleci/node:12.9.1-browsers - steps: - - checkout - - run: - name: Install Dependencies - command: yarn - - run: - name: Test - command: yarn test - - run: - name: Build Package - command: yarn build - - run: - name: Verify Artifacts - command: yarn test:build - - persist_to_workspace: - root: . - paths: - - dist + build: + docker: + - image: circleci/node:12.9.1-browsers + steps: + - checkout + - run: + name: Install Dependencies + command: yarn + - run: + name: Test + command: yarn test + - run: + name: Build Package + command: yarn build + - run: + name: Verify Artifacts + command: yarn test:build + - persist_to_workspace: + root: . + paths: + - dist - publish: - docker: - - image: circleci/node:12.9.1-browsers - steps: - - checkout - - attach_workspace: - at: . - - run: - name: Authenticate with registry - command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc - - run: - name: Publish @pxblue/highcharts - command: | - MASTER_VERSION=`node -p "require('./package.json').version"` - NPM_LATEST_VERSION=`npm show @pxblue/highcharts version` - if ! [ $MASTER_VERSION == $NPM_LATEST_VERSION ]; - then - npm publish - else - echo "Latest version is already published." - fi + publish: + docker: + - image: circleci/node:12.9.1-browsers + steps: + - checkout + - attach_workspace: + at: . + - run: + name: Authenticate with registry + command: | + echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc + echo "//registry.yarnpkg.com/:_authToken=$NPM_TOKEN" >> ~/.npmrc + - run: + name: Publish @brightlayer-ui/highcharts + command: | + yarn publish:package -b $CIRCLE_BRANCH + + tag: + docker: + - image: circleci/node:12.9.1-browsers + steps: + - checkout + - gh/setup + - run: + name: Tag @brightlayer-ui/highcharts + command: | + yarn tag:package -b $CIRCLE_BRANCH -s -blui-highcharts workflows: - version: 2 - types: - jobs: - - build - - publish: - requires: + version: 2 + types: + jobs: - build - filters: - branches: - only: - - master + - publish: + requires: + - build + filters: + branches: + only: + - master + - dev + - tag: + requires: + - publish + filters: + branches: + only: + - master diff --git a/.eslintrc.js b/.eslintrc.js index a7eb8c9..f092abe 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,7 +1,7 @@ -module.exports = { - parser: '@typescript-eslint/parser', - extends: [ '@pxblue/eslint-config/ts', '@pxblue/eslint-config/tsx' ], - parserOptions: { +module.exports = { + parser: '@typescript-eslint/parser', + extends: ['@brightlayer-ui/eslint-config/ts', '@brightlayer-ui/eslint-config/tsx'], + parserOptions: { project: "./tsconfig.json", }, env: { diff --git a/CHANGELOG.md b/CHANGELOG.md index 14932fc..d3f9b24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,27 +1,45 @@ # CHANGELOG -### v2.1.0 +## v2.1.0 (November 3, 2021) + +### Changed + +- Changed package namespace from `@pxblue` to `@brightlayer-ui`. + +## Package Migration Notice + +Previous versions listed after this indicator refer to our deprecated `@pxblue` packages. + +--- + +### v2.1.0 (March 30, 2021) ### Added -- Utility functions for translating chart labels and formats. -### v2.0.0 +- Utility functions for translating chart labels and formats. + +### v2.0.0 (January 22, 2020) ### Changed -- Library converted to TypeScript to provide strong typings for TS projects. This will continue to work for plain JavaScript projects without any changes necessary. -### v1.1.0 +- Library converted to TypeScript to provide strong typings for TS projects. This will continue to work for plain JavaScript projects without any changes necessary. + +### v1.1.0 (November 21, 2018) ### Changed + Significant improvements to the way we generate charts: -* We now expose chart generator functions, rather than sample config objects -* These generator functions accept a configuration object that supports any Highcharts configuration properties -* If required data is missing, sample data will be injected automatically -* Leaving the config object blank will generate a complete sample chart that can be used as a placeholder + +- We now expose chart generator functions, rather than sample config objects +- These generator functions accept a configuration object that supports any Highcharts configuration properties +- If required data is missing, sample data will be injected automatically +- Leaving the config object blank will generate a complete sample chart that can be used as a placeholder Breaking changes: -* We no longer export chart samples from the /samples directory -* baseConfig object exports have been replaced by the chart generator functions -### v1.0.0 -- This library has been ported from @pxblue/visualizations +- We no longer export chart samples from the /samples directory +- baseConfig object exports have been replaced by the chart generator functions + +### v1.0.0 (October 26, 2018) + +- This library has been ported from @pxblue/visualizations diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..73b177a --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1 @@ +* @emclaug2 @daileytj @huayunh \ No newline at end of file diff --git a/PUBLISHING.md b/PUBLISHING.md index 6c193dd..2a4a87a 100644 --- a/PUBLISHING.md +++ b/PUBLISHING.md @@ -1,12 +1,28 @@ # Publishing Instructions -To update the version number, edit the version in `package.json`. +## Automatic Publishing -To publish a new package through NPM, run the following commands from the root folder: +This package is published to NPM automatically by CircleCI when code is merged into the `dev` or `master` branches. To publish a new version, simply update the version in `package.json` and merge your code into the appropriate branch. +- The `dev` branch will publish versions marked as `alpha` or `beta`. +- The `master` branch will publish any version (`alpha`, `beta`, or `latest`). + In both cases, the code will only be published if the version number differs from the current version published under the respective dist tag. +## Manually Publishing + +If you need to publish a package manually, you can run the following commands from the root folder: + +``` +yarn build +yarn publish:package ``` -yarn build -npm publish --tag + +The publishing script will look at the version in the `package.json` and automatically determine whether to publish an alpha, beta, or latest package. + +For this command to work, you must have an NPM token configured in your environment variables or you can perform a login prior to executing the publish command via: + +```sh +yarn build +npm adduser && yarn publish:package ``` -> The above command should only be run for `alpha` or `beta` packages. This repo's CircleCI will automatically publish latest packages from the master branch. +> Publishing manually should only be done for `alpha` or `beta` packages. The command will work for `latest` packages, but this should be avoided except in rare situations where the automatic publishing functionality is not working in CircleCI. diff --git a/README.md b/README.md index e4a52d2..a62e5a8 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,17 @@ # Highcharts Configurations -[![](https://img.shields.io/npm/v/@pxblue/highcharts.svg?label=@pxblue/highcharts&style=flat)](https://www.npmjs.com/package/@pxblue/highcharts) -[![](https://img.shields.io/circleci/project/github/pxblue/highcharts/master.svg?style=flat)](https://circleci.com/gh/pxblue/highcharts/tree/master) +[![](https://img.shields.io/npm/v/@brightlayer-ui/highcharts.svg?label=@brightlayer-ui/highcharts&style=flat)](https://www.npmjs.com/package/@brightlayer-ui/highcharts) +[![](https://img.shields.io/circleci/project/github/brightlayer-ui/highcharts/master.svg?style=flat)](https://circleci.com/gh/brightlayer-ui/highcharts/tree/master) -This package contains basic support for basic HighCharts line, pie, bar, and donut graphs for use with PX Blue. +This package contains basic support for basic HighCharts line, pie, bar, and donut graphs for use with Brightlayer UI. ## Installation Install with npm: ``` -npm install --save @pxblue/highcharts +npm install --save @brightlayer-ui/highcharts ``` or yarn ``` -yarn add @pxblue/highcharts +yarn add @brightlayer-ui/highcharts ``` ## Basic Usage @@ -23,7 +23,7 @@ import { createPieGraph, createDonutGraph, createBarGraph -} from '@pxblue/highcharts'; +} from '@brightlayer-ui/highcharts'; ``` and then use them as placeholders in your application. @@ -47,7 +47,7 @@ This will use the default sample data to render a chart in your application. Rea When you are ready to customize charts of your own, you can pass a configuration object into the chart generator functions. ``` -import { createPieChart } from '@pxblue/highcharts'; +import { createPieChart } from '@brightlayer-ui/highcharts'; ... let myPieConfig = { series: [{ @@ -71,16 +71,16 @@ This package also includes several utility functions and style variables to make ``` import { OpenSans, - pxblueColors, + bluiColors, sizes -} from '@pxblue/highcharts/styles'; +} from '@brightlayer-ui/highcharts/styles'; import { getRandomData, sharedTooltipFormatter, sharedTimeTooltipFormatter, simpleTooltipFormatter -} from '@pxblue/highcharts/utilities'; +} from '@brightlayer-ui/highcharts/utilities'; ``` ### Translations @@ -88,7 +88,7 @@ import { Several functions are provided that will translate the language and format of chart labels. These functions can be imported from the i18n file and accept a language locale string as their argument. ```tsx -import { getChartsLanguage, getChartsAxisDateTimeLabelFormats, getChartsTooltipDateTimeLabelFormats } from '@pxblue/highcharts'; +import { getChartsLanguage, getChartsAxisDateTimeLabelFormats, getChartsTooltipDateTimeLabelFormats } from '@brightlayer-ui/highcharts'; ... const langOptions = getChartsLanguage('fr'); const axisFormats = getChartsAxisDateTimeLabelFormats('fr'); @@ -112,5 +112,5 @@ const tooltipFormats = getChartsTooltipDateTimeLabelFormats('fr'); ## Demos | Framework | Live Examples | |-----------|--------------------------------------------------------------------------------------------------| -| Angular | [View on Stackblitz](https://stackblitz.com/github/pxblue/highcharts/tree/master/angular-demo) | -| React | [View on Code Sandbox](https://codesandbox.io/s/github/pxblue/highcharts/tree/master/react-demo) | \ No newline at end of file +| Angular | [View on Stackblitz](https://stackblitz.com/github/brightlayer-ui/highcharts/tree/master/angular-demo) | +| React | [View on Code Sandbox](https://codesandbox.io/s/github/brightlayer-ui/highcharts/tree/master/react-demo) | \ No newline at end of file diff --git a/angular-demo/.eslintrc.js b/angular-demo/.eslintrc.js index 3299e73..28fc407 100644 --- a/angular-demo/.eslintrc.js +++ b/angular-demo/.eslintrc.js @@ -1,11 +1,11 @@ -module.exports = { - root: true, - parser: '@typescript-eslint/parser', - extends: [ '@pxblue/eslint-config/ts' ], - parserOptions: { - project: "./tsconfig.json", - }, - env: { - browser: true - } - }; \ No newline at end of file +module.exports = { + root: true, + parser: '@typescript-eslint/parser', + extends: ['@brightlayer-ui/eslint-config/ts'], + parserOptions: { + project: "./tsconfig.json", + }, + env: { + browser: true + } +}; \ No newline at end of file diff --git a/angular-demo/README.md b/angular-demo/README.md index faa0f65..82b2583 100644 --- a/angular-demo/README.md +++ b/angular-demo/README.md @@ -1,14 +1,17 @@ # Highcharts Demo -This is a sample application demonstrating the PXBlue Highcharts library. -[View on Stackblitz](https://stackblitz.com/github/pxblue/highcharts/tree/master/angular-demo) +This is a sample application demonstrating the Brightlayer UI Highcharts library. + +[View on Stackblitz](https://stackblitz.com/github/brightlayer-ui/highcharts/tree/master/angular-demo) ## Running the Example + ``` -git clone https://github.com/pxblue/highcharts +git clone https://github.com/brightlayer-ui/highcharts cd highcharts yarn start:angular ``` + > **NOTE**: running the demo will use the latest src files from the repository and NOT the themes that are published on NPM. -For additional information read our [Angular Guide](https://pxblue.github.io/development/frameworks-web/angular) and our [Environment Setup](https://pxblue.github.io/development/environment) \ No newline at end of file +For additional information read our [Angular Guide](https://brightlayer-ui.github.io/development/frameworks-web/angular) and our [Environment Setup](https://brightlayer-ui.github.io/development/environment) diff --git a/angular-demo/package.json b/angular-demo/package.json index da93db1..947a0c7 100644 --- a/angular-demo/package.json +++ b/angular-demo/package.json @@ -26,8 +26,8 @@ "@angular/platform-browser-dynamic": "~11.2.7", "@angular/router": "~11.2.7", "@pxblue/angular-themes": "^6.0.1", - "@pxblue/colors": "^3.0.0", - "@pxblue/highcharts": "^2.1.0-beta.0", + "@brightlayer-ui/colors": "^3.0.1", + "@brightlayer-ui/highcharts": "^2.1.0-beta.0", "angular-highcharts": "^11.3.1", "highcharts": "^9.0.1", "rxjs": "~6.6.0", @@ -39,8 +39,8 @@ "@angular-devkit/build-angular": "~0.1102.6", "@angular/cli": "~11.2.6", "@angular/compiler-cli": "~11.2.7", - "@pxblue/eslint-config": "^2.0.4", - "@pxblue/prettier-config": "^1.0.2", + "@brightlayer-ui/eslint-config": "^2.0.5", + "@brightlayer-ui/prettier-config": "^1.0.3", "@types/jasmine": "~3.6.0", "@types/node": "^12.11.1", "@typescript-eslint/eslint-plugin": "^4.5.0", @@ -60,5 +60,5 @@ "ts-node": "~8.3.0", "typescript": "~4.1.5" }, - "prettier": "@pxblue/prettier-config" + "prettier": "@brightlayer-ui/prettier-config" } diff --git a/angular-demo/src/app/app.component.ts b/angular-demo/src/app/app.component.ts index 49f0448..e91d2b4 100755 --- a/angular-demo/src/app/app.component.ts +++ b/angular-demo/src/app/app.component.ts @@ -4,15 +4,15 @@ import { Component, OnInit } from '@angular/core'; import { Chart } from 'angular-highcharts'; -import { createLineChart, createBarChart, createPieChart, createDonutChart } from '@pxblue/highcharts'; -import * as PXBColors from '@pxblue/colors'; +import { createLineChart, createBarChart, createPieChart, createDonutChart } from '@brightlayer-ui/highcharts'; +import * as BLUIColors from '@brightlayer-ui/colors'; const mainConfig = { - colors: [PXBColors.blue[900], PXBColors.blue[500], PXBColors.blue[200]], + colors: [BLUIColors.blue[900], BLUIColors.blue[500], BLUIColors.blue[200]], }; const lineConfig = { - colors: [PXBColors.blue[500], PXBColors.blue[200], PXBColors.blue[200]], + colors: [BLUIColors.blue[500], BLUIColors.blue[200], BLUIColors.blue[200]], }; @Component({ diff --git a/angular-demo/src/index.html b/angular-demo/src/index.html index d145d88..1f08276 100644 --- a/angular-demo/src/index.html +++ b/angular-demo/src/index.html @@ -1,14 +1,17 @@ - - - angular-demo - - - - - - - - - + + + + angular-demo + + + + + + + + + + + \ No newline at end of file diff --git a/angular-demo/yarn.lock b/angular-demo/yarn.lock index 6dd87c3..de86030 100644 --- a/angular-demo/yarn.lock +++ b/angular-demo/yarn.lock @@ -1143,6 +1143,40 @@ lodash "^4.17.19" to-fast-properties "^2.0.0" +"@brightlayer-ui/colors@^3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@brightlayer-ui/colors/-/colors-3.0.1.tgz#f085acf6b6b4266a01798c78bc25841d15e44b3e" + integrity sha512-AE9F6FN1EQWMoqFTak6q8MN3wg9et2u2SUs6HjYhcS3GVSHjMWVSsuJZ2aD5Lu9409Gfi6pBHDWsJZ5PyeLsdQ== + dependencies: + "@brightlayer-ui/types" "^2.0.0" + +"@brightlayer-ui/eslint-config@^2.0.5": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@brightlayer-ui/eslint-config/-/eslint-config-2.0.5.tgz#b7ee0c47f4669d2ecefc45d5fc37d7a9e209ccc9" + integrity sha512-qUxNX/1z+cmBWzbOeFftxGD7SPT+xkT1rUj++xsZjIQajEkwF1Ka+0mRlSY5qqAsQpRLGDCHDszx8uztmSm1lA== + dependencies: + "@typescript-eslint/parser" "^4.8.0" + eslint-config-prettier ">= 6.3.0" + optionalDependencies: + eslint-plugin-react "^7.16.0" + +"@brightlayer-ui/highcharts@^2.1.0-beta.0": + version "2.1.0-beta.0" + resolved "https://registry.yarnpkg.com/@brightlayer-ui/highcharts/-/highcharts-2.1.0-beta.0.tgz#ef9c7ba65899f5844926822bc44f01e6899d5f0a" + integrity sha512-2UvleFg96PmVrC6TH+hbGTgjGhxQxmAqzWYauVgmx+t+2VF2jLOcR8R9ZKdSrvx6W2fVfFHEmpvzwsIL9Xhadg== + dependencies: + "@brightlayer-ui/colors" "^3.0.1" + +"@brightlayer-ui/prettier-config@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@brightlayer-ui/prettier-config/-/prettier-config-1.0.3.tgz#e40a7ae7435c6fd5118acbf249080e0aa81e93af" + integrity sha512-EYm3+V7Qd+oYEF+8FadsXAZqXryEHHbGnrV1BMp9selhABjceqUqXPVE4Sn3SKWQdBNJ3En2A3EzgrzRbvRTaw== + +"@brightlayer-ui/types@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@brightlayer-ui/types/-/types-2.0.0.tgz#d8adc0cdb96c164943adbad6e74043128a8b4112" + integrity sha512-DTCVwND6YC9qrkQl7pkFlN6QxDReJHtjuAiFU9HkXJN368vlw+fzHQ5/j4sB1sZl2eNwOgccv5ecl2XrlolOCw== + "@discoveryjs/json-ext@0.5.2": version "0.5.2" resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.2.tgz#8f03a22a04de437254e8ce8cc84ba39689288752" @@ -1288,28 +1322,6 @@ dependencies: "@pxblue/types" "^2.0.0" -"@pxblue/eslint-config@^2.0.4": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@pxblue/eslint-config/-/eslint-config-2.0.4.tgz#b22d637e2e8bbf1d8606de99bfd7e95f3af2ce34" - integrity sha512-PDBj5dhi/6c14/QYhoFLTkMnrYRTKw8hW7AuFq/9wc7pJ4MdSOF3i5MJH1NZ1p9chBl9na4ZASPeHWsDCvvk8A== - dependencies: - "@typescript-eslint/parser" "^4.8.0" - eslint-config-prettier ">= 6.3.0" - optionalDependencies: - eslint-plugin-react "^7.16.0" - -"@pxblue/highcharts@^2.1.0-beta.0": - version "2.1.0-beta.0" - resolved "https://registry.yarnpkg.com/@pxblue/highcharts/-/highcharts-2.1.0-beta.0.tgz#7e102ba7855c2de80b2bd8fabdc05fc7b30af4c3" - integrity sha512-1hWdKpYPtFWZAFjSeefWq+sLdP1erGoVEE1amoOf6Ncbs7rfXTrWnNVSut3hJXe6Ol49gFcMHPtAg1XG0vGLDw== - dependencies: - "@pxblue/colors" "^3.0.0" - -"@pxblue/prettier-config@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@pxblue/prettier-config/-/prettier-config-1.0.2.tgz#fb00503df6557b66c3d91d43c9101e614c35d2ec" - integrity sha512-/3cLBoTjZs3kV1ATPA/Sp0tsL7XmlV/b8HW/qt0jqR/uP5+cdXL2YIhMXQngLRa7PhpSkEiRIYK5sl0rKsXTUg== - "@pxblue/types@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@pxblue/types/-/types-2.0.0.tgz#3df970352aca5256974a10a97d75a2264bad1eba" diff --git a/link.sh b/link.sh index b8d748c..386d253 100755 --- a/link.sh +++ b/link.sh @@ -17,23 +17,23 @@ cd ../angular-demo && yarn install cd .. echo -e "${GREEN}Done${NC}" -echo -e "${BLUE}Building @pxblue/highcharts...${NC}" +echo -e "${BLUE}Building @brightlayer-ui/highcharts...${NC}" yarn build echo -e "${GREEN}Done${NC}" echo -e "${BLUE}Creating new folders in node_modules...${NC}" -rm -rf "./react-demo/node_modules/@pxblue/highcharts" -mkdir "./react-demo/node_modules/@pxblue/highcharts" -rm -rf "./angular-demo/node_modules/@pxblue/highcharts" -mkdir "./angular-demo/node_modules/@pxblue/highcharts" +rm -rf "./react-demo/node_modules/@brightlayer-ui/highcharts" +mkdir "./react-demo/node_modules/@brightlayer-ui/highcharts" +rm -rf "./angular-demo/node_modules/@brightlayer-ui/highcharts" +mkdir "./angular-demo/node_modules/@brightlayer-ui/highcharts" echo -e "${GREEN}Done${NC}" -echo -e "${BLUE}Linking @pxblue/highcharts into node_modules...${NC}"; -cp -r ./package.json ./react-demo/node_modules/@pxblue/highcharts/package.json -cp -r ./package.json ./angular-demo/node_modules/@pxblue/highcharts/package.json -cp -r ./dist ./react-demo/node_modules/@pxblue/highcharts -cp -r ./dist ./angular-demo/node_modules/@pxblue/highcharts +echo -e "${BLUE}Linking @brightlayer-ui/highcharts into node_modules...${NC}"; +cp -r ./package.json ./react-demo/node_modules/@brightlayer-ui/highcharts/package.json +cp -r ./package.json ./angular-demo/node_modules/@brightlayer-ui/highcharts/package.json +cp -r ./dist ./react-demo/node_modules/@brightlayer-ui/highcharts +cp -r ./dist ./angular-demo/node_modules/@brightlayer-ui/highcharts echo -e "${GREEN}Done${NC}" diff --git a/package.json b/package.json index 1e8e906..0795ff8 100644 --- a/package.json +++ b/package.json @@ -1,66 +1,68 @@ { - "name": "@pxblue/highcharts", - "version": "2.1.0", - "description": "Base configurations for assorted HighCharts graph types for PX Blue.", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "files": [ - "dist/", - "package.json", - "LICENSE", - "README.md", - "CHANGELOG.md" - ], - "prettier": "@pxblue/prettier-config", - "scripts": { - "build": "yarn && tsc", - "test": "jest src/**/** --passWithNoTests", - "test:angular": "cd angular-demo && yarn test && cd ..", - "test:react": "cd react-demo && yarn test && cd ..", - "test:build": "bash ./buildTest.sh", - "linkscript": "bash ./link.sh", - "start:angular": "yarn linkscript && cd angular-demo && yarn start", - "start:react": "yarn linkscript && cd react-demo && yarn start", - "lint": "eslint \"src/**/**.{tsx,ts}\"", - "lint:fix": "eslint \"src/**/**.{tsx,ts}\" --fix", - "prettier": "prettier \"src/**/**.{ts,tsx,js,jsx,json,css,scss,html}\" --write" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/pxblue/highcharts.git" - }, - "dependencies": { - "@pxblue/colors": "^3.0.0" - }, - "devDependencies": { - "@pxblue/eslint-config": "^2.0.3", - "@pxblue/prettier-config": "^1.0.2", - "@types/jest": "^26.0.0", - "@typescript-eslint/eslint-plugin": "^4.6.1", - "@typescript-eslint/parser": "^4.6.1", - "eslint": "^7.0.0", - "eslint-config-prettier": "^8.0.0", - "eslint-plugin-react": "^7.18.0", - "highcharts": "^9.0.0", - "jest": "26.6.0", - "prettier": "^2.0.0", - "ts-jest": "^26.4.3", - "typescript": "^4.0.0" - }, - "peerDependencies": { - "highcharts": ">=7.2.0" - }, - "keywords": [ - "Highcharts", - "Visualization", - "PXBlue", - "Chart", - "Graph" - ], - "author": "pxblue ", - "license": "BSD-3-Clause", - "bugs": { - "url": "https://github.com/pxblue/highchart/issues" - }, - "homepage": "https://github.com/pxblue/highcharts#readme" + "name": "@brightlayer-ui/highcharts", + "version": "2.1.0", + "description": "Base configurations for assorted HighCharts graph types for Brightlayer UI.", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "files": [ + "dist/", + "package.json", + "LICENSE", + "README.md", + "CHANGELOG.md" + ], + "prettier": "@brightlayer-ui/prettier-config", + "scripts": { + "build": "yarn && tsc", + "test": "jest src/**/** --passWithNoTests", + "test:angular": "cd angular-demo && yarn test && cd ..", + "test:react": "cd react-demo && yarn test && cd ..", + "test:build": "bash ./buildTest.sh", + "linkscript": "bash ./link.sh", + "prettier": "prettier \"src/**/**.{ts,tsx,js,jsx,json,css,scss,html}\" --write", + "publish:package": "set npm_config_yes=true && npx -p @brightlayer-ui/publish blui-publish", + "tag:package": "npx -p @brightlayer-ui/tag blui-tag", + "start:angular": "yarn linkscript && cd angular-demo && yarn start", + "start:react": "yarn linkscript && cd react-demo && yarn start", + "lint": "eslint \"src/**/**.{tsx,ts}\"", + "lint:fix": "eslint \"src/**/**.{tsx,ts}\" --fix" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/brightlayer-ui/highcharts.git" + }, + "dependencies": { + "@brightlayer-ui/colors": "^3.0.1" + }, + "devDependencies": { + "@brightlayer-ui/eslint-config": "^2.0.5", + "@brightlayer-ui/prettier-config": "^1.0.3", + "@types/jest": "^26.0.0", + "@typescript-eslint/eslint-plugin": "^4.6.1", + "@typescript-eslint/parser": "^4.6.1", + "eslint": "^7.0.0", + "eslint-config-prettier": "^8.0.0", + "eslint-plugin-react": "^7.18.0", + "highcharts": "^9.0.0", + "jest": "26.6.0", + "prettier": "^2.0.0", + "ts-jest": "^26.4.3", + "typescript": "^4.0.0" + }, + "peerDependencies": { + "highcharts": ">=7.2.0" + }, + "keywords": [ + "Highcharts", + "Visualization", + "Brightlayer-UI", + "Chart", + "Graph" + ], + "author": "Brightlayer UI ", + "license": "BSD-3-Clause", + "bugs": { + "url": "https://github.com/brightlayer-ui/highchart/issues" + }, + "homepage": "https://github.com/brightlayer-ui/highcharts#readme" } diff --git a/react-demo/.eslintrc.js b/react-demo/.eslintrc.js index f9533e0..5821717 100644 --- a/react-demo/.eslintrc.js +++ b/react-demo/.eslintrc.js @@ -1,7 +1,7 @@ module.exports = { root: true, parser: '@typescript-eslint/parser', - extends: ['@pxblue/eslint-config/tsx'], + extends: ['@brightlayer-ui/eslint-config/tsx'], parserOptions: { project: "./tsconfig.json", }, diff --git a/react-demo/README.md b/react-demo/README.md index 6b7af59..76d96d4 100644 --- a/react-demo/README.md +++ b/react-demo/README.md @@ -1,14 +1,17 @@ # Highcharts Demo -This is a sample application demonstrating the PXBlue Highcharts library. -[View on CodeSandbox](https://codesandbox.io/s/github/pxblue/highcharts/tree/master/react-demo) +This is a sample application demonstrating the Brightlayer UI Highcharts library. + +[View on CodeSandbox](https://codesandbox.io/s/github/brightlayer-ui/highcharts/tree/master/react-demo) ## Running the Example + ``` -git clone https://github.com/pxblue/highcharts +git clone https://github.com/brightlayer-ui/highcharts cd highcharts yarn start:react ``` + > **NOTE**: running the demo will use the latest src files from the repository and NOT the themes that are published on NPM. -For additional information read our [React Guide](https://pxblue.github.io/development/frameworks-web/react) and our [Environment Setup](https://pxblue.github.io/development/environment) \ No newline at end of file +For additional information read our [React Guide](https://brightlayer-ui.github.io/development/frameworks-web/react) and our [Environment Setup](https://brightlayer-ui.github.io/development/environment) diff --git a/react-demo/package.json b/react-demo/package.json index 5a746eb..aaf0155 100644 --- a/react-demo/package.json +++ b/react-demo/package.json @@ -5,8 +5,8 @@ "dependencies": { "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", - "@pxblue/colors": "^3.0.0", - "@pxblue/highcharts": "^2.1.0-beta.0", + "@brightlayer-ui/colors": "^3.0.1", + "@brightlayer-ui/highcharts": "^2.1.0-beta.0", "@pxblue/icons-mui": "^2.2.1", "@pxblue/react-themes": "^6.0.0", "@testing-library/jest-dom": "^5.11.4", @@ -56,8 +56,8 @@ ] }, "devDependencies": { - "@pxblue/eslint-config": "^2.0.4", - "@pxblue/prettier-config": "^1.0.2", + "@brightlayer-ui/eslint-config": "^2.0.5", + "@brightlayer-ui/prettier-config": "^1.0.3", "@types/jest": "^26.0.15", "@types/node": "^12.0.0", "@types/react": "^17.0.0", @@ -72,5 +72,5 @@ "jest": "26.6.0", "prettier": "^2.1.2" }, - "prettier": "@pxblue/prettier-config" + "prettier": "@brightlayer-ui/prettier-config" } diff --git a/react-demo/src/App.tsx b/react-demo/src/App.tsx index 49e2c1b..f835e35 100644 --- a/react-demo/src/App.tsx +++ b/react-demo/src/App.tsx @@ -3,15 +3,15 @@ import React from 'react'; import ReactHighcharts from 'react-highcharts'; // @ts-ignore -import { createLineChart, createBarChart, createPieChart, createDonutChart } from '@pxblue/highcharts'; -import * as PXBColors from '@pxblue/colors'; +import { createLineChart, createBarChart, createPieChart, createDonutChart } from '@brightlayer-ui/highcharts'; +import * as BLUIColors from '@brightlayer-ui/colors'; const mainConfig = { - colors: [PXBColors.blue[900], PXBColors.blue[500], PXBColors.blue[200]], + colors: [BLUIColors.blue[900], BLUIColors.blue[500], BLUIColors.blue[200]], }; const lineConfig = { - colors: [PXBColors.blue[500], PXBColors.blue[200], PXBColors.blue[200]], + colors: [BLUIColors.blue[500], BLUIColors.blue[200], BLUIColors.blue[200]], }; const graphStyles = { diff --git a/react-demo/yarn.lock b/react-demo/yarn.lock index 00c2db0..d0b093e 100644 --- a/react-demo/yarn.lock +++ b/react-demo/yarn.lock @@ -1165,6 +1165,40 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@brightlayer-ui/colors@^3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@brightlayer-ui/colors/-/colors-3.0.1.tgz#f085acf6b6b4266a01798c78bc25841d15e44b3e" + integrity sha512-AE9F6FN1EQWMoqFTak6q8MN3wg9et2u2SUs6HjYhcS3GVSHjMWVSsuJZ2aD5Lu9409Gfi6pBHDWsJZ5PyeLsdQ== + dependencies: + "@brightlayer-ui/types" "^2.0.0" + +"@brightlayer-ui/eslint-config@^2.0.5": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@brightlayer-ui/eslint-config/-/eslint-config-2.0.5.tgz#b7ee0c47f4669d2ecefc45d5fc37d7a9e209ccc9" + integrity sha512-qUxNX/1z+cmBWzbOeFftxGD7SPT+xkT1rUj++xsZjIQajEkwF1Ka+0mRlSY5qqAsQpRLGDCHDszx8uztmSm1lA== + dependencies: + "@typescript-eslint/parser" "^4.8.0" + eslint-config-prettier ">= 6.3.0" + optionalDependencies: + eslint-plugin-react "^7.16.0" + +"@brightlayer-ui/highcharts@^2.1.0-beta.0": + version "2.1.0-beta.0" + resolved "https://registry.yarnpkg.com/@brightlayer-ui/highcharts/-/highcharts-2.1.0-beta.0.tgz#ef9c7ba65899f5844926822bc44f01e6899d5f0a" + integrity sha512-2UvleFg96PmVrC6TH+hbGTgjGhxQxmAqzWYauVgmx+t+2VF2jLOcR8R9ZKdSrvx6W2fVfFHEmpvzwsIL9Xhadg== + dependencies: + "@brightlayer-ui/colors" "^3.0.1" + +"@brightlayer-ui/prettier-config@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@brightlayer-ui/prettier-config/-/prettier-config-1.0.3.tgz#e40a7ae7435c6fd5118acbf249080e0aa81e93af" + integrity sha512-EYm3+V7Qd+oYEF+8FadsXAZqXryEHHbGnrV1BMp9selhABjceqUqXPVE4Sn3SKWQdBNJ3En2A3EzgrzRbvRTaw== + +"@brightlayer-ui/types@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@brightlayer-ui/types/-/types-2.0.0.tgz#d8adc0cdb96c164943adbad6e74043128a8b4112" + integrity sha512-DTCVwND6YC9qrkQl7pkFlN6QxDReJHtjuAiFU9HkXJN368vlw+fzHQ5/j4sB1sZl2eNwOgccv5ecl2XrlolOCw== + "@cnakazawa/watch@^1.0.3": version "1.0.4" resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.4.tgz#f864ae85004d0fcab6f50be9141c4da368d1656a" @@ -1546,33 +1580,11 @@ dependencies: "@pxblue/types" "^2.0.0" -"@pxblue/eslint-config@^2.0.4": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@pxblue/eslint-config/-/eslint-config-2.0.4.tgz#b22d637e2e8bbf1d8606de99bfd7e95f3af2ce34" - integrity sha512-PDBj5dhi/6c14/QYhoFLTkMnrYRTKw8hW7AuFq/9wc7pJ4MdSOF3i5MJH1NZ1p9chBl9na4ZASPeHWsDCvvk8A== - dependencies: - "@typescript-eslint/parser" "^4.8.0" - eslint-config-prettier ">= 6.3.0" - optionalDependencies: - eslint-plugin-react "^7.16.0" - -"@pxblue/highcharts@^2.1.0-beta.0": - version "2.1.0-beta.0" - resolved "https://registry.yarnpkg.com/@pxblue/highcharts/-/highcharts-2.1.0-beta.0.tgz#7e102ba7855c2de80b2bd8fabdc05fc7b30af4c3" - integrity sha512-1hWdKpYPtFWZAFjSeefWq+sLdP1erGoVEE1amoOf6Ncbs7rfXTrWnNVSut3hJXe6Ol49gFcMHPtAg1XG0vGLDw== - dependencies: - "@pxblue/colors" "^3.0.0" - "@pxblue/icons-mui@^2.2.1": version "2.3.0" resolved "https://registry.yarnpkg.com/@pxblue/icons-mui/-/icons-mui-2.3.0.tgz#5398630529e5a89b2c93d13db7ccf86f14b8ab51" integrity sha512-GzqkkSKFYgaSy1/LITheqI3BSxPthXE6UrCAz5Ubk1btwDajSvw0O5YR3/b4h7p9vfk/fIxSYgztW8H2/1i4Eg== -"@pxblue/prettier-config@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@pxblue/prettier-config/-/prettier-config-1.0.2.tgz#fb00503df6557b66c3d91d43c9101e614c35d2ec" - integrity sha512-/3cLBoTjZs3kV1ATPA/Sp0tsL7XmlV/b8HW/qt0jqR/uP5+cdXL2YIhMXQngLRa7PhpSkEiRIYK5sl0rKsXTUg== - "@pxblue/react-themes@^6.0.0": version "6.0.0" resolved "https://registry.yarnpkg.com/@pxblue/react-themes/-/react-themes-6.0.0.tgz#35ce84165263d8721bde638ed594f820c408727c" diff --git a/src/index.ts b/src/index.ts index 843519c..2064dbc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,5 @@ /** -Copyright (c) 2018-present, Eaton +Copyright (c) 2021-present, Eaton All rights reserved. @@ -13,7 +13,7 @@ This code is licensed under the BSD-3 license found in the LICENSE file in the r sample data to ensure the charts will render even when no config is supplied. */ -import { OpenSans, pxblueColors, sizes } from './styles'; +import { OpenSans, bluiColors, sizes } from './styles'; import { getRandomData, sharedTooltipFormatter, sharedTimeTooltipFormatter, simpleTooltipFormatter } from './utilities'; @@ -99,7 +99,7 @@ export const createPieChart = ({ series: series || [ { name: 'Browsers', - colors: colors || pxblueColors, + colors: colors || bluiColors, type: 'pie', data: [ { @@ -184,7 +184,7 @@ export const createLineChart = ({ }, chart ), - colors: colors || pxblueColors, + colors: colors || bluiColors, credits: { enabled: false, }, @@ -306,7 +306,7 @@ export const createBarChart = ({ }, chart ), - colors: colors || pxblueColors, + colors: colors || bluiColors, credits: { enabled: false, }, @@ -496,7 +496,7 @@ export const createDonutChart = ({ { name: 'Browsers', showInLegend: false, - colors: colors || pxblueColors, + colors: colors || bluiColors, type: 'pie', data: [ { diff --git a/src/styles/index.ts b/src/styles/index.ts index 15aa97d..422c55d 100644 --- a/src/styles/index.ts +++ b/src/styles/index.ts @@ -9,27 +9,27 @@ This code is licensed under the BSD-3 license found in the LICENSE file in the r /* This file contains various elements used to style the charts. - pxblueColors: an array of pxblue 500 and 300 level colors + bluiColors: an array of Brightlayer UI 500 and 300 level colors sizes: an array of font sizes for various chart elements */ -import * as PXBColors from '@pxblue/colors'; +import * as BLUIColors from '@brightlayer-ui/colors'; export const OpenSans = 'Open Sans'; -export const pxblueColors: string[] = [ - PXBColors.blue[500], - PXBColors.red[500], - PXBColors.green[500], - PXBColors.purple[500], - PXBColors.orange[500], - PXBColors.gold[500], - PXBColors.yellow[500], - PXBColors.blue[300], - PXBColors.red[300], - PXBColors.green[300], - PXBColors.purple[300], - PXBColors.orange[300], - PXBColors.gold[300], - PXBColors.yellow[300], +export const bluiColors: string[] = [ + BLUIColors.blue[500], + BLUIColors.red[500], + BLUIColors.green[500], + BLUIColors.purple[500], + BLUIColors.orange[500], + BLUIColors.gold[500], + BLUIColors.yellow[500], + BLUIColors.blue[300], + BLUIColors.red[300], + BLUIColors.green[300], + BLUIColors.purple[300], + BLUIColors.orange[300], + BLUIColors.gold[300], + BLUIColors.yellow[300], ]; export const sizes = { diff --git a/yarn.lock b/yarn.lock index 433d0ba..b38857c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -297,6 +297,33 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@brightlayer-ui/colors@^3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@brightlayer-ui/colors/-/colors-3.0.1.tgz#f085acf6b6b4266a01798c78bc25841d15e44b3e" + integrity sha512-AE9F6FN1EQWMoqFTak6q8MN3wg9et2u2SUs6HjYhcS3GVSHjMWVSsuJZ2aD5Lu9409Gfi6pBHDWsJZ5PyeLsdQ== + dependencies: + "@brightlayer-ui/types" "^2.0.0" + +"@brightlayer-ui/eslint-config@^2.0.5": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@brightlayer-ui/eslint-config/-/eslint-config-2.0.5.tgz#b7ee0c47f4669d2ecefc45d5fc37d7a9e209ccc9" + integrity sha512-qUxNX/1z+cmBWzbOeFftxGD7SPT+xkT1rUj++xsZjIQajEkwF1Ka+0mRlSY5qqAsQpRLGDCHDszx8uztmSm1lA== + dependencies: + "@typescript-eslint/parser" "^4.8.0" + eslint-config-prettier ">= 6.3.0" + optionalDependencies: + eslint-plugin-react "^7.16.0" + +"@brightlayer-ui/prettier-config@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@brightlayer-ui/prettier-config/-/prettier-config-1.0.3.tgz#e40a7ae7435c6fd5118acbf249080e0aa81e93af" + integrity sha512-EYm3+V7Qd+oYEF+8FadsXAZqXryEHHbGnrV1BMp9selhABjceqUqXPVE4Sn3SKWQdBNJ3En2A3EzgrzRbvRTaw== + +"@brightlayer-ui/types@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@brightlayer-ui/types/-/types-2.0.0.tgz#d8adc0cdb96c164943adbad6e74043128a8b4112" + integrity sha512-DTCVwND6YC9qrkQl7pkFlN6QxDReJHtjuAiFU9HkXJN368vlw+fzHQ5/j4sB1sZl2eNwOgccv5ecl2XrlolOCw== + "@cnakazawa/watch@^1.0.3": version "1.0.4" resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.4.tgz#f864ae85004d0fcab6f50be9141c4da368d1656a" @@ -528,33 +555,6 @@ "@nodelib/fs.scandir" "2.1.4" fastq "^1.6.0" -"@pxblue/colors@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@pxblue/colors/-/colors-3.0.0.tgz#080fb5cfd5a08fea018ece7cac8022ed38f7878f" - integrity sha512-rMFW4an1V9M5KX4BiNzrbbaYe2fic4o9iGL8/bPYvITbeiwgAapyFX0VbMIoo8XKlIbNaxyn7oWnrxzI/tp8Rw== - dependencies: - "@pxblue/types" "^2.0.0" - -"@pxblue/eslint-config@^2.0.3": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@pxblue/eslint-config/-/eslint-config-2.0.4.tgz#b22d637e2e8bbf1d8606de99bfd7e95f3af2ce34" - integrity sha512-PDBj5dhi/6c14/QYhoFLTkMnrYRTKw8hW7AuFq/9wc7pJ4MdSOF3i5MJH1NZ1p9chBl9na4ZASPeHWsDCvvk8A== - dependencies: - "@typescript-eslint/parser" "^4.8.0" - eslint-config-prettier ">= 6.3.0" - optionalDependencies: - eslint-plugin-react "^7.16.0" - -"@pxblue/prettier-config@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@pxblue/prettier-config/-/prettier-config-1.0.2.tgz#fb00503df6557b66c3d91d43c9101e614c35d2ec" - integrity sha512-/3cLBoTjZs3kV1ATPA/Sp0tsL7XmlV/b8HW/qt0jqR/uP5+cdXL2YIhMXQngLRa7PhpSkEiRIYK5sl0rKsXTUg== - -"@pxblue/types@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@pxblue/types/-/types-2.0.0.tgz#3df970352aca5256974a10a97d75a2264bad1eba" - integrity sha512-rHABCqYALGjrDxdCfw/v4mFsHhE9y9+vdSD3VHfIzA3HY1g1Bp/VWwEuEXWbtj2H5n75D+jkMQZ0rTqSKY3vLw== - "@sinonjs/commons@^1.7.0": version "1.8.2" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.2.tgz#858f5c4b48d80778fde4b9d541f27edc0d56488b"