Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(monorepo): frontend code cleanup after monorepo #17639

Merged
merged 5 commits into from
Dec 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions superset-frontend/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
const path = require('path');

// Superset's webpack.config.js
const customConfig = require('../webpack.config.js');

Expand Down
8 changes: 0 additions & 8 deletions superset-frontend/jsconfig.json

This file was deleted.

17 changes: 0 additions & 17 deletions superset-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,6 @@
"last 3 safari versions",
"last 3 edge versions"
],
"stylelint": {
"rules": {
"block-opening-brace-space-before": "always",
"no-missing-end-of-source-newline": "never",
"rule-empty-line-before": [
"always",
{
"except": [
"first-nested"
],
"ignore": [
"after-comment"
]
}
]
}
},
"dependencies": {
"@ant-design/icons": "^4.2.2",
"@babel/runtime-corejs3": "^7.12.5",
Expand Down
12 changes: 0 additions & 12 deletions superset-frontend/packages/superset-ui-demo/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ const packages = readdirSync(basePath).filter(name => {
return stat.isSymbolicLink();
});

const rootPath = path.resolve(__dirname, '../../../');

const PLUGIN_PACKAGES_PATH_REGEXP = new RegExp(
`${path.resolve(
__dirname,
Expand Down Expand Up @@ -64,16 +62,6 @@ module.exports = {
),
});

// todo: remove hard code after move storybook to superset repo.
config.resolve.alias['@emotion/styled'] = path.resolve(
rootPath,
'./node_modules/@emotion/styled',
);
config.resolve.alias['@emotion/core'] = path.resolve(
rootPath,
'./node_modules/@emotion/core',
);

config.devtool = 'eval-cheap-module-source-map';
config.devServer = {
...config.devServer,
Expand Down
16 changes: 0 additions & 16 deletions superset-frontend/packages/superset-ui-demo/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,12 @@
"rootDir": "../../",
"emitDeclarationOnly": false,
"sourceMap": true,
"allowSyntheticDefaultImports": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noImplicitAny": false,
"noEmit": false,
"baseUrl": "../../",
"paths": {
"@superset-ui/core": ["./packages/superset-ui-core/src"],
"@superset-ui/chart-controls": [
"./packages/superset-ui-chart-controls/src"
],
"@superset-ui/legacy-plugin-chart-*": [
"./plugins/legacy-plugin-chart-*/src"
],
"@superset-ui/legacy-preset-chart-*": [
"./plugins/legacy-preset-chart-*/src"
],
"@superset-ui/plugin-chart-*": ["./plugins/plugin-chart-*/src"],
"@superset-ui/preset-chart-*": ["./plugins/preset-chart-*/src"],
}
},
"exclude": ["node_modules"],
"include": [
"storybook",
"../**/src",
Expand Down
90 changes: 0 additions & 90 deletions superset-frontend/scripts/check_license.sh

This file was deleted.

63 changes: 38 additions & 25 deletions superset-frontend/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
{
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"baseUrl": ".",
"composite": true,
"declaration": true,
"declarationMap": true,
"esModuleInterop": false,
"forceConsistentCasingInFileNames": true,
"importHelpers": false,
"jsx": "preserve",
"lib": ["dom", "dom.iterable", "esnext"],
"module": "esnext",
"moduleResolution": "node",
"noEmitOnError": true,
/* Type Checking */
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"outDir": "./dist",
"pretty": true,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"pretty" default value is true, remove it.

"strictNullChecks": true,

/* Modules */
"baseUrl": ".",
"module": "esnext",
"moduleResolution": "node",
"paths": {
"@superset-ui/core": ["./packages/superset-ui-core/src"],
"@superset-ui/chart-controls": [
Expand All @@ -33,20 +24,42 @@
],
"@superset-ui/plugin-chart-*": ["./plugins/plugin-chart-*/src"],
"@superset-ui/preset-chart-*": ["./plugins/preset-chart-*/src"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe L15-26 can be updated to

      "@superset-ui/*": [
        "./node_modules/@superset-ui/*/src",
        "./node_modules/@superset-ui/*",
      ],

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unfortunately, I got this error when I make this change. I will make a separate PR to improve it.

image

// for supressing errors caused by incompatible @types/react when `npm link`
// Ref: https://github.com/Microsoft/typescript/issues/6496#issuecomment-384786222
"react": ["./node_modules/@types/react", "react"]
},
"skipLibCheck": true,
"sourceMap": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"target": "esnext",
"types": [
"@emotion/react/types/css-prop",
"jest",
"@testing-library/jest-dom"
]
],

/* Emit */
"declaration": true,
"declarationMap": true,
"importHelpers": false,
"noEmitOnError": true,
"outDir": "./dist",
"sourceMap": true,

/* JavaScript Support */
"allowJs": true,

/* Interop Constraints */
"allowSyntheticDefaultImports": true,
"esModuleInterop": false,
"forceConsistentCasingInFileNames": true,

/* Backwards Compatibility */
"suppressImplicitAnyIndexErrors": true,

/* Language and Environment */
"target": "esnext",
"jsx": "preserve",
"lib": ["dom", "dom.iterable", "esnext"],

/* Projects */
"composite": true,

/* Completeness */
"skipLibCheck": true
},
"include": [
"./src/**/*",
Expand Down