jsc-typescript-ast-mcp 1.1.3 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -163,7 +163,7 @@ const buildNodeFromJSX = (node, project, options, depth) => {
163
163
  treeNode.filePath = localComponentFilePath;
164
164
  }
165
165
  }
166
- const props = extractPropsFromNode(node);
166
+ const props = extractPropsFromNode(node, options.dataIdAttribute);
167
167
  if (props) {
168
168
  treeNode.props = props;
169
169
  }
@@ -235,7 +235,7 @@ const addSpreadProps = (props, spreadAttribute) => {
235
235
  // Keep spread attributes as references so callers can resolve them later if needed.
236
236
  props[`...${expressionText}`] = expressionText;
237
237
  };
238
- export const extractPropsFromNode = (node) => {
238
+ export const extractPropsFromNode = (node, excludedAttributeName) => {
239
239
  const attributes = Node.isJsxElement(node)
240
240
  ? node.getOpeningElement().getAttributes()
241
241
  : node.getAttributes();
@@ -246,7 +246,9 @@ export const extractPropsFromNode = (node) => {
246
246
  for (const attribute of attributes) {
247
247
  if (Node.isJsxAttribute(attribute)) {
248
248
  const attributeName = attribute.getNameNode().getText();
249
- if (isStandardHtmlAttribute(attributeName)) {
249
+ const isExcludedDataIdAttribute = excludedAttributeName !== undefined &&
250
+ attributeName.toLowerCase() === excludedAttributeName.toLowerCase();
251
+ if (isStandardHtmlAttribute(attributeName) || isExcludedDataIdAttribute) {
250
252
  continue;
251
253
  }
252
254
  props[attributeName] = extractPropValue(attribute);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsc-typescript-ast-mcp",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "mcpName": "io.github.jscoobyced/jsc-typescript-ast-mcp",
5
5
  "description": "A Model Context Protocol (MCP) server that provides an abstract syntax tree (AST) representation of TypeScript code using the ts-morph library. It allows clients to analyze and manipulate TypeScript code structures, making it easier for AI models to understand and work with TypeScript projects. You can create a JSON representation of your React components, and use it for various purposes such as documentation, code analysis, or even generating new code based on existing components.",
6
6
  "main": "dist/index.js",