Skip to content

Commit

Permalink
refactor: import value name from root of superset-ui/core (#17947)
Browse files Browse the repository at this point in the history
* chart

* index and number-format

* char-composition and color

* connection

* dimension and math-expression

* models

* query

* time-format

* residual modules

* change config of jest and eslint

config

* wip

update package.json

* fix lint

* WithLegend import from superset-ui/core
  • Loading branch information
zhaoyongjie authored Jan 8, 2022
1 parent 8b1e44c commit cb97e37
Show file tree
Hide file tree
Showing 117 changed files with 472 additions and 382 deletions.
5 changes: 3 additions & 2 deletions superset-frontend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ module.exports = {
moduleDirectory: ['node_modules', '.'],
},
},
// Allow only core/src and core/test, avoid import modules from lib
'import/internal-regex': /^@superset-ui\/core\/(src|test)\/.*/,
// only allow import from top level of module
'import/core-modules': importCoreModules,
react: {
version: 'detect',
Expand Down Expand Up @@ -156,6 +155,8 @@ module.exports = {
'*.test.tsx',
'*.test.js',
'*.test.jsx',
'*.stories.tsx',
'*.stories.jsx',
'fixtures.*',
],
plugins: ['jest', 'jest-dom', 'no-only-tests', 'testing-library'],
Expand Down
16 changes: 6 additions & 10 deletions superset-frontend/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,20 @@

module.exports = {
testRegex: '\\/(spec|src|plugins|packages)\\/.*(_spec|\\.test)\\.[jt]sx?$',
testPathIgnorePatterns: [
'packages\\/generator-superset\\/.*',
'/node_modules/',
],
moduleNameMapper: {
'\\.(css|less|geojson)$': '<rootDir>/spec/__mocks__/mockExportObject.js',
'\\.(gif|ttf|eot|png|jpg)$': '<rootDir>/spec/__mocks__/mockExportString.js',
'\\.svg$': '<rootDir>/spec/__mocks__/svgrMock.tsx',
'^src/(.*)$': '<rootDir>/src/$1',
'^spec/(.*)$': '<rootDir>/spec/$1',
// mapping to souce code instead of lib or esm module
'@superset-ui/(((?!(core/src)).)*)$':
'<rootDir>/node_modules/@superset-ui/$1/src',
'@superset-ui/core/src/(.*)$':
'<rootDir>/node_modules/@superset-ui/core/src/$1',
// mapping plugins of superset-ui to souce code
'@superset-ui/(.*)$': '<rootDir>/node_modules/@superset-ui/$1/src',
},
testEnvironment: 'jsdom',
modulePathIgnorePatterns: ['<rootDir>/temporary_superset_ui'],
modulePathIgnorePatterns: [
'<rootDir>/temporary_superset_ui',
'<rootDir>/packages/generator-superset',
],
setupFilesAfterEnv: ['<rootDir>/spec/helpers/setup.ts'],
testURL: 'http://localhost',
collectCoverageFrom: [
Expand Down
Loading

0 comments on commit cb97e37

Please sign in to comment.