diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000000..2dbbb5c8d8 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,7 @@ +coverage/ +node_modules/ +public/ +esm/ +lib/ +tmp/ +dist/ diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000000..18f016e7b6 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,69 @@ +const path = require('path'); + +module.exports = { + extends: [ + './node_modules/@airbnb/config-eslint/lib/presets/base.js', + './node_modules/@airbnb/config-eslint/lib/presets/next.js', + './node_modules/@airbnb/config-eslint/lib/presets/typescript.js', + './node_modules/@airbnb/config-eslint/lib/presets/prettier.js', + 'prettier/@typescript-eslint', + 'prettier/unicorn', + ], + parserOptions: { + project: path.join(__dirname, './tsconfig.eslint.json'), + }, + rules: { + 'arrow-parens': ['warn', 'as-needed'], + }, + overrides: [ + { + files: '**/*.d.ts', + rules: { + 'max-classes-per-file': 0, + }, + }, + { + files: './packages/generator-superset/**/*.test.{js,jsx,ts,tsx}', + rules: { + 'jest/expect-expect': 0, + }, + }, + { + files: '**/test/**/*', + rules: { + 'import/no-extraneous-dependencies': 0, + 'promise/param-names': 0, + 'jest/require-to-throw-message': 0, + 'jest/no-test-return-statement': 0, + 'jest/no-expect-resolves': 0, + '@typescript-eslint/no-require-imports': 0, + 'global-require': 0, + }, + }, + { + files: '*.{js,jsx,ts,tsx}', + rules: { + 'import/extensions': 0, + 'no-plusplus': 0, + 'react/jsx-no-literals': 0, + '@typescript-eslint/no-unsafe-member-access': 0, + '@typescript-eslint/no-unsafe-call': 0, + '@typescript-eslint/no-explicit-any': [ + 'warn', + { + fixToUnknown: false, + }, + ], + }, + }, + { + files: ['./scripts/*', './*.config.js'], + rules: { + 'no-console': 0, + }, + env: { + node: true, + }, + }, + ], +}; diff --git a/.esprintrc b/.esprintrc new file mode 100644 index 0000000000..4c0d584b94 --- /dev/null +++ b/.esprintrc @@ -0,0 +1,5 @@ +{ + "paths": ["{packages,plugins}/*/{src,test,types}/**/*.{ts,tsx,js,jsx}"], + "ignores": ["**/node_modules/**/*"], + "port": 5004 +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a8a2c92964..9ca74d938d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,6 +55,8 @@ jobs: run: yarn install --frozen-lockfile - name: Build packages run: yarn build + - name: Run ESLint + run: yarn lint --quiet - name: Run unit tests run: yarn test diff --git a/.gitignore b/.gitignore index 7538951132..23ac7fc279 100644 --- a/.gitignore +++ b/.gitignore @@ -33,19 +33,7 @@ _gh-pages/ *.min.js test-changelog.md -# Configs (provided by Nimbus) -.babelrc -.eslintignore -.eslintrc.js -.flowconfig -.prettierignore -jest.config.js -prettier.config.js -tsconfig.eslint.json -tsconfig.json -tsconfig.options.json *.tsbuildinfo -webpack.config.js # Ignore npm lock files, always use yarn.lock instead npm-shrinkwrap.json diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000000..81f93c1f50 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,15 @@ +coverage/ +node_modules/ +public/ +esm/ +lib/ +tmp/ +dist/ +lerna.json +npm-shrinkwrap.json +package.json +package-lock.json +tsconfig.json +tsconfig.options.json +tsconfig.eslint.json +CHANGELOG.md diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000000..3b3572963e --- /dev/null +++ b/.prettierrc @@ -0,0 +1,13 @@ +{ + "arrowParens": "avoid", + "bracketSpacing": true, + "jsxBracketSameLine": false, + "printWidth": 100, + "proseWrap": "always", + "requirePragma": false, + "semi": true, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "all", + "useTabs": false +} diff --git a/README.md b/README.md index 49ddecf00c..ca15a69b42 100644 --- a/README.md +++ b/README.md @@ -24,15 +24,11 @@ Current master: https://superset-ui.now.sh/ | [@superset-ui/chart](https://github.com/apache-superset/superset-ui/tree/master/packages/superset-ui-chart) | [![Version](https://img.shields.io/npm/v/@superset-ui/chart.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/chart.svg?style=flat-square) | | [@superset-ui/chart-composition](https://github.com/apache-superset/superset-ui/tree/master/packages/superset-ui-chart-composition) | [![Version](https://img.shields.io/npm/v/@superset-ui/chart-composition.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/chart-composition.svg?style=flat-square) | | [@superset-ui/color](https://github.com/apache-superset/superset-ui/tree/master/packages/superset-ui-color) | [![Version](https://img.shields.io/npm/v/@superset-ui/color.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/color.svg?style=flat-square) | -| [@superset-ui/connection](https://github.com/apache-superset/superset-ui/tree/master/packages/superset-ui-connection) | [![Version](https://img.shields.io/npm/v/@superset-ui/connection.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/connection.svg?style=flat-square) | | [@superset-ui/core](https://github.com/apache-superset/superset-ui/tree/master/packages/superset-ui-core) | [![Version](https://img.shields.io/npm/v/@superset-ui/core.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/core.svg?style=flat-square) | -| [@superset-ui/dimension](https://github.com/apache-superset/superset-ui/tree/master/packages/superset-ui-dimension) | [![Version](https://img.shields.io/npm/v/@superset-ui/dimension.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/dimension.svg?style=flat-square) | | [@superset-ui/generator-superset](https://github.com/apache-superset/superset-ui/tree/master/packages/superset-ui-generator-superset) | [![Version](https://img.shields.io/npm/v/@superset-ui/generator-superset.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/generator-superset.svg?style=flat-square) | | [@superset-ui/number-format](https://github.com/apache-superset/superset-ui/tree/master/packages/superset-ui-number-format) | [![Version](https://img.shields.io/npm/v/@superset-ui/number-format.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/number-format.svg?style=flat-square) | -| [@superset-ui/query](https://github.com/apache-superset/superset-ui/tree/master/packages/superset-ui-query) | [![Version](https://img.shields.io/npm/v/@superset-ui/query.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/query.svg?style=flat-square) | | [@superset-ui/style](https://github.com/apache-superset/superset-ui/tree/master/packages/superset-ui-style) | [![Version](https://img.shields.io/npm/v/@superset-ui/style.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/style.svg?style=flat-square) | | [@superset-ui/time-format](https://github.com/apache-superset/superset-ui/tree/master/packages/superset-ui-time-format) | [![Version](https://img.shields.io/npm/v/@superset-ui/time-format.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/time-format.svg?style=flat-square) | -| [@superset-ui/translation](https://github.com/apache-superset/superset-ui/tree/master/packages/superset-ui-translation) | [![Version](https://img.shields.io/npm/v/@superset-ui/translation.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/translation.svg?style=flat-square) | ### Chart plugin packages @@ -65,7 +61,6 @@ packages are extracted with minimal changes (almost as-is). They also depend on | [@superset-ui/legacy-plugin-chart-sankey-loop](https://github.com/apache-superset/superset-ui/tree/master/plugins/legacy-plugin-chart-sankey-loop) | [![Version](https://img.shields.io/npm/v/@superset-ui/legacy-plugin-chart-sankey-loop.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/legacy-plugin-chart-sankey-loop.svg?style=flat-square) | | [@superset-ui/legacy-plugin-chart-sunburst](https://github.com/apache-superset/superset-ui/tree/master/plugins/legacy-plugin-chart-sunburst) | [![Version](https://img.shields.io/npm/v/@superset-ui/legacy-plugin-chart-sunburst.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/legacy-plugin-chart-sunburst.svg?style=flat-square) | | [@superset-ui/legacy-plugin-chart-treemap](https://github.com/apache-superset/superset-ui/tree/master/plugins/legacy-plugin-chart-treemap) | [![Version](https://img.shields.io/npm/v/@superset-ui/legacy-plugin-chart-treemap.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/legacy-plugin-chart-treemap.svg?style=flat-square) | -| [@superset-ui/legacy-plugin-chart-word-cloud](https://github.com/apache-superset/superset-ui/tree/master/plugins/legacy-plugin-chart-word-cloud) | [![Version](https://img.shields.io/npm/v/@superset-ui/legacy-plugin-chart-word-cloud.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/legacy-plugin-chart-word-cloud.svg?style=flat-square) | | [@superset-ui/legacy-plugin-chart-world-map](https://github.com/apache-superset/superset-ui/tree/master/plugins/legacy-plugin-chart-world-map) | [![Version](https://img.shields.io/npm/v/@superset-ui/legacy-plugin-chart-world-map.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/legacy-plugin-chart-world-map.svg?style=flat-square) | `@superset-ui/plugin-*` packages are newer and higher quality in general. A key difference that they diff --git a/babel.config.js b/babel.config.js index 9a14758e4e..f88c341020 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,10 +1,10 @@ -// eslint-disable-next-line no-undef, import/no-extraneous-dependencies const { getConfig } = require('@airbnb/config-babel'); const config = getConfig({ library: true, react: true, next: true, + esm: process.env.BABEL_OUTPUT === 'esm', node: process.env.NODE_ENV === 'test', typescript: true, env: { @@ -16,5 +16,4 @@ const config = getConfig({ config.ignore = config.ignore.filter(item => item !== 'node_modules/'); config.ignore.push('node_modules/(?!(vega-lite|lodash-es))'); -// eslint-disable-next-line no-undef module.exports = config; diff --git a/docs/debugging.md b/docs/debugging.md index 87568978e6..1330bdc837 100644 --- a/docs/debugging.md +++ b/docs/debugging.md @@ -3,7 +3,8 @@ ## Activate plugins for local development 1. First, make sure you have run `yarn` and `yarn build` in `superset-ui` or your own plugin repo. -2. Go to [sueprset-frontend](https://github.com/apache/incubator-superset/tree/master/superset-frontend), +2. Go to + [superset-frontend](https://github.com/apache/incubator-superset/tree/master/superset-frontend), use `npm link` to create a symlink of the plugin source code in `node_modules`: ```sh @@ -12,13 +13,14 @@ npm link ../../superset-ui/plugins/plugin-chart-word-cloud ``` -3. Start developing with webpack dev server: +3. Start developing with webpack dev server: ```sh npm run dev-server ``` - The dev server will automatically build from the source code under `path/to/your-plugin/src` and watch the changes. + The dev server will automatically build from the source code under `path/to/your-plugin/src` and + watch the changes. ## Deactivate plugins diff --git a/docs/storybook.md b/docs/storybook.md index 048a55ddd2..8c72571df0 100644 --- a/docs/storybook.md +++ b/docs/storybook.md @@ -8,4 +8,6 @@ yarn build yarn storybook ``` -The Storybook will [automatically build from the source code](https://github.com/apache-superset/superset-ui/blob/master/packages/superset-ui-demo/.storybook/main.js#L49-L58) when package names start with `@superset-ui/`. \ No newline at end of file +The Storybook will +[automatically build from the source code](https://github.com/apache-superset/superset-ui/blob/master/packages/superset-ui-demo/.storybook/main.js#L49-L58) +when package names start with `@superset-ui/`. diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000000..7cf8c674c4 --- /dev/null +++ b/jest.config.js @@ -0,0 +1,83 @@ +module.exports = { + "bail": false, + "collectCoverageFrom": [ + "**/src/**/*.{ts,tsx,js,jsx}", + "**/test/**/*.{ts,tsx,js,jsx}" + ], + "coverageDirectory": "./coverage", + "coveragePathIgnorePatterns": [ + "coverage/", + "node_modules/", + "public/", + "esm/", + "lib/", + "tmp/", + "dist/" + ], + "coverageReporters": [ + "lcov", + "json-summary", + "html" + ], + "coverageThreshold": { + "global": { + "branches": 0, + "functions": 0, + "lines": 0, + "statements": 0 + } + }, + "globals": { + "__DEV__": true, + "caches": true + }, + "moduleFileExtensions": [ + "mock.js", + "ts", + "tsx", + "js", + "jsx", + "json", + "node" + ], + "moduleNameMapper": { + "^.+\\.(ttf|eot|otf|svg|woff|woff2|mp3|png|jpg|jpeg|gif|ico)$": "/node_modules/@airbnb/config-jest/mocks/file.js", + "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "/__mocks__/fileMock.js", + "\\.(css|less)$": "identity-obj-proxy" + }, + "roots": [ + "/packages", + "/plugins" + ], + "setupFiles": [ + "/node_modules/@airbnb/config-jest/setup/shims.js", + "/node_modules/@airbnb/config-jest/setup/console.js", + "/node_modules/@airbnb/config-jest/setup/dom.js" + ], + "setupFilesAfterEnv": [ + "/node_modules/@airbnb/config-jest/bootstrap/react.js", + "/node_modules/@airbnb/config-jest/bootstrap/consumer.js", + "@airbnb/config-jest/enzyme" + ], + "testEnvironment": "jsdom", + "testURL": "http://localhost", + "timers": "real", + "verbose": false, + "transformIgnorePatterns": [ + "node_modules/(?!(vega-lite|lodash-es))" + ], + "testPathIgnorePatterns": [ + "packages/generator-superset/generators" + ], + "projects": [ + "", + { + "displayName": "node", + "rootDir": "/packages/generator-superset", + "testMatch": [ + "/test/**/?(*.)+(spec|test).{js,jsx,ts,tsx}" + ], + "testEnvironment": "node" + } + ] +}; \ No newline at end of file diff --git a/package.json b/package.json index 84360638b4..d4360c18d6 100644 --- a/package.json +++ b/package.json @@ -19,15 +19,15 @@ "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 10", "format": "yarn prettier --write", "jest": "NODE_ENV=test nimbus jest --coverage --verbose", - "lint": "nimbus eslint", - "lint:fix": "nimbus eslint --fix", + "lint": "esprint check --workers=3", + "lint:fix": "yarn lint --fix", "prettier": "nimbus prettier", "test": "yarn jest", "test:watch": "yarn lint:fix && yarn jest --watch", - "type": "nimbus typescript --build --reference-workspaces", + "type": "yarn build --no-babel", + "type:nimbus": "nimbus typescript --build --reference-workspaces", "prepare-release": "git checkout master && git pull --rebase origin master && yarn install && yarn test", "prerelease": "yarn build", - "pretest": "yarn lint", "release": "yarn prepare-release && lerna publish && yarn postrelease", "postrelease": "lerna run deploy-demo", "list-changed-packages": "lerna changed", @@ -68,8 +68,10 @@ "enzyme": "^3.11.0", "enzyme-adapter-react-16": "^1.15.1", "enzyme-to-json": "^3.4.3", - "fast-glob": "^3.0.1", + "esprint": "^0.7.0", + "fast-glob": "^3.2.4", "fs-extra": "^9.0.0", + "global-box": "^1.2.0", "husky": "^4.2.5", "identity-obj-proxy": "^3.0.0", "jest-mock-console": "^1.0.0", @@ -78,7 +80,8 @@ "react": "^16.13.1", "react-dom": "^16.13.1", "react-test-renderer": "^16.13.1", - "rimraf": "^3.0.2" + "rimraf": "^3.0.2", + "yargs": "^15.4.1" }, "engines": { "node": ">=10.10.0", @@ -101,9 +104,18 @@ "driver": "babel", "strategy": "none" }, - "eslint", - "jest", - "prettier", + { + "driver": "eslint", + "strategy": "none" + }, + { + "driver": "jest", + "strategy": "none" + }, + { + "driver": "prettier", + "strategy": "none" + }, "typescript" ], "settings": { @@ -155,54 +167,6 @@ "prettier": { "arrowParens": "avoid" }, - "eslint": { - "rules": { - "arrow-parens": [ - "warn", - "as-needed" - ] - }, - "overrides": [ - { - "files": "./packages/generator-superset/**/*.test.{js,jsx,ts,tsx}", - "rules": { - "jest/expect-expect": "off" - } - }, - { - "files": "**/test/**/*", - "rules": { - "import/no-extraneous-dependencies": "off", - "promise/param-names": "off", - "jest/require-to-throw-message": "off", - "jest/no-test-return-statement": "off", - "jest/no-expect-resolves": "off", - "@typescript-eslint/no-require-imports": "off", - "global-require": "off" - } - }, - { - "files": "*.{js,jsx,ts,tsx}", - "rules": { - "import/extensions": "off", - "no-plusplus": "off", - "react/jsx-no-literals": "off", - "@typescript-eslint/no-explicit-any": [ - "warn", - { - "fixToUnknown": false - } - ] - } - }, - { - "files": "./scripts/*", - "env": { - "node": true - } - } - ] - }, "typescript": { "compilerOptions": { "rootDir": "./src", diff --git a/packages/generator-superset/generators/plugin-chart/templates/package.erb b/packages/generator-superset/generators/plugin-chart/templates/package.erb index 84e6feda7a..bdcc5c4c42 100644 --- a/packages/generator-superset/generators/plugin-chart/templates/package.erb +++ b/packages/generator-superset/generators/plugin-chart/templates/package.erb @@ -25,13 +25,14 @@ "publishConfig": { "access": "public" }, - "peerDependencies": { + "dependencies": { "@superset-ui/chart": "^0.14.1", - "@superset-ui/query": "^0.14.1", + "@superset-ui/core": "^0.15.0", "@superset-ui/chart-controls": "^0.14.0", - "@superset-ui/translation": "^0.14.0", "@superset-ui/validator": "^0.14.1", "@superset-ui/style": "^0.14.0", + }, + "peerDependencies": { "react": "^16.13.1" }, "devDependencies": { diff --git a/packages/generator-superset/generators/plugin-chart/templates/src/plugin/buildQuery.erb b/packages/generator-superset/generators/plugin-chart/templates/src/plugin/buildQuery.erb index 4978faf571..dbec7f96a4 100644 --- a/packages/generator-superset/generators/plugin-chart/templates/src/plugin/buildQuery.erb +++ b/packages/generator-superset/generators/plugin-chart/templates/src/plugin/buildQuery.erb @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { buildQueryContext, QueryFormData } from '@superset-ui/query'; +import { buildQueryContext, QueryFormData } from '@superset-ui/core'; /** * The buildQuery function is used to create an instance of QueryContext that's diff --git a/packages/generator-superset/generators/plugin-chart/templates/src/plugin/controlPanel.erb b/packages/generator-superset/generators/plugin-chart/templates/src/plugin/controlPanel.erb index b7788235b3..7e382e6a76 100644 --- a/packages/generator-superset/generators/plugin-chart/templates/src/plugin/controlPanel.erb +++ b/packages/generator-superset/generators/plugin-chart/templates/src/plugin/controlPanel.erb @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { validateNonEmpty } from '@superset-ui/validator'; import { ControlPanelConfig } from '@superset-ui/chart-controls'; diff --git a/packages/generator-superset/generators/plugin-chart/templates/src/plugin/index.erb b/packages/generator-superset/generators/plugin-chart/templates/src/plugin/index.erb index fe491ee33e..6df16bffbb 100644 --- a/packages/generator-superset/generators/plugin-chart/templates/src/plugin/index.erb +++ b/packages/generator-superset/generators/plugin-chart/templates/src/plugin/index.erb @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import buildQuery from './buildQuery'; import controlPanel from './controlPanel'; diff --git a/packages/generator-superset/test/tsconfig.json b/packages/generator-superset/test/tsconfig.json new file mode 100644 index 0000000000..014c5465be --- /dev/null +++ b/packages/generator-superset/test/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "composite": false, + "emitDeclarationOnly": false, + "noEmit": true, + "rootDir": "." + }, + "extends": "../../../tsconfig.options.json", + "include": [ + "**/*", + "../types/**/*", + "../../../types/**/*" + ], + "references": [ + { + "path": ".." + } + ] +} \ No newline at end of file diff --git a/packages/generator-superset/tsconfig.json b/packages/generator-superset/tsconfig.json new file mode 100644 index 0000000000..892bfbba65 --- /dev/null +++ b/packages/generator-superset/tsconfig.json @@ -0,0 +1,37 @@ +{ + "compilerOptions": { + "allowSyntheticDefaultImports": true, + "declaration": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": false, + "jsx": "react", + "lib": [ + "dom", + "esnext" + ], + "module": "esnext", + "moduleResolution": "node", + "noEmitOnError": true, + "noImplicitReturns": true, + "noUnusedLocals": true, + "pretty": true, + "removeComments": false, + "strict": true, + "target": "es2015", + "useDefineForClassFields": false, + "declarationDir": "./lib", + "outDir": "./lib", + "rootDir": "./src", + "emitDeclarationOnly": true, + "composite": true, + "resolveJsonModule": true + }, + "include": [ + "./src/**/*", + "./types/**/*" + ], + "exclude": [ + "**/node_modules/*" + ] +} \ No newline at end of file diff --git a/packages/superset-ui-chart-composition/package.json b/packages/superset-ui-chart-composition/package.json index 97f87cce95..222d629dfa 100644 --- a/packages/superset-ui-chart-composition/package.json +++ b/packages/superset-ui-chart-composition/package.json @@ -28,10 +28,10 @@ "dependencies": { "@types/react": "^16.9.43", "@vx/responsive": "^0.0.197", + "@superset-ui/core": "^0.15.0", "csstype": "^2.6.4" }, "peerDependencies": { - "@superset-ui/core": "^0.14.0", "react": "^16.13.1" } } diff --git a/packages/superset-ui-chart-composition/test/legend/WithLegend.test.tsx b/packages/superset-ui-chart-composition/test/legend/WithLegend.test.tsx index cc5ef4ce71..eb5af0de58 100644 --- a/packages/superset-ui-chart-composition/test/legend/WithLegend.test.tsx +++ b/packages/superset-ui-chart-composition/test/legend/WithLegend.test.tsx @@ -29,7 +29,6 @@ describe('WithLegend', () => { , ); - // eslint-disable-next-line @typescript-eslint/no-unsafe-call triggerResizeObserver(); // Have to delay more than debounceTime (1ms) return promiseTimeout(() => { @@ -50,7 +49,6 @@ describe('WithLegend', () => { />, ); - // eslint-disable-next-line @typescript-eslint/no-unsafe-call triggerResizeObserver(); // Have to delay more than debounceTime (1ms) return promiseTimeout(() => { @@ -66,7 +64,6 @@ describe('WithLegend', () => { , ); - // eslint-disable-next-line @typescript-eslint/no-unsafe-call triggerResizeObserver(); // Have to delay more than debounceTime (1ms) return promiseTimeout(() => { @@ -87,7 +84,6 @@ describe('WithLegend', () => { />, ); - // eslint-disable-next-line @typescript-eslint/no-unsafe-call triggerResizeObserver(); // Have to delay more than debounceTime (1ms) return promiseTimeout(() => { @@ -108,7 +104,6 @@ describe('WithLegend', () => { />, ); - // eslint-disable-next-line @typescript-eslint/no-unsafe-call triggerResizeObserver(); // Have to delay more than debounceTime (1ms) return promiseTimeout(() => { @@ -129,7 +124,6 @@ describe('WithLegend', () => { />, ); - // eslint-disable-next-line @typescript-eslint/no-unsafe-call triggerResizeObserver(); // Have to delay more than debounceTime (1ms) return promiseTimeout(() => { @@ -150,7 +144,6 @@ describe('WithLegend', () => { />, ); - // eslint-disable-next-line @typescript-eslint/no-unsafe-call triggerResizeObserver(); // Have to delay more than debounceTime (1ms) return promiseTimeout(() => { @@ -172,7 +165,6 @@ describe('WithLegend', () => { />, ); - // eslint-disable-next-line @typescript-eslint/no-unsafe-call triggerResizeObserver(); // Have to delay more than debounceTime (1ms) return promiseTimeout(() => { diff --git a/packages/superset-ui-chart-composition/test/tsconfig.json b/packages/superset-ui-chart-composition/test/tsconfig.json new file mode 100644 index 0000000000..014c5465be --- /dev/null +++ b/packages/superset-ui-chart-composition/test/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "composite": false, + "emitDeclarationOnly": false, + "noEmit": true, + "rootDir": "." + }, + "extends": "../../../tsconfig.options.json", + "include": [ + "**/*", + "../types/**/*", + "../../../types/**/*" + ], + "references": [ + { + "path": ".." + } + ] +} \ No newline at end of file diff --git a/packages/superset-ui-chart-composition/tsconfig.json b/packages/superset-ui-chart-composition/tsconfig.json new file mode 100644 index 0000000000..53e3141e13 --- /dev/null +++ b/packages/superset-ui-chart-composition/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "declarationDir": "lib", + "outDir": "lib", + "rootDir": "src" + }, + "exclude": [ + "lib", + "test" + ], + "extends": "../../tsconfig.options.json", + "include": [ + "src/**/*", + "types/**/*", + "../../types/**/*" + ], + "references": [ + { + "path": "../superset-ui-core" + } + ] +} \ No newline at end of file diff --git a/packages/superset-ui-chart-controls/package.json b/packages/superset-ui-chart-controls/package.json index 4bcb118648..2c15944c8d 100644 --- a/packages/superset-ui-chart-controls/package.json +++ b/packages/superset-ui-chart-controls/package.json @@ -26,11 +26,6 @@ "access": "public" }, "peerDependencies": { - "@superset-ui/color": "^0.14.0", - "@superset-ui/query": "^0.14.0", - "@superset-ui/style": "^0.14.0", - "@superset-ui/translation": "^0.14.0", - "@superset-ui/validator": "^0.14.0", "react": "^16.13.1" }, "devDependencies": { @@ -38,6 +33,9 @@ }, "dependencies": { "@types/react-bootstrap": "0.32.21", + "@superset-ui/core": "^0.15.0", + "@superset-ui/style": "^0.14.0", + "@superset-ui/validator": "^0.14.0", "lodash": "^4.17.15", "prop-types": "^15.7.2", "react-bootstrap": "^0.33.1" diff --git a/packages/superset-ui-chart-controls/src/components/CertifiedIconWithTooltip.tsx b/packages/superset-ui-chart-controls/src/components/CertifiedIconWithTooltip.tsx index bb3a6c056c..071ef09394 100644 --- a/packages/superset-ui-chart-controls/src/components/CertifiedIconWithTooltip.tsx +++ b/packages/superset-ui-chart-controls/src/components/CertifiedIconWithTooltip.tsx @@ -17,7 +17,7 @@ * under the License. */ import React from 'react'; -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { supersetTheme } from '@superset-ui/style'; import { Tooltip, OverlayTrigger } from 'react-bootstrap'; import { kebabCase } from 'lodash'; diff --git a/packages/superset-ui-chart-controls/src/constants.ts b/packages/superset-ui-chart-controls/src/constants.ts index 7fdc63f7b0..7a492dd0b4 100644 --- a/packages/superset-ui-chart-controls/src/constants.ts +++ b/packages/superset-ui-chart-controls/src/constants.ts @@ -17,7 +17,7 @@ * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; // eslint-disable-next-line import/prefer-default-export export const TIME_FILTER_LABELS = { diff --git a/packages/superset-ui-chart-controls/src/sections.tsx b/packages/superset-ui-chart-controls/src/sections.tsx index 2b29619709..cf71a25d38 100644 --- a/packages/superset-ui-chart-controls/src/sections.tsx +++ b/packages/superset-ui-chart-controls/src/sections.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; // A few standard controls sections that are used internally. // Not recommended for use in third-party plugins. diff --git a/packages/superset-ui-chart-controls/src/shared-controls/index.tsx b/packages/superset-ui-chart-controls/src/shared-controls/index.tsx index 8205e3f3ca..cac6117ef9 100644 --- a/packages/superset-ui-chart-controls/src/shared-controls/index.tsx +++ b/packages/superset-ui-chart-controls/src/shared-controls/index.tsx @@ -34,12 +34,12 @@ * control interface. */ import React from 'react'; -import { t } from '@superset-ui/translation'; import { + t, getCategoricalSchemeRegistry, getSequentialSchemeRegistry, SequentialScheme, -} from '@superset-ui/color'; +} from '@superset-ui/core'; import { legacyValidateInteger, validateNonEmpty } from '@superset-ui/validator'; import { formatSelectOptions } from '../utils/selectOptions'; diff --git a/packages/superset-ui-chart-controls/src/types.ts b/packages/superset-ui-chart-controls/src/types.ts index 0c35240b4d..10ab0cd701 100644 --- a/packages/superset-ui-chart-controls/src/types.ts +++ b/packages/superset-ui-chart-controls/src/types.ts @@ -18,7 +18,7 @@ * under the License. */ import React, { ReactNode, ReactText, ReactElement } from 'react'; -import { QueryFormData } from '@superset-ui/query'; +import { QueryFormData } from '@superset-ui/core'; import sharedControls from './shared-controls'; import sharedControlComponents from './shared-controls/components'; diff --git a/packages/superset-ui-chart-controls/test/tsconfig.json b/packages/superset-ui-chart-controls/test/tsconfig.json new file mode 100644 index 0000000000..014c5465be --- /dev/null +++ b/packages/superset-ui-chart-controls/test/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "composite": false, + "emitDeclarationOnly": false, + "noEmit": true, + "rootDir": "." + }, + "extends": "../../../tsconfig.options.json", + "include": [ + "**/*", + "../types/**/*", + "../../../types/**/*" + ], + "references": [ + { + "path": ".." + } + ] +} \ No newline at end of file diff --git a/packages/superset-ui-chart-controls/tsconfig.json b/packages/superset-ui-chart-controls/tsconfig.json new file mode 100644 index 0000000000..f7af2c07dd --- /dev/null +++ b/packages/superset-ui-chart-controls/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "declarationDir": "lib", + "outDir": "lib", + "rootDir": "src" + }, + "exclude": [ + "lib", + "test" + ], + "extends": "../../tsconfig.options.json", + "include": [ + "src/**/*", + "types/**/*", + "../../types/**/*" + ], + "references": [ + { + "path": "../superset-ui-core" + }, + { + "path": "../superset-ui-style" + }, + { + "path": "../superset-ui-validator" + } + ] +} \ No newline at end of file diff --git a/packages/superset-ui-chart/README.md b/packages/superset-ui-chart/README.md index 22ccd2b5ff..84b9408fd6 100644 --- a/packages/superset-ui-chart/README.md +++ b/packages/superset-ui-chart/README.md @@ -44,7 +44,7 @@ requests from domains outside your `Apache Superset` instance: configuration in the `@superset-ui` storybook. ```javascript - import { SupersetClient } from '@superset-ui/connection'; + import { SupersetClient } from '@superset-ui/core'; SupersetClient.configure({ credentials: 'include', diff --git a/packages/superset-ui-chart/package.json b/packages/superset-ui-chart/package.json index 11291b69c1..4f6a4e1aa2 100644 --- a/packages/superset-ui-chart/package.json +++ b/packages/superset-ui-chart/package.json @@ -30,6 +30,7 @@ "@types/react": "^16.9.43", "@types/react-loadable": "^5.4.2", "@vx/responsive": "^0.0.197", + "@superset-ui/core": "^0.15.0", "prop-types": "^15.6.2", "react-error-boundary": "^1.2.5", "react-loadable": "^5.5.0", @@ -41,10 +42,6 @@ "node-fetch": "^2.2.0" }, "peerDependencies": { - "@superset-ui/connection": "^0.14.0", - "@superset-ui/core": "^0.14.0", - "@superset-ui/dimension": "^0.14.0", - "@superset-ui/query": "^0.14.0", "react": "^16.13.1" } } diff --git a/packages/superset-ui-chart/src/clients/ChartClient.ts b/packages/superset-ui-chart/src/clients/ChartClient.ts index 4b0a117c7e..2df8a26fc2 100644 --- a/packages/superset-ui-chart/src/clients/ChartClient.ts +++ b/packages/superset-ui-chart/src/clients/ChartClient.ts @@ -1,11 +1,12 @@ -import { isDefined } from '@superset-ui/core'; import { + isDefined, SupersetClient, SupersetClientInterface, RequestConfig, SupersetClientClass, -} from '@superset-ui/connection'; -import { QueryFormData, Datasource } from '@superset-ui/query'; + QueryFormData, + Datasource, +} from '@superset-ui/core'; import getChartBuildQueryRegistry from '../registries/ChartBuildQueryRegistrySingleton'; import getChartMetadataRegistry from '../registries/ChartMetadataRegistrySingleton'; import { QueryData } from '../types/QueryResponse'; diff --git a/packages/superset-ui-chart/src/components/ChartDataProvider.tsx b/packages/superset-ui-chart/src/components/ChartDataProvider.tsx index e401f6d032..9e495790bc 100644 --- a/packages/superset-ui-chart/src/components/ChartDataProvider.tsx +++ b/packages/superset-ui-chart/src/components/ChartDataProvider.tsx @@ -1,7 +1,11 @@ /* eslint react/sort-comp: 'off' */ import React, { ReactNode } from 'react'; -import { SupersetClientInterface, RequestConfig } from '@superset-ui/connection'; -import { QueryFormData, Datasource } from '@superset-ui/query'; +import { + SupersetClientInterface, + RequestConfig, + QueryFormData, + Datasource, +} from '@superset-ui/core'; import ChartClient, { SliceIdAndOrFormData } from '../clients/ChartClient'; import { QueryData } from '../types/QueryResponse'; diff --git a/packages/superset-ui-chart/src/components/SuperChart.tsx b/packages/superset-ui-chart/src/components/SuperChart.tsx index ecad1ed6ef..b43737a13f 100644 --- a/packages/superset-ui-chart/src/components/SuperChart.tsx +++ b/packages/superset-ui-chart/src/components/SuperChart.tsx @@ -1,6 +1,6 @@ import React, { ReactNode } from 'react'; import ErrorBoundary, { ErrorBoundaryProps, FallbackProps } from 'react-error-boundary'; -import { parseLength, Dimension } from '@superset-ui/dimension'; +import { parseLength, Dimension } from '@superset-ui/core'; import { ParentSize } from '@vx/responsive'; import { createSelector } from 'reselect'; import SuperChartCore, { Props as SuperChartCoreProps } from './SuperChartCore'; @@ -127,7 +127,6 @@ export default class SuperChart extends React.PureComponent { if ( queryData == null || queryData.data === null || - // eslint-disable-next-line @typescript-eslint/no-unsafe-call (Array.isArray(queryData.data) && queryData.data.length === 0) ) { chart = ; diff --git a/packages/superset-ui-chart/src/components/createLoadableRenderer.ts b/packages/superset-ui-chart/src/components/createLoadableRenderer.ts index e774c17f69..b196625053 100644 --- a/packages/superset-ui-chart/src/components/createLoadableRenderer.ts +++ b/packages/superset-ui-chart/src/components/createLoadableRenderer.ts @@ -36,9 +36,7 @@ export default function createLoadableRenderer( const { onRenderFailure, onRenderSuccess } = this.props; if (!loading) { if (error) { - // eslint-disable-next-line @typescript-eslint/no-unsafe-call (onRenderFailure as Function)(error); - // eslint-disable-next-line @typescript-eslint/no-unsafe-call } else if (loaded && Object.keys(loaded).length > 0) { (onRenderSuccess as Function)(); } diff --git a/packages/superset-ui-chart/src/models/ChartPlugin.ts b/packages/superset-ui-chart/src/models/ChartPlugin.ts index 0ce60a4dd0..6a5b12f2dd 100644 --- a/packages/superset-ui-chart/src/models/ChartPlugin.ts +++ b/packages/superset-ui-chart/src/models/ChartPlugin.ts @@ -1,6 +1,5 @@ import { ComponentType } from 'react'; -import { isRequired, Plugin } from '@superset-ui/core'; -import { QueryFormData } from '@superset-ui/query'; +import { isRequired, Plugin, QueryFormData } from '@superset-ui/core'; import ChartMetadata from './ChartMetadata'; import getChartMetadataRegistry from '../registries/ChartMetadataRegistrySingleton'; import getChartBuildQueryRegistry from '../registries/ChartBuildQueryRegistrySingleton'; diff --git a/packages/superset-ui-chart/src/models/ChartProps.ts b/packages/superset-ui-chart/src/models/ChartProps.ts index 4b0db7f0e7..82be8a51e8 100644 --- a/packages/superset-ui-chart/src/models/ChartProps.ts +++ b/packages/superset-ui-chart/src/models/ChartProps.ts @@ -1,6 +1,5 @@ import { createSelector } from 'reselect'; -import { convertKeysToCamelCase } from '@superset-ui/core'; -import { Datasource } from '@superset-ui/query'; +import { convertKeysToCamelCase, Datasource } from '@superset-ui/core'; import { HandlerFunction, PlainObject } from '../types/Base'; import { QueryData, DataRecordFilters } from '../types/QueryResponse'; diff --git a/packages/superset-ui-chart/src/registries/ChartBuildQueryRegistrySingleton.ts b/packages/superset-ui-chart/src/registries/ChartBuildQueryRegistrySingleton.ts index 791df16b58..3eec209840 100644 --- a/packages/superset-ui-chart/src/registries/ChartBuildQueryRegistrySingleton.ts +++ b/packages/superset-ui-chart/src/registries/ChartBuildQueryRegistrySingleton.ts @@ -1,5 +1,4 @@ -import { Registry, makeSingleton, OverwritePolicy } from '@superset-ui/core'; -import { QueryContext } from '@superset-ui/query'; +import { Registry, makeSingleton, OverwritePolicy, QueryContext } from '@superset-ui/core'; // Ideally this would be type BuildQuery = (formData: any) => QueryContext; diff --git a/packages/superset-ui-chart/src/types/TransformFunction.ts b/packages/superset-ui-chart/src/types/TransformFunction.ts index bc458c820d..dbc18e5781 100644 --- a/packages/superset-ui-chart/src/types/TransformFunction.ts +++ b/packages/superset-ui-chart/src/types/TransformFunction.ts @@ -1,4 +1,4 @@ -import { QueryFormData, QueryContext } from '@superset-ui/query'; +import { QueryFormData, QueryContext } from '@superset-ui/core'; import ChartProps from '../models/ChartProps'; export interface PlainProps { diff --git a/packages/superset-ui-chart/test/clients/ChartClient.test.ts b/packages/superset-ui-chart/test/clients/ChartClient.test.ts index bee82f430b..61186170c1 100644 --- a/packages/superset-ui-chart/test/clients/ChartClient.test.ts +++ b/packages/superset-ui-chart/test/clients/ChartClient.test.ts @@ -1,6 +1,10 @@ import fetchMock from 'fetch-mock'; -import { SupersetClientClass, SupersetClient } from '@superset-ui/connection'; -import { buildQueryContext, QueryFormData } from '@superset-ui/query'; +import { + SupersetClientClass, + SupersetClient, + buildQueryContext, + QueryFormData, +} from '@superset-ui/core'; import { ChartClient, getChartBuildQueryRegistry, diff --git a/packages/superset-ui-chart/test/components/MockChartPlugins.tsx b/packages/superset-ui-chart/test/components/MockChartPlugins.tsx index 53e014ddf9..c9d1f0461d 100644 --- a/packages/superset-ui-chart/test/components/MockChartPlugins.tsx +++ b/packages/superset-ui-chart/test/components/MockChartPlugins.tsx @@ -1,6 +1,6 @@ /* eslint-disable max-classes-per-file */ import React from 'react'; -import { QueryFormData } from '@superset-ui/query'; +import { QueryFormData } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '../../src'; const DIMENSION_STYLE = { diff --git a/packages/superset-ui-chart/test/components/SuperChart.test.tsx b/packages/superset-ui-chart/test/components/SuperChart.test.tsx index d5c745ba90..d79b855f91 100644 --- a/packages/superset-ui-chart/test/components/SuperChart.test.tsx +++ b/packages/superset-ui-chart/test/components/SuperChart.test.tsx @@ -225,7 +225,6 @@ describe('SuperChart', () => { height="100%" />, ); - // eslint-disable-next-line @typescript-eslint/no-unsafe-call triggerResizeObserver(); return promiseTimeout(() => { @@ -244,7 +243,6 @@ describe('SuperChart', () => { height="125" />, ); - // eslint-disable-next-line @typescript-eslint/no-unsafe-call triggerResizeObserver([{ contentRect: { height: 125, width: 150 } }]); return promiseTimeout(() => { @@ -266,7 +264,6 @@ describe('SuperChart', () => { height="25%" />, ); - // eslint-disable-next-line @typescript-eslint/no-unsafe-call triggerResizeObserver([{ contentRect: { height: 75, width: 50 } }]); return promiseTimeout(() => { @@ -286,7 +283,6 @@ describe('SuperChart', () => { debounceTime={1} />, ); - // eslint-disable-next-line @typescript-eslint/no-unsafe-call triggerResizeObserver(); return promiseTimeout(() => { @@ -340,7 +336,6 @@ describe('SuperChart', () => { Wrapper={MyWrapper} />, ); - // eslint-disable-next-line @typescript-eslint/no-unsafe-call triggerResizeObserver(); return promiseTimeout(() => { diff --git a/packages/superset-ui-chart/test/components/reactify.test.tsx b/packages/superset-ui-chart/test/components/reactify.test.tsx index d4cb004c56..02a20411cb 100644 --- a/packages/superset-ui-chart/test/components/reactify.test.tsx +++ b/packages/superset-ui-chart/test/components/reactify.test.tsx @@ -100,8 +100,6 @@ describe('reactify(renderFn)', () => { it('does not try to render if not mounted', () => { const anotherRenderFn = jest.fn(); const AnotherChart = reactify(anotherRenderFn); // enables valid new AnotherChart() call - // @ts-ignore - // eslint-disable-next-line @typescript-eslint/no-unsafe-call new AnotherChart({ id: 'test' }).execute(); expect(anotherRenderFn).not.toHaveBeenCalled(); }); diff --git a/packages/superset-ui-chart/test/models/ChartPlugin.test.tsx b/packages/superset-ui-chart/test/models/ChartPlugin.test.tsx index 328b8a6874..2b613c2611 100644 --- a/packages/superset-ui-chart/test/models/ChartPlugin.test.tsx +++ b/packages/superset-ui-chart/test/models/ChartPlugin.test.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { QueryFormData, DatasourceType } from '@superset-ui/query'; +import { QueryFormData, DatasourceType } from '@superset-ui/core'; import { ChartPlugin, ChartMetadata, diff --git a/packages/superset-ui-chart/test/tsconfig.json b/packages/superset-ui-chart/test/tsconfig.json new file mode 100644 index 0000000000..014c5465be --- /dev/null +++ b/packages/superset-ui-chart/test/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "composite": false, + "emitDeclarationOnly": false, + "noEmit": true, + "rootDir": "." + }, + "extends": "../../../tsconfig.options.json", + "include": [ + "**/*", + "../types/**/*", + "../../../types/**/*" + ], + "references": [ + { + "path": ".." + } + ] +} \ No newline at end of file diff --git a/packages/superset-ui-chart/tsconfig.json b/packages/superset-ui-chart/tsconfig.json new file mode 100644 index 0000000000..53e3141e13 --- /dev/null +++ b/packages/superset-ui-chart/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "declarationDir": "lib", + "outDir": "lib", + "rootDir": "src" + }, + "exclude": [ + "lib", + "test" + ], + "extends": "../../tsconfig.options.json", + "include": [ + "src/**/*", + "types/**/*", + "../../types/**/*" + ], + "references": [ + { + "path": "../superset-ui-core" + } + ] +} \ No newline at end of file diff --git a/packages/superset-ui-color/README.md b/packages/superset-ui-color/README.md deleted file mode 100644 index 3afae2e316..0000000000 --- a/packages/superset-ui-color/README.md +++ /dev/null @@ -1,23 +0,0 @@ -## @superset-ui/color - -[![Version](https://img.shields.io/npm/v/@superset-ui/color.svg?style=flat)](https://img.shields.io/npm/v/@superset-ui/color.svg?style=flat) -[![David (path)](https://img.shields.io/david/apache-superset/superset-ui.svg?path=packages%2Fsuperset-ui-color&style=flat-square)](https://david-dm.org/apache-superset/superset-ui?path=packages/superset-ui-color) - -Description - -#### Example usage - -```js -import { xxx } from '@superset-ui/color'; -``` - -#### API - -`fn(args)` - -- Do something - -### Development - -`@data-ui/build-config` is used to manage the build configuration for this package including babel -builds, jest testing, eslint, and prettier. diff --git a/packages/superset-ui-color/package.json b/packages/superset-ui-color/package.json deleted file mode 100644 index b38b1252b4..0000000000 --- a/packages/superset-ui-color/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "@superset-ui/color", - "version": "0.14.9", - "description": "Superset UI color", - "sideEffects": false, - "main": "lib/index.js", - "module": "esm/index.js", - "files": [ - "esm", - "lib" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/apache-superset/superset-ui.git" - }, - "keywords": [ - "superset" - ], - "author": "Superset", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/apache-superset/superset-ui/issues" - }, - "homepage": "https://github.com/apache-superset/superset-ui#readme", - "publishConfig": { - "access": "public" - }, - "dependencies": { - "@types/d3-interpolate": "^1.3.1", - "@types/d3-scale": "^2.1.1", - "d3-interpolate": "^1.4.0", - "d3-scale": "^3.0.0" - }, - "peerDependencies": { - "@superset-ui/core": "^0.14.0" - } -} diff --git a/packages/superset-ui-color/test/colorSchemes.test.ts b/packages/superset-ui-color/test/colorSchemes.test.ts deleted file mode 100644 index f4c07a9025..0000000000 --- a/packages/superset-ui-color/test/colorSchemes.test.ts +++ /dev/null @@ -1,36 +0,0 @@ -import categoricalAirbnb from '../src/colorSchemes/categorical/airbnb'; -import categoricalSuperset from '../src/colorSchemes/categorical/superset'; -import categoricalPreset from '../src/colorSchemes/categorical/preset'; -import categoricalD3 from '../src/colorSchemes/categorical/d3'; -import categoricalGoogle from '../src/colorSchemes/categorical/google'; -import categoricalLyft from '../src/colorSchemes/categorical/lyft'; -import sequentialCommon from '../src/colorSchemes/sequential/common'; -import sequentialD3 from '../src/colorSchemes/sequential/d3'; -import CategoricalScheme from '../src/CategoricalScheme'; -import SequentialScheme from '../src/SequentialScheme'; - -describe('Color Schemes', () => { - describe('categorical', () => { - it('returns an array of CategoricalScheme', () => { - [ - categoricalAirbnb, - categoricalD3, - categoricalGoogle, - categoricalLyft, - categoricalSuperset, - categoricalPreset, - ].forEach(group => { - expect(group).toBeInstanceOf(Array); - group.forEach(scheme => expect(scheme).toBeInstanceOf(CategoricalScheme)); - }); - }); - }); - describe('sequential', () => { - it('returns an array of SequentialScheme', () => { - [sequentialCommon, sequentialD3].forEach(group => { - expect(group).toBeInstanceOf(Array); - group.forEach(scheme => expect(scheme).toBeInstanceOf(SequentialScheme)); - }); - }); - }); -}); diff --git a/packages/superset-ui-connection/.eslintrc b/packages/superset-ui-connection/.eslintrc deleted file mode 100644 index 4bb3c533f7..0000000000 --- a/packages/superset-ui-connection/.eslintrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "rules": { - "prefer-promise-reject-errors": "off", - "lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }] - } -} diff --git a/packages/superset-ui-connection/package.json b/packages/superset-ui-connection/package.json deleted file mode 100644 index 54db5576d5..0000000000 --- a/packages/superset-ui-connection/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@superset-ui/connection", - "version": "0.14.19", - "description": "Superset UI connection", - "sideEffects": false, - "main": "lib/index.js", - "module": "esm/index.js", - "files": [ - "esm", - "lib" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/apache-superset/superset-ui.git" - }, - "keywords": [ - "superset", - "client", - "core", - "data" - ], - "author": "Superset", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/apache-superset/superset-ui/issues" - }, - "homepage": "https://github.com/apache-superset/superset-ui#readme", - "devDependencies": { - "@types/fetch-mock": "^6.0.0", - "fetch-mock": "^6.5.2", - "node-fetch": "^2.2.0" - }, - "dependencies": { - "@babel/runtime": "^7.1.2", - "fetch-retry": "^4.0.1", - "whatwg-fetch": "^3.0.0" - }, - "publishConfig": { - "access": "public" - } -} diff --git a/packages/superset-ui-core/package.json b/packages/superset-ui-core/package.json index 1cadef4e43..7d1bdd590d 100644 --- a/packages/superset-ui-core/package.json +++ b/packages/superset-ui-core/package.json @@ -1,6 +1,6 @@ { "name": "@superset-ui/core", - "version": "0.14.21", + "version": "0.15.0", "description": "Superset UI core", "sideEffects": false, "main": "lib/index.js", @@ -26,10 +26,27 @@ "access": "public" }, "devDependencies": { - "jest-mock-console": "^1.0.0" + "jest-mock-console": "^1.0.0", + "@types/fetch-mock": "^6.0.0", + "fetch-mock": "^6.5.2" }, "dependencies": { + "@babel/runtime": "^7.1.2", + "@types/d3-format": "^1.3.0", "@types/lodash": "^4.14.149", - "lodash": "^4.17.11" + "@types/d3-time": "^1.0.9", + "@types/d3-time-format": "^2.1.0", + "@types/d3-interpolate": "^1.3.1", + "@types/d3-scale": "^2.1.1", + "d3-interpolate": "^1.4.0", + "d3-scale": "^3.0.0", + "d3-format": "^1.3.2", + "d3-time": "^1.0.10", + "d3-time-format": "^2.2.0", + "jed": "^1.1.1", + "lodash": "^4.17.11", + "fetch-retry": "^4.0.1", + "pretty-ms": "^7.0.0", + "whatwg-fetch": "^3.0.0" } } diff --git a/packages/superset-ui-color/src/CategoricalColorNamespace.ts b/packages/superset-ui-core/src/color/CategoricalColorNamespace.ts similarity index 100% rename from packages/superset-ui-color/src/CategoricalColorNamespace.ts rename to packages/superset-ui-core/src/color/CategoricalColorNamespace.ts diff --git a/packages/superset-ui-color/src/CategoricalColorScale.ts b/packages/superset-ui-core/src/color/CategoricalColorScale.ts similarity index 98% rename from packages/superset-ui-color/src/CategoricalColorScale.ts rename to packages/superset-ui-core/src/color/CategoricalColorScale.ts index 9f7d70c11c..c2c12390f6 100644 --- a/packages/superset-ui-color/src/CategoricalColorScale.ts +++ b/packages/superset-ui-core/src/color/CategoricalColorScale.ts @@ -1,6 +1,6 @@ /* eslint-disable no-dupe-class-members */ -import { ExtensibleFunction } from '@superset-ui/core'; import { scaleOrdinal, ScaleOrdinal } from 'd3-scale'; +import { ExtensibleFunction } from '../models'; import { ColorsLookup } from './types'; import stringifyAndTrim from './stringifyAndTrim'; diff --git a/packages/superset-ui-color/src/CategoricalScheme.ts b/packages/superset-ui-core/src/color/CategoricalScheme.ts similarity index 100% rename from packages/superset-ui-color/src/CategoricalScheme.ts rename to packages/superset-ui-core/src/color/CategoricalScheme.ts diff --git a/packages/superset-ui-color/src/CategoricalSchemeRegistrySingleton.ts b/packages/superset-ui-core/src/color/CategoricalSchemeRegistrySingleton.ts similarity index 89% rename from packages/superset-ui-color/src/CategoricalSchemeRegistrySingleton.ts rename to packages/superset-ui-core/src/color/CategoricalSchemeRegistrySingleton.ts index c2fdea9a44..44143ba10a 100644 --- a/packages/superset-ui-color/src/CategoricalSchemeRegistrySingleton.ts +++ b/packages/superset-ui-core/src/color/CategoricalSchemeRegistrySingleton.ts @@ -1,4 +1,4 @@ -import { makeSingleton } from '@superset-ui/core'; +import makeSingleton from '../utils/makeSingleton'; import CategoricalScheme from './CategoricalScheme'; import ColorSchemeRegistry from './ColorSchemeRegistry'; import schemes from './colorSchemes/categorical/d3'; diff --git a/packages/superset-ui-color/src/ColorScheme.ts b/packages/superset-ui-core/src/color/ColorScheme.ts similarity index 100% rename from packages/superset-ui-color/src/ColorScheme.ts rename to packages/superset-ui-core/src/color/ColorScheme.ts diff --git a/packages/superset-ui-color/src/ColorSchemeRegistry.ts b/packages/superset-ui-core/src/color/ColorSchemeRegistry.ts similarity index 75% rename from packages/superset-ui-color/src/ColorSchemeRegistry.ts rename to packages/superset-ui-core/src/color/ColorSchemeRegistry.ts index de08128fd8..c6536fc4ae 100644 --- a/packages/superset-ui-color/src/ColorSchemeRegistry.ts +++ b/packages/superset-ui-core/src/color/ColorSchemeRegistry.ts @@ -1,4 +1,5 @@ -import { RegistryWithDefaultKey, OverwritePolicy } from '@superset-ui/core'; +import { RegistryWithDefaultKey } from '../models'; +import { OverwritePolicy } from '../types'; export default class ColorSchemeRegistry extends RegistryWithDefaultKey { constructor() { diff --git a/packages/superset-ui-color/src/SequentialScheme.ts b/packages/superset-ui-core/src/color/SequentialScheme.ts similarity index 100% rename from packages/superset-ui-color/src/SequentialScheme.ts rename to packages/superset-ui-core/src/color/SequentialScheme.ts diff --git a/packages/superset-ui-color/src/SequentialSchemeRegistrySingleton.ts b/packages/superset-ui-core/src/color/SequentialSchemeRegistrySingleton.ts similarity index 89% rename from packages/superset-ui-color/src/SequentialSchemeRegistrySingleton.ts rename to packages/superset-ui-core/src/color/SequentialSchemeRegistrySingleton.ts index 2ff8d23c40..621fd1acfd 100644 --- a/packages/superset-ui-color/src/SequentialSchemeRegistrySingleton.ts +++ b/packages/superset-ui-core/src/color/SequentialSchemeRegistrySingleton.ts @@ -1,4 +1,4 @@ -import { makeSingleton } from '@superset-ui/core'; +import makeSingleton from '../utils/makeSingleton'; import ColorSchemeRegistry from './ColorSchemeRegistry'; import SequentialScheme from './SequentialScheme'; import schemes from './colorSchemes/sequential/d3'; diff --git a/packages/superset-ui-color/src/colorSchemes/categorical/airbnb.ts b/packages/superset-ui-core/src/color/colorSchemes/categorical/airbnb.ts similarity index 100% rename from packages/superset-ui-color/src/colorSchemes/categorical/airbnb.ts rename to packages/superset-ui-core/src/color/colorSchemes/categorical/airbnb.ts diff --git a/packages/superset-ui-color/src/colorSchemes/categorical/d3.ts b/packages/superset-ui-core/src/color/colorSchemes/categorical/d3.ts similarity index 100% rename from packages/superset-ui-color/src/colorSchemes/categorical/d3.ts rename to packages/superset-ui-core/src/color/colorSchemes/categorical/d3.ts diff --git a/packages/superset-ui-color/src/colorSchemes/categorical/google.ts b/packages/superset-ui-core/src/color/colorSchemes/categorical/google.ts similarity index 100% rename from packages/superset-ui-color/src/colorSchemes/categorical/google.ts rename to packages/superset-ui-core/src/color/colorSchemes/categorical/google.ts diff --git a/packages/superset-ui-color/src/colorSchemes/categorical/lyft.ts b/packages/superset-ui-core/src/color/colorSchemes/categorical/lyft.ts similarity index 100% rename from packages/superset-ui-color/src/colorSchemes/categorical/lyft.ts rename to packages/superset-ui-core/src/color/colorSchemes/categorical/lyft.ts diff --git a/packages/superset-ui-color/src/colorSchemes/categorical/preset.ts b/packages/superset-ui-core/src/color/colorSchemes/categorical/preset.ts similarity index 100% rename from packages/superset-ui-color/src/colorSchemes/categorical/preset.ts rename to packages/superset-ui-core/src/color/colorSchemes/categorical/preset.ts diff --git a/packages/superset-ui-color/src/colorSchemes/categorical/superset.ts b/packages/superset-ui-core/src/color/colorSchemes/categorical/superset.ts similarity index 100% rename from packages/superset-ui-color/src/colorSchemes/categorical/superset.ts rename to packages/superset-ui-core/src/color/colorSchemes/categorical/superset.ts diff --git a/packages/superset-ui-color/src/colorSchemes/sequential/common.ts b/packages/superset-ui-core/src/color/colorSchemes/sequential/common.ts similarity index 100% rename from packages/superset-ui-color/src/colorSchemes/sequential/common.ts rename to packages/superset-ui-core/src/color/colorSchemes/sequential/common.ts diff --git a/packages/superset-ui-color/src/colorSchemes/sequential/d3.ts b/packages/superset-ui-core/src/color/colorSchemes/sequential/d3.ts similarity index 100% rename from packages/superset-ui-color/src/colorSchemes/sequential/d3.ts rename to packages/superset-ui-core/src/color/colorSchemes/sequential/d3.ts diff --git a/packages/superset-ui-color/src/index.ts b/packages/superset-ui-core/src/color/index.ts similarity index 100% rename from packages/superset-ui-color/src/index.ts rename to packages/superset-ui-core/src/color/index.ts diff --git a/packages/superset-ui-color/src/stringifyAndTrim.ts b/packages/superset-ui-core/src/color/stringifyAndTrim.ts similarity index 100% rename from packages/superset-ui-color/src/stringifyAndTrim.ts rename to packages/superset-ui-core/src/color/stringifyAndTrim.ts diff --git a/packages/superset-ui-color/src/types.ts b/packages/superset-ui-core/src/color/types.ts similarity index 100% rename from packages/superset-ui-color/src/types.ts rename to packages/superset-ui-core/src/color/types.ts diff --git a/packages/superset-ui-connection/README.md b/packages/superset-ui-core/src/connection/README.md similarity index 76% rename from packages/superset-ui-connection/README.md rename to packages/superset-ui-core/src/connection/README.md index bc34ca9c94..89cbc3d9e8 100644 --- a/packages/superset-ui-connection/README.md +++ b/packages/superset-ui-core/src/connection/README.md @@ -1,7 +1,4 @@ -## @superset-ui/connection - -[![Version](https://img.shields.io/npm/v/@superset-ui/connection.svg?style=flat)](https://img.shields.io/npm/v/@superset-ui/connection.svg?style=flat-square) -[![David (path)](https://img.shields.io/david/apache-superset/superset-ui.svg?path=packages%2Fsuperset-ui-connection&style=flat-square)](https://david-dm.org/apache-superset/superset-ui?path=packages/superset-ui-connection) +## @superset-ui/core/connection Connection modules for Superset: @@ -29,14 +26,13 @@ a high-level it supports: ```javascript // appSetup.js -import { SupersetClient } from `@superset-ui/connection`; -// or import SupersetClient from `@superset-ui/connection/lib|esm/SupersetClient`; +import { SupersetClient } from `@superset-ui/core`; SupersetClient.configure(...clientConfig); SupersetClient.init(); // CSRF auth, can also chain `.configure().init(); // anotherFile.js -import { SupersetClient } from `@superset-ui/connection`; +import { SupersetClient } from `@superset-ui/core`; SupersetClient.post(...requestConfig) .then(({ request, json }) => ...) @@ -77,7 +73,7 @@ The following flags can be passed on a per-request call `SupersetClient.get/post Per-request aborting is implemented through the `AbortController` API: ```javascript -import { SupersetClient } from '@superset-ui/connection'; +import { SupersetClient } from '@superset-ui/core'; import AbortController from 'abortcontroller-polyfill'; const controller = new AbortController(); @@ -89,8 +85,3 @@ if (IWantToCancelForSomeReason) { signal.abort(); // Promise is rejected, request `catch` is invoked } ``` - -### Development - -`@data-ui/build-config` is used to manage the build configuration for this package including babel -builds, jest testing, eslint, and prettier. diff --git a/packages/superset-ui-connection/src/SupersetClient.ts b/packages/superset-ui-core/src/connection/SupersetClient.ts similarity index 100% rename from packages/superset-ui-connection/src/SupersetClient.ts rename to packages/superset-ui-core/src/connection/SupersetClient.ts diff --git a/packages/superset-ui-connection/src/SupersetClientClass.ts b/packages/superset-ui-core/src/connection/SupersetClientClass.ts similarity index 97% rename from packages/superset-ui-connection/src/SupersetClientClass.ts rename to packages/superset-ui-core/src/connection/SupersetClientClass.ts index 01b9ea80e7..9ce281afd4 100644 --- a/packages/superset-ui-connection/src/SupersetClientClass.ts +++ b/packages/superset-ui-core/src/connection/SupersetClientClass.ts @@ -35,14 +35,23 @@ import { DEFAULT_FETCH_RETRY_OPTIONS, DEFAULT_BASE_URL } from './constants'; export default class SupersetClientClass { credentials: Credentials; + csrfToken?: CsrfToken; + csrfPromise?: CsrfPromise; + fetchRetryOptions?: FetchRetryOptions; + baseUrl: string; + protocol: Protocol; + host: Host; + headers: Headers; + mode: Mode; + timeout: ClientTimeout; constructor({ @@ -133,6 +142,7 @@ export default class SupersetClientClass { async ensureAuth(): CsrfPromise { return ( this.csrfPromise ?? + // eslint-disable-next-line prefer-promise-reject-errors Promise.reject({ error: `SupersetClient has not been provided a CSRF token, ensure it is initialized with \`client.getCSRFToken()\` or try logging in at @@ -165,6 +175,7 @@ export default class SupersetClientClass { if (this.isAuthenticated()) { return this.csrfToken; } + // eslint-disable-next-line prefer-promise-reject-errors return Promise.reject({ error: 'Failed to fetch CSRF token' }); }); return this.csrfPromise; diff --git a/packages/superset-ui-connection/src/callApi/callApi.ts b/packages/superset-ui-core/src/connection/callApi/callApi.ts similarity index 100% rename from packages/superset-ui-connection/src/callApi/callApi.ts rename to packages/superset-ui-core/src/connection/callApi/callApi.ts diff --git a/packages/superset-ui-connection/src/callApi/callApiAndParseWithTimeout.ts b/packages/superset-ui-core/src/connection/callApi/callApiAndParseWithTimeout.ts similarity index 100% rename from packages/superset-ui-connection/src/callApi/callApiAndParseWithTimeout.ts rename to packages/superset-ui-core/src/connection/callApi/callApiAndParseWithTimeout.ts diff --git a/packages/superset-ui-connection/src/callApi/index.ts b/packages/superset-ui-core/src/connection/callApi/index.ts similarity index 100% rename from packages/superset-ui-connection/src/callApi/index.ts rename to packages/superset-ui-core/src/connection/callApi/index.ts diff --git a/packages/superset-ui-connection/src/callApi/parseResponse.ts b/packages/superset-ui-core/src/connection/callApi/parseResponse.ts similarity index 100% rename from packages/superset-ui-connection/src/callApi/parseResponse.ts rename to packages/superset-ui-core/src/connection/callApi/parseResponse.ts diff --git a/packages/superset-ui-connection/src/callApi/rejectAfterTimeout.ts b/packages/superset-ui-core/src/connection/callApi/rejectAfterTimeout.ts similarity index 84% rename from packages/superset-ui-connection/src/callApi/rejectAfterTimeout.ts rename to packages/superset-ui-core/src/connection/callApi/rejectAfterTimeout.ts index ec3158339a..39c8b59b66 100644 --- a/packages/superset-ui-connection/src/callApi/rejectAfterTimeout.ts +++ b/packages/superset-ui-core/src/connection/callApi/rejectAfterTimeout.ts @@ -3,6 +3,7 @@ export default function rejectAfterTimeout(timeout: number) { return new Promise((resolve, reject) => { setTimeout( () => + // eslint-disable-next-line prefer-promise-reject-errors reject({ error: 'Request timed out', statusText: 'timeout', diff --git a/packages/superset-ui-connection/src/constants.ts b/packages/superset-ui-core/src/connection/constants.ts similarity index 100% rename from packages/superset-ui-connection/src/constants.ts rename to packages/superset-ui-core/src/connection/constants.ts diff --git a/packages/superset-ui-connection/src/index.ts b/packages/superset-ui-core/src/connection/index.ts similarity index 100% rename from packages/superset-ui-connection/src/index.ts rename to packages/superset-ui-core/src/connection/index.ts diff --git a/packages/superset-ui-connection/src/types.ts b/packages/superset-ui-core/src/connection/types.ts similarity index 100% rename from packages/superset-ui-connection/src/types.ts rename to packages/superset-ui-core/src/connection/types.ts diff --git a/packages/superset-ui-dimension/src/computeMaxFontSize.ts b/packages/superset-ui-core/src/dimension/computeMaxFontSize.ts similarity index 100% rename from packages/superset-ui-dimension/src/computeMaxFontSize.ts rename to packages/superset-ui-core/src/dimension/computeMaxFontSize.ts diff --git a/packages/superset-ui-dimension/src/getMultipleTextDimensions.ts b/packages/superset-ui-core/src/dimension/getMultipleTextDimensions.ts similarity index 100% rename from packages/superset-ui-dimension/src/getMultipleTextDimensions.ts rename to packages/superset-ui-core/src/dimension/getMultipleTextDimensions.ts diff --git a/packages/superset-ui-dimension/src/getTextDimension.ts b/packages/superset-ui-core/src/dimension/getTextDimension.ts similarity index 100% rename from packages/superset-ui-dimension/src/getTextDimension.ts rename to packages/superset-ui-core/src/dimension/getTextDimension.ts diff --git a/packages/superset-ui-dimension/src/index.ts b/packages/superset-ui-core/src/dimension/index.ts similarity index 100% rename from packages/superset-ui-dimension/src/index.ts rename to packages/superset-ui-core/src/dimension/index.ts diff --git a/packages/superset-ui-dimension/src/mergeMargin.ts b/packages/superset-ui-core/src/dimension/mergeMargin.ts similarity index 100% rename from packages/superset-ui-dimension/src/mergeMargin.ts rename to packages/superset-ui-core/src/dimension/mergeMargin.ts diff --git a/packages/superset-ui-dimension/src/parseLength.ts b/packages/superset-ui-core/src/dimension/parseLength.ts similarity index 100% rename from packages/superset-ui-dimension/src/parseLength.ts rename to packages/superset-ui-core/src/dimension/parseLength.ts diff --git a/packages/superset-ui-dimension/src/svg/LazyFactory.ts b/packages/superset-ui-core/src/dimension/svg/LazyFactory.ts similarity index 100% rename from packages/superset-ui-dimension/src/svg/LazyFactory.ts rename to packages/superset-ui-core/src/dimension/svg/LazyFactory.ts diff --git a/packages/superset-ui-dimension/src/svg/constants.ts b/packages/superset-ui-core/src/dimension/svg/constants.ts similarity index 100% rename from packages/superset-ui-dimension/src/svg/constants.ts rename to packages/superset-ui-core/src/dimension/svg/constants.ts diff --git a/packages/superset-ui-dimension/src/svg/createHiddenSvgNode.ts b/packages/superset-ui-core/src/dimension/svg/createHiddenSvgNode.ts similarity index 100% rename from packages/superset-ui-dimension/src/svg/createHiddenSvgNode.ts rename to packages/superset-ui-core/src/dimension/svg/createHiddenSvgNode.ts diff --git a/packages/superset-ui-dimension/src/svg/createTextNode.ts b/packages/superset-ui-core/src/dimension/svg/createTextNode.ts similarity index 100% rename from packages/superset-ui-dimension/src/svg/createTextNode.ts rename to packages/superset-ui-core/src/dimension/svg/createTextNode.ts diff --git a/packages/superset-ui-dimension/src/svg/factories.ts b/packages/superset-ui-core/src/dimension/svg/factories.ts similarity index 100% rename from packages/superset-ui-dimension/src/svg/factories.ts rename to packages/superset-ui-core/src/dimension/svg/factories.ts diff --git a/packages/superset-ui-dimension/src/svg/getBBoxCeil.ts b/packages/superset-ui-core/src/dimension/svg/getBBoxCeil.ts similarity index 100% rename from packages/superset-ui-dimension/src/svg/getBBoxCeil.ts rename to packages/superset-ui-core/src/dimension/svg/getBBoxCeil.ts diff --git a/packages/superset-ui-dimension/src/svg/updateTextNode.ts b/packages/superset-ui-core/src/dimension/svg/updateTextNode.ts similarity index 100% rename from packages/superset-ui-dimension/src/svg/updateTextNode.ts rename to packages/superset-ui-core/src/dimension/svg/updateTextNode.ts diff --git a/packages/superset-ui-dimension/src/types.ts b/packages/superset-ui-core/src/dimension/types.ts similarity index 100% rename from packages/superset-ui-dimension/src/types.ts rename to packages/superset-ui-core/src/dimension/types.ts diff --git a/packages/superset-ui-core/src/index.ts b/packages/superset-ui-core/src/index.ts index 6918a8fb26..559f306782 100644 --- a/packages/superset-ui-core/src/index.ts +++ b/packages/superset-ui-core/src/index.ts @@ -1,14 +1,28 @@ -export { default as ExtensibleFunction } from './models/ExtensibleFunction'; -export { default as Plugin } from './models/Plugin'; -export { default as Preset } from './models/Preset'; -export { default as Registry } from './models/Registry'; -export { default as RegistryWithDefaultKey } from './models/RegistryWithDefaultKey'; - -export { default as convertKeysToCamelCase } from './utils/convertKeysToCamelCase'; -export { default as isDefined } from './utils/isDefined'; -export { default as isRequired } from './utils/isRequired'; -export { default as makeSingleton } from './utils/makeSingleton'; -export { default as promiseTimeout } from './utils/promiseTimeout'; -export { default as logging } from './utils/logging'; - +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +export * from './models'; +export * from './utils'; export * from './types'; +export * from './translation'; +export * from './connection'; +export * from './query'; +export * from './number-format'; +export * from './time-format'; +export * from './dimension'; +export * from './color'; diff --git a/packages/superset-ui-core/src/models/index.ts b/packages/superset-ui-core/src/models/index.ts new file mode 100644 index 0000000000..fed74e4942 --- /dev/null +++ b/packages/superset-ui-core/src/models/index.ts @@ -0,0 +1,23 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +export { default as ExtensibleFunction } from './ExtensibleFunction'; +export { default as Plugin } from './Plugin'; +export { default as Preset } from './Preset'; +export { default as Registry } from './Registry'; +export { default as RegistryWithDefaultKey } from './RegistryWithDefaultKey'; diff --git a/packages/superset-ui-number-format/src/NumberFormats.ts b/packages/superset-ui-core/src/number-format/NumberFormats.ts similarity index 100% rename from packages/superset-ui-number-format/src/NumberFormats.ts rename to packages/superset-ui-core/src/number-format/NumberFormats.ts diff --git a/packages/superset-ui-number-format/src/NumberFormatter.ts b/packages/superset-ui-core/src/number-format/NumberFormatter.ts similarity index 62% rename from packages/superset-ui-number-format/src/NumberFormatter.ts rename to packages/superset-ui-core/src/number-format/NumberFormatter.ts index 2ceb5401ce..c8c656d4c1 100644 --- a/packages/superset-ui-number-format/src/NumberFormatter.ts +++ b/packages/superset-ui-core/src/number-format/NumberFormatter.ts @@ -1,4 +1,23 @@ -import { ExtensibleFunction, isRequired } from '@superset-ui/core'; +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { ExtensibleFunction } from '../models'; +import { isRequired } from '../utils'; import { NumberFormatFunction } from './types'; export const PREVIEW_VALUE = 12345.432; diff --git a/packages/superset-ui-number-format/src/NumberFormatterRegistry.ts b/packages/superset-ui-core/src/number-format/NumberFormatterRegistry.ts similarity index 60% rename from packages/superset-ui-number-format/src/NumberFormatterRegistry.ts rename to packages/superset-ui-core/src/number-format/NumberFormatterRegistry.ts index 6cac446383..c1e3576c6a 100644 --- a/packages/superset-ui-number-format/src/NumberFormatterRegistry.ts +++ b/packages/superset-ui-core/src/number-format/NumberFormatterRegistry.ts @@ -1,4 +1,23 @@ -import { RegistryWithDefaultKey, OverwritePolicy } from '@superset-ui/core'; +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { RegistryWithDefaultKey } from '../models'; +import { OverwritePolicy } from '../types'; import createD3NumberFormatter from './factories/createD3NumberFormatter'; import createSmartNumberFormatter from './factories/createSmartNumberFormatter'; import NumberFormats from './NumberFormats'; diff --git a/packages/superset-ui-core/src/number-format/NumberFormatterRegistrySingleton.ts b/packages/superset-ui-core/src/number-format/NumberFormatterRegistrySingleton.ts new file mode 100644 index 0000000000..9bb39ea615 --- /dev/null +++ b/packages/superset-ui-core/src/number-format/NumberFormatterRegistrySingleton.ts @@ -0,0 +1,32 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { makeSingleton } from '../utils'; +import NumberFormatterRegistry from './NumberFormatterRegistry'; + +const getInstance = makeSingleton(NumberFormatterRegistry); + +export default getInstance; + +export function getNumberFormatter(format?: string) { + return getInstance().get(format); +} + +export function formatNumber(format: string | undefined, value: number | null | undefined) { + return getInstance().format(format, value); +} diff --git a/packages/superset-ui-number-format/README.md b/packages/superset-ui-core/src/number-format/README.md similarity index 50% rename from packages/superset-ui-number-format/README.md rename to packages/superset-ui-core/src/number-format/README.md index 10718fb0ab..e8967fc19f 100644 --- a/packages/superset-ui-number-format/README.md +++ b/packages/superset-ui-core/src/number-format/README.md @@ -1,16 +1,14 @@ -## @superset-ui/number-format - -[![Version](https://img.shields.io/npm/v/@superset-ui/number-format.svg?style=flat)](https://img.shields.io/npm/v/@superset-ui/number-format.svg?style=flat) -[![David (path)](https://img.shields.io/david/apache-superset/superset-ui.svg?path=packages%2Fsuperset-ui-number-format&style=flat-square)](https://david-dm.org/apache-superset/superset-ui?path=packages/superset-ui-number-format) +## @superset-ui/core/number-format Description #### Example usage -Functions `getNumberFormatter` and `formatNumber` should be used instead of calling `d3.format` directly. +Functions `getNumberFormatter` and `formatNumber` should be used instead of calling `d3.format` +directly. ```js -import { getNumberFormatter } from '@superset-ui/number-format'; +import { getNumberFormatter } from '@superset-ui/core'; const formatter = getNumberFormatter('.2f'); console.log(formatter(1000)); ``` @@ -18,14 +16,15 @@ console.log(formatter(1000)); or ```js -import { formatNumber } from '@superset-ui/number-format'; +import { formatNumber } from '@superset-ui/core'; console.log(formatNumber('.2f', 1000)); ``` -It is powered by a registry to support registration of custom formatting, with fallback to `d3.format` and handle error for invalid format string. +It is powered by a registry to support registration of custom formatting, with fallback to +`d3.format` and handle error for invalid format string. ```js -import { getNumberFormatterRegistry, formatNumber, NumberFormatter } from '@superset-ui/number-format'; +import { getNumberFormatterRegistry, formatNumber, NumberFormatter } from '@superset-ui/core'; getNumberFormatterRegistry().registerValue('my_format', new NumberFormatter({ id: 'my_format', @@ -36,16 +35,18 @@ console.log(formatNumber('my_format', 1000)); // prints 'my special format of 1000' ``` -It also define constants for common d3 formats. See the full list of formats in [NumberFormats.js](https://github.com/apache-superset/superset-ui/blob/master/packages/superset-ui-number-format/src/NumberFormats.js). +It also define constants for common d3 formats. See the full list of formats in +[NumberFormats.js](https://github.com/apache-superset/superset-ui/blob/master/packages/superset-ui-number-format/src/NumberFormats.js). ```js import { NumberFormats } from '@superset-ui-number-format'; -NumberFormats.PERCENT // ,.2% -NumberFormats.PERCENT_3_POINT // ,.3% +NumberFormats.PERCENT; // ,.2% +NumberFormats.PERCENT_3_POINT; // ,.3% ``` -There is also a formatter based on [pretty-ms](https://www.npmjs.com/package/pretty-ms) that can be used to format time durations: +There is also a formatter based on [pretty-ms](https://www.npmjs.com/package/pretty-ms) that can be +used to format time durations: ```js import { createDurationFormatter, formatNumber, getNumberFormatterRegistry } from from '@superset-ui-number-format'; @@ -60,8 +61,3 @@ console.log(formatNumber('my_duration_format', 95500)) `fn(args)` - Do something - -### Development - -`@data-ui/build-config` is used to manage the build configuration for this package including babel -builds, jest testing, eslint, and prettier. diff --git a/packages/superset-ui-number-format/src/factories/createD3NumberFormatter.ts b/packages/superset-ui-core/src/number-format/factories/createD3NumberFormatter.ts similarity index 51% rename from packages/superset-ui-number-format/src/factories/createD3NumberFormatter.ts rename to packages/superset-ui-core/src/number-format/factories/createD3NumberFormatter.ts index 1a87d5d443..839ab07bee 100644 --- a/packages/superset-ui-number-format/src/factories/createD3NumberFormatter.ts +++ b/packages/superset-ui-core/src/number-format/factories/createD3NumberFormatter.ts @@ -1,5 +1,23 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ import { format as d3Format, formatLocale, FormatLocaleDefinition } from 'd3-format'; -import { isRequired } from '@superset-ui/core'; +import { isRequired } from '../../utils'; import NumberFormatter from '../NumberFormatter'; import { NumberFormatFunction } from '../types'; diff --git a/packages/superset-ui-number-format/src/factories/createDurationFormatter.ts b/packages/superset-ui-core/src/number-format/factories/createDurationFormatter.ts similarity index 100% rename from packages/superset-ui-number-format/src/factories/createDurationFormatter.ts rename to packages/superset-ui-core/src/number-format/factories/createDurationFormatter.ts diff --git a/packages/superset-ui-number-format/src/factories/createSiAtMostNDigitFormatter.ts b/packages/superset-ui-core/src/number-format/factories/createSiAtMostNDigitFormatter.ts similarity index 100% rename from packages/superset-ui-number-format/src/factories/createSiAtMostNDigitFormatter.ts rename to packages/superset-ui-core/src/number-format/factories/createSiAtMostNDigitFormatter.ts diff --git a/packages/superset-ui-number-format/src/factories/createSmartNumberFormatter.ts b/packages/superset-ui-core/src/number-format/factories/createSmartNumberFormatter.ts similarity index 100% rename from packages/superset-ui-number-format/src/factories/createSmartNumberFormatter.ts rename to packages/superset-ui-core/src/number-format/factories/createSmartNumberFormatter.ts diff --git a/packages/superset-ui-number-format/src/index.ts b/packages/superset-ui-core/src/number-format/index.ts similarity index 75% rename from packages/superset-ui-number-format/src/index.ts rename to packages/superset-ui-core/src/number-format/index.ts index aa8574aaef..797f81f3e9 100644 --- a/packages/superset-ui-number-format/src/index.ts +++ b/packages/superset-ui-core/src/number-format/index.ts @@ -7,6 +7,8 @@ export { getNumberFormatter, } from './NumberFormatterRegistrySingleton'; +export { default as NumberFormatterRegistry } from './NumberFormatterRegistry'; export { default as createD3NumberFormatter } from './factories/createD3NumberFormatter'; export { default as createDurationFormatter } from './factories/createDurationFormatter'; export { default as createSiAtMostNDigitFormatter } from './factories/createSiAtMostNDigitFormatter'; +export { default as createSmartNumberFormatter } from './factories/createSmartNumberFormatter'; diff --git a/packages/superset-ui-number-format/src/types.ts b/packages/superset-ui-core/src/number-format/types.ts similarity index 100% rename from packages/superset-ui-number-format/src/types.ts rename to packages/superset-ui-core/src/number-format/types.ts diff --git a/packages/superset-ui-query/src/DatasourceKey.ts b/packages/superset-ui-core/src/query/DatasourceKey.ts similarity index 100% rename from packages/superset-ui-query/src/DatasourceKey.ts rename to packages/superset-ui-core/src/query/DatasourceKey.ts diff --git a/packages/superset-ui-core/src/query/README.md b/packages/superset-ui-core/src/query/README.md new file mode 100644 index 0000000000..91fd632f2e --- /dev/null +++ b/packages/superset-ui-core/src/query/README.md @@ -0,0 +1,11 @@ +## @superset-ui/core/query + +Utility to make API requests to Superset backend. + +#### Example usage + +TODO + +#### API + +TODO diff --git a/packages/superset-ui-query/src/api/legacy/fetchExploreJson.ts b/packages/superset-ui-core/src/query/api/legacy/fetchExploreJson.ts similarity index 90% rename from packages/superset-ui-query/src/api/legacy/fetchExploreJson.ts rename to packages/superset-ui-core/src/query/api/legacy/fetchExploreJson.ts index f87e3c721a..80d2da4e8b 100644 --- a/packages/superset-ui-query/src/api/legacy/fetchExploreJson.ts +++ b/packages/superset-ui-core/src/query/api/legacy/fetchExploreJson.ts @@ -1,4 +1,4 @@ -import { SupersetClient, Method, Endpoint } from '@superset-ui/connection'; +import { SupersetClient, Method, Endpoint } from '../../../connection'; import { QueryFormData } from '../../types/QueryFormData'; import { LegacyChartDataResponse } from './types'; import { BaseParams } from '../types'; diff --git a/packages/superset-ui-query/src/api/legacy/getDatasourceMetadata.ts b/packages/superset-ui-core/src/query/api/legacy/getDatasourceMetadata.ts similarity index 89% rename from packages/superset-ui-query/src/api/legacy/getDatasourceMetadata.ts rename to packages/superset-ui-core/src/query/api/legacy/getDatasourceMetadata.ts index 200e93e540..004480eace 100644 --- a/packages/superset-ui-query/src/api/legacy/getDatasourceMetadata.ts +++ b/packages/superset-ui-core/src/query/api/legacy/getDatasourceMetadata.ts @@ -1,4 +1,4 @@ -import { SupersetClient } from '@superset-ui/connection'; +import { SupersetClient } from '../../../connection'; import { Datasource } from '../../types/Datasource'; import { BaseParams } from '../types'; diff --git a/packages/superset-ui-query/src/api/legacy/getFormData.ts b/packages/superset-ui-core/src/query/api/legacy/getFormData.ts similarity index 91% rename from packages/superset-ui-query/src/api/legacy/getFormData.ts rename to packages/superset-ui-core/src/query/api/legacy/getFormData.ts index 5f484993b7..8a67e754ab 100644 --- a/packages/superset-ui-query/src/api/legacy/getFormData.ts +++ b/packages/superset-ui-core/src/query/api/legacy/getFormData.ts @@ -1,4 +1,4 @@ -import { SupersetClient } from '@superset-ui/connection'; +import { SupersetClient } from '../../../connection'; import { BaseParams } from '../types'; import { QueryFormData } from '../../types/QueryFormData'; diff --git a/packages/superset-ui-query/src/api/legacy/index.ts b/packages/superset-ui-core/src/query/api/legacy/index.ts similarity index 100% rename from packages/superset-ui-query/src/api/legacy/index.ts rename to packages/superset-ui-core/src/query/api/legacy/index.ts diff --git a/packages/superset-ui-query/src/api/legacy/types.ts b/packages/superset-ui-core/src/query/api/legacy/types.ts similarity index 100% rename from packages/superset-ui-query/src/api/legacy/types.ts rename to packages/superset-ui-core/src/query/api/legacy/types.ts diff --git a/packages/superset-ui-query/src/api/types.ts b/packages/superset-ui-core/src/query/api/types.ts similarity index 89% rename from packages/superset-ui-query/src/api/types.ts rename to packages/superset-ui-core/src/query/api/types.ts index 90eddc9277..e7b73909ec 100644 --- a/packages/superset-ui-query/src/api/types.ts +++ b/packages/superset-ui-core/src/query/api/types.ts @@ -16,11 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { - RequestConfig, - SupersetClientInterface, - SupersetClientClass, -} from '@superset-ui/connection'; +import { RequestConfig, SupersetClientInterface, SupersetClientClass } from '../../connection'; export interface BaseParams { client?: SupersetClientInterface | SupersetClientClass; diff --git a/packages/superset-ui-query/src/api/v1/handleError.ts b/packages/superset-ui-core/src/query/api/v1/handleError.ts similarity index 100% rename from packages/superset-ui-query/src/api/v1/handleError.ts rename to packages/superset-ui-core/src/query/api/v1/handleError.ts diff --git a/packages/superset-ui-query/src/api/v1/index.ts b/packages/superset-ui-core/src/query/api/v1/index.ts similarity index 100% rename from packages/superset-ui-query/src/api/v1/index.ts rename to packages/superset-ui-core/src/query/api/v1/index.ts diff --git a/packages/superset-ui-query/src/api/v1/makeApi.ts b/packages/superset-ui-core/src/query/api/v1/makeApi.ts similarity index 99% rename from packages/superset-ui-query/src/api/v1/makeApi.ts rename to packages/superset-ui-core/src/query/api/v1/makeApi.ts index b72562d021..71f652bb7c 100644 --- a/packages/superset-ui-query/src/api/v1/makeApi.ts +++ b/packages/superset-ui-core/src/query/api/v1/makeApi.ts @@ -25,7 +25,7 @@ import { Endpoint, Method, RequestBase, -} from '@superset-ui/connection'; +} from '../../../connection'; import handleError, { ErrorInput } from './handleError'; import { SupersetApiRequestOptions, SupersetApiErrorPayload, ParsedResponseType } from './types'; diff --git a/packages/superset-ui-query/src/api/v1/types.ts b/packages/superset-ui-core/src/query/api/v1/types.ts similarity index 99% rename from packages/superset-ui-query/src/api/v1/types.ts rename to packages/superset-ui-core/src/query/api/v1/types.ts index 270e7cb6e5..84ab441ec4 100644 --- a/packages/superset-ui-query/src/api/v1/types.ts +++ b/packages/superset-ui-core/src/query/api/v1/types.ts @@ -23,7 +23,7 @@ import { StrictJsonObject, JsonValue, JsonObject, -} from '@superset-ui/connection'; +} from '../../../connection'; export type ParsedResponseType = T extends 'text' ? string diff --git a/packages/superset-ui-query/src/buildQueryContext.ts b/packages/superset-ui-core/src/query/buildQueryContext.ts similarity index 100% rename from packages/superset-ui-query/src/buildQueryContext.ts rename to packages/superset-ui-core/src/query/buildQueryContext.ts diff --git a/packages/superset-ui-query/src/buildQueryObject.ts b/packages/superset-ui-core/src/query/buildQueryObject.ts similarity index 100% rename from packages/superset-ui-query/src/buildQueryObject.ts rename to packages/superset-ui-core/src/query/buildQueryObject.ts diff --git a/packages/superset-ui-query/src/convertFilter.ts b/packages/superset-ui-core/src/query/convertFilter.ts similarity index 100% rename from packages/superset-ui-query/src/convertFilter.ts rename to packages/superset-ui-core/src/query/convertFilter.ts diff --git a/packages/superset-ui-query/src/convertMetric.ts b/packages/superset-ui-core/src/query/convertMetric.ts similarity index 100% rename from packages/superset-ui-query/src/convertMetric.ts rename to packages/superset-ui-core/src/query/convertMetric.ts diff --git a/packages/superset-ui-query/src/extractExtras.ts b/packages/superset-ui-core/src/query/extractExtras.ts similarity index 100% rename from packages/superset-ui-query/src/extractExtras.ts rename to packages/superset-ui-core/src/query/extractExtras.ts diff --git a/packages/superset-ui-query/src/extractQueryFields.ts b/packages/superset-ui-core/src/query/extractQueryFields.ts similarity index 100% rename from packages/superset-ui-query/src/extractQueryFields.ts rename to packages/superset-ui-core/src/query/extractQueryFields.ts diff --git a/packages/superset-ui-query/src/index.ts b/packages/superset-ui-core/src/query/index.ts similarity index 100% rename from packages/superset-ui-query/src/index.ts rename to packages/superset-ui-core/src/query/index.ts diff --git a/packages/superset-ui-query/src/processFilters.ts b/packages/superset-ui-core/src/query/processFilters.ts similarity index 100% rename from packages/superset-ui-query/src/processFilters.ts rename to packages/superset-ui-core/src/query/processFilters.ts diff --git a/packages/superset-ui-query/src/processGroupby.ts b/packages/superset-ui-core/src/query/processGroupby.ts similarity index 100% rename from packages/superset-ui-query/src/processGroupby.ts rename to packages/superset-ui-core/src/query/processGroupby.ts diff --git a/packages/superset-ui-query/src/types/Column.ts b/packages/superset-ui-core/src/query/types/Column.ts similarity index 100% rename from packages/superset-ui-query/src/types/Column.ts rename to packages/superset-ui-core/src/query/types/Column.ts diff --git a/packages/superset-ui-query/src/types/Datasource.ts b/packages/superset-ui-core/src/query/types/Datasource.ts similarity index 100% rename from packages/superset-ui-query/src/types/Datasource.ts rename to packages/superset-ui-core/src/query/types/Datasource.ts diff --git a/packages/superset-ui-query/src/types/Filter.ts b/packages/superset-ui-core/src/query/types/Filter.ts similarity index 100% rename from packages/superset-ui-query/src/types/Filter.ts rename to packages/superset-ui-core/src/query/types/Filter.ts diff --git a/packages/superset-ui-query/src/types/Metric.ts b/packages/superset-ui-core/src/query/types/Metric.ts similarity index 100% rename from packages/superset-ui-query/src/types/Metric.ts rename to packages/superset-ui-core/src/query/types/Metric.ts diff --git a/packages/superset-ui-query/src/types/Operator.ts b/packages/superset-ui-core/src/query/types/Operator.ts similarity index 100% rename from packages/superset-ui-query/src/types/Operator.ts rename to packages/superset-ui-core/src/query/types/Operator.ts diff --git a/packages/superset-ui-query/src/types/Query.ts b/packages/superset-ui-core/src/query/types/Query.ts similarity index 100% rename from packages/superset-ui-query/src/types/Query.ts rename to packages/superset-ui-core/src/query/types/Query.ts diff --git a/packages/superset-ui-query/src/types/QueryFormData.ts b/packages/superset-ui-core/src/query/types/QueryFormData.ts similarity index 100% rename from packages/superset-ui-query/src/types/QueryFormData.ts rename to packages/superset-ui-core/src/query/types/QueryFormData.ts diff --git a/packages/superset-ui-query/src/types/Time.ts b/packages/superset-ui-core/src/query/types/Time.ts similarity index 100% rename from packages/superset-ui-query/src/types/Time.ts rename to packages/superset-ui-core/src/query/types/Time.ts diff --git a/packages/superset-ui-core/src/time-format/README.md b/packages/superset-ui-core/src/time-format/README.md new file mode 100644 index 0000000000..fba67d344c --- /dev/null +++ b/packages/superset-ui-core/src/time-format/README.md @@ -0,0 +1,49 @@ +## @superset-ui/core/time-format + +Description + +#### Example usage + +```js +import { getTimeFormatter } from '@superset-ui/core'; +const formatter = getTimeFormatter('%Y-%m-d'); +console.log(formatter(new Date())); +``` + +or + +```js +import { formatTime } from '@superset-ui/core'; +console.log(formatTime('%Y-%m-d', new Date())); +``` + +It is powered by a registry to support registration of custom formatting, with fallback to +`d3.utcFormat` or `d3.timeFormat` (if the formatId starts with `local!`) + +```js +import { getTimeFormatterRegistry, formatTime, TimeFormatter } from '@superset-ui/core'; + +getTimeFormatterRegistry().registerValue('my_format', new TimeFormatter({ + id: 'my_format', + formatFunc: v => `my special format of ${utcFormat('%Y')(v)}` +}); + +console.log(formatTime('my_format', new Date(2018))); +// prints 'my special format of 2018' +``` + +It also define constants for common d3 time formats. See +[TimeFormats.js](https://github.com/apache-superset/superset-ui/blob/master/packages/superset-ui-time-format/src/TimeFormats.js). + +```js +import { TimeFormats } from '@superset-ui/core'; + +TimeFormats.DATABASE_DATETIME; // '%Y-%m-%d %H:%M:%S' +TimeFormats.US_DATE; // '%m/%d/%Y' +``` + +#### API + +`fn(args)` + +- Do something diff --git a/packages/superset-ui-time-format/src/TimeFormats.ts b/packages/superset-ui-core/src/time-format/TimeFormats.ts similarity index 100% rename from packages/superset-ui-time-format/src/TimeFormats.ts rename to packages/superset-ui-core/src/time-format/TimeFormats.ts diff --git a/packages/superset-ui-time-format/src/TimeFormatsForGranularity.ts b/packages/superset-ui-core/src/time-format/TimeFormatsForGranularity.ts similarity index 100% rename from packages/superset-ui-time-format/src/TimeFormatsForGranularity.ts rename to packages/superset-ui-core/src/time-format/TimeFormatsForGranularity.ts diff --git a/packages/superset-ui-time-format/src/TimeFormatter.ts b/packages/superset-ui-core/src/time-format/TimeFormatter.ts similarity index 60% rename from packages/superset-ui-time-format/src/TimeFormatter.ts rename to packages/superset-ui-core/src/time-format/TimeFormatter.ts index a49b1fec82..3a2a2464bc 100644 --- a/packages/superset-ui-time-format/src/TimeFormatter.ts +++ b/packages/superset-ui-core/src/time-format/TimeFormatter.ts @@ -1,4 +1,23 @@ -import { ExtensibleFunction, isRequired } from '@superset-ui/core'; +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { ExtensibleFunction } from '../models'; +import { isRequired } from '../utils'; import { TimeFormatFunction } from './types'; import stringifyTimeInput from './utils/stringifyTimeInput'; diff --git a/packages/superset-ui-time-format/src/TimeFormatterRegistry.ts b/packages/superset-ui-core/src/time-format/TimeFormatterRegistry.ts similarity index 56% rename from packages/superset-ui-time-format/src/TimeFormatterRegistry.ts rename to packages/superset-ui-core/src/time-format/TimeFormatterRegistry.ts index 8e1f1c2db5..40f9e83656 100644 --- a/packages/superset-ui-time-format/src/TimeFormatterRegistry.ts +++ b/packages/superset-ui-core/src/time-format/TimeFormatterRegistry.ts @@ -1,4 +1,23 @@ -import { RegistryWithDefaultKey, OverwritePolicy } from '@superset-ui/core'; +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { RegistryWithDefaultKey } from '../models'; +import { OverwritePolicy } from '../types'; import TimeFormats, { LOCAL_PREFIX } from './TimeFormats'; import createD3TimeFormatter from './factories/createD3TimeFormatter'; import TimeFormatter from './TimeFormatter'; diff --git a/packages/superset-ui-time-format/src/TimeFormatterRegistrySingleton.ts b/packages/superset-ui-core/src/time-format/TimeFormatterRegistrySingleton.ts similarity index 71% rename from packages/superset-ui-time-format/src/TimeFormatterRegistrySingleton.ts rename to packages/superset-ui-core/src/time-format/TimeFormatterRegistrySingleton.ts index 6c7e08f9b1..a79e440495 100644 --- a/packages/superset-ui-time-format/src/TimeFormatterRegistrySingleton.ts +++ b/packages/superset-ui-core/src/time-format/TimeFormatterRegistrySingleton.ts @@ -1,4 +1,22 @@ -import { makeSingleton } from '@superset-ui/core'; +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { makeSingleton } from '../utils'; import TimeFormatterRegistry from './TimeFormatterRegistry'; import TimeFormatter from './TimeFormatter'; import TimeFormatsForGranularity from './TimeFormatsForGranularity'; diff --git a/packages/superset-ui-time-format/src/TimeRangeFormatter.ts b/packages/superset-ui-core/src/time-format/TimeRangeFormatter.ts similarity index 54% rename from packages/superset-ui-time-format/src/TimeRangeFormatter.ts rename to packages/superset-ui-core/src/time-format/TimeRangeFormatter.ts index 0d199d91ea..36f53bd68b 100644 --- a/packages/superset-ui-time-format/src/TimeRangeFormatter.ts +++ b/packages/superset-ui-core/src/time-format/TimeRangeFormatter.ts @@ -1,4 +1,22 @@ -import { ExtensibleFunction } from '@superset-ui/core'; +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { ExtensibleFunction } from '../models'; import { TimeRangeFormatFunction } from './types'; // Use type augmentation to indicate that diff --git a/packages/superset-ui-time-format/src/factories/createD3TimeFormatter.ts b/packages/superset-ui-core/src/time-format/factories/createD3TimeFormatter.ts similarity index 54% rename from packages/superset-ui-time-format/src/factories/createD3TimeFormatter.ts rename to packages/superset-ui-core/src/time-format/factories/createD3TimeFormatter.ts index c965bff313..e8cbe42e34 100644 --- a/packages/superset-ui-time-format/src/factories/createD3TimeFormatter.ts +++ b/packages/superset-ui-core/src/time-format/factories/createD3TimeFormatter.ts @@ -1,5 +1,23 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ import { utcFormat, timeFormat, timeFormatLocale, TimeLocaleDefinition } from 'd3-time-format'; -import { isRequired } from '@superset-ui/core'; +import { isRequired } from '../../utils'; import TimeFormatter from '../TimeFormatter'; import { LOCAL_PREFIX } from '../TimeFormats'; diff --git a/packages/superset-ui-time-format/src/factories/createMultiFormatter.ts b/packages/superset-ui-core/src/time-format/factories/createMultiFormatter.ts similarity index 100% rename from packages/superset-ui-time-format/src/factories/createMultiFormatter.ts rename to packages/superset-ui-core/src/time-format/factories/createMultiFormatter.ts diff --git a/packages/superset-ui-time-format/src/formatters/smartDate.ts b/packages/superset-ui-core/src/time-format/formatters/smartDate.ts similarity index 100% rename from packages/superset-ui-time-format/src/formatters/smartDate.ts rename to packages/superset-ui-core/src/time-format/formatters/smartDate.ts diff --git a/packages/superset-ui-time-format/src/formatters/smartDateVerbose.ts b/packages/superset-ui-core/src/time-format/formatters/smartDateVerbose.ts similarity index 100% rename from packages/superset-ui-time-format/src/formatters/smartDateVerbose.ts rename to packages/superset-ui-core/src/time-format/formatters/smartDateVerbose.ts diff --git a/packages/superset-ui-time-format/src/index.ts b/packages/superset-ui-core/src/time-format/index.ts similarity index 100% rename from packages/superset-ui-time-format/src/index.ts rename to packages/superset-ui-core/src/time-format/index.ts diff --git a/packages/superset-ui-time-format/src/types.ts b/packages/superset-ui-core/src/time-format/types.ts similarity index 100% rename from packages/superset-ui-time-format/src/types.ts rename to packages/superset-ui-core/src/time-format/types.ts diff --git a/packages/superset-ui-time-format/src/utils/createTime.ts b/packages/superset-ui-core/src/time-format/utils/createTime.ts similarity index 100% rename from packages/superset-ui-time-format/src/utils/createTime.ts rename to packages/superset-ui-core/src/time-format/utils/createTime.ts diff --git a/packages/superset-ui-time-format/src/utils/createTimeRangeFromGranularity.ts b/packages/superset-ui-core/src/time-format/utils/createTimeRangeFromGranularity.ts similarity index 100% rename from packages/superset-ui-time-format/src/utils/createTimeRangeFromGranularity.ts rename to packages/superset-ui-core/src/time-format/utils/createTimeRangeFromGranularity.ts diff --git a/packages/superset-ui-time-format/src/utils/d3Time.ts b/packages/superset-ui-core/src/time-format/utils/d3Time.ts similarity index 100% rename from packages/superset-ui-time-format/src/utils/d3Time.ts rename to packages/superset-ui-core/src/time-format/utils/d3Time.ts diff --git a/packages/superset-ui-time-format/src/utils/stringifyTimeInput.ts b/packages/superset-ui-core/src/time-format/utils/stringifyTimeInput.ts similarity index 100% rename from packages/superset-ui-time-format/src/utils/stringifyTimeInput.ts rename to packages/superset-ui-core/src/time-format/utils/stringifyTimeInput.ts diff --git a/packages/superset-ui-core/src/translation/README.md b/packages/superset-ui-core/src/translation/README.md new file mode 100644 index 0000000000..a09246fd80 --- /dev/null +++ b/packages/superset-ui-core/src/translation/README.md @@ -0,0 +1,52 @@ +## @superset-ui/core/translation + +`i18n` locales and translation for Superset. + +### SupersetTranslation + +#### Example usage + +```js +import { configure, t, tn } from '@superset-ui/core'; + +configure({ + languagePack: {...}, +}); + +console.log(t('text to be translated')); +console.log(tn('singular text', 'plural text', value)); +``` + +#### API + +`configure({ [languagePack] })` + +- Initialize the translator +- Initialize with the default language if no `languagePack` is specified. + +`t(text[, args])` + +- Translate `text`. +- If `args` is provided, substitute `args` into the `sprintf` placeholders specified within `text` + translation. + +For example + +```js +t('Hello %(name)s', user); +``` + +See [sprintf-js](https://github.com/alexei/sprintf.js) for more details on how to define +placeholders. + +`tn(singular, plural, num, [, args])` + +- Translate and choose between `singular` and `plural` based on `num`. +- If `args` is provided, substitute `args` into the `sprintf` placeholders specified within + `singular` or `plural` translations. + +For example + +```js +tn('%d duck', '%d ducks', 2, 2); +``` diff --git a/packages/superset-ui-translation/src/Translator.ts b/packages/superset-ui-core/src/translation/Translator.ts similarity index 98% rename from packages/superset-ui-translation/src/Translator.ts rename to packages/superset-ui-core/src/translation/Translator.ts index c0a47eee6d..bb4ad6b6e1 100644 --- a/packages/superset-ui-translation/src/Translator.ts +++ b/packages/superset-ui-core/src/translation/Translator.ts @@ -17,7 +17,7 @@ * under the License. */ import UntypedJed from 'jed'; -import { logging } from '@superset-ui/core'; +import logging from '../utils/logging'; import { Jed, TranslatorConfig, Locale, Translations, LocaleData, LanguagePack } from './types'; const DEFAULT_LANGUAGE_PACK: LanguagePack = { diff --git a/packages/superset-ui-translation/src/TranslatorSingleton.ts b/packages/superset-ui-core/src/translation/TranslatorSingleton.ts similarity index 100% rename from packages/superset-ui-translation/src/TranslatorSingleton.ts rename to packages/superset-ui-core/src/translation/TranslatorSingleton.ts diff --git a/packages/superset-ui-translation/src/index.ts b/packages/superset-ui-core/src/translation/index.ts similarity index 100% rename from packages/superset-ui-translation/src/index.ts rename to packages/superset-ui-core/src/translation/index.ts diff --git a/packages/superset-ui-translation/src/types/index.ts b/packages/superset-ui-core/src/translation/types/index.ts similarity index 100% rename from packages/superset-ui-translation/src/types/index.ts rename to packages/superset-ui-core/src/translation/types/index.ts diff --git a/packages/superset-ui-translation/src/types/jed.ts b/packages/superset-ui-core/src/translation/types/jed.ts similarity index 100% rename from packages/superset-ui-translation/src/types/jed.ts rename to packages/superset-ui-core/src/translation/types/jed.ts diff --git a/packages/superset-ui-core/src/types.ts b/packages/superset-ui-core/src/types/index.ts similarity index 100% rename from packages/superset-ui-core/src/types.ts rename to packages/superset-ui-core/src/types/index.ts diff --git a/packages/superset-ui-core/src/utils/index.ts b/packages/superset-ui-core/src/utils/index.ts new file mode 100644 index 0000000000..5198e3f218 --- /dev/null +++ b/packages/superset-ui-core/src/utils/index.ts @@ -0,0 +1,24 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +export { default as convertKeysToCamelCase } from './convertKeysToCamelCase'; +export { default as isDefined } from './isDefined'; +export { default as isRequired } from './isRequired'; +export { default as makeSingleton } from './makeSingleton'; +export { default as promiseTimeout } from './promiseTimeout'; +export { default as logging } from './logging'; diff --git a/packages/superset-ui-color/test/CategoricalColorNameSpace.test.ts b/packages/superset-ui-core/test/color/CategoricalColorNameSpace.test.ts similarity index 95% rename from packages/superset-ui-color/test/CategoricalColorNameSpace.test.ts rename to packages/superset-ui-core/test/color/CategoricalColorNameSpace.test.ts index da479f0330..fa2f193906 100644 --- a/packages/superset-ui-color/test/CategoricalColorNameSpace.test.ts +++ b/packages/superset-ui-core/test/color/CategoricalColorNameSpace.test.ts @@ -3,9 +3,9 @@ import CategoricalColorNamespace, { getScale, getColor, DEFAULT_NAMESPACE, -} from '../src/CategoricalColorNamespace'; -import getCategoricalSchemeRegistry from '../src/CategoricalSchemeRegistrySingleton'; -import CategoricalScheme from '../src/CategoricalScheme'; +} from '@superset-ui/core/src/color/CategoricalColorNamespace'; +import getCategoricalSchemeRegistry from '@superset-ui/core/src/color/CategoricalSchemeRegistrySingleton'; +import CategoricalScheme from '@superset-ui/core/src/color/CategoricalScheme'; describe('CategoricalColorNamespace', () => { beforeAll(() => { diff --git a/packages/superset-ui-color/test/CategoricalColorScale.test.ts b/packages/superset-ui-core/test/color/CategoricalColorScale.test.ts similarity index 98% rename from packages/superset-ui-color/test/CategoricalColorScale.test.ts rename to packages/superset-ui-core/test/color/CategoricalColorScale.test.ts index 00d8244435..1c027a006c 100644 --- a/packages/superset-ui-color/test/CategoricalColorScale.test.ts +++ b/packages/superset-ui-core/test/color/CategoricalColorScale.test.ts @@ -1,5 +1,5 @@ import { ScaleOrdinal } from 'd3-scale'; -import CategoricalColorScale from '../src/CategoricalColorScale'; +import CategoricalColorScale from '@superset-ui/core/src/color/CategoricalColorScale'; describe('CategoricalColorScale', () => { it('exists', () => { diff --git a/packages/superset-ui-color/test/CategoricalSchemeRegistrySingleton.test.ts b/packages/superset-ui-core/test/color/CategoricalSchemeRegistrySingleton.test.ts similarity index 89% rename from packages/superset-ui-color/test/CategoricalSchemeRegistrySingleton.test.ts rename to packages/superset-ui-core/test/color/CategoricalSchemeRegistrySingleton.test.ts index 5db289d0a2..b38f233c4b 100644 --- a/packages/superset-ui-color/test/CategoricalSchemeRegistrySingleton.test.ts +++ b/packages/superset-ui-core/test/color/CategoricalSchemeRegistrySingleton.test.ts @@ -1,4 +1,4 @@ -import { CategoricalScheme, getCategoricalSchemeRegistry } from '../src'; +import { CategoricalScheme, getCategoricalSchemeRegistry } from '@superset-ui/core/src/color'; describe('CategoricalSchemeRegistry', () => { it('has default value out-of-the-box', () => { diff --git a/packages/superset-ui-color/test/ColorScheme.test.ts b/packages/superset-ui-core/test/color/ColorScheme.test.ts similarity index 80% rename from packages/superset-ui-color/test/ColorScheme.test.ts rename to packages/superset-ui-core/test/color/ColorScheme.test.ts index 3cf63c420c..4da70568c3 100644 --- a/packages/superset-ui-color/test/ColorScheme.test.ts +++ b/packages/superset-ui-core/test/color/ColorScheme.test.ts @@ -1,4 +1,4 @@ -import ColorScheme from '../src/ColorScheme'; +import ColorScheme from '@superset-ui/core/src/color/ColorScheme'; describe('ColorScheme', () => { describe('new ColorScheme()', () => { diff --git a/packages/superset-ui-color/test/ColorSchemeRegistry.test.ts b/packages/superset-ui-core/test/color/ColorSchemeRegistry.test.ts similarity index 68% rename from packages/superset-ui-color/test/ColorSchemeRegistry.test.ts rename to packages/superset-ui-core/test/color/ColorSchemeRegistry.test.ts index b9cb4696ca..e103871288 100644 --- a/packages/superset-ui-color/test/ColorSchemeRegistry.test.ts +++ b/packages/superset-ui-core/test/color/ColorSchemeRegistry.test.ts @@ -1,4 +1,4 @@ -import ColorSchemeRegistry from '../src/ColorSchemeRegistry'; +import ColorSchemeRegistry from '@superset-ui/core/src/color/ColorSchemeRegistry'; describe('ColorSchemeRegistry', () => { it('exists', () => { diff --git a/packages/superset-ui-color/test/SequentialScheme.test.ts b/packages/superset-ui-core/test/color/SequentialScheme.test.ts similarity index 97% rename from packages/superset-ui-color/test/SequentialScheme.test.ts rename to packages/superset-ui-core/test/color/SequentialScheme.test.ts index 22f9d351c9..4e3b4f4623 100644 --- a/packages/superset-ui-color/test/SequentialScheme.test.ts +++ b/packages/superset-ui-core/test/color/SequentialScheme.test.ts @@ -1,4 +1,4 @@ -import SequentialScheme from '../src/SequentialScheme'; +import SequentialScheme from '@superset-ui/core/src/color/SequentialScheme'; describe('SequentialScheme', () => { const scheme = new SequentialScheme({ diff --git a/packages/superset-ui-color/test/SequentialSchemeRegistrySingleton.test.ts b/packages/superset-ui-core/test/color/SequentialSchemeRegistrySingleton.test.ts similarity index 66% rename from packages/superset-ui-color/test/SequentialSchemeRegistrySingleton.test.ts rename to packages/superset-ui-core/test/color/SequentialSchemeRegistrySingleton.test.ts index af616f46ad..e0c60a71a0 100644 --- a/packages/superset-ui-color/test/SequentialSchemeRegistrySingleton.test.ts +++ b/packages/superset-ui-core/test/color/SequentialSchemeRegistrySingleton.test.ts @@ -1,4 +1,4 @@ -import { SequentialScheme, getSequentialSchemeRegistry } from '../src'; +import { SequentialScheme, getSequentialSchemeRegistry } from '@superset-ui/core/src/color'; describe('SequentialSchemeRegistry', () => { it('has default value out-of-the-box', () => { diff --git a/packages/superset-ui-core/test/color/colorSchemes.test.ts b/packages/superset-ui-core/test/color/colorSchemes.test.ts new file mode 100644 index 0000000000..bb5ece94da --- /dev/null +++ b/packages/superset-ui-core/test/color/colorSchemes.test.ts @@ -0,0 +1,36 @@ +import categoricalAirbnb from '@superset-ui/core/src/color/colorSchemes/categorical/airbnb'; +import categoricalSuperset from '@superset-ui/core/src/color/colorSchemes/categorical/superset'; +import categoricalPreset from '@superset-ui/core/src/color/colorSchemes/categorical/preset'; +import categoricalD3 from '@superset-ui/core/src/color/colorSchemes/categorical/d3'; +import categoricalGoogle from '@superset-ui/core/src/color/colorSchemes/categorical/google'; +import categoricalLyft from '@superset-ui/core/src/color/colorSchemes/categorical/lyft'; +import sequentialCommon from '@superset-ui/core/src/color/colorSchemes/sequential/common'; +import sequentialD3 from '@superset-ui/core/src/color/colorSchemes/sequential/d3'; +import CategoricalScheme from '@superset-ui/core/src/color/CategoricalScheme'; +import SequentialScheme from '@superset-ui/core/src/color/SequentialScheme'; + +describe('Color Schemes', () => { + describe('categorical', () => { + it('returns an array of CategoricalScheme', () => { + [ + categoricalAirbnb, + categoricalD3, + categoricalGoogle, + categoricalLyft, + categoricalSuperset, + categoricalPreset, + ].forEach(group => { + expect(group).toBeInstanceOf(Array); + group.forEach(scheme => expect(scheme).toBeInstanceOf(CategoricalScheme)); + }); + }); + }); + describe('sequential', () => { + it('returns an array of SequentialScheme', () => { + [sequentialCommon, sequentialD3].forEach(group => { + expect(group).toBeInstanceOf(Array); + group.forEach(scheme => expect(scheme).toBeInstanceOf(SequentialScheme)); + }); + }); + }); +}); diff --git a/packages/superset-ui-color/test/index.test.ts b/packages/superset-ui-core/test/color/index.test.ts similarity index 92% rename from packages/superset-ui-color/test/index.test.ts rename to packages/superset-ui-core/test/color/index.test.ts index 4e161c3710..8da4b476b1 100644 --- a/packages/superset-ui-color/test/index.test.ts +++ b/packages/superset-ui-core/test/color/index.test.ts @@ -6,7 +6,7 @@ import { getCategoricalSchemeRegistry, getSequentialSchemeRegistry, SequentialScheme, -} from '../src'; +} from '@superset-ui/core/src/color'; describe('index', () => { it('exports modules', () => { diff --git a/packages/superset-ui-connection/test/SupersetClient.test.ts b/packages/superset-ui-core/test/connection/SupersetClient.test.ts similarity index 98% rename from packages/superset-ui-connection/test/SupersetClient.test.ts rename to packages/superset-ui-core/test/connection/SupersetClient.test.ts index 6d49295767..95f5c5844d 100644 --- a/packages/superset-ui-connection/test/SupersetClient.test.ts +++ b/packages/superset-ui-core/test/connection/SupersetClient.test.ts @@ -18,7 +18,7 @@ */ import fetchMock from 'fetch-mock'; -import { SupersetClient, SupersetClientClass } from '../src'; +import { SupersetClient, SupersetClientClass } from '@superset-ui/core/src/connection'; import { LOGIN_GLOB } from './fixtures/constants'; describe('SupersetClient', () => { diff --git a/packages/superset-ui-connection/test/SupersetClientClass.test.ts b/packages/superset-ui-core/test/connection/SupersetClientClass.test.ts similarity index 99% rename from packages/superset-ui-connection/test/SupersetClientClass.test.ts rename to packages/superset-ui-core/test/connection/SupersetClientClass.test.ts index 67100e7114..96d0c824ea 100644 --- a/packages/superset-ui-connection/test/SupersetClientClass.test.ts +++ b/packages/superset-ui-core/test/connection/SupersetClientClass.test.ts @@ -17,7 +17,7 @@ * under the License. */ import fetchMock from 'fetch-mock'; -import { SupersetClientClass, ClientConfig } from '../src'; +import { SupersetClientClass, ClientConfig } from '@superset-ui/core/src/connection'; import { LOGIN_GLOB } from './fixtures/constants'; describe('SupersetClientClass', () => { diff --git a/packages/superset-ui-connection/test/callApi/callApi.test.ts b/packages/superset-ui-core/test/connection/callApi/callApi.test.ts similarity index 98% rename from packages/superset-ui-connection/test/callApi/callApi.test.ts rename to packages/superset-ui-core/test/connection/callApi/callApi.test.ts index 84dd94ce74..f5ee5eb263 100644 --- a/packages/superset-ui-connection/test/callApi/callApi.test.ts +++ b/packages/superset-ui-core/test/connection/callApi/callApi.test.ts @@ -17,12 +17,12 @@ * under the License. */ import fetchMock from 'fetch-mock'; -import callApi from '../../src/callApi/callApi'; -import * as constants from '../../src/constants'; +import callApi from '@superset-ui/core/src/connection/callApi/callApi'; +import * as constants from '@superset-ui/core/src/connection/constants'; +import { CallApi, JsonObject } from '@superset-ui/core/src/connection/types'; +import { DEFAULT_FETCH_RETRY_OPTIONS } from '@superset-ui/core/src/connection/constants'; import { LOGIN_GLOB } from '../fixtures/constants'; -import { CallApi, JsonObject } from '../../src/types'; -import { DEFAULT_FETCH_RETRY_OPTIONS } from '../../src/constants'; describe('callApi()', () => { beforeAll(() => { diff --git a/packages/superset-ui-connection/test/callApi/callApiAndParseWithTimeout.test.ts b/packages/superset-ui-core/test/connection/callApi/callApiAndParseWithTimeout.test.ts similarity index 90% rename from packages/superset-ui-connection/test/callApi/callApiAndParseWithTimeout.test.ts rename to packages/superset-ui-core/test/connection/callApi/callApiAndParseWithTimeout.test.ts index 2f55ad2dbd..e4c1cbd3c9 100644 --- a/packages/superset-ui-connection/test/callApi/callApiAndParseWithTimeout.test.ts +++ b/packages/superset-ui-core/test/connection/callApi/callApiAndParseWithTimeout.test.ts @@ -18,12 +18,12 @@ */ import fetchMock from 'fetch-mock'; -import callApiAndParseWithTimeout from '../../src/callApi/callApiAndParseWithTimeout'; +import callApiAndParseWithTimeout from '@superset-ui/core/src/connection/callApi/callApiAndParseWithTimeout'; // we import these via * so that we can spy on the 'default' property of the object -import * as callApi from '../../src/callApi/callApi'; -import * as parseResponse from '../../src/callApi/parseResponse'; -import * as rejectAfterTimeout from '../../src/callApi/rejectAfterTimeout'; +import * as callApi from '@superset-ui/core/src/connection/callApi/callApi'; +import * as parseResponse from '@superset-ui/core/src/connection/callApi/parseResponse'; +import * as rejectAfterTimeout from '@superset-ui/core/src/connection/callApi/rejectAfterTimeout'; import { LOGIN_GLOB } from '../fixtures/constants'; diff --git a/packages/superset-ui-connection/test/callApi/parseResponse.test.ts b/packages/superset-ui-core/test/connection/callApi/parseResponse.test.ts similarity index 96% rename from packages/superset-ui-connection/test/callApi/parseResponse.test.ts rename to packages/superset-ui-core/test/connection/callApi/parseResponse.test.ts index b0a568c9ee..4cd223a2e2 100644 --- a/packages/superset-ui-connection/test/callApi/parseResponse.test.ts +++ b/packages/superset-ui-core/test/connection/callApi/parseResponse.test.ts @@ -17,8 +17,8 @@ * under the License. */ import fetchMock from 'fetch-mock'; -import callApi from '../../src/callApi/callApi'; -import parseResponse from '../../src/callApi/parseResponse'; +import callApi from '@superset-ui/core/src/connection/callApi/callApi'; +import parseResponse from '@superset-ui/core/src/connection/callApi/parseResponse'; import { LOGIN_GLOB } from '../fixtures/constants'; diff --git a/packages/superset-ui-connection/test/callApi/rejectAfterTimeout.test.ts b/packages/superset-ui-core/test/connection/callApi/rejectAfterTimeout.test.ts similarity index 92% rename from packages/superset-ui-connection/test/callApi/rejectAfterTimeout.test.ts rename to packages/superset-ui-core/test/connection/callApi/rejectAfterTimeout.test.ts index 9b08430e74..532124f4a7 100644 --- a/packages/superset-ui-connection/test/callApi/rejectAfterTimeout.test.ts +++ b/packages/superset-ui-core/test/connection/callApi/rejectAfterTimeout.test.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import rejectAfterTimeout from '../../src/callApi/rejectAfterTimeout'; +import rejectAfterTimeout from '@superset-ui/core/src/connection/callApi/rejectAfterTimeout'; describe('rejectAfterTimeout()', () => { it('returns a promise that rejects after the specified timeout', async () => { diff --git a/packages/superset-ui-connection/test/fixtures/constants.ts b/packages/superset-ui-core/test/connection/fixtures/constants.ts similarity index 100% rename from packages/superset-ui-connection/test/fixtures/constants.ts rename to packages/superset-ui-core/test/connection/fixtures/constants.ts diff --git a/packages/superset-ui-dimension/test/computeMaxFontSize.test.ts b/packages/superset-ui-core/test/dimension/computeMaxFontSize.test.ts similarity index 90% rename from packages/superset-ui-dimension/test/computeMaxFontSize.test.ts rename to packages/superset-ui-core/test/dimension/computeMaxFontSize.test.ts index bdb99fa8f7..29856b360a 100644 --- a/packages/superset-ui-dimension/test/computeMaxFontSize.test.ts +++ b/packages/superset-ui-core/test/dimension/computeMaxFontSize.test.ts @@ -1,4 +1,4 @@ -import { computeMaxFontSize } from '../src'; +import { computeMaxFontSize } from '@superset-ui/core/src'; import { addDummyFill, removeDummyFill, SAMPLE_TEXT } from './getBBoxDummyFill'; describe('computeMaxFontSize(input)', () => { @@ -7,11 +7,11 @@ describe('computeMaxFontSize(input)', () => { afterEach(removeDummyFill); it('requires either idealFontSize or maxHeight', () => { - expect(() => + expect(() => { computeMaxFontSize({ text: SAMPLE_TEXT[0], - }), - ).toThrow(); + }); + }).toThrow(); }); it('computes maximum font size for given maxWidth and maxHeight', () => { expect( diff --git a/packages/superset-ui-dimension/test/getBBoxDummyFill.ts b/packages/superset-ui-core/test/dimension/getBBoxDummyFill.ts similarity index 100% rename from packages/superset-ui-dimension/test/getBBoxDummyFill.ts rename to packages/superset-ui-core/test/dimension/getBBoxDummyFill.ts diff --git a/packages/superset-ui-dimension/test/getMultipleTextDimensions.test.ts b/packages/superset-ui-core/test/dimension/getMultipleTextDimensions.test.ts similarity index 97% rename from packages/superset-ui-dimension/test/getMultipleTextDimensions.test.ts rename to packages/superset-ui-core/test/dimension/getMultipleTextDimensions.test.ts index 522f1a2cfd..93166f54db 100644 --- a/packages/superset-ui-dimension/test/getMultipleTextDimensions.test.ts +++ b/packages/superset-ui-core/test/dimension/getMultipleTextDimensions.test.ts @@ -1,5 +1,4 @@ -import { promiseTimeout } from '@superset-ui/core'; -import { getMultipleTextDimensions } from '../src'; +import { getMultipleTextDimensions, promiseTimeout } from '@superset-ui/core/src'; import { addDummyFill, removeDummyFill, SAMPLE_TEXT } from './getBBoxDummyFill'; describe('getMultipleTextDimension(input)', () => { diff --git a/packages/superset-ui-dimension/test/getTextDimension.test.ts b/packages/superset-ui-core/test/dimension/getTextDimension.test.ts similarity index 97% rename from packages/superset-ui-dimension/test/getTextDimension.test.ts rename to packages/superset-ui-core/test/dimension/getTextDimension.test.ts index 2a96b5bdfb..01b4ac870a 100644 --- a/packages/superset-ui-dimension/test/getTextDimension.test.ts +++ b/packages/superset-ui-core/test/dimension/getTextDimension.test.ts @@ -1,5 +1,4 @@ -import { promiseTimeout } from '@superset-ui/core'; -import { getTextDimension } from '../src'; +import { promiseTimeout, getTextDimension } from '@superset-ui/core/src'; import { addDummyFill, removeDummyFill, SAMPLE_TEXT } from './getBBoxDummyFill'; describe('getTextDimension(input)', () => { diff --git a/packages/superset-ui-dimension/test/mergeMargin.test.ts b/packages/superset-ui-core/test/dimension/mergeMargin.test.ts similarity index 98% rename from packages/superset-ui-dimension/test/mergeMargin.test.ts rename to packages/superset-ui-core/test/dimension/mergeMargin.test.ts index 3aa7a59a70..2739c4c468 100644 --- a/packages/superset-ui-dimension/test/mergeMargin.test.ts +++ b/packages/superset-ui-core/test/dimension/mergeMargin.test.ts @@ -1,4 +1,4 @@ -import { mergeMargin } from '../src'; +import { mergeMargin } from '@superset-ui/core/src'; describe('mergeMargin(margin1, margin2, mode?)', () => { it('combines two given margin', () => { diff --git a/packages/superset-ui-dimension/test/parseLength.test.ts b/packages/superset-ui-core/test/dimension/parseLength.test.ts similarity index 95% rename from packages/superset-ui-dimension/test/parseLength.test.ts rename to packages/superset-ui-core/test/dimension/parseLength.test.ts index e4f13d7140..da295db629 100644 --- a/packages/superset-ui-dimension/test/parseLength.test.ts +++ b/packages/superset-ui-core/test/dimension/parseLength.test.ts @@ -1,4 +1,4 @@ -import parseLength from '../src/parseLength'; +import { parseLength } from '@superset-ui/core/src'; describe('parseLength(input)', () => { it('handles string "auto"', () => { diff --git a/packages/superset-ui-dimension/test/svg/LazyFactory.test.ts b/packages/superset-ui-core/test/dimension/svg/LazyFactory.test.ts similarity index 96% rename from packages/superset-ui-dimension/test/svg/LazyFactory.test.ts rename to packages/superset-ui-core/test/dimension/svg/LazyFactory.test.ts index c26df95857..93edff5539 100644 --- a/packages/superset-ui-dimension/test/svg/LazyFactory.test.ts +++ b/packages/superset-ui-core/test/dimension/svg/LazyFactory.test.ts @@ -1,4 +1,4 @@ -import LazyFactory from '../../src/svg/LazyFactory'; +import LazyFactory from '@superset-ui/core/src/dimension/svg/LazyFactory'; describe('LazyFactory', () => { describe('createInContainer()', () => { diff --git a/packages/superset-ui-dimension/test/svg/getBBoxCeil.test.ts b/packages/superset-ui-core/test/dimension/svg/getBBoxCeil.test.ts similarity index 86% rename from packages/superset-ui-dimension/test/svg/getBBoxCeil.test.ts rename to packages/superset-ui-core/test/dimension/svg/getBBoxCeil.test.ts index 397c867ded..a5d3cfc07c 100644 --- a/packages/superset-ui-dimension/test/svg/getBBoxCeil.test.ts +++ b/packages/superset-ui-core/test/dimension/svg/getBBoxCeil.test.ts @@ -1,5 +1,5 @@ -import getBBoxCeil from '../../src/svg/getBBoxCeil'; -import createTextNode from '../../src/svg/createTextNode'; +import getBBoxCeil from '@superset-ui/core/src/dimension/svg/getBBoxCeil'; +import createTextNode from '@superset-ui/core/src/dimension/svg/createTextNode'; describe('getBBoxCeil(node, defaultDimension)', () => { describe('returns default dimension if getBBox() is not available', () => { diff --git a/packages/superset-ui-dimension/test/svg/updateTextNode.test.ts b/packages/superset-ui-core/test/dimension/svg/updateTextNode.test.ts similarity index 94% rename from packages/superset-ui-dimension/test/svg/updateTextNode.test.ts rename to packages/superset-ui-core/test/dimension/svg/updateTextNode.test.ts index 8d4dd47e11..08859eb6eb 100644 --- a/packages/superset-ui-dimension/test/svg/updateTextNode.test.ts +++ b/packages/superset-ui-core/test/dimension/svg/updateTextNode.test.ts @@ -1,5 +1,5 @@ -import updateTextNode from '../../src/svg/updateTextNode'; -import createTextNode from '../../src/svg/createTextNode'; +import updateTextNode from '@superset-ui/core/src/dimension/svg/updateTextNode'; +import createTextNode from '@superset-ui/core/src/dimension/svg/createTextNode'; describe('updateTextNode(node, options)', () => { it('handles empty options', () => { diff --git a/packages/superset-ui-core/test/index.test.ts b/packages/superset-ui-core/test/index.test.ts index f6e838a760..36424c9487 100644 --- a/packages/superset-ui-core/test/index.test.ts +++ b/packages/superset-ui-core/test/index.test.ts @@ -8,7 +8,7 @@ import { isDefined, isRequired, makeSingleton, -} from '../src'; +} from '@superset-ui/core/src'; describe('index', () => { it('exports modules', () => { diff --git a/packages/superset-ui-core/test/models/ExtensibleFunction.test.ts b/packages/superset-ui-core/test/models/ExtensibleFunction.test.ts index c2c28fdda1..b3c59de491 100644 --- a/packages/superset-ui-core/test/models/ExtensibleFunction.test.ts +++ b/packages/superset-ui-core/test/models/ExtensibleFunction.test.ts @@ -1,4 +1,4 @@ -import { ExtensibleFunction } from '../../src'; +import { ExtensibleFunction } from '@superset-ui/core/src'; describe('ExtensibleFunction', () => { interface Func1 { diff --git a/packages/superset-ui-core/test/models/Plugin.test.ts b/packages/superset-ui-core/test/models/Plugin.test.ts index 846168e7f3..97f16ea55a 100644 --- a/packages/superset-ui-core/test/models/Plugin.test.ts +++ b/packages/superset-ui-core/test/models/Plugin.test.ts @@ -1,4 +1,4 @@ -import { Plugin } from '../../src'; +import { Plugin } from '@superset-ui/core/src'; describe('Plugin', () => { it('exists', () => { diff --git a/packages/superset-ui-core/test/models/Preset.test.ts b/packages/superset-ui-core/test/models/Preset.test.ts index 2732262380..8f7a016e92 100644 --- a/packages/superset-ui-core/test/models/Preset.test.ts +++ b/packages/superset-ui-core/test/models/Preset.test.ts @@ -1,4 +1,4 @@ -import { Plugin, Preset } from '../../src'; +import { Plugin, Preset } from '@superset-ui/core/src'; describe('Preset', () => { it('exists', () => { diff --git a/packages/superset-ui-core/test/models/Registry.test.ts b/packages/superset-ui-core/test/models/Registry.test.ts index cfe1bbd3a9..e4a7cec5a8 100644 --- a/packages/superset-ui-core/test/models/Registry.test.ts +++ b/packages/superset-ui-core/test/models/Registry.test.ts @@ -1,6 +1,6 @@ /* eslint no-console: 0 */ import mockConsole from 'jest-mock-console'; -import { Registry, OverwritePolicy } from '../../src'; +import { Registry, OverwritePolicy } from '@superset-ui/core/src'; const loader = () => 'testValue'; diff --git a/packages/superset-ui-core/test/models/RegistryWithDefaultKey.test.ts b/packages/superset-ui-core/test/models/RegistryWithDefaultKey.test.ts index 8b16a4ce93..ecabbe8c3a 100644 --- a/packages/superset-ui-core/test/models/RegistryWithDefaultKey.test.ts +++ b/packages/superset-ui-core/test/models/RegistryWithDefaultKey.test.ts @@ -1,4 +1,4 @@ -import { Registry, RegistryWithDefaultKey } from '../../src'; +import { Registry, RegistryWithDefaultKey } from '@superset-ui/core/src'; describe('RegistryWithDefaultKey', () => { let registry: RegistryWithDefaultKey; diff --git a/packages/superset-ui-number-format/test/NumberFormatter.test.ts b/packages/superset-ui-core/test/number-format/NumberFormatter.test.ts similarity index 96% rename from packages/superset-ui-number-format/test/NumberFormatter.test.ts rename to packages/superset-ui-core/test/number-format/NumberFormatter.test.ts index c60436eb65..87b73fe713 100644 --- a/packages/superset-ui-number-format/test/NumberFormatter.test.ts +++ b/packages/superset-ui-core/test/number-format/NumberFormatter.test.ts @@ -1,4 +1,4 @@ -import NumberFormatter from '../src/NumberFormatter'; +import { NumberFormatter } from '@superset-ui/core/src/number-format'; describe('NumberFormatter', () => { describe('new NumberFormatter(config)', () => { diff --git a/packages/superset-ui-number-format/test/NumberFormatterRegistry.test.ts b/packages/superset-ui-core/test/number-format/NumberFormatterRegistry.test.ts similarity index 94% rename from packages/superset-ui-number-format/test/NumberFormatterRegistry.test.ts rename to packages/superset-ui-core/test/number-format/NumberFormatterRegistry.test.ts index 4787d05c4d..60d1397a50 100644 --- a/packages/superset-ui-number-format/test/NumberFormatterRegistry.test.ts +++ b/packages/superset-ui-core/test/number-format/NumberFormatterRegistry.test.ts @@ -1,6 +1,4 @@ -import NumberFormatterRegistry from '../src/NumberFormatterRegistry'; -import NumberFormatter from '../src/NumberFormatter'; -import { NumberFormats } from '../src'; +import { NumberFormats, NumberFormatter, NumberFormatterRegistry } from '@superset-ui/core/src'; describe('NumberFormatterRegistry', () => { let registry: NumberFormatterRegistry; diff --git a/packages/superset-ui-number-format/test/NumberFormatterRegistrySingleton.test.ts b/packages/superset-ui-core/test/number-format/NumberFormatterRegistrySingleton.test.ts similarity index 88% rename from packages/superset-ui-number-format/test/NumberFormatterRegistrySingleton.test.ts rename to packages/superset-ui-core/test/number-format/NumberFormatterRegistrySingleton.test.ts index 0f8a482848..ee0dd7d40f 100644 --- a/packages/superset-ui-number-format/test/NumberFormatterRegistrySingleton.test.ts +++ b/packages/superset-ui-core/test/number-format/NumberFormatterRegistrySingleton.test.ts @@ -1,8 +1,9 @@ -import getNumberFormatterRegistry, { +import { + NumberFormatterRegistry, + getNumberFormatterRegistry, getNumberFormatter, formatNumber, -} from '../src/NumberFormatterRegistrySingleton'; -import NumberFormatterRegistry from '../src/NumberFormatterRegistry'; +} from '@superset-ui/core/src'; describe('NumberFormatterRegistrySingleton', () => { describe('getNumberFormatterRegistry()', () => { diff --git a/packages/superset-ui-number-format/test/factories/createD3NumberFormatter.test.ts b/packages/superset-ui-core/test/number-format/factories/createD3NumberFormatter.test.ts similarity index 96% rename from packages/superset-ui-number-format/test/factories/createD3NumberFormatter.test.ts rename to packages/superset-ui-core/test/number-format/factories/createD3NumberFormatter.test.ts index 703eeaf94c..25f22f2d02 100644 --- a/packages/superset-ui-number-format/test/factories/createD3NumberFormatter.test.ts +++ b/packages/superset-ui-core/test/number-format/factories/createD3NumberFormatter.test.ts @@ -1,4 +1,4 @@ -import createD3NumberFormatter from '../../src/factories/createD3NumberFormatter'; +import { createD3NumberFormatter } from '@superset-ui/core/src/number-format'; describe('createD3NumberFormatter(config)', () => { it('requires config.formatString', () => { diff --git a/packages/superset-ui-number-format/test/factories/createDurationFormatter.test.ts b/packages/superset-ui-core/test/number-format/factories/createDurationFormatter.test.ts similarity index 91% rename from packages/superset-ui-number-format/test/factories/createDurationFormatter.test.ts rename to packages/superset-ui-core/test/number-format/factories/createDurationFormatter.test.ts index 1a54731e13..6fd8aad7b8 100644 --- a/packages/superset-ui-number-format/test/factories/createDurationFormatter.test.ts +++ b/packages/superset-ui-core/test/number-format/factories/createDurationFormatter.test.ts @@ -1,5 +1,4 @@ -import NumberFormatter from '../../src/NumberFormatter'; -import createDurationFormatter from '../../src/factories/createDurationFormatter'; +import { NumberFormatter, createDurationFormatter } from '@superset-ui/core/src/number-format'; describe('createDurationFormatter()', () => { it('creates an instance of NumberFormatter', () => { diff --git a/packages/superset-ui-number-format/test/factories/createSiAtMostNDigitFormatter.test.ts b/packages/superset-ui-core/test/number-format/factories/createSiAtMostNDigitFormatter.test.ts similarity index 92% rename from packages/superset-ui-number-format/test/factories/createSiAtMostNDigitFormatter.test.ts rename to packages/superset-ui-core/test/number-format/factories/createSiAtMostNDigitFormatter.test.ts index 62a34236a4..2969786ec0 100644 --- a/packages/superset-ui-number-format/test/factories/createSiAtMostNDigitFormatter.test.ts +++ b/packages/superset-ui-core/test/number-format/factories/createSiAtMostNDigitFormatter.test.ts @@ -1,5 +1,7 @@ -import NumberFormatter from '../../src/NumberFormatter'; -import createSiAtMostNDigitFormatter from '../../src/factories/createSiAtMostNDigitFormatter'; +import { + NumberFormatter, + createSiAtMostNDigitFormatter, +} from '@superset-ui/core/src/number-format'; describe('createSiAtMostNDigitFormatter({ n })', () => { it('creates an instance of NumberFormatter', () => { diff --git a/packages/superset-ui-number-format/test/factories/createSmartNumberFormatter.test.ts b/packages/superset-ui-core/test/number-format/factories/createSmartNumberFormatter.test.ts similarity index 97% rename from packages/superset-ui-number-format/test/factories/createSmartNumberFormatter.test.ts rename to packages/superset-ui-core/test/number-format/factories/createSmartNumberFormatter.test.ts index ffd823d532..8656d446d5 100644 --- a/packages/superset-ui-number-format/test/factories/createSmartNumberFormatter.test.ts +++ b/packages/superset-ui-core/test/number-format/factories/createSmartNumberFormatter.test.ts @@ -1,5 +1,4 @@ -import NumberFormatter from '../../src/NumberFormatter'; -import createSmartNumberFormatter from '../../src/factories/createSmartNumberFormatter'; +import { NumberFormatter, createSmartNumberFormatter } from '@superset-ui/core/src'; describe('createSmartNumberFormatter(options)', () => { it('creates an instance of NumberFormatter', () => { diff --git a/packages/superset-ui-number-format/test/index.test.ts b/packages/superset-ui-core/test/number-format/index.test.ts similarity index 94% rename from packages/superset-ui-number-format/test/index.test.ts rename to packages/superset-ui-core/test/number-format/index.test.ts index 6c09e64824..43efa07933 100644 --- a/packages/superset-ui-number-format/test/index.test.ts +++ b/packages/superset-ui-core/test/number-format/index.test.ts @@ -8,7 +8,7 @@ import { NumberFormats, NumberFormatter, PREVIEW_VALUE, -} from '../src'; +} from '@superset-ui/core/src'; describe('index', () => { it('exports modules', () => { diff --git a/packages/superset-ui-query/test/DatasourceKey.test.ts b/packages/superset-ui-core/test/query/DatasourceKey.test.ts similarity index 90% rename from packages/superset-ui-query/test/DatasourceKey.test.ts rename to packages/superset-ui-core/test/query/DatasourceKey.test.ts index fea3a34b8c..70beafb2c0 100644 --- a/packages/superset-ui-query/test/DatasourceKey.test.ts +++ b/packages/superset-ui-core/test/query/DatasourceKey.test.ts @@ -1,4 +1,4 @@ -import { DatasourceKey } from '../src'; +import { DatasourceKey } from '@superset-ui/core/src/query'; describe('DatasourceKey', () => { const tableKey = '5__table'; diff --git a/packages/superset-ui-query/test/api/legacy/fetchExploreJson.test.ts b/packages/superset-ui-core/test/query/api/legacy/fetchExploreJson.test.ts similarity index 96% rename from packages/superset-ui-query/test/api/legacy/fetchExploreJson.test.ts rename to packages/superset-ui-core/test/query/api/legacy/fetchExploreJson.test.ts index 972b0b85d9..9c69095c6f 100644 --- a/packages/superset-ui-query/test/api/legacy/fetchExploreJson.test.ts +++ b/packages/superset-ui-core/test/query/api/legacy/fetchExploreJson.test.ts @@ -17,7 +17,7 @@ * under the License. */ import fetchMock from 'fetch-mock'; -import { fetchExploreJson } from '../../../src/api/legacy'; +import { fetchExploreJson } from '@superset-ui/core/src/query/api/legacy'; import setupClientForTest from '../setupClientForTest'; describe('fetchExploreJson()', () => { diff --git a/packages/superset-ui-query/test/api/legacy/getDatasourceMetadata.test.ts b/packages/superset-ui-core/test/query/api/legacy/getDatasourceMetadata.test.ts similarity index 94% rename from packages/superset-ui-query/test/api/legacy/getDatasourceMetadata.test.ts rename to packages/superset-ui-core/test/query/api/legacy/getDatasourceMetadata.test.ts index 625efe7a2d..8e4cbd9cab 100644 --- a/packages/superset-ui-query/test/api/legacy/getDatasourceMetadata.test.ts +++ b/packages/superset-ui-core/test/query/api/legacy/getDatasourceMetadata.test.ts @@ -17,8 +17,9 @@ * under the License. */ import fetchMock from 'fetch-mock'; +import { getDatasourceMetadata } from '@superset-ui/core/src/query/api/legacy'; + import setupClientForTest from '../setupClientForTest'; -import { getDatasourceMetadata } from '../../../src/api/legacy'; describe('getFormData()', () => { beforeAll(setupClientForTest); diff --git a/packages/superset-ui-query/test/api/legacy/getFormData.test.ts b/packages/superset-ui-core/test/query/api/legacy/getFormData.test.ts similarity index 96% rename from packages/superset-ui-query/test/api/legacy/getFormData.test.ts rename to packages/superset-ui-core/test/query/api/legacy/getFormData.test.ts index 2926e0641c..089a14b37d 100644 --- a/packages/superset-ui-query/test/api/legacy/getFormData.test.ts +++ b/packages/superset-ui-core/test/query/api/legacy/getFormData.test.ts @@ -17,8 +17,9 @@ * under the License. */ import fetchMock from 'fetch-mock'; +import { getFormData } from '@superset-ui/core/src/query/api/legacy'; + import setupClientForTest from '../setupClientForTest'; -import { getFormData } from '../../../src/api/legacy'; describe('getFormData()', () => { beforeAll(setupClientForTest); diff --git a/packages/superset-ui-query/test/api/setupClientForTest.ts b/packages/superset-ui-core/test/query/api/setupClientForTest.ts similarity index 94% rename from packages/superset-ui-query/test/api/setupClientForTest.ts rename to packages/superset-ui-core/test/query/api/setupClientForTest.ts index 295178271e..651e57cb97 100644 --- a/packages/superset-ui-query/test/api/setupClientForTest.ts +++ b/packages/superset-ui-core/test/query/api/setupClientForTest.ts @@ -17,7 +17,7 @@ * under the License. */ import fetchMock from 'fetch-mock'; -import { SupersetClient } from '@superset-ui/connection'; +import { SupersetClient } from '@superset-ui/core/src/connection'; const LOGIN_GLOB = 'glob:*superset/csrf_token/*'; diff --git a/packages/superset-ui-query/test/api/v1/getChartData.test.ts b/packages/superset-ui-core/test/query/api/v1/getChartData.test.ts similarity index 95% rename from packages/superset-ui-query/test/api/v1/getChartData.test.ts rename to packages/superset-ui-core/test/query/api/v1/getChartData.test.ts index 3e887e13e4..16af3daf4d 100644 --- a/packages/superset-ui-query/test/api/v1/getChartData.test.ts +++ b/packages/superset-ui-core/test/query/api/v1/getChartData.test.ts @@ -17,7 +17,7 @@ * under the License. */ import fetchMock from 'fetch-mock'; -import { buildQueryContext, ApiV1 } from '../../../src'; +import { buildQueryContext, ApiV1 } from '@superset-ui/core/src/query'; import setupClientForTest from '../setupClientForTest'; describe('API v1 > getChartData()', () => { diff --git a/packages/superset-ui-query/test/api/v1/handleError.test.ts b/packages/superset-ui-core/test/query/api/v1/handleError.test.ts similarity index 95% rename from packages/superset-ui-query/test/api/v1/handleError.test.ts rename to packages/superset-ui-core/test/query/api/v1/handleError.test.ts index e8219f2282..69b868c756 100644 --- a/packages/superset-ui-query/test/api/v1/handleError.test.ts +++ b/packages/superset-ui-core/test/query/api/v1/handleError.test.ts @@ -17,9 +17,9 @@ * under the License. */ import 'whatwg-fetch'; // for adding Response polyfill -import { JsonObject } from '@superset-ui/connection'; -import handleError, { ErrorInput } from '../../../src/api/v1/handleError'; -import { SupersetApiError, SupersetApiErrorType } from '../../../src/api/v1/types'; +import { JsonObject } from '@superset-ui/core/src/connection'; +import handleError, { ErrorInput } from '@superset-ui/core/src/query/api/v1/handleError'; +import { SupersetApiError, SupersetApiErrorType } from '@superset-ui/core/src/query/api/v1/types'; async function testHandleError( inputError: ErrorInput, diff --git a/packages/superset-ui-query/test/api/v1/makeApi.test.ts b/packages/superset-ui-core/test/query/api/v1/makeApi.test.ts similarity index 97% rename from packages/superset-ui-query/test/api/v1/makeApi.test.ts rename to packages/superset-ui-core/test/query/api/v1/makeApi.test.ts index 92221c6a8f..3d968b80c8 100644 --- a/packages/superset-ui-query/test/api/v1/makeApi.test.ts +++ b/packages/superset-ui-core/test/query/api/v1/makeApi.test.ts @@ -17,8 +17,8 @@ * under the License. */ import fetchMock from 'fetch-mock'; -import { JsonValue, SupersetClientClass } from '@superset-ui/connection'; -import { makeApi, SupersetApiError } from '../../../src'; +import { JsonValue, SupersetClientClass } from '@superset-ui/core/src/connection'; +import { makeApi, SupersetApiError } from '@superset-ui/core/src/query'; import setupClientForTest from '../setupClientForTest'; describe('makeApi()', () => { diff --git a/packages/superset-ui-query/test/buildQueryContext.test.ts b/packages/superset-ui-core/test/query/buildQueryContext.test.ts similarity index 93% rename from packages/superset-ui-query/test/buildQueryContext.test.ts rename to packages/superset-ui-core/test/query/buildQueryContext.test.ts index de00f5c9f7..56436c537d 100644 --- a/packages/superset-ui-query/test/buildQueryContext.test.ts +++ b/packages/superset-ui-core/test/query/buildQueryContext.test.ts @@ -1,4 +1,4 @@ -import { buildQueryContext } from '../src'; +import { buildQueryContext } from '@superset-ui/core/src/query'; describe('buildQueryContext', () => { it('should build datasource for table sources and apply defaults', () => { diff --git a/packages/superset-ui-query/test/buildQueryObject.test.ts b/packages/superset-ui-core/test/query/buildQueryObject.test.ts similarity index 97% rename from packages/superset-ui-query/test/buildQueryObject.test.ts rename to packages/superset-ui-core/test/query/buildQueryObject.test.ts index 4a4ae9bb0f..86c3014a1f 100644 --- a/packages/superset-ui-query/test/buildQueryObject.test.ts +++ b/packages/superset-ui-core/test/query/buildQueryObject.test.ts @@ -1,4 +1,4 @@ -import { buildQueryObject, QueryObject } from '../src'; +import { buildQueryObject, QueryObject } from '@superset-ui/core/src/query'; describe('buildQueryObject', () => { let query: QueryObject; diff --git a/packages/superset-ui-query/test/convertFilter.test.ts b/packages/superset-ui-core/test/query/convertFilter.test.ts similarity index 94% rename from packages/superset-ui-query/test/convertFilter.test.ts rename to packages/superset-ui-core/test/query/convertFilter.test.ts index 8d0bc92450..db7bf85c07 100644 --- a/packages/superset-ui-query/test/convertFilter.test.ts +++ b/packages/superset-ui-core/test/query/convertFilter.test.ts @@ -1,4 +1,4 @@ -import { convertFilter } from '../src'; +import { convertFilter } from '@superset-ui/core/src/query'; describe('convertFilter', () => { it('should handle unary filter', () => { diff --git a/packages/superset-ui-query/test/convertMetric.test.ts b/packages/superset-ui-core/test/query/convertMetric.test.ts similarity index 94% rename from packages/superset-ui-query/test/convertMetric.test.ts rename to packages/superset-ui-core/test/query/convertMetric.test.ts index 45f07b203f..08cc397a8f 100644 --- a/packages/superset-ui-query/test/convertMetric.test.ts +++ b/packages/superset-ui-core/test/query/convertMetric.test.ts @@ -1,4 +1,4 @@ -import { ColumnType, convertMetric } from '../src'; +import { ColumnType, convertMetric } from '@superset-ui/core/src/query'; describe('convertMetric', () => { it('should handle string metric name', () => { diff --git a/packages/superset-ui-query/test/extractExtras.test.ts b/packages/superset-ui-core/test/query/extractExtras.test.ts similarity index 96% rename from packages/superset-ui-query/test/extractExtras.test.ts rename to packages/superset-ui-core/test/query/extractExtras.test.ts index 3572e154ce..60adbb7bf4 100644 --- a/packages/superset-ui-query/test/extractExtras.test.ts +++ b/packages/superset-ui-core/test/query/extractExtras.test.ts @@ -1,4 +1,4 @@ -import extractExtras from '../src/extractExtras'; +import extractExtras from '@superset-ui/core/src/query/extractExtras'; describe('extractExtras', () => { const baseQueryFormData = { diff --git a/packages/superset-ui-query/test/extractQueryFields.test.ts b/packages/superset-ui-core/test/query/extractQueryFields.test.ts similarity index 95% rename from packages/superset-ui-query/test/extractQueryFields.test.ts rename to packages/superset-ui-core/test/query/extractQueryFields.test.ts index 8500766280..74a3417177 100644 --- a/packages/superset-ui-query/test/extractQueryFields.test.ts +++ b/packages/superset-ui-core/test/query/extractQueryFields.test.ts @@ -1,4 +1,4 @@ -import extractQueryFields from '../src/extractQueryFields'; +import extractQueryFields from '@superset-ui/core/src/query/extractQueryFields'; describe('extractQueryFields', () => { it('should return default object', () => { diff --git a/packages/superset-ui-query/test/processFilters.test.ts b/packages/superset-ui-core/test/query/processFilters.test.ts similarity index 97% rename from packages/superset-ui-query/test/processFilters.test.ts rename to packages/superset-ui-core/test/query/processFilters.test.ts index 3274dff824..05bb46150b 100644 --- a/packages/superset-ui-query/test/processFilters.test.ts +++ b/packages/superset-ui-core/test/query/processFilters.test.ts @@ -1,4 +1,4 @@ -import processFilters from '../src/processFilters'; +import processFilters from '@superset-ui/core/src/query/processFilters'; describe('processFilters', () => { it('should handle non-array adhoc_filters', () => { diff --git a/packages/superset-ui-query/test/processGroupby.test.ts b/packages/superset-ui-core/test/query/processGroupby.test.ts similarity index 81% rename from packages/superset-ui-query/test/processGroupby.test.ts rename to packages/superset-ui-core/test/query/processGroupby.test.ts index cf99b840a9..390f2509fc 100644 --- a/packages/superset-ui-query/test/processGroupby.test.ts +++ b/packages/superset-ui-core/test/query/processGroupby.test.ts @@ -1,4 +1,4 @@ -import processGroupby from '../src/processGroupby'; +import processGroupby from '@superset-ui/core/src/query/processGroupby'; describe('processGroupby', () => { it('should handle array of strings', () => { diff --git a/packages/superset-ui-query/test/types/Filter.test.ts b/packages/superset-ui-core/test/query/types/Filter.test.ts similarity index 93% rename from packages/superset-ui-query/test/types/Filter.test.ts rename to packages/superset-ui-core/test/query/types/Filter.test.ts index de5645050f..ea88512bb0 100644 --- a/packages/superset-ui-query/test/types/Filter.test.ts +++ b/packages/superset-ui-core/test/query/types/Filter.test.ts @@ -1,4 +1,8 @@ -import { isUnaryAdhocFilter, isBinaryAdhocFilter, isSetAdhocFilter } from '../../src/types/Filter'; +import { + isUnaryAdhocFilter, + isBinaryAdhocFilter, + isSetAdhocFilter, +} from '@superset-ui/core/src/query/types/Filter'; describe('Filter type guards', () => { describe('isUnaryAdhocFilter', () => { diff --git a/packages/superset-ui-time-format/test/TimeFormatter.test.ts b/packages/superset-ui-core/test/time-format/TimeFormatter.test.ts similarity index 95% rename from packages/superset-ui-time-format/test/TimeFormatter.test.ts rename to packages/superset-ui-core/test/time-format/TimeFormatter.test.ts index 282578b6a9..3a52925e47 100644 --- a/packages/superset-ui-time-format/test/TimeFormatter.test.ts +++ b/packages/superset-ui-core/test/time-format/TimeFormatter.test.ts @@ -1,4 +1,4 @@ -import TimeFormatter, { PREVIEW_TIME } from '../src/TimeFormatter'; +import TimeFormatter, { PREVIEW_TIME } from '@superset-ui/core/src/time-format/TimeFormatter'; describe('TimeFormatter', () => { describe('new TimeFormatter(config)', () => { diff --git a/packages/superset-ui-time-format/test/TimeFormatterRegistry.test.ts b/packages/superset-ui-core/test/time-format/TimeFormatterRegistry.test.ts similarity index 92% rename from packages/superset-ui-time-format/test/TimeFormatterRegistry.test.ts rename to packages/superset-ui-core/test/time-format/TimeFormatterRegistry.test.ts index de3593a317..a80eaa8779 100644 --- a/packages/superset-ui-time-format/test/TimeFormatterRegistry.test.ts +++ b/packages/superset-ui-core/test/time-format/TimeFormatterRegistry.test.ts @@ -1,5 +1,5 @@ -import TimeFormatterRegistry from '../src/TimeFormatterRegistry'; -import { TimeFormats, TimeFormatter, PREVIEW_TIME } from '../src'; +import TimeFormatterRegistry from '@superset-ui/core/src/time-format/TimeFormatterRegistry'; +import { TimeFormats, TimeFormatter, PREVIEW_TIME } from '@superset-ui/core/src/time-format'; describe('TimeFormatterRegistry', () => { let registry: TimeFormatterRegistry; diff --git a/packages/superset-ui-time-format/test/TimeFormatterRegistrySingleton.test.ts b/packages/superset-ui-core/test/time-format/TimeFormatterRegistrySingleton.test.ts similarity index 94% rename from packages/superset-ui-time-format/test/TimeFormatterRegistrySingleton.test.ts rename to packages/superset-ui-core/test/time-format/TimeFormatterRegistrySingleton.test.ts index 59ccfbafc2..0247252804 100644 --- a/packages/superset-ui-time-format/test/TimeFormatterRegistrySingleton.test.ts +++ b/packages/superset-ui-core/test/time-format/TimeFormatterRegistrySingleton.test.ts @@ -3,10 +3,10 @@ import getTimeFormatterRegistry, { formatTime, getTimeFormatterForGranularity, formatTimeRange, -} from '../src/TimeFormatterRegistrySingleton'; -import TimeFormatterRegistry from '../src/TimeFormatterRegistry'; -import { PREVIEW_TIME } from '../src/TimeFormatter'; -import { TimeGranularity, LOCAL_PREFIX } from '../src'; +} from '@superset-ui/core/src/time-format/TimeFormatterRegistrySingleton'; +import TimeFormatterRegistry from '@superset-ui/core/src/time-format/TimeFormatterRegistry'; +import { PREVIEW_TIME } from '@superset-ui/core/src/time-format/TimeFormatter'; +import { TimeGranularity, LOCAL_PREFIX } from '@superset-ui/core/src/time-format'; describe('TimeFormatterRegistrySingleton', () => { describe('getTimeFormatterRegistry()', () => { diff --git a/packages/superset-ui-time-format/test/factories/createD3TimeFormatter.test.ts b/packages/superset-ui-core/test/time-format/factories/createD3TimeFormatter.test.ts similarity index 92% rename from packages/superset-ui-time-format/test/factories/createD3TimeFormatter.test.ts rename to packages/superset-ui-core/test/time-format/factories/createD3TimeFormatter.test.ts index 99dda2c763..33eb65cefa 100644 --- a/packages/superset-ui-time-format/test/factories/createD3TimeFormatter.test.ts +++ b/packages/superset-ui-core/test/time-format/factories/createD3TimeFormatter.test.ts @@ -1,7 +1,7 @@ import { TimeLocaleDefinition } from 'd3-time-format'; -import createD3TimeFormatter from '../../src/factories/createD3TimeFormatter'; -import { PREVIEW_TIME } from '../../src/TimeFormatter'; -import { TimeFormats } from '../../src'; +import createD3TimeFormatter from '@superset-ui/core/src/time-format/factories/createD3TimeFormatter'; +import { PREVIEW_TIME } from '@superset-ui/core/src/time-format/TimeFormatter'; +import { TimeFormats } from '@superset-ui/core/src/time-format'; const thLocale: TimeLocaleDefinition = { dateTime: '%a %e %b %Y %X', diff --git a/packages/superset-ui-time-format/test/factories/createMultiFormatter.test.ts b/packages/superset-ui-core/test/time-format/factories/createMultiFormatter.test.ts similarity index 91% rename from packages/superset-ui-time-format/test/factories/createMultiFormatter.test.ts rename to packages/superset-ui-core/test/time-format/factories/createMultiFormatter.test.ts index f72b88fbe1..4a4833b58c 100644 --- a/packages/superset-ui-time-format/test/factories/createMultiFormatter.test.ts +++ b/packages/superset-ui-core/test/time-format/factories/createMultiFormatter.test.ts @@ -1,4 +1,4 @@ -import createMultiFormatter from '../../src/factories/createMultiFormatter'; +import createMultiFormatter from '@superset-ui/core/src/time-format/factories/createMultiFormatter'; describe('createMultiFormatter()', () => { describe('creates a multi-step formatter', () => { diff --git a/packages/superset-ui-time-format/test/formatters/smartDate.test.ts b/packages/superset-ui-core/test/time-format/formatters/smartDate.test.ts similarity index 80% rename from packages/superset-ui-time-format/test/formatters/smartDate.test.ts rename to packages/superset-ui-core/test/time-format/formatters/smartDate.test.ts index 020d4bbe3e..983d6182d8 100644 --- a/packages/superset-ui-time-format/test/formatters/smartDate.test.ts +++ b/packages/superset-ui-core/test/time-format/formatters/smartDate.test.ts @@ -1,5 +1,5 @@ -import TimeFormatter from '../../src/TimeFormatter'; -import smartDateFormatter from '../../src/formatters/smartDate'; +import TimeFormatter from '@superset-ui/core/src/time-format/TimeFormatter'; +import smartDateFormatter from '@superset-ui/core/src/time-format/formatters/smartDate'; describe('smartDateFormatter', () => { it('is a function', () => { diff --git a/packages/superset-ui-time-format/test/formatters/smartDateVerbose.test.ts b/packages/superset-ui-core/test/time-format/formatters/smartDateVerbose.test.ts similarity index 77% rename from packages/superset-ui-time-format/test/formatters/smartDateVerbose.test.ts rename to packages/superset-ui-core/test/time-format/formatters/smartDateVerbose.test.ts index 4cdbaae20c..f1f8f27c67 100644 --- a/packages/superset-ui-time-format/test/formatters/smartDateVerbose.test.ts +++ b/packages/superset-ui-core/test/time-format/formatters/smartDateVerbose.test.ts @@ -1,5 +1,5 @@ -import TimeFormatter from '../../src/TimeFormatter'; -import smartDateVerboseFormatter from '../../src/formatters/smartDateVerbose'; +import TimeFormatter from '@superset-ui/core/src/time-format/TimeFormatter'; +import smartDateVerboseFormatter from '@superset-ui/core/src/time-format/formatters/smartDateVerbose'; describe('smartDateVerboseFormatter', () => { const formatter = smartDateVerboseFormatter; diff --git a/packages/superset-ui-time-format/test/index.test.ts b/packages/superset-ui-core/test/time-format/index.test.ts similarity index 93% rename from packages/superset-ui-time-format/test/index.test.ts rename to packages/superset-ui-core/test/time-format/index.test.ts index 75fc6e3904..d1639ab080 100644 --- a/packages/superset-ui-time-format/test/index.test.ts +++ b/packages/superset-ui-core/test/time-format/index.test.ts @@ -10,7 +10,7 @@ import { smartDateVerboseFormatter, TimeFormats, TimeFormatter, -} from '../src'; +} from '@superset-ui/core/src/time-format'; describe('index', () => { it('exports modules', () => { diff --git a/packages/superset-ui-time-format/test/utils/createTime.test.ts b/packages/superset-ui-core/test/time-format/utils/createTime.test.ts similarity index 94% rename from packages/superset-ui-time-format/test/utils/createTime.test.ts rename to packages/superset-ui-core/test/time-format/utils/createTime.test.ts index c861d7eba9..802a8dea35 100644 --- a/packages/superset-ui-time-format/test/utils/createTime.test.ts +++ b/packages/superset-ui-core/test/time-format/utils/createTime.test.ts @@ -1,4 +1,4 @@ -import createTime from '../../src/utils/createTime'; +import createTime from '@superset-ui/core/src/time-format/utils/createTime'; describe('createTime(mode, year, month, date, hours, minutes, seconds, milliseconds)', () => { describe('mode', () => { diff --git a/packages/superset-ui-time-format/test/utils/createTimeRangeFromGranularity.test.ts b/packages/superset-ui-core/test/time-format/utils/createTimeRangeFromGranularity.test.ts similarity index 96% rename from packages/superset-ui-time-format/test/utils/createTimeRangeFromGranularity.test.ts rename to packages/superset-ui-core/test/time-format/utils/createTimeRangeFromGranularity.test.ts index 4a5db79fb7..dc3516c8b6 100644 --- a/packages/superset-ui-time-format/test/utils/createTimeRangeFromGranularity.test.ts +++ b/packages/superset-ui-core/test/time-format/utils/createTimeRangeFromGranularity.test.ts @@ -1,5 +1,9 @@ -import createTimeRangeFromGranularity from '../../src/utils/createTimeRangeFromGranularity'; -import { TimeGranularity, getTimeRangeFormatter, LOCAL_PREFIX } from '../../src'; +import createTimeRangeFromGranularity from '@superset-ui/core/src/time-format/utils/createTimeRangeFromGranularity'; +import { + TimeGranularity, + getTimeRangeFormatter, + LOCAL_PREFIX, +} from '@superset-ui/core/src/time-format'; const formatString = '%Y-%m-%d %H:%M:%S.%L'; const formatUTCTimeRange = getTimeRangeFormatter(formatString); diff --git a/packages/superset-ui-time-format/test/utils/d3Time.test.ts b/packages/superset-ui-core/test/time-format/utils/d3Time.test.ts similarity index 98% rename from packages/superset-ui-time-format/test/utils/d3Time.test.ts rename to packages/superset-ui-core/test/time-format/utils/d3Time.test.ts index 10e1655edb..4f41131736 100644 --- a/packages/superset-ui-time-format/test/utils/d3Time.test.ts +++ b/packages/superset-ui-core/test/time-format/utils/d3Time.test.ts @@ -1,4 +1,4 @@ -import { utcUtils, localTimeUtils } from '../../src/utils/d3Time'; +import { utcUtils, localTimeUtils } from '@superset-ui/core/src/time-format/utils/d3Time'; describe('utils', () => { describe('utcUtils', () => { diff --git a/packages/superset-ui-translation/test/Translator.test.ts b/packages/superset-ui-core/test/translation/Translator.test.ts similarity index 97% rename from packages/superset-ui-translation/test/Translator.test.ts rename to packages/superset-ui-core/test/translation/Translator.test.ts index 616520a6a7..ce58530d34 100644 --- a/packages/superset-ui-translation/test/Translator.test.ts +++ b/packages/superset-ui-core/test/translation/Translator.test.ts @@ -1,4 +1,4 @@ -import Translator from '../src/Translator'; +import Translator from '@superset-ui/core/src/translation/Translator'; import { configure, t, @@ -6,7 +6,7 @@ import { addLocaleData, addTranslation, addTranslations, -} from '../src/TranslatorSingleton'; +} from '@superset-ui/core/src/translation/TranslatorSingleton'; import languagePackZh from './languagePacks/zh'; import languagePackEn from './languagePacks/en'; diff --git a/packages/superset-ui-translation/test/TranslatorSingleton.test.ts b/packages/superset-ui-core/test/translation/TranslatorSingleton.test.ts similarity index 90% rename from packages/superset-ui-translation/test/TranslatorSingleton.test.ts rename to packages/superset-ui-core/test/translation/TranslatorSingleton.test.ts index 0c842bee14..81327801ce 100644 --- a/packages/superset-ui-translation/test/TranslatorSingleton.test.ts +++ b/packages/superset-ui-core/test/translation/TranslatorSingleton.test.ts @@ -1,7 +1,8 @@ /* eslint no-console: 0 */ import mockConsole from 'jest-mock-console'; -import Translator from '../src/Translator'; -import { configure, t, tn } from '../src/TranslatorSingleton'; +import Translator from '@superset-ui/core/src/translation/Translator'; +import { configure, t, tn } from '@superset-ui/core/src/translation/TranslatorSingleton'; + import languagePackEn from './languagePacks/en'; import languagePackZh from './languagePacks/zh'; diff --git a/packages/superset-ui-translation/test/index.test.ts b/packages/superset-ui-core/test/translation/index.test.ts similarity index 83% rename from packages/superset-ui-translation/test/index.test.ts rename to packages/superset-ui-core/test/translation/index.test.ts index 3042c7d24b..bc90e0ea11 100644 --- a/packages/superset-ui-translation/test/index.test.ts +++ b/packages/superset-ui-core/test/translation/index.test.ts @@ -1,4 +1,4 @@ -import { configure, t, tn } from '../src'; +import { configure, t, tn } from '@superset-ui/core/src/translation'; describe('index', () => { it('exports configure()', () => { diff --git a/packages/superset-ui-translation/test/languagePacks/en.ts b/packages/superset-ui-core/test/translation/languagePacks/en.ts similarity index 83% rename from packages/superset-ui-translation/test/languagePacks/en.ts rename to packages/superset-ui-core/test/translation/languagePacks/en.ts index 80a777a410..668ea4b536 100644 --- a/packages/superset-ui-translation/test/languagePacks/en.ts +++ b/packages/superset-ui-core/test/translation/languagePacks/en.ts @@ -1,4 +1,4 @@ -import { LanguagePack } from '../../src'; +import { LanguagePack } from '@superset-ui/core/src/translation'; const languagePack: LanguagePack = { domain: 'superset', diff --git a/packages/superset-ui-translation/test/languagePacks/zh.ts b/packages/superset-ui-core/test/translation/languagePacks/zh.ts similarity index 82% rename from packages/superset-ui-translation/test/languagePacks/zh.ts rename to packages/superset-ui-core/test/translation/languagePacks/zh.ts index f03a266d93..4a3ba79852 100644 --- a/packages/superset-ui-translation/test/languagePacks/zh.ts +++ b/packages/superset-ui-core/test/translation/languagePacks/zh.ts @@ -1,4 +1,4 @@ -import { LanguagePack } from '../../src'; +import { LanguagePack } from '@superset-ui/core/src/translation'; const languagePack: LanguagePack = { domain: 'superset', diff --git a/packages/superset-ui-core/test/tsconfig.json b/packages/superset-ui-core/test/tsconfig.json new file mode 100644 index 0000000000..014c5465be --- /dev/null +++ b/packages/superset-ui-core/test/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "composite": false, + "emitDeclarationOnly": false, + "noEmit": true, + "rootDir": "." + }, + "extends": "../../../tsconfig.options.json", + "include": [ + "**/*", + "../types/**/*", + "../../../types/**/*" + ], + "references": [ + { + "path": ".." + } + ] +} \ No newline at end of file diff --git a/packages/superset-ui-core/test/utils/convertKeysToCamelCase.test.ts b/packages/superset-ui-core/test/utils/convertKeysToCamelCase.test.ts index fd9d2deb72..23cd9610e9 100644 --- a/packages/superset-ui-core/test/utils/convertKeysToCamelCase.test.ts +++ b/packages/superset-ui-core/test/utils/convertKeysToCamelCase.test.ts @@ -1,4 +1,4 @@ -import { convertKeysToCamelCase } from '../../src'; +import { convertKeysToCamelCase } from '@superset-ui/core/src'; describe('convertKeysToCamelCase(object)', () => { it('returns undefined for undefined input', () => { diff --git a/packages/superset-ui-core/test/utils/isDefined.test.ts b/packages/superset-ui-core/test/utils/isDefined.test.ts index aee9f52800..a80765137b 100644 --- a/packages/superset-ui-core/test/utils/isDefined.test.ts +++ b/packages/superset-ui-core/test/utils/isDefined.test.ts @@ -1,4 +1,4 @@ -import { isDefined } from '../../src'; +import { isDefined } from '@superset-ui/core/src'; describe('isDefined(value)', () => { it('returns true if value is not null and not undefined', () => { diff --git a/packages/superset-ui-core/test/utils/isRequired.test.ts b/packages/superset-ui-core/test/utils/isRequired.test.ts index afb8428a90..13b54791b3 100644 --- a/packages/superset-ui-core/test/utils/isRequired.test.ts +++ b/packages/superset-ui-core/test/utils/isRequired.test.ts @@ -1,4 +1,4 @@ -import { isRequired } from '../../src'; +import { isRequired } from '@superset-ui/core/src'; describe('isRequired(field)', () => { it('should throw error with the given field in the message', () => { diff --git a/packages/superset-ui-core/test/utils/logging.test.ts b/packages/superset-ui-core/test/utils/logging.test.ts index 3707977d07..5c2bb96444 100644 --- a/packages/superset-ui-core/test/utils/logging.test.ts +++ b/packages/superset-ui-core/test/utils/logging.test.ts @@ -22,7 +22,7 @@ describe('logging', () => { jest.resetModules(); }); it('should pipe to `console` methods', () => { - const { logging } = require('../../src'); + const { logging } = require('@superset-ui/core/src'); expect(() => { logging.debug(); @@ -42,7 +42,7 @@ describe('logging', () => { it('should use noop functions when console unavailable', () => { const { console } = window; Object.assign(window, { console: undefined }); - const { logging } = require('../../src'); + const { logging } = require('@superset-ui/core/src'); afterAll(() => { Object.assign(window, { console }); diff --git a/packages/superset-ui-core/test/utils/makeSingleton.test.ts b/packages/superset-ui-core/test/utils/makeSingleton.test.ts index 4ab96e1d10..7b69cb84e2 100644 --- a/packages/superset-ui-core/test/utils/makeSingleton.test.ts +++ b/packages/superset-ui-core/test/utils/makeSingleton.test.ts @@ -1,4 +1,4 @@ -import { makeSingleton } from '../../src'; +import { makeSingleton } from '@superset-ui/core/src'; describe('makeSingleton()', () => { class Dog { diff --git a/packages/superset-ui-core/test/utils/promiseTimeout.test.ts b/packages/superset-ui-core/test/utils/promiseTimeout.test.ts index 0c786c6da9..cfdb972fbd 100644 --- a/packages/superset-ui-core/test/utils/promiseTimeout.test.ts +++ b/packages/superset-ui-core/test/utils/promiseTimeout.test.ts @@ -1,4 +1,4 @@ -import { promiseTimeout } from '../../src'; +import { promiseTimeout } from '@superset-ui/core/src'; describe('promiseTimeout(func, delay)', () => { beforeEach(() => { diff --git a/packages/superset-ui-core/tsconfig.json b/packages/superset-ui-core/tsconfig.json new file mode 100644 index 0000000000..b2c72804cc --- /dev/null +++ b/packages/superset-ui-core/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "declarationDir": "lib", + "outDir": "lib", + "rootDir": "src" + }, + "exclude": [ + "lib", + "test" + ], + "extends": "../../tsconfig.options.json", + "include": [ + "src/**/*", + "types/**/*", + "../../types/**/*" + ], + "references": [] +} \ No newline at end of file diff --git a/packages/superset-ui-core/types/external.d.ts b/packages/superset-ui-core/types/external.d.ts new file mode 100644 index 0000000000..31b0250bf4 --- /dev/null +++ b/packages/superset-ui-core/types/external.d.ts @@ -0,0 +1,22 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +/** + * Stub for the untypped jed module. + */ +declare module 'jed'; diff --git a/packages/superset-ui-demo/.eslintrc b/packages/superset-ui-demo/.eslintrc new file mode 100644 index 0000000000..d445a4e4e1 --- /dev/null +++ b/packages/superset-ui-demo/.eslintrc @@ -0,0 +1,5 @@ +{ + "parserOptions": { + "project": "./tsconfig.json" + } +} diff --git a/packages/superset-ui-demo/.storybook/preview.js b/packages/superset-ui-demo/.storybook/preview.js index 1d238ed208..e154d976fa 100644 --- a/packages/superset-ui-demo/.storybook/preview.js +++ b/packages/superset-ui-demo/.storybook/preview.js @@ -1,12 +1,12 @@ import { addParameters, addDecorator } from '@storybook/react'; import { jsxDecorator } from 'storybook-addon-jsx'; -import categoricalD3 from '@superset-ui/color/esm/colorSchemes/categorical/d3'; -import sequentialCommon from '@superset-ui/color/esm/colorSchemes/sequential/common'; -import sequentialD3 from '@superset-ui/color/esm/colorSchemes/sequential/d3'; -import { configure } from '@superset-ui/translation'; -import { getCategoricalSchemeRegistry, getSequentialSchemeRegistry } from '@superset-ui/color'; -import { getTimeFormatterRegistry, smartDateFormatter } from '@superset-ui/time-format'; -import themeDecorator from "./themeDecorator" +import categoricalD3 from '@superset-ui/core/lib/color/colorSchemes/categorical/d3'; +import sequentialCommon from '@superset-ui/core/lib/color/colorSchemes/sequential/common'; +import sequentialD3 from '@superset-ui/core/lib/color/colorSchemes/sequential/d3'; +import { configure, getTimeFormatterRegistry, smartDateFormatter } from '@superset-ui/core'; +import { getCategoricalSchemeRegistry, getSequentialSchemeRegistry } from '@superset-ui/core'; +import { configureEncodable } from '@superset-ui/preset-chart-xy'; +import themeDecorator from './themeDecorator'; import 'bootstrap/dist/css/bootstrap.min.css'; import './storybook.css'; @@ -30,7 +30,7 @@ addParameters({ sortStoriesByKind: false, url: '#', storySort: (a, b) => { - if (a[1].kind === b[1].kind ) { + if (a[1].kind === b[1].kind) { return 0; } if (a[1].id.startsWith('core-packages') && !b[1].id.startsWith('core-packages')) { @@ -68,3 +68,4 @@ getTimeFormatterRegistry() .registerValue('smart_date', smartDateFormatter) .setDefaultKey('smart_date'); +configureEncodable(); diff --git a/packages/superset-ui-demo/package.json b/packages/superset-ui-demo/package.json index 1a5af773b5..05eb2571c1 100644 --- a/packages/superset-ui-demo/package.json +++ b/packages/superset-ui-demo/package.json @@ -38,8 +38,7 @@ "@storybook/preset-typescript": "^3.0.0", "@storybook/react": "^5.3.18", "@superset-ui/chart": "0.14.11", - "@superset-ui/color": "0.14.9", - "@superset-ui/connection": "0.14.19", + "@superset-ui/core": "0.15.0", "@superset-ui/legacy-plugin-chart-calendar": "0.14.11", "@superset-ui/legacy-plugin-chart-chord": "0.14.20", "@superset-ui/legacy-plugin-chart-country-map": "0.14.9", @@ -59,21 +58,17 @@ "@superset-ui/legacy-plugin-chart-sunburst": "0.14.18", "@superset-ui/legacy-plugin-chart-time-table": "0.14.11", "@superset-ui/legacy-plugin-chart-treemap": "0.14.13", - "@superset-ui/legacy-plugin-chart-word-cloud": "^0.11.15", "@superset-ui/legacy-plugin-chart-world-map": "0.14.20", "@superset-ui/legacy-preset-chart-big-number": "0.14.9", - "@superset-ui/number-format": "0.14.9", "@superset-ui/plugin-chart-table": "0.14.20", "@superset-ui/plugin-chart-word-cloud": "0.14.12", - "@superset-ui/query": "0.14.15", - "@superset-ui/style": "0.14.20", - "@superset-ui/time-format": "0.14.9", - "@superset-ui/translation": "0.14.20", + "@superset-ui/preset-chart-xy": "0.14.17", "@types/react-resizable": "^1.7.2", "@types/storybook__react": "5.2.1", "bootstrap": "^3.4.1", "core-js": "3.6.5", "gh-pages": "^3.0.0", + "global-box": "^1.2.0", "jquery": "^3.4.1", "memoize-one": "^5.1.1", "react": "^16.13.1", diff --git a/packages/superset-ui-demo/storybook/shared/components/VerifyCORS.tsx b/packages/superset-ui-demo/storybook/shared/components/VerifyCORS.tsx index e057e137f8..29297a6f1a 100644 --- a/packages/superset-ui-demo/storybook/shared/components/VerifyCORS.tsx +++ b/packages/superset-ui-demo/storybook/shared/components/VerifyCORS.tsx @@ -1,6 +1,5 @@ import React, { ReactNode } from 'react'; -import { SupersetClient, Method } from '@superset-ui/connection'; -import { makeApi, SupersetApiError } from '@superset-ui/query'; +import { SupersetClient, Method, makeApi, SupersetApiError } from '@superset-ui/core'; import ErrorMessage from './ErrorMessage'; export type Props = { diff --git a/packages/superset-ui-demo/storybook/shared/components/createQueryStory.tsx b/packages/superset-ui-demo/storybook/shared/components/createQueryStory.tsx index 484c2489e5..e2140fdf3b 100644 --- a/packages/superset-ui-demo/storybook/shared/components/createQueryStory.tsx +++ b/packages/superset-ui-demo/storybook/shared/components/createQueryStory.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { text, select } from '@storybook/addon-knobs'; import { SuperChart, ChartDataProvider } from '@superset-ui/chart'; -import { SupersetClient } from '@superset-ui/connection'; +import { SupersetClient } from '@superset-ui/core'; import Expandable from './Expandable'; import VerifyCORS, { renderError } from './VerifyCORS'; diff --git a/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-country-map/Stories.tsx b/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-country-map/Stories.tsx index cec509ff18..90c4d346d1 100644 --- a/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-country-map/Stories.tsx +++ b/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-country-map/Stories.tsx @@ -1,8 +1,7 @@ -/* eslint-disable no-magic-numbers */ import React from 'react'; import { SuperChart } from '@superset-ui/chart'; import CountryMapChartPlugin from '@superset-ui/legacy-plugin-chart-country-map'; -import countries from '@superset-ui/legacy-plugin-chart-country-map/esm/countries'; +import countries from '@superset-ui/legacy-plugin-chart-country-map/lib/countries'; import { withKnobs, select } from '@storybook/addon-knobs'; import data from './data'; diff --git a/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/BoxPlot/Stories.tsx b/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/BoxPlot/Stories.tsx index d7ddb867e6..273fbb4dcf 100644 --- a/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/BoxPlot/Stories.tsx +++ b/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/BoxPlot/Stories.tsx @@ -1,5 +1,6 @@ import { BoxPlotChartPlugin, LegacyBoxPlotChartPlugin } from '@superset-ui/preset-chart-xy'; import { BOX_PLOT_PLUGIN_LEGACY_TYPE, BOX_PLOT_PLUGIN_TYPE } from './constants'; + new LegacyBoxPlotChartPlugin().configure({ key: BOX_PLOT_PLUGIN_LEGACY_TYPE }).register(); new BoxPlotChartPlugin().configure({ key: BOX_PLOT_PLUGIN_TYPE }).register(); diff --git a/packages/superset-ui-demo/storybook/stories/superset-ui-chart/ChartDataProviderStories.tsx b/packages/superset-ui-demo/storybook/stories/superset-ui-chart/ChartDataProviderStories.tsx index a680b3eff4..814daa4c90 100644 --- a/packages/superset-ui-demo/storybook/stories/superset-ui-chart/ChartDataProviderStories.tsx +++ b/packages/superset-ui-demo/storybook/stories/superset-ui-chart/ChartDataProviderStories.tsx @@ -2,11 +2,10 @@ import React from 'react'; import { text, select, withKnobs } from '@storybook/addon-knobs'; import { SuperChart, ChartDataProvider } from '@superset-ui/chart'; -import { SupersetClient } from '@superset-ui/connection'; +import { SupersetClient } from '@superset-ui/core'; import { BigNumberChartPlugin as LegacyBigNumberPlugin } from '@superset-ui/legacy-preset-chart-big-number'; import LegacySankeyPlugin from '@superset-ui/legacy-plugin-chart-sankey'; import LegacySunburstPlugin from '@superset-ui/legacy-plugin-chart-sunburst'; -import LegacyWordCloudPlugin from '@superset-ui/legacy-plugin-chart-word-cloud'; import { WordCloudChartPlugin } from '@superset-ui/plugin-chart-word-cloud'; import { @@ -31,7 +30,6 @@ new LegacySankeyPlugin().configure({ key: SANKEY }).register(); // eslint-disable-next-line new LegacySunburstPlugin().configure({ key: SUNBURST }).register(); // eslint-disable-next-line -new LegacyWordCloudPlugin().configure({ key: WORD_CLOUD_LEGACY }).register(); new WordCloudChartPlugin().configure({ key: WORD_CLOUD }).register(); const VIS_TYPES = [BIG_NUMBER, SANKEY, SUNBURST, WORD_CLOUD, WORD_CLOUD_LEGACY]; diff --git a/packages/superset-ui-demo/storybook/stories/superset-ui-color/ColorPallettesStories.jsx b/packages/superset-ui-demo/storybook/stories/superset-ui-color/ColorPallettesStories.jsx index 3d68f67cb9..2bf27d33cd 100644 --- a/packages/superset-ui-demo/storybook/stories/superset-ui-color/ColorPallettesStories.jsx +++ b/packages/superset-ui-demo/storybook/stories/superset-ui-color/ColorPallettesStories.jsx @@ -1,14 +1,14 @@ import React from 'react'; -import AirbnbPalettes from '@superset-ui/color/src/colorSchemes/categorical/airbnb'; -import D3Palettes from '@superset-ui/color/src/colorSchemes/categorical/d3'; -import GooglePalettes from '@superset-ui/color/src/colorSchemes/categorical/google'; -import LyftPalettes from '@superset-ui/color/src/colorSchemes/categorical/lyft'; -import PresetPalettes from '@superset-ui/color/src/colorSchemes/categorical/preset'; -import SupersetPalettes from '@superset-ui/color/src/colorSchemes/categorical/superset'; +import AirbnbPalettes from '@superset-ui/core/src/color/colorSchemes/categorical/airbnb'; +import D3Palettes from '@superset-ui/core/src/color/colorSchemes/categorical/d3'; +import GooglePalettes from '@superset-ui/core/src/color/colorSchemes/categorical/google'; +import LyftPalettes from '@superset-ui/core/src/color/colorSchemes/categorical/lyft'; +import PresetPalettes from '@superset-ui/core/src/color/colorSchemes/categorical/preset'; +import SupersetPalettes from '@superset-ui/core/src/color/colorSchemes/categorical/superset'; -import SequantialCommonPalettes from '@superset-ui/color/src/colorSchemes/sequential/common'; -import SequantialD3Palettes from '@superset-ui/color/src/colorSchemes/sequential/d3'; +import SequantialCommonPalettes from '@superset-ui/core/src/color/colorSchemes/sequential/common'; +import SequantialD3Palettes from '@superset-ui/core/src/color/colorSchemes/sequential/d3'; import RenderPalettes from './RenderPalettes'; diff --git a/packages/superset-ui-demo/storybook/stories/superset-ui-number-format/BigNumberStories.jsx b/packages/superset-ui-demo/storybook/stories/superset-ui-number-format/BigNumberStories.jsx index 87fc43e570..4b97444d13 100644 --- a/packages/superset-ui-demo/storybook/stories/superset-ui-number-format/BigNumberStories.jsx +++ b/packages/superset-ui-demo/storybook/stories/superset-ui-number-format/BigNumberStories.jsx @@ -1,7 +1,6 @@ -/* eslint-disable no-magic-numbers, jsx-a11y/label-has-for, jsx-a11y/label-has-associated-control */ - +/* eslint-disable jsx-a11y/label-has-associated-control */ import React from 'react'; -import { formatNumber } from '@superset-ui/number-format'; +import { formatNumber } from '@superset-ui/core'; const propTypes = {}; const defaultProps = {}; diff --git a/packages/superset-ui-demo/storybook/stories/superset-ui-time-format/TimeFormatStories.jsx b/packages/superset-ui-demo/storybook/stories/superset-ui-time-format/TimeFormatStories.jsx index da71833571..019df495df 100644 --- a/packages/superset-ui-demo/storybook/stories/superset-ui-time-format/TimeFormatStories.jsx +++ b/packages/superset-ui-demo/storybook/stories/superset-ui-time-format/TimeFormatStories.jsx @@ -1,7 +1,6 @@ -/* eslint-disable no-magic-numbers, jsx-a11y/label-has-for, jsx-a11y/label-has-associated-control */ - +/* eslint-disable jsx-a11y/label-has-associated-control */ import React from 'react'; -import { formatTime } from '@superset-ui/time-format'; +import { formatTime } from '@superset-ui/core'; const propTypes = {}; const defaultProps = {}; diff --git a/packages/superset-ui-dimension/README.md b/packages/superset-ui-dimension/README.md deleted file mode 100644 index b057c4281b..0000000000 --- a/packages/superset-ui-dimension/README.md +++ /dev/null @@ -1,23 +0,0 @@ -## @superset-ui/dimension - -[![Version](https://img.shields.io/npm/v/@superset-ui/dimension.svg?style=flat)](https://img.shields.io/npm/v/@superset-ui/dimension.svg?style=flat) -[![David (path)](https://img.shields.io/david/apache-superset/superset-ui.svg?path=packages%2Fsuperset-ui-dimension&style=flat-square)](https://david-dm.org/apache-superset/superset-ui?path=packages/superset-ui-dimension) - -Description - -#### Example usage - -```js -import { xxx } from '@superset-ui/dimension'; -``` - -#### API - -`fn(args)` - -- Do something - -### Development - -`@data-ui/build-config` is used to manage the build configuration for this package including babel -builds, jest testing, eslint, and prettier. diff --git a/packages/superset-ui-dimension/package.json b/packages/superset-ui-dimension/package.json deleted file mode 100644 index 1c70ae2e1e..0000000000 --- a/packages/superset-ui-dimension/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "@superset-ui/dimension", - "version": "0.14.9", - "description": "Superset UI dimension", - "sideEffects": false, - "main": "lib/index.js", - "module": "esm/index.js", - "files": [ - "esm", - "lib" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/apache-superset/superset-ui.git" - }, - "keywords": [ - "superset" - ], - "author": "Superset", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/apache-superset/superset-ui/issues" - }, - "homepage": "https://github.com/apache-superset/superset-ui#readme", - "publishConfig": { - "access": "public" - } -} diff --git a/packages/superset-ui-number-format/package.json b/packages/superset-ui-number-format/package.json deleted file mode 100644 index fc327f2417..0000000000 --- a/packages/superset-ui-number-format/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "@superset-ui/number-format", - "version": "0.14.9", - "description": "Superset UI number format", - "sideEffects": false, - "main": "lib/index.js", - "module": "esm/index.js", - "files": [ - "esm", - "lib" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/apache-superset/superset-ui.git" - }, - "keywords": [ - "superset" - ], - "author": "Superset", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/apache-superset/superset-ui/issues" - }, - "homepage": "https://github.com/apache-superset/superset-ui#readme", - "publishConfig": { - "access": "public" - }, - "dependencies": { - "@types/d3-format": "^1.3.0", - "d3-format": "^1.3.2", - "pretty-ms": "^7.0.0" - }, - "peerDependencies": { - "@superset-ui/core": "^0.14.0" - } -} diff --git a/packages/superset-ui-number-format/src/NumberFormatterRegistrySingleton.ts b/packages/superset-ui-number-format/src/NumberFormatterRegistrySingleton.ts deleted file mode 100644 index 098a35bfe3..0000000000 --- a/packages/superset-ui-number-format/src/NumberFormatterRegistrySingleton.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { makeSingleton } from '@superset-ui/core'; -import NumberFormatterRegistry from './NumberFormatterRegistry'; - -const getInstance = makeSingleton(NumberFormatterRegistry); - -export default getInstance; - -export function getNumberFormatter(format?: string) { - return getInstance().get(format); -} - -export function formatNumber(format: string | undefined, value: number | null | undefined) { - return getInstance().format(format, value); -} diff --git a/packages/superset-ui-query/README.md b/packages/superset-ui-query/README.md deleted file mode 100644 index f784bc6485..0000000000 --- a/packages/superset-ui-query/README.md +++ /dev/null @@ -1,16 +0,0 @@ -## @superset-ui/query - -[![Version](https://img.shields.io/npm/v/@superset-ui/query.svg?style=flat)](https://img.shields.io/npm/v/@superset-ui/query.svg?style=flat) -[![David (path)](https://img.shields.io/david/apache-superset/superset-ui.svg?path=packages%2Fsuperset-ui-query&style=flat-square)](https://david-dm.org/apache-superset/superset-ui?path=packages/superset-ui-query) - -Utility to build query object for chart data. - -#### Example usage - -```js -import { xxx } from '@superset-ui/query'; -``` - -#### API - -TODO diff --git a/packages/superset-ui-query/package.json b/packages/superset-ui-query/package.json deleted file mode 100644 index 4368c8ca8a..0000000000 --- a/packages/superset-ui-query/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "@superset-ui/query", - "version": "0.14.15", - "description": "Superset UI query", - "sideEffects": false, - "main": "lib/index.js", - "module": "esm/index.js", - "files": [ - "esm", - "lib" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/apache-superset/superset-ui.git" - }, - "keywords": [ - "superset" - ], - "author": "Superset", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/apache-superset/superset-ui/issues" - }, - "homepage": "https://github.com/apache-superset/superset-ui#readme", - "publishConfig": { - "access": "public" - }, - "devDependencies": { - "@types/fetch-mock": "^6.0.4", - "fetch-mock": "^7.2.5", - "node-fetch": "^2.2.0" - }, - "peerDependencies": { - "@superset-ui/connection": "^0.14.0" - } -} diff --git a/packages/superset-ui-style/test/tsconfig.json b/packages/superset-ui-style/test/tsconfig.json new file mode 100644 index 0000000000..014c5465be --- /dev/null +++ b/packages/superset-ui-style/test/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "composite": false, + "emitDeclarationOnly": false, + "noEmit": true, + "rootDir": "." + }, + "extends": "../../../tsconfig.options.json", + "include": [ + "**/*", + "../types/**/*", + "../../../types/**/*" + ], + "references": [ + { + "path": ".." + } + ] +} \ No newline at end of file diff --git a/packages/superset-ui-style/tsconfig.json b/packages/superset-ui-style/tsconfig.json new file mode 100644 index 0000000000..b2c72804cc --- /dev/null +++ b/packages/superset-ui-style/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "declarationDir": "lib", + "outDir": "lib", + "rootDir": "src" + }, + "exclude": [ + "lib", + "test" + ], + "extends": "../../tsconfig.options.json", + "include": [ + "src/**/*", + "types/**/*", + "../../types/**/*" + ], + "references": [] +} \ No newline at end of file diff --git a/packages/superset-ui-superset-ui/README.md b/packages/superset-ui-superset-ui/README.md deleted file mode 100644 index 4fd4e57a22..0000000000 --- a/packages/superset-ui-superset-ui/README.md +++ /dev/null @@ -1,23 +0,0 @@ -## @superset-ui/superset-ui - -[![Version](https://img.shields.io/npm/v/@superset-ui/superset-ui.svg?style=flat)](https://img.shields.io/npm/v/@superset-ui/superset-ui.svg?style=flat) -[![David (path)](https://img.shields.io/david/apache-superset/superset-ui.svg?path=packages%2Fsuperset-ui-superset-ui&style=flat-square)](https://david-dm.org/apache-superset/superset-ui?path=packages/superset-ui-superset-ui) - -Description - -#### Example usage - -```js -import { xxx } from '@superset-ui/superset-ui'; -``` - -#### API - -`fn(args)` - -- Do something - -### Development - -`@data-ui/build-config` is used to manage the build configuration for this package including babel -builds, jest testing, eslint, and prettier. diff --git a/packages/superset-ui-superset-ui/package.json b/packages/superset-ui-superset-ui/package.json deleted file mode 100644 index 8230352b38..0000000000 --- a/packages/superset-ui-superset-ui/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "@superset-ui/superset-ui", - "version": "0.14.22", - "description": "One stop install for all superset-ui packages", - "sideEffects": false, - "main": "lib/index.js", - "module": "esm/index.js", - "files": [ - "esm", - "lib" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/apache-superset/superset-ui.git" - }, - "keywords": [ - "superset" - ], - "author": "Superset", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/apache-superset/superset-ui/issues" - }, - "homepage": "https://github.com/apache-superset/superset-ui#readme", - "publishConfig": { - "access": "public" - }, - "dependencies": { - "@superset-ui/chart": "0.14.11", - "@superset-ui/chart-composition": "0.14.11", - "@superset-ui/chart-controls": "0.14.22", - "@superset-ui/color": "0.14.9", - "@superset-ui/connection": "0.14.19", - "@superset-ui/core": "0.14.21", - "@superset-ui/dimension": "0.14.9", - "@superset-ui/number-format": "0.14.9", - "@superset-ui/query": "0.14.15", - "@superset-ui/style": "0.14.20", - "@superset-ui/time-format": "0.14.9", - "@superset-ui/translation": "0.14.20", - "@superset-ui/validator": "0.14.9" - } -} diff --git a/packages/superset-ui-superset-ui/src/index.ts b/packages/superset-ui-superset-ui/src/index.ts deleted file mode 100644 index c9078fb59e..0000000000 --- a/packages/superset-ui-superset-ui/src/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -export * from '@superset-ui/chart'; -export * from '@superset-ui/chart-composition'; -export * from '@superset-ui/color'; -export * from '@superset-ui/connection'; -export * from '@superset-ui/chart-controls'; -export * from '@superset-ui/core'; -export * from '@superset-ui/dimension'; -export * from '@superset-ui/number-format'; -export * from '@superset-ui/query'; -export * from '@superset-ui/style'; -export * from '@superset-ui/time-format'; -export * from '@superset-ui/translation'; -export * from '@superset-ui/validator'; diff --git a/packages/superset-ui-superset-ui/test/index.test.ts b/packages/superset-ui-superset-ui/test/index.test.ts deleted file mode 100644 index 05f3bc29ad..0000000000 --- a/packages/superset-ui-superset-ui/test/index.test.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { - SuperChart, - ChartFrame, - CategoricalColorScale, - SupersetClient, - Registry, - getTextDimension, - getNumberFormatterRegistry, - buildQueryContext, - getTimeFormatterRegistry, - t, - validateInteger, - supersetTheme, - D3_FORMAT_DOCS, -} from '../src'; - -describe('@superset-ui/superset-ui', () => { - it('should export @superset-ui/chart', () => { - expect(SuperChart).toBeDefined(); - }); - it('should export @superset-ui/chart-composition', () => { - expect(ChartFrame).toBeDefined(); - }); - it('should export @superset-ui/color', () => { - expect(CategoricalColorScale).toBeDefined(); - }); - it('should export @superset-ui/connection', () => { - expect(SupersetClient).toBeDefined(); - }); - it('should export @superset-ui/chart-controls', () => { - expect(D3_FORMAT_DOCS).toBeDefined(); - }); - it('should export @superset-ui/core', () => { - expect(Registry).toBeDefined(); - }); - it('should export @superset-ui/dimension', () => { - expect(getTextDimension).toBeDefined(); - }); - it('should export @superset-ui/number-format', () => { - expect(getNumberFormatterRegistry).toBeDefined(); - }); - it('should export @superset-ui/query', () => { - expect(buildQueryContext).toBeDefined(); - }); - it('should export @superset-ui/style', () => { - expect(supersetTheme).toBeDefined(); - }); - it('should export @superset-ui/time-format', () => { - expect(getTimeFormatterRegistry).toBeDefined(); - }); - it('should export @superset-ui/translation', () => { - expect(t).toBeDefined(); - }); - it('should export @superset-ui/validator', () => { - expect(validateInteger).toBeDefined(); - }); -}); diff --git a/packages/superset-ui-time-format/README.md b/packages/superset-ui-time-format/README.md deleted file mode 100644 index 537b968aa4..0000000000 --- a/packages/superset-ui-time-format/README.md +++ /dev/null @@ -1,57 +0,0 @@ -## @superset-ui/time-format - -[![Version](https://img.shields.io/npm/v/@superset-ui/time-format.svg?style=flat)](https://img.shields.io/npm/v/@superset-ui/time-format.svg?style=flat) -[![David (path)](https://img.shields.io/david/apache-superset/superset-ui.svg?path=packages%2Fsuperset-ui-time-format&style=flat-square)](https://david-dm.org/apache-superset/superset-ui?path=packages/superset-ui-time-format) - -Description - -#### Example usage - -Add `@superset-ui/time-format`, a module for formatting time. Functions `getTimeFormatter` and `formatTime` should be used instead of calling `d3.utcFormat` or `d3.timeFormat` directly. - -```js -import { getTimeFormatter } from '@superset-ui/time-format'; -const formatter = getTimeFormatter('%Y-%m-d'); -console.log(formatter(new Date())); -``` - -or - -```js -import { formatTime } from '@superset-ui/time-format'; -console.log(formatTime('%Y-%m-d', new Date())); -``` - -It is powered by a registry to support registration of custom formatting, with fallback to `d3.utcFormat` or `d3.timeFormat` (if the formatId starts with `local!`) - -```js -import { getTimeFormatterRegistry, formatTime, TimeFormatter } from '@superset-ui/time-format'; - -getTimeFormatterRegistry().registerValue('my_format', new TimeFormatter({ - id: 'my_format', - formatFunc: v => `my special format of ${utcFormat('%Y')(v)}` -}); - -console.log(formatTime('my_format', new Date(2018))); -// prints 'my special format of 2018' -``` - -It also define constants for common d3 time formats. See [TimeFormats.js](https://github.com/apache-superset/superset-ui/blob/master/packages/superset-ui-time-format/src/TimeFormats.js). - -```js -import { TimeFormats } from '@superset-ui/time-format'; - -TimeFormats.DATABASE_DATETIME // '%Y-%m-%d %H:%M:%S' -TimeFormats.US_DATE // '%m/%d/%Y' -``` - -#### API - -`fn(args)` - -- Do something - -### Development - -`@data-ui/build-config` is used to manage the build configuration for this package including babel -builds, jest testing, eslint, and prettier. diff --git a/packages/superset-ui-time-format/package.json b/packages/superset-ui-time-format/package.json deleted file mode 100644 index 4845d1c318..0000000000 --- a/packages/superset-ui-time-format/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "@superset-ui/time-format", - "version": "0.14.9", - "description": "Superset UI time-format", - "sideEffects": false, - "main": "lib/index.js", - "module": "esm/index.js", - "files": [ - "esm", - "lib" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/apache-superset/superset-ui.git" - }, - "keywords": [ - "superset" - ], - "author": "Superset", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/apache-superset/superset-ui/issues" - }, - "homepage": "https://github.com/apache-superset/superset-ui#readme", - "publishConfig": { - "access": "public" - }, - "dependencies": { - "@types/d3-time": "^1.0.9", - "@types/d3-time-format": "^2.1.0", - "d3-time": "^1.0.10", - "d3-time-format": "^2.2.0" - }, - "peerDependencies": { - "@superset-ui/core": "^0.14.0" - } -} diff --git a/packages/superset-ui-translation/README.md b/packages/superset-ui-translation/README.md deleted file mode 100644 index 077431a192..0000000000 --- a/packages/superset-ui-translation/README.md +++ /dev/null @@ -1,57 +0,0 @@ -## @superset-ui/translation - -[![Version](https://img.shields.io/npm/v/@superset-ui/translation.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/translation.svg?style=flat-square) -[![David (path)](https://img.shields.io/david/apache-superset/superset-ui.svg?path=packages%2Fsuperset-ui-translation&style=flat-square)](https://david-dm.org/apache-superset/superset-ui?path=packages/superset-ui-translation) - -`i18n` locales and translation for Superset - -### SupersetTranslation - -#### Example usage - -```js -import { configure, t, tn } from '@superset-ui/translation'; - -configure({ - languagePack: {...}, -}); - -console.log(t('text to be translated')); -console.log(tn('singular text', 'plural text', value)); -``` - -#### API - -`configure({ [languagePack] })` - -- Initialize the translator -- Initialize with the default language if no `languagePack` is specified. - -`t(text[, args])` - -- Translate `text`. -- If `args` is provided, substitute `args` into the `sprintf` placeholders specified within `text` translation. - -For example - -```js -t('Hello %(name)s', user); -``` - -See [sprintf-js](https://github.com/alexei/sprintf.js) for more details on how to define placeholders. - -`tn(singular, plural, num, [, args])` - -- Translate and choose between `singular` and `plural` based on `num`. -- If `args` is provided, substitute `args` into the `sprintf` placeholders specified within `singular` or `plural` translations. - -For example - -```js -tn('%d duck', '%d ducks', 2, 2); -``` - -### Development - -`@data-ui/build-config` is used to manage the build configuration for this package including babel -builds, jest testing, eslint, and prettier. diff --git a/packages/superset-ui-translation/package.json b/packages/superset-ui-translation/package.json deleted file mode 100644 index caa22c215c..0000000000 --- a/packages/superset-ui-translation/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "@superset-ui/translation", - "version": "0.14.20", - "description": "Superset UI translation", - "sideEffects": false, - "main": "lib/index.js", - "module": "esm/index.js", - "files": [ - "esm", - "lib", - "types" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/apache-superset/superset-ui.git" - }, - "keywords": [ - "superset", - "client", - "translation" - ], - "author": "Superset", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/apache-superset/superset-ui/issues" - }, - "homepage": "https://github.com/apache-superset/superset-ui#readme", - "dependencies": { - "jed": "^1.1.1" - }, - "peerDependencies": { - "@superset-ui/core": "^0.14.18" - }, - "publishConfig": { - "access": "public" - } -} diff --git a/packages/superset-ui-translation/types/external.d.ts b/packages/superset-ui-translation/types/external.d.ts deleted file mode 100644 index 1175c8147a..0000000000 --- a/packages/superset-ui-translation/types/external.d.ts +++ /dev/null @@ -1 +0,0 @@ -declare module 'jed'; diff --git a/packages/superset-ui-validator/package.json b/packages/superset-ui-validator/package.json index 563d8c5b65..2b7fd6a84b 100644 --- a/packages/superset-ui-validator/package.json +++ b/packages/superset-ui-validator/package.json @@ -25,7 +25,7 @@ "publishConfig": { "access": "public" }, - "peerDependencies": { - "@superset-ui/translation": "^0.14.0" + "dependencies": { + "@superset-ui/core": "^0.15.0" } } diff --git a/packages/superset-ui-validator/src/legacyValidateInteger.ts b/packages/superset-ui-validator/src/legacyValidateInteger.ts index ca38d39f7d..2c068bb915 100644 --- a/packages/superset-ui-validator/src/legacyValidateInteger.ts +++ b/packages/superset-ui-validator/src/legacyValidateInteger.ts @@ -1,4 +1,4 @@ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; /** * formerly called integer() diff --git a/packages/superset-ui-validator/src/legacyValidateNumber.ts b/packages/superset-ui-validator/src/legacyValidateNumber.ts index 062d30b025..e06669c121 100644 --- a/packages/superset-ui-validator/src/legacyValidateNumber.ts +++ b/packages/superset-ui-validator/src/legacyValidateNumber.ts @@ -1,4 +1,4 @@ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; /** * formerly called numeric() diff --git a/packages/superset-ui-validator/src/validateInteger.ts b/packages/superset-ui-validator/src/validateInteger.ts index e761c274d0..7546e78334 100644 --- a/packages/superset-ui-validator/src/validateInteger.ts +++ b/packages/superset-ui-validator/src/validateInteger.ts @@ -1,4 +1,4 @@ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; export default function validateInteger(v: unknown) { if ( diff --git a/packages/superset-ui-validator/src/validateNonEmpty.ts b/packages/superset-ui-validator/src/validateNonEmpty.ts index e4b28235b5..4c3b772e03 100644 --- a/packages/superset-ui-validator/src/validateNonEmpty.ts +++ b/packages/superset-ui-validator/src/validateNonEmpty.ts @@ -1,4 +1,4 @@ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; export default function validateNonEmpty(v: unknown) { if (v === null || typeof v === 'undefined' || v === '' || (Array.isArray(v) && v.length === 0)) { diff --git a/packages/superset-ui-validator/src/validateNumber.ts b/packages/superset-ui-validator/src/validateNumber.ts index a8a6f1a6de..d06ae0b37a 100644 --- a/packages/superset-ui-validator/src/validateNumber.ts +++ b/packages/superset-ui-validator/src/validateNumber.ts @@ -1,4 +1,4 @@ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; export default function validateInteger(v: unknown) { if ( diff --git a/packages/superset-ui-validator/test/tsconfig.json b/packages/superset-ui-validator/test/tsconfig.json new file mode 100644 index 0000000000..014c5465be --- /dev/null +++ b/packages/superset-ui-validator/test/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "composite": false, + "emitDeclarationOnly": false, + "noEmit": true, + "rootDir": "." + }, + "extends": "../../../tsconfig.options.json", + "include": [ + "**/*", + "../types/**/*", + "../../../types/**/*" + ], + "references": [ + { + "path": ".." + } + ] +} \ No newline at end of file diff --git a/packages/superset-ui-validator/tsconfig.json b/packages/superset-ui-validator/tsconfig.json new file mode 100644 index 0000000000..53e3141e13 --- /dev/null +++ b/packages/superset-ui-validator/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "declarationDir": "lib", + "outDir": "lib", + "rootDir": "src" + }, + "exclude": [ + "lib", + "test" + ], + "extends": "../../tsconfig.options.json", + "include": [ + "src/**/*", + "types/**/*", + "../../types/**/*" + ], + "references": [ + { + "path": "../superset-ui-core" + } + ] +} \ No newline at end of file diff --git a/plugins/legacy-plugin-chart-calendar/package.json b/plugins/legacy-plugin-chart-calendar/package.json index 72ecde17b3..0745468697 100644 --- a/plugins/legacy-plugin-chart-calendar/package.json +++ b/plugins/legacy-plugin-chart-calendar/package.json @@ -36,11 +36,8 @@ "peerDependencies": { "@superset-ui/chart": "^0.14.0", "@superset-ui/chart-controls": "^0.14.0", - "@superset-ui/color": "^0.14.0", - "@superset-ui/number-format": "^0.14.0", + "@superset-ui/core": "^0.15.0", "@superset-ui/style": "^0.14.0", - "@superset-ui/time-format": "^0.14.0", - "@superset-ui/translation": "^0.14.0", "@superset-ui/validator": "^0.14.0", "react": "^16.13.1" } diff --git a/plugins/legacy-plugin-chart-calendar/src/Calendar.js b/plugins/legacy-plugin-chart-calendar/src/Calendar.js index 12f1700e09..2d651c3b61 100644 --- a/plugins/legacy-plugin-chart-calendar/src/Calendar.js +++ b/plugins/legacy-plugin-chart-calendar/src/Calendar.js @@ -19,9 +19,11 @@ import PropTypes from 'prop-types'; import { extent as d3Extent, range as d3Range } from 'd3-array'; import { select as d3Select } from 'd3-selection'; -import { getSequentialSchemeRegistry } from '@superset-ui/color'; -import { getNumberFormatter } from '@superset-ui/number-format'; -import { getTimeFormatter } from '@superset-ui/time-format'; +import { + getNumberFormatter, + getTimeFormatter, + getSequentialSchemeRegistry, +} from '@superset-ui/core'; import CalHeatMap from './vendor/cal-heatmap'; import './vendor/cal-heatmap.css'; diff --git a/plugins/legacy-plugin-chart-calendar/src/controlPanel.js b/plugins/legacy-plugin-chart-calendar/src/controlPanel.js index 26ef964f4a..c5fe71256f 100644 --- a/plugins/legacy-plugin-chart-calendar/src/controlPanel.js +++ b/plugins/legacy-plugin-chart-calendar/src/controlPanel.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { legacyValidateInteger } from '@superset-ui/validator'; import { formatSelectOptions, diff --git a/plugins/legacy-plugin-chart-calendar/src/index.js b/plugins/legacy-plugin-chart-calendar/src/index.js index 913cd4419d..2069cd306a 100644 --- a/plugins/legacy-plugin-chart-calendar/src/index.js +++ b/plugins/legacy-plugin-chart-calendar/src/index.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from './transformProps'; import controlPanel from './controlPanel'; diff --git a/plugins/legacy-plugin-chart-calendar/tsconfig.json b/plugins/legacy-plugin-chart-calendar/tsconfig.json new file mode 100644 index 0000000000..712c31f4f2 --- /dev/null +++ b/plugins/legacy-plugin-chart-calendar/tsconfig.json @@ -0,0 +1,34 @@ +{ + "compilerOptions": { + "declarationDir": "lib", + "outDir": "lib", + "rootDir": "src" + }, + "exclude": [ + "lib", + "test" + ], + "extends": "../../tsconfig.options.json", + "include": [ + "src/**/*", + "types/**/*", + "../../types/**/*" + ], + "references": [ + { + "path": "../../packages/superset-ui-chart" + }, + { + "path": "../../packages/superset-ui-chart-controls" + }, + { + "path": "../../packages/superset-ui-core" + }, + { + "path": "../../packages/superset-ui-style" + }, + { + "path": "../../packages/superset-ui-validator" + } + ] +} \ No newline at end of file diff --git a/plugins/legacy-plugin-chart-chord/package.json b/plugins/legacy-plugin-chart-chord/package.json index fd2bd91dd0..00929cf4f4 100644 --- a/plugins/legacy-plugin-chart-chord/package.json +++ b/plugins/legacy-plugin-chart-chord/package.json @@ -29,15 +29,11 @@ }, "dependencies": { "@superset-ui/style": "0.14.20", + "@superset-ui/core": "^0.15.0", + "@superset-ui/chart": "^0.14.0", + "@superset-ui/validator": "^0.14.0", "d3": "^3.5.17", "prop-types": "^15.6.2", "react": "^16.13.1" - }, - "peerDependencies": { - "@superset-ui/chart": "^0.14.0", - "@superset-ui/color": "^0.14.0", - "@superset-ui/number-format": "^0.14.0", - "@superset-ui/translation": "^0.14.0", - "@superset-ui/validator": "^0.14.0" } } diff --git a/plugins/legacy-plugin-chart-chord/src/Chord.js b/plugins/legacy-plugin-chart-chord/src/Chord.js index 9889dc4db4..b1c7adb76c 100644 --- a/plugins/legacy-plugin-chart-chord/src/Chord.js +++ b/plugins/legacy-plugin-chart-chord/src/Chord.js @@ -19,8 +19,7 @@ /* eslint-disable no-param-reassign, react/sort-prop-types */ import d3 from 'd3'; import PropTypes from 'prop-types'; -import { CategoricalColorNamespace } from '@superset-ui/color'; -import { getNumberFormatter } from '@superset-ui/number-format'; +import { getNumberFormatter, CategoricalColorNamespace } from '@superset-ui/core'; const propTypes = { data: PropTypes.shape({ diff --git a/plugins/legacy-plugin-chart-chord/src/controlPanel.js b/plugins/legacy-plugin-chart-chord/src/controlPanel.js index 7cbf4a7a75..5d3fd6d8ca 100644 --- a/plugins/legacy-plugin-chart-chord/src/controlPanel.js +++ b/plugins/legacy-plugin-chart-chord/src/controlPanel.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { validateNonEmpty } from '@superset-ui/validator'; export default { diff --git a/plugins/legacy-plugin-chart-chord/src/index.js b/plugins/legacy-plugin-chart-chord/src/index.js index 1e0a2dccd6..124e6be7df 100644 --- a/plugins/legacy-plugin-chart-chord/src/index.js +++ b/plugins/legacy-plugin-chart-chord/src/index.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from './transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/plugins/legacy-plugin-chart-chord/tsconfig.json b/plugins/legacy-plugin-chart-chord/tsconfig.json new file mode 100644 index 0000000000..226ec8d30d --- /dev/null +++ b/plugins/legacy-plugin-chart-chord/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "declarationDir": "lib", + "outDir": "lib", + "rootDir": "src" + }, + "exclude": [ + "lib", + "test" + ], + "extends": "../../tsconfig.options.json", + "include": [ + "src/**/*", + "types/**/*", + "../../types/**/*" + ], + "references": [ + { + "path": "../../packages/superset-ui-style" + }, + { + "path": "../../packages/superset-ui-core" + }, + { + "path": "../../packages/superset-ui-chart" + }, + { + "path": "../../packages/superset-ui-validator" + } + ] +} \ No newline at end of file diff --git a/plugins/legacy-plugin-chart-country-map/package.json b/plugins/legacy-plugin-chart-country-map/package.json index 83d8759193..eb5a0c87de 100644 --- a/plugins/legacy-plugin-chart-country-map/package.json +++ b/plugins/legacy-plugin-chart-country-map/package.json @@ -30,13 +30,9 @@ "dependencies": { "d3": "^3.5.17", "d3-array": "^2.0.3", - "prop-types": "^15.6.2" - }, - "peerDependencies": { "@superset-ui/chart": "^0.14.0", "@superset-ui/chart-controls": "^0.14.0", - "@superset-ui/color": "^0.14.0", - "@superset-ui/number-format": "^0.14.0", - "@superset-ui/translation": "^0.14.0" + "@superset-ui/core": "^0.15.0", + "prop-types": "^15.6.2" } } diff --git a/plugins/legacy-plugin-chart-country-map/src/CountryMap.js b/plugins/legacy-plugin-chart-country-map/src/CountryMap.js index 95bd3ce4c3..9b77fe4a27 100644 --- a/plugins/legacy-plugin-chart-country-map/src/CountryMap.js +++ b/plugins/legacy-plugin-chart-country-map/src/CountryMap.js @@ -20,8 +20,7 @@ import d3 from 'd3'; import PropTypes from 'prop-types'; import { extent as d3Extent } from 'd3-array'; -import { getSequentialSchemeRegistry } from '@superset-ui/color'; -import { getNumberFormatter } from '@superset-ui/number-format'; +import { getNumberFormatter, getSequentialSchemeRegistry } from '@superset-ui/core'; import countries from './countries'; import './CountryMap.css'; diff --git a/plugins/legacy-plugin-chart-country-map/src/controlPanel.ts b/plugins/legacy-plugin-chart-country-map/src/controlPanel.ts index 6bd847d570..64a64c4f3e 100644 --- a/plugins/legacy-plugin-chart-country-map/src/controlPanel.ts +++ b/plugins/legacy-plugin-chart-country-map/src/controlPanel.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { D3_FORMAT_OPTIONS, D3_FORMAT_DOCS } from '@superset-ui/chart-controls'; export default { diff --git a/plugins/legacy-plugin-chart-country-map/src/index.js b/plugins/legacy-plugin-chart-country-map/src/index.js index 65dce1e53a..07cf19f31f 100644 --- a/plugins/legacy-plugin-chart-country-map/src/index.js +++ b/plugins/legacy-plugin-chart-country-map/src/index.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from './transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/plugins/legacy-plugin-chart-country-map/tsconfig.json b/plugins/legacy-plugin-chart-country-map/tsconfig.json new file mode 100644 index 0000000000..2a99836c69 --- /dev/null +++ b/plugins/legacy-plugin-chart-country-map/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "declarationDir": "lib", + "outDir": "lib", + "rootDir": "src" + }, + "exclude": [ + "lib", + "test" + ], + "extends": "../../tsconfig.options.json", + "include": [ + "src/**/*", + "types/**/*", + "../../types/**/*" + ], + "references": [ + { + "path": "../../packages/superset-ui-chart" + }, + { + "path": "../../packages/superset-ui-chart-controls" + }, + { + "path": "../../packages/superset-ui-core" + } + ] +} \ No newline at end of file diff --git a/plugins/legacy-plugin-chart-event-flow/package.json b/plugins/legacy-plugin-chart-event-flow/package.json index 2aa1ce4a6f..f27f23572e 100644 --- a/plugins/legacy-plugin-chart-event-flow/package.json +++ b/plugins/legacy-plugin-chart-event-flow/package.json @@ -34,7 +34,7 @@ "peerDependencies": { "@superset-ui/chart": "^0.14.0", "@superset-ui/chart-controls": "^0.14.0", - "@superset-ui/translation": "^0.14.0", + "@superset-ui/core": "^0.15.0", "@superset-ui/validator": "^0.14.0", "react": "^15 || ^16" } diff --git a/plugins/legacy-plugin-chart-event-flow/src/EventFlow.jsx b/plugins/legacy-plugin-chart-event-flow/src/EventFlow.jsx index 0e5de57c0d..5164604553 100644 --- a/plugins/legacy-plugin-chart-event-flow/src/EventFlow.jsx +++ b/plugins/legacy-plugin-chart-event-flow/src/EventFlow.jsx @@ -20,7 +20,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { App } from '@data-ui/event-flow'; -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; const propTypes = { data: PropTypes.array, diff --git a/plugins/legacy-plugin-chart-event-flow/src/controlPanel.jsx b/plugins/legacy-plugin-chart-event-flow/src/controlPanel.jsx index a8682c4a47..d3c2cb22c0 100644 --- a/plugins/legacy-plugin-chart-event-flow/src/controlPanel.jsx +++ b/plugins/legacy-plugin-chart-event-flow/src/controlPanel.jsx @@ -17,7 +17,7 @@ * under the License. */ import React from 'react'; -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { validateNonEmpty } from '@superset-ui/validator'; import { ColumnOption, diff --git a/plugins/legacy-plugin-chart-event-flow/src/index.js b/plugins/legacy-plugin-chart-event-flow/src/index.js index fef15f7d4e..ba25d114fd 100644 --- a/plugins/legacy-plugin-chart-event-flow/src/index.js +++ b/plugins/legacy-plugin-chart-event-flow/src/index.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import thumbnail from './images/thumbnail.png'; import controlPanel from './controlPanel'; diff --git a/plugins/legacy-plugin-chart-event-flow/tsconfig.json b/plugins/legacy-plugin-chart-event-flow/tsconfig.json new file mode 100644 index 0000000000..f7612c330e --- /dev/null +++ b/plugins/legacy-plugin-chart-event-flow/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "declarationDir": "lib", + "outDir": "lib", + "rootDir": "src" + }, + "exclude": [ + "lib", + "test" + ], + "extends": "../../tsconfig.options.json", + "include": [ + "src/**/*", + "types/**/*", + "../../types/**/*" + ], + "references": [ + { + "path": "../../packages/superset-ui-chart" + }, + { + "path": "../../packages/superset-ui-chart-controls" + }, + { + "path": "../../packages/superset-ui-core" + }, + { + "path": "../../packages/superset-ui-validator" + } + ] +} \ No newline at end of file diff --git a/plugins/legacy-plugin-chart-force-directed/package.json b/plugins/legacy-plugin-chart-force-directed/package.json index e7cf9e3065..a419dc1af4 100644 --- a/plugins/legacy-plugin-chart-force-directed/package.json +++ b/plugins/legacy-plugin-chart-force-directed/package.json @@ -28,14 +28,14 @@ "access": "public" }, "dependencies": { - "d3": "^3.5.17" - }, - "peerDependencies": { "@superset-ui/chart": "^0.14.0", "@superset-ui/chart-controls": "^0.14.0", + "@superset-ui/core": "^0.15.0", "@superset-ui/style": "^0.14.3", - "@superset-ui/translation": "^0.14.0", - "prop-types": "^15.7.2", + "d3": "^3.5.17", + "prop-types": "^15.7.2" + }, + "peerDependencies": { "react": "^16.13.1" } } diff --git a/plugins/legacy-plugin-chart-force-directed/src/controlPanel.js b/plugins/legacy-plugin-chart-force-directed/src/controlPanel.js index caa034e5eb..f494748950 100644 --- a/plugins/legacy-plugin-chart-force-directed/src/controlPanel.js +++ b/plugins/legacy-plugin-chart-force-directed/src/controlPanel.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { formatSelectOptions } from '@superset-ui/chart-controls'; export default { diff --git a/plugins/legacy-plugin-chart-force-directed/src/index.js b/plugins/legacy-plugin-chart-force-directed/src/index.js index 16cabb1156..d80f7b88f4 100644 --- a/plugins/legacy-plugin-chart-force-directed/src/index.js +++ b/plugins/legacy-plugin-chart-force-directed/src/index.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from './transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/plugins/legacy-plugin-chart-force-directed/tsconfig.json b/plugins/legacy-plugin-chart-force-directed/tsconfig.json new file mode 100644 index 0000000000..73429d63b6 --- /dev/null +++ b/plugins/legacy-plugin-chart-force-directed/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "declarationDir": "lib", + "outDir": "lib", + "rootDir": "src" + }, + "exclude": [ + "lib", + "test" + ], + "extends": "../../tsconfig.options.json", + "include": [ + "src/**/*", + "types/**/*", + "../../types/**/*" + ], + "references": [ + { + "path": "../../packages/superset-ui-chart" + }, + { + "path": "../../packages/superset-ui-chart-controls" + }, + { + "path": "../../packages/superset-ui-core" + }, + { + "path": "../../packages/superset-ui-style" + } + ] +} \ No newline at end of file diff --git a/plugins/legacy-plugin-chart-heatmap/package.json b/plugins/legacy-plugin-chart-heatmap/package.json index 1b39de0e8f..2994ded1c2 100644 --- a/plugins/legacy-plugin-chart-heatmap/package.json +++ b/plugins/legacy-plugin-chart-heatmap/package.json @@ -28,17 +28,13 @@ "access": "public" }, "dependencies": { + "@superset-ui/chart": "^0.14.0", + "@superset-ui/chart-controls": "^0.14.0", + "@superset-ui/core": "^0.15.0", + "@superset-ui/validator": "^0.14.0", "d3": "^3.5.17", "d3-svg-legend": "^1.x", "d3-tip": "^0.9.1", "prop-types": "^15.6.2" - }, - "peerDependencies": { - "@superset-ui/chart": "^0.14.0", - "@superset-ui/chart-controls": "^0.14.0", - "@superset-ui/color": "^0.14.0", - "@superset-ui/number-format": "^0.14.0", - "@superset-ui/translation": "^0.14.0", - "@superset-ui/validator": "^0.14.0" } } diff --git a/plugins/legacy-plugin-chart-heatmap/src/Heatmap.js b/plugins/legacy-plugin-chart-heatmap/src/Heatmap.js index c07dea1b36..8164a49573 100644 --- a/plugins/legacy-plugin-chart-heatmap/src/Heatmap.js +++ b/plugins/legacy-plugin-chart-heatmap/src/Heatmap.js @@ -21,8 +21,7 @@ import d3 from 'd3'; import PropTypes from 'prop-types'; import 'd3-svg-legend'; import d3tip from 'd3-tip'; -import { getSequentialSchemeRegistry } from '@superset-ui/color'; -import { getNumberFormatter, NumberFormats } from '@superset-ui/number-format'; +import { getNumberFormatter, NumberFormats, getSequentialSchemeRegistry } from '@superset-ui/core'; import './vendor/d3tip.css'; import './Heatmap.css'; diff --git a/plugins/legacy-plugin-chart-heatmap/src/controlPanel.js b/plugins/legacy-plugin-chart-heatmap/src/controlPanel.js index 2007759b4b..55ddb8188f 100644 --- a/plugins/legacy-plugin-chart-heatmap/src/controlPanel.js +++ b/plugins/legacy-plugin-chart-heatmap/src/controlPanel.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { validateNonEmpty } from '@superset-ui/validator'; import { internalSharedControls, diff --git a/plugins/legacy-plugin-chart-heatmap/src/index.js b/plugins/legacy-plugin-chart-heatmap/src/index.js index cdf5bf77c1..6a40165750 100644 --- a/plugins/legacy-plugin-chart-heatmap/src/index.js +++ b/plugins/legacy-plugin-chart-heatmap/src/index.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from './transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/plugins/legacy-plugin-chart-heatmap/tsconfig.json b/plugins/legacy-plugin-chart-heatmap/tsconfig.json new file mode 100644 index 0000000000..f7612c330e --- /dev/null +++ b/plugins/legacy-plugin-chart-heatmap/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "declarationDir": "lib", + "outDir": "lib", + "rootDir": "src" + }, + "exclude": [ + "lib", + "test" + ], + "extends": "../../tsconfig.options.json", + "include": [ + "src/**/*", + "types/**/*", + "../../types/**/*" + ], + "references": [ + { + "path": "../../packages/superset-ui-chart" + }, + { + "path": "../../packages/superset-ui-chart-controls" + }, + { + "path": "../../packages/superset-ui-core" + }, + { + "path": "../../packages/superset-ui-validator" + } + ] +} \ No newline at end of file diff --git a/plugins/legacy-plugin-chart-histogram/package.json b/plugins/legacy-plugin-chart-histogram/package.json index de522d408b..a8296def16 100644 --- a/plugins/legacy-plugin-chart-histogram/package.json +++ b/plugins/legacy-plugin-chart-histogram/package.json @@ -30,18 +30,17 @@ "dependencies": { "@data-ui/histogram": "^0.0.84", "@data-ui/theme": "^0.0.84", + "@superset-ui/chart": "^0.14.0", + "@superset-ui/chart-controls": "^0.14.0", + "@superset-ui/core": "^0.15.0", + "@superset-ui/style": "^0.14.0", + "@superset-ui/validator": "^0.14.0", "@vx/legend": "^0.0.198", "@vx/responsive": "^0.0.197", "@vx/scale": "^0.0.197", "prop-types": "^15.6.2" }, "peerDependencies": { - "@superset-ui/chart": "^0.14.0", - "@superset-ui/chart-controls": "^0.14.0", - "@superset-ui/color": "^0.14.0", - "@superset-ui/style": "^0.14.0", - "@superset-ui/translation": "^0.14.0", - "@superset-ui/validator": "^0.14.0", "react": "^15 || ^16" } } diff --git a/plugins/legacy-plugin-chart-histogram/src/Histogram.jsx b/plugins/legacy-plugin-chart-histogram/src/Histogram.jsx index b277c3fa45..8675ed0d5b 100644 --- a/plugins/legacy-plugin-chart-histogram/src/Histogram.jsx +++ b/plugins/legacy-plugin-chart-histogram/src/Histogram.jsx @@ -24,7 +24,7 @@ import { chartTheme } from '@data-ui/theme'; import { LegendOrdinal } from '@vx/legend'; import { scaleOrdinal } from '@vx/scale'; import styled from '@superset-ui/style'; -import { CategoricalColorNamespace } from '@superset-ui/color'; +import { CategoricalColorNamespace } from '@superset-ui/core'; import WithLegend from './WithLegend'; const propTypes = { diff --git a/plugins/legacy-plugin-chart-histogram/src/controlPanel.js b/plugins/legacy-plugin-chart-histogram/src/controlPanel.js index f6b66d1fcb..c4316cb4bd 100644 --- a/plugins/legacy-plugin-chart-histogram/src/controlPanel.js +++ b/plugins/legacy-plugin-chart-histogram/src/controlPanel.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { validateNonEmpty } from '@superset-ui/validator'; import { formatSelectOptions, internalSharedControls } from '@superset-ui/chart-controls'; diff --git a/plugins/legacy-plugin-chart-histogram/src/index.js b/plugins/legacy-plugin-chart-histogram/src/index.js index 7a1b3c49b6..d050eb4314 100644 --- a/plugins/legacy-plugin-chart-histogram/src/index.js +++ b/plugins/legacy-plugin-chart-histogram/src/index.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from './transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/plugins/legacy-plugin-chart-histogram/tsconfig.json b/plugins/legacy-plugin-chart-histogram/tsconfig.json new file mode 100644 index 0000000000..712c31f4f2 --- /dev/null +++ b/plugins/legacy-plugin-chart-histogram/tsconfig.json @@ -0,0 +1,34 @@ +{ + "compilerOptions": { + "declarationDir": "lib", + "outDir": "lib", + "rootDir": "src" + }, + "exclude": [ + "lib", + "test" + ], + "extends": "../../tsconfig.options.json", + "include": [ + "src/**/*", + "types/**/*", + "../../types/**/*" + ], + "references": [ + { + "path": "../../packages/superset-ui-chart" + }, + { + "path": "../../packages/superset-ui-chart-controls" + }, + { + "path": "../../packages/superset-ui-core" + }, + { + "path": "../../packages/superset-ui-style" + }, + { + "path": "../../packages/superset-ui-validator" + } + ] +} \ No newline at end of file diff --git a/plugins/legacy-plugin-chart-horizon/package.json b/plugins/legacy-plugin-chart-horizon/package.json index 7049276449..470a3cc08d 100644 --- a/plugins/legacy-plugin-chart-horizon/package.json +++ b/plugins/legacy-plugin-chart-horizon/package.json @@ -28,14 +28,14 @@ "access": "public" }, "dependencies": { + "@superset-ui/chart": "^0.14.0", + "@superset-ui/chart-controls": "^0.14.0", + "@superset-ui/core": "^0.15.0", "d3-array": "^2.0.3", "d3-scale": "^3.0.1", "prop-types": "^15.6.2" }, "peerDependencies": { - "@superset-ui/chart": "^0.14.0", - "@superset-ui/chart-controls": "^0.14.0", - "@superset-ui/translation": "^0.14.0", "react": "^15 || ^16" } } diff --git a/plugins/legacy-plugin-chart-horizon/src/controlPanel.js b/plugins/legacy-plugin-chart-horizon/src/controlPanel.js index 361291254e..e0e22f959b 100644 --- a/plugins/legacy-plugin-chart-horizon/src/controlPanel.js +++ b/plugins/legacy-plugin-chart-horizon/src/controlPanel.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { formatSelectOptions } from '@superset-ui/chart-controls'; export default { diff --git a/plugins/legacy-plugin-chart-horizon/src/index.js b/plugins/legacy-plugin-chart-horizon/src/index.js index 51ab45b533..f692eb4399 100644 --- a/plugins/legacy-plugin-chart-horizon/src/index.js +++ b/plugins/legacy-plugin-chart-horizon/src/index.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from './transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/plugins/legacy-plugin-chart-horizon/tsconfig.json b/plugins/legacy-plugin-chart-horizon/tsconfig.json new file mode 100644 index 0000000000..2a99836c69 --- /dev/null +++ b/plugins/legacy-plugin-chart-horizon/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "declarationDir": "lib", + "outDir": "lib", + "rootDir": "src" + }, + "exclude": [ + "lib", + "test" + ], + "extends": "../../tsconfig.options.json", + "include": [ + "src/**/*", + "types/**/*", + "../../types/**/*" + ], + "references": [ + { + "path": "../../packages/superset-ui-chart" + }, + { + "path": "../../packages/superset-ui-chart-controls" + }, + { + "path": "../../packages/superset-ui-core" + } + ] +} \ No newline at end of file diff --git a/plugins/legacy-plugin-chart-map-box/package.json b/plugins/legacy-plugin-chart-map-box/package.json index d68e88f733..fcd033fd90 100644 --- a/plugins/legacy-plugin-chart-map-box/package.json +++ b/plugins/legacy-plugin-chart-map-box/package.json @@ -28,6 +28,9 @@ "access": "public" }, "dependencies": { + "@superset-ui/chart": "^0.14.0", + "@superset-ui/chart-controls": "^0.14.0", + "@superset-ui/core": "^0.15.0", "immutable": "^3.8.2", "mapbox-gl": "^0.53.0", "prop-types": "^15.6.2", @@ -36,9 +39,6 @@ "viewport-mercator-project": "^6.1.1" }, "peerDependencies": { - "@superset-ui/chart": "^0.14.0", - "@superset-ui/chart-controls": "^0.14.0", - "@superset-ui/translation": "^0.14.0", "react": "^15 || ^16" } } diff --git a/plugins/legacy-plugin-chart-map-box/src/controlPanel.js b/plugins/legacy-plugin-chart-map-box/src/controlPanel.js index e21c2244d2..c0209d9dcf 100644 --- a/plugins/legacy-plugin-chart-map-box/src/controlPanel.js +++ b/plugins/legacy-plugin-chart-map-box/src/controlPanel.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { formatSelectOptions, internalSharedControls } from '@superset-ui/chart-controls'; const { columnChoices } = internalSharedControls; diff --git a/plugins/legacy-plugin-chart-map-box/src/index.js b/plugins/legacy-plugin-chart-map-box/src/index.js index 631480797f..e795319439 100644 --- a/plugins/legacy-plugin-chart-map-box/src/index.js +++ b/plugins/legacy-plugin-chart-map-box/src/index.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import thumbnail from './images/thumbnail.png'; import controlPanel from './controlPanel'; diff --git a/plugins/legacy-plugin-chart-map-box/test/tsconfig.json b/plugins/legacy-plugin-chart-map-box/test/tsconfig.json new file mode 100644 index 0000000000..014c5465be --- /dev/null +++ b/plugins/legacy-plugin-chart-map-box/test/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "composite": false, + "emitDeclarationOnly": false, + "noEmit": true, + "rootDir": "." + }, + "extends": "../../../tsconfig.options.json", + "include": [ + "**/*", + "../types/**/*", + "../../../types/**/*" + ], + "references": [ + { + "path": ".." + } + ] +} \ No newline at end of file diff --git a/plugins/legacy-plugin-chart-map-box/tsconfig.json b/plugins/legacy-plugin-chart-map-box/tsconfig.json new file mode 100644 index 0000000000..2a99836c69 --- /dev/null +++ b/plugins/legacy-plugin-chart-map-box/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "declarationDir": "lib", + "outDir": "lib", + "rootDir": "src" + }, + "exclude": [ + "lib", + "test" + ], + "extends": "../../tsconfig.options.json", + "include": [ + "src/**/*", + "types/**/*", + "../../types/**/*" + ], + "references": [ + { + "path": "../../packages/superset-ui-chart" + }, + { + "path": "../../packages/superset-ui-chart-controls" + }, + { + "path": "../../packages/superset-ui-core" + } + ] +} \ No newline at end of file diff --git a/plugins/legacy-plugin-chart-paired-t-test/package.json b/plugins/legacy-plugin-chart-paired-t-test/package.json index 634f77b3b0..da7396d892 100644 --- a/plugins/legacy-plugin-chart-paired-t-test/package.json +++ b/plugins/legacy-plugin-chart-paired-t-test/package.json @@ -28,13 +28,13 @@ "access": "public" }, "dependencies": { + "@superset-ui/chart": "^0.14.0", + "@superset-ui/core": "^0.15.0", "distributions": "^1.0.0", "prop-types": "^15.6.2", "reactable-arc": "0.15.0" }, "peerDependencies": { - "@superset-ui/chart": "^0.14.0", - "@superset-ui/translation": "0.13.3", "react": "^15 || ^16" } } diff --git a/plugins/legacy-plugin-chart-paired-t-test/src/controlPanel.ts b/plugins/legacy-plugin-chart-paired-t-test/src/controlPanel.ts index 0740f50ad8..bd872a29a0 100644 --- a/plugins/legacy-plugin-chart-paired-t-test/src/controlPanel.ts +++ b/plugins/legacy-plugin-chart-paired-t-test/src/controlPanel.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; export default { controlPanelSections: [ diff --git a/plugins/legacy-plugin-chart-paired-t-test/src/index.js b/plugins/legacy-plugin-chart-paired-t-test/src/index.js index 7db8907785..73f6a4ab73 100644 --- a/plugins/legacy-plugin-chart-paired-t-test/src/index.js +++ b/plugins/legacy-plugin-chart-paired-t-test/src/index.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from './transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/plugins/legacy-plugin-chart-paired-t-test/tsconfig.json b/plugins/legacy-plugin-chart-paired-t-test/tsconfig.json new file mode 100644 index 0000000000..20c59c0ac2 --- /dev/null +++ b/plugins/legacy-plugin-chart-paired-t-test/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "declarationDir": "lib", + "outDir": "lib", + "rootDir": "src" + }, + "exclude": [ + "lib", + "test" + ], + "extends": "../../tsconfig.options.json", + "include": [ + "src/**/*", + "types/**/*", + "../../types/**/*" + ], + "references": [ + { + "path": "../../packages/superset-ui-chart" + }, + { + "path": "../../packages/superset-ui-core" + } + ] +} \ No newline at end of file diff --git a/plugins/legacy-plugin-chart-parallel-coordinates/package.json b/plugins/legacy-plugin-chart-parallel-coordinates/package.json index 4458ec63ee..2217ef071d 100644 --- a/plugins/legacy-plugin-chart-parallel-coordinates/package.json +++ b/plugins/legacy-plugin-chart-parallel-coordinates/package.json @@ -28,14 +28,13 @@ "access": "public" }, "dependencies": { + "@superset-ui/chart": "^0.14.0", + "@superset-ui/core": "^0.15.0", + "@superset-ui/style": "^0.14.3", "d3": "^3.5.17", "prop-types": "^15.7.2" }, "peerDependencies": { - "@superset-ui/chart": "^0.14.0", - "@superset-ui/color": "^0.14.0", - "@superset-ui/style": "^0.14.3", - "@superset-ui/translation": "0.13.3", "react": "^16.13.1" } } diff --git a/plugins/legacy-plugin-chart-parallel-coordinates/src/ParallelCoordinates.js b/plugins/legacy-plugin-chart-parallel-coordinates/src/ParallelCoordinates.js index 769d539ec4..55c3428d04 100644 --- a/plugins/legacy-plugin-chart-parallel-coordinates/src/ParallelCoordinates.js +++ b/plugins/legacy-plugin-chart-parallel-coordinates/src/ParallelCoordinates.js @@ -19,7 +19,7 @@ /* eslint-disable react/sort-prop-types */ import d3 from 'd3'; import PropTypes from 'prop-types'; -import { getSequentialSchemeRegistry } from '@superset-ui/color'; +import { getSequentialSchemeRegistry } from '@superset-ui/core'; import parcoords from './vendor/parcoords/d3.parcoords'; import divgrid from './vendor/parcoords/divgrid'; diff --git a/plugins/legacy-plugin-chart-parallel-coordinates/src/controlPanel.ts b/plugins/legacy-plugin-chart-parallel-coordinates/src/controlPanel.ts index 31526f8040..35935450c5 100644 --- a/plugins/legacy-plugin-chart-parallel-coordinates/src/controlPanel.ts +++ b/plugins/legacy-plugin-chart-parallel-coordinates/src/controlPanel.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; export default { controlPanelSections: [ diff --git a/plugins/legacy-plugin-chart-parallel-coordinates/src/index.js b/plugins/legacy-plugin-chart-parallel-coordinates/src/index.js index 36ac7c9d54..6bc58311ff 100644 --- a/plugins/legacy-plugin-chart-parallel-coordinates/src/index.js +++ b/plugins/legacy-plugin-chart-parallel-coordinates/src/index.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from './transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/plugins/legacy-plugin-chart-parallel-coordinates/tsconfig.json b/plugins/legacy-plugin-chart-parallel-coordinates/tsconfig.json new file mode 100644 index 0000000000..4e94c6627e --- /dev/null +++ b/plugins/legacy-plugin-chart-parallel-coordinates/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "declarationDir": "lib", + "outDir": "lib", + "rootDir": "src" + }, + "exclude": [ + "lib", + "test" + ], + "extends": "../../tsconfig.options.json", + "include": [ + "src/**/*", + "types/**/*", + "../../types/**/*" + ], + "references": [ + { + "path": "../../packages/superset-ui-chart" + }, + { + "path": "../../packages/superset-ui-core" + }, + { + "path": "../../packages/superset-ui-style" + } + ] +} \ No newline at end of file diff --git a/plugins/legacy-plugin-chart-partition/package.json b/plugins/legacy-plugin-chart-partition/package.json index 4631e2f35c..7bcd3b621f 100644 --- a/plugins/legacy-plugin-chart-partition/package.json +++ b/plugins/legacy-plugin-chart-partition/package.json @@ -28,18 +28,15 @@ "access": "public" }, "dependencies": { + "@superset-ui/chart": "^0.14.0", + "@superset-ui/chart-controls": "^0.14.0", + "@superset-ui/core": "^0.15.0", + "@superset-ui/validator": "^0.14.0", "d3": "^3.5.17", "d3-hierarchy": "^1.1.8", "prop-types": "^15.6.2" }, "peerDependencies": { - "@superset-ui/chart": "0.13.3", - "@superset-ui/chart-controls": "^0.14.0", - "@superset-ui/color": "^0.14.0", - "@superset-ui/number-format": "^0.14.0", - "@superset-ui/time-format": "^0.14.0", - "@superset-ui/translation": "^0.14.0", - "@superset-ui/validator": "^0.14.0", "react": "^16.13.1" } } diff --git a/plugins/legacy-plugin-chart-partition/src/Partition.js b/plugins/legacy-plugin-chart-partition/src/Partition.js index b6bc542a2d..d975c646cb 100644 --- a/plugins/legacy-plugin-chart-partition/src/Partition.js +++ b/plugins/legacy-plugin-chart-partition/src/Partition.js @@ -21,9 +21,7 @@ import d3 from 'd3'; import PropTypes from 'prop-types'; import { hierarchy } from 'd3-hierarchy'; -import { CategoricalColorNamespace } from '@superset-ui/color'; -import { getNumberFormatter } from '@superset-ui/number-format'; -import { getTimeFormatter } from '@superset-ui/time-format'; +import { getNumberFormatter, getTimeFormatter, CategoricalColorNamespace } from '@superset-ui/core'; import './Partition.css'; // Compute dx, dy, x, y for each node and diff --git a/plugins/legacy-plugin-chart-partition/src/controlPanel.jsx b/plugins/legacy-plugin-chart-partition/src/controlPanel.jsx index 13dbfba4c6..7d727782f0 100644 --- a/plugins/legacy-plugin-chart-partition/src/controlPanel.jsx +++ b/plugins/legacy-plugin-chart-partition/src/controlPanel.jsx @@ -17,7 +17,7 @@ * under the License. */ import React from 'react'; -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { validateNonEmpty } from '@superset-ui/validator'; import { formatSelectOptions, diff --git a/plugins/legacy-plugin-chart-partition/src/index.js b/plugins/legacy-plugin-chart-partition/src/index.js index c84ce5b0b9..245758c01d 100644 --- a/plugins/legacy-plugin-chart-partition/src/index.js +++ b/plugins/legacy-plugin-chart-partition/src/index.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from './transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/plugins/legacy-plugin-chart-partition/test/tsconfig.json b/plugins/legacy-plugin-chart-partition/test/tsconfig.json new file mode 100644 index 0000000000..014c5465be --- /dev/null +++ b/plugins/legacy-plugin-chart-partition/test/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "composite": false, + "emitDeclarationOnly": false, + "noEmit": true, + "rootDir": "." + }, + "extends": "../../../tsconfig.options.json", + "include": [ + "**/*", + "../types/**/*", + "../../../types/**/*" + ], + "references": [ + { + "path": ".." + } + ] +} \ No newline at end of file diff --git a/plugins/legacy-plugin-chart-partition/tsconfig.json b/plugins/legacy-plugin-chart-partition/tsconfig.json new file mode 100644 index 0000000000..f7612c330e --- /dev/null +++ b/plugins/legacy-plugin-chart-partition/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "declarationDir": "lib", + "outDir": "lib", + "rootDir": "src" + }, + "exclude": [ + "lib", + "test" + ], + "extends": "../../tsconfig.options.json", + "include": [ + "src/**/*", + "types/**/*", + "../../types/**/*" + ], + "references": [ + { + "path": "../../packages/superset-ui-chart" + }, + { + "path": "../../packages/superset-ui-chart-controls" + }, + { + "path": "../../packages/superset-ui-core" + }, + { + "path": "../../packages/superset-ui-validator" + } + ] +} \ No newline at end of file diff --git a/plugins/legacy-plugin-chart-pivot-table/package.json b/plugins/legacy-plugin-chart-pivot-table/package.json index 9883302180..142a3eb59a 100644 --- a/plugins/legacy-plugin-chart-pivot-table/package.json +++ b/plugins/legacy-plugin-chart-pivot-table/package.json @@ -28,15 +28,11 @@ "access": "public" }, "dependencies": { + "@superset-ui/chart": "^0.14.0", + "@superset-ui/chart-controls": "^0.14.3", + "@superset-ui/core": "^0.15.0", "d3": "^3.5.17", "datatables.net-bs": "^1.10.15", "prop-types": "^15.6.2" - }, - "peerDependencies": { - "@superset-ui/chart": "^0.14.0", - "@superset-ui/chart-controls": "^0.14.3", - "@superset-ui/number-format": "^0.14.0", - "@superset-ui/time-format": "^0.14.9", - "@superset-ui/translation": "^0.14.0" } } diff --git a/plugins/legacy-plugin-chart-pivot-table/src/PivotTable.js b/plugins/legacy-plugin-chart-pivot-table/src/PivotTable.js index ec0f92e4de..6d4e3922f5 100644 --- a/plugins/legacy-plugin-chart-pivot-table/src/PivotTable.js +++ b/plugins/legacy-plugin-chart-pivot-table/src/PivotTable.js @@ -19,12 +19,12 @@ /* eslint-disable react/sort-prop-types */ import dt from 'datatables.net-bs'; import PropTypes from 'prop-types'; -import { formatNumber } from '@superset-ui/number-format'; import { + formatNumber, getTimeFormatter, getTimeFormatterForGranularity, smartDateFormatter, -} from '@superset-ui/time-format'; +} from '@superset-ui/core'; import fixTableHeight from './utils/fixTableHeight'; import 'datatables.net-bs/css/dataTables.bootstrap.css'; diff --git a/plugins/legacy-plugin-chart-pivot-table/src/controlPanel.js b/plugins/legacy-plugin-chart-pivot-table/src/controlPanel.js index bb3f7d3a52..b9cf9c7e49 100644 --- a/plugins/legacy-plugin-chart-pivot-table/src/controlPanel.js +++ b/plugins/legacy-plugin-chart-pivot-table/src/controlPanel.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { D3_FORMAT_OPTIONS, D3_FORMAT_DOCS, diff --git a/plugins/legacy-plugin-chart-pivot-table/src/index.js b/plugins/legacy-plugin-chart-pivot-table/src/index.js index 001a940002..88417cf6e2 100644 --- a/plugins/legacy-plugin-chart-pivot-table/src/index.js +++ b/plugins/legacy-plugin-chart-pivot-table/src/index.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from './transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/plugins/legacy-plugin-chart-pivot-table/tsconfig.json b/plugins/legacy-plugin-chart-pivot-table/tsconfig.json new file mode 100644 index 0000000000..2a99836c69 --- /dev/null +++ b/plugins/legacy-plugin-chart-pivot-table/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "declarationDir": "lib", + "outDir": "lib", + "rootDir": "src" + }, + "exclude": [ + "lib", + "test" + ], + "extends": "../../tsconfig.options.json", + "include": [ + "src/**/*", + "types/**/*", + "../../types/**/*" + ], + "references": [ + { + "path": "../../packages/superset-ui-chart" + }, + { + "path": "../../packages/superset-ui-chart-controls" + }, + { + "path": "../../packages/superset-ui-core" + } + ] +} \ No newline at end of file diff --git a/plugins/legacy-plugin-chart-rose/package.json b/plugins/legacy-plugin-chart-rose/package.json index 50db1a0955..ed0b7adf45 100644 --- a/plugins/legacy-plugin-chart-rose/package.json +++ b/plugins/legacy-plugin-chart-rose/package.json @@ -35,10 +35,7 @@ "peerDependencies": { "@superset-ui/chart": "^0.14.0", "@superset-ui/chart-controls": "^0.14.0", - "@superset-ui/color": "^0.14.0", - "@superset-ui/number-format": "^0.14.0", - "@superset-ui/time-format": "^0.14.0", - "@superset-ui/translation": "^0.14.0", + "@superset-ui/core": "^0.15.0", "react": "^16.13.1" } } diff --git a/plugins/legacy-plugin-chart-rose/src/Rose.js b/plugins/legacy-plugin-chart-rose/src/Rose.js index eb97a0e605..b2f0516abf 100644 --- a/plugins/legacy-plugin-chart-rose/src/Rose.js +++ b/plugins/legacy-plugin-chart-rose/src/Rose.js @@ -22,9 +22,7 @@ import d3 from 'd3'; import PropTypes from 'prop-types'; import nv from 'nvd3'; -import { CategoricalColorNamespace } from '@superset-ui/color'; -import { getNumberFormatter } from '@superset-ui/number-format'; -import { getTimeFormatter } from '@superset-ui/time-format'; +import { getTimeFormatter, getNumberFormatter, CategoricalColorNamespace } from '@superset-ui/core'; import './Rose.css'; const propTypes = { diff --git a/plugins/legacy-plugin-chart-rose/src/controlPanel.jsx b/plugins/legacy-plugin-chart-rose/src/controlPanel.jsx index 8bf08f219c..59abadec66 100644 --- a/plugins/legacy-plugin-chart-rose/src/controlPanel.jsx +++ b/plugins/legacy-plugin-chart-rose/src/controlPanel.jsx @@ -17,7 +17,7 @@ * under the License. */ import React from 'react'; -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { D3_TIME_FORMAT_OPTIONS, D3_FORMAT_OPTIONS, diff --git a/plugins/legacy-plugin-chart-rose/src/index.js b/plugins/legacy-plugin-chart-rose/src/index.js index 1b6b7eb9d6..bb2627cfcf 100644 --- a/plugins/legacy-plugin-chart-rose/src/index.js +++ b/plugins/legacy-plugin-chart-rose/src/index.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from './transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/plugins/legacy-plugin-chart-rose/tsconfig.json b/plugins/legacy-plugin-chart-rose/tsconfig.json new file mode 100644 index 0000000000..2a99836c69 --- /dev/null +++ b/plugins/legacy-plugin-chart-rose/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "declarationDir": "lib", + "outDir": "lib", + "rootDir": "src" + }, + "exclude": [ + "lib", + "test" + ], + "extends": "../../tsconfig.options.json", + "include": [ + "src/**/*", + "types/**/*", + "../../types/**/*" + ], + "references": [ + { + "path": "../../packages/superset-ui-chart" + }, + { + "path": "../../packages/superset-ui-chart-controls" + }, + { + "path": "../../packages/superset-ui-core" + } + ] +} \ No newline at end of file diff --git a/plugins/legacy-plugin-chart-sankey-loop/package.json b/plugins/legacy-plugin-chart-sankey-loop/package.json index b6055e0742..e60d3e581e 100644 --- a/plugins/legacy-plugin-chart-sankey-loop/package.json +++ b/plugins/legacy-plugin-chart-sankey-loop/package.json @@ -28,14 +28,10 @@ "access": "public" }, "dependencies": { + "@superset-ui/chart": "^0.14.0", + "@superset-ui/core": "^0.15.0", "d3-sankey-diagram": "^0.7.3", "d3-selection": "^1.4.0", "prop-types": "^15.6.2" - }, - "peerDependencies": { - "@superset-ui/chart": "^0.14.0", - "@superset-ui/color": "^0.14.0", - "@superset-ui/number-format": "^0.14.0", - "@superset-ui/translation": "^0.14.0" } } diff --git a/plugins/legacy-plugin-chart-sankey-loop/src/SankeyLoop.js b/plugins/legacy-plugin-chart-sankey-loop/src/SankeyLoop.js index 4c85b9abb5..a7b8a1bada 100644 --- a/plugins/legacy-plugin-chart-sankey-loop/src/SankeyLoop.js +++ b/plugins/legacy-plugin-chart-sankey-loop/src/SankeyLoop.js @@ -20,8 +20,7 @@ import PropTypes from 'prop-types'; import { select } from 'd3-selection'; import { sankeyDiagram, sankey } from 'd3-sankey-diagram'; -import { CategoricalColorNamespace } from '@superset-ui/color'; -import { getNumberFormatter, NumberFormats } from '@superset-ui/number-format'; +import { getNumberFormatter, NumberFormats, CategoricalColorNamespace } from '@superset-ui/core'; import './SankeyLoop.css'; diff --git a/plugins/legacy-plugin-chart-sankey-loop/src/index.js b/plugins/legacy-plugin-chart-sankey-loop/src/index.js index d5acf40775..810ea35699 100644 --- a/plugins/legacy-plugin-chart-sankey-loop/src/index.js +++ b/plugins/legacy-plugin-chart-sankey-loop/src/index.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from './transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/plugins/legacy-plugin-chart-sankey-loop/tsconfig.json b/plugins/legacy-plugin-chart-sankey-loop/tsconfig.json new file mode 100644 index 0000000000..20c59c0ac2 --- /dev/null +++ b/plugins/legacy-plugin-chart-sankey-loop/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "declarationDir": "lib", + "outDir": "lib", + "rootDir": "src" + }, + "exclude": [ + "lib", + "test" + ], + "extends": "../../tsconfig.options.json", + "include": [ + "src/**/*", + "types/**/*", + "../../types/**/*" + ], + "references": [ + { + "path": "../../packages/superset-ui-chart" + }, + { + "path": "../../packages/superset-ui-core" + } + ] +} \ No newline at end of file diff --git a/plugins/legacy-plugin-chart-sankey/package.json b/plugins/legacy-plugin-chart-sankey/package.json index 8369d3e25e..cef6755546 100644 --- a/plugins/legacy-plugin-chart-sankey/package.json +++ b/plugins/legacy-plugin-chart-sankey/package.json @@ -28,16 +28,14 @@ "access": "public" }, "dependencies": { + "@superset-ui/chart": "^0.14.0", + "@superset-ui/core": "^0.15.0", + "@superset-ui/style": "^0.14.3", + "prop-types": "^15.6.2", "d3": "^3.5.17", "d3-sankey": "^0.4.2" }, "peerDependencies": { - "@superset-ui/chart": "^0.14.0", - "@superset-ui/color": "^0.14.0", - "@superset-ui/number-format": "^0.14.0", - "@superset-ui/style": "^0.14.3", - "@superset-ui/translation": "^0.14.0", - "prop-types": "^15.6.2", "react": "^16.13.1" } } diff --git a/plugins/legacy-plugin-chart-sankey/src/Sankey.js b/plugins/legacy-plugin-chart-sankey/src/Sankey.js index ef6531e46d..23cbd31b1c 100644 --- a/plugins/legacy-plugin-chart-sankey/src/Sankey.js +++ b/plugins/legacy-plugin-chart-sankey/src/Sankey.js @@ -21,8 +21,7 @@ import d3 from 'd3'; import PropTypes from 'prop-types'; import { sankey as d3Sankey } from 'd3-sankey'; -import { CategoricalColorNamespace } from '@superset-ui/color'; -import { getNumberFormatter, NumberFormats } from '@superset-ui/number-format'; +import { getNumberFormatter, NumberFormats, CategoricalColorNamespace } from '@superset-ui/core'; const propTypes = { data: PropTypes.arrayOf( diff --git a/plugins/legacy-plugin-chart-sankey/src/controlPanel.js b/plugins/legacy-plugin-chart-sankey/src/controlPanel.js index 7ac1a1aef8..7f6125becb 100644 --- a/plugins/legacy-plugin-chart-sankey/src/controlPanel.js +++ b/plugins/legacy-plugin-chart-sankey/src/controlPanel.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; export default { controlPanelSections: [ diff --git a/plugins/legacy-plugin-chart-sankey/src/index.js b/plugins/legacy-plugin-chart-sankey/src/index.js index 4ded433ee7..883fdf6725 100644 --- a/plugins/legacy-plugin-chart-sankey/src/index.js +++ b/plugins/legacy-plugin-chart-sankey/src/index.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from './transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/plugins/legacy-plugin-chart-sankey/tsconfig.json b/plugins/legacy-plugin-chart-sankey/tsconfig.json new file mode 100644 index 0000000000..4e94c6627e --- /dev/null +++ b/plugins/legacy-plugin-chart-sankey/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "declarationDir": "lib", + "outDir": "lib", + "rootDir": "src" + }, + "exclude": [ + "lib", + "test" + ], + "extends": "../../tsconfig.options.json", + "include": [ + "src/**/*", + "types/**/*", + "../../types/**/*" + ], + "references": [ + { + "path": "../../packages/superset-ui-chart" + }, + { + "path": "../../packages/superset-ui-core" + }, + { + "path": "../../packages/superset-ui-style" + } + ] +} \ No newline at end of file diff --git a/plugins/legacy-plugin-chart-sunburst/package.json b/plugins/legacy-plugin-chart-sunburst/package.json index 5c01373ac4..c8e841dbfc 100644 --- a/plugins/legacy-plugin-chart-sunburst/package.json +++ b/plugins/legacy-plugin-chart-sunburst/package.json @@ -28,14 +28,10 @@ "access": "public" }, "dependencies": { - "d3": "^3.5.17", - "prop-types": "^15.6.2" - }, - "peerDependencies": { "@superset-ui/chart": "^0.14.0", "@superset-ui/chart-controls": "^0.14.0", - "@superset-ui/color": "^0.14.0", - "@superset-ui/number-format": "^0.14.0", - "@superset-ui/translation": "^0.14.0" + "@superset-ui/core": "^0.15.0", + "d3": "^3.5.17", + "prop-types": "^15.6.2" } } diff --git a/plugins/legacy-plugin-chart-sunburst/src/Sunburst.js b/plugins/legacy-plugin-chart-sunburst/src/Sunburst.js index c21e8fe3ea..715e4724f4 100644 --- a/plugins/legacy-plugin-chart-sunburst/src/Sunburst.js +++ b/plugins/legacy-plugin-chart-sunburst/src/Sunburst.js @@ -19,8 +19,12 @@ /* eslint-disable no-param-reassign, react/sort-prop-types */ import d3 from 'd3'; import PropTypes from 'prop-types'; -import { CategoricalColorNamespace, getSequentialSchemeRegistry } from '@superset-ui/color'; -import { getNumberFormatter, NumberFormats } from '@superset-ui/number-format'; +import { + getNumberFormatter, + NumberFormats, + CategoricalColorNamespace, + getSequentialSchemeRegistry, +} from '@superset-ui/core'; import wrapSvgText from './utils/wrapSvgText'; import './Sunburst.css'; diff --git a/plugins/legacy-plugin-chart-sunburst/src/controlPanel.ts b/plugins/legacy-plugin-chart-sunburst/src/controlPanel.ts index ff68eefc73..7569f40818 100644 --- a/plugins/legacy-plugin-chart-sunburst/src/controlPanel.ts +++ b/plugins/legacy-plugin-chart-sunburst/src/controlPanel.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; export default { controlPanelSections: [ diff --git a/plugins/legacy-plugin-chart-sunburst/src/index.js b/plugins/legacy-plugin-chart-sunburst/src/index.js index 799bce6bca..07d987e6a1 100644 --- a/plugins/legacy-plugin-chart-sunburst/src/index.js +++ b/plugins/legacy-plugin-chart-sunburst/src/index.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from './transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/plugins/legacy-plugin-chart-sunburst/tsconfig.json b/plugins/legacy-plugin-chart-sunburst/tsconfig.json new file mode 100644 index 0000000000..2a99836c69 --- /dev/null +++ b/plugins/legacy-plugin-chart-sunburst/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "declarationDir": "lib", + "outDir": "lib", + "rootDir": "src" + }, + "exclude": [ + "lib", + "test" + ], + "extends": "../../tsconfig.options.json", + "include": [ + "src/**/*", + "types/**/*", + "../../types/**/*" + ], + "references": [ + { + "path": "../../packages/superset-ui-chart" + }, + { + "path": "../../packages/superset-ui-chart-controls" + }, + { + "path": "../../packages/superset-ui-core" + } + ] +} \ No newline at end of file diff --git a/plugins/legacy-plugin-chart-time-table/package.json b/plugins/legacy-plugin-chart-time-table/package.json index 8c993a502a..d29de513a0 100644 --- a/plugins/legacy-plugin-chart-time-table/package.json +++ b/plugins/legacy-plugin-chart-time-table/package.json @@ -29,6 +29,11 @@ }, "dependencies": { "@data-ui/sparkline": "^0.0.84", + "@superset-ui/chart": "^0.14.0", + "@superset-ui/chart-controls": "^0.14.3", + "@superset-ui/core": "^0.15.0", + "@superset-ui/style": "^0.14.0", + "@superset-ui/validator": "^0.14.0", "@types/d3-scale": "^2.0.2", "@types/react": "^16.9.43", "d3-scale": "^3.2.1", @@ -39,16 +44,6 @@ "reactable-arc": "^0.15.0" }, "peerDependencies": { - "@superset-ui/chart": "^0.14.0", - "@superset-ui/chart-controls": "^0.14.3", - "@superset-ui/color": "^0.14.0", - "@superset-ui/dimension": "^0.14.0", - "@superset-ui/number-format": "^0.14.1", - "@superset-ui/query": "^0.14.0", - "@superset-ui/style": "^0.14.0", - "@superset-ui/time-format": "^0.14.1", - "@superset-ui/translation": "^0.14.0", - "@superset-ui/validator": "^0.14.0", "react": "^16.3.1" } } diff --git a/plugins/legacy-plugin-chart-time-table/src/FormattedNumber.tsx b/plugins/legacy-plugin-chart-time-table/src/FormattedNumber.tsx index ac51c224d1..249aa28508 100644 --- a/plugins/legacy-plugin-chart-time-table/src/FormattedNumber.tsx +++ b/plugins/legacy-plugin-chart-time-table/src/FormattedNumber.tsx @@ -17,7 +17,7 @@ * under the License. */ import React from 'react'; -import { formatNumber } from '@superset-ui/number-format'; +import { formatNumber } from '@superset-ui/core'; interface Props { format: string; diff --git a/plugins/legacy-plugin-chart-time-table/src/SparklineCell.tsx b/plugins/legacy-plugin-chart-time-table/src/SparklineCell.tsx index 013e8c2698..769201c749 100644 --- a/plugins/legacy-plugin-chart-time-table/src/SparklineCell.tsx +++ b/plugins/legacy-plugin-chart-time-table/src/SparklineCell.tsx @@ -1,4 +1,3 @@ -/* eslint-disable react/forbid-prop-types */ /* eslint-disable class-methods-use-this */ /** * Licensed to the Apache Software Foundation (ASF) under one @@ -27,8 +26,7 @@ import { VerticalReferenceLine, WithTooltip, } from '@data-ui/sparkline'; -import { formatNumber } from '@superset-ui/number-format'; -import { getTextDimension } from '@superset-ui/dimension'; +import { getTextDimension, formatNumber } from '@superset-ui/core'; interface Props { ariaLabel: string; diff --git a/plugins/legacy-plugin-chart-time-table/src/TimeTable.tsx b/plugins/legacy-plugin-chart-time-table/src/TimeTable.tsx index 1e48df920d..bf4fd97f85 100644 --- a/plugins/legacy-plugin-chart-time-table/src/TimeTable.tsx +++ b/plugins/legacy-plugin-chart-time-table/src/TimeTable.tsx @@ -20,8 +20,7 @@ import React from 'react'; import Mustache from 'mustache'; import { scaleLinear } from 'd3-scale'; import { Table, Thead, Th, Tr, Td } from 'reactable-arc'; -import { formatNumber } from '@superset-ui/number-format'; -import { formatTime } from '@superset-ui/time-format'; +import { formatNumber, formatTime } from '@superset-ui/core'; import styled from '@superset-ui/style'; import moment from 'moment'; import { InfoTooltipWithTrigger, MetricOption, Metric } from '@superset-ui/chart-controls'; diff --git a/plugins/legacy-plugin-chart-time-table/src/TimeTableChartPlugin.ts b/plugins/legacy-plugin-chart-time-table/src/TimeTableChartPlugin.ts index 203f022f4a..d2b98144b4 100644 --- a/plugins/legacy-plugin-chart-time-table/src/TimeTableChartPlugin.ts +++ b/plugins/legacy-plugin-chart-time-table/src/TimeTableChartPlugin.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from './transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/plugins/legacy-plugin-chart-time-table/src/controlPanel.ts b/plugins/legacy-plugin-chart-time-table/src/controlPanel.ts index f4d159a646..badf077998 100644 --- a/plugins/legacy-plugin-chart-time-table/src/controlPanel.ts +++ b/plugins/legacy-plugin-chart-time-table/src/controlPanel.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { validateNonEmpty } from '@superset-ui/validator'; import { ControlPanelConfig } from '@superset-ui/chart-controls'; diff --git a/plugins/legacy-plugin-chart-time-table/src/index.ts b/plugins/legacy-plugin-chart-time-table/src/index.ts index 5ddbb1b752..4912f628b7 100644 --- a/plugins/legacy-plugin-chart-time-table/src/index.ts +++ b/plugins/legacy-plugin-chart-time-table/src/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from './transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/plugins/legacy-plugin-chart-time-table/src/transformProps.ts b/plugins/legacy-plugin-chart-time-table/src/transformProps.ts index 1f216c44be..abddcdfdbe 100644 --- a/plugins/legacy-plugin-chart-time-table/src/transformProps.ts +++ b/plugins/legacy-plugin-chart-time-table/src/transformProps.ts @@ -17,7 +17,7 @@ * under the License. */ import { ChartProps, DataRecord } from '@superset-ui/chart'; -import { QueryObjectMetric } from '@superset-ui/query'; +import { QueryObjectMetric } from '@superset-ui/core'; interface FormData { groupby: string[]; diff --git a/plugins/legacy-plugin-chart-time-table/tsconfig.json b/plugins/legacy-plugin-chart-time-table/tsconfig.json new file mode 100644 index 0000000000..712c31f4f2 --- /dev/null +++ b/plugins/legacy-plugin-chart-time-table/tsconfig.json @@ -0,0 +1,34 @@ +{ + "compilerOptions": { + "declarationDir": "lib", + "outDir": "lib", + "rootDir": "src" + }, + "exclude": [ + "lib", + "test" + ], + "extends": "../../tsconfig.options.json", + "include": [ + "src/**/*", + "types/**/*", + "../../types/**/*" + ], + "references": [ + { + "path": "../../packages/superset-ui-chart" + }, + { + "path": "../../packages/superset-ui-chart-controls" + }, + { + "path": "../../packages/superset-ui-core" + }, + { + "path": "../../packages/superset-ui-style" + }, + { + "path": "../../packages/superset-ui-validator" + } + ] +} \ No newline at end of file diff --git a/plugins/legacy-plugin-chart-time-table/types/external.d.ts b/plugins/legacy-plugin-chart-time-table/types/external.d.ts index 868020e3b5..fc8dbf45a9 100644 --- a/plugins/legacy-plugin-chart-time-table/types/external.d.ts +++ b/plugins/legacy-plugin-chart-time-table/types/external.d.ts @@ -1,4 +1,4 @@ declare module '*.png'; declare module '@data-ui/sparkline'; -declare module 'reactable-arc' +declare module 'reactable-arc'; declare module 'mustache'; diff --git a/plugins/legacy-plugin-chart-treemap/package.json b/plugins/legacy-plugin-chart-treemap/package.json index 9aed6ed82d..c36c250bc6 100644 --- a/plugins/legacy-plugin-chart-treemap/package.json +++ b/plugins/legacy-plugin-chart-treemap/package.json @@ -28,15 +28,11 @@ "access": "public" }, "dependencies": { + "@superset-ui/chart": "^0.14.0", + "@superset-ui/chart-controls": "^0.14.0", + "@superset-ui/core": "^0.15.0", "d3-hierarchy": "^1.1.8", "d3-selection": "^1.4.0", "prop-types": "^15.6.2" - }, - "peerDependencies": { - "@superset-ui/chart": "^0.14.0", - "@superset-ui/chart-controls": "^0.14.0", - "@superset-ui/color": "^0.14.0", - "@superset-ui/number-format": "^0.14.0", - "@superset-ui/translation": "^0.14.0" } } diff --git a/plugins/legacy-plugin-chart-treemap/src/Treemap.js b/plugins/legacy-plugin-chart-treemap/src/Treemap.js index 40f1d587ec..6d12838e76 100644 --- a/plugins/legacy-plugin-chart-treemap/src/Treemap.js +++ b/plugins/legacy-plugin-chart-treemap/src/Treemap.js @@ -21,8 +21,7 @@ import { select as d3Select, selectAll as d3SelectAll } from 'd3-selection'; import { treemap as d3Treemap, hierarchy as d3Hierarchy, treemapSquarify } from 'd3-hierarchy'; import PropTypes from 'prop-types'; -import { CategoricalColorNamespace } from '@superset-ui/color'; -import { getNumberFormatter } from '@superset-ui/number-format'; +import { getNumberFormatter, CategoricalColorNamespace } from '@superset-ui/core'; import './Treemap.css'; // Declare PropTypes for recursive data structures diff --git a/plugins/legacy-plugin-chart-treemap/src/controlPanel.js b/plugins/legacy-plugin-chart-treemap/src/controlPanel.js index a16ffddd3e..8b0dd392ea 100644 --- a/plugins/legacy-plugin-chart-treemap/src/controlPanel.js +++ b/plugins/legacy-plugin-chart-treemap/src/controlPanel.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { D3_FORMAT_OPTIONS, D3_FORMAT_DOCS } from '@superset-ui/chart-controls'; export default { diff --git a/plugins/legacy-plugin-chart-treemap/src/index.js b/plugins/legacy-plugin-chart-treemap/src/index.js index 2f881bbc97..74d68fb843 100644 --- a/plugins/legacy-plugin-chart-treemap/src/index.js +++ b/plugins/legacy-plugin-chart-treemap/src/index.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from './transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/plugins/legacy-plugin-chart-treemap/tsconfig.json b/plugins/legacy-plugin-chart-treemap/tsconfig.json new file mode 100644 index 0000000000..2a99836c69 --- /dev/null +++ b/plugins/legacy-plugin-chart-treemap/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "declarationDir": "lib", + "outDir": "lib", + "rootDir": "src" + }, + "exclude": [ + "lib", + "test" + ], + "extends": "../../tsconfig.options.json", + "include": [ + "src/**/*", + "types/**/*", + "../../types/**/*" + ], + "references": [ + { + "path": "../../packages/superset-ui-chart" + }, + { + "path": "../../packages/superset-ui-chart-controls" + }, + { + "path": "../../packages/superset-ui-core" + } + ] +} \ No newline at end of file diff --git a/plugins/legacy-plugin-chart-world-map/package.json b/plugins/legacy-plugin-chart-world-map/package.json index 446bdc67ac..f5e58ae511 100644 --- a/plugins/legacy-plugin-chart-world-map/package.json +++ b/plugins/legacy-plugin-chart-world-map/package.json @@ -28,6 +28,10 @@ "access": "public" }, "dependencies": { + "@superset-ui/chart": "^0.14.0", + "@superset-ui/chart-controls": "^0.14.0", + "@superset-ui/core": "^0.15.0", + "@superset-ui/style": "^0.14.3", "d3": "^3.5.17", "d3-array": "^2.4.0", "d3-color": "^1.4.1", @@ -35,12 +39,6 @@ "prop-types": "^15.6.2" }, "peerDependencies": { - "@superset-ui/chart": "^0.14.0", - "@superset-ui/chart-controls": "^0.14.0", - "@superset-ui/color": "^0.14.9", - "@superset-ui/number-format": "^0.14.0", - "@superset-ui/style": "^0.14.3", - "@superset-ui/translation": "^0.14.0", "react": "^16.13.1" } } diff --git a/plugins/legacy-plugin-chart-world-map/src/WorldMap.js b/plugins/legacy-plugin-chart-world-map/src/WorldMap.js index a980b8db9c..8db8950404 100644 --- a/plugins/legacy-plugin-chart-world-map/src/WorldMap.js +++ b/plugins/legacy-plugin-chart-world-map/src/WorldMap.js @@ -20,9 +20,8 @@ import d3 from 'd3'; import PropTypes from 'prop-types'; import { extent as d3Extent } from 'd3-array'; -import { getSequentialSchemeRegistry } from '@superset-ui/color'; +import { getNumberFormatter, getSequentialSchemeRegistry } from '@superset-ui/core'; import Datamap from 'datamaps/dist/datamaps.world.min'; -import { getNumberFormatter } from '@superset-ui/number-format'; const propTypes = { data: PropTypes.arrayOf( diff --git a/plugins/legacy-plugin-chart-world-map/src/controlPanel.js b/plugins/legacy-plugin-chart-world-map/src/controlPanel.js index 26606ef1ee..c009734ba2 100644 --- a/plugins/legacy-plugin-chart-world-map/src/controlPanel.js +++ b/plugins/legacy-plugin-chart-world-map/src/controlPanel.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { formatSelectOptions } from '@superset-ui/chart-controls'; export default { diff --git a/plugins/legacy-plugin-chart-world-map/src/index.js b/plugins/legacy-plugin-chart-world-map/src/index.js index bda51f8f94..bc0f160eda 100644 --- a/plugins/legacy-plugin-chart-world-map/src/index.js +++ b/plugins/legacy-plugin-chart-world-map/src/index.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from './transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/plugins/legacy-plugin-chart-world-map/tsconfig.json b/plugins/legacy-plugin-chart-world-map/tsconfig.json new file mode 100644 index 0000000000..73429d63b6 --- /dev/null +++ b/plugins/legacy-plugin-chart-world-map/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "declarationDir": "lib", + "outDir": "lib", + "rootDir": "src" + }, + "exclude": [ + "lib", + "test" + ], + "extends": "../../tsconfig.options.json", + "include": [ + "src/**/*", + "types/**/*", + "../../types/**/*" + ], + "references": [ + { + "path": "../../packages/superset-ui-chart" + }, + { + "path": "../../packages/superset-ui-chart-controls" + }, + { + "path": "../../packages/superset-ui-core" + }, + { + "path": "../../packages/superset-ui-style" + } + ] +} \ No newline at end of file diff --git a/plugins/legacy-preset-chart-big-number/package.json b/plugins/legacy-preset-chart-big-number/package.json index 1220da4f00..5286cebe18 100644 --- a/plugins/legacy-preset-chart-big-number/package.json +++ b/plugins/legacy-preset-chart-big-number/package.json @@ -29,21 +29,16 @@ }, "dependencies": { "@data-ui/xy-chart": "^0.0.84", + "@superset-ui/chart": "^0.14.0", + "@superset-ui/chart-controls": "^0.14.0", + "@superset-ui/core": "^0.15.0", + "@superset-ui/style": "^0.14.0", "@types/d3-color": "^1.2.2", "@types/shortid": "^0.0.29", "d3-color": "^1.2.3", "shortid": "^2.2.14" }, "peerDependencies": { - "@superset-ui/chart": "^0.14.0", - "@superset-ui/chart-controls": "^0.14.0", - "@superset-ui/color": "^0.14.0", - "@superset-ui/core": "^0.14.0", - "@superset-ui/dimension": "^0.14.0", - "@superset-ui/number-format": "^0.14.0", - "@superset-ui/style": "^0.14.0", - "@superset-ui/time-format": "^0.14.0", - "@superset-ui/translation": "^0.14.0", "react": "^15 || ^16" } } diff --git a/plugins/legacy-preset-chart-big-number/src/BigNumber/BigNumber.tsx b/plugins/legacy-preset-chart-big-number/src/BigNumber/BigNumber.tsx index 2d3676f8d2..756b998286 100644 --- a/plugins/legacy-preset-chart-big-number/src/BigNumber/BigNumber.tsx +++ b/plugins/legacy-preset-chart-big-number/src/BigNumber/BigNumber.tsx @@ -18,14 +18,18 @@ */ import React from 'react'; import shortid from 'shortid'; -import { t } from '@superset-ui/translation'; -import { getNumberFormatter, NumberFormatter } from '@superset-ui/number-format'; +import { + t, + getNumberFormatter, + NumberFormatter, + smartDateVerboseFormatter, + TimeFormatter, + computeMaxFontSize, + BRAND_COLOR, +} from '@superset-ui/core'; import { XYChart, AreaSeries, CrossHair, LinearGradient } from '@data-ui/xy-chart'; -import { BRAND_COLOR } from '@superset-ui/color'; -import { computeMaxFontSize } from '@superset-ui/dimension'; import styled from '@superset-ui/style'; -import { smartDateVerboseFormatter, TimeFormatter } from '@superset-ui/time-format'; const defaultNumberFormatter = getNumberFormatter(); diff --git a/plugins/legacy-preset-chart-big-number/src/BigNumber/controlPanel.tsx b/plugins/legacy-preset-chart-big-number/src/BigNumber/controlPanel.tsx index e44935edac..483d7e4e48 100644 --- a/plugins/legacy-preset-chart-big-number/src/BigNumber/controlPanel.tsx +++ b/plugins/legacy-preset-chart-big-number/src/BigNumber/controlPanel.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { formatSelectOptions, ControlPanelConfig } from '@superset-ui/chart-controls'; import React from 'react'; import { headerFontSize, subheaderFontSize } from '../sharedControls'; diff --git a/plugins/legacy-preset-chart-big-number/src/BigNumber/index.ts b/plugins/legacy-preset-chart-big-number/src/BigNumber/index.ts index 5a411f748a..80d2edeceb 100644 --- a/plugins/legacy-preset-chart-big-number/src/BigNumber/index.ts +++ b/plugins/legacy-preset-chart-big-number/src/BigNumber/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import controlPanel from './controlPanel'; import transformProps from './transformProps'; diff --git a/plugins/legacy-preset-chart-big-number/src/BigNumber/transformProps.ts b/plugins/legacy-preset-chart-big-number/src/BigNumber/transformProps.ts index d08a0984d7..45dba9dd60 100644 --- a/plugins/legacy-preset-chart-big-number/src/BigNumber/transformProps.ts +++ b/plugins/legacy-preset-chart-big-number/src/BigNumber/transformProps.ts @@ -17,9 +17,13 @@ * under the License. */ import * as color from 'd3-color'; -import { getNumberFormatter, NumberFormats } from '@superset-ui/number-format'; +import { + TimeGranularity, + getTimeFormatterForGranularity, + getNumberFormatter, + NumberFormats, +} from '@superset-ui/core'; import { ChartProps } from '@superset-ui/chart'; -import { TimeGranularity, getTimeFormatterForGranularity } from '@superset-ui/time-format'; const TIME_COLUMN = '__timestamp'; const formatPercentChange = getNumberFormatter(NumberFormats.PERCENT_SIGNED_1_POINT); diff --git a/plugins/legacy-preset-chart-big-number/src/BigNumberTotal/controlPanel.ts b/plugins/legacy-preset-chart-big-number/src/BigNumberTotal/controlPanel.ts index 4325940a3f..996497a3cd 100644 --- a/plugins/legacy-preset-chart-big-number/src/BigNumberTotal/controlPanel.ts +++ b/plugins/legacy-preset-chart-big-number/src/BigNumberTotal/controlPanel.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { headerFontSize, subheaderFontSize } from '../sharedControls'; export default { diff --git a/plugins/legacy-preset-chart-big-number/src/BigNumberTotal/index.ts b/plugins/legacy-preset-chart-big-number/src/BigNumberTotal/index.ts index 794728e2e9..33255147fa 100644 --- a/plugins/legacy-preset-chart-big-number/src/BigNumberTotal/index.ts +++ b/plugins/legacy-preset-chart-big-number/src/BigNumberTotal/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import controlPanel from './controlPanel'; import transformProps from '../BigNumber/transformProps'; diff --git a/plugins/legacy-preset-chart-big-number/src/sharedControls.ts b/plugins/legacy-preset-chart-big-number/src/sharedControls.ts index c7330066a4..de13c6c844 100644 --- a/plugins/legacy-preset-chart-big-number/src/sharedControls.ts +++ b/plugins/legacy-preset-chart-big-number/src/sharedControls.ts @@ -18,7 +18,7 @@ */ // These are control configurations that are shared ONLY within the BigNumber viz plugin repo. -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { CustomControlItem } from '@superset-ui/chart-controls'; export const headerFontSize: CustomControlItem = { diff --git a/plugins/legacy-preset-chart-big-number/test/transformProps.test.ts b/plugins/legacy-preset-chart-big-number/test/transformProps.test.ts index 13b234a550..76e54b5259 100644 --- a/plugins/legacy-preset-chart-big-number/test/transformProps.test.ts +++ b/plugins/legacy-preset-chart-big-number/test/transformProps.test.ts @@ -16,8 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { DatasourceType } from '@superset-ui/query'; -import { TimeGranularity } from '@superset-ui/time-format'; +import { DatasourceType, TimeGranularity } from '@superset-ui/core'; import transformProps, { BignumberChartProps, BigNumberDatum, diff --git a/plugins/legacy-preset-chart-big-number/test/tsconfig.json b/plugins/legacy-preset-chart-big-number/test/tsconfig.json new file mode 100644 index 0000000000..014c5465be --- /dev/null +++ b/plugins/legacy-preset-chart-big-number/test/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "composite": false, + "emitDeclarationOnly": false, + "noEmit": true, + "rootDir": "." + }, + "extends": "../../../tsconfig.options.json", + "include": [ + "**/*", + "../types/**/*", + "../../../types/**/*" + ], + "references": [ + { + "path": ".." + } + ] +} \ No newline at end of file diff --git a/plugins/legacy-preset-chart-big-number/tsconfig.json b/plugins/legacy-preset-chart-big-number/tsconfig.json new file mode 100644 index 0000000000..73429d63b6 --- /dev/null +++ b/plugins/legacy-preset-chart-big-number/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "declarationDir": "lib", + "outDir": "lib", + "rootDir": "src" + }, + "exclude": [ + "lib", + "test" + ], + "extends": "../../tsconfig.options.json", + "include": [ + "src/**/*", + "types/**/*", + "../../types/**/*" + ], + "references": [ + { + "path": "../../packages/superset-ui-chart" + }, + { + "path": "../../packages/superset-ui-chart-controls" + }, + { + "path": "../../packages/superset-ui-core" + }, + { + "path": "../../packages/superset-ui-style" + } + ] +} \ No newline at end of file diff --git a/plugins/legacy-preset-chart-nvd3/package.json b/plugins/legacy-preset-chart-nvd3/package.json index 305e162cfd..44e52fc607 100644 --- a/plugins/legacy-preset-chart-nvd3/package.json +++ b/plugins/legacy-preset-chart-nvd3/package.json @@ -29,6 +29,11 @@ }, "dependencies": { "@data-ui/xy-chart": "^0.0.84", + "@superset-ui/chart": "^0.14.0", + "@superset-ui/chart-controls": "^0.14.0", + "@superset-ui/core": "^0.15.0", + "@superset-ui/style": "^0.14.20", + "@superset-ui/validator": "^0.14.0", "d3": "^3.5.17", "d3-tip": "^0.9.1", "dompurify": "^2.0.6", @@ -41,16 +46,6 @@ "urijs": "^1.18.10" }, "peerDependencies": { - "@superset-ui/chart": "^0.14.9", - "@superset-ui/chart-controls": "^0.14.9", - "@superset-ui/color": "^0.14.9", - "@superset-ui/core": "^0.14.9", - "@superset-ui/dimension": "^0.14.9", - "@superset-ui/number-format": "^0.14.9", - "@superset-ui/style": "^0.14.9", - "@superset-ui/time-format": "^0.14.9", - "@superset-ui/translation": "^0.14.9", - "@superset-ui/validator": "^0.14.9", "react": "^15 || ^16" } } diff --git a/plugins/legacy-preset-chart-nvd3/src/Area/controlPanel.ts b/plugins/legacy-preset-chart-nvd3/src/Area/controlPanel.ts index 0a69342363..e3d29e0b71 100644 --- a/plugins/legacy-preset-chart-nvd3/src/Area/controlPanel.ts +++ b/plugins/legacy-preset-chart-nvd3/src/Area/controlPanel.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { sections } from '@superset-ui/chart-controls'; import { lineInterpolation, diff --git a/plugins/legacy-preset-chart-nvd3/src/Area/index.js b/plugins/legacy-preset-chart-nvd3/src/Area/index.js index e5aea6dfcf..557f85594a 100644 --- a/plugins/legacy-preset-chart-nvd3/src/Area/index.js +++ b/plugins/legacy-preset-chart-nvd3/src/Area/index.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from '../transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/plugins/legacy-preset-chart-nvd3/src/Bar/controlPanel.ts b/plugins/legacy-preset-chart-nvd3/src/Bar/controlPanel.ts index 9da36a6255..8790b427c1 100644 --- a/plugins/legacy-preset-chart-nvd3/src/Bar/controlPanel.ts +++ b/plugins/legacy-preset-chart-nvd3/src/Bar/controlPanel.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { sections } from '@superset-ui/chart-controls'; import { lineInterpolation, diff --git a/plugins/legacy-preset-chart-nvd3/src/Bar/index.js b/plugins/legacy-preset-chart-nvd3/src/Bar/index.js index 2c6fa62155..1d456a87ad 100644 --- a/plugins/legacy-preset-chart-nvd3/src/Bar/index.js +++ b/plugins/legacy-preset-chart-nvd3/src/Bar/index.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from '../transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/plugins/legacy-preset-chart-nvd3/src/BoxPlot/index.js b/plugins/legacy-preset-chart-nvd3/src/BoxPlot/index.js index 554c655e81..dddb7d0881 100644 --- a/plugins/legacy-preset-chart-nvd3/src/BoxPlot/index.js +++ b/plugins/legacy-preset-chart-nvd3/src/BoxPlot/index.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from '../transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/plugins/legacy-preset-chart-nvd3/src/Bubble/controlPanel.ts b/plugins/legacy-preset-chart-nvd3/src/Bubble/controlPanel.ts index 1d98ba8575..8a6a568918 100644 --- a/plugins/legacy-preset-chart-nvd3/src/Bubble/controlPanel.ts +++ b/plugins/legacy-preset-chart-nvd3/src/Bubble/controlPanel.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { D3_FORMAT_OPTIONS, formatSelectOptions } from '@superset-ui/chart-controls'; import { showLegend, diff --git a/plugins/legacy-preset-chart-nvd3/src/Bubble/index.js b/plugins/legacy-preset-chart-nvd3/src/Bubble/index.js index 451ef01b12..329034a4c3 100644 --- a/plugins/legacy-preset-chart-nvd3/src/Bubble/index.js +++ b/plugins/legacy-preset-chart-nvd3/src/Bubble/index.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from '../transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/plugins/legacy-preset-chart-nvd3/src/Bullet/controlPanel.ts b/plugins/legacy-preset-chart-nvd3/src/Bullet/controlPanel.ts index 437b1a8f44..a857242e2a 100644 --- a/plugins/legacy-preset-chart-nvd3/src/Bullet/controlPanel.ts +++ b/plugins/legacy-preset-chart-nvd3/src/Bullet/controlPanel.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; export default { controlPanelSections: [ diff --git a/plugins/legacy-preset-chart-nvd3/src/Bullet/index.js b/plugins/legacy-preset-chart-nvd3/src/Bullet/index.js index 75b95d9eec..edaf411e73 100644 --- a/plugins/legacy-preset-chart-nvd3/src/Bullet/index.js +++ b/plugins/legacy-preset-chart-nvd3/src/Bullet/index.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from '../transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/plugins/legacy-preset-chart-nvd3/src/Compare/controlPanel.ts b/plugins/legacy-preset-chart-nvd3/src/Compare/controlPanel.ts index 856de34fad..8a90e8355d 100644 --- a/plugins/legacy-preset-chart-nvd3/src/Compare/controlPanel.ts +++ b/plugins/legacy-preset-chart-nvd3/src/Compare/controlPanel.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { sections } from '@superset-ui/chart-controls'; import { xAxisLabel, diff --git a/plugins/legacy-preset-chart-nvd3/src/Compare/index.js b/plugins/legacy-preset-chart-nvd3/src/Compare/index.js index 762c6c5b4f..916cb41bcf 100644 --- a/plugins/legacy-preset-chart-nvd3/src/Compare/index.js +++ b/plugins/legacy-preset-chart-nvd3/src/Compare/index.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from '../transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/plugins/legacy-preset-chart-nvd3/src/DistBar/controlPanel.ts b/plugins/legacy-preset-chart-nvd3/src/DistBar/controlPanel.ts index 3877a078b3..d1a9c4d0a5 100644 --- a/plugins/legacy-preset-chart-nvd3/src/DistBar/controlPanel.ts +++ b/plugins/legacy-preset-chart-nvd3/src/DistBar/controlPanel.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { validateNonEmpty } from '@superset-ui/validator'; import { showLegend, diff --git a/plugins/legacy-preset-chart-nvd3/src/DistBar/index.js b/plugins/legacy-preset-chart-nvd3/src/DistBar/index.js index 21ce66b07e..38e8fa8def 100644 --- a/plugins/legacy-preset-chart-nvd3/src/DistBar/index.js +++ b/plugins/legacy-preset-chart-nvd3/src/DistBar/index.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from '../transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/plugins/legacy-preset-chart-nvd3/src/DualLine/controlPanel.ts b/plugins/legacy-preset-chart-nvd3/src/DualLine/controlPanel.ts index a8b1275e27..8bcd6ed3f8 100644 --- a/plugins/legacy-preset-chart-nvd3/src/DualLine/controlPanel.ts +++ b/plugins/legacy-preset-chart-nvd3/src/DualLine/controlPanel.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { sections } from '@superset-ui/chart-controls'; import { xAxisFormat, yAxis2Format } from '../NVD3Controls'; diff --git a/plugins/legacy-preset-chart-nvd3/src/DualLine/index.js b/plugins/legacy-preset-chart-nvd3/src/DualLine/index.js index 87eca3dd8f..64dd7e4e8c 100644 --- a/plugins/legacy-preset-chart-nvd3/src/DualLine/index.js +++ b/plugins/legacy-preset-chart-nvd3/src/DualLine/index.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from '../transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/plugins/legacy-preset-chart-nvd3/src/Line/controlPanel.ts b/plugins/legacy-preset-chart-nvd3/src/Line/controlPanel.ts index aecff4310b..6f8373ff12 100644 --- a/plugins/legacy-preset-chart-nvd3/src/Line/controlPanel.ts +++ b/plugins/legacy-preset-chart-nvd3/src/Line/controlPanel.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { sections } from '@superset-ui/chart-controls'; import { lineInterpolation, diff --git a/plugins/legacy-preset-chart-nvd3/src/Line/index.js b/plugins/legacy-preset-chart-nvd3/src/Line/index.js index 9d30c0cb60..4651c51627 100644 --- a/plugins/legacy-preset-chart-nvd3/src/Line/index.js +++ b/plugins/legacy-preset-chart-nvd3/src/Line/index.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from '../transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/plugins/legacy-preset-chart-nvd3/src/LineMulti/controlPanel.ts b/plugins/legacy-preset-chart-nvd3/src/LineMulti/controlPanel.ts index 2f0e576b02..b499216d2d 100644 --- a/plugins/legacy-preset-chart-nvd3/src/LineMulti/controlPanel.ts +++ b/plugins/legacy-preset-chart-nvd3/src/LineMulti/controlPanel.ts @@ -17,7 +17,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { validateNonEmpty } from '@superset-ui/validator'; import { sections } from '@superset-ui/chart-controls'; import { diff --git a/plugins/legacy-preset-chart-nvd3/src/LineMulti/index.js b/plugins/legacy-preset-chart-nvd3/src/LineMulti/index.js index c67347812f..e27b5c4e03 100644 --- a/plugins/legacy-preset-chart-nvd3/src/LineMulti/index.js +++ b/plugins/legacy-preset-chart-nvd3/src/LineMulti/index.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import thumbnail from './images/thumbnail.png'; import controlPanel from './controlPanel'; diff --git a/plugins/legacy-preset-chart-nvd3/src/NVD3Controls.tsx b/plugins/legacy-preset-chart-nvd3/src/NVD3Controls.tsx index 79d9f70053..17b2667f12 100644 --- a/plugins/legacy-preset-chart-nvd3/src/NVD3Controls.tsx +++ b/plugins/legacy-preset-chart-nvd3/src/NVD3Controls.tsx @@ -18,7 +18,7 @@ */ import React from 'react'; -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { formatSelectOptions, D3_TIME_FORMAT_OPTIONS, diff --git a/plugins/legacy-preset-chart-nvd3/src/NVD3Vis.js b/plugins/legacy-preset-chart-nvd3/src/NVD3Vis.js index 834b08dc5e..351d74bf45 100644 --- a/plugins/legacy-preset-chart-nvd3/src/NVD3Vis.js +++ b/plugins/legacy-preset-chart-nvd3/src/NVD3Vis.js @@ -23,12 +23,15 @@ import nv from 'nvd3-fork'; import mathjs from 'mathjs'; import moment from 'moment'; import PropTypes from 'prop-types'; -import { isDefined } from '@superset-ui/core'; -import { t } from '@superset-ui/translation'; -import { CategoricalColorNamespace } from '@superset-ui/color'; -import { getNumberFormatter, NumberFormats } from '@superset-ui/number-format'; -import { getTimeFormatter, smartDateVerboseFormatter } from '@superset-ui/time-format'; -import 'nvd3-fork/build/nv.d3.min.css'; +import { + isDefined, + t, + getTimeFormatter, + smartDateVerboseFormatter, + getNumberFormatter, + NumberFormats, + CategoricalColorNamespace, +} from '@superset-ui/core'; /* eslint-disable-next-line */ import ANNOTATION_TYPES, { applyNativeColumns } from './vendor/superset/AnnotationTypes'; import isTruthy from './utils/isTruthy'; diff --git a/plugins/legacy-preset-chart-nvd3/src/Pie/controlPanel.ts b/plugins/legacy-preset-chart-nvd3/src/Pie/controlPanel.ts index dc854ae73f..f814676fd6 100644 --- a/plugins/legacy-preset-chart-nvd3/src/Pie/controlPanel.ts +++ b/plugins/legacy-preset-chart-nvd3/src/Pie/controlPanel.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { D3_FORMAT_OPTIONS } from '@superset-ui/chart-controls'; import { showLegend } from '../NVD3Controls'; diff --git a/plugins/legacy-preset-chart-nvd3/src/Pie/index.js b/plugins/legacy-preset-chart-nvd3/src/Pie/index.js index 4837cefc2d..dd6c90e325 100644 --- a/plugins/legacy-preset-chart-nvd3/src/Pie/index.js +++ b/plugins/legacy-preset-chart-nvd3/src/Pie/index.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from '../transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/plugins/legacy-preset-chart-nvd3/src/TimePivot/controlPanel.ts b/plugins/legacy-preset-chart-nvd3/src/TimePivot/controlPanel.ts index 81ce95d07a..78f7960d3a 100644 --- a/plugins/legacy-preset-chart-nvd3/src/TimePivot/controlPanel.ts +++ b/plugins/legacy-preset-chart-nvd3/src/TimePivot/controlPanel.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { D3_FORMAT_OPTIONS } from '@superset-ui/chart-controls'; import { lineInterpolation, diff --git a/plugins/legacy-preset-chart-nvd3/src/TimePivot/index.js b/plugins/legacy-preset-chart-nvd3/src/TimePivot/index.js index 4994650689..b6b8286f6a 100644 --- a/plugins/legacy-preset-chart-nvd3/src/TimePivot/index.js +++ b/plugins/legacy-preset-chart-nvd3/src/TimePivot/index.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from '../transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/plugins/legacy-preset-chart-nvd3/src/utils.js b/plugins/legacy-preset-chart-nvd3/src/utils.js index c026d9924e..4da35fad8e 100644 --- a/plugins/legacy-preset-chart-nvd3/src/utils.js +++ b/plugins/legacy-preset-chart-nvd3/src/utils.js @@ -19,8 +19,7 @@ import d3 from 'd3'; import d3tip from 'd3-tip'; import dompurify from 'dompurify'; -import { getNumberFormatter } from '@superset-ui/number-format'; -import { smartDateFormatter } from '@superset-ui/time-format'; +import { smartDateFormatter, getNumberFormatter } from '@superset-ui/core'; // Regexp for the label added to time shifted series // (1 hour offset, 2 days offset, etc.) const TIME_SHIFT_PATTERN = /\d+ \w+ offset/; diff --git a/plugins/legacy-preset-chart-nvd3/test/tsconfig.json b/plugins/legacy-preset-chart-nvd3/test/tsconfig.json new file mode 100644 index 0000000000..014c5465be --- /dev/null +++ b/plugins/legacy-preset-chart-nvd3/test/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "composite": false, + "emitDeclarationOnly": false, + "noEmit": true, + "rootDir": "." + }, + "extends": "../../../tsconfig.options.json", + "include": [ + "**/*", + "../types/**/*", + "../../../types/**/*" + ], + "references": [ + { + "path": ".." + } + ] +} \ No newline at end of file diff --git a/plugins/legacy-preset-chart-nvd3/tsconfig.json b/plugins/legacy-preset-chart-nvd3/tsconfig.json new file mode 100644 index 0000000000..712c31f4f2 --- /dev/null +++ b/plugins/legacy-preset-chart-nvd3/tsconfig.json @@ -0,0 +1,34 @@ +{ + "compilerOptions": { + "declarationDir": "lib", + "outDir": "lib", + "rootDir": "src" + }, + "exclude": [ + "lib", + "test" + ], + "extends": "../../tsconfig.options.json", + "include": [ + "src/**/*", + "types/**/*", + "../../types/**/*" + ], + "references": [ + { + "path": "../../packages/superset-ui-chart" + }, + { + "path": "../../packages/superset-ui-chart-controls" + }, + { + "path": "../../packages/superset-ui-core" + }, + { + "path": "../../packages/superset-ui-style" + }, + { + "path": "../../packages/superset-ui-validator" + } + ] +} \ No newline at end of file diff --git a/plugins/plugin-chart-choropleth-map/package.json b/plugins/plugin-chart-choropleth-map/package.json index 6252e9a7ed..4923ee0fe3 100644 --- a/plugins/plugin-chart-choropleth-map/package.json +++ b/plugins/plugin-chart-choropleth-map/package.json @@ -27,6 +27,10 @@ "access": "public" }, "dependencies": { + "@superset-ui/chart": "^0.14.0", + "@superset-ui/chart-composition": "^0.14.0", + "@superset-ui/core": "^0.15.0", + "@superset-ui/style": "^0.14.0", "@types/d3-geo": "^1.11.1", "@types/geojson": "^7946.0.3", "@types/react": "^16.9.43", @@ -38,16 +42,12 @@ "@vx/tooltip": "^0.0.197", "@vx/zoom": "^0.0.197", "d3-geo": "^1.12.0", - "encodable": "^0.3.7", + "encodable": "^0.7.6", "geojson": "^0.5.0", "lodash": "^4.17.15", "topojson-client": "^3.1.0" }, "peerDependencies": { - "@superset-ui/chart": "^0.14.0", - "@superset-ui/chart-composition": "^0.14.0", - "@superset-ui/style": "^0.14.0", - "@superset-ui/translation": "^0.14.0", "react": "^16.13.1" } } diff --git a/plugins/plugin-chart-choropleth-map/src/chart/ChoroplethMap.tsx b/plugins/plugin-chart-choropleth-map/src/chart/ChoroplethMap.tsx index b1e42ff128..b2cfc53e80 100644 --- a/plugins/plugin-chart-choropleth-map/src/chart/ChoroplethMap.tsx +++ b/plugins/plugin-chart-choropleth-map/src/chart/ChoroplethMap.tsx @@ -17,7 +17,7 @@ * under the License. */ import React from 'react'; -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { Zoom } from '@vx/zoom'; import { localPoint } from '@vx/event'; import { RectClipPath } from '@vx/clip-path'; diff --git a/plugins/plugin-chart-choropleth-map/src/configureEncodable.ts b/plugins/plugin-chart-choropleth-map/src/configureEncodable.ts new file mode 100644 index 0000000000..dc9904430d --- /dev/null +++ b/plugins/plugin-chart-choropleth-map/src/configureEncodable.ts @@ -0,0 +1,49 @@ +import { + Encodable, + ColorSchemeResolver, + TimeFormatResolver, + CategoricalColorScaleResolver, + defaultColorSchemeResolver, + addPrefix, +} from 'encodable'; +import { + CategoricalColorNamespace, + getCategoricalSchemeRegistry, + getSequentialSchemeRegistry, + getNumberFormatter, + getTimeFormatter, + LOCAL_PREFIX, + getTimeFormatterRegistry, +} from '@superset-ui/core'; + +const timeFormat: TimeFormatResolver = ({ format, formatInLocalTime = false } = {}) => { + const formatString = formatInLocalTime + ? addPrefix(LOCAL_PREFIX, format ?? getTimeFormatterRegistry().getDefaultKey()!) + : format; + + return getTimeFormatter(formatString); +}; + +const colorSchemeResolver: ColorSchemeResolver = ({ name, type = 'categorical' } = {}) => { + if (type === 'sequential') { + const scheme = getSequentialSchemeRegistry().get(name); + + return typeof scheme === 'undefined' ? scheme : { type: 'sequential', ...scheme }; + } + if (type === 'categorical') { + const scheme = getCategoricalSchemeRegistry().get(name); + + return typeof scheme === 'undefined' ? scheme : { type: 'categorical', ...scheme }; + } + return defaultColorSchemeResolver({ name, type }); +}; + +const colorScaleResolver: CategoricalColorScaleResolver = ({ name, namespace } = {}) => + CategoricalColorNamespace.getScale(name, namespace); + +export default function configureEncodable() { + Encodable.setNumberFormatResolver(getNumberFormatter) + .setTimeFormatResolver(timeFormat) + .setColorSchemeResolver(colorSchemeResolver) + .setCategoricalColorScaleResolver(colorScaleResolver); +} diff --git a/plugins/plugin-chart-choropleth-map/src/index.ts b/plugins/plugin-chart-choropleth-map/src/index.ts index 637c5ce3da..25f2b992c5 100644 --- a/plugins/plugin-chart-choropleth-map/src/index.ts +++ b/plugins/plugin-chart-choropleth-map/src/index.ts @@ -1,2 +1,3 @@ export { default as ChoroplethMapChartPlugin } from './plugin'; export { maps, mapsLookup } from './maps'; +export { default as configureEncodable } from './configureEncodable'; diff --git a/plugins/plugin-chart-choropleth-map/src/plugin/index.ts b/plugins/plugin-chart-choropleth-map/src/plugin/index.ts index 7efa3dd427..399a60f971 100644 --- a/plugins/plugin-chart-choropleth-map/src/plugin/index.ts +++ b/plugins/plugin-chart-choropleth-map/src/plugin/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from './transformProps'; import thumbnail from '../images/thumbnail.png'; diff --git a/plugins/plugin-chart-choropleth-map/test/tsconfig.json b/plugins/plugin-chart-choropleth-map/test/tsconfig.json new file mode 100644 index 0000000000..014c5465be --- /dev/null +++ b/plugins/plugin-chart-choropleth-map/test/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "composite": false, + "emitDeclarationOnly": false, + "noEmit": true, + "rootDir": "." + }, + "extends": "../../../tsconfig.options.json", + "include": [ + "**/*", + "../types/**/*", + "../../../types/**/*" + ], + "references": [ + { + "path": ".." + } + ] +} \ No newline at end of file diff --git a/plugins/plugin-chart-choropleth-map/tsconfig.json b/plugins/plugin-chart-choropleth-map/tsconfig.json new file mode 100644 index 0000000000..bf9f402ac6 --- /dev/null +++ b/plugins/plugin-chart-choropleth-map/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "declarationDir": "lib", + "outDir": "lib", + "rootDir": "src" + }, + "exclude": [ + "lib", + "test" + ], + "extends": "../../tsconfig.options.json", + "include": [ + "src/**/*", + "types/**/*", + "../../types/**/*" + ], + "references": [ + { + "path": "../../packages/superset-ui-chart" + }, + { + "path": "../../packages/superset-ui-chart-composition" + }, + { + "path": "../../packages/superset-ui-core" + }, + { + "path": "../../packages/superset-ui-style" + } + ] +} \ No newline at end of file diff --git a/plugins/plugin-chart-choropleth-map/types/external.d.ts b/plugins/plugin-chart-choropleth-map/types/external.d.ts index 0935dbbd80..e2937d470e 100644 --- a/plugins/plugin-chart-choropleth-map/types/external.d.ts +++ b/plugins/plugin-chart-choropleth-map/types/external.d.ts @@ -1,4 +1 @@ -declare module '*.png' { - const value: any; - export default value; -} +declare module '*.png'; diff --git a/plugins/plugin-chart-table/package.json b/plugins/plugin-chart-table/package.json index 3fcbd1ded3..6027fa0d2e 100644 --- a/plugins/plugin-chart-table/package.json +++ b/plugins/plugin-chart-table/package.json @@ -27,6 +27,11 @@ }, "dependencies": { "@emotion/core": "^10.0.28", + "@superset-ui/chart": "^0.14.0", + "@superset-ui/chart-controls": "^0.14.0", + "@superset-ui/core": "^0.15.0", + "@superset-ui/style": "^0.14.0", + "@superset-ui/validator": "^0.14.0", "@types/d3-array": "^2.0.0", "@types/match-sorter": "^4.0.0", "@types/react": "^16.9.43", @@ -40,14 +45,6 @@ "xss": "^1.0.6" }, "peerDependencies": { - "@superset-ui/chart": "^0.14.0", - "@superset-ui/chart-controls": "^0.14.0", - "@superset-ui/number-format": "^0.14.0", - "@superset-ui/query": "^0.14.0", - "@superset-ui/style": "^0.14.0", - "@superset-ui/time-format": "^0.14.0", - "@superset-ui/translation": "^0.14.0", - "@superset-ui/validator": "^0.14.0", "react": "^16.13.1", "react-dom": "^16.13.1" } diff --git a/plugins/plugin-chart-table/src/TableChart.tsx b/plugins/plugin-chart-table/src/TableChart.tsx index 7077085a53..39a4625f3e 100644 --- a/plugins/plugin-chart-table/src/TableChart.tsx +++ b/plugins/plugin-chart-table/src/TableChart.tsx @@ -20,7 +20,7 @@ import React, { useState, useMemo, useCallback } from 'react'; import { ColumnInstance, DefaultSortTypes, ColumnWithLooseAccessor } from 'react-table'; import { extent as d3Extent, max as d3Max } from 'd3-array'; import { FaSort, FaSortUp as FaSortAsc, FaSortDown as FaSortDesc } from 'react-icons/fa'; -import { t, tn } from '@superset-ui/translation'; +import { t, tn } from '@superset-ui/core'; import { DataRecordValue, DataRecord } from '@superset-ui/chart'; import { TableChartTransformedProps, DataType, DataColumnMeta } from './types'; diff --git a/plugins/plugin-chart-table/src/controlPanel.tsx b/plugins/plugin-chart-table/src/controlPanel.tsx index e0a90c93df..7d983eacd0 100644 --- a/plugins/plugin-chart-table/src/controlPanel.tsx +++ b/plugins/plugin-chart-table/src/controlPanel.tsx @@ -18,7 +18,7 @@ * under the License. */ import React from 'react'; -import { t, addLocaleData } from '@superset-ui/translation'; +import { t, addLocaleData, smartDateFormatter } from '@superset-ui/core'; import { formatSelectOptions, D3_TIME_FORMAT_OPTIONS, @@ -30,7 +30,6 @@ import { sharedControls, } from '@superset-ui/chart-controls'; import { validateNonEmpty } from '@superset-ui/validator'; -import { smartDateFormatter } from '@superset-ui/time-format'; import i18n from './i18n'; addLocaleData(i18n); diff --git a/plugins/plugin-chart-table/src/i18n.ts b/plugins/plugin-chart-table/src/i18n.ts index 0fca5aa33a..2d12b11d11 100644 --- a/plugins/plugin-chart-table/src/i18n.ts +++ b/plugins/plugin-chart-table/src/i18n.ts @@ -1,4 +1,4 @@ -import { Locale } from '@superset-ui/translation'; +import { Locale } from '@superset-ui/core'; const en = { 'Query Mode': [''], diff --git a/plugins/plugin-chart-table/src/index.ts b/plugins/plugin-chart-table/src/index.ts index d6ccefbee6..ede1a8c7ba 100644 --- a/plugins/plugin-chart-table/src/index.ts +++ b/plugins/plugin-chart-table/src/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from './transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/plugins/plugin-chart-table/src/transformProps.ts b/plugins/plugin-chart-table/src/transformProps.ts index df7677f2fd..220f447892 100644 --- a/plugins/plugin-chart-table/src/transformProps.ts +++ b/plugins/plugin-chart-table/src/transformProps.ts @@ -18,14 +18,15 @@ */ import memoizeOne from 'memoize-one'; import { DataRecord } from '@superset-ui/chart'; -import { QueryFormDataMetric } from '@superset-ui/query'; -import { getNumberFormatter, NumberFormats } from '@superset-ui/number-format'; import { + QueryFormDataMetric, + getNumberFormatter, + NumberFormats, getTimeFormatter, smartDateFormatter, getTimeFormatterForGranularity, TimeFormatter, -} from '@superset-ui/time-format'; +} from '@superset-ui/core'; import isEqualArray from './utils/isEqualArray'; import DateWithFormatter from './utils/DateWithFormatter'; diff --git a/plugins/plugin-chart-table/src/types.ts b/plugins/plugin-chart-table/src/types.ts index ebeb349b70..8baeab0313 100644 --- a/plugins/plugin-chart-table/src/types.ts +++ b/plugins/plugin-chart-table/src/types.ts @@ -16,10 +16,13 @@ * specific language governing permissions and limitations * under the License. */ -import { QueryFormDataMetric } from '@superset-ui/query'; +import { + NumberFormatter, + TimeFormatter, + TimeGranularity, + QueryFormDataMetric, +} from '@superset-ui/core'; import { ChartProps, DataRecord, DataRecordValue, DataRecordFilters } from '@superset-ui/chart'; -import { TimeFormatter, TimeGranularity } from '@superset-ui/time-format'; -import { NumberFormatter } from '@superset-ui/number-format'; export enum DataType { Number = 'number', diff --git a/plugins/plugin-chart-table/src/utils/DateWithFormatter.ts b/plugins/plugin-chart-table/src/utils/DateWithFormatter.ts index b86d94696a..58fa8c6bc1 100644 --- a/plugins/plugin-chart-table/src/utils/DateWithFormatter.ts +++ b/plugins/plugin-chart-table/src/utils/DateWithFormatter.ts @@ -17,7 +17,7 @@ * under the License. */ import { DataRecordValue } from '@superset-ui/chart'; -import { TimeFormatFunction } from '@superset-ui/time-format'; +import { TimeFormatFunction } from '@superset-ui/core'; const REGEXP_TIMESTAMP_NO_TIMEZONE = /T(\d{2}:){2}\d{2}$/; diff --git a/plugins/plugin-chart-table/test/testData.ts b/plugins/plugin-chart-table/test/testData.ts index 2370682308..706f188ea5 100644 --- a/plugins/plugin-chart-table/test/testData.ts +++ b/plugins/plugin-chart-table/test/testData.ts @@ -17,7 +17,7 @@ * under the License. */ import { ChartProps } from '@superset-ui/chart'; -import { DatasourceType } from '@superset-ui/query'; +import { DatasourceType } from '@superset-ui/core'; const basicFormData = { alignPn: false, diff --git a/plugins/plugin-chart-table/test/tsconfig.json b/plugins/plugin-chart-table/test/tsconfig.json new file mode 100644 index 0000000000..014c5465be --- /dev/null +++ b/plugins/plugin-chart-table/test/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "composite": false, + "emitDeclarationOnly": false, + "noEmit": true, + "rootDir": "." + }, + "extends": "../../../tsconfig.options.json", + "include": [ + "**/*", + "../types/**/*", + "../../../types/**/*" + ], + "references": [ + { + "path": ".." + } + ] +} \ No newline at end of file diff --git a/plugins/plugin-chart-table/tsconfig.json b/plugins/plugin-chart-table/tsconfig.json new file mode 100644 index 0000000000..712c31f4f2 --- /dev/null +++ b/plugins/plugin-chart-table/tsconfig.json @@ -0,0 +1,34 @@ +{ + "compilerOptions": { + "declarationDir": "lib", + "outDir": "lib", + "rootDir": "src" + }, + "exclude": [ + "lib", + "test" + ], + "extends": "../../tsconfig.options.json", + "include": [ + "src/**/*", + "types/**/*", + "../../types/**/*" + ], + "references": [ + { + "path": "../../packages/superset-ui-chart" + }, + { + "path": "../../packages/superset-ui-chart-controls" + }, + { + "path": "../../packages/superset-ui-core" + }, + { + "path": "../../packages/superset-ui-style" + }, + { + "path": "../../packages/superset-ui-validator" + } + ] +} \ No newline at end of file diff --git a/plugins/plugin-chart-word-cloud/package.json b/plugins/plugin-chart-word-cloud/package.json index e139b9d9dc..25483a19a5 100644 --- a/plugins/plugin-chart-word-cloud/package.json +++ b/plugins/plugin-chart-word-cloud/package.json @@ -28,21 +28,19 @@ "access": "public" }, "dependencies": { + "@superset-ui/chart": "^0.14.0", + "@superset-ui/core": "^0.15.0", + "@superset-ui/style": "^0.14.0", + "@superset-ui/validator": "^0.14.0", "@types/d3-cloud": "^1.2.1", "@types/d3-scale": "^2.0.2", "@types/react": "^16.9.43", "d3-cloud": "^1.2.5", "d3-scale": "^3.0.1", "emotion-theming": "^10.0.27", - "encodable": "^0.3.7" + "encodable": "^0.7.6" }, "peerDependencies": { - "@superset-ui/chart": "^0.14.0", - "@superset-ui/color": "^0.14.0", - "@superset-ui/query": "^0.14.0", - "@superset-ui/style": "^0.14.0", - "@superset-ui/translation": "^0.14.0", - "@superset-ui/validator": "^0.14.0", "react": "^16.13.1" } } diff --git a/plugins/plugin-chart-word-cloud/src/configureEncodable.ts b/plugins/plugin-chart-word-cloud/src/configureEncodable.ts new file mode 100644 index 0000000000..dc9904430d --- /dev/null +++ b/plugins/plugin-chart-word-cloud/src/configureEncodable.ts @@ -0,0 +1,49 @@ +import { + Encodable, + ColorSchemeResolver, + TimeFormatResolver, + CategoricalColorScaleResolver, + defaultColorSchemeResolver, + addPrefix, +} from 'encodable'; +import { + CategoricalColorNamespace, + getCategoricalSchemeRegistry, + getSequentialSchemeRegistry, + getNumberFormatter, + getTimeFormatter, + LOCAL_PREFIX, + getTimeFormatterRegistry, +} from '@superset-ui/core'; + +const timeFormat: TimeFormatResolver = ({ format, formatInLocalTime = false } = {}) => { + const formatString = formatInLocalTime + ? addPrefix(LOCAL_PREFIX, format ?? getTimeFormatterRegistry().getDefaultKey()!) + : format; + + return getTimeFormatter(formatString); +}; + +const colorSchemeResolver: ColorSchemeResolver = ({ name, type = 'categorical' } = {}) => { + if (type === 'sequential') { + const scheme = getSequentialSchemeRegistry().get(name); + + return typeof scheme === 'undefined' ? scheme : { type: 'sequential', ...scheme }; + } + if (type === 'categorical') { + const scheme = getCategoricalSchemeRegistry().get(name); + + return typeof scheme === 'undefined' ? scheme : { type: 'categorical', ...scheme }; + } + return defaultColorSchemeResolver({ name, type }); +}; + +const colorScaleResolver: CategoricalColorScaleResolver = ({ name, namespace } = {}) => + CategoricalColorNamespace.getScale(name, namespace); + +export default function configureEncodable() { + Encodable.setNumberFormatResolver(getNumberFormatter) + .setTimeFormatResolver(timeFormat) + .setColorSchemeResolver(colorSchemeResolver) + .setCategoricalColorScaleResolver(colorScaleResolver); +} diff --git a/plugins/plugin-chart-word-cloud/src/index.ts b/plugins/plugin-chart-word-cloud/src/index.ts index 5fe4eb4f17..bf77bf8212 100644 --- a/plugins/plugin-chart-word-cloud/src/index.ts +++ b/plugins/plugin-chart-word-cloud/src/index.ts @@ -1,3 +1,4 @@ export { default as WordCloudChartPlugin } from './plugin'; export { default as LegacyWordCloudChartPlugin } from './legacyPlugin'; export * from './types'; +export { default as configureEncodable } from './configureEncodable'; diff --git a/plugins/plugin-chart-word-cloud/src/legacyPlugin/index.ts b/plugins/plugin-chart-word-cloud/src/legacyPlugin/index.ts index d8a66f0083..6b6b592c36 100644 --- a/plugins/plugin-chart-word-cloud/src/legacyPlugin/index.ts +++ b/plugins/plugin-chart-word-cloud/src/legacyPlugin/index.ts @@ -1,4 +1,4 @@ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from './transformProps'; import buildQuery from '../plugin/buildQuery'; diff --git a/plugins/plugin-chart-word-cloud/src/legacyPlugin/types.ts b/plugins/plugin-chart-word-cloud/src/legacyPlugin/types.ts index b7faf6a2f1..3704908862 100644 --- a/plugins/plugin-chart-word-cloud/src/legacyPlugin/types.ts +++ b/plugins/plugin-chart-word-cloud/src/legacyPlugin/types.ts @@ -1,4 +1,4 @@ -import { QueryFormData } from '@superset-ui/query'; +import { QueryFormData } from '@superset-ui/core'; import { RotationType } from '../chart/WordCloud'; export type LegacyWordCloudFormData = QueryFormData & { diff --git a/plugins/plugin-chart-word-cloud/src/plugin/buildQuery.ts b/plugins/plugin-chart-word-cloud/src/plugin/buildQuery.ts index 7e30a169c0..e0c06f7ff1 100644 --- a/plugins/plugin-chart-word-cloud/src/plugin/buildQuery.ts +++ b/plugins/plugin-chart-word-cloud/src/plugin/buildQuery.ts @@ -1,4 +1,4 @@ -import { buildQueryContext } from '@superset-ui/query'; +import { buildQueryContext } from '@superset-ui/core'; import { WordCloudFormData } from '../types'; export default function buildQuery(formData: WordCloudFormData) { diff --git a/plugins/plugin-chart-word-cloud/src/plugin/controlPanel.ts b/plugins/plugin-chart-word-cloud/src/plugin/controlPanel.ts index f7ae2885e5..bb4f10f4c0 100644 --- a/plugins/plugin-chart-word-cloud/src/plugin/controlPanel.ts +++ b/plugins/plugin-chart-word-cloud/src/plugin/controlPanel.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { validateNonEmpty } from '@superset-ui/validator'; export default { diff --git a/plugins/plugin-chart-word-cloud/src/plugin/index.ts b/plugins/plugin-chart-word-cloud/src/plugin/index.ts index 5fbed8b869..8b0e9b3805 100644 --- a/plugins/plugin-chart-word-cloud/src/plugin/index.ts +++ b/plugins/plugin-chart-word-cloud/src/plugin/index.ts @@ -1,4 +1,4 @@ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from '../legacyPlugin/transformProps'; import buildQuery from './buildQuery'; diff --git a/plugins/plugin-chart-word-cloud/src/types.ts b/plugins/plugin-chart-word-cloud/src/types.ts index 4ea7324267..35a061b274 100644 --- a/plugins/plugin-chart-word-cloud/src/types.ts +++ b/plugins/plugin-chart-word-cloud/src/types.ts @@ -1,4 +1,4 @@ -import { QueryFormData } from '@superset-ui/query'; +import { QueryFormData } from '@superset-ui/core'; import { WordCloudVisualProps } from './chart/WordCloud'; // FormData for wordcloud contains both common properties of all form data diff --git a/plugins/plugin-chart-word-cloud/test/tsconfig.json b/plugins/plugin-chart-word-cloud/test/tsconfig.json new file mode 100644 index 0000000000..014c5465be --- /dev/null +++ b/plugins/plugin-chart-word-cloud/test/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "composite": false, + "emitDeclarationOnly": false, + "noEmit": true, + "rootDir": "." + }, + "extends": "../../../tsconfig.options.json", + "include": [ + "**/*", + "../types/**/*", + "../../../types/**/*" + ], + "references": [ + { + "path": ".." + } + ] +} \ No newline at end of file diff --git a/plugins/plugin-chart-word-cloud/tsconfig.json b/plugins/plugin-chart-word-cloud/tsconfig.json new file mode 100644 index 0000000000..e83ace9563 --- /dev/null +++ b/plugins/plugin-chart-word-cloud/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "declarationDir": "lib", + "outDir": "lib", + "rootDir": "src" + }, + "exclude": [ + "lib", + "test" + ], + "extends": "../../tsconfig.options.json", + "include": [ + "src/**/*", + "types/**/*", + "../../types/**/*" + ], + "references": [ + { + "path": "../../packages/superset-ui-chart" + }, + { + "path": "../../packages/superset-ui-core" + }, + { + "path": "../../packages/superset-ui-style" + }, + { + "path": "../../packages/superset-ui-validator" + } + ] +} \ No newline at end of file diff --git a/plugins/preset-chart-xy/package.json b/plugins/preset-chart-xy/package.json index 6073a13da9..c0ac23abfe 100644 --- a/plugins/preset-chart-xy/package.json +++ b/plugins/preset-chart-xy/package.json @@ -29,27 +29,21 @@ "access": "public" }, "dependencies": { + "@superset-ui/chart": "^0.14.0", + "@superset-ui/chart-composition": "^0.14.0", + "@superset-ui/chart-controls": "^0.14.0", + "@superset-ui/core": "^0.15.0", "@data-ui/theme": "^0.0.84", "@data-ui/xy-chart": "^0.0.84", "@vx/axis": "^0.0.198", "@vx/legend": "^0.0.198", "@vx/scale": "^0.0.197", "csstype": "^2.6.3", - "encodable": "^0.3.4", + "encodable": "^0.7.6", "lodash": "^4.17.11", "reselect": "^4.0.0" }, "peerDependencies": { - "@superset-ui/chart": "^0.14.0", - "@superset-ui/chart-composition": "^0.14.0", - "@superset-ui/chart-controls": "^0.14.0", - "@superset-ui/color": "^0.14.0", - "@superset-ui/core": "^0.14.0", - "@superset-ui/dimension": "^0.14.0", - "@superset-ui/number-format": "^0.14.0", - "@superset-ui/query": "^0.14.0", - "@superset-ui/time-format": "^0.14.0", - "@superset-ui/translation": "^0.14.0", "react": "^16.2" } } diff --git a/plugins/preset-chart-xy/src/BoxPlot/controlPanel.ts b/plugins/preset-chart-xy/src/BoxPlot/controlPanel.ts index a76bd135d9..426ae50683 100644 --- a/plugins/preset-chart-xy/src/BoxPlot/controlPanel.ts +++ b/plugins/preset-chart-xy/src/BoxPlot/controlPanel.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { formatSelectOptions } from '@superset-ui/chart-controls'; export default { diff --git a/plugins/preset-chart-xy/src/BoxPlot/createMetadata.ts b/plugins/preset-chart-xy/src/BoxPlot/createMetadata.ts index 52fd28fc88..2682ec76a5 100644 --- a/plugins/preset-chart-xy/src/BoxPlot/createMetadata.ts +++ b/plugins/preset-chart-xy/src/BoxPlot/createMetadata.ts @@ -1,4 +1,4 @@ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata } from '@superset-ui/chart'; import thumbnail from './images/thumbnail.png'; diff --git a/plugins/preset-chart-xy/src/BoxPlot/legacy/transformProps.ts b/plugins/preset-chart-xy/src/BoxPlot/legacy/transformProps.ts index 5ed92e2445..0619323506 100644 --- a/plugins/preset-chart-xy/src/BoxPlot/legacy/transformProps.ts +++ b/plugins/preset-chart-xy/src/BoxPlot/legacy/transformProps.ts @@ -17,7 +17,7 @@ * under the License. */ import { ChartProps, QueryData } from '@superset-ui/chart'; -import { QueryFormData, QueryFormDataMetric } from '@superset-ui/query'; +import { QueryFormData, QueryFormDataMetric } from '@superset-ui/core'; import { RawBoxPlotDataRow, BoxPlotDataRow } from '../../components/BoxPlot/types'; export type LegacyBoxPlotFormData = { diff --git a/plugins/preset-chart-xy/src/Line/ChartFormData.ts b/plugins/preset-chart-xy/src/Line/ChartFormData.ts index a345bf2ddb..8a16404354 100644 --- a/plugins/preset-chart-xy/src/Line/ChartFormData.ts +++ b/plugins/preset-chart-xy/src/Line/ChartFormData.ts @@ -1,4 +1,4 @@ -import { QueryFormData } from '@superset-ui/query'; +import { QueryFormData } from '@superset-ui/core'; import { FormDataProps } from '../components/Line/Line'; type CombinedFormData = QueryFormData & FormDataProps; diff --git a/plugins/preset-chart-xy/src/Line/buildQuery.ts b/plugins/preset-chart-xy/src/Line/buildQuery.ts index ab8b1fe226..2ae2cf90da 100644 --- a/plugins/preset-chart-xy/src/Line/buildQuery.ts +++ b/plugins/preset-chart-xy/src/Line/buildQuery.ts @@ -1,4 +1,4 @@ -import { buildQueryContext } from '@superset-ui/query'; +import { buildQueryContext } from '@superset-ui/core'; import ChartFormData from './ChartFormData'; import { lineEncoderFactory } from '../components/Line/Encoder'; diff --git a/plugins/preset-chart-xy/src/Line/createMetadata.ts b/plugins/preset-chart-xy/src/Line/createMetadata.ts index 6eadf746eb..b3a3820e32 100644 --- a/plugins/preset-chart-xy/src/Line/createMetadata.ts +++ b/plugins/preset-chart-xy/src/Line/createMetadata.ts @@ -1,4 +1,4 @@ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata } from '@superset-ui/chart'; import thumbnail from './images/thumbnail.png'; diff --git a/plugins/preset-chart-xy/src/ScatterPlot/createMetadata.ts b/plugins/preset-chart-xy/src/ScatterPlot/createMetadata.ts index 29a7908026..c5ea618f07 100644 --- a/plugins/preset-chart-xy/src/ScatterPlot/createMetadata.ts +++ b/plugins/preset-chart-xy/src/ScatterPlot/createMetadata.ts @@ -1,4 +1,4 @@ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata } from '@superset-ui/chart'; import thumbnail from './images/thumbnail.png'; diff --git a/plugins/preset-chart-xy/src/components/BoxPlot/BoxPlot.tsx b/plugins/preset-chart-xy/src/components/BoxPlot/BoxPlot.tsx index 6af6fe2361..7de4a01dfb 100644 --- a/plugins/preset-chart-xy/src/components/BoxPlot/BoxPlot.tsx +++ b/plugins/preset-chart-xy/src/components/BoxPlot/BoxPlot.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { BoxPlotSeries, XYChart } from '@data-ui/xy-chart'; import { chartTheme, ChartTheme } from '@data-ui/theme'; -import { Margin, Dimension } from '@superset-ui/dimension'; +import { Margin, Dimension } from '@superset-ui/core'; import { WithLegend } from '@superset-ui/chart-composition'; import { Dataset, PlainObject, isFieldDef } from 'encodable'; import DefaultTooltipRenderer from './DefaultTooltipRenderer'; @@ -85,9 +85,9 @@ export default class BoxPlot extends React.PureComponent { )} theme={theme} - // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-explicit-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any xScale={convertScaleToDataUIScale(channels.x.definition.scale as any)} - // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-explicit-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any yScale={convertScaleToDataUIScale(channels.y.definition.scale as any)} > {layout.renderXAxis()} diff --git a/plugins/preset-chart-xy/src/components/Line/Encoder.ts b/plugins/preset-chart-xy/src/components/Line/Encoder.ts index 033d39cd7b..0f27fe2184 100644 --- a/plugins/preset-chart-xy/src/components/Line/Encoder.ts +++ b/plugins/preset-chart-xy/src/components/Line/Encoder.ts @@ -1,4 +1,6 @@ -import { createEncoderFactory, Encoder, DeriveEncoding, DeriveChannelOutputs } from 'encodable'; +import Encoder from 'encodable/lib/encoders/Encoder'; +import createEncoderFactory from 'encodable/lib/encoders/createEncoderFactory'; +import { DeriveEncoding, DeriveChannelOutputs } from 'encodable/lib/types/Encoding'; export type LineEncodingConfig = { x: ['X', number]; diff --git a/plugins/preset-chart-xy/src/components/Line/Line.tsx b/plugins/preset-chart-xy/src/components/Line/Line.tsx index eb5ef3c32e..aeeece15cb 100644 --- a/plugins/preset-chart-xy/src/components/Line/Line.tsx +++ b/plugins/preset-chart-xy/src/components/Line/Line.tsx @@ -9,7 +9,7 @@ import { WithTooltip, } from '@data-ui/xy-chart'; import { chartTheme } from '@data-ui/theme'; -import { Margin, Dimension } from '@superset-ui/dimension'; +import { Margin, Dimension } from '@superset-ui/core'; import { WithLegend } from '@superset-ui/chart-composition'; import { createSelector } from 'reselect'; import { Dataset, PlainObject } from 'encodable'; @@ -240,9 +240,9 @@ export default class LineChart extends PureComponent { renderTooltip={null} theme={theme} tooltipData={tooltipData} - // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-explicit-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any xScale={convertScaleToDataUIScale(channels.x.definition.scale as any)} - // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-explicit-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any yScale={convertScaleToDataUIScale(channels.y.definition.scale as any)} onMouseMove={onMouseMove} onMouseLeave={onMouseLeave} diff --git a/plugins/preset-chart-xy/src/components/ScatterPlot/ScatterPlot.tsx b/plugins/preset-chart-xy/src/components/ScatterPlot/ScatterPlot.tsx index ce7dfbee19..0734e7adfe 100644 --- a/plugins/preset-chart-xy/src/components/ScatterPlot/ScatterPlot.tsx +++ b/plugins/preset-chart-xy/src/components/ScatterPlot/ScatterPlot.tsx @@ -1,7 +1,7 @@ import React, { PureComponent } from 'react'; import { XYChart, PointSeries } from '@data-ui/xy-chart'; import { chartTheme, ChartTheme } from '@data-ui/theme'; -import { Margin, Dimension } from '@superset-ui/dimension'; +import { Margin, Dimension } from '@superset-ui/core'; import { WithLegend } from '@superset-ui/chart-composition'; import { isFieldDef, Dataset, PlainObject } from 'encodable'; @@ -87,9 +87,9 @@ export default class ScatterPlot extends PureComponent { )} theme={theme} - // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-explicit-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any xScale={convertScaleToDataUIScale(channels.x.definition.scale as any)} - // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-explicit-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any yScale={convertScaleToDataUIScale(channels.y.definition.scale as any)} > {layout.renderXAxis()} diff --git a/plugins/preset-chart-xy/src/configureEncodable.ts b/plugins/preset-chart-xy/src/configureEncodable.ts new file mode 100644 index 0000000000..dc9904430d --- /dev/null +++ b/plugins/preset-chart-xy/src/configureEncodable.ts @@ -0,0 +1,49 @@ +import { + Encodable, + ColorSchemeResolver, + TimeFormatResolver, + CategoricalColorScaleResolver, + defaultColorSchemeResolver, + addPrefix, +} from 'encodable'; +import { + CategoricalColorNamespace, + getCategoricalSchemeRegistry, + getSequentialSchemeRegistry, + getNumberFormatter, + getTimeFormatter, + LOCAL_PREFIX, + getTimeFormatterRegistry, +} from '@superset-ui/core'; + +const timeFormat: TimeFormatResolver = ({ format, formatInLocalTime = false } = {}) => { + const formatString = formatInLocalTime + ? addPrefix(LOCAL_PREFIX, format ?? getTimeFormatterRegistry().getDefaultKey()!) + : format; + + return getTimeFormatter(formatString); +}; + +const colorSchemeResolver: ColorSchemeResolver = ({ name, type = 'categorical' } = {}) => { + if (type === 'sequential') { + const scheme = getSequentialSchemeRegistry().get(name); + + return typeof scheme === 'undefined' ? scheme : { type: 'sequential', ...scheme }; + } + if (type === 'categorical') { + const scheme = getCategoricalSchemeRegistry().get(name); + + return typeof scheme === 'undefined' ? scheme : { type: 'categorical', ...scheme }; + } + return defaultColorSchemeResolver({ name, type }); +}; + +const colorScaleResolver: CategoricalColorScaleResolver = ({ name, namespace } = {}) => + CategoricalColorNamespace.getScale(name, namespace); + +export default function configureEncodable() { + Encodable.setNumberFormatResolver(getNumberFormatter) + .setTimeFormatResolver(timeFormat) + .setColorSchemeResolver(colorSchemeResolver) + .setCategoricalColorScaleResolver(colorScaleResolver); +} diff --git a/plugins/preset-chart-xy/src/index.ts b/plugins/preset-chart-xy/src/index.ts index d55cdcfa82..f3954ff96c 100644 --- a/plugins/preset-chart-xy/src/index.ts +++ b/plugins/preset-chart-xy/src/index.ts @@ -4,3 +4,4 @@ export { default as ScatterPlotChartPlugin } from './ScatterPlot'; export { default as LegacyScatterPlotChartPlugin } from './ScatterPlot/legacy'; export { default as LineChartPlugin } from './Line'; export { default as LegacyLineChartPlugin } from './Line/legacy'; +export { default as configureEncodable } from './configureEncodable'; diff --git a/plugins/preset-chart-xy/src/utils/XYChartLayout.tsx b/plugins/preset-chart-xy/src/utils/XYChartLayout.tsx index e852014910..45a6558997 100644 --- a/plugins/preset-chart-xy/src/utils/XYChartLayout.tsx +++ b/plugins/preset-chart-xy/src/utils/XYChartLayout.tsx @@ -1,6 +1,6 @@ import React, { ReactNode, CSSProperties } from 'react'; import { XAxis, YAxis } from '@data-ui/xy-chart'; -import { Margin, mergeMargin, Dimension } from '@superset-ui/dimension'; +import { Margin, mergeMargin, Dimension } from '@superset-ui/core'; import { ChartFrame } from '@superset-ui/chart-composition'; import { ChannelEncoder, PlainObject, Value, XFieldDef, YFieldDef } from 'encodable'; import createTickComponent from './createTickComponent'; diff --git a/plugins/preset-chart-xy/src/utils/computeAxisLayout.ts b/plugins/preset-chart-xy/src/utils/computeAxisLayout.ts index 39a0659998..00662e6e5a 100644 --- a/plugins/preset-chart-xy/src/utils/computeAxisLayout.ts +++ b/plugins/preset-chart-xy/src/utils/computeAxisLayout.ts @@ -1,5 +1,5 @@ import { CSSProperties } from 'react'; -import { getTextDimension, Margin, Dimension } from '@superset-ui/dimension'; +import { getTextDimension, Margin, Dimension } from '@superset-ui/core'; import { AxisOrient, ChannelDef, Value } from 'encodable'; import ChannelEncoderAxis from 'encodable/lib/encoders/ChannelEncoderAxis'; diff --git a/plugins/preset-chart-xy/src/utils/createMarginSelector.tsx b/plugins/preset-chart-xy/src/utils/createMarginSelector.tsx index 9a886d6c6a..ba8ef077c0 100644 --- a/plugins/preset-chart-xy/src/utils/createMarginSelector.tsx +++ b/plugins/preset-chart-xy/src/utils/createMarginSelector.tsx @@ -1,5 +1,5 @@ import { createSelector } from 'reselect'; -import { Margin } from '@superset-ui/dimension'; +import { Margin } from '@superset-ui/core'; export const DEFAULT_MARGIN = { bottom: 16, left: 16, right: 16, top: 16 }; diff --git a/plugins/preset-chart-xy/src/utils/createTickComponent.tsx b/plugins/preset-chart-xy/src/utils/createTickComponent.tsx index f18406ac02..841f404d18 100644 --- a/plugins/preset-chart-xy/src/utils/createTickComponent.tsx +++ b/plugins/preset-chart-xy/src/utils/createTickComponent.tsx @@ -1,5 +1,5 @@ import React, { CSSProperties } from 'react'; -import { Dimension } from '@superset-ui/dimension'; +import { Dimension } from '@superset-ui/core'; import { AxisLayout } from './computeAxisLayout'; export default function createTickComponent({ diff --git a/plugins/preset-chart-xy/test/tsconfig.json b/plugins/preset-chart-xy/test/tsconfig.json new file mode 100644 index 0000000000..014c5465be --- /dev/null +++ b/plugins/preset-chart-xy/test/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "composite": false, + "emitDeclarationOnly": false, + "noEmit": true, + "rootDir": "." + }, + "extends": "../../../tsconfig.options.json", + "include": [ + "**/*", + "../types/**/*", + "../../../types/**/*" + ], + "references": [ + { + "path": ".." + } + ] +} \ No newline at end of file diff --git a/plugins/preset-chart-xy/tsconfig.json b/plugins/preset-chart-xy/tsconfig.json new file mode 100644 index 0000000000..8f919b9df1 --- /dev/null +++ b/plugins/preset-chart-xy/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "declarationDir": "lib", + "outDir": "lib", + "rootDir": "src" + }, + "exclude": [ + "lib", + "test" + ], + "extends": "../../tsconfig.options.json", + "include": [ + "src/**/*", + "types/**/*", + "../../types/**/*" + ], + "references": [ + { + "path": "../../packages/superset-ui-chart" + }, + { + "path": "../../packages/superset-ui-chart-composition" + }, + { + "path": "../../packages/superset-ui-chart-controls" + }, + { + "path": "../../packages/superset-ui-core" + } + ] +} \ No newline at end of file diff --git a/plugins/preset-chart-xy/types/@data-ui/theme/index.d.ts b/plugins/preset-chart-xy/types/@data-ui/theme/index.d.ts index c222f857df..40262814cc 100644 --- a/plugins/preset-chart-xy/types/@data-ui/theme/index.d.ts +++ b/plugins/preset-chart-xy/types/@data-ui/theme/index.d.ts @@ -105,6 +105,5 @@ declare module '@data-ui/theme' { }; } - // eslint-disable-next-line import/prefer-default-export export const chartTheme: ChartTheme; } diff --git a/plugins/preset-chart-xy/types/@data-ui/xy-chart/index.d.ts b/plugins/preset-chart-xy/types/@data-ui/xy-chart/index.d.ts index 308a073857..339eb142e6 100644 --- a/plugins/preset-chart-xy/types/@data-ui/xy-chart/index.d.ts +++ b/plugins/preset-chart-xy/types/@data-ui/xy-chart/index.d.ts @@ -1,4 +1,3 @@ -/* eslint-disable react/no-multi-comp */ declare module '@data-ui/xy-chart' { import React from 'react'; diff --git a/scripts/build.js b/scripts/build.js index 981c595cdf..c545455bd3 100755 --- a/scripts/build.js +++ b/scripts/build.js @@ -2,43 +2,106 @@ /** * Build plugins specified by globs */ +process.env.PATH = `./node_modules/.bin:${process.env.PATH}`; + const rimraf = require('rimraf'); const { spawnSync } = require('child_process'); +const fastGlob = require('fast-glob'); +const { argv } = require('yargs') + .option('lint', { + describe: 'whether to run ESLint', + type: 'boolean', + // lint is slow, so not turning it on by default + default: false, + }) + .option('babel', { + describe: 'Whether to run Babel', + type: 'boolean', + default: true, + }) + .option('clean', { + describe: 'Whether to clean cache', + type: 'boolean', + default: true, + }) + .option('type', { + describe: 'Whether to run tsc', + type: 'boolean', + default: true, + }); -const glob = process.argv[2]; -const extraArgs = process.argv.slice(2); +const { + _: globs, + lint: shouldLint, + babel: shouldRunBabel, + clean: shouldCleanup, + type: shouldRunTyping, +} = argv; +const glob = globs.length > 1 ? `{${globs.join(',')}}` : globs[0] || '*'; -process.env.PATH = `./node_modules/.bin:${process.env.PATH}`; +const BABEL_CONFIG = '--config-file=../../babel.config.js'; + +// packages that do not need tsc +const META_PACKAGES = new Set(['demo', 'generator-superset']); -const run = cmd => { - // eslint-disable-next-line no-console - console.log(`>> ${cmd}`); +function run(cmd, options) { + console.log(`\n>> ${cmd}\n`); const [p, ...args] = cmd.split(' '); const runner = spawnSync; - const { status } = runner(p, args, { stdio: 'inherit' }); + const { status } = runner(p, args, { stdio: 'inherit', ...options }); if (status !== 0) { process.exit(status); } -}; - -const BABEL_CONFIG = '--config-file=../../babel.config.js'; +} -if (glob) { - // lint is slow, so not turning it on by default - if (extraArgs.includes('--lint')) { - run(`nimbus eslint {packages,plugins}/${glob}/{src,test}`); +function getPackages(pattern, tsOnly = false) { + if (pattern === '*' && !tsOnly) { + return `@superset-ui/!(${[...META_PACKAGES].join('|')})`; } - rimraf.sync( - `./{packages,plugins}/${glob}/{lib,esm,tsconfig.tsbuildinfo,node_modules/@types/react}`, - ); - const packageName = glob.replace(/^superset-ui-/, ''); - run(`nimbus babel --clean --workspaces="@superset-ui/${packageName}" ${BABEL_CONFIG}`); - run(`nimbus babel --clean --workspaces="@superset-ui/${packageName}" --esm ${BABEL_CONFIG}`); - run(`nimbus typescript --build --workspaces="@superset-ui/${packageName}"`); - // eslint-disable-next-line global-require - require('./copyAssets'); -} else { - run('yarn babel'); - run('yarn type'); - run('yarn build:assets'); + const packages = [ + ...new Set( + fastGlob + .sync([ + `./node_modules/@superset-ui/${pattern}/src/**/*.${ + tsOnly ? '{ts,tsx}' : '{ts,tsx,js,jsx}' + }`, + ]) + .map(x => x.split('/')[3]) + .filter(x => !META_PACKAGES.has(x)), + ), + ]; + if (packages.length === 0) { + throw new Error('No matching packages'); + } + return `@superset-ui/${packages.length > 1 ? `{${packages.join(',')}}` : packages[0]}`; +} + +let scope = getPackages(glob); + +if (shouldLint) { + run(`nimbus eslint {packages,plugins}/${scope}/{src,test}`); +} + +if (shouldCleanup) { + const cachePath = `./node_modules/${scope}/{lib,esm,tsconfig.tsbuildinfo,node_modules/@types/react}`; + console.log(`\n>> Cleaning up ${cachePath}`); + rimraf.sync(cachePath); +} + +if (shouldRunBabel) { + console.log('--- Run babel --------'); + const babelCommand = `lerna exec --stream --concurrency 10 --scope ${scope} + -- babel ${BABEL_CONFIG} src --extensions ".ts,.tsx,.js,.jsx" --copy-files`; + run(`${babelCommand} --out-dir lib`); + + console.log('--- Run babel esm ---'); + // run again with + run(`${babelCommand} --out-dir esm`, { env: { ...process.env, BABEL_OUTPUT: 'esm' } }); +} + +if (shouldRunTyping) { + // only run tsc for packages with ts files + scope = getPackages(glob, true); + run(`lerna exec --stream --concurrency 3 --scope ${scope} \ + -- ../../scripts/tsc.sh --build`); } diff --git a/scripts/tsc.sh b/scripts/tsc.sh new file mode 100755 index 0000000000..b4978ef8c6 --- /dev/null +++ b/scripts/tsc.sh @@ -0,0 +1,8 @@ +#!/bin/bash +startTime=$(node -e 'console.log(Date.now())') +tscExitCode=$(tsc "$@") +duration=$(node -e "console.log('%ss', (Date.now() - $startTime) / 1000)") + +if [ ! "$tscExitCode" ]; then + echo "compiled in ${duration}" +fi diff --git a/temporary-plugins/hold-potentially-deprecate/legacy-plugin-chart-table/package.json b/temporary-plugins/hold-potentially-deprecate/legacy-plugin-chart-table/package.json index 46c6acc8aa..44508c282d 100644 --- a/temporary-plugins/hold-potentially-deprecate/legacy-plugin-chart-table/package.json +++ b/temporary-plugins/hold-potentially-deprecate/legacy-plugin-chart-table/package.json @@ -28,20 +28,17 @@ "access": "public" }, "dependencies": { + "@superset-ui/chart": "^0.14.0", + "@superset-ui/chart-controls": "^0.14.0", + "@superset-ui/core": "^0.15.0", + "@superset-ui/style": "^0.14.0", + "@superset-ui/validator": "^0.14.0", "@types/datatables.net": "^1.10.18", "@types/react-dom": "^16.9.8", "datatables.net-bs": "^1.10.20", "xss": "^1.0.6" }, "peerDependencies": { - "@superset-ui/chart": "^0.14.0", - "@superset-ui/chart-controls": "^0.14.0", - "@superset-ui/number-format": "^0.14.0", - "@superset-ui/query": "^0.14.0", - "@superset-ui/style": "^0.14.0", - "@superset-ui/time-format": "^0.14.0", - "@superset-ui/translation": "^0.14.0", - "@superset-ui/validator": "^0.14.0", "jquery": "^3.4.1", "react": "^16.13.1", "react-dom": "^16.13.1" diff --git a/temporary-plugins/hold-potentially-deprecate/legacy-plugin-chart-table/src/ReactDataTable.tsx b/temporary-plugins/hold-potentially-deprecate/legacy-plugin-chart-table/src/ReactDataTable.tsx index fa3fc56d3e..0a2f8f5030 100644 --- a/temporary-plugins/hold-potentially-deprecate/legacy-plugin-chart-table/src/ReactDataTable.tsx +++ b/temporary-plugins/hold-potentially-deprecate/legacy-plugin-chart-table/src/ReactDataTable.tsx @@ -16,12 +16,12 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import React, { useEffect, createRef } from 'react'; import ReactDOMServer from 'react-dom/server'; -import { formatNumber, NumberFormats } from '@superset-ui/number-format'; +import { formatNumber, NumberFormats } from '@superset-ui/core'; import { DataRecordValue } from '@superset-ui/chart'; -import { getTimeFormatter } from '@superset-ui/time-format'; +import { getTimeFormatter } from '@superset-ui/core'; import { filterXSS } from 'xss'; // initialize datatables.net diff --git a/temporary-plugins/hold-potentially-deprecate/legacy-plugin-chart-table/src/controlPanel.tsx b/temporary-plugins/hold-potentially-deprecate/legacy-plugin-chart-table/src/controlPanel.tsx index a8296a4d3c..a91da0814d 100644 --- a/temporary-plugins/hold-potentially-deprecate/legacy-plugin-chart-table/src/controlPanel.tsx +++ b/temporary-plugins/hold-potentially-deprecate/legacy-plugin-chart-table/src/controlPanel.tsx @@ -18,7 +18,7 @@ * under the License. */ import React from 'react'; -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { formatSelectOptions, D3_TIME_FORMAT_OPTIONS, @@ -30,7 +30,7 @@ import { sharedControls, } from '@superset-ui/chart-controls'; import { validateNonEmpty } from '@superset-ui/validator'; -import { smartDateFormatter } from '@superset-ui/time-format'; +import { smartDateFormatter } from '@superset-ui/core'; export const PAGE_SIZE_OPTIONS = formatSelectOptions([[0, t('All')], 10, 20, 50, 100, 200]); diff --git a/temporary-plugins/hold-potentially-deprecate/legacy-plugin-chart-table/src/index.ts b/temporary-plugins/hold-potentially-deprecate/legacy-plugin-chart-table/src/index.ts index f8ce382608..15fe5bf916 100644 --- a/temporary-plugins/hold-potentially-deprecate/legacy-plugin-chart-table/src/index.ts +++ b/temporary-plugins/hold-potentially-deprecate/legacy-plugin-chart-table/src/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from './transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/temporary-plugins/hold-potentially-deprecate/legacy-plugin-chart-table/src/transformProps.ts b/temporary-plugins/hold-potentially-deprecate/legacy-plugin-chart-table/src/transformProps.ts index 3a8e9b9189..52756aca48 100644 --- a/temporary-plugins/hold-potentially-deprecate/legacy-plugin-chart-table/src/transformProps.ts +++ b/temporary-plugins/hold-potentially-deprecate/legacy-plugin-chart-table/src/transformProps.ts @@ -17,7 +17,7 @@ * under the License. */ import { ChartProps, DataRecord, DataRecordFilters } from '@superset-ui/chart'; -import { QueryFormDataMetric } from '@superset-ui/query'; +import { QueryFormDataMetric } from '@superset-ui/core'; interface DataColumnMeta { // `key` is what is called `label` in the input props diff --git a/temporary-plugins/hold-potentially-deprecate/legacy-plugin-chart-table/test/testData.ts b/temporary-plugins/hold-potentially-deprecate/legacy-plugin-chart-table/test/testData.ts index 719e76cfbe..1ee43f4391 100644 --- a/temporary-plugins/hold-potentially-deprecate/legacy-plugin-chart-table/test/testData.ts +++ b/temporary-plugins/hold-potentially-deprecate/legacy-plugin-chart-table/test/testData.ts @@ -17,7 +17,7 @@ * under the License. */ import { ChartProps } from '@superset-ui/chart'; -import { DatasourceType } from '@superset-ui/query'; +import { DatasourceType } from '@superset-ui/core'; import { TableChartProps } from '../src/transformProps'; const basicFormData = { diff --git a/temporary-plugins/hold-potentially-deprecate/superset-ui-legacy-plugin-chart-word-cloud/package.json b/temporary-plugins/hold-potentially-deprecate/superset-ui-legacy-plugin-chart-word-cloud/package.json index 3f0fcd84cb..85bf100630 100644 --- a/temporary-plugins/hold-potentially-deprecate/superset-ui-legacy-plugin-chart-word-cloud/package.json +++ b/temporary-plugins/hold-potentially-deprecate/superset-ui-legacy-plugin-chart-word-cloud/package.json @@ -28,13 +28,10 @@ "access": "public" }, "dependencies": { + "@superset-ui/chart": "^0.14.0", + "@superset-ui/core": "^0.15.0", "d3": "^3.5.17", "d3-cloud": "^1.2.1", "prop-types": "^15.6.2" - }, - "peerDependencies": { - "@superset-ui/chart": "^0.14.0", - "@superset-ui/color": "^0.14.0", - "@superset-ui/translation": "^0.14.0" } } diff --git a/temporary-plugins/hold-potentially-deprecate/superset-ui-legacy-plugin-chart-word-cloud/src/WordCloud.js b/temporary-plugins/hold-potentially-deprecate/superset-ui-legacy-plugin-chart-word-cloud/src/WordCloud.js index 64bf1e54f2..fdba9bb2f7 100644 --- a/temporary-plugins/hold-potentially-deprecate/superset-ui-legacy-plugin-chart-word-cloud/src/WordCloud.js +++ b/temporary-plugins/hold-potentially-deprecate/superset-ui-legacy-plugin-chart-word-cloud/src/WordCloud.js @@ -21,7 +21,7 @@ import d3 from 'd3'; import PropTypes from 'prop-types'; import cloudLayout from 'd3-cloud'; -import { CategoricalColorNamespace } from '@superset-ui/color'; +import { CategoricalColorNamespace } from '@superset-ui/core'; const ROTATION = { square: () => Math.floor(Math.random() * 2) * 90, diff --git a/temporary-plugins/hold-potentially-deprecate/superset-ui-legacy-plugin-chart-word-cloud/src/index.js b/temporary-plugins/hold-potentially-deprecate/superset-ui-legacy-plugin-chart-word-cloud/src/index.js index 875ee82a3a..c791ef9b42 100644 --- a/temporary-plugins/hold-potentially-deprecate/superset-ui-legacy-plugin-chart-word-cloud/src/index.js +++ b/temporary-plugins/hold-potentially-deprecate/superset-ui-legacy-plugin-chart-word-cloud/src/index.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata, ChartPlugin } from '@superset-ui/chart'; import transformProps from './transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/package.json b/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/package.json index 8b400929b0..213e610a3a 100644 --- a/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/package.json +++ b/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/package.json @@ -28,16 +28,13 @@ "dependencies": { "@airbnb/lunar": "^2.35.0", "@airbnb/lunar-icons": "^2.1.4", + "@superset-ui/chart": "^0.14.0", + "@superset-ui/core": "^0.15.0", "@types/dompurify": "^2.0.0", "dompurify": "^2.0.6", "reselect": "^4.0.0" }, "peerDependencies": { - "@superset-ui/chart": "^0.14.0", - "@superset-ui/number-format": "^0.14.0", - "@superset-ui/query": "^0.14.0", - "@superset-ui/time-format": "^0.14.0", - "@superset-ui/translation": "^0.14.0", "react": "^16.8.6" } } diff --git a/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/Table.tsx b/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/Table.tsx index 63d0f20d0e..1aa9fcdfae 100644 --- a/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/Table.tsx +++ b/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/Table.tsx @@ -10,8 +10,7 @@ import { GenericRow, } from '@airbnb/lunar/lib/components/DataTable/types'; import { createSelector } from 'reselect'; -import { TimeFormatter } from '@superset-ui/time-format'; -import { NumberFormatter } from '@superset-ui/number-format'; +import { NumberFormatter, TimeFormatter } from '@superset-ui/core'; import getRenderer, { ColumnType, Cell } from './getRenderer'; type Props = { diff --git a/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/TableFormData.ts b/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/TableFormData.ts index 2a65d7c9cc..1591b2d7c6 100644 --- a/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/TableFormData.ts +++ b/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/TableFormData.ts @@ -1,5 +1,5 @@ /* eslint-disable camelcase */ -import { QueryFormData, QueryFormDataMetric } from '@superset-ui/query'; +import { QueryFormData, QueryFormDataMetric } from '@superset-ui/core'; type TableFormData = QueryFormData & { all_columns: string[]; diff --git a/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/buildQuery.ts b/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/buildQuery.ts index f3b5daea70..ed3d18c8c8 100644 --- a/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/buildQuery.ts +++ b/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/buildQuery.ts @@ -3,7 +3,7 @@ import { convertMetric, QueryFormDataMetric, QueryObjectMetric, -} from '@superset-ui/query'; +} from '@superset-ui/core'; import TableFormData from './TableFormData'; export default function buildQuery(formData: TableFormData) { diff --git a/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/createMetadata.ts b/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/createMetadata.ts index 1adcd18c65..bef3e82c83 100644 --- a/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/createMetadata.ts +++ b/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/createMetadata.ts @@ -1,4 +1,4 @@ -import { t } from '@superset-ui/translation'; +import { t } from '@superset-ui/core'; import { ChartMetadata } from '@superset-ui/chart'; import thumbnail from './images/thumbnail.png'; diff --git a/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/getRenderer.tsx b/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/getRenderer.tsx index 04ef09198d..5c86af5dc1 100644 --- a/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/getRenderer.tsx +++ b/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/getRenderer.tsx @@ -3,8 +3,7 @@ import React, { CSSProperties, useMemo } from 'react'; import { HEIGHT_TO_PX } from '@airbnb/lunar/lib/components/DataTable/constants'; import { RendererProps } from '@airbnb/lunar/lib/components/DataTable/types'; -import { NumberFormatter } from '@superset-ui/number-format'; -import { TimeFormatter } from '@superset-ui/time-format'; +import { TimeFormatter, NumberFormatter } from '@superset-ui/core'; import HTMLRenderer from './components/HTMLRenderer'; const NEGATIVE_COLOR = '#FFA8A8'; diff --git a/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/processColumns.ts b/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/processColumns.ts index 63849bf43b..c2fada62d4 100644 --- a/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/processColumns.ts +++ b/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/processColumns.ts @@ -1,5 +1,10 @@ -import { getNumberFormatter, NumberFormats, NumberFormatter } from '@superset-ui/number-format'; -import { getTimeFormatter, TimeFormatter } from '@superset-ui/time-format'; +import { + getTimeFormatter, + TimeFormatter, + getNumberFormatter, + NumberFormats, + NumberFormatter, +} from '@superset-ui/core'; import { createSelector } from 'reselect'; import { PlainObject } from './types'; diff --git a/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/processData.ts b/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/processData.ts index 42f13211d1..a91ad5c60b 100644 --- a/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/processData.ts +++ b/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/processData.ts @@ -1,4 +1,4 @@ -import { QueryFormDataMetric, AdhocMetric } from '@superset-ui/query'; +import { QueryFormDataMetric, AdhocMetric } from '@superset-ui/core'; import { createSelector } from 'reselect'; import { PlainObject } from './types'; diff --git a/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/processMetrics.ts b/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/processMetrics.ts index 4172144d2b..3d0197003c 100644 --- a/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/processMetrics.ts +++ b/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/processMetrics.ts @@ -1,4 +1,4 @@ -import { QueryFormDataMetric, AdhocMetric } from '@superset-ui/query'; +import { QueryFormDataMetric, AdhocMetric } from '@superset-ui/core'; import { createSelector } from 'reselect'; import { PlainObject } from './types'; diff --git a/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/transformProps.ts b/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/transformProps.ts index 0eefac0e48..700794fa7e 100644 --- a/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/transformProps.ts +++ b/temporary-plugins/hold-potentially-deprecate/superset-ui-plugin-chart-table/src/transformProps.ts @@ -18,7 +18,7 @@ */ import { ChartProps } from '@superset-ui/chart'; -import { QueryFormDataMetric, AdhocMetric } from '@superset-ui/query'; +import { QueryFormDataMetric, AdhocMetric } from '@superset-ui/core'; import getProcessColumnsFunction from './processColumns'; import getProcessMetricsFunction from './processMetrics'; import getProcessDataFunction from './processData'; diff --git a/temporary-plugins/package.json b/temporary-plugins/package.json index 4f02240101..192ed86696 100644 --- a/temporary-plugins/package.json +++ b/temporary-plugins/package.json @@ -49,7 +49,6 @@ "@airbnb/config-typescript": "^2.2.2", "@airbnb/nimbus": "^2.2.3", "@superset-ui/commit-config": "^0.14.0", - "@superset-ui/superset-ui": "^0.14.0", "@types/enzyme": "^3.10.3", "@types/jest": "^25.1.3", "@types/jsdom": "^12.2.4", diff --git a/temporary-plugins/setupJest.js b/temporary-plugins/setupJest.js index 4483e0aff4..1cf590dc49 100644 --- a/temporary-plugins/setupJest.js +++ b/temporary-plugins/setupJest.js @@ -1,4 +1,4 @@ -import { configure as configureTranslation } from '@superset-ui/translation'; +import { configure as configureTranslation } from '@superset-ui/core'; import { configure as configureEnzyme } from 'enzyme'; import EnzymeReactAdapter from 'enzyme-adapter-react-16'; diff --git a/temporary-plugins/superset-ui-plugins-demo/package.json b/temporary-plugins/superset-ui-plugins-demo/package.json index 2f8aacd139..e08b929732 100644 --- a/temporary-plugins/superset-ui-plugins-demo/package.json +++ b/temporary-plugins/superset-ui-plugins-demo/package.json @@ -47,17 +47,11 @@ "devDependencies": { "@babel/core": "^7.4.3", "@babel/plugin-syntax-dynamic-import": "^7.2.0", + "@superset-ui/chart": "^0.14.0", + "@superset-ui/chart-composition": "^0.14.0", + "@superset-ui/core": "^0.15.0", "babel-loader": "^8.0.5", "gh-pages": "^2.0.1", "terser-webpack-plugin": "2.3.5" - }, - "peerDependencies": { - "@superset-ui/chart": "^0.14.0", - "@superset-ui/chart-composition": "^0.14.0", - "@superset-ui/color": "^0.14.0", - "@superset-ui/connection": "^0.14.0", - "@superset-ui/number-format": "^0.14.0", - "@superset-ui/time-format": "^0.14.0", - "@superset-ui/translation": "^0.14.0" } -} \ No newline at end of file +} diff --git a/temporary-plugins/superset-ui-plugins-demo/storybook/stories/index.js b/temporary-plugins/superset-ui-plugins-demo/storybook/stories/index.js deleted file mode 100644 index 93362ec482..0000000000 --- a/temporary-plugins/superset-ui-plugins-demo/storybook/stories/index.js +++ /dev/null @@ -1,71 +0,0 @@ -import '@babel/polyfill'; -import { setAddon, storiesOf } from '@storybook/react'; -import { withKnobs } from '@storybook/addon-knobs'; -import JSXAddon from 'storybook-addon-jsx'; -import categoricalD3 from '@superset-ui/color/esm/colorSchemes/categorical/d3'; -import sequentialCommon from '@superset-ui/color/esm/colorSchemes/sequential/common'; -import sequentialD3 from '@superset-ui/color/esm/colorSchemes/sequential/d3'; -import { configure } from '@superset-ui/translation'; -import { getCategoricalSchemeRegistry, getSequentialSchemeRegistry } from '@superset-ui/color'; -import { getTimeFormatterRegistry, smartDateFormatter } from '@superset-ui/time-format'; - -setAddon(JSXAddon); - -configure(); - -// Register color schemes -const categoricalSchemeRegistry = getCategoricalSchemeRegistry(); -[categoricalD3].forEach(group => { - group.forEach(scheme => { - categoricalSchemeRegistry.registerValue(scheme.id, scheme); - }); -}); -categoricalSchemeRegistry.setDefaultKey('d3Category10'); - -const sequentialSchemeRegistry = getSequentialSchemeRegistry(); -[sequentialCommon, sequentialD3].forEach(group => { - group.forEach(scheme => { - sequentialSchemeRegistry.registerValue(scheme.id, scheme); - }); -}); - -getTimeFormatterRegistry() - .registerValue('smart_date', smartDateFormatter) - .setDefaultKey('smart_date'); - -const EMPTY_EXAMPLES = [ - { - renderStory: () => 'Does your default export have an `examples` key?', - storyName: 'No examples found', - }, -]; - -/* - * Below we crawl the dir + subdirs looking for index files of stories - * Each index is expected to have a default export with examples key containing - * an array of examples. Each example should have the shape: - * { storyPath: string, storyName: string, renderStory: fn() => node } - * - */ -const requireContext = require.context('./', /* subdirs= */ true, /index\.(js|ts)x?$/); - -requireContext.keys().forEach(packageName => { - const packageExport = requireContext(packageName); - if (packageExport && packageExport.default && !Array.isArray(packageExport.default)) { - const { examples = EMPTY_EXAMPLES } = packageExport.default; - - examples.forEach(example => { - const { - storyPath = 'Missing story path', - storyName = 'Missing name', - renderStory = () => 'Missing `renderStory`', - options = {}, - } = example; - - storiesOf(storyPath, module) - .addParameters({ options }) - .addDecorator(withKnobs) - .addWithJSX(storyName, renderStory); - }); - } -}); diff --git a/temporary-plugins/superset-ui-plugins-demo/storybook/stories/plugin-chart-table/Stories.jsx b/temporary-plugins/superset-ui-plugins-demo/storybook/stories/plugin-chart-table/Stories.jsx deleted file mode 100644 index 32aa115319..0000000000 --- a/temporary-plugins/superset-ui-plugins-demo/storybook/stories/plugin-chart-table/Stories.jsx +++ /dev/null @@ -1,158 +0,0 @@ -/* eslint-disable no-magic-numbers */ -import React from 'react'; -import { SuperChart } from '@superset-ui/chart'; -import dataLegacy from './dataLegacy'; -import data from './data'; -import generateData from './generateData'; - -const dataset30Rows = { data: generateData(30) }; -const dataset1000Rows = { data: generateData(1000) }; - -export default [ - { - renderStory: () => ( - - ), - storyName: 'Legacy', - storyPath: 'plugin-chart-table|TableChartPlugin', - }, - { - renderStory: () => ( - - ), - storyName: 'Legacy-TableFilter', - storyPath: 'plugin-chart-table|TableChartPlugin', - }, - { - renderStory: () => ( - - ), - storyName: 'TableFilter', - storyPath: 'plugin-chart-table|TableChartPlugin', - }, - { - renderStory: () => ( - - ), - storyName: '30 rows 20 columns', - storyPath: 'plugin-chart-table|TableChartPlugin', - }, - { - renderStory: () => ( - - ), - storyName: '1000 rows 20 columns', - storyPath: 'plugin-chart-table|TableChartPlugin', - }, -]; diff --git a/temporary-plugins/superset-ui-plugins-demo/storybook/stories/plugin-chart-table/data.js b/temporary-plugins/superset-ui-plugins-demo/storybook/stories/plugin-chart-table/data.js deleted file mode 100644 index 7ae43e101a..0000000000 --- a/temporary-plugins/superset-ui-plugins-demo/storybook/stories/plugin-chart-table/data.js +++ /dev/null @@ -1,43 +0,0 @@ -/* eslint-disable sort-keys */ -export default [ - { - name: 'Michael', - sum__num: 2467063, - }, - { - name: 'Christopher', - sum__num: 1725265, - }, - { - name: 'David', - sum__num: 1570516, - }, - { - name: 'James', - sum__num: 1506025, - }, - { - name: 'john', - sum__num: 1426074, - }, - { - name: 'Matthew', - sum__num: 1355803, - }, - { - name: 'Robert', - sum__num: 1314800, - }, - { - name: 'Daniel', - sum__num: 1159354, - }, - { - name: 'Joseph', - sum__num: 1114098, - }, - { - name: 'William', - sum__num: 1113701, - }, -]; diff --git a/temporary-plugins/superset-ui-plugins-demo/storybook/stories/plugin-chart-table/dataLegacy.js b/temporary-plugins/superset-ui-plugins-demo/storybook/stories/plugin-chart-table/dataLegacy.js deleted file mode 100644 index 3e852e7302..0000000000 --- a/temporary-plugins/superset-ui-plugins-demo/storybook/stories/plugin-chart-table/dataLegacy.js +++ /dev/null @@ -1,76 +0,0 @@ -/* eslint-disable sort-keys */ -export default { - columns: ['name', 'sum__num', '%sum__num', 'trend', 'is_girl'], - records: [ - { - name: 'Michael', - sum__num: 2467063, - '%sum__num': 0.2, - trend: 0, - is_girl: false, - }, - { - name: 'Christopher', - sum__num: 1725265, - '%sum__num': 0.2, - trend: 17, - is_girl: true, - }, - { - name: 'David', - sum__num: 1570516, - '%sum__num': 0.15, - trend: 21, - is_girl: true, - }, - { - name: 'James', - sum__num: 1506025, - '%sum__num': 0.14, - trend: 1, - is_girl: true, - }, - { - name: 'john', - sum__num: 1426074, - '%sum__num': 0.12, - trend: -2, - is_girl: true, - }, - { - name: 'Matthew', - sum__num: 1355803, - '%sum__num': 0.1, - trend: -10, - is_girl: true, - }, - { - name: 'Robert', - sum__num: 1314800, - '%sum__num': 0.03, - trend: 24, - is_girl: true, - }, - { - name: 'Daniel', - sum__num: 1159354, - '%sum__num': 0.02, - trend: 25, - is_girl: true, - }, - { - name: 'Joseph', - sum__num: 1114098, - '%sum__num': 0.02, - trend: 10, - is_girl: false, - }, - { - name: 'William', - sum__num: 1113701, - '%sum__num': 0.02, - trend: 10, - is_girl: null, - }, - ], -}; diff --git a/temporary-plugins/superset-ui-plugins-demo/storybook/stories/plugin-chart-table/generateData.js b/temporary-plugins/superset-ui-plugins-demo/storybook/stories/plugin-chart-table/generateData.js deleted file mode 100644 index 65162439e3..0000000000 --- a/temporary-plugins/superset-ui-plugins-demo/storybook/stories/plugin-chart-table/generateData.js +++ /dev/null @@ -1,36 +0,0 @@ -/* eslint-disable no-unused-vars */ -/* eslint-disable no-magic-numbers */ -/* eslint-disable sort-keys */ - -const getHTML = () => { - const randomText = Array(Math.floor(Math.random() * 50)) - .fill('very') - .join('_'); - - return `Link Test with a ${randomText} long title`; -}; - -export default function generateData(rowCount = 30, columnCount = 20) { - const columns = Array(columnCount) - .fill(0) - .map((_, i) => `clm${i}`); - - return Array(rowCount) - .fill(0) - .map((_, index) => ({ - index: index + 1, - html: getHTML(), - ...columns.reduce( - (prev, key, i) => { - const obj = prev; - // eslint-disable-next-line no-restricted-properties - obj[key] = Math.round(Math.random() * Math.pow(10, columnCount - i)); - - return obj; - }, - { - ds: '2019-09-09', - }, - ), - })); -} diff --git a/temporary-plugins/superset-ui-plugins-demo/storybook/stories/plugin-chart-table/index.js b/temporary-plugins/superset-ui-plugins-demo/storybook/stories/plugin-chart-table/index.js deleted file mode 100644 index 2a5769070d..0000000000 --- a/temporary-plugins/superset-ui-plugins-demo/storybook/stories/plugin-chart-table/index.js +++ /dev/null @@ -1,10 +0,0 @@ -import TableChartPlugin from '../../../../superset-ui-plugin-chart-table/src'; -import TableChartPluginLegacy from '../../../../superset-ui-plugin-chart-table/src/legacy'; -import Stories from './Stories'; - -new TableChartPlugin().configure({ key: 'table2' }).register(); -new TableChartPluginLegacy().configure({ key: 'table2-legacy' }).register(); - -export default { - examples: [...Stories], -}; diff --git a/test/setup.ts b/test/setup.ts index c36712435c..dec1607ada 100644 --- a/test/setup.ts +++ b/test/setup.ts @@ -1,4 +1,4 @@ -import { configure } from '@superset-ui/translation'; +import { configure } from '@superset-ui/core'; configure(); diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json new file mode 100644 index 0000000000..007c8aaa16 --- /dev/null +++ b/tsconfig.eslint.json @@ -0,0 +1,12 @@ +{ + "extends": "./tsconfig.options.json", + "include": [ + "types/**/*", + "packages/*/src/**/*", + "packages/*/test/**/*", + "packages/*/types/**/*", + "plugins/*/src/**/*", + "plugins/*/test/**/*", + "plugins/*/types/**/*" + ] +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000000..ae98643561 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,144 @@ +{ + "files": [], + "references": [ + { + "path": "packages/superset-ui-chart" + }, + { + "path": "packages/superset-ui-chart/test" + }, + { + "path": "packages/superset-ui-chart-composition" + }, + { + "path": "packages/superset-ui-chart-composition/test" + }, + { + "path": "packages/superset-ui-chart-controls" + }, + { + "path": "packages/superset-ui-chart-controls/test" + }, + { + "path": "packages/superset-ui-core" + }, + { + "path": "packages/superset-ui-core/test" + }, + { + "path": "packages/superset-ui-style" + }, + { + "path": "packages/superset-ui-style/test" + }, + { + "path": "packages/superset-ui-validator" + }, + { + "path": "packages/superset-ui-validator/test" + }, + { + "path": "plugins/legacy-plugin-chart-calendar" + }, + { + "path": "plugins/legacy-plugin-chart-chord" + }, + { + "path": "plugins/legacy-plugin-chart-country-map" + }, + { + "path": "plugins/legacy-plugin-chart-event-flow" + }, + { + "path": "plugins/legacy-plugin-chart-force-directed" + }, + { + "path": "plugins/legacy-plugin-chart-heatmap" + }, + { + "path": "plugins/legacy-plugin-chart-histogram" + }, + { + "path": "plugins/legacy-plugin-chart-horizon" + }, + { + "path": "plugins/legacy-plugin-chart-map-box" + }, + { + "path": "plugins/legacy-plugin-chart-map-box/test" + }, + { + "path": "plugins/legacy-plugin-chart-paired-t-test" + }, + { + "path": "plugins/legacy-plugin-chart-parallel-coordinates" + }, + { + "path": "plugins/legacy-plugin-chart-partition" + }, + { + "path": "plugins/legacy-plugin-chart-partition/test" + }, + { + "path": "plugins/legacy-plugin-chart-pivot-table" + }, + { + "path": "plugins/legacy-plugin-chart-rose" + }, + { + "path": "plugins/legacy-plugin-chart-sankey" + }, + { + "path": "plugins/legacy-plugin-chart-sankey-loop" + }, + { + "path": "plugins/legacy-plugin-chart-sunburst" + }, + { + "path": "plugins/legacy-plugin-chart-time-table" + }, + { + "path": "plugins/legacy-plugin-chart-treemap" + }, + { + "path": "plugins/legacy-plugin-chart-world-map" + }, + { + "path": "plugins/legacy-preset-chart-big-number" + }, + { + "path": "plugins/legacy-preset-chart-big-number/test" + }, + { + "path": "plugins/legacy-preset-chart-nvd3" + }, + { + "path": "plugins/legacy-preset-chart-nvd3/test" + }, + { + "path": "plugins/plugin-chart-choropleth-map" + }, + { + "path": "plugins/plugin-chart-choropleth-map/test" + }, + { + "path": "plugins/plugin-chart-table" + }, + { + "path": "plugins/plugin-chart-table/test" + }, + { + "path": "plugins/plugin-chart-word-cloud" + }, + { + "path": "plugins/plugin-chart-word-cloud/test" + }, + { + "path": "plugins/preset-chart-xy" + }, + { + "path": "plugins/preset-chart-xy/test" + } + ], + "extends": "./tsconfig.options.json" +} \ No newline at end of file diff --git a/tsconfig.options.json b/tsconfig.options.json new file mode 100644 index 0000000000..a247b60834 --- /dev/null +++ b/tsconfig.options.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "allowSyntheticDefaultImports": true, + "declaration": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": false, + "jsx": "react", + "lib": [ + "dom", + "esnext" + ], + "module": "esnext", + "moduleResolution": "node", + "noEmitOnError": true, + "noImplicitReturns": true, + "noUnusedLocals": true, + "pretty": true, + "removeComments": false, + "strict": true, + "target": "es2015", + "useDefineForClassFields": false, + "composite": true, + "declarationMap": true, + "rootDir": "./src", + "emitDeclarationOnly": true, + "resolveJsonModule": true + } +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index fc17fe5825..e2f5188bee 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1746,6 +1746,37 @@ resolved "https://registry.yarnpkg.com/@emotion/weak-memoize/-/weak-memoize-0.2.5.tgz#8eed982e2ee6f7f4e44c253e12962980791efd46" integrity sha512-6U71C2Wp7r5XtFtQzYrW5iKFT67OixrSxjI4MptCHzdSVlgabczzqLe0ZSgnub/5Kp4hSbpDB1tMytZY9pwxxA== +"@encodable/color@^1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@encodable/color/-/color-1.0.4.tgz#44fbd96f65ea02041828cd27a855d5715c8105cb" + integrity sha512-WmB1Iqsa2zkj7cMBBKnGHtIdRH1BHNQZ/6j8LAmWrz9LVqsV2trbnVtThBGv//NPsLtzAFXwOCAlSUQLO9oQcQ== + dependencies: + "@encodable/registry" "^1.0.3" + "@types/d3-interpolate" "^1.3.1" + "@types/d3-scale" "^2.2.0" + "@types/d3-scale-chromatic" "^1.2.0" + d3-interpolate "^2.0.1" + d3-scale "^3.2.1" + d3-scale-chromatic "^1.5.0" + +"@encodable/format@^1.0.5": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@encodable/format/-/format-1.0.5.tgz#8278ad181129c139b9e54bb990369ac5f28b2e49" + integrity sha512-+JlQCoJ1DhuPdFesCBsxGLScC/b/irId1By2xZ5nzmNWkUxjjoRThPyN1EegOYHMiGSH+K9IVI/aaN3klrs0ow== + dependencies: + "@encodable/registry" "^1.0.3" + "@types/d3-format" "^1.3.1" + "@types/d3-time" "^1.0.10" + "@types/d3-time-format" "^2.1.1" + d3-format "^2.0.0" + d3-time "^2.0.0" + d3-time-format "^2.2.3" + +"@encodable/registry@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@encodable/registry/-/registry-1.0.3.tgz#0660939a88baf5f77c5e1594d7ba841b9e007248" + integrity sha512-YH2nSBZJKgbH/9MkQXzAEE9UwTaVcWiKgVFyEU/gvrfmNWqecYaHMTyObo+ADSTGF4kk0cZZkr7VqZgIQbvrUw== + "@evocateur/libnpmaccess@^3.1.2": version "3.1.2" resolved "https://registry.yarnpkg.com/@evocateur/libnpmaccess/-/libnpmaccess-3.1.2.tgz#ecf7f6ce6b004e9f942b098d92200be4a4b1c845" @@ -3582,15 +3613,6 @@ conventional-changelog-cli "^2.0.12" cz-conventional-changelog "^2.1.0" -"@superset-ui/legacy-plugin-chart-word-cloud@^0.11.15": - version "0.11.15" - resolved "https://registry.yarnpkg.com/@superset-ui/legacy-plugin-chart-word-cloud/-/legacy-plugin-chart-word-cloud-0.11.15.tgz#70a146aaf3cf1977c29086c069f0216325f092b2" - integrity sha512-DG0iGtZk20wAJuKURNk5U6VX+JxxkC07p5R/pEMr95nLyS6JTEOd/y953tzZu43GO3JcuTYnbartLu6D+jTxVw== - dependencies: - d3 "^3.5.17" - d3-cloud "^1.2.1" - prop-types "^15.6.2" - "@svgr/babel-plugin-add-jsx-attribute@^4.2.0": version "4.2.0" resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-4.2.0.tgz#dadcb6218503532d6884b210e7f3c502caaa44b1" @@ -3749,11 +3771,6 @@ resolved "https://registry.yarnpkg.com/@types/classnames/-/classnames-2.2.10.tgz#cc658ca319b6355399efc1f5b9e818f1a24bf999" integrity sha512-1UzDldn9GfYYEsWWnn/P4wkTlkZDH7lDb0wBMGbtIQc9zXEQq7FlKBdZUn6OBqD8sKZZ2RQO2mAjGpXiDGoRmQ== -"@types/clone@~0.1.30": - version "0.1.30" - resolved "https://registry.yarnpkg.com/@types/clone/-/clone-0.1.30.tgz#e7365648c1b42136a59c7d5040637b3b5c83b614" - integrity sha1-5zZWSMG0ITalnH1QQGN7O1yDthQ= - "@types/color-name@^1.1.1": version "1.1.1" resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" @@ -3776,7 +3793,7 @@ resolved "https://registry.yarnpkg.com/@types/d3-color/-/d3-color-1.2.2.tgz#80cf7cfff7401587b8f89307ba36fe4a576bc7cf" integrity sha512-6pBxzJ8ZP3dYEQ4YjQ+NVbQaOflfgXq/JbDiS99oLobM2o72uAST4q6yPxHv6FOTCRC/n35ktuo8pvw/S4M7sw== -"@types/d3-format@^1.3.0": +"@types/d3-format@^1.3.0", "@types/d3-format@^1.3.1": version "1.3.1" resolved "https://registry.yarnpkg.com/@types/d3-format/-/d3-format-1.3.1.tgz#35bf88264bd6bcda39251165bb827f67879c4384" integrity sha512-KAWvReOKMDreaAwOjdfQMm0HjcUMlQG47GwqdVKgmm20vTd2pucj0a70c3gUSHrnsmo6H2AMrkBsZU2UhJLq8A== @@ -3800,7 +3817,12 @@ resolved "https://registry.yarnpkg.com/@types/d3-path/-/d3-path-1.0.8.tgz#48e6945a8ff43ee0a1ce85c8cfa2337de85c7c79" integrity sha512-AZGHWslq/oApTAHu9+yH/Bnk63y9oFOMROtqPAtxl5uB6qm1x2lueWdVEjsjjV3Qc2+QfuzKIwIR5MvVBakfzA== -"@types/d3-scale@^2.0.2", "@types/d3-scale@^2.1.1": +"@types/d3-scale-chromatic@^1.2.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@types/d3-scale-chromatic/-/d3-scale-chromatic-1.5.0.tgz#315367557d51b823bec848614fac095325613fc3" + integrity sha512-9/D7cOBKdZdTCPc6re0HeSUFBM0aFzdNdmYggUWT9SRRiYSOa6Ys2xdTwHKgc1WS3gGfwTMatBOdWCS863REsg== + +"@types/d3-scale@^2.0.2", "@types/d3-scale@^2.1.1", "@types/d3-scale@^2.2.0": version "2.2.0" resolved "https://registry.yarnpkg.com/@types/d3-scale/-/d3-scale-2.2.0.tgz#e5987a2857365823eb26ed5eb21bc566c4dcf1c0" integrity sha512-oQFanN0/PiR2oySHfj+zAAkK1/p4LD32Nt1TMVmzk+bYHk7vgIg/iTXQWitp1cIkDw4LMdcgvO63wL+mNs47YA== @@ -3814,7 +3836,7 @@ dependencies: "@types/d3-path" "*" -"@types/d3-time-format@^2.1.0": +"@types/d3-time-format@^2.1.0", "@types/d3-time-format@^2.1.1": version "2.1.1" resolved "https://registry.yarnpkg.com/@types/d3-time-format/-/d3-time-format-2.1.1.tgz#dd2c79ec4575f1355484ab6b10407824668eba42" integrity sha512-tJSyXta8ZyJ52wDDHA96JEsvkbL6jl7wowGmuf45+fAkj5Y+SQOnz0N7/H68OWmPshPsAaWMQh+GAws44IzH3g== @@ -3857,11 +3879,6 @@ resolved "https://registry.yarnpkg.com/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7" integrity sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g== -"@types/fast-json-stable-stringify@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@types/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#40363bb847cb86b2c2e1599f1398d11e8329c921" - integrity sha512-mky/O83TXmGY39P1H9YbUpjV6l6voRYlufqfFCvel8l1phuy8HRjdWc1rrPuN53ITBJlbyMSV6z3niOySO5pgQ== - "@types/fetch-mock@^6.0.0", "@types/fetch-mock@^6.0.4": version "6.0.5" resolved "https://registry.yarnpkg.com/@types/fetch-mock/-/fetch-mock-6.0.5.tgz#acbc6771d43d7ebc1f0a8b7e3d57147618f8eacb" @@ -3945,6 +3962,18 @@ resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.4.tgz#38fd73ddfd9b55abb1e1b2ed578cb55bd7b7d339" integrity sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA== +"@types/lodash.get@^4.4.6": + version "4.4.6" + resolved "https://registry.yarnpkg.com/@types/lodash.get/-/lodash.get-4.4.6.tgz#0c7ac56243dae0f9f09ab6f75b29471e2e777240" + integrity sha512-E6zzjR3GtNig8UJG/yodBeJeIOtgPkMgsLjDU3CbgCAPC++vJ0eCMnJhVpRZb/ENqEFlov1+3K9TKtY4UdWKtQ== + dependencies: + "@types/lodash" "*" + +"@types/lodash@*": + version "4.14.159" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.159.tgz#61089719dc6fdd9c5cb46efc827f2571d1517065" + integrity sha512-gF7A72f7WQN33DpqOWw9geApQPh4M3PxluMtaHxWHXEGSN12/WbcEk/eNSqWNQcQhF66VSZ06vCF94CrHwXJDg== + "@types/lodash@^4.14.146", "@types/lodash@^4.14.149": version "4.14.157" resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.157.tgz#fdac1c52448861dfde1a2e1515dbc46e54926dc8" @@ -5312,11 +5341,6 @@ array-find-index@^1.0.1: resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" integrity sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E= -array-flat-polyfill@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/array-flat-polyfill/-/array-flat-polyfill-1.0.1.tgz#1e3a4255be619dfbffbfd1d635c1cf357cd034e7" - integrity sha512-hfJmKupmQN0lwi0xG6FQ5U8Rd97RnIERplymOv/qpq8AoNKPPAnxJadjFA23FNWm88wykh9HmpLJUUwUtNU/iw== - array-flatten@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" @@ -6020,7 +6044,7 @@ binaryextensions@^2.1.2: resolved "https://registry.yarnpkg.com/binaryextensions/-/binaryextensions-2.2.0.tgz#e7c6ba82d4f5f5758c26078fe8eea28881233311" integrity sha512-bHhs98rj/7i/RZpCSJ3uk55pLXOItjIrh2sRQZSM6OoktScX+LxJzvlU+FELp9j3TdcddTmmYArLSGptCTwjuw== -bindings@^1.5.0: +bindings@^1.3.0, bindings@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== @@ -6785,7 +6809,7 @@ clone@^1.0.0, clone@^1.0.2: resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4= -clone@^2.1.1, clone@~2.1.2: +clone@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" integrity sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18= @@ -7583,12 +7607,12 @@ d3-array@1, d3-array@^1.0.2, d3-array@^1.2.0, d3-array@^1.2.1: resolved "https://registry.yarnpkg.com/d3-array/-/d3-array-1.2.4.tgz#635ce4d5eea759f6f605863dbcfc30edc737f71f" integrity sha512-KHW6M86R+FUPYGb3R5XiYjXPq7VzwxZ22buHhAEVG5ztoEcZZMLov530mmccaqA1GghZArjQV46fuc8kUqhhHw== -"d3-array@1.2.0 - 2", d3-array@^2.0.3, d3-array@^2.3.1, d3-array@^2.3.3, d3-array@^2.4.0: +"d3-array@1.2.0 - 2", d3-array@^2.0.3, d3-array@^2.3.1, d3-array@^2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/d3-array/-/d3-array-2.4.0.tgz#87f8b9ad11088769c82b5ea846bcb1cc9393f242" integrity sha512-KQ41bAF2BMakf/HdKT865ALd4cgND6VcIztVQZUTt0+BH3RWy6ZYnHghVXf6NFjt2ritLr8H1T8LreAAlfiNcw== -d3-cloud@^1.2.1, d3-cloud@^1.2.5: +d3-cloud@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/d3-cloud/-/d3-cloud-1.2.5.tgz#3e91564f2d27fba47fcc7d812eb5081ea24c603d" integrity sha512-4s2hXZgvs0CoUIw31oBAGrHt9Kt/7P9Ik5HIVzISFiWkD0Ga2VLAuO/emO/z1tYIpE7KG2smB4PhMPfFMJpahw== @@ -7600,17 +7624,15 @@ d3-collection@1, d3-collection@^1.0.2, d3-collection@^1.0.4: resolved "https://registry.yarnpkg.com/d3-collection/-/d3-collection-1.0.7.tgz#349bd2aa9977db071091c13144d5e4f16b5b310e" integrity sha512-ii0/r5f4sjKNTfh84Di+DpztYwqKhEyUlKoPrzUFfeSkWxjW49xU2QzO9qrPrNkpdI0XJkfzvmTu8V2Zylln6A== -d3-color@1, d3-color@^1.2.3, d3-color@^1.4.0, d3-color@^1.4.1: +d3-color@1, d3-color@^1.2.3, d3-color@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/d3-color/-/d3-color-1.4.1.tgz#c52002bf8846ada4424d55d97982fef26eb3bc8a" integrity sha512-p2sTHSLCJI2QKunbGb7ocOh7DgTAn8IrLx21QRc/BSnodXM4sv6aLQlnfpvehFMLZEfBc6g9pH9SWQccFYfJ9Q== -d3-delaunay@^5.1.3: - version "5.2.1" - resolved "https://registry.yarnpkg.com/d3-delaunay/-/d3-delaunay-5.2.1.tgz#0c4b280eb00194986ac4a3df9c81d32bf216cb36" - integrity sha512-ZZdeJl6cKRyqYVFYK+/meXvWIrAvZsZTD7WSxl4OPXCmuXNgDyACAClAJHD63zL25TA+IJGURUNO7rFseNFCYw== - dependencies: - delaunator "4" +"d3-color@1 - 2": + version "2.0.0" + resolved "https://registry.yarnpkg.com/d3-color/-/d3-color-2.0.0.tgz#8d625cab42ed9b8f601a1760a389f7ea9189d62e" + integrity sha512-SPXi0TSKPD4g9tw0NMZFnR95XVgUZiBH+uUTqQuDu1OsE2zomHU7ho0FISciaPvosimixwHFl3WHLGabv6dDgQ== d3-dispatch@1, d3-dispatch@^1.0.3: version "1.0.6" @@ -7625,34 +7647,21 @@ d3-drag@1: d3-dispatch "1" d3-selection "1" -d3-dsv@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/d3-dsv/-/d3-dsv-1.2.0.tgz#9d5f75c3a5f8abd611f74d3f5847b0d4338b885c" - integrity sha512-9yVlqvZcSOMhCYzniHE7EVUws7Fa1zgw+/EAV2BxJoG3ME19V6BQFBwI855XQDsxyOuG7NibqRMTtiF/Qup46g== - dependencies: - commander "2" - iconv-lite "0.4" - rw "1" - d3-ease@1: version "1.0.6" resolved "https://registry.yarnpkg.com/d3-ease/-/d3-ease-1.0.6.tgz#ebdb6da22dfac0a22222f2d4da06f66c416a0ec0" integrity sha512-SZ/lVU7LRXafqp7XtIcBdxnWl8yyLpgOmzAk0mWBI9gXNzLDx5ybZgnRbH9dN/yY5tzVBqCQ9avltSnqVwessQ== -d3-force@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/d3-force/-/d3-force-2.0.1.tgz#31750eee8c43535301d571195bf9683beda534e2" - integrity sha512-zh73/N6+MElRojiUG7vmn+3vltaKon7iD5vB/7r9nUaBeftXMzRo5IWEG63DLBCto4/8vr9i3m9lwr1OTJNiCg== - dependencies: - d3-dispatch "1" - d3-quadtree "1" - d3-timer "1" - -d3-format@1, d3-format@^1.1.1, d3-format@^1.2.0, d3-format@^1.3.2, d3-format@^1.4.2, d3-format@^1.4.3: +d3-format@1, d3-format@^1.1.1, d3-format@^1.2.0, d3-format@^1.3.2: version "1.4.4" resolved "https://registry.yarnpkg.com/d3-format/-/d3-format-1.4.4.tgz#356925f28d0fd7c7983bfad593726fce46844030" integrity sha512-TWks25e7t8/cqctxCmxpUuzZN11QxIA7YrMbram94zMQ0PXjE4LVIMe/f6a4+xxL8HQ3OsAFULOINQi1pE62Aw== +d3-format@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/d3-format/-/d3-format-2.0.0.tgz#a10bcc0f986c372b729ba447382413aabf5b0767" + integrity sha512-Ab3S6XuE/Q+flY96HXT0jOXcM4EAClYFnRGY5zsjRGNy6qCYrQsMffs7cV5Q9xejb35zxW5hf/guKw34kvIKsA== + d3-geo-projection@0.2: version "0.2.16" resolved "https://registry.yarnpkg.com/d3-geo-projection/-/d3-geo-projection-0.2.16.tgz#4994ecd1033ddb1533b6c4c5528a1c81dcc29427" @@ -7660,17 +7669,7 @@ d3-geo-projection@0.2: dependencies: brfs "^1.3.0" -d3-geo-projection@^2.7.1: - version "2.8.1" - resolved "https://registry.yarnpkg.com/d3-geo-projection/-/d3-geo-projection-2.8.1.tgz#80447ef6cc6ab561646d251c20f4882c81879938" - integrity sha512-VObmT3vQQgU7IxkDwyIuOrWK4AS2OHyvucp1vHo98WE7DvAN+VcS3Pf/oKenszPfbMtHusOfQNBLEMyGHguvTg== - dependencies: - commander "2" - d3-array "1" - d3-geo "^1.10.0" - resolve "^1.1.10" - -d3-geo@^1.10.0, d3-geo@^1.11.9, d3-geo@^1.12.0: +d3-geo@^1.12.0: version "1.12.1" resolved "https://registry.yarnpkg.com/d3-geo/-/d3-geo-1.12.1.tgz#7fc2ab7414b72e59fbcbd603e80d9adc029b035f" integrity sha512-XG4d1c/UJSEX9NfU02KwBL6BYPj8YKHxgBEw5om2ZnTRSbIcego6dhHwcxuSR3clxh0EpE38os1DVPOmnYtTPg== @@ -7689,16 +7688,18 @@ d3-interpolate@1, d3-interpolate@^1.1.3, d3-interpolate@^1.2.0, d3-interpolate@^ dependencies: d3-color "1" -d3-path@1, d3-path@^1.0.5, d3-path@^1.0.9: +d3-interpolate@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/d3-interpolate/-/d3-interpolate-2.0.1.tgz#98be499cfb8a3b94d4ff616900501a64abc91163" + integrity sha512-c5UhwwTs/yybcmTpAVqwSFl6vrQ8JZJoT5F7xNFK9pymv5C0Ymcc9/LIJHtYIggg/yS9YHw8i8O8tgb9pupjeQ== + dependencies: + d3-color "1 - 2" + +d3-path@1, d3-path@^1.0.5: version "1.0.9" resolved "https://registry.yarnpkg.com/d3-path/-/d3-path-1.0.9.tgz#48c050bb1fe8c262493a8caf5524e3e9591701cf" integrity sha512-VLaYcn81dtHVTjEHd8B+pbe9yHWpXKZUC87PzoFmsFrJqgFwDe/qxfp5MlfsfM1V5E/iVt0MmEbWQ7FVIXh/bg== -d3-quadtree@1: - version "1.0.7" - resolved "https://registry.yarnpkg.com/d3-quadtree/-/d3-quadtree-1.0.7.tgz#ca8b84df7bb53763fe3c2f24bd435137f4e53135" - integrity sha512-RKPAeXnkC59IDGD0Wu5mANy0Q2V28L+fNe65pOCXVdVuTJS3WPKaJlFHer32Rbh9gIo9qMuJXio8ra4+YmIymA== - d3-queue@1: version "1.2.3" resolved "https://registry.yarnpkg.com/d3-queue/-/d3-queue-1.2.3.tgz#143a701cfa65fe021292f321c10d14e98abd491b" @@ -7732,6 +7733,14 @@ d3-sankey@^0.4.2: d3-collection "1" d3-interpolate "1" +d3-scale-chromatic@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/d3-scale-chromatic/-/d3-scale-chromatic-1.5.0.tgz#54e333fc78212f439b14641fb55801dd81135a98" + integrity sha512-ACcL46DYImpRFMBcpk9HhtIyC7bTBR4fNOPxwVSl0LfulDAwyiHyPOTqcDG1+t5d4P9W7t/2NAuWu59aKko/cg== + dependencies: + d3-color "1" + d3-interpolate "1" + d3-scale@^1.0.5, d3-scale@^1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/d3-scale/-/d3-scale-1.0.7.tgz#fa90324b3ea8a776422bd0472afab0b252a0945d" @@ -7773,7 +7782,7 @@ d3-selection@1, d3-selection@^1.0.3, d3-selection@^1.1.0, d3-selection@^1.3.0, d resolved "https://registry.yarnpkg.com/d3-selection/-/d3-selection-1.4.1.tgz#98eedbbe085fbda5bafa2f9e3f3a2f4d7d622a98" integrity sha512-BTIbRjv/m5rcVTfBs4AMBLKs4x8XaaLkwm28KWu9S2vKNqXkXt2AH2Qf0sdPZHjFxcWg/YL53zcqAz+3g4/7PA== -d3-shape@^1.0.6, d3-shape@^1.2.0, d3-shape@^1.3.7: +d3-shape@^1.0.6, d3-shape@^1.2.0: version "1.3.7" resolved "https://registry.yarnpkg.com/d3-shape/-/d3-shape-1.3.7.tgz#df63801be07bc986bc54f63789b4fe502992b5d7" integrity sha512-EUkvKjqPFUAZyOlhY5gzCxCeI0Aep04LwIRpsZ/mLFelJiUfnK56jo5JMDSE7yyP2kLSb6LtF+S5chMk7uqPqw== @@ -7785,19 +7794,24 @@ d3-svg-legend@^1.x: resolved "https://registry.yarnpkg.com/d3-svg-legend/-/d3-svg-legend-1.13.0.tgz#6217478c9add9d62cb333617e1961311a41a4db3" integrity sha1-YhdHjJrdnWLLMzYX4ZYTEaQaTbM= -d3-time-format@2, d3-time-format@^2.2.0, d3-time-format@^2.2.1, d3-time-format@^2.2.2, d3-time-format@^2.2.3: +d3-time-format@2, d3-time-format@^2.2.0, d3-time-format@^2.2.3: version "2.2.3" resolved "https://registry.yarnpkg.com/d3-time-format/-/d3-time-format-2.2.3.tgz#0c9a12ee28342b2037e5ea1cf0b9eb4dd75f29cb" integrity sha512-RAHNnD8+XvC4Zc4d2A56Uw0yJoM7bsvOlJR33bclxq399Rak/b9bhvu/InjxdWhPtkgU53JJcleJTGkNRnN6IA== dependencies: d3-time "1" -d3-time@1, d3-time@^1.0.10, d3-time@^1.0.11, d3-time@^1.1.0: +d3-time@1, d3-time@^1.0.10: version "1.1.0" resolved "https://registry.yarnpkg.com/d3-time/-/d3-time-1.1.0.tgz#b1e19d307dae9c900b7e5b25ffc5dcc249a8a0f1" integrity sha512-Xh0isrZ5rPYYdqhAVk8VLnMEidhz5aP7htAADH6MfzgmmicPkTo8LhkLxci61/lCB7n7UmE3bN0leRt+qvkLxA== -d3-timer@1, d3-timer@^1.0.10, d3-timer@^1.0.9: +d3-time@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/d3-time/-/d3-time-2.0.0.tgz#ad7c127d17c67bd57a4c61f3eaecb81108b1e0ab" + integrity sha512-2mvhstTFcMvwStWd9Tj3e6CEqtOivtD8AUiHT8ido/xmzrI9ijrUUihZ6nHuf/vsScRBonagOdj0Vv+SEL5G3Q== + +d3-timer@1, d3-timer@^1.0.9: version "1.0.10" resolved "https://registry.yarnpkg.com/d3-timer/-/d3-timer-1.0.10.tgz#dfe76b8a91748831b13b6d9c793ffbd508dd9de5" integrity sha512-B1JDm0XDaQC+uvo4DT79H0XmBskgS3l6Ve+1SBCfxgmtIb1AVrPIoqd+nPSv+loMX8szQ0sVUhGngL7D5QPiXw== @@ -8039,11 +8053,6 @@ define-property@^2.0.2: is-descriptor "^1.0.2" isobject "^3.0.1" -delaunator@4: - version "4.0.1" - resolved "https://registry.yarnpkg.com/delaunator/-/delaunator-4.0.1.tgz#3d779687f57919a7a418f8ab947d3bddb6846957" - integrity sha512-WNPWi1IRKZfCt/qIDMfERkDp93+iZEmOxN2yy4Jg+Xhv8SLk2UTqqbe1sfiipn0and9QrE914/ihdx82Y/Giag== - delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" @@ -8177,6 +8186,24 @@ distributions@^1.0.0: dependencies: mathfn "^1.0.0" +dnode-protocol@~0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/dnode-protocol/-/dnode-protocol-0.2.2.tgz#51151d16fc3b5f84815ee0b9497a1061d0d1949d" + integrity sha1-URUdFvw7X4SBXuC5SXoQYdDRlJ0= + dependencies: + jsonify "~0.0.0" + traverse "~0.6.3" + +dnode-weak-napi@1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/dnode-weak-napi/-/dnode-weak-napi-1.2.2.tgz#7618c12eae5ef0622ff6b48a924b342e2162f8de" + integrity sha512-xn/HTB0C5gA7bW12SCkYbkqWoTdQquR7kxInjnZYh3egkEj/ys02fDDAw/7XVq+0fYWFgD7ewuV8w9K5LAr+zw== + dependencies: + dnode-protocol "~0.2.2" + jsonify "~0.0.0" + optionalDependencies: + weak-napi "^1.0.3" + doctrine@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" @@ -8502,43 +8529,24 @@ emotion-theming@^10.0.19, emotion-theming@^10.0.27: "@emotion/weak-memoize" "0.2.5" hoist-non-react-statics "^3.3.0" -encodable@^0.3.4: - version "0.3.5" - resolved "https://registry.yarnpkg.com/encodable/-/encodable-0.3.5.tgz#4d273623f86680939474b555183753c4976b3cc6" - integrity sha512-ofpVxFEYwFjgk94syrbdTc4nn6nxOO8rvJTieFz/Ko7V5oJMDpYwJYO87eL5xbc84XqD07vUJp50Zi54y+WAhw== - dependencies: - "@types/d3-array" "^2.0.0" - "@types/d3-interpolate" "^1.3.1" - "@types/d3-scale" "^2.1.1" - "@types/d3-time" "^1.0.10" - "@types/lodash" "^4.14.149" - d3-array "^2.3.1" - d3-interpolate "^1.3.2" - d3-scale "^3.0.1" - d3-time "^1.0.11" - lodash "^4.17.15" - reselect "^4.0.0" - vega "^5.9.1" - vega-lite "~4.1.0" - -encodable@^0.3.7: - version "0.3.7" - resolved "https://registry.yarnpkg.com/encodable/-/encodable-0.3.7.tgz#6906ab4b03be36108f70a4f3288882b601caec1c" - integrity sha512-aFbrhAsxPUN+OMZ28+N2tOqaeIFs4I1t/Li9+WmQwPFONrsu7InwMehLR3XTOQjmo+ucCBcSV9ABjQqMawgKNw== +encodable@^0.7.6: + version "0.7.6" + resolved "https://registry.yarnpkg.com/encodable/-/encodable-0.7.6.tgz#fb21e6dc8235482d6086e206bf6894c41329bdd3" + integrity sha512-T++E20LzE2r2PfXFA++9vzJXPi1Ji1xDmsXSi7FxjUzWLqWLNErJpopnvMbF7kIKmr0Zea2Ookl/Uf5PtLQfDg== dependencies: + "@encodable/color" "^1.0.4" + "@encodable/format" "^1.0.5" "@types/d3-array" "^2.0.0" "@types/d3-interpolate" "^1.3.1" "@types/d3-scale" "^2.1.1" "@types/d3-time" "^1.0.10" - "@types/lodash" "^4.14.149" + "@types/lodash.get" "^4.4.6" d3-array "^2.3.1" - d3-interpolate "^1.3.2" + d3-interpolate "^2.0.1" d3-scale "^3.0.1" - d3-time "^1.0.11" - lodash "^4.17.15" + d3-time "^2.0.0" + lodash.get "^4.4.2" reselect "^4.0.0" - vega "^5.9.1" - vega-lite "~4.1.0" encodeurl@~1.0.2: version "1.0.2" @@ -9072,6 +9080,18 @@ esprima@~1.0.4: resolved "https://registry.yarnpkg.com/esprima/-/esprima-1.0.4.tgz#9f557e08fc3b4d26ece9dd34f8fbf476b62585ad" integrity sha1-n1V+CPw7TSbs6d00+Pv0drYlha0= +esprint@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/esprint/-/esprint-0.7.0.tgz#058af46da0d847f021e9c92db836bbf1c3c62c77" + integrity sha512-9EbgelpgCdiHRnTzAHbG+cyKN0ruUBfu9NTxxehQOh+1RVly1xvZPArqzc2DD95YtdOVX1qLqaKZI9qngmq+fQ== + dependencies: + dnode-weak-napi "1.2.2" + fb-watchman "^2.0.0" + glob "^7.1.4" + sane "^4.1.0" + worker-farm "^1.7.0" + yargs "^14.0.0" + esquery@^1.0.1: version "1.2.0" resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.2.0.tgz#a010a519c0288f2530b3404124bfb5f02e9797fe" @@ -9326,7 +9346,7 @@ fast-deep-equal@^2.0.1: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= -fast-deep-equal@^3.1.1, fast-deep-equal@~3.1.1: +fast-deep-equal@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz#545145077c501491e33b15ec408c294376e94ae4" integrity sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA== @@ -9348,7 +9368,7 @@ fast-glob@^2.0.2, fast-glob@^2.2.6: merge2 "^1.2.3" micromatch "^3.1.10" -fast-glob@^3.0.1, fast-glob@^3.0.4, fast-glob@^3.2.2: +fast-glob@^3.0.4, fast-glob@^3.2.2, fast-glob@^3.2.4: version "3.2.4" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.4.tgz#d20aefbf99579383e7f3cc66529158c9b98554d3" integrity sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ== @@ -9360,7 +9380,7 @@ fast-glob@^3.0.1, fast-glob@^3.0.4, fast-glob@^3.2.2: micromatch "^4.0.2" picomatch "^2.2.1" -fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@~2.1.0: +fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== @@ -10011,6 +10031,18 @@ get-stream@^5.0.0: dependencies: pump "^3.0.0" +get-symbol-from-current-process-h@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/get-symbol-from-current-process-h/-/get-symbol-from-current-process-h-1.0.2.tgz#510af52eaef873f7028854c3377f47f7bb200265" + integrity sha512-syloC6fsCt62ELLrr1VKBM1ggOpMdetX9hTrdW77UQdcApPHLmf7CI7OKcN1c9kYuNxKcDe4iJ4FY9sX3aw2xw== + +get-uv-event-loop-napi-h@^1.0.5: + version "1.0.6" + resolved "https://registry.yarnpkg.com/get-uv-event-loop-napi-h/-/get-uv-event-loop-napi-h-1.0.6.tgz#42b0b06b74c3ed21fbac8e7c72845fdb7a200208" + integrity sha512-t5c9VNR84nRoF+eLiz6wFrEp1SE2Acg0wS+Ysa2zF0eROes+LzOfuTaVHxGy8AbS8rq7FHEJzjnCZo1BupwdJg== + dependencies: + get-symbol-from-current-process-h "^1.0.1" + get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" @@ -10188,6 +10220,11 @@ glob@^7.0.0, glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, gl once "^1.3.0" path-is-absolute "^1.0.0" +global-box@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/global-box/-/global-box-1.2.0.tgz#009f681e6fef6eb6f8aff00be732d23de4be0acd" + integrity sha512-IgpqqAYWNG3eluK1tsCkI8Uxff16+OYWLEhDS/QrfkfmbRQ/tVlBXZfURn5tSoPPT6wtmeJp7VKhXrcc5jl/1A== + global-cache@^1.2.0: version "1.2.1" resolved "https://registry.yarnpkg.com/global-cache/-/global-cache-1.2.1.tgz#39ca020d3dd7b3f0934c52b75363f8d53312c16d" @@ -10747,7 +10784,7 @@ iconv-lite@0.2: resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.2.11.tgz#1ce60a3a57864a292d1321ff4609ca4bb965adc8" integrity sha1-HOYKOleGSiktEyH/RgnKS7llrcg= -iconv-lite@0.4, iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@~0.4.13: +iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@~0.4.13: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== @@ -12082,11 +12119,6 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= -json-stringify-pretty-compact@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/json-stringify-pretty-compact/-/json-stringify-pretty-compact-2.0.0.tgz#e77c419f52ff00c45a31f07f4c820c2433143885" - integrity sha512-WRitRfs6BGq4q8gTgOy4ek7iPFXjbra0H3PmDLKm2xnZ+Gh1HUhiKGgCZkSPNULlP7mvfu6FV/mOLhCarspADQ== - json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" @@ -12134,6 +12166,11 @@ jsonfile@^6.0.1: optionalDependencies: graceful-fs "^4.1.6" +jsonify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" + integrity sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM= + jsonparse@^1.2.0: version "1.3.1" resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" @@ -13472,6 +13509,11 @@ no-case@^3.0.3: lower-case "^2.0.1" tslib "^1.10.0" +node-addon-api@^1.1.0: + version "1.7.2" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-1.7.2.tgz#3df30b95720b53c24e59948b49532b662444f54d" + integrity sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg== + node-dir@^0.1.10: version "0.1.17" resolved "https://registry.yarnpkg.com/node-dir/-/node-dir-0.1.17.tgz#5f5665d93351335caabef8f1c554516cf5f1e4e5" @@ -15983,7 +16025,7 @@ resolve@1.1.7: resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= -resolve@1.x, resolve@^1.1.10, resolve@^1.1.5, resolve@^1.1.6, resolve@^1.10.0, resolve@^1.11.0, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.15.1, resolve@^1.17.0, resolve@^1.3.2, resolve@^1.8.1: +resolve@1.x, resolve@^1.1.5, resolve@^1.1.6, resolve@^1.10.0, resolve@^1.11.0, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.15.1, resolve@^1.17.0, resolve@^1.3.2, resolve@^1.8.1: version "1.17.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== @@ -16140,7 +16182,7 @@ safe-regex@^2.1.1: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -sane@^4.0.3: +sane@^4.0.3, sane@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/sane/-/sane-4.1.0.tgz#ed881fd922733a6c461bc189dc2b6c006f3ffded" integrity sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA== @@ -16324,6 +16366,14 @@ set-value@^3.0.1: dependencies: is-plain-object "^2.0.4" +setimmediate-napi@^1.0.3: + version "1.0.6" + resolved "https://registry.yarnpkg.com/setimmediate-napi/-/setimmediate-napi-1.0.6.tgz#43cd797ef25d66eb69c782170ea01898787b8720" + integrity sha512-sdNXN15Av1jPXuSal4Mk4tEAKn0+8lfF9Z50/negaQMrAIO9c1qM0eiCh8fT6gctp0RiCObk+6/Xfn5RMGdZoA== + dependencies: + get-symbol-from-current-process-h "^1.0.1" + get-uv-event-loop-napi-h "^1.0.5" + setimmediate@^1.0.4, setimmediate@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" @@ -17606,6 +17656,11 @@ tr46@^1.0.1: dependencies: punycode "^2.1.0" +traverse@~0.6.3: + version "0.6.6" + resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.6.6.tgz#cbdf560fd7b9af632502fed40f918c157ea97137" + integrity sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc= + trim-newlines@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" @@ -17670,11 +17725,6 @@ tslib@^1.10.0, tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.1.tgz#eb15d128827fbee2841549e171f45ed338ac7e35" integrity sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA== -tslib@~1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" - integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== - tsutils@^3.17.1: version "3.17.1" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759" @@ -18085,326 +18135,6 @@ vary@~1.1.2: resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= -vega-canvas@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/vega-canvas/-/vega-canvas-1.2.1.tgz#ee0586e2a1f096f6a5d1710df61ef501562c2bd4" - integrity sha512-k/S3EPeJ37D7fYDhv4sEg7fNWVpLheQY7flfLyAmJU7aSwCMgw8cZJi0CKHchJeculssfH+41NCqvRB1QtaJnw== - -vega-crossfilter@~4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/vega-crossfilter/-/vega-crossfilter-4.0.1.tgz#9fab0dc5445e846d732c83ac2b5a72225bc6fdf1" - integrity sha512-wLNS4JzKaOLj8EAzI/v8XBJjUWMRWYSu6EeQF4o9Opq/78u87Ol9Lc5I27UHsww5dNNH/tHubAV4QPIXnGOp5Q== - dependencies: - d3-array "^2.0.3" - vega-dataflow "^5.1.0" - vega-util "^1.8.0" - -vega-dataflow@^5.1.0, vega-dataflow@^5.1.1, vega-dataflow@^5.4.0, vega-dataflow@^5.4.1, vega-dataflow@^5.5.0, vega-dataflow@~5.5.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/vega-dataflow/-/vega-dataflow-5.5.0.tgz#9a1ecd2eb0ff02aef53cdb87a7828eae528f8d82" - integrity sha512-9eRe2qLpwvEegBoSaH3vdziSLMZSszY02wxVmvcFzHe57Rf/eYEr0YRuW4qc+gMmwURPYu9wtmeUTiK4XhDKXw== - dependencies: - vega-loader "^4.0.0" - vega-util "^1.11.0" - -vega-encode@~4.5.3: - version "4.5.3" - resolved "https://registry.yarnpkg.com/vega-encode/-/vega-encode-4.5.3.tgz#a243cbe2af461313a8a2eef88400548b89cdf52c" - integrity sha512-N7EVoDVQOrloutGnnXZj0Pa9JReH2s7Tio/2KUiMb5eGeJQ7jRD2zyqZSG0ZxKODSlxoP3YLmbLVKHIqNJQ5Kg== - dependencies: - d3-array "^2.4.0" - d3-format "^1.4.3" - d3-interpolate "^1.4.0" - vega-dataflow "^5.5.0" - vega-scale "^6.0.0" - vega-time "^1.0.0" - vega-util "^1.13.1" - -vega-event-selector@^2.0.2, vega-event-selector@~2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/vega-event-selector/-/vega-event-selector-2.0.2.tgz#bb64e1cfe047c6808878038319e18af6991759d9" - integrity sha512-Uv72vBfM0lrlI2belKHFMZuVnW2uJl2ShqWPwGSXPVe6p+PzgqoPJYC8A/i5N8B54UA4UMDzlbBeo3x7q2W9Yg== - -vega-expression@^2.6.1, vega-expression@^2.6.3, vega-expression@~2.6.3: - version "2.6.3" - resolved "https://registry.yarnpkg.com/vega-expression/-/vega-expression-2.6.3.tgz#11110922765cc495b8aebd8e05c4ec848d9f2b3b" - integrity sha512-sME1+45BToTGsftb1Q6Ubs2iRYEoXkD2NRGnJuKS9YJ2ITzZwPHF/jy2kHW3iLpuNjj54meaO7HMQ/hUKrciUw== - dependencies: - vega-util "^1.11.0" - -vega-force@~4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/vega-force/-/vega-force-4.0.3.tgz#33e0b03c9af60146f821007d9e7a7617fe9e8ac6" - integrity sha512-4stItN4jD9H1CENaCz4jXRNS1Bi9cozMOUjX2824FeJENi2RZSiAZAaGbscgerZQ/jbNcOHD8PHpC2pWldEvGA== - dependencies: - d3-force "^2.0.1" - vega-dataflow "^5.4.0" - vega-util "^1.11.0" - -vega-functions@^5.5.1, vega-functions@~5.5.1: - version "5.5.1" - resolved "https://registry.yarnpkg.com/vega-functions/-/vega-functions-5.5.1.tgz#849a7c9f19c77899c26969b6070c724cd7366131" - integrity sha512-VTfEwf/ChSOGc4d4yUIgu2XoScky6NH06WN4vwVGY5PREhsyVPsQ+p2zqgD/N/a00EyWPHeOSHEhsPU28oIMtQ== - dependencies: - d3-array "^2.4.0" - d3-color "^1.4.0" - d3-format "^1.4.2" - d3-geo "^1.11.9" - d3-time-format "^2.2.2" - vega-dataflow "^5.5.0" - vega-expression "^2.6.3" - vega-scale "^6.0.0" - vega-scenegraph "^4.5.0" - vega-selections "^5.1.0" - vega-statistics "^1.7.1" - vega-time "^1.0.0" - vega-util "^1.12.1" - -vega-geo@~4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/vega-geo/-/vega-geo-4.3.0.tgz#3dd5d3606f18dc839c8a430338c6a390319bf477" - integrity sha512-Rcz4z+TR4qy727pjBWSsbMAn8eM9bDZ5MXKqo5AWuFkoj/8ngv13vafHd1tvEMTA8L5BjAW3/eTqN4tyx9KSQg== - dependencies: - d3-array "^2.4.0" - d3-color "^1.4.0" - d3-geo "^1.11.9" - vega-canvas "^1.2.1" - vega-dataflow "^5.1.1" - vega-projection "^1.4.0" - vega-statistics "^1.7.1" - vega-util "^1.12.1" - -vega-hierarchy@~4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/vega-hierarchy/-/vega-hierarchy-4.0.3.tgz#0d36bc29ad6f369fa844e3e2ce5faec983f8b047" - integrity sha512-9wNe+KyKqZW1S4++jCC38HuAhZbqNhfY7gOvwiMLjsp65tMtRETrtvYfHkULClm3UokUIX54etAXREAGW7znbw== - dependencies: - d3-hierarchy "^1.1.8" - vega-dataflow "^5.4.0" - vega-util "^1.11.0" - -vega-lite@~4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/vega-lite/-/vega-lite-4.1.1.tgz#f6e6cae4e0518c66afd0298fb544b6a35290437b" - integrity sha512-D2seO6ZbY8aZQ8+ZQfU+5NYwot3ryIDyvdQdcVoupMSgJ/oGv4QqEwL3rmu8abdSG6NhFiac0trsI+wBb0F6vQ== - dependencies: - "@types/clone" "~0.1.30" - "@types/fast-json-stable-stringify" "^2.0.0" - array-flat-polyfill "^1.0.1" - clone "~2.1.2" - fast-deep-equal "~3.1.1" - fast-json-stable-stringify "~2.1.0" - json-stringify-pretty-compact "~2.0.0" - tslib "~1.10.0" - vega-event-selector "~2.0.2" - vega-expression "~2.6.3" - vega-typings "~0.12.0" - vega-util "~1.12.2" - yargs "~15.1.0" - -vega-loader@^4.0.0, vega-loader@^4.2.0, vega-loader@~4.2.1: - version "4.2.1" - resolved "https://registry.yarnpkg.com/vega-loader/-/vega-loader-4.2.1.tgz#556554e6e70f254dc68da15a391ba0d3ad6d1373" - integrity sha512-JfF/vwOWzj7MD2Je/5r0beqBApTsQ68e2H8uV1T9wZctMM7WV9+z3JWvQ95yUFiMqyjVYRpXUR25y/b7qPE03Q== - dependencies: - d3-dsv "^1.2.0" - d3-time-format "^2.2.3" - node-fetch "^2.6.0" - topojson-client "^3.1.0" - vega-util "^1.13.1" - -vega-parser@~5.13.1: - version "5.13.1" - resolved "https://registry.yarnpkg.com/vega-parser/-/vega-parser-5.13.1.tgz#37770fe599808988a4c31e36bb632976a0119786" - integrity sha512-xTtfpZTgJ/UMclcSor8adpK95G5hh1YSCZom94eUnFabfsoEHAfl5K3RJd5XVjInUISsGFOyAR5LqXNth4k7BA== - dependencies: - vega-dataflow "^5.5.0" - vega-event-selector "^2.0.2" - vega-expression "^2.6.3" - vega-functions "^5.5.1" - vega-scale "^6.0.0" - vega-util "^1.13.1" - -vega-projection@^1.4.0, vega-projection@~1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/vega-projection/-/vega-projection-1.4.0.tgz#58c910b30306869132c4a26516164f8643fd1734" - integrity sha512-Prb/E41PqZT5b+46rHv6BZLDsXMe+NFClHxJ9NbwW7mntz8aMGAHiYolVa/M2KuTLbsXVgDAPxk/aA9tbQ0SSg== - dependencies: - d3-geo "^1.11.9" - d3-geo-projection "^2.7.1" - -vega-regression@~1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/vega-regression/-/vega-regression-1.0.5.tgz#dbe39dc6e3cb0c1f54f631be4edeedd3366f4b2c" - integrity sha512-HlKRQ0N5pQGqjmdy7Am+jtDCInI1IyAfHMbIVmpgF7H9odaUqtHynZijRtHRfbS6IXK+aXJ0WNsKW/oc+ox2fA== - dependencies: - d3-array "^2.4.0" - vega-dataflow "^5.4.1" - vega-statistics "^1.7.3" - vega-util "^1.12.2" - -vega-runtime@^5.0.2, vega-runtime@~5.0.2: - version "5.0.2" - resolved "https://registry.yarnpkg.com/vega-runtime/-/vega-runtime-5.0.2.tgz#4d7f327e05b2d4addc8b7472d49eb54f1118ff6c" - integrity sha512-Cuv+RY6kprH+vtNERg6xP4dgcdYGD2ZnxPxJNEtGi7dmtQQTBa1s7jQ0VDXTolsO6lKJ3B7np2GzKJYwevgj1A== - dependencies: - vega-dataflow "^5.1.1" - vega-util "^1.11.0" - -vega-scale@^6.0.0, vega-scale@~6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/vega-scale/-/vega-scale-6.0.0.tgz#b227127b00841e9d507a3235af2f8be475f7de83" - integrity sha512-uNJ5LC+s+XLxdO2iXC36/TLen3mMNv0wzhMZMNXa8h+Ih10geJ57sHbYYA8Z8403JC9AYTaWUe7m0H9CHgV9NA== - dependencies: - d3-array "^2.4.0" - d3-interpolate "^1.4.0" - d3-scale "^3.2.1" - vega-util "^1.12.1" - -vega-scenegraph@^4.5.0, vega-scenegraph@^4.6.0, vega-scenegraph@~4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/vega-scenegraph/-/vega-scenegraph-4.6.0.tgz#431b31c72ce528285c5808593dbb29cf8ed981e8" - integrity sha512-OwHr67kUyY5vG7VR1ovatVyynoHemIUxLgG6w5I4ckzCwCUWgvQRMhxT3bJnoIWvgE9AgLTiIL8mfoSLehK1IA== - dependencies: - d3-path "^1.0.9" - d3-shape "^1.3.7" - vega-canvas "^1.2.1" - vega-loader "^4.2.0" - vega-util "^1.13.1" - -vega-selections@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/vega-selections/-/vega-selections-5.1.0.tgz#5cbfe4d50e404129e5613bfa6470a1cb60cf6015" - integrity sha512-Gm+16RaCMkWbimqKh9kuIGMK91vutJsTbIDKBXxmq0c3pTvf+Djy6KfBoFsipEJ9wkwhXHSqpLqS1tExV93E9g== - dependencies: - vega-expression "^2.6.1" - vega-util "^1.11.0" - -vega-statistics@^1.7.1, vega-statistics@^1.7.3, vega-statistics@~1.7.3: - version "1.7.3" - resolved "https://registry.yarnpkg.com/vega-statistics/-/vega-statistics-1.7.3.tgz#8ce436eccebf484f7c7aa619c884e2427a7e044b" - integrity sha512-PRhoozWmlQRYesly4greSIJ5yaKljzmuPYiXbhcvxW3dvgcnWexKjh3Kxk66eTgf9vX6OU/5QEnKQqjWKXqiQQ== - dependencies: - d3-array "^2.4.0" - -vega-time@^1.0.0, vega-time@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/vega-time/-/vega-time-1.0.0.tgz#5bc61ff311260cd212ccc8cbd73049bcd29b1440" - integrity sha512-r0yOFr/VklJwD3ew1+fEcB7E0LBCLChYlwh0KoO6cTIWMdlC4KhIIUN3/FuBfUZ4qx4V/xp71xH2YYYZTH6izg== - dependencies: - d3-array "^2.3.3" - d3-time "^1.1.0" - d3-time-format "^2.2.1" - vega-util "^1.12.0" - -vega-transforms@~4.7.1: - version "4.7.1" - resolved "https://registry.yarnpkg.com/vega-transforms/-/vega-transforms-4.7.1.tgz#6bde7a05d43df4aa12e9cefe8ae559812c52b21c" - integrity sha512-F8KMowHTerCl6VZonbrItqKpTTf1/2TZDCCZ+HO0Izw9RiamkXrgwu3DZQ/H/wUwDiI/WrmKNIHh6L6pYs45AQ== - dependencies: - d3-array "^2.4.0" - vega-dataflow "^5.5.0" - vega-statistics "^1.7.3" - vega-time "^1.0.0" - vega-util "^1.13.1" - -vega-typings@~0.12.0: - version "0.12.4" - resolved "https://registry.yarnpkg.com/vega-typings/-/vega-typings-0.12.4.tgz#e3b298723db1a484aae6ca1cf760ff20fd46fae1" - integrity sha512-2tnAfFMxaGul1875q6v6vZW20s+j9hYGlt/lpp3yVYYGARG7hjgwyHpOKnHzw3C/huy4JaHaMhf3psXgG/VnHw== - dependencies: - vega-util "^1.12.1" - -vega-typings@~0.15.0: - version "0.15.0" - resolved "https://registry.yarnpkg.com/vega-typings/-/vega-typings-0.15.0.tgz#def47bff152deaaa7b796aa483a7db8beb928b9c" - integrity sha512-6XreJKYQEpqfsvNCMK+ULnY/Uy6F595LdRqM7lQO8g+lZUHbYDzhMI95a9SEz4e7KyRmdETytYKhHEL0hxQp9w== - dependencies: - vega-util "^1.13.1" - -vega-util@^1.11.0, vega-util@^1.12.0, vega-util@^1.12.1, vega-util@^1.12.2, vega-util@^1.13.1, vega-util@^1.8.0, vega-util@~1.13.1: - version "1.13.1" - resolved "https://registry.yarnpkg.com/vega-util/-/vega-util-1.13.1.tgz#3eae51043184c6b873c17b148755c21b01274a0e" - integrity sha512-TmvZSMKqhGlS7eAXphqJUhq+NZVYbvXX2ahargTRkVckGWjEUpWhMC7T13vYihrU2Lf/OevKbrruSXKOBxke2w== - -vega-util@~1.12.2: - version "1.12.2" - resolved "https://registry.yarnpkg.com/vega-util/-/vega-util-1.12.2.tgz#4997a50e56fa4be05046966568aed72246a40e27" - integrity sha512-p02+oQ/XU/gzY9S/CTZinym2NKWEMIneLc+FYdUeJZZnDGa3DvcNgUDlVR90JlwLcYZNs5dBdfYLfdRHsKZKiw== - -vega-view-transforms@~4.5.2: - version "4.5.2" - resolved "https://registry.yarnpkg.com/vega-view-transforms/-/vega-view-transforms-4.5.2.tgz#46b488aacc28be4c2f134be2e13f80378f399844" - integrity sha512-i12eEWSkCTGRyuFCn+96k2FvftZAygEkbYJOqSyoFdyAvdN37+87GdsDhgJJzGF31hjnN8OfzuVgxfueE0uhEQ== - dependencies: - vega-dataflow "^5.5.0" - vega-scenegraph "^4.6.0" - vega-util "^1.13.1" - -vega-view@~5.5.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/vega-view/-/vega-view-5.5.0.tgz#57901e5bce075c1389a949bb761d94b32f9118d0" - integrity sha512-hD3J00QRkh3zC1jF81UgxnXpTKY07nVKKG1ut7rlCpVdpEec8Ix6EckOHpAzMkHeY6aG5fbhSQbRYv05tzQy/A== - dependencies: - d3-array "^2.4.0" - d3-timer "^1.0.10" - vega-dataflow "^5.5.0" - vega-functions "^5.5.1" - vega-runtime "^5.0.2" - vega-scenegraph "^4.6.0" - vega-util "^1.13.1" - -vega-voronoi@~4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/vega-voronoi/-/vega-voronoi-4.1.1.tgz#1a09f86661cf85c75581282f19ff108603893715" - integrity sha512-agLmr+UGxJs5KB9D8GeZqxgeWWGoER/eVHPcFFPgVuoNBsrqf2bdoltmIkRnpiRsQnGCibGixhFEDCc9GGNAww== - dependencies: - d3-delaunay "^5.1.3" - vega-dataflow "^5.1.1" - vega-util "^1.11.0" - -vega-wordcloud@~4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/vega-wordcloud/-/vega-wordcloud-4.0.4.tgz#9169165c652478489e43cc56e05edbe14ce3d3c3" - integrity sha512-+FwgCKTj8JBMbBjNiVciLvjQnk+rC59uyecmlTsmtUGVZz5wyANooYcXt4xtiRu+G8ohdlJ6L/59+UFTaUR8og== - dependencies: - vega-canvas "^1.2.1" - vega-dataflow "^5.4.1" - vega-scale "^6.0.0" - vega-statistics "^1.7.1" - vega-util "^1.12.1" - -vega@^5.9.1: - version "5.10.1" - resolved "https://registry.yarnpkg.com/vega/-/vega-5.10.1.tgz#4eafef108c065cefa463375350bab7db27e06836" - integrity sha512-DSY0G3NnOk425TYVxRlrzdi1xKk3b5yfqjIRRhg+oN+T55PWCBzDnUG3GdqOSJnfs6zTp6485rR4IL8qpbDizA== - dependencies: - vega-crossfilter "~4.0.1" - vega-dataflow "~5.5.0" - vega-encode "~4.5.3" - vega-event-selector "~2.0.2" - vega-expression "~2.6.3" - vega-force "~4.0.3" - vega-functions "~5.5.1" - vega-geo "~4.3.0" - vega-hierarchy "~4.0.3" - vega-loader "~4.2.1" - vega-parser "~5.13.1" - vega-projection "~1.4.0" - vega-regression "~1.0.5" - vega-runtime "~5.0.2" - vega-scale "~6.0.0" - vega-scenegraph "~4.6.0" - vega-statistics "~1.7.3" - vega-time "~1.0.0" - vega-transforms "~4.7.1" - vega-typings "~0.15.0" - vega-util "~1.13.1" - vega-view "~5.5.0" - vega-view-transforms "~4.5.2" - vega-voronoi "~4.1.1" - vega-wordcloud "~4.0.4" - verror@1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" @@ -18532,6 +18262,15 @@ wcwidth@^1.0.0: dependencies: defaults "^1.0.3" +weak-napi@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/weak-napi/-/weak-napi-1.0.3.tgz#ff4dfa818db1c509ba4166530b42414ef74cbba6" + integrity sha512-cyqeMaYA5qI7RoZKAKvIHwEROEKDNxK7jXj3u56nF2rGBh+HFyhYmBb1/wAN4RqzRmkYKVVKQyqHpBoJjqtGUA== + dependencies: + bindings "^1.3.0" + node-addon-api "^1.1.0" + setimmediate-napi "^1.0.3" + webidl-conversions@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" @@ -18916,14 +18655,6 @@ yargs-parser@^15.0.1: camelcase "^5.0.0" decamelize "^1.2.0" -yargs-parser@^16.1.0: - version "16.1.0" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-16.1.0.tgz#73747d53ae187e7b8dbe333f95714c76ea00ecf1" - integrity sha512-H/V41UNZQPkUMIT5h5hiwg4QKIY1RPvoBV4XcjUbRM8Bk2oKqqyZ0DIEbTFZB0XjbtSPG8SAa/0DxCQmiRgzKg== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - yargs-parser@^18.1.1: version "18.1.2" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.2.tgz#2f482bea2136dbde0861683abea7756d30b504f1" @@ -18932,7 +18663,15 @@ yargs-parser@^18.1.1: camelcase "^5.0.0" decamelize "^1.2.0" -yargs@^14.2.2: +yargs-parser@^18.1.2: + version "18.1.3" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" + integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + +yargs@^14.0.0, yargs@^14.2.2: version "14.2.3" resolved "https://registry.yarnpkg.com/yargs/-/yargs-14.2.3.tgz#1a1c3edced1afb2a2fea33604bc6d1d8d688a414" integrity sha512-ZbotRWhF+lkjijC/VhmOT9wSgyBQ7+zr13+YLkhfsSiTriYsMzkTUFP18pFhWwBeMa5gUc1MzbhrO6/VB7c9Xg== @@ -18966,10 +18705,10 @@ yargs@^15.3.1: y18n "^4.0.0" yargs-parser "^18.1.1" -yargs@~15.1.0: - version "15.1.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.1.0.tgz#e111381f5830e863a89550bd4b136bb6a5f37219" - integrity sha512-T39FNN1b6hCW4SOIk1XyTOWxtXdcen0t+XYrysQmChzSipvhBO8Bj0nK1ozAasdk24dNWuMZvr4k24nz+8HHLg== +yargs@^15.4.1: + version "15.4.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" + integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== dependencies: cliui "^6.0.0" decamelize "^1.2.0" @@ -18981,7 +18720,7 @@ yargs@~15.1.0: string-width "^4.2.0" which-module "^2.0.0" y18n "^4.0.0" - yargs-parser "^16.1.0" + yargs-parser "^18.1.2" yeoman-assert@^3.1.0: version "3.1.1"