Compare commits

...

1 Commits

Author SHA1 Message Date
hainenber
977eef1481 chore(docs): thin out redundant deps used for docs building + resolve type issues
Signed-off-by: hainenber <dotronghai96@gmail.com>
2026-02-20 13:47:26 +07:00
4 changed files with 57 additions and 73 deletions

View File

@@ -21,7 +21,6 @@ import type { Config } from '@docusaurus/types';
import type { Options, ThemeConfig } from '@docusaurus/preset-classic';
import type * as OpenApiPlugin from 'docusaurus-plugin-openapi-docs';
import { themes } from 'prism-react-renderer';
import remarkImportPartial from 'remark-import-partial';
import remarkLocalizeBadges from './plugins/remark-localize-badges.mjs';
import remarkTechArticleSchema from './plugins/remark-tech-article-schema.mjs';
import * as fs from 'fs';
@@ -45,9 +44,8 @@ if (!versionsConfig.components.disabled) {
path: 'components',
routeBasePath: 'components',
sidebarPath: require.resolve('./sidebarComponents.js'),
editUrl:
'https://github.com/apache/superset/edit/master/docs/components',
remarkPlugins: [remarkImportPartial, remarkLocalizeBadges, remarkTechArticleSchema],
editUrl: 'https://github.com/apache/superset/edit/master/docs/components',
remarkPlugins: [remarkLocalizeBadges, remarkTechArticleSchema],
admonitions: {
keywords: ['note', 'tip', 'info', 'warning', 'danger', 'resources'],
extendDefaults: true,
@@ -75,13 +73,14 @@ if (!versionsConfig.developer_portal.disabled) {
sidebarPath: require.resolve('./sidebarTutorials.js'),
editUrl:
'https://github.com/apache/superset/edit/master/docs/developer_portal',
remarkPlugins: [remarkImportPartial, remarkLocalizeBadges, remarkTechArticleSchema],
remarkPlugins: [remarkLocalizeBadges, remarkTechArticleSchema],
admonitions: {
keywords: ['note', 'tip', 'info', 'warning', 'danger', 'resources'],
extendDefaults: true,
},
docItemComponent: '@theme/DocItem',
includeCurrentVersion: versionsConfig.developer_portal.includeCurrentVersion,
includeCurrentVersion:
versionsConfig.developer_portal.includeCurrentVersion,
lastVersion: versionsConfig.developer_portal.lastVersion,
onlyIncludeVersions: versionsConfig.developer_portal.onlyIncludeVersions,
versions: versionsConfig.developer_portal.versions,
@@ -93,7 +92,32 @@ if (!versionsConfig.developer_portal.disabled) {
}
// Build navbar items dynamically based on disabled flags
const dynamicNavbarItems = [];
const dynamicNavbarItems = [] as (
| {
label: string;
to: string;
items: {
label: string;
to: string;
}[];
}
| {
label: string;
position: 'left' | 'right' | undefined;
items: (
| {
type: string;
docsPluginId: string;
docId: string;
label: string;
}
| {
label: string;
href: string;
}
)[];
}
)[];
// Add Component Playground navbar item if not disabled
if (!versionsConfig.components.disabled) {
@@ -122,7 +146,10 @@ if (!versionsConfig.components.disabled) {
}
// Add Developer Portal navbar item if not hidden from nav
if (!versionsConfig.developer_portal.disabled && !versionsConfig.developer_portal.hideFromNav) {
if (
!versionsConfig.developer_portal.disabled &&
!versionsConfig.developer_portal.hideFromNav
) {
dynamicNavbarItems.push({
label: 'Developer Portal',
position: 'left',
@@ -196,7 +223,8 @@ const config: Config = {
name: 'Apache Superset',
applicationCategory: 'BusinessApplication',
operatingSystem: 'Cross-platform',
description: 'Apache Superset is a modern, enterprise-ready business intelligence web application for data exploration and visualization.',
description:
'Apache Superset is a modern, enterprise-ready business intelligence web application for data exploration and visualization.',
url: 'https://superset.apache.org',
license: 'https://www.apache.org/licenses/LICENSE-2.0',
author: {
@@ -235,7 +263,8 @@ const config: Config = {
'@type': 'SearchAction',
target: {
'@type': 'EntryPoint',
urlTemplate: 'https://superset.apache.org/search?q={search_term_string}',
urlTemplate:
'https://superset.apache.org/search?q={search_term_string}',
},
'query-input': 'required name=search_term_string',
},
@@ -464,13 +493,13 @@ const config: Config = {
}
return `https://github.com/apache/superset/edit/master/docs/${versionDocsDirPath}/${docPath}`;
},
remarkPlugins: [remarkImportPartial, remarkLocalizeBadges, remarkTechArticleSchema],
remarkPlugins: [remarkLocalizeBadges, remarkTechArticleSchema],
admonitions: {
keywords: ['note', 'tip', 'info', 'warning', 'danger', 'resources'],
extendDefaults: true,
},
includeCurrentVersion: versionsConfig.docs.includeCurrentVersion,
lastVersion: versionsConfig.docs.lastVersion, // Make 'next' the default
lastVersion: versionsConfig.docs.lastVersion, // Make 'next' the default
onlyIncludeVersions: versionsConfig.docs.onlyIncludeVersions,
versions: versionsConfig.docs.versions,
disableVersioning: false,
@@ -494,10 +523,10 @@ const config: Config = {
priority: 0.5,
ignorePatterns: ['/tags/**'],
filename: 'sitemap.xml',
createSitemapItems: async (params) => {
createSitemapItems: async params => {
const { defaultCreateSitemapItems, ...rest } = params;
const items = await defaultCreateSitemapItems(rest);
return items.map((item) => {
return items.map(item => {
// Boost priority for key pages
if (item.url.includes('/docs/intro')) {
return { ...item, priority: 1.0, changefreq: 'daily' };
@@ -528,14 +557,24 @@ const config: Config = {
themeConfig: {
// SEO: OpenGraph and Twitter meta tags
metadata: [
{ name: 'keywords', content: 'data visualization, business intelligence, BI, dashboards, SQL, analytics, open source, Apache, charts, reporting' },
{
name: 'keywords',
content:
'data visualization, business intelligence, BI, dashboards, SQL, analytics, open source, Apache, charts, reporting',
},
{ property: 'og:type', content: 'website' },
{ property: 'og:site_name', content: 'Apache Superset' },
{ property: 'og:image', content: 'https://superset.apache.org/img/superset-og-image.png' },
{
property: 'og:image',
content: 'https://superset.apache.org/img/superset-og-image.png',
},
{ property: 'og:image:width', content: '1200' },
{ property: 'og:image:height', content: '630' },
{ name: 'twitter:card', content: 'summary_large_image' },
{ name: 'twitter:image', content: 'https://superset.apache.org/img/superset-og-image.png' },
{
name: 'twitter:image',
content: 'https://superset.apache.org/img/superset-og-image.png',
},
{ name: 'twitter:site', content: '@ApacheSuperset' },
],
colorMode: {

View File

@@ -72,7 +72,6 @@
"docusaurus-theme-openapi-docs": "^4.6.0",
"js-yaml": "^4.1.1",
"js-yaml-loader": "^1.2.2",
"json-bigint": "^1.0.0",
"prism-react-renderer": "^2.4.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
@@ -80,19 +79,16 @@
"react-resize-detector": "^9.1.1",
"react-svg-pan-zoom": "^3.13.1",
"react-table": "^7.8.0",
"remark-import-partial": "^0.0.2",
"reselect": "^5.1.1",
"storybook": "^8.6.17",
"swagger-ui-react": "^5.31.1",
"swc-loader": "^0.2.7",
"tinycolor2": "^1.4.2",
"unist-util-visit": "^5.1.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^3.9.1",
"@docusaurus/tsconfig": "^3.9.2",
"@eslint/js": "^9.39.2",
"@types/js-yaml": "^4.0.9",
"@types/react": "^19.1.8",
"@typescript-eslint/eslint-plugin": "^8.52.0",
"@typescript-eslint/parser": "^8.55.0",

View File

@@ -123,7 +123,7 @@ export default function webpackExtendPlugin(): Plugin<void> {
path.resolve(__dirname, '../../superset-frontend/node_modules'),
],
alias: {
...config.resolve.alias,
...(config.resolve?.alias || {} ),
// Ensure single React instance across all modules (critical for hooks to work)
react: path.resolve(__dirname, '../node_modules/react'),
'react-dom': path.resolve(__dirname, '../node_modules/react-dom'),

View File

@@ -4538,11 +4538,6 @@
dependencies:
"@types/istanbul-lib-report" "*"
"@types/js-yaml@^4.0.9":
version "4.0.9"
resolved "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-4.0.9.tgz"
integrity sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==
"@types/json-bigint@^1.0.4":
version "1.0.4"
resolved "https://registry.npmjs.org/@types/json-bigint/-/json-bigint-1.0.4.tgz"
@@ -5538,11 +5533,6 @@ big.js@^5.2.2:
resolved "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz"
integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==
bignumber.js@^9.0.0:
version "9.3.1"
resolved "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.3.1.tgz"
integrity sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ==
binary-extensions@^2.0.0:
version "2.3.0"
resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz"
@@ -9387,13 +9377,6 @@ jsesc@~3.0.2:
resolved "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz"
integrity sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==
json-bigint@^1.0.0:
version "1.0.0"
resolved "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz"
integrity sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==
dependencies:
bignumber.js "^9.0.0"
json-buffer@3.0.1:
version "3.0.1"
resolved "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz"
@@ -12930,13 +12913,6 @@ remark-gfm@4.0.1, remark-gfm@^4.0.0:
remark-stringify "^11.0.0"
unified "^11.0.0"
remark-import-partial@^0.0.2:
version "0.0.2"
resolved "https://registry.npmjs.org/remark-import-partial/-/remark-import-partial-0.0.2.tgz"
integrity sha512-HuIcpGITU/PK+fZvYYamayCH/jlsoB2Uxj1QaGBgTYtcpozvJQth+PKp9NUZpksUldGAmJf59IyMJgczMpbhwg==
dependencies:
unist-util-visit "2.0.2"
remark-mdx@^3.0.0:
version "3.1.0"
resolved "https://registry.npmjs.org/remark-mdx/-/remark-mdx-3.1.0.tgz"
@@ -14188,11 +14164,6 @@ tiny-warning@^1.0.0:
resolved "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz"
integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==
tinycolor2@^1.4.2:
version "1.6.0"
resolved "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.6.0.tgz"
integrity sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw==
tinyexec@^1.0.1:
version "1.0.1"
resolved "https://registry.npmjs.org/tinyexec/-/tinyexec-1.0.1.tgz"
@@ -14518,11 +14489,6 @@ unist-util-generated@^2.0.0:
resolved "https://registry.npmjs.org/unist-util-generated/-/unist-util-generated-2.0.1.tgz"
integrity sha512-qF72kLmPxAw0oN2fwpWIqbXAVyEqUzDHMsbtPvOudIlUzXYFIeQIuxXQCRCFh22B7cixvU0MG7m3MW8FTq/S+A==
unist-util-is@^4.0.0:
version "4.1.0"
resolved "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.1.0.tgz"
integrity sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg==
unist-util-is@^5.0.0:
version "5.2.1"
resolved "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz"
@@ -14572,14 +14538,6 @@ unist-util-stringify-position@^4.0.0:
dependencies:
"@types/unist" "^3.0.0"
unist-util-visit-parents@^3.0.0:
version "3.1.1"
resolved "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz"
integrity sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg==
dependencies:
"@types/unist" "^2.0.0"
unist-util-is "^4.0.0"
unist-util-visit-parents@^5.1.1:
version "5.1.3"
resolved "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz"
@@ -14596,15 +14554,6 @@ unist-util-visit-parents@^6.0.0:
"@types/unist" "^3.0.0"
unist-util-is "^6.0.0"
unist-util-visit@2.0.2:
version "2.0.2"
resolved "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.2.tgz"
integrity sha512-HoHNhGnKj6y+Sq+7ASo2zpVdfdRifhTgX2KTU3B/sO/TTlZchp7E3S4vjRzDJ7L60KmrCPsQkVK3lEF3cz36XQ==
dependencies:
"@types/unist" "^2.0.0"
unist-util-is "^4.0.0"
unist-util-visit-parents "^3.0.0"
unist-util-visit@^4.0.0:
version "4.1.2"
resolved "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.2.tgz"