periplus-map 0.2.1__py3-none-any.whl

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.
Files changed (272) hide show
  1. periplus/__init__.py +70 -0
  2. periplus/checkmap.py +80 -0
  3. periplus/cli.py +658 -0
  4. periplus/contract/schema/map.schema.json +138 -0
  5. periplus/contract/schema/navigation.schema.json +200 -0
  6. periplus/contract/schema/pack-file.schema.json +1405 -0
  7. periplus/contract/schema/pack-manifest.schema.json +245 -0
  8. periplus/contract/schema/project-settings.schema.json +85 -0
  9. periplus/contract/spec/engine.md +151 -0
  10. periplus/contract/spec/rules.md +352 -0
  11. periplus/detect.py +228 -0
  12. periplus/engine/__init__.py +5 -0
  13. periplus/engine/check.py +481 -0
  14. periplus/engine/emit.py +368 -0
  15. periplus/engine/packload.py +2321 -0
  16. periplus/engine/pattern.py +27 -0
  17. periplus/engine/rules.py +1946 -0
  18. periplus/engine/select.py +491 -0
  19. periplus/engine/source.py +172 -0
  20. periplus/engine/tree.py +424 -0
  21. periplus/errors.py +332 -0
  22. periplus/init.py +358 -0
  23. periplus/layout.py +28 -0
  24. periplus/manifest.py +498 -0
  25. periplus/map.py +364 -0
  26. periplus/navigate/__init__.py +1 -0
  27. periplus/navigate/find.py +143 -0
  28. periplus/navigate/ids.py +30 -0
  29. periplus/navigate/listing.py +42 -0
  30. periplus/navigate/mapfile.py +189 -0
  31. periplus/navigate/path.py +175 -0
  32. periplus/navigate/show.py +175 -0
  33. periplus/navigate/types.py +83 -0
  34. periplus/navigate/walk.py +138 -0
  35. periplus/packs/advancedqueue_basic@0.0.1/pack.yaml +14 -0
  36. periplus/packs/advancedqueue_basic@0.0.1/queue_job_type/queue_job_type.yaml +9 -0
  37. periplus/packs/advancedqueue_basic@0.0.1/queue_job_type/queue_job_type_annotation.yaml +43 -0
  38. periplus/packs/advancedqueue_basic@0.0.1/queue_job_type/queue_job_type_attribute.yaml +43 -0
  39. periplus/packs/ai_basic@0.0.1/ai_agent/ai_agent.yaml +8 -0
  40. periplus/packs/ai_basic@0.0.1/ai_agent/ai_agent_attribute.yaml +43 -0
  41. periplus/packs/ai_basic@0.0.1/ai_function_call/ai_function_call.yaml +8 -0
  42. periplus/packs/ai_basic@0.0.1/ai_function_call/ai_function_call_attribute.yaml +43 -0
  43. periplus/packs/ai_basic@0.0.1/pack.yaml +15 -0
  44. periplus/packs/config_pages_basic@0.0.1/bundle/config_pages_bundle_config.yaml +54 -0
  45. periplus/packs/config_pages_basic@0.0.1/pack.yaml +11 -0
  46. periplus/packs/crop_basic@0.0.1/bundle/crop_bundle_config.yaml +54 -0
  47. periplus/packs/crop_basic@0.0.1/pack.yaml +11 -0
  48. periplus/packs/drupal@0.1.0/block/block_placement.yaml +25 -0
  49. periplus/packs/drupal@0.1.0/block/block_placement_code.yaml +58 -0
  50. periplus/packs/drupal@0.1.0/block/block_placement_config.yaml +53 -0
  51. periplus/packs/drupal@0.1.0/block/block_plugin.yaml +52 -0
  52. periplus/packs/drupal@0.1.0/block/block_plugin_altered.yaml +61 -0
  53. periplus/packs/drupal@0.1.0/block/block_plugin_annotation.yaml +69 -0
  54. periplus/packs/drupal@0.1.0/block/block_plugin_attribute.yaml +56 -0
  55. periplus/packs/drupal@0.1.0/block/block_plugin_content.yaml +46 -0
  56. periplus/packs/drupal@0.1.0/block/block_plugin_derived.yaml +110 -0
  57. periplus/packs/drupal@0.1.0/block/block_plugin_deriver.yaml +30 -0
  58. periplus/packs/drupal@0.1.0/block/block_type.yaml +14 -0
  59. periplus/packs/drupal@0.1.0/block/block_type_code.yaml +43 -0
  60. periplus/packs/drupal@0.1.0/block/block_type_config.yaml +45 -0
  61. periplus/packs/drupal@0.1.0/cache/cache.yaml +18 -0
  62. periplus/packs/drupal@0.1.0/cache/cache_backend.yaml +31 -0
  63. periplus/packs/drupal@0.1.0/component/sdc.yaml +19 -0
  64. periplus/packs/drupal@0.1.0/component/sdc_definition.yaml +25 -0
  65. periplus/packs/drupal@0.1.0/component/sdc_use.yaml +25 -0
  66. periplus/packs/drupal@0.1.0/config/config_object.yaml +65 -0
  67. periplus/packs/drupal@0.1.0/display/display.yaml +32 -0
  68. periplus/packs/drupal@0.1.0/display/display_code.yaml +53 -0
  69. periplus/packs/drupal@0.1.0/display/display_config.yaml +95 -0
  70. periplus/packs/drupal@0.1.0/entity/entity.yaml +33 -0
  71. periplus/packs/drupal@0.1.0/entity/entity_class.yaml +60 -0
  72. periplus/packs/drupal@0.1.0/entity/entity_save.yaml +27 -0
  73. periplus/packs/drupal@0.1.0/entity/entity_type_annotation.yaml +85 -0
  74. periplus/packs/drupal@0.1.0/entity/entity_type_attribute.yaml +76 -0
  75. periplus/packs/drupal@0.1.0/field/field_instance_code.yaml +40 -0
  76. periplus/packs/drupal@0.1.0/field/field_instance_config.yaml +58 -0
  77. periplus/packs/drupal@0.1.0/field/field_storage.yaml +37 -0
  78. periplus/packs/drupal@0.1.0/field/field_storage_code.yaml +39 -0
  79. periplus/packs/drupal@0.1.0/field/field_storage_config.yaml +24 -0
  80. periplus/packs/drupal@0.1.0/form/form.yaml +48 -0
  81. periplus/packs/drupal@0.1.0/form/form_class.yaml +50 -0
  82. periplus/packs/drupal@0.1.0/form/form_id.yaml +48 -0
  83. periplus/packs/drupal@0.1.0/form/form_methods.yaml +39 -0
  84. periplus/packs/drupal@0.1.0/hook/hook.yaml +8 -0
  85. periplus/packs/drupal@0.1.0/hook/hook_attribute.yaml +28 -0
  86. periplus/packs/drupal@0.1.0/module/module.yaml +8 -0
  87. periplus/packs/drupal@0.1.0/module/module_info.yaml +50 -0
  88. periplus/packs/drupal@0.1.0/pack.yaml +184 -0
  89. periplus/packs/drupal@0.1.0/plugin/plugin.yaml +17 -0
  90. periplus/packs/drupal@0.1.0/plugin/plugin_annotation.yaml +120 -0
  91. periplus/packs/drupal@0.1.0/recommendations/recommendations.yaml +14 -0
  92. periplus/packs/drupal@0.1.0/service/service.yaml +19 -0
  93. periplus/packs/drupal@0.1.0/service/service_autowire.yaml +28 -0
  94. periplus/packs/drupal@0.1.0/service/service_definition.yaml +24 -0
  95. periplus/packs/drupal@0.1.0/service/service_use.yaml +43 -0
  96. periplus/packs/drupal_basic@0.3.0/action/action.yaml +9 -0
  97. periplus/packs/drupal_basic@0.3.0/action/action_annotation.yaml +43 -0
  98. periplus/packs/drupal_basic@0.3.0/action/action_attribute.yaml +43 -0
  99. periplus/packs/drupal_basic@0.3.0/block/block_placement.yaml +16 -0
  100. periplus/packs/drupal_basic@0.3.0/block/block_placement_config.yaml +51 -0
  101. periplus/packs/drupal_basic@0.3.0/block_plugin/block_plugin.yaml +14 -0
  102. periplus/packs/drupal_basic@0.3.0/block_plugin/block_plugin_annotation.yaml +47 -0
  103. periplus/packs/drupal_basic@0.3.0/block_plugin/block_plugin_attribute.yaml +43 -0
  104. periplus/packs/drupal_basic@0.3.0/block_type/block_type.yaml +8 -0
  105. periplus/packs/drupal_basic@0.3.0/block_type/block_type_config.yaml +54 -0
  106. periplus/packs/drupal_basic@0.3.0/boundary/boundary_types.yaml +19 -0
  107. periplus/packs/drupal_basic@0.3.0/bundle/bundle.yaml +20 -0
  108. periplus/packs/drupal_basic@0.3.0/bundle/bundle_config.yaml +393 -0
  109. periplus/packs/drupal_basic@0.3.0/call/call.yaml +349 -0
  110. periplus/packs/drupal_basic@0.3.0/component/component.yaml +30 -0
  111. periplus/packs/drupal_basic@0.3.0/config/config_object.yaml +119 -0
  112. periplus/packs/drupal_basic@0.3.0/constraint/constraint.yaml +8 -0
  113. periplus/packs/drupal_basic@0.3.0/constraint/constraint_annotation.yaml +43 -0
  114. periplus/packs/drupal_basic@0.3.0/constraint/constraint_attribute.yaml +43 -0
  115. periplus/packs/drupal_basic@0.3.0/display/display.yaml +30 -0
  116. periplus/packs/drupal_basic@0.3.0/display/display_config.yaml +203 -0
  117. periplus/packs/drupal_basic@0.3.0/display/display_mode_config.yaml +60 -0
  118. periplus/packs/drupal_basic@0.3.0/entity_type/config_entity_type_annotation.yaml +46 -0
  119. periplus/packs/drupal_basic@0.3.0/entity_type/config_entity_type_attribute.yaml +43 -0
  120. periplus/packs/drupal_basic@0.3.0/entity_type/content_entity_type_annotation.yaml +46 -0
  121. periplus/packs/drupal_basic@0.3.0/entity_type/content_entity_type_attribute.yaml +43 -0
  122. periplus/packs/drupal_basic@0.3.0/entity_type/entity_type.yaml +16 -0
  123. periplus/packs/drupal_basic@0.3.0/field/field_instance_config.yaml +116 -0
  124. periplus/packs/drupal_basic@0.3.0/field/field_storage.yaml +21 -0
  125. periplus/packs/drupal_basic@0.3.0/field/field_storage_config.yaml +45 -0
  126. periplus/packs/drupal_basic@0.3.0/field_formatter/field_formatter.yaml +8 -0
  127. periplus/packs/drupal_basic@0.3.0/field_formatter/field_formatter_annotation.yaml +46 -0
  128. periplus/packs/drupal_basic@0.3.0/field_formatter/field_formatter_attribute.yaml +43 -0
  129. periplus/packs/drupal_basic@0.3.0/field_type/field_type_annotation.yaml +46 -0
  130. periplus/packs/drupal_basic@0.3.0/field_type/field_type_attribute.yaml +50 -0
  131. periplus/packs/drupal_basic@0.3.0/field_widget/field_widget_annotation.yaml +46 -0
  132. periplus/packs/drupal_basic@0.3.0/field_widget/field_widget_attribute.yaml +50 -0
  133. periplus/packs/drupal_basic@0.3.0/form/form_id.yaml +80 -0
  134. periplus/packs/drupal_basic@0.3.0/hook/hook.yaml +100 -0
  135. periplus/packs/drupal_basic@0.3.0/hook/hook_attribute.yaml +64 -0
  136. periplus/packs/drupal_basic@0.3.0/hook/hook_theme_include.yaml +34 -0
  137. periplus/packs/drupal_basic@0.3.0/library/library.yaml +12 -0
  138. periplus/packs/drupal_basic@0.3.0/library/library_definition.yaml +58 -0
  139. periplus/packs/drupal_basic@0.3.0/local_action/local_action.yaml +12 -0
  140. periplus/packs/drupal_basic@0.3.0/local_action/local_action_definition.yaml +49 -0
  141. periplus/packs/drupal_basic@0.3.0/mail/mail.yaml +8 -0
  142. periplus/packs/drupal_basic@0.3.0/mail/mail_attribute.yaml +43 -0
  143. periplus/packs/drupal_basic@0.3.0/media_source/media_source.yaml +8 -0
  144. periplus/packs/drupal_basic@0.3.0/media_source/media_source_annotation.yaml +43 -0
  145. periplus/packs/drupal_basic@0.3.0/media_source/media_source_attribute.yaml +79 -0
  146. periplus/packs/drupal_basic@0.3.0/menu_link/menu_link.yaml +18 -0
  147. periplus/packs/drupal_basic@0.3.0/menu_link/menu_link_definition.yaml +48 -0
  148. periplus/packs/drupal_basic@0.3.0/module/module.yaml +7 -0
  149. periplus/packs/drupal_basic@0.3.0/module/module_info.yaml +58 -0
  150. periplus/packs/drupal_basic@0.3.0/pack.yaml +528 -0
  151. periplus/packs/drupal_basic@0.3.0/permission/permission.yaml +7 -0
  152. periplus/packs/drupal_basic@0.3.0/permission/permission_definition.yaml +27 -0
  153. periplus/packs/drupal_basic@0.3.0/queue_worker/queue_worker.yaml +9 -0
  154. periplus/packs/drupal_basic@0.3.0/queue_worker/queue_worker_annotation.yaml +43 -0
  155. periplus/packs/drupal_basic@0.3.0/queue_worker/queue_worker_attribute.yaml +43 -0
  156. periplus/packs/drupal_basic@0.3.0/rest_resource/rest_resource.yaml +8 -0
  157. periplus/packs/drupal_basic@0.3.0/rest_resource/rest_resource_annotation.yaml +43 -0
  158. periplus/packs/drupal_basic@0.3.0/rest_resource/rest_resource_attribute.yaml +43 -0
  159. periplus/packs/drupal_basic@0.3.0/role/role.yaml +14 -0
  160. periplus/packs/drupal_basic@0.3.0/role/role_config.yaml +44 -0
  161. periplus/packs/drupal_basic@0.3.0/route/route.yaml +42 -0
  162. periplus/packs/drupal_basic@0.3.0/route/route_definition.yaml +113 -0
  163. periplus/packs/drupal_basic@0.3.0/route/route_options.yaml +55 -0
  164. periplus/packs/drupal_basic@0.3.0/route/route_requirements.yaml +108 -0
  165. periplus/packs/drupal_basic@0.3.0/service/service.yaml +56 -0
  166. periplus/packs/drupal_basic@0.3.0/service/service_definition.yaml +181 -0
  167. periplus/packs/drupal_basic@0.3.0/template/template.yaml +86 -0
  168. periplus/packs/drupal_basic@0.3.0/template/template_route_link.yaml +30 -0
  169. periplus/packs/drupal_basic@0.3.0/theme/theme.yaml +15 -0
  170. periplus/packs/drupal_basic@0.3.0/theme/theme_info.yaml +61 -0
  171. periplus/packs/drupal_basic@0.3.0/theme_hook/template_suggestion.yaml +29 -0
  172. periplus/packs/drupal_basic@0.3.0/theme_hook/theme_hook.yaml +87 -0
  173. periplus/packs/drupal_basic@0.3.0/theme_hook/theme_hook_render.yaml +20 -0
  174. periplus/packs/drupal_basic@0.3.0/url/url.yaml +88 -0
  175. periplus/packs/drupal_basic@0.3.0/views_plugin/views_field_attribute.yaml +80 -0
  176. periplus/packs/drupal_basic@0.3.0/views_plugin/views_filter_attribute.yaml +80 -0
  177. periplus/packs/drupal_basic@0.3.0/views_plugin/views_plugin.yaml +15 -0
  178. periplus/packs/drupal_basic@0.3.0/views_plugin/views_style_attribute.yaml +80 -0
  179. periplus/packs/drupal_js_basic@0.0.1/attachment/attachment.yaml +12 -0
  180. periplus/packs/drupal_js_basic@0.0.1/attachment/attachment_in_php.yaml +15 -0
  181. periplus/packs/drupal_js_basic@0.0.1/attachment/attachment_in_php_array.yaml +52 -0
  182. periplus/packs/drupal_js_basic@0.0.1/attachment/attachment_in_twig.yaml +26 -0
  183. periplus/packs/drupal_js_basic@0.0.1/attachment/php_function_holder.yaml +13 -0
  184. periplus/packs/drupal_js_basic@0.0.1/behavior/behavior.yaml +198 -0
  185. periplus/packs/drupal_js_basic@0.0.1/pack.yaml +153 -0
  186. periplus/packs/drupal_js_basic@0.0.1/setting/setting.yaml +13 -0
  187. periplus/packs/drupal_js_basic@0.0.1/setting/setting_in_js.yaml +15 -0
  188. periplus/packs/drupal_js_basic@0.0.1/setting/setting_in_php.yaml +92 -0
  189. periplus/packs/drush_basic@0.0.1/command/command.yaml +15 -0
  190. periplus/packs/drush_basic@0.0.1/command/command_annotation.yaml +60 -0
  191. periplus/packs/drush_basic@0.0.1/command/command_attribute.yaml +88 -0
  192. periplus/packs/drush_basic@0.0.1/pack.yaml +29 -0
  193. periplus/packs/eck_basic@0.0.1/bundle/eck_bundle_config.yaml +56 -0
  194. periplus/packs/eck_basic@0.0.1/entity_type/eck_entity_type_config.yaml +26 -0
  195. periplus/packs/eck_basic@0.0.1/pack.yaml +28 -0
  196. periplus/packs/go@0.0.2/interfaces/satisfies.yaml +47 -0
  197. periplus/packs/go@0.0.2/pack.yaml +51 -0
  198. periplus/packs/go@0.0.2/types/find_declarations.yaml +137 -0
  199. periplus/packs/go@0.0.2/types/node_types.yaml +36 -0
  200. periplus/packs/go_basic@0.0.3/pack.yaml +104 -0
  201. periplus/packs/go_basic@0.0.3/rules/calls.yaml +25 -0
  202. periplus/packs/go_basic@0.0.3/rules/declarations.yaml +40 -0
  203. periplus/packs/go_basic@0.0.3/rules/imports.yaml +16 -0
  204. periplus/packs/go_basic@0.0.3/types/node_types.yaml +15 -0
  205. periplus/packs/js_basic@0.0.1/function/function.yaml +68 -0
  206. periplus/packs/js_basic@0.0.1/pack.yaml +50 -0
  207. periplus/packs/laravel_basic@0.0.5/pack.yaml +313 -0
  208. periplus/packs/laravel_basic@0.0.5/rules/classes.yaml +42 -0
  209. periplus/packs/laravel_basic@0.0.5/rules/config.yaml +229 -0
  210. periplus/packs/laravel_basic@0.0.5/rules/routes.yaml +210 -0
  211. periplus/packs/laravel_basic@0.0.5/rules/types.yaml +50 -0
  212. periplus/packs/laravel_basic@0.0.5/rules/views.yaml +100 -0
  213. periplus/packs/paragraphs_basic@0.0.1/bundle/paragraph_bundle_config.yaml +54 -0
  214. periplus/packs/paragraphs_basic@0.0.1/pack.yaml +12 -0
  215. periplus/packs/php@0.1.0/edges/edge_kinds.yaml +64 -0
  216. periplus/packs/php@0.1.0/edges/find_calls.yaml +34 -0
  217. periplus/packs/php@0.1.0/edges/find_imports.yaml +18 -0
  218. periplus/packs/php@0.1.0/edges/find_member_access.yaml +22 -0
  219. periplus/packs/php@0.1.0/edges/find_structure.yaml +38 -0
  220. periplus/packs/php@0.1.0/embedded/embedded_regions.yaml +19 -0
  221. periplus/packs/php@0.1.0/imports/imports.yaml +20 -0
  222. periplus/packs/php@0.1.0/pack.yaml +117 -0
  223. periplus/packs/php@0.1.0/resolution/excluded_tokens.yaml +23 -0
  224. periplus/packs/php@0.1.0/resolution/resolution.yaml +35 -0
  225. periplus/packs/php@0.1.0/types/find_declarations.yaml +102 -0
  226. periplus/packs/php@0.1.0/types/node_types.yaml +55 -0
  227. periplus/packs/php_basic@0.2.0/edges/edge_kinds.yaml +48 -0
  228. periplus/packs/php_basic@0.2.0/edges/find_structure.yaml +750 -0
  229. periplus/packs/php_basic@0.2.0/imports/imports.yaml +19 -0
  230. periplus/packs/php_basic@0.2.0/pack.yaml +94 -0
  231. periplus/packs/php_basic@0.2.0/types/find_declarations.yaml +267 -0
  232. periplus/packs/php_basic@0.2.0/types/node_types.yaml +55 -0
  233. periplus/packs/profile_basic@0.0.1/bundle/profile_bundle_config.yaml +54 -0
  234. periplus/packs/profile_basic@0.0.1/pack.yaml +12 -0
  235. periplus/packs/salesforce_basic@0.0.1/event/salesforce_event.yaml +36 -0
  236. periplus/packs/salesforce_basic@0.0.1/pack.yaml +31 -0
  237. periplus/packs/salesforce_basic@0.0.1/salesforce_mapping/salesforce_mapping.yaml +19 -0
  238. periplus/packs/salesforce_basic@0.0.1/salesforce_mapping/salesforce_mapping_config.yaml +83 -0
  239. periplus/packs/salesforce_basic@0.0.1/salesforce_mapping_field/salesforce_mapping_field.yaml +8 -0
  240. periplus/packs/salesforce_basic@0.0.1/salesforce_mapping_field/salesforce_mapping_field_annotation.yaml +43 -0
  241. periplus/packs/twig@0.0.1/pack.yaml +26 -0
  242. periplus/packs/twig@0.0.1/types/template.yaml +57 -0
  243. periplus/packs/twig_basic@0.1.0/pack.yaml +11 -0
  244. periplus/packs/twig_tweak_basic@0.0.1/pack.yaml +27 -0
  245. periplus/packs/twig_tweak_basic@0.0.1/rules/block.yaml +20 -0
  246. periplus/packs/twig_tweak_basic@0.0.1/rules/entity.yaml +35 -0
  247. periplus/packs/twig_tweak_basic@0.0.1/rules/field.yaml +21 -0
  248. periplus/packs/twig_tweak_basic@0.0.1/rules/menu.yaml +21 -0
  249. periplus/packs/webform_basic@0.0.1/bundle/webform_submission_bundle_config.yaml +54 -0
  250. periplus/packs/webform_basic@0.0.1/pack.yaml +20 -0
  251. periplus/packs/webform_basic@0.0.1/webform_handler/webform_handler.yaml +8 -0
  252. periplus/packs/webform_basic@0.0.1/webform_handler/webform_handler_annotation.yaml +43 -0
  253. periplus/packs/yaml@0.0.1/pack.yaml +72 -0
  254. periplus/packs/yaml@0.0.1/types/find_mapping_entry.yaml +21 -0
  255. periplus/packs/yaml@0.0.1/types/yaml_types.yaml +44 -0
  256. periplus/packs/yaml_basic@0.1.0/pack.yaml +10 -0
  257. periplus/packs.py +447 -0
  258. periplus/preflight.py +102 -0
  259. periplus/py.typed +0 -0
  260. periplus/report.py +596 -0
  261. periplus/resolution.py +355 -0
  262. periplus/settings.py +617 -0
  263. periplus/settings.stub.yml +99 -0
  264. periplus/spec.py +774 -0
  265. periplus/update.py +197 -0
  266. periplus/validate.py +655 -0
  267. periplus_map-0.2.1.dist-info/METADATA +566 -0
  268. periplus_map-0.2.1.dist-info/RECORD +272 -0
  269. periplus_map-0.2.1.dist-info/WHEEL +4 -0
  270. periplus_map-0.2.1.dist-info/entry_points.txt +2 -0
  271. periplus_map-0.2.1.dist-info/licenses/LICENSE +202 -0
  272. periplus_map-0.2.1.dist-info/licenses/NOTICE +2 -0
