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

[docs-infra] Ignore classes tagged with @ignore #41009

Merged
merged 1 commit into from Feb 8, 2024

Conversation

cherniavskii
Copy link
Member

We want to ignore some internal classes in Data Grid: mui/mui-x#11924 (comment)

Example:

Adding @ignore tag:

diff --git a/packages/mui-base/src/Badge/badgeClasses.ts b/packages/mui-base/src/Badge/badgeClasses.ts
index 6ed7dfc7e1..788e30067f 100644
--- a/packages/mui-base/src/Badge/badgeClasses.ts
+++ b/packages/mui-base/src/Badge/badgeClasses.ts
@@ -8,7 +8,10 @@ export interface BadgeClasses {
   root: string;
   /** Class name applied to the badge `span` element. */
   badge: string;
-  /** State class applied to the badge `span` element if `invisible={true}`. */
+  /**
+   * @ignore - do not document.
+   * State class applied to the badge `span` element if `invisible={true}`.
+   */
   invisible: string;
 } 

Results in the following diff:

diff --git a/docs/pages/base-ui/api/badge.json b/docs/pages/base-ui/api/badge.json
index bd111d150b..963aee8290 100644
--- a/docs/pages/base-ui/api/badge.json
+++ b/docs/pages/base-ui/api/badge.json
@@ -34,14 +34,7 @@
       "class": "base-Badge-badge"
     }
   ],
-  "classes": [
-    {
-      "key": "invisible",
-      "className": "base-Badge-invisible",
-      "description": "State class applied to the badge `span` element if `invisible={true}`.",
-      "isGlobal": false
-    }
-  ],
+  "classes": [],
   "spread": true,
   "muiName": "Badge",
   "forwardsRefTo": "HTMLSpanElement",
diff --git a/docs/translations/api-docs-base/badge/badge.json b/docs/translations/api-docs-base/badge/badge.json
index 0af4baae88..8db2aa7d15 100644
--- a/docs/translations/api-docs-base/badge/badge.json
+++ b/docs/translations/api-docs-base/badge/badge.json
@@ -13,13 +13,7 @@
       "description": "The components used for each slot inside the Badge. Either a string to use a HTML element or a component."
     }
   },
-  "classDescriptions": {
-    "invisible": {
-      "description": "State class applied to {{nodeName}} if {{conditions}}.",
-      "nodeName": "the badge <code>span</code> element",
-      "conditions": "<code>invisible={true}</code>"
-    }
-  },
+  "classDescriptions": {},
   "slotDescriptions": {
     "badge": "The component that renders the badge.",
     "root": "The component that renders the root."

@mui-bot
Copy link

mui-bot commented Feb 8, 2024

Netlify deploy preview

https://deploy-preview-41009--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 6652d6a

Copy link
Member

@alexfauquette alexfauquette left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@@ -109,6 +109,10 @@ function extractClassesFromInterface(
if (classesTypeDeclaration && ts.isInterfaceDeclaration(classesTypeDeclaration)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Tested in mui/mui-x#12001 - works as expected

@cherniavskii cherniavskii merged commit 2ae3f29 into mui:master Feb 8, 2024
20 checks passed
@cherniavskii cherniavskii deleted the allow-ignoring-classes branch February 8, 2024 17:39
@oliviertassinari oliviertassinari added the new feature New feature or request label Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request scope: docs-infra Specific to the docs-infra product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants