Skip to content

Commit

Permalink
build: migrate to nimbus and fix build (apache#319)
Browse files Browse the repository at this point in the history
* build: change gitignore and update package.json

* fix: importing issues

* fix: missing reference

* build: move buildAssets script

* fix: prettier

* fix: lints jsx-sort-default-props, sort-prop-types

* fix: more lints jsx-sort-default-props, sort-prop-types

* fix: remove all unnecessary eslint-disable

* fix: export default type

* fix: use .forEach instead of for...of

* fix: package.json

* fix: ts issue

* fix: webpack config

* fix: issue with for loop

* fix: parallel coordinates

* fix: parallel coordinates

* fix: add prettier check

Co-Authored-By: Evan Rusackas <evan@preset.io>

* build: change type:dts to type

* fix: bring back Math.pow

* fix: use optional

* fix: bring back .0

* fix: declare word in the loop

* fix: for loop in sunburst

Co-authored-by: Evan Rusackas <evan@preset.io>
  • Loading branch information
2 people authored and zhaoyongjie committed Nov 25, 2021
1 parent 983de5e commit 2b8e1f5
Show file tree
Hide file tree
Showing 125 changed files with 570 additions and 479 deletions.
Original file line number Diff line number Diff line change
@@ -1,31 +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
.*.swp

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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,27 @@
"description": "Superset UI Plugins",
"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",
"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"
"format": "yarn prettier --write",
"jest": "NODE_ENV=test nimbus jest --coverage --verbose",
"lint": "nimbus eslint && nimbus prettier --check",
"lint:fix": "yarn lint --fix",
"prettier": "nimbus prettier",
"test": "yarn type && yarn jest",
"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"
},
"repository": "https://github.com/apache-superset/superset-ui-plugins.git",
"keywords": [
Expand All @@ -39,23 +41,33 @@
],
"license": "Apache-2.0",
"devDependencies": {
"@superset-ui/build-config": "^0.2.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/superset-ui": "^0.12.5",
"@types/react": "^16.8.8",
"core-js": "^3.0.1",
"@types/enzyme": "^3.10.3",
"@types/jest": "^24.0.18",
"@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",
"react": "^16.6.0",
"react-dom": "^16.6.0",
"yarn": "^1.9.4"
},
"engines": {
"node": ">=8.10.0"
"husky": "^3.0.1",
"jest-mock-console": "^1.0.0",
"lerna": "^3.15.0",
"lint-staged": "^9.2.5",
"react-test-renderer": "^16.9.0",
"react-dom": "^16.9.0",
"react": "^16.9.0"
},
"beemo": {
"module": "@superset-ui/build-config",
Expand All @@ -79,9 +91,78 @@
}
}
},
"engines": {
"node": ">=10.10.0",
"npm": ">=6.8.0",
"yarn": ">=1.13.0"
},
"workspaces": [
"./packages/*"
],
"nimbus": {
"drivers": [
"babel",
"eslint",
"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": 1,
"functions": 1,
"lines": 1,
"statements": 1
}
}
},
"eslint": {
"overrides": [
{
"files": "*.test.{js,jsx,ts,tsx}",
"rules": {
"import/no-extraneous-dependencies": "off",
"promise/param-names": "off",
"import/extensions": "off",
"jest/require-to-throw-message": "off",
"jest/no-test-return-statement": "off",
"jest/no-expect-resolves": "off",
"jest/no-test-callback": "off"
}
},
{
"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": {
"emitDeclarationOnly": true
}
}
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
Expand All @@ -90,7 +171,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
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

.superset-legacy-chart-calendar {
.superset-legacy-chart-calendar {
padding: 10px;
position: static !important;
overflow: auto !important;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
/* eslint-disable sort-keys, no-magic-numbers, react/forbid-prop-types */
import PropTypes from 'prop-types';
import { extent as d3Extent, range as d3Range } from 'd3-array';
import { select as d3Select } from 'd3-selection';
Expand Down Expand Up @@ -54,8 +53,11 @@ const propTypes = {
subdomain: PropTypes.string,
}),
height: PropTypes.number,
// eslint-disable-next-line react/sort-prop-types
cellPadding: PropTypes.number,
// eslint-disable-next-line react/sort-prop-types
cellRadius: PropTypes.number,
// eslint-disable-next-line react/sort-prop-types
cellSize: PropTypes.number,
linearColorScheme: PropTypes.string,
showLegend: PropTypes.bool,
Expand Down Expand Up @@ -119,7 +121,7 @@ function Calendar(element, props) {
.createLinearScale(extents);

const legend = d3Range(steps).map(i => extents[0] + step * i);
const legendColors = legend.map(colorScale);
const legendColors = legend.map(x => colorScale(x));

const cal = new CalHeatMap();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
/* eslint-disable sort-keys */
export default function transformProps(chartProps) {
const { height, formData, queryData, datasource } = chartProps;
const {
Expand Down
Loading

0 comments on commit 2b8e1f5

Please sign in to comment.