@@ -0,0 +1,19 @@
1
+ $schema: "https://periplus.dev/schema/0/pack-file.schema.json"
2
+
3
+ # The import statements a file's written names resolve through. The facts name tree fields: alias
4
+ # holds an alias, and type holds the function or const keyword of a use that binds no type name.
5
+ # bind says how a clause binds: its alias, else the last segment of its written path, names it; a
6
+ # grouped use joins each member to its prefix; a leading backslash is stripped; a use with a kind
7
+ # keyword binds nothing.
8
+ imports:
9
+ - ast: namespace_use_declaration
10
+ group_ast: namespace_use_group
11
+ clause: namespace_use_clause
12
+ facts:
13
+ alias: alias
14
+ use_kind: type
15
+ bind:
16
+ name: [alias, last_segment]
17
+ prefix_from_group: true
18
+ strip_prefix: "\\"
19
+ skip_when_field_set: use_kind
@@ -0,0 +1,94 @@
1
+ $schema: "https://periplus.dev/schema/0/pack-manifest.schema.json"
2
+
3
+ # The basic PHP pack: every class, interface, trait, enum, function and method becomes a node
4
+ # under its full name, and a class-like gets its inherits, implements, mixes_in and contains edges.
5
+ # It sits beside the reference pack php and does not replace it.
6
+ #
7
+ # Known gaps. A call to a function PHP itself defines, such as strlen() or json_decode(), makes
8
+ # nothing: the rule calls_function lists the 2150 names get_defined_functions()['internal']
9
+ # returned in one run of PHP 8.5.11 (cli, NTS), beside PHP's language constructs; exit and die are
10
+ # in both and listed once. That run loaded
11
+ # these extensions: Core, date, lexbor, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype,
12
+ # curl, dba, uri, json, mbstring, SPL, FFI, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv,
13
+ # intl, session, ldap, standard, libxml, mysqlnd, mysqli, odbc, Zend OPcache, pcntl, PDO,
14
+ # pdo_dblib, pdo_mysql, PDO_ODBC, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, random, readline,
15
+ # Reflection, exif, shmop, SimpleXML, snmp, soap, sockets, sodium, sysvmsg, sysvsem, sysvshm, tidy,
16
+ # tokenizer, dom, xml, xmlreader, xmlwriter, xsl, zip. A function of an extension not loaded there
17
+ # is not listed.
18
+ #
19
+ # False results:
20
+ # - The names are compared with the text as written. A builtin called with a leading backslash,
21
+ # \strlen(), or in another letter case, StrLen(), still gives an unresolved function node.
22
+ # - A function the project declares under a builtin name, function strlen() in its namespace, gets
23
+ # no calls edge from an unqualified call to it: no rule can yet try the namespaced name and then
24
+ # the bare one in order.
25
+ # - Drupal's global functions, such as t(), drupal_flush_all_caches() and theme_get_setting(), are
26
+ # not PHP builtins: a call to one still gives an unresolved function node.
27
+ #
28
+ # Missing results:
29
+ # - A method call on an object, $x->m(), makes nothing, except a call on a property of $this
30
+ # whose type the same class declares, or that the calling class, or its nearest ancestor
31
+ # declaring the property, assigns from a parameter typed by a class name: only plain function
32
+ # calls, static calls and those are read. A property typed by a union of two or more class names,
33
+ # Helper|Other, gives no edge, and neither does a call in a parent class through a property only
34
+ # a child assigns; the call keeps its php.call_site node.
35
+ # - A use function alias does not bind.
36
+ pack: php_basic
37
+ version: 0.2.0
38
+ depends: []
39
+
40
+ # Pinned exactly: the rules name tree node types, and those can change across grammar releases.
41
+ grammar:
42
+ provider: tree-sitter
43
+ provider_version: "0.26.0"
44
+ language: php
45
+ grammar_version: "0.24.1"
46
+
47
+ # The whole project at any depth; a dependent pack or the project settings narrows it.
48
+ folders:
49
+ source: ./**
50
+
51
+ files:
52
+ extensions: [php]
53
+ exclude:
54
+ - '**/vendor/**'
55
+ - '**/node_modules/**'
56
+
57
+ # How a full name is built, read by the engine as data. namespace names the tree node that
58
+ # declares a namespace and the field holding its name; written_names are the tree node types of a
59
+ # name written in source, such as the names after extends.
60
+ identity:
61
+ qualified_name:
62
+ parts: [namespace, declared_name]
63
+ separator: "\\"
64
+ namespace:
65
+ declaration: namespace_definition
66
+ name_child: name
67
+ written_names: [name, qualified_name, namespace_name]
68
+ # How a written name becomes a full one, the first step that holds giving it: a name with a
69
+ # leading backslash is full without it; a name whose first segment a use of its namespace block
70
+ # binds takes the used path in place of that segment; any other name takes the namespace.
71
+ resolve:
72
+ - full_if_prefixed: "\\"
73
+ - bound_first_segment
74
+ - prefix_with: namespace
75
+ # How an attribute is written: its node, the list that holds it on a declaration, the field of
76
+ # its arguments, one argument and the field of its name, and the text literals with the node of
77
+ # their text.
78
+ attribute:
79
+ node: attribute
80
+ list: attribute_list
81
+ arguments: parameters
82
+ argument: argument
83
+ argument_name: name
84
+ literals: [string, encapsed_string]
85
+ literal_content: string_content
86
+ # A call's arguments: their field, one argument and the field of its name, and the text
87
+ # literals with the node of their text. view('a') holds 'a' at position 0.
88
+ call_arguments: arguments
89
+ call_argument: argument
90
+ call_argument_name: name
91
+ call_literals: [string, encapsed_string]
92
+ call_literal_content: [string_content]
93
+ # The tree node type of a comment; a docblock is the comment just before a declaration.
94
+ comment: comment
@@ -0,0 +1,267 @@
1
+ $schema: "https://periplus.dev/schema/0/pack-file.schema.json"
2
+
3
+ # The type a class declares for a property, which the rules below find; node_types.yaml holds the
4
+ # pack's other node types.
5
+ node_types:
6
+
7
+ - name: php.property_type
8
+ id_namespace: php.property_type
9
+
10
+ # One rule per construct, because each names where its body lives: enum_declaration_list differs
11
+ # from declaration_list by one word. A rule with a body_child is a type a method can sit in.
12
+ rules:
13
+
14
+ - rule: find_class
15
+ reads: file
16
+ in: [source]
17
+ match: {declaration: class_declaration, name_child: name, body_child: declaration_list, filetype: php}
18
+ id: {from: qualified_name}
19
+ emits: [{node: {type: php.class}}]
20
+ confidence: declared
21
+
22
+ - rule: find_interface
23
+ reads: file
24
+ in: [source]
25
+ match: {declaration: interface_declaration, name_child: name, body_child: declaration_list, filetype: php}
26
+ id: {from: qualified_name}
27
+ emits: [{node: {type: php.interface}}]
28
+ confidence: declared
29
+
30
+ - rule: find_trait
31
+ reads: file
32
+ in: [source]
33
+ match: {declaration: trait_declaration, name_child: name, body_child: declaration_list, filetype: php}
34
+ id: {from: qualified_name}
35
+ emits: [{node: {type: php.trait}}]
36
+ confidence: declared
37
+
38
+ - rule: find_enum
39
+ reads: file
40
+ in: [source]
41
+ match: {declaration: enum_declaration, name_child: name, body_child: enum_declaration_list, filetype: php}
42
+ id: {from: qualified_name}
43
+ emits: [{node: {type: php.enum}}]
44
+ confidence: declared
45
+
46
+ - rule: find_function
47
+ reads: file
48
+ in: [source]
49
+ match: {declaration: function_definition, name_child: name, filetype: php}
50
+ id: {from: qualified_name}
51
+ emits: [{node: {type: php.function}}]
52
+ confidence: declared
53
+
54
+ # A method's id holds the full name of the type it sits in, so five build methods on five classes
55
+ # stay five nodes.
56
+ - rule: find_method
57
+ reads: file
58
+ in: [source]
59
+ match: {declaration: method_declaration, name_child: name, filetype: php}
60
+ id:
61
+ from: [enclosing_type, declared_name]
62
+ template: "{enclosing_type}::{declared_name}"
63
+ emits: [{node: {type: php.method}}]
64
+ confidence: declared
65
+
66
+ # The parts of a call through a property of the enclosing object. A property, <class>::$<name>.
67
+ - rule: find_property
68
+ reads: file
69
+ in: [source]
70
+ match: {declaration: property_element, name_child: name, filetype: php}
71
+ id:
72
+ from: [enclosing_type, declared_name]
73
+ template: "{enclosing_type}::{declared_name}"
74
+ emits: [{node: {type: php.property}}]
75
+ confidence: declared
76
+
77
+ # The property a promoted constructor parameter declares, the same <class>::$<name>.
78
+ - rule: find_promoted_property
79
+ reads: file
80
+ in: [source]
81
+ match: {declaration: property_promotion_parameter, name_child: name, filetype: php}
82
+ id:
83
+ from: [enclosing_type, declared_name]
84
+ template: "{enclosing_type}::{declared_name}"
85
+ emits: [{node: {type: php.property}}]
86
+ confidence: declared
87
+
88
+ # A parameter of a method, <class>::<method>::$<name>, and for one typed by a class name its twin,
89
+ # <class>::$<name>::<type>, the type resolved through the file's imports and namespace. A scalar,
90
+ # nullable or union type gives no twin, and a function's parameter makes nothing. The twin keeps
91
+ # the method out of its id, so find_structure.yaml's parameter_typed_as reaches it.
92
+ - rule: find_parameter
93
+ reads: file
94
+ in: [source]
95
+ match: {declaration: simple_parameter, name_child: name, filetype: php}
96
+ id:
97
+ from: [enclosing_type, enclosing_method, declared_name]
98
+ template: "{enclosing_type}::{enclosing_method}::{declared_name}"
99
+ emits: [{node: {type: php.parameter}}]
100
+ confidence: declared
101
+
102
+ - rule: find_parameter_type
103
+ reads: file
104
+ in: [source]
105
+ match: {declaration: simple_parameter, name_child: name, filetype: php, where: [{has_child: named_type}]}
106
+ id:
107
+ from: [enclosing_type, declared_name, {qualified: type}]
108
+ template: "{enclosing_type}::{declared_name}::{type}"
109
+ emits: [{node: {type: php.parameter_type}}]
110
+ confidence: declared
111
+
112
+ # The type a class declares for a property, <class>::$<name>::<type>, resolved through the file's
113
+ # imports and namespace: written on the property, private Mailer $mailer; on a promoted constructor
114
+ # parameter; or in the @var line of the docblock before the property. A nullable class type,
115
+ # ?Mailer, gives the class, and so does a union of one class name with null, false or scalars,
116
+ # Mailer|null. A scalar, ?int, or a union of two class names, Mailer|Other, gives none, and so does
117
+ # a @var of several types or of an array; a @var of a scalar, such as string, is read as a class
118
+ # name. A declaration of several properties in one
119
+ # statement names its first only. find_structure.yaml's property_typed_as reaches each.
120
+ - rule: find_property_type
121
+ reads: file
122
+ in: [source]
123
+ match:
124
+ declaration: property_declaration
125
+ name_child: [property_element, name]
126
+ filetype: php
127
+ where: [{has_child: named_type}]
128
+ id:
129
+ from: [enclosing_type, declared_name, {qualified: type}]
130
+ template: "{enclosing_type}::{declared_name}::{type}"
131
+ emits: [{node: {type: php.property_type}}]
132
+ confidence: declared
133
+
134
+ - rule: find_promoted_property_type
135
+ reads: file
136
+ in: [source]
137
+ match:
138
+ declaration: property_promotion_parameter
139
+ name_child: name
140
+ filetype: php
141
+ where: [{has_child: named_type}]
142
+ id:
143
+ from: [enclosing_type, declared_name, {qualified: type}]
144
+ template: "{enclosing_type}::{declared_name}::{type}"
145
+ emits: [{node: {type: php.property_type}}]
146
+ confidence: declared
147
+
148
+ - rule: find_nullable_property_type
149
+ reads: file
150
+ in: [source]
151
+ match:
152
+ declaration: property_declaration
153
+ name_child: [property_element, name]
154
+ filetype: php
155
+ where: [{has_child: optional_type}]
156
+ id:
157
+ from: [enclosing_type, declared_name, {qualified: type}]
158
+ template: "{enclosing_type}::{declared_name}::{type}"
159
+ emits: [{node: {type: php.property_type}}]
160
+ confidence: declared
161
+
162
+ - rule: find_nullable_promoted_property_type
163
+ reads: file
164
+ in: [source]
165
+ match:
166
+ declaration: property_promotion_parameter
167
+ name_child: name
168
+ filetype: php
169
+ where: [{has_child: optional_type}]
170
+ id:
171
+ from: [enclosing_type, declared_name, {qualified: type}]
172
+ template: "{enclosing_type}::{declared_name}::{type}"
173
+ emits: [{node: {type: php.property_type}}]
174
+ confidence: declared
175
+
176
+ # {qualified: type} takes a union's first class-like name and skips null, false and scalars, so the
177
+ # name_matches guard admits a union of one class name among those, in any order, and refuses two.
178
+ - rule: find_union_property_type
179
+ reads: file
180
+ in: [source]
181
+ match:
182
+ declaration: property_declaration
183
+ name_child: [property_element, name]
184
+ filetype: php
185
+ where:
186
+ - has_child: union_type
187
+ - name_matches: {child: type, pattern: '(?i)^(?:(?:null|false|true|int|float|string|bool|array|iterable|mixed|callable)\s*\|\s*)*\\?[A-Za-z_][\w\\]*(?:\s*\|\s*(?:null|false|true|int|float|string|bool|array|iterable|mixed|callable))*$'}
188
+ id:
189
+ from: [enclosing_type, declared_name, {qualified: type}]
190
+ template: "{enclosing_type}::{declared_name}::{type}"
191
+ emits: [{node: {type: php.property_type}}]
192
+ confidence: declared
193
+
194
+ - rule: find_union_promoted_property_type
195
+ reads: file
196
+ in: [source]
197
+ match:
198
+ declaration: property_promotion_parameter
199
+ name_child: name
200
+ filetype: php
201
+ where:
202
+ - has_child: union_type
203
+ - name_matches: {child: type, pattern: '(?i)^(?:(?:null|false|true|int|float|string|bool|array|iterable|mixed|callable)\s*\|\s*)*\\?[A-Za-z_][\w\\]*(?:\s*\|\s*(?:null|false|true|int|float|string|bool|array|iterable|mixed|callable))*$'}
204
+ id:
205
+ from: [enclosing_type, declared_name, {qualified: type}]
206
+ template: "{enclosing_type}::{declared_name}::{type}"
207
+ emits: [{node: {type: php.property_type}}]
208
+ confidence: declared
209
+
210
+ - rule: find_var_property_type
211
+ reads: file
212
+ in: [source]
213
+ match: {declaration: property_declaration, name_child: [property_element, name], filetype: php}
214
+ id:
215
+ from:
216
+ - enclosing_type
217
+ - declared_name
218
+ - qualified: {docblock: '@var\s+\??(?<type>\\?[A-Za-z_][A-Za-z0-9_\\]*)(?:\|null)?(?:\s|\*)'}
219
+ template: "{enclosing_type}::{declared_name}::{type}"
220
+ emits: [{node: {type: php.property_type}}]
221
+ confidence: declared
222
+
223
+ # An assignment to a property of the object, <class>::$this-><name>, one node for each class and
224
+ # property; and its twin, <class>::<method>::$this-><name>=<right-hand text>, one for each method
225
+ # and text. A text holding a line break is kept as written.
226
+ - rule: find_member_assignment
227
+ reads: file
228
+ in: [source]
229
+ match:
230
+ declaration: assignment_expression
231
+ name_child: left
232
+ filetype: php
233
+ where: [{name_matches: {child: left, pattern: '\$this->\w+'}}]
234
+ id:
235
+ from: [enclosing_type, declared_name]
236
+ template: "{enclosing_type}::{declared_name}"
237
+ emits: [{node: {type: php.member_assignment}}]
238
+ confidence: declared
239
+
240
+ - rule: find_member_assignment_value
241
+ reads: file
242
+ in: [source]
243
+ match:
244
+ declaration: assignment_expression
245
+ name_child: left
246
+ filetype: php
247
+ where: [{name_matches: {child: left, pattern: '\$this->\w+'}}]
248
+ id:
249
+ from: [enclosing_type, enclosing_method, declared_name, right]
250
+ template: "{enclosing_type}::{enclosing_method}::{declared_name}={right}"
251
+ emits: [{node: {type: php.member_assignment_value}}]
252
+ confidence: declared
253
+
254
+ # A call on a property of the object, <class>::<method>::$this-><name>-><called method>.
255
+ - rule: find_call_site
256
+ reads: file
257
+ in: [source]
258
+ match:
259
+ declaration: member_call_expression
260
+ name_child: object
261
+ filetype: php
262
+ where: [{name_matches: {child: object, pattern: '\$this->\w+'}}]
263
+ id:
264
+ from: [enclosing_type, enclosing_method, declared_name, name]
265
+ template: "{enclosing_type}::{enclosing_method}::{declared_name}->{name}"
266
+ emits: [{node: {type: php.call_site}}]
267
+ confidence: declared
@@ -0,0 +1,55 @@
1
+ $schema: "https://periplus.dev/schema/0/pack-file.schema.json"
2
+
3
+ # The node types this pack declares. Finding them is in types/find_declarations.yaml.
4
+ #
5
+ # A function and a class may share a name in PHP, so functions and methods each have their own id
6
+ # namespace and do not share the class-likes' one.
7
+ node_types:
8
+
9
+ - name: php.class_like
10
+ abstract: true
11
+ id_namespace: php.type
12
+
13
+ - name: php.class
14
+ parent: php.class_like
15
+
16
+ - name: php.interface
17
+ parent: php.class_like
18
+
19
+ - name: php.trait
20
+ parent: php.class_like
21
+
22
+ - name: php.enum
23
+ parent: php.class_like
24
+
25
+ - name: php.callable
26
+ abstract: true
27
+
28
+ - name: php.function
29
+ parent: php.callable
30
+ id_namespace: php.function
31
+
32
+ - name: php.method
33
+ parent: php.callable
34
+ id_namespace: php.method
35
+
36
+ # The parts of a call through a property of the enclosing object, $this->mailer->send(), that
37
+ # edges/find_structure.yaml joins in the map rule calls_through_assigned_property. Each is found at
38
+ # its own line by a rule in types/find_declarations.yaml; its id is shaped there.
39
+ - name: php.property
40
+ id_namespace: php.property
41
+
42
+ - name: php.parameter
43
+ id_namespace: php.parameter
44
+
45
+ - name: php.parameter_type
46
+ id_namespace: php.parameter_type
47
+
48
+ - name: php.member_assignment
49
+ id_namespace: php.member_assignment
50
+
51
+ - name: php.member_assignment_value
52
+ id_namespace: php.member_assignment_value
53
+
54
+ - name: php.call_site
55
+ id_namespace: php.call_site
@@ -0,0 +1,54 @@
1
+ $schema: "https://periplus.dev/schema/0/pack-file.schema.json"
2
+
3
+ # A profile type read from its config file as the bundle profile.<id>, the id drupal_basic gives a field or
4
+ # display of it. Two rules: the node with its label, and its edges.
5
+
6
+ rules:
7
+ - rule: bundle_profile_from_config
8
+ reads: file
9
+ in:
10
+ - config
11
+ - module_config
12
+ match:
13
+ file: profile.type.*
14
+ filetype: yaml
15
+ id:
16
+ from: file_stem
17
+ normalize:
18
+ - {replace: '^profile\.type\.', with: 'profile.'}
19
+ emits:
20
+ - node:
21
+ type: drupal.bundle
22
+ - attribute:
23
+ name: label
24
+ from:
25
+ key: label
26
+ confidence: declared
27
+ - rule: bundle_profile_from_config_edges
28
+ reads: file
29
+ in:
30
+ - config
31
+ - module_config
32
+ match:
33
+ file: profile.type.*
34
+ filetype: yaml
35
+ id:
36
+ from: file_stem
37
+ normalize:
38
+ - {replace: '^profile\.type\.', with: 'profile.'}
39
+ emits:
40
+ - edge:
41
+ kind: configured_by
42
+ from: this_node
43
+ to:
44
+ from:
45
+ key: id
46
+ template: 'profile.type.{id}'
47
+ - edge:
48
+ kind: bundle_of
49
+ from: this_node
50
+ to:
51
+ from:
52
+ key: id
53
+ template: 'profile'
54
+ confidence: declared
@@ -0,0 +1,12 @@
1
+ $schema: "https://periplus.dev/schema/0/pack-manifest.schema.json"
2
+
3
+ # The Profile contributed module: each profile type, from its config file, as the bundle
4
+ # profile.<id> with its label, a configured_by edge to that file and a bundle_of edge to the entity
5
+ # type profile.
6
+ #
7
+ # Known gaps: the roles a profile type is limited to, and its registration and multiple settings,
8
+ # give nothing. The entity type profile is declared by the module's PHP, which is not mapped, so it
9
+ # stays referenced.
10
+ pack: profile_basic
11
+ version: 0.0.1
12
+ depends: [drupal_basic]
@@ -0,0 +1,36 @@
1
+ $schema: "https://periplus.dev/schema/0/pack-file.schema.json"
2
+
3
+ # A Salesforce event, named by its SalesforceEvents constant as written, as
4
+ # SalesforceEvents::PULL_QUERY. Read from PHP as text, where a subscriber's getSubscribedEvents
5
+ # keys it: SalesforceEvents::X => 'method', or $events[SalesforceEvents::X][] = .... A use of the
6
+ # constant as a value, as in a test's assertArrayHasKey(SalesforceEvents::X, ...), makes nothing.
7
+ # The id is the constant's name, not the event name it holds, such as salesforce.pull_query. The
8
+ # class the file's path names by Drupal's PSR-4 layout subscribes to the event, so the edge is
9
+ # inferred and a file outside a src folder makes no edge. The Salesforce module defines the
10
+ # event and is not in the mapped code, so the event is the referenced end of the edge and no
11
+ # rule makes it a node of its own.
12
+
13
+ node_types:
14
+ - name: salesforce.event
15
+ id_namespace: salesforce.event
16
+
17
+ edge_kinds:
18
+ - kind: subscribes_to_salesforce_event
19
+ from: php.class
20
+ to: salesforce.event
21
+
22
+ rules:
23
+ - rule: salesforce_event_subscribed_by_class
24
+ reads: file
25
+ in: [source]
26
+ match:
27
+ file: '**'
28
+ filetype: drupal_php_text
29
+ text: '\bSalesforceEvents::(?<event>[A-Z][A-Z0-9_]*)\s*(?:=>|\]\s*\[\s*\]\s*=)'
30
+ id: {template: '{psr4_class}'}
31
+ emits:
32
+ - edge:
33
+ kind: subscribes_to_salesforce_event
34
+ from: this_node
35
+ to: {template: 'SalesforceEvents::{event}', types: [salesforce.event]}
36
+ confidence: inferred
@@ -0,0 +1,31 @@
1
+ $schema: "https://periplus.dev/schema/0/pack-manifest.schema.json"
2
+
3
+ # The Salesforce contributed modules: their mapping field plugins, by annotation, each joined to
4
+ # its class by plugin_class; each mapping config file as a salesforce.mapping on its config node,
5
+ # with its Salesforce object and its push and pull standalone flags, a maps_bundle edge to
6
+ # <drupal_entity_type>.<drupal_bundle>, a maps_entity_type edge, and an inferred maps_field edge to
7
+ # each field instance its dependencies.config lists; and each SalesforceEvents constant a
8
+ # subscriber keys, as a salesforce.event, read as text through drupal_basic's drupal_php_text.
9
+ #
10
+ # Known gaps:
11
+ # - The mapping field manager reads the generic Plugin annotation, so any class in the folder
12
+ # below that carries a Plugin annotation is read as a mapping field. An id that is not text in
13
+ # double quotes makes no plugin and is listed under skipped. The other Salesforce plugin types,
14
+ # such as auth providers and pull queue workers, give nothing.
15
+ # - A mapping's field_mappings list is not read: a list source's each part names the key, not its
16
+ # value. So a field mapped by a property path, such as field_my_date.value, which the
17
+ # dependencies do not list, gives no maps_field edge, and nor does any mapping's Salesforce
18
+ # field, direction or mapping field plugin. A mapping whose dependencies list no field instance,
19
+ # as a webform submission mapping, is listed under skipped: fired and emitted nothing.
20
+ # - A mapping's sync triggers, pull settings and key give nothing. The auth provider config,
21
+ # salesforce.salesforce_auth.*, and salesforce_logger.settings stay plain config objects.
22
+ # - An event is named by its constant as written, less any namespace. One used through an alias,
23
+ # or as the event's own text, such as 'salesforce.pull_query', makes no event. No edge joins a
24
+ # subscriber to its event: that rule belongs to drupal_basic.
25
+ pack: salesforce_basic
26
+ version: 0.0.1
27
+ depends: [drupal_basic, php_basic]
28
+
29
+ folders:
30
+ # The folder the mapping field manager discovers in, below a module's src folder.
31
+ salesforce_mapping_field_classes: "{module_root}/src/Plugin/SalesforceMappingField/**"
@@ -0,0 +1,19 @@
1
+ $schema: "https://periplus.dev/schema/0/pack-file.schema.json"
2
+
3
+ # A Salesforce mapping: a config entity that syncs one Drupal bundle with one Salesforce object.
4
+ # It refines the config object of its file, so it shares that node's id.
5
+
6
+ node_types:
7
+ - name: salesforce.mapping
8
+ parent: drupal.config_object
9
+
10
+ edge_kinds:
11
+ - kind: maps_bundle
12
+ from: salesforce.mapping
13
+ to: drupal.bundle
14
+ - kind: maps_entity_type
15
+ from: salesforce.mapping
16
+ to: drupal.entity_type
17
+ - kind: maps_field
18
+ from: salesforce.mapping
19
+ to: drupal.field_instance
@@ -0,0 +1,83 @@
1
+ $schema: "https://periplus.dev/schema/0/pack-file.schema.json"
2
+
3
+ # A Salesforce mapping read from its config file: the node with the Salesforce object and the two
4
+ # standalone flags, and its edges. The bundle is {drupal_entity_type}.{drupal_bundle}. Each field
5
+ # instance the mapping's dependencies.config lists is a maps_field edge, inferred: Salesforce
6
+ # writes those dependencies from the field mappings, so a base field such as title, a constant or
7
+ # a token gives none. The field mappings themselves are not read: a list source's each part fills
8
+ # {key} with the key name drupal_field_value, not its value.
9
+
10
+ rules:
11
+ - rule: salesforce_mapping_from_config
12
+ reads: file
13
+ in:
14
+ - config
15
+ - module_config
16
+ match:
17
+ file: salesforce_mapping.salesforce_mapping.*
18
+ filetype: yaml
19
+ id:
20
+ from: file_stem
21
+ emits:
22
+ - node:
23
+ type: salesforce.mapping
24
+ - attribute:
25
+ name: salesforce_object
26
+ from:
27
+ key: salesforce_object_type
28
+ - attribute:
29
+ name: push_standalone
30
+ from:
31
+ key: push_standalone
32
+ - attribute:
33
+ name: pull_standalone
34
+ from:
35
+ key: pull_standalone
36
+ confidence: declared
37
+ - rule: salesforce_mapping_from_config_edges
38
+ reads: file
39
+ in:
40
+ - config
41
+ - module_config
42
+ match:
43
+ file: salesforce_mapping.salesforce_mapping.*
44
+ filetype: yaml
45
+ id:
46
+ from: file_stem
47
+ emits:
48
+ - edge:
49
+ kind: maps_bundle
50
+ from: this_node
51
+ to:
52
+ from:
53
+ - key: drupal_entity_type
54
+ - key: drupal_bundle
55
+ template: '{drupal_entity_type}.{drupal_bundle}'
56
+ - edge:
57
+ kind: maps_entity_type
58
+ from: this_node
59
+ to:
60
+ from:
61
+ key: drupal_entity_type
62
+ confidence: declared
63
+ - rule: salesforce_mapping_fields_from_config
64
+ reads: file
65
+ in:
66
+ - config
67
+ - module_config
68
+ match:
69
+ file: salesforce_mapping.salesforce_mapping.*
70
+ filetype: yaml
71
+ id:
72
+ from: file_stem
73
+ emits:
74
+ - edge:
75
+ kind: maps_field
76
+ from: this_node
77
+ to:
78
+ from:
79
+ key: dependencies.config
80
+ each: true
81
+ where:
82
+ - matches: 'field.field.*'
83
+ confidence: inferred
@@ -0,0 +1,8 @@
1
+ $schema: "https://periplus.dev/schema/0/pack-file.schema.json"
2
+
3
+ # A Salesforce mapping field plugin, named by its plugin id; plugin_class joins it to its class.
4
+
5
+ node_types:
6
+ - name: drupal.salesforce_mapping_field
7
+ parent: drupal.plugin
8
+ id_namespace: drupal.plugin.salesforce_mapping_field