You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ha...@apache.org on 2026/07/05 04:38:44 UTC

(superset) 02/05: refactor(docs): load and parse YAML-based INTHEWILD without external Webpack loader

This is an automated email from the ASF dual-hosted git repository.

hainenber pushed a commit to branch feat/resolve-all-dependabot-vuln-alerts
in repository https://gitbox.apache.org/repos/asf/superset.git

commit a129667afb7b37f465452f9d4fabc6c5e06e6f8e
Author: hainenber <do...@gmail.com>
AuthorDate: Sun Jul 5 11:24:18 2026 +0700

    refactor(docs): load and parse YAML-based INTHEWILD without external Webpack loader
    
    Signed-off-by: hainenber <do...@gmail.com>
---
 docs/package.json            | 1 -
 docs/src/pages/inTheWild.tsx | 3 ++-
 docs/src/pages/index.tsx     | 3 ++-
 docs/src/types/yaml.d.ts     | 4 ++--
 docs/src/webpack.extend.ts   | 4 ++--
 5 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/docs/package.json b/docs/package.json
index ec1047c78a8..39736d56cb8 100644
--- a/docs/package.json
+++ b/docs/package.json
@@ -67,7 +67,6 @@
     "docusaurus-plugin-openapi-docs": "^5.1.0",
     "docusaurus-theme-openapi-docs": "^5.1.0",
     "js-yaml": "^5.1.0",
-    "js-yaml-loader": "^1.2.2",
     "json-bigint": "^1.0.0",
     "prism-react-renderer": "^2.4.1",
     "react": "^18.3.1",
diff --git a/docs/src/pages/inTheWild.tsx b/docs/src/pages/inTheWild.tsx
index 4cc4a79205f..870ced1c53a 100644
--- a/docs/src/pages/inTheWild.tsx
+++ b/docs/src/pages/inTheWild.tsx
@@ -19,6 +19,7 @@
 
 import Layout from '@theme/Layout';
 import { Avatar, Card, Col, Collapse, Row, Typography } from 'antd';
+import { load } from 'js-yaml';
 import BlurredSection from '../components/BlurredSection';
 import SectionHeader from '../components/SectionHeader';
 import DataSet from '../../../RESOURCES/INTHEWILD.yaml';
@@ -36,7 +37,7 @@ interface DataSetType {
   categories: Record<string, Organization[]>;
 }
 
-const typedDataSet = DataSet as DataSetType;
+const typedDataSet = load(DataSet) as DataSetType;
 
 const ContributorAvatars = ({ contributors }: { contributors?: string[] }) => {
   if (!contributors?.length) return null;
diff --git a/docs/src/pages/index.tsx b/docs/src/pages/index.tsx
index 04f8c89789b..214efdcd2de 100644
--- a/docs/src/pages/index.tsx
+++ b/docs/src/pages/index.tsx
@@ -22,6 +22,7 @@ import Link from '@docusaurus/Link';
 import { Card, Carousel, Flex } from 'antd';
 import styled from '@emotion/styled';
 import GitHubButton from 'react-github-btn';
+import { load } from 'js-yaml';
 import { mq } from '../utils';
 import SectionHeader from '../components/SectionHeader';
 import databaseData from '../data/databases.json';
@@ -60,7 +61,7 @@ interface DataSetType {
   categories: Record<string, Organization[]>;
 }
 
-const typedDataSet = DataSet as DataSetType;
+const typedDataSet = load(DataSet) as DataSetType;
 
 // Extract all organizations with logos for the carousel
 const companiesWithLogos = Object.values(typedDataSet.categories)
diff --git a/docs/src/types/yaml.d.ts b/docs/src/types/yaml.d.ts
index fc9442c7196..10482bea7ac 100644
--- a/docs/src/types/yaml.d.ts
+++ b/docs/src/types/yaml.d.ts
@@ -18,11 +18,11 @@
  */
 
 declare module '*.yaml' {
-  const content: unknown;
+  const content: string;
   export default content;
 }
 
 declare module '*.yml' {
-  const content: unknown;
+  const content: string;
   export default content;
 }
diff --git a/docs/src/webpack.extend.ts b/docs/src/webpack.extend.ts
index 32a91552d05..123584b9a02 100644
--- a/docs/src/webpack.extend.ts
+++ b/docs/src/webpack.extend.ts
@@ -61,10 +61,10 @@ export default function webpackExtendPlugin(): Plugin<void> {
         );
       });
 
-      // Add YAML loader rule directly to existing rules
+      // Load YAML file as raw text string
       config.module?.rules?.push({
         test: /\.ya?ml$/,
-        use: 'js-yaml-loader',
+        type: 'asset/source',
       });
 
       // Add swc-loader rule for superset-frontend files