mirror of https://github.com/apache/superset.git
refactor(monorepo): frontend code cleanup after monorepo (#17639)
* chore: frontend cleanup * remove unused files * remove stylelint * arrange tsconfig * updates
This commit is contained in:
parent
05752e3fe8
commit
4306289bfc
|
@ -16,8 +16,6 @@
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
const path = require('path');
|
|
||||||
|
|
||||||
// Superset's webpack.config.js
|
// Superset's webpack.config.js
|
||||||
const customConfig = require('../webpack.config.js');
|
const customConfig = require('../webpack.config.js');
|
||||||
|
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"baseUrl": ".",
|
|
||||||
"paths": {
|
|
||||||
"src/*": ["./src/*"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -72,23 +72,6 @@
|
||||||
"last 3 safari versions",
|
"last 3 safari versions",
|
||||||
"last 3 edge 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": {
|
"dependencies": {
|
||||||
"@ant-design/icons": "^4.2.2",
|
"@ant-design/icons": "^4.2.2",
|
||||||
"@babel/runtime-corejs3": "^7.12.5",
|
"@babel/runtime-corejs3": "^7.12.5",
|
||||||
|
|
|
@ -9,8 +9,6 @@ const packages = readdirSync(basePath).filter(name => {
|
||||||
return stat.isSymbolicLink();
|
return stat.isSymbolicLink();
|
||||||
});
|
});
|
||||||
|
|
||||||
const rootPath = path.resolve(__dirname, '../../../');
|
|
||||||
|
|
||||||
const PLUGIN_PACKAGES_PATH_REGEXP = new RegExp(
|
const PLUGIN_PACKAGES_PATH_REGEXP = new RegExp(
|
||||||
`${path.resolve(
|
`${path.resolve(
|
||||||
__dirname,
|
__dirname,
|
||||||
|
@ -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.devtool = 'eval-cheap-module-source-map';
|
||||||
config.devServer = {
|
config.devServer = {
|
||||||
...config.devServer,
|
...config.devServer,
|
||||||
|
|
|
@ -6,28 +6,12 @@
|
||||||
"rootDir": "../../",
|
"rootDir": "../../",
|
||||||
"emitDeclarationOnly": false,
|
"emitDeclarationOnly": false,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"allowSyntheticDefaultImports": true,
|
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"noImplicitAny": false,
|
"noImplicitAny": false,
|
||||||
"noEmit": false,
|
"noEmit": false,
|
||||||
"baseUrl": "../../",
|
"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": [
|
"include": [
|
||||||
"storybook",
|
"storybook",
|
||||||
"../**/src",
|
"../**/src",
|
||||||
|
|
|
@ -1,90 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
|
|
||||||
|
|
||||||
acquire_rat_jar () {
|
|
||||||
|
|
||||||
URL="https://repo1.maven.org/maven2/org/apache/rat/apache-rat/${RAT_VERSION}/apache-rat-${RAT_VERSION}.jar"
|
|
||||||
|
|
||||||
JAR="$rat_jar"
|
|
||||||
|
|
||||||
# Download rat launch jar if it hasn't been downloaded yet
|
|
||||||
if [ ! -f "$JAR" ]; then
|
|
||||||
# Download
|
|
||||||
printf "Attempting to fetch rat\n"
|
|
||||||
JAR_DL="${JAR}.part"
|
|
||||||
if [ $(command -v curl) ]; then
|
|
||||||
curl -L --silent "${URL}" > "$JAR_DL" && mv "$JAR_DL" "$JAR"
|
|
||||||
elif [ $(command -v wget) ]; then
|
|
||||||
wget --quiet ${URL} -O "$JAR_DL" && mv "$JAR_DL" "$JAR"
|
|
||||||
else
|
|
||||||
printf "You do not have curl or wget installed, please install rat manually.\n"
|
|
||||||
exit -1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
unzip -tq "$JAR" &> /dev/null
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
# We failed to download
|
|
||||||
rm "$JAR"
|
|
||||||
printf "Our attempt to download rat locally to ${JAR} failed. Please install rat manually.\n"
|
|
||||||
exit -1
|
|
||||||
fi
|
|
||||||
printf "Done downloading.\n"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Go to the project root directory
|
|
||||||
FWDIR="$(cd "`dirname "$0"`"/..; pwd)"
|
|
||||||
cd "$FWDIR"
|
|
||||||
|
|
||||||
TMP_DIR=/tmp
|
|
||||||
|
|
||||||
if test -x "$JAVA_HOME/bin/java"; then
|
|
||||||
declare java_cmd="$JAVA_HOME/bin/java"
|
|
||||||
else
|
|
||||||
declare java_cmd=java
|
|
||||||
fi
|
|
||||||
|
|
||||||
export RAT_VERSION=0.13
|
|
||||||
export rat_jar="${TMP_DIR}"/lib/apache-rat-${RAT_VERSION}.jar
|
|
||||||
mkdir -p ${TMP_DIR}/lib
|
|
||||||
|
|
||||||
|
|
||||||
[[ -f "$rat_jar" ]] || acquire_rat_jar || {
|
|
||||||
echo "Download failed. Obtain the rat jar manually and place it at $rat_jar"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "Running license checks. This can take a while."
|
|
||||||
echo "$FWDIR"/.rat-excludes
|
|
||||||
$java_cmd -jar "$rat_jar" -E "$FWDIR"/.rat-excludes -d "$FWDIR" > rat-results.txt
|
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo "RAT exited abnormally"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
ERRORS="$(cat rat-results.txt | grep -e "??")"
|
|
||||||
|
|
||||||
if test ! -z "$ERRORS"; then
|
|
||||||
echo >&2 "Could not find Apache license headers in the following files:"
|
|
||||||
echo >&2 "$ERRORS"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echo -e "RAT checks passed."
|
|
||||||
fi
|
|
|
@ -1,25 +1,16 @@
|
||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"allowJs": true,
|
/* Type Checking */
|
||||||
"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,
|
|
||||||
"noImplicitAny": true,
|
"noImplicitAny": true,
|
||||||
"noImplicitReturns": true,
|
"noImplicitReturns": true,
|
||||||
"noImplicitThis": true,
|
"noImplicitThis": true,
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
"outDir": "./dist",
|
"strictNullChecks": true,
|
||||||
"pretty": true,
|
|
||||||
|
/* Modules */
|
||||||
|
"baseUrl": ".",
|
||||||
|
"module": "esnext",
|
||||||
|
"moduleResolution": "node",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@superset-ui/core": ["./packages/superset-ui-core/src"],
|
"@superset-ui/core": ["./packages/superset-ui-core/src"],
|
||||||
"@superset-ui/chart-controls": [
|
"@superset-ui/chart-controls": [
|
||||||
|
@ -33,20 +24,42 @@
|
||||||
],
|
],
|
||||||
"@superset-ui/plugin-chart-*": ["./plugins/plugin-chart-*/src"],
|
"@superset-ui/plugin-chart-*": ["./plugins/plugin-chart-*/src"],
|
||||||
"@superset-ui/preset-chart-*": ["./plugins/preset-chart-*/src"],
|
"@superset-ui/preset-chart-*": ["./plugins/preset-chart-*/src"],
|
||||||
// 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": [
|
"types": [
|
||||||
"@emotion/react/types/css-prop",
|
"@emotion/react/types/css-prop",
|
||||||
"jest",
|
"jest",
|
||||||
"@testing-library/jest-dom"
|
"@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": [
|
"include": [
|
||||||
"./src/**/*",
|
"./src/**/*",
|
||||||
|
|
Loading…
Reference in New Issue