Skip to content

Commit

Permalink
build: migrate to nimbus (#8)
Browse files Browse the repository at this point in the history
* build: migrate to nimbus

* fix: eslint-disable statements

* fix: conflict

* fix: lint

* fix: lints

* fix: bump packages
  • Loading branch information
kristw authored and zhaoyongjie committed Nov 30, 2021
1 parent b50ab75 commit b7ec4bf
Show file tree
Hide file tree
Showing 38 changed files with 238 additions and 236 deletions.
Original file line number Diff line number Diff line change
@@ -1,30 +1,56 @@
.babelrc
.cache
.cache-loader
.DS_Store
*.DS_Store

# Logs
logs/
*.log

# Cache
.bundle/
.happo/
.idea/
.next/
.cache
.eslintcache
.eslintignore
.eslintrc.js
.idea
.npm
.prettierignore
.vscode
.yarnclean

*.log
*.map
*.min.js

babel.config.js
# Directories
build/
coverage/
dist/
esm/
jest.config.js
lib/
logs/
public/
node_modules/
package-lock.json
tmp/

# Custom
*.map
*.min.js
test-changelog.md

# Configs (provided by Nimbus)
.babelrc
.eslintignore
.eslintrc.js
.flowconfig
.prettierignore
babel.config.js
jest.config.js
prettier.config.js
tsconfig.eslint.json
tsconfig.json
tsconfig.options.json
*.tsbuildinfo
webpack.config.js

# Lock files, libs should not have lock files
npm-shrinkwrap.json
package-lock.json
yarn.lock
old-yarn.lock
.*.swp
_gh-pages
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# @superset-ui/plugins-deckgl 🔌💡

[![Codecov branch](https://img.shields.io/codecov/c/github/apache-superset/superset-ui-plugins-deckgl/master.svg?style=flat-square)](https://codecov.io/gh/apache-superset/superset-ui-plugins-deckgl/branch/master)
[![Build Status](https://img.shields.io/travis/com/apache-superset/superset-ui-plugins-deckgl/master.svg?style=flat-square
)](https://travis-ci.com/apache-superset/superset-ui-plugins-deckgl)
[![Build Status](https://img.shields.io/travis/com/apache-superset/superset-ui-plugins-deckgl/master.svg?style=flat-square)](https://travis-ci.com/apache-superset/superset-ui-plugins-deckgl)
[![David](https://img.shields.io/david/dev/apache-superset/superset-ui-plugins-deckgl.svg?style=flat-square)](https://david-dm.org/apache-superset/superset-ui-plugins-deckgl?type=dev)
[![Netlify Status](https://api.netlify.com/api/v1/badges/4d054ead-0e76-4e03-b684-797ca5924161/deploy-status)](https://app.netlify.com/sites/superset-ui-plugins-deckgl/deploys)

Expand All @@ -14,14 +13,16 @@ Current master: https://superset-ui-plugins-deckgl.netlify.com

## Packages

| Package | Version |
|--|--|
| Package | Version |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [@superset-ui/legacy-preset-chart-deckgl](https://github.com/apache-superset/superset-ui-plugins-deckgl/tree/master/packages/superset-ui-legacy-preset-chart-deckgl) | [![Version](https://img.shields.io/npm/v/@superset-ui/legacy-preset-chart-deckgl.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/legacy-preset-chart-deckgl.svg?style=flat-square) |

## Contribution and development guide

Please read the [contributing guidelines](https://github.com/apache-superset/superset-ui/blob/master/CONTRIBUTING.md) which include development environment setup
and other things you should know about coding in this repo.
Please read the
[contributing guidelines](https://github.com/apache-superset/superset-ui/blob/master/CONTRIBUTING.md)
which include development environment setup and other things you should know about coding in this
repo.

### License

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,28 @@
"description": "Superset UI Plugins - deck.gl",
"private": true,
"scripts": {
"build": "yarn build:cjs && yarn build:esm && yarn run type:dts && yarn build:assets",
"build:cjs": "NODE_ENV=production beemo babel --extensions=\".js,.jsx,.ts,.tsx\" ./src --out-dir lib/ --delete-dir-on-start --minify --workspaces=\"@superset-ui/!(plugins-demo)\"",
"build:esm": "NODE_ENV=production beemo babel --extensions=\".js,.jsx,.ts,.tsx\" ./src --out-dir esm/ --delete-dir-on-start --esm --minify --workspaces=\"@superset-ui/!(plugins-demo)\"",
"build:assets": "node ./buildAssets.js",
"build": "yarn babel && yarn type && yarn build:assets",
"babel": "yarn babel:cjs && yarn babel:esm",
"babel:cjs": "nimbus babel --clean --workspaces=\"@superset-ui/!(plugins-demo)\"",
"babel:esm": "nimbus babel --clean --workspaces=\"@superset-ui/!(plugins-demo)\" --esm",
"build:assets": "node ./scripts/buildAssets.js",
"clean": "rm -rf ./packages/**/{lib,esm}",
"commit": "superset-commit",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
"type": "NODE_ENV=production beemo typescript --workspaces=\"@superset-ui/((preset|plugin)-*)\" --noEmit",
"type:dts": "NODE_ENV=production beemo typescript --workspaces=\"@superset-ui/((preset|plugin)-*)\" --emitDeclarationOnly",
"lint": "beemo create-config prettier && beemo eslint \"./packages/*/{src,test,storybook}/**/*.{js,jsx,ts,tsx}\"",
"lint:fix": "beemo create-config prettier && beemo eslint --fix \"./packages/*/{src,test,storybook}/**/*.{js,jsx,ts,tsx}\"",
"jest": "beemo jest --color --coverage --react",
"format": "yarn prettier --write",
"jest": "NODE_ENV=test nimbus jest --coverage --verbose",
"lint": "nimbus eslint && nimbus prettier --check",
"lint:fix": "nimbus eslint --fix",
"prettier": "nimbus prettier",
"test": "yarn type",
"test:watch": "yarn lint:fix && yarn jest --watch",
"type": "nimbus typescript --build --reference-workspaces",
"prepare-release": "git checkout master && git pull --rebase origin master && lerna bootstrap && yarn install && yarn test",
"prerelease": "yarn build",
"pretest": "yarn lint",
"release": "yarn prepare-release && lerna publish --exact && yarn postrelease",
"postrelease": "lerna run deploy-demo",
"prepare-release": "git checkout master && git pull --rebase origin master && lerna bootstrap && yarn run test",
"prerelease": "yarn run build",
"pretest": "yarn run lint",
"prettier": "beemo prettier \"./packages/*/{src,test,storybook}/**/*.{js,jsx,ts,tsx,json,md}\"",
"release": "yarn run prepare-release && lerna publish && yarn run postrelease",
"test": "yarn run type && yarn run jest",
"test:watch": "yarn run lint:fix && beemo create-config jest --react && jest --watch"
"storybook": "cd packages/superset-ui-plugins-demo && yarn storybook"
},
"repository": "https://github.com/apache-superset/superset-ui-plugins-deckgl.git",
"keywords": [
Expand All @@ -33,65 +36,99 @@
"analysis",
"visualization",
"react",
"d3",
"data-ui",
"vx"
"d3"
],
"license": "Apache-2.0",
"devDependencies": {
"@superset-ui/build-config": "^0.1.0",
"@superset-ui/chart": "^0.12.1",
"@superset-ui/chart-composition": "^0.12.1",
"@superset-ui/color": "^0.12.1",
"@airbnb/config-babel": "^2.1.3",
"@airbnb/config-eslint": "^2.1.3",
"@airbnb/config-jest": "^2.1.3",
"@airbnb/config-prettier": "^2.0.4",
"@airbnb/config-typescript": "^2.1.2",
"@airbnb/nimbus": "^2.1.3",
"@babel/plugin-transform-runtime": "^7.8.3",
"@superset-ui/commit-config": "^0.0.9",
"@superset-ui/connection": "^0.12.0",
"@superset-ui/core": "^0.12.0",
"@superset-ui/dimension": "^0.12.0",
"@superset-ui/number-format": "^0.12.1",
"@superset-ui/query": "^0.12.2",
"@superset-ui/time-format": "^0.12.1",
"@superset-ui/translation": "^0.12.0",
"@types/react": "^16.8.8",
"core-js": "^3.0.1",
"@superset-ui/superset-ui": "^0.12.5",
"@types/enzyme": "^3.10.3",
"@types/jest": "^25.1.1",
"@types/jsdom": "^12.2.4",
"@types/react": "^16.9.0",
"@types/react-test-renderer": "^16.9.0",
"csstype": "^2.6.3",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.15.1",
"enzyme-to-json": "^3.4.3",
"fast-glob": "^3.0.1",
"fs-extra": "^8.0.1",
"husky": "^3.0.3",
"lerna": "^3.2.1",
"lint-staged": "^9.2.1",
"luma.gl": "^7.3.0",
"react": "^16.6.0",
"react-dom": "^16.6.0",
"yarn": "^1.9.4"
"husky": "^4.2.1",
"jest-mock-console": "^1.0.0",
"lerna": "^3.15.0",
"lint-staged": "^10.0.7",
"luma.gl": "^7.3.2",
"react-test-renderer": "^16.9.0",
"react-dom": "^16.9.0",
"react": "^16.9.0"
},
"engines": {
"node": ">=8.10.0"
"node": ">=10.10.0",
"npm": ">=6.8.0",
"yarn": ">=1.13.0"
},
"beemo": {
"module": "@superset-ui/build-config",
"workspaces": [
"./packages/*"
],
"nimbus": {
"drivers": [
"babel",
"eslint",
{
"driver": "jest",
"env": {
"NODE_ENV": "test"
}
},
"jest",
"prettier",
"typescript"
],
"settings": {
"library": true,
"react": true,
"next": true,
"env": {
"corejs": 3,
"useBuiltIns": "usage"
}
},
"babel": {
"plugins": [["@babel/plugin-transform-runtime", { "corejs": 3 }]]
},
"jest": {
"timers": "real",
"setupFilesAfterEnv": [
"@airbnb/config-jest/enzyme"
],
"coverageThreshold": {
"global": {
"branches": 0,
"functions": 0,
"lines": 0,
"statements": 0
}
}
},
"eslint": {
"overrides": [
{
"files": "*.{js,jsx,ts,tsx}",
"rules": {
"react/jsx-no-literals": "off",
"prefer-exponentiation-operator": "off",
"@typescript-eslint/no-explicit-any": ["warn", { "fixToUnknown": false }]
}
}
]
},
"typescript": {
"compilerOptions": {
"typeRoots": [
"../../node_modules/vega-lite/typings"
]
"emitDeclarationOnly": true
}
}
},
"workspaces": [
"./packages/*"
],
"husky": {
"hooks": {
"pre-commit": "lint-staged",
Expand All @@ -100,7 +137,7 @@
},
"lint-staged": {
"./packages/*/{src,test,storybook}/**/*.{js,jsx,ts,tsx,json,md}": [
"yarn run prettier --write",
"yarn prettier --write",
"git add"
]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* eslint-disable react/jsx-handler-names */
/* eslint-disable react/destructuring-assignment */
/* eslint-disable react/jsx-sort-default-props */
/* eslint-disable react/sort-prop-types */
/* eslint-disable react/forbid-prop-types */
/* eslint-disable sort-keys */
/* eslint-disable react/require-default-props */
/**
* Licensed to the Apache Software Foundation (ASF) under one
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
/* eslint-disable react/sort-prop-types */
/* eslint-disable react/require-default-props */
/* eslint-disable react/no-unused-prop-types */
/* eslint-disable react/forbid-prop-types */
/* eslint-disable react/no-access-state-in-setstate */
/* eslint-disable compat/compat */
/* eslint-disable react/destructuring-assignment */
/* eslint-disable react/jsx-handler-names */
/* eslint-disable react/no-unsafe */
/* eslint-disable react/sort-comp */
/* eslint-disable camelcase */
/* eslint-disable no-prototype-builtins */
/* eslint-disable sort-keys */
/* eslint-disable no-eq-null */
/* eslint-disable no-magic-numbers */
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down Expand Up @@ -107,6 +99,7 @@ export default class CategoricalDeckGLContainer extends React.PureComponent {
});
}

// eslint-disable-next-line class-methods-use-this
getStateFromProps(props, state) {
const features = props.payload.data.features || [];
const timestamps = features.map(f => f.__timestamp);
Expand Down Expand Up @@ -178,6 +171,7 @@ export default class CategoricalDeckGLContainer extends React.PureComponent {
return [getLayer(fd, filteredPayload, onAddFilter, setTooltip)];
}

// eslint-disable-next-line class-methods-use-this
addColor(data, fd) {
const c = fd.color_picker || { r: 0, g: 0, b: 0, a: 1 };
const colorFn = getScale(fd.color_scheme);
Expand Down Expand Up @@ -233,7 +227,6 @@ export default class CategoricalDeckGLContainer extends React.PureComponent {
end={this.state.end}
getStep={this.state.getStep}
values={this.state.values}
onValuesChange={this.onValuesChange}
disabled={this.state.disabled}
viewport={this.state.viewport}
mapboxApiAccessToken={this.props.mapboxApiKey}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable react/jsx-sort-default-props */
/* eslint-disable react/sort-prop-types */
/* eslint-disable react/jsx-handler-names */
/* eslint-disable react/destructuring-assignment */
/* eslint-disable sort-keys */
/* eslint-disable react/forbid-prop-types */
/**
* Licensed to the Apache Software Foundation (ASF) under one
Expand Down Expand Up @@ -98,13 +98,13 @@ export default class DeckGLContainer extends React.Component {
return (
<div style={{ position: 'relative', width, height: adjustedHeight }}>
<DeckGL
initWebGLParameters
controller
width={width}
height={adjustedHeight}
layers={layers}
viewState={viewState}
onViewStateChange={this.onViewStateChange}
initWebGLParameters
controller
>
<StaticMap
mapStyle={this.props.mapStyle}
Expand Down

0 comments on commit b7ec4bf

Please sign in to comment.