diff --git a/graphify/extractors/json_config.py b/graphify/extractors/json_config.py index e98666534f..4ca9562a99 100644 --- a/graphify/extractors/json_config.py +++ b/graphify/extractors/json_config.py @@ -13,6 +13,12 @@ "app.json", "now.json", "vercel.json", "angular.json", "nest-cli.json", "biome.json", "biome.jsonc", "renovate.json", ".babelrc", ".babelrc.json", ".eslintrc.json", ".prettierrc.json", ".prettierrc", "babel.config.json", + # The WordPress block manifest. It carries the nesting relationships that + # make a block graph worth having: parent, ancestor, allowedBlocks, + # providesContext / usesContext, and the editorScript / style handles. Only + # the blocks that happen to declare "$schema" reached the key probe, so a + # repo of blocks indexed as almost nothing. + "block.json", }) _CONFIG_JSON_KEYS = frozenset({ diff --git a/tests/test_extract.py b/tests/test_extract.py index d7a263b8e2..595af72ffc 100644 --- a/tests/test_extract.py +++ b/tests/test_extract.py @@ -4687,3 +4687,26 @@ def test_3252_metadata_preservation(tmp_path): assert param_ref["source_location"] == "L2" assert node_by_id[param_ref["target"]]["label"] == "User" assert node_by_id[param_ref["target"]]["source_file"] == "models.py" + + +def test_extract_json_wordpress_block_manifest(tmp_path): + """#3574: block.json is a manifest, not data JSON. + + It was in neither the filename allowlist nor the key probe, so a block that + did not happen to declare "$schema" produced no nodes at all. + """ + block = tmp_path / "block.json" + block.write_text( + json.dumps( + { + "apiVersion": 3, + "name": "acme/card", + "title": "Card", + "parent": ["acme/deck"], + "editorScript": "file:./index.js", + } + ) + ) + result = extract_json(block) + assert len(result["nodes"]) > 0 + assert "skipped" not in result