You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2025/06/27 20:52:28 UTC
(superset) branch master updated: chore(build): refactor plugin build script to remove unused stanzas (#33887)
This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new 2e9939baf2 chore(build): refactor plugin build script to remove unused stanzas (#33887)
2e9939baf2 is described below
commit 2e9939baf253e607a54722b1996baaf625e72133
Author: Đỗ Trọng Hải <41...@users.noreply.github.com>
AuthorDate: Sat Jun 28 03:52:22 2025 +0700
chore(build): refactor plugin build script to remove unused stanzas (#33887)
Signed-off-by: hainenber <do...@gmail.com>
---
superset-frontend/package-lock.json | 109 +-----------------------------------
superset-frontend/package.json | 1 -
superset-frontend/scripts/build.js | 76 ++++++-------------------
3 files changed, 17 insertions(+), 169 deletions(-)
diff --git a/superset-frontend/package-lock.json b/superset-frontend/package-lock.json
index d559c324b7..1f0db618ad 100644
--- a/superset-frontend/package-lock.json
+++ b/superset-frontend/package-lock.json
@@ -128,7 +128,6 @@
"redux-localstorage": "^0.4.1",
"redux-thunk": "^2.1.0",
"redux-undo": "^1.0.0-beta9-9-7",
- "rimraf": "^6.0.1",
"rison": "^0.1.1",
"scroll-into-view-if-needed": "^3.1.0",
"simple-zstd": "^1.4.2",
@@ -244,7 +243,7 @@
"eslint-plugin-storybook": "^0.8.0",
"eslint-plugin-testing-library": "^6.4.0",
"eslint-plugin-theme-colors": "file:eslint-rules/eslint-plugin-theme-colors",
- "fetch-mock": "^11.1.4",
+ "fetch-mock": "^11.1.5",
"fork-ts-checker-webpack-plugin": "^9.0.2",
"history": "^5.3.0",
"html-webpack-plugin": "^5.6.3",
@@ -46161,112 +46160,6 @@
"node": ">= 0.8.15"
}
},
- "node_modules/rimraf": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.0.1.tgz",
- "integrity": "sha512-9dkvaxAsk/xNXSJzMgFqqMCuFgt2+KsOFek3TMLfo8NCPfWpBmqwyNn5Y+NX56QUYfCtsyhF3ayiboEoUmJk/A==",
- "license": "ISC",
- "dependencies": {
- "glob": "^11.0.0",
- "package-json-from-dist": "^1.0.0"
- },
- "bin": {
- "rimraf": "dist/esm/bin.mjs"
- },
- "engines": {
- "node": "20 || >=22"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
- "node_modules/rimraf/node_modules/brace-expansion": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
- "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
- "license": "MIT",
- "dependencies": {
- "balanced-match": "^1.0.0"
- }
- },
- "node_modules/rimraf/node_modules/glob": {
- "version": "11.0.1",
- "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.1.tgz",
- "integrity": "sha512-zrQDm8XPnYEKawJScsnM0QzobJxlT/kHOOlRTio8IH/GrmxRE5fjllkzdaHclIuNjUQTJYH2xHNIGfdpJkDJUw==",
- "license": "ISC",
- "dependencies": {
- "foreground-child": "^3.1.0",
- "jackspeak": "^4.0.1",
- "minimatch": "^10.0.0",
- "minipass": "^7.1.2",
- "package-json-from-dist": "^1.0.0",
- "path-scurry": "^2.0.0"
- },
- "bin": {
- "glob": "dist/esm/bin.mjs"
- },
- "engines": {
- "node": "20 || >=22"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
- "node_modules/rimraf/node_modules/jackspeak": {
- "version": "4.0.2",
- "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.0.2.tgz",
- "integrity": "sha512-bZsjR/iRjl1Nk1UkjGpAzLNfQtzuijhn2g+pbZb98HQ1Gk8vM9hfbxeMBP+M2/UUdwj0RqGG3mlvk2MsAqwvEw==",
- "license": "BlueOak-1.0.0",
- "dependencies": {
- "@isaacs/cliui": "^8.0.2"
- },
- "engines": {
- "node": "20 || >=22"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
- "node_modules/rimraf/node_modules/lru-cache": {
- "version": "11.0.2",
- "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.2.tgz",
- "integrity": "sha512-123qHRfJBmo2jXDbo/a5YOQrJoHF/GNQTLzQ5+IdK5pWpceK17yRc6ozlWd25FxvGKQbIUs91fDFkXmDHTKcyA==",
- "license": "ISC",
- "engines": {
- "node": "20 || >=22"
- }
- },
- "node_modules/rimraf/node_modules/minimatch": {
- "version": "10.0.1",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz",
- "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==",
- "license": "ISC",
- "dependencies": {
- "brace-expansion": "^2.0.1"
- },
- "engines": {
- "node": "20 || >=22"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
- "node_modules/rimraf/node_modules/path-scurry": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz",
- "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==",
- "license": "BlueOak-1.0.0",
- "dependencies": {
- "lru-cache": "^11.0.0",
- "minipass": "^7.1.2"
- },
- "engines": {
- "node": "20 || >=22"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
"node_modules/rison": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/rison/-/rison-0.1.1.tgz",
diff --git a/superset-frontend/package.json b/superset-frontend/package.json
index e4837ad6e9..f84e12dd44 100644
--- a/superset-frontend/package.json
+++ b/superset-frontend/package.json
@@ -196,7 +196,6 @@
"redux-localstorage": "^0.4.1",
"redux-thunk": "^2.1.0",
"redux-undo": "^1.0.0-beta9-9-7",
- "rimraf": "^6.0.1",
"rison": "^0.1.1",
"scroll-into-view-if-needed": "^3.1.0",
"simple-zstd": "^1.4.2",
diff --git a/superset-frontend/scripts/build.js b/superset-frontend/scripts/build.js
index 5d73aaadc5..2cabf466ec 100644
--- a/superset-frontend/scripts/build.js
+++ b/superset-frontend/scripts/build.js
@@ -25,39 +25,11 @@
*/
process.env.PATH = `./node_modules/.bin:${process.env.PATH}`;
-const { sync } = 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: false,
- })
- .option('type', {
- describe: 'Whether to run tsc',
- type: 'boolean',
- default: true,
- });
+const { argv } = require('yargs');
-const {
- _: globs,
- lint: shouldLint,
- babel: shouldRunBabel,
- clean: shouldCleanup,
- type: shouldRunTyping,
-} = argv;
+const { _: globs } = argv;
const glob = globs.length > 1 ? `{${globs.join(',')}}` : globs[0] || '*';
const BABEL_CONFIG = '--config-file=../../babel.config.js';
@@ -105,35 +77,19 @@ function getPackages(packagePattern, tsOnly = false) {
let scope = getPackages(glob);
-if (shouldLint) {
- run(`npm run eslint -- . --fix {packages,plugins}/${scope}/{src,test}`);
-}
-
-if (shouldCleanup) {
- // these modules will be installed by `npm link` but not useful for actual build
- const dirtyModules = 'node_modules/@types/react,node_modules/@superset-ui';
- const cachePath = `./node_modules/${scope}/{lib,esm,tsconfig.tsbuildinfo,${dirtyModules}}`;
- console.log(`\n>> Cleaning up ${cachePath}`);
- sync(cachePath);
-}
+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`);
-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, NODE_ENV: 'production', BABEL_OUTPUT: 'esm' },
+});
- console.log('--- Run babel esm ---');
- // run again with
- run(`${babelCommand} --out-dir esm`, {
- env: { ...process.env, NODE_ENV: 'production', BABEL_OUTPUT: 'esm' },
- });
-}
-
-if (shouldRunTyping) {
- console.log('--- Run tsc ---');
- // only run tsc for packages with ts files
- scope = getPackages(glob, true);
- run(`lerna exec --stream --concurrency 3 --scope ${scope} \
- -- ../../scripts/tsc.sh --build`);
-}
+console.log('--- Run tsc ---');
+// only run tsc for packages with ts files
+scope = getPackages(glob, true);
+run(`lerna exec --stream --concurrency 3 --scope ${scope} \
+ -- ../../scripts/tsc.sh --build`);