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.
- periplus/__init__.py +70 -0
- periplus/checkmap.py +80 -0
- periplus/cli.py +658 -0
- periplus/contract/schema/map.schema.json +138 -0
- periplus/contract/schema/navigation.schema.json +200 -0
- periplus/contract/schema/pack-file.schema.json +1405 -0
- periplus/contract/schema/pack-manifest.schema.json +245 -0
- periplus/contract/schema/project-settings.schema.json +85 -0
- periplus/contract/spec/engine.md +151 -0
- periplus/contract/spec/rules.md +352 -0
- periplus/detect.py +228 -0
- periplus/engine/__init__.py +5 -0
- periplus/engine/check.py +481 -0
- periplus/engine/emit.py +368 -0
- periplus/engine/packload.py +2321 -0
- periplus/engine/pattern.py +27 -0
- periplus/engine/rules.py +1946 -0
- periplus/engine/select.py +491 -0
- periplus/engine/source.py +172 -0
- periplus/engine/tree.py +424 -0
- periplus/errors.py +332 -0
- periplus/init.py +358 -0
- periplus/layout.py +28 -0
- periplus/manifest.py +498 -0
- periplus/map.py +364 -0
- periplus/navigate/__init__.py +1 -0
- periplus/navigate/find.py +143 -0
- periplus/navigate/ids.py +30 -0
- periplus/navigate/listing.py +42 -0
- periplus/navigate/mapfile.py +189 -0
- periplus/navigate/path.py +175 -0
- periplus/navigate/show.py +175 -0
- periplus/navigate/types.py +83 -0
- periplus/navigate/walk.py +138 -0
- periplus/packs/advancedqueue_basic@0.0.1/pack.yaml +14 -0
- periplus/packs/advancedqueue_basic@0.0.1/queue_job_type/queue_job_type.yaml +9 -0
- periplus/packs/advancedqueue_basic@0.0.1/queue_job_type/queue_job_type_annotation.yaml +43 -0
- periplus/packs/advancedqueue_basic@0.0.1/queue_job_type/queue_job_type_attribute.yaml +43 -0
- periplus/packs/ai_basic@0.0.1/ai_agent/ai_agent.yaml +8 -0
- periplus/packs/ai_basic@0.0.1/ai_agent/ai_agent_attribute.yaml +43 -0
- periplus/packs/ai_basic@0.0.1/ai_function_call/ai_function_call.yaml +8 -0
- periplus/packs/ai_basic@0.0.1/ai_function_call/ai_function_call_attribute.yaml +43 -0
- periplus/packs/ai_basic@0.0.1/pack.yaml +15 -0
- periplus/packs/config_pages_basic@0.0.1/bundle/config_pages_bundle_config.yaml +54 -0
- periplus/packs/config_pages_basic@0.0.1/pack.yaml +11 -0
- periplus/packs/crop_basic@0.0.1/bundle/crop_bundle_config.yaml +54 -0
- periplus/packs/crop_basic@0.0.1/pack.yaml +11 -0
- periplus/packs/drupal@0.1.0/block/block_placement.yaml +25 -0
- periplus/packs/drupal@0.1.0/block/block_placement_code.yaml +58 -0
- periplus/packs/drupal@0.1.0/block/block_placement_config.yaml +53 -0
- periplus/packs/drupal@0.1.0/block/block_plugin.yaml +52 -0
- periplus/packs/drupal@0.1.0/block/block_plugin_altered.yaml +61 -0
- periplus/packs/drupal@0.1.0/block/block_plugin_annotation.yaml +69 -0
- periplus/packs/drupal@0.1.0/block/block_plugin_attribute.yaml +56 -0
- periplus/packs/drupal@0.1.0/block/block_plugin_content.yaml +46 -0
- periplus/packs/drupal@0.1.0/block/block_plugin_derived.yaml +110 -0
- periplus/packs/drupal@0.1.0/block/block_plugin_deriver.yaml +30 -0
- periplus/packs/drupal@0.1.0/block/block_type.yaml +14 -0
- periplus/packs/drupal@0.1.0/block/block_type_code.yaml +43 -0
- periplus/packs/drupal@0.1.0/block/block_type_config.yaml +45 -0
- periplus/packs/drupal@0.1.0/cache/cache.yaml +18 -0
- periplus/packs/drupal@0.1.0/cache/cache_backend.yaml +31 -0
- periplus/packs/drupal@0.1.0/component/sdc.yaml +19 -0
- periplus/packs/drupal@0.1.0/component/sdc_definition.yaml +25 -0
- periplus/packs/drupal@0.1.0/component/sdc_use.yaml +25 -0
- periplus/packs/drupal@0.1.0/config/config_object.yaml +65 -0
- periplus/packs/drupal@0.1.0/display/display.yaml +32 -0
- periplus/packs/drupal@0.1.0/display/display_code.yaml +53 -0
- periplus/packs/drupal@0.1.0/display/display_config.yaml +95 -0
- periplus/packs/drupal@0.1.0/entity/entity.yaml +33 -0
- periplus/packs/drupal@0.1.0/entity/entity_class.yaml +60 -0
- periplus/packs/drupal@0.1.0/entity/entity_save.yaml +27 -0
- periplus/packs/drupal@0.1.0/entity/entity_type_annotation.yaml +85 -0
- periplus/packs/drupal@0.1.0/entity/entity_type_attribute.yaml +76 -0
- periplus/packs/drupal@0.1.0/field/field_instance_code.yaml +40 -0
- periplus/packs/drupal@0.1.0/field/field_instance_config.yaml +58 -0
- periplus/packs/drupal@0.1.0/field/field_storage.yaml +37 -0
- periplus/packs/drupal@0.1.0/field/field_storage_code.yaml +39 -0
- periplus/packs/drupal@0.1.0/field/field_storage_config.yaml +24 -0
- periplus/packs/drupal@0.1.0/form/form.yaml +48 -0
- periplus/packs/drupal@0.1.0/form/form_class.yaml +50 -0
- periplus/packs/drupal@0.1.0/form/form_id.yaml +48 -0
- periplus/packs/drupal@0.1.0/form/form_methods.yaml +39 -0
- periplus/packs/drupal@0.1.0/hook/hook.yaml +8 -0
- periplus/packs/drupal@0.1.0/hook/hook_attribute.yaml +28 -0
- periplus/packs/drupal@0.1.0/module/module.yaml +8 -0
- periplus/packs/drupal@0.1.0/module/module_info.yaml +50 -0
- periplus/packs/drupal@0.1.0/pack.yaml +184 -0
- periplus/packs/drupal@0.1.0/plugin/plugin.yaml +17 -0
- periplus/packs/drupal@0.1.0/plugin/plugin_annotation.yaml +120 -0
- periplus/packs/drupal@0.1.0/recommendations/recommendations.yaml +14 -0
- periplus/packs/drupal@0.1.0/service/service.yaml +19 -0
- periplus/packs/drupal@0.1.0/service/service_autowire.yaml +28 -0
- periplus/packs/drupal@0.1.0/service/service_definition.yaml +24 -0
- periplus/packs/drupal@0.1.0/service/service_use.yaml +43 -0
- periplus/packs/drupal_basic@0.3.0/action/action.yaml +9 -0
- periplus/packs/drupal_basic@0.3.0/action/action_annotation.yaml +43 -0
- periplus/packs/drupal_basic@0.3.0/action/action_attribute.yaml +43 -0
- periplus/packs/drupal_basic@0.3.0/block/block_placement.yaml +16 -0
- periplus/packs/drupal_basic@0.3.0/block/block_placement_config.yaml +51 -0
- periplus/packs/drupal_basic@0.3.0/block_plugin/block_plugin.yaml +14 -0
- periplus/packs/drupal_basic@0.3.0/block_plugin/block_plugin_annotation.yaml +47 -0
- periplus/packs/drupal_basic@0.3.0/block_plugin/block_plugin_attribute.yaml +43 -0
- periplus/packs/drupal_basic@0.3.0/block_type/block_type.yaml +8 -0
- periplus/packs/drupal_basic@0.3.0/block_type/block_type_config.yaml +54 -0
- periplus/packs/drupal_basic@0.3.0/boundary/boundary_types.yaml +19 -0
- periplus/packs/drupal_basic@0.3.0/bundle/bundle.yaml +20 -0
- periplus/packs/drupal_basic@0.3.0/bundle/bundle_config.yaml +393 -0
- periplus/packs/drupal_basic@0.3.0/call/call.yaml +349 -0
- periplus/packs/drupal_basic@0.3.0/component/component.yaml +30 -0
- periplus/packs/drupal_basic@0.3.0/config/config_object.yaml +119 -0
- periplus/packs/drupal_basic@0.3.0/constraint/constraint.yaml +8 -0
- periplus/packs/drupal_basic@0.3.0/constraint/constraint_annotation.yaml +43 -0
- periplus/packs/drupal_basic@0.3.0/constraint/constraint_attribute.yaml +43 -0
- periplus/packs/drupal_basic@0.3.0/display/display.yaml +30 -0
- periplus/packs/drupal_basic@0.3.0/display/display_config.yaml +203 -0
- periplus/packs/drupal_basic@0.3.0/display/display_mode_config.yaml +60 -0
- periplus/packs/drupal_basic@0.3.0/entity_type/config_entity_type_annotation.yaml +46 -0
- periplus/packs/drupal_basic@0.3.0/entity_type/config_entity_type_attribute.yaml +43 -0
- periplus/packs/drupal_basic@0.3.0/entity_type/content_entity_type_annotation.yaml +46 -0
- periplus/packs/drupal_basic@0.3.0/entity_type/content_entity_type_attribute.yaml +43 -0
- periplus/packs/drupal_basic@0.3.0/entity_type/entity_type.yaml +16 -0
- periplus/packs/drupal_basic@0.3.0/field/field_instance_config.yaml +116 -0
- periplus/packs/drupal_basic@0.3.0/field/field_storage.yaml +21 -0
- periplus/packs/drupal_basic@0.3.0/field/field_storage_config.yaml +45 -0
- periplus/packs/drupal_basic@0.3.0/field_formatter/field_formatter.yaml +8 -0
- periplus/packs/drupal_basic@0.3.0/field_formatter/field_formatter_annotation.yaml +46 -0
- periplus/packs/drupal_basic@0.3.0/field_formatter/field_formatter_attribute.yaml +43 -0
- periplus/packs/drupal_basic@0.3.0/field_type/field_type_annotation.yaml +46 -0
- periplus/packs/drupal_basic@0.3.0/field_type/field_type_attribute.yaml +50 -0
- periplus/packs/drupal_basic@0.3.0/field_widget/field_widget_annotation.yaml +46 -0
- periplus/packs/drupal_basic@0.3.0/field_widget/field_widget_attribute.yaml +50 -0
- periplus/packs/drupal_basic@0.3.0/form/form_id.yaml +80 -0
- periplus/packs/drupal_basic@0.3.0/hook/hook.yaml +100 -0
- periplus/packs/drupal_basic@0.3.0/hook/hook_attribute.yaml +64 -0
- periplus/packs/drupal_basic@0.3.0/hook/hook_theme_include.yaml +34 -0
- periplus/packs/drupal_basic@0.3.0/library/library.yaml +12 -0
- periplus/packs/drupal_basic@0.3.0/library/library_definition.yaml +58 -0
- periplus/packs/drupal_basic@0.3.0/local_action/local_action.yaml +12 -0
- periplus/packs/drupal_basic@0.3.0/local_action/local_action_definition.yaml +49 -0
- periplus/packs/drupal_basic@0.3.0/mail/mail.yaml +8 -0
- periplus/packs/drupal_basic@0.3.0/mail/mail_attribute.yaml +43 -0
- periplus/packs/drupal_basic@0.3.0/media_source/media_source.yaml +8 -0
- periplus/packs/drupal_basic@0.3.0/media_source/media_source_annotation.yaml +43 -0
- periplus/packs/drupal_basic@0.3.0/media_source/media_source_attribute.yaml +79 -0
- periplus/packs/drupal_basic@0.3.0/menu_link/menu_link.yaml +18 -0
- periplus/packs/drupal_basic@0.3.0/menu_link/menu_link_definition.yaml +48 -0
- periplus/packs/drupal_basic@0.3.0/module/module.yaml +7 -0
- periplus/packs/drupal_basic@0.3.0/module/module_info.yaml +58 -0
- periplus/packs/drupal_basic@0.3.0/pack.yaml +528 -0
- periplus/packs/drupal_basic@0.3.0/permission/permission.yaml +7 -0
- periplus/packs/drupal_basic@0.3.0/permission/permission_definition.yaml +27 -0
- periplus/packs/drupal_basic@0.3.0/queue_worker/queue_worker.yaml +9 -0
- periplus/packs/drupal_basic@0.3.0/queue_worker/queue_worker_annotation.yaml +43 -0
- periplus/packs/drupal_basic@0.3.0/queue_worker/queue_worker_attribute.yaml +43 -0
- periplus/packs/drupal_basic@0.3.0/rest_resource/rest_resource.yaml +8 -0
- periplus/packs/drupal_basic@0.3.0/rest_resource/rest_resource_annotation.yaml +43 -0
- periplus/packs/drupal_basic@0.3.0/rest_resource/rest_resource_attribute.yaml +43 -0
- periplus/packs/drupal_basic@0.3.0/role/role.yaml +14 -0
- periplus/packs/drupal_basic@0.3.0/role/role_config.yaml +44 -0
- periplus/packs/drupal_basic@0.3.0/route/route.yaml +42 -0
- periplus/packs/drupal_basic@0.3.0/route/route_definition.yaml +113 -0
- periplus/packs/drupal_basic@0.3.0/route/route_options.yaml +55 -0
- periplus/packs/drupal_basic@0.3.0/route/route_requirements.yaml +108 -0
- periplus/packs/drupal_basic@0.3.0/service/service.yaml +56 -0
- periplus/packs/drupal_basic@0.3.0/service/service_definition.yaml +181 -0
- periplus/packs/drupal_basic@0.3.0/template/template.yaml +86 -0
- periplus/packs/drupal_basic@0.3.0/template/template_route_link.yaml +30 -0
- periplus/packs/drupal_basic@0.3.0/theme/theme.yaml +15 -0
- periplus/packs/drupal_basic@0.3.0/theme/theme_info.yaml +61 -0
- periplus/packs/drupal_basic@0.3.0/theme_hook/template_suggestion.yaml +29 -0
- periplus/packs/drupal_basic@0.3.0/theme_hook/theme_hook.yaml +87 -0
- periplus/packs/drupal_basic@0.3.0/theme_hook/theme_hook_render.yaml +20 -0
- periplus/packs/drupal_basic@0.3.0/url/url.yaml +88 -0
- periplus/packs/drupal_basic@0.3.0/views_plugin/views_field_attribute.yaml +80 -0
- periplus/packs/drupal_basic@0.3.0/views_plugin/views_filter_attribute.yaml +80 -0
- periplus/packs/drupal_basic@0.3.0/views_plugin/views_plugin.yaml +15 -0
- periplus/packs/drupal_basic@0.3.0/views_plugin/views_style_attribute.yaml +80 -0
- periplus/packs/drupal_js_basic@0.0.1/attachment/attachment.yaml +12 -0
- periplus/packs/drupal_js_basic@0.0.1/attachment/attachment_in_php.yaml +15 -0
- periplus/packs/drupal_js_basic@0.0.1/attachment/attachment_in_php_array.yaml +52 -0
- periplus/packs/drupal_js_basic@0.0.1/attachment/attachment_in_twig.yaml +26 -0
- periplus/packs/drupal_js_basic@0.0.1/attachment/php_function_holder.yaml +13 -0
- periplus/packs/drupal_js_basic@0.0.1/behavior/behavior.yaml +198 -0
- periplus/packs/drupal_js_basic@0.0.1/pack.yaml +153 -0
- periplus/packs/drupal_js_basic@0.0.1/setting/setting.yaml +13 -0
- periplus/packs/drupal_js_basic@0.0.1/setting/setting_in_js.yaml +15 -0
- periplus/packs/drupal_js_basic@0.0.1/setting/setting_in_php.yaml +92 -0
- periplus/packs/drush_basic@0.0.1/command/command.yaml +15 -0
- periplus/packs/drush_basic@0.0.1/command/command_annotation.yaml +60 -0
- periplus/packs/drush_basic@0.0.1/command/command_attribute.yaml +88 -0
- periplus/packs/drush_basic@0.0.1/pack.yaml +29 -0
- periplus/packs/eck_basic@0.0.1/bundle/eck_bundle_config.yaml +56 -0
- periplus/packs/eck_basic@0.0.1/entity_type/eck_entity_type_config.yaml +26 -0
- periplus/packs/eck_basic@0.0.1/pack.yaml +28 -0
- periplus/packs/go@0.0.2/interfaces/satisfies.yaml +47 -0
- periplus/packs/go@0.0.2/pack.yaml +51 -0
- periplus/packs/go@0.0.2/types/find_declarations.yaml +137 -0
- periplus/packs/go@0.0.2/types/node_types.yaml +36 -0
- periplus/packs/go_basic@0.0.3/pack.yaml +104 -0
- periplus/packs/go_basic@0.0.3/rules/calls.yaml +25 -0
- periplus/packs/go_basic@0.0.3/rules/declarations.yaml +40 -0
- periplus/packs/go_basic@0.0.3/rules/imports.yaml +16 -0
- periplus/packs/go_basic@0.0.3/types/node_types.yaml +15 -0
- periplus/packs/js_basic@0.0.1/function/function.yaml +68 -0
- periplus/packs/js_basic@0.0.1/pack.yaml +50 -0
- periplus/packs/laravel_basic@0.0.5/pack.yaml +313 -0
- periplus/packs/laravel_basic@0.0.5/rules/classes.yaml +42 -0
- periplus/packs/laravel_basic@0.0.5/rules/config.yaml +229 -0
- periplus/packs/laravel_basic@0.0.5/rules/routes.yaml +210 -0
- periplus/packs/laravel_basic@0.0.5/rules/types.yaml +50 -0
- periplus/packs/laravel_basic@0.0.5/rules/views.yaml +100 -0
- periplus/packs/paragraphs_basic@0.0.1/bundle/paragraph_bundle_config.yaml +54 -0
- periplus/packs/paragraphs_basic@0.0.1/pack.yaml +12 -0
- periplus/packs/php@0.1.0/edges/edge_kinds.yaml +64 -0
- periplus/packs/php@0.1.0/edges/find_calls.yaml +34 -0
- periplus/packs/php@0.1.0/edges/find_imports.yaml +18 -0
- periplus/packs/php@0.1.0/edges/find_member_access.yaml +22 -0
- periplus/packs/php@0.1.0/edges/find_structure.yaml +38 -0
- periplus/packs/php@0.1.0/embedded/embedded_regions.yaml +19 -0
- periplus/packs/php@0.1.0/imports/imports.yaml +20 -0
- periplus/packs/php@0.1.0/pack.yaml +117 -0
- periplus/packs/php@0.1.0/resolution/excluded_tokens.yaml +23 -0
- periplus/packs/php@0.1.0/resolution/resolution.yaml +35 -0
- periplus/packs/php@0.1.0/types/find_declarations.yaml +102 -0
- periplus/packs/php@0.1.0/types/node_types.yaml +55 -0
- periplus/packs/php_basic@0.2.0/edges/edge_kinds.yaml +48 -0
- periplus/packs/php_basic@0.2.0/edges/find_structure.yaml +750 -0
- periplus/packs/php_basic@0.2.0/imports/imports.yaml +19 -0
- periplus/packs/php_basic@0.2.0/pack.yaml +94 -0
- periplus/packs/php_basic@0.2.0/types/find_declarations.yaml +267 -0
- periplus/packs/php_basic@0.2.0/types/node_types.yaml +55 -0
- periplus/packs/profile_basic@0.0.1/bundle/profile_bundle_config.yaml +54 -0
- periplus/packs/profile_basic@0.0.1/pack.yaml +12 -0
- periplus/packs/salesforce_basic@0.0.1/event/salesforce_event.yaml +36 -0
- periplus/packs/salesforce_basic@0.0.1/pack.yaml +31 -0
- periplus/packs/salesforce_basic@0.0.1/salesforce_mapping/salesforce_mapping.yaml +19 -0
- periplus/packs/salesforce_basic@0.0.1/salesforce_mapping/salesforce_mapping_config.yaml +83 -0
- periplus/packs/salesforce_basic@0.0.1/salesforce_mapping_field/salesforce_mapping_field.yaml +8 -0
- periplus/packs/salesforce_basic@0.0.1/salesforce_mapping_field/salesforce_mapping_field_annotation.yaml +43 -0
- periplus/packs/twig@0.0.1/pack.yaml +26 -0
- periplus/packs/twig@0.0.1/types/template.yaml +57 -0
- periplus/packs/twig_basic@0.1.0/pack.yaml +11 -0
- periplus/packs/twig_tweak_basic@0.0.1/pack.yaml +27 -0
- periplus/packs/twig_tweak_basic@0.0.1/rules/block.yaml +20 -0
- periplus/packs/twig_tweak_basic@0.0.1/rules/entity.yaml +35 -0
- periplus/packs/twig_tweak_basic@0.0.1/rules/field.yaml +21 -0
- periplus/packs/twig_tweak_basic@0.0.1/rules/menu.yaml +21 -0
- periplus/packs/webform_basic@0.0.1/bundle/webform_submission_bundle_config.yaml +54 -0
- periplus/packs/webform_basic@0.0.1/pack.yaml +20 -0
- periplus/packs/webform_basic@0.0.1/webform_handler/webform_handler.yaml +8 -0
- periplus/packs/webform_basic@0.0.1/webform_handler/webform_handler_annotation.yaml +43 -0
- periplus/packs/yaml@0.0.1/pack.yaml +72 -0
- periplus/packs/yaml@0.0.1/types/find_mapping_entry.yaml +21 -0
- periplus/packs/yaml@0.0.1/types/yaml_types.yaml +44 -0
- periplus/packs/yaml_basic@0.1.0/pack.yaml +10 -0
- periplus/packs.py +447 -0
- periplus/preflight.py +102 -0
- periplus/py.typed +0 -0
- periplus/report.py +596 -0
- periplus/resolution.py +355 -0
- periplus/settings.py +617 -0
- periplus/settings.stub.yml +99 -0
- periplus/spec.py +774 -0
- periplus/update.py +197 -0
- periplus/validate.py +655 -0
- periplus_map-0.2.1.dist-info/METADATA +566 -0
- periplus_map-0.2.1.dist-info/RECORD +272 -0
- periplus_map-0.2.1.dist-info/WHEEL +4 -0
- periplus_map-0.2.1.dist-info/entry_points.txt +2 -0
- periplus_map-0.2.1.dist-info/licenses/LICENSE +202 -0
- periplus_map-0.2.1.dist-info/licenses/NOTICE +2 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
$schema: "https://periplus.dev/schema/0/pack-file.schema.json"
|
|
2
|
+
|
|
3
|
+
imports:
|
|
4
|
+
# import u "example.com/app/util" binds u. import "gopkg.in/yaml.v3" binds yaml: the path less a
|
|
5
|
+
# trailing /vN with N 2 or more, its last segment, less a trailing .vN. So "k8s.io/api/core/v1"
|
|
6
|
+
# binds v1. The target is the whole path. A blank or a dot import binds nothing.
|
|
7
|
+
- ast: import_spec
|
|
8
|
+
clause: interpreted_string_literal
|
|
9
|
+
facts: {alias: name}
|
|
10
|
+
bind:
|
|
11
|
+
name: [alias, path]
|
|
12
|
+
normalize:
|
|
13
|
+
- {replace: '/v([2-9]|[1-9][0-9]+)$', with: ''}
|
|
14
|
+
- {replace: '^.*/', with: ''}
|
|
15
|
+
- {replace: '\.v\d+$', with: ''}
|
|
16
|
+
unbound_aliases: [_, .]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
$schema: "https://periplus.dev/schema/0/pack-file.schema.json"
|
|
2
|
+
|
|
3
|
+
node_types:
|
|
4
|
+
- name: go.function
|
|
5
|
+
id_namespace: go.function
|
|
6
|
+
- name: go.method
|
|
7
|
+
id_namespace: go.method
|
|
8
|
+
- name: go.struct
|
|
9
|
+
id_namespace: go.struct
|
|
10
|
+
- name: go.interface
|
|
11
|
+
id_namespace: go.interface
|
|
12
|
+
edge_kinds:
|
|
13
|
+
- kind: calls
|
|
14
|
+
from: [go.function, go.method]
|
|
15
|
+
to: [go.function, go.struct, go.interface]
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
$schema: "https://periplus.dev/schema/0/pack-file.schema.json"
|
|
2
|
+
|
|
3
|
+
node_types:
|
|
4
|
+
- name: js.function
|
|
5
|
+
id_namespace: js.function
|
|
6
|
+
- name: js.file
|
|
7
|
+
id_namespace: js.file
|
|
8
|
+
|
|
9
|
+
edge_kinds:
|
|
10
|
+
- kind: script_declares_function
|
|
11
|
+
from: js.file
|
|
12
|
+
to: js.function
|
|
13
|
+
|
|
14
|
+
rules:
|
|
15
|
+
# function name(...) {...}: <script path>:name
|
|
16
|
+
- rule: function_declaration
|
|
17
|
+
reads: file
|
|
18
|
+
in: [js_source]
|
|
19
|
+
match: {declaration: function_declaration, name_child: name, filetype: javascript}
|
|
20
|
+
id: {from: qualified_name}
|
|
21
|
+
emits: [{node: {type: js.function}}]
|
|
22
|
+
confidence: declared
|
|
23
|
+
- rule: function_declaration_in_file
|
|
24
|
+
reads: file
|
|
25
|
+
in: [js_source]
|
|
26
|
+
match: {declaration: function_declaration, name_child: name, filetype: javascript}
|
|
27
|
+
id: {from: qualified_name}
|
|
28
|
+
emits: [{edge: {kind: script_declares_function, from: enclosing_file, to: this_node}}]
|
|
29
|
+
confidence: declared
|
|
30
|
+
# const name = (...) => {...}, and the same with let or var.
|
|
31
|
+
- rule: function_from_arrow
|
|
32
|
+
reads: file
|
|
33
|
+
in: [js_source]
|
|
34
|
+
match: {declaration: variable_declarator, name_child: name, filetype: javascript, where: [{has_child: arrow_function}]}
|
|
35
|
+
id: {from: qualified_name}
|
|
36
|
+
emits: [{node: {type: js.function}}]
|
|
37
|
+
confidence: declared
|
|
38
|
+
- rule: function_from_arrow_in_file
|
|
39
|
+
reads: file
|
|
40
|
+
in: [js_source]
|
|
41
|
+
match: {declaration: variable_declarator, name_child: name, filetype: javascript, where: [{has_child: arrow_function}]}
|
|
42
|
+
id: {from: qualified_name}
|
|
43
|
+
emits: [{edge: {kind: script_declares_function, from: enclosing_file, to: this_node}}]
|
|
44
|
+
confidence: declared
|
|
45
|
+
# const name = function (...) {...}, and the same with let or var.
|
|
46
|
+
- rule: function_from_expression
|
|
47
|
+
reads: file
|
|
48
|
+
in: [js_source]
|
|
49
|
+
match: {declaration: variable_declarator, name_child: name, filetype: javascript, where: [{has_child: function_expression}]}
|
|
50
|
+
id: {from: qualified_name}
|
|
51
|
+
emits: [{node: {type: js.function}}]
|
|
52
|
+
confidence: declared
|
|
53
|
+
- rule: function_from_expression_in_file
|
|
54
|
+
reads: file
|
|
55
|
+
in: [js_source]
|
|
56
|
+
match: {declaration: variable_declarator, name_child: name, filetype: javascript, where: [{has_child: function_expression}]}
|
|
57
|
+
id: {from: qualified_name}
|
|
58
|
+
emits: [{edge: {kind: script_declares_function, from: enclosing_file, to: this_node}}]
|
|
59
|
+
confidence: declared
|
|
60
|
+
# The script itself: its path from the project folder, the same value that starts each function's
|
|
61
|
+
# name. A node for a script that holds no function lets a library reach it.
|
|
62
|
+
- rule: script_file
|
|
63
|
+
reads: file
|
|
64
|
+
in: [js_source]
|
|
65
|
+
match: {declaration: program, filetype: javascript}
|
|
66
|
+
id: {from: script}
|
|
67
|
+
emits: [{node: {type: js.file}}]
|
|
68
|
+
confidence: declared
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
$schema: "https://periplus.dev/schema/0/pack-manifest.schema.json"
|
|
2
|
+
|
|
3
|
+
# Known gaps. The basic JavaScript pack maps each function that has a name of its own, as a
|
|
4
|
+
# node named <script path>:<name>: function name() {}, async function name() {}, and a const,
|
|
5
|
+
# let or var whose value is an arrow function or a function expression. Each line below was
|
|
6
|
+
# seen on real code or on a planted file.
|
|
7
|
+
# Each script is a js.file node named by its path, and each function above has a
|
|
8
|
+
# script_declares_function edge from its script.
|
|
9
|
+
# What it does not map, today:
|
|
10
|
+
# - A call: no rule reads one, so the map holds no edge between two functions.
|
|
11
|
+
# - A generator, function* name() {}, a class and a class method: no node.
|
|
12
|
+
# - A function that is a member of an object, { name() {} }, { name: function () {} } or
|
|
13
|
+
# { name: () => {} }, and a function passed as an argument: no node.
|
|
14
|
+
# - A function declared inside another gets the same kind of id, so two functions of one name in
|
|
15
|
+
# one script are one node holding both locations.
|
|
16
|
+
# - An import or an export: no rule. A script in a .mjs, .cjs, .jsx or .ts file is not read.
|
|
17
|
+
# - The script path is the path from the project folder, so the same script mapped from another
|
|
18
|
+
# folder gets another id.
|
|
19
|
+
# The grammar is not a dependency of periplus-map. Without it, periplus map stops with a problem
|
|
20
|
+
# that names the pin; install periplus with the extra js, which pins tree-sitter-javascript 0.25.0.
|
|
21
|
+
pack: js_basic
|
|
22
|
+
version: 0.0.1
|
|
23
|
+
depends: []
|
|
24
|
+
grammar:
|
|
25
|
+
provider: tree-sitter
|
|
26
|
+
provider_version: "0.26.0"
|
|
27
|
+
language: javascript
|
|
28
|
+
grammar_version: "0.25.0"
|
|
29
|
+
# The whole project at any depth; a dependent pack or the project settings narrows it.
|
|
30
|
+
folders:
|
|
31
|
+
js_source: ./**
|
|
32
|
+
files:
|
|
33
|
+
exclude: ['**/node_modules/**']
|
|
34
|
+
types:
|
|
35
|
+
javascript:
|
|
36
|
+
endings: [js]
|
|
37
|
+
reader: tree
|
|
38
|
+
path_values:
|
|
39
|
+
# A script is named by its path from the project folder.
|
|
40
|
+
script:
|
|
41
|
+
pattern: '^(?<file>.+)$'
|
|
42
|
+
template: '{file}'
|
|
43
|
+
identity:
|
|
44
|
+
# A full name is the script's path, a colon, and the declared name.
|
|
45
|
+
qualified_name:
|
|
46
|
+
parts: [namespace, declared_name]
|
|
47
|
+
separator: ":"
|
|
48
|
+
namespace:
|
|
49
|
+
path_value: script
|
|
50
|
+
written_names: [identifier]
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
$schema: "https://periplus.dev/schema/0/pack-manifest.schema.json"
|
|
2
|
+
|
|
3
|
+
# Known gaps. The basic Laravel pack maps, beside php_basic's classes and methods:
|
|
4
|
+
# - each route in a file named web.php, api.php, channels.php or console.php in the routes folder,
|
|
5
|
+
# named by file, method and URI, such as web:GET /books. Route::redirect and
|
|
6
|
+
# Route::permanentRedirect give web:REDIRECT /here and web:PERMANENTREDIRECT /a. Inside
|
|
7
|
+
# Route::prefix('admin')->name('admin.')->group(...), its calls in any order and middleware(...)
|
|
8
|
+
# among them, the URI and the name carry each enclosing group's prefix and name: GET /stats is
|
|
9
|
+
# web:GET admin/stats, named admin.stats, the URI joined as Laravel joins it; outside every
|
|
10
|
+
# group the URI stays as written. A route inside a comment, a quoted or backtick string, a
|
|
11
|
+
# heredoc, a nowdoc or inline HTML gives nothing;
|
|
12
|
+
# - the controller method a route names as [BookController::class, 'index'] or
|
|
13
|
+
# [\App\Http\Controllers\BookController::class, 'index'], as a handled_by edge;
|
|
14
|
+
# - Route::resource and Route::apiResource as one node each, with an edge to the controller class;
|
|
15
|
+
# - Route::view with an edge to its view;
|
|
16
|
+
# - each class in app/Http/Controllers as a controller, each class in app/Models as a model;
|
|
17
|
+
# - each Blade view, named by its dotted path, the views it names in @include, @includeIf, @each,
|
|
18
|
+
# @component and @extends, and the view components.alert that a tag <x-alert> names;
|
|
19
|
+
# - each file in config, each config('x.y') key a view reads, each file in database/migrations;
|
|
20
|
+
# - each text key of the array a config file returns, at every depth, named by the file and every
|
|
21
|
+
# enclosing key: 'one' => ['two' => 1] in config/app.php is app.one.two, with a key_of edge to
|
|
22
|
+
# the config app. A config file named api.php, web.php, channels.php or console.php gets its keys
|
|
23
|
+
# too. Each config file also gets a key named by the file alone, app, which stands for the whole
|
|
24
|
+
# array, so that config('app') ends on it; it is not a key the file declares;
|
|
25
|
+
# - each view('x.y') and config('x.y') call in a PHP function or method, read from the parse tree:
|
|
26
|
+
# a renders edge from it to the view x.y, unresolved when no such template exists, and a
|
|
27
|
+
# reads_config edge to the key x.y, unresolved when no config file declares it. A call inside a
|
|
28
|
+
# closure counts the function or method around it. The name matches in any letter case, as PHP's
|
|
29
|
+
# does: View('x.y') counts.
|
|
30
|
+
#
|
|
31
|
+
# False results:
|
|
32
|
+
# - A route inside the array form, Route::group(['prefix' => 'admin', 'as' => 'admin.'], ...), or
|
|
33
|
+
# a group whose chain holds a call other than prefix, name and middleware, such as ->as('a.') or
|
|
34
|
+
# ->where(...), gets an id and a name without that group's prefix: /stats there is
|
|
35
|
+
# web:GET /stats, named stats. Two such routes with one verb and URI, in two groups, merge into
|
|
36
|
+
# one node with two locations and two handled_by edges.
|
|
37
|
+
# - So does a route inside a group whose middleware argument holds parentheses,
|
|
38
|
+
# Route::middleware(Authorize::using('x'))->prefix('a')->group(...), or whose prefix is not a
|
|
39
|
+
# text literal, prefix($p) or prefix(self::P). The /api prefix the application adds to routes in
|
|
40
|
+
# api.php is in no id: GET /books there is api:GET /books.
|
|
41
|
+
# - Inside a prefix group a URI keeps a final slash: Route::get('/users/') there is
|
|
42
|
+
# web:GET admin/users/, where Laravel registers admin/users.
|
|
43
|
+
# - With routes set to a folder not named routes, such as ./routing/**, routing/admin/web.php is
|
|
44
|
+
# named web: its GET /x is web:GET /x, one node with GET /x in routing/web.php.
|
|
45
|
+
# - A grouped use, use App\Http\Controllers\{PageController}, binds nothing in a route file, so a
|
|
46
|
+
# handled_by edge ends at an unresolved PageController::show that exists.
|
|
47
|
+
# - Controllers and models are typed by folder alone: a plain class in app/Models is a model.
|
|
48
|
+
# - A component tag ends at the view components.<name>, so these tags end at a view that is
|
|
49
|
+
# unresolved: <x-dynamic-component>, which names its component when the page renders; <x-card>
|
|
50
|
+
# for components/card/index.blade.php or components/card/card.blade.php, mapped as
|
|
51
|
+
# components.card.index and components.card.card; a class component whose render() returns
|
|
52
|
+
# another view; an inline class component, which has no view; a class registered under an alias,
|
|
53
|
+
# Blade::component('package-alert', Alert::class); a component in a folder registered with
|
|
54
|
+
# Blade::anonymousComponentPath().
|
|
55
|
+
# - An HTML comment hides nothing: a tag or a directive inside <!-- --> still gives an edge. Only
|
|
56
|
+
# {{-- --}} hides text.
|
|
57
|
+
# - view() and config() are matched by the name as written, not resolved: a project's own function
|
|
58
|
+
# named view or config, declared in the namespace or bound by use function, gives a renders or
|
|
59
|
+
# reads_config edge as if it were Laravel's helper.
|
|
60
|
+
# - view('books/show') ends at an unresolved books/show, not at the existing view books.show,
|
|
61
|
+
# though Laravel reads the slash as a dot.
|
|
62
|
+
# - An array indexed at once still gives k.a and every key below it a node when it holds arrays
|
|
63
|
+
# three deep, 'k' => ['a' => ['b' => ['c' => ['d' => 1]]]][$i], or a ] inside a string,
|
|
64
|
+
# 'k' => ['a' => ']'][$i], though Laravel's k is the one value picked: false nodes. The pack
|
|
65
|
+
# tests what follows an array with a pattern that balances brackets only two deep and reads no
|
|
66
|
+
# string, because the engine lacks a span opening that can test the text after the span closes.
|
|
67
|
+
# - A return without braces before the main one, if ($x) return ['early' => 1];, gives its keys as
|
|
68
|
+
# keys of the file beside the main array's, though the file returns one array or the other: a
|
|
69
|
+
# false node such as early.
|
|
70
|
+
# - A key a project sets at run time, config(['app.extra' => 1]) or config()->set('app.extra', 1),
|
|
71
|
+
# as a test or a service provider does, is declared by no config file, so config('app.extra')
|
|
72
|
+
# from PHP ends at an unresolved key that exists when the code runs.
|
|
73
|
+
#
|
|
74
|
+
# Missing results:
|
|
75
|
+
# - An invokable controller, Route::get('/x', ShowProfile::class), gives a route node with no
|
|
76
|
+
# handled_by edge. So do 'BookController@index' and a route inside a Route::controller group.
|
|
77
|
+
# - A route that starts with another method, Route::middleware('auth')->get(...), gives no node.
|
|
78
|
+
# Route::match gives no node.
|
|
79
|
+
# - Route::resource stands for seven routes and Route::apiResource for five. Each gets one node.
|
|
80
|
+
# - A closure route gets no edge to the view it returns. Its ->name() is lost when its body holds
|
|
81
|
+
# a statement.
|
|
82
|
+
# - A model in another folder than app/Models is not typed as a model.
|
|
83
|
+
# - A quote that PHP itself rejects as unpaired hides every later route in its file.
|
|
84
|
+
# - A file named web.php, api.php, channels.php or console.php is a route file in any folder, so
|
|
85
|
+
# php_basic maps no class in it.
|
|
86
|
+
# - view($name), a concatenated view name, config($key) and config([...]) give no edge and go under
|
|
87
|
+
# skipped. View::make('x'), $this->view('x') and a view() or config() call outside every
|
|
88
|
+
# function and method give no edge. config()->set('x', 1) goes under skipped as argument 0 is
|
|
89
|
+
# missing. A key no config file declares has no key_of edge to its file. Read from a template,
|
|
90
|
+
# config('app.nosuch') ends at the key app.nosuch in state referenced, not unresolved, unless a
|
|
91
|
+
# PHP function or method reads it too, which makes it unresolved. config('nofile.key') in a
|
|
92
|
+
# template ends the same way at a referenced key, and gives the key nofile a key_of edge to the
|
|
93
|
+
# config nofile, which is unresolved. A template's read adds its line to the key_of edge of the
|
|
94
|
+
# key named by the file, app for config('app.name').
|
|
95
|
+
# php_basic still shows every view() and config() call inside a function or method as an
|
|
96
|
+
# unresolved call, such as App\Http\Controllers\view, unless the project declares its own.
|
|
97
|
+
# - Two identical calls on one line, config('app.name') . config('app.name'), are one location of
|
|
98
|
+
# one reads_config edge, so the map counts one read where the source holds two.
|
|
99
|
+
# - A config key gets no node, nor does any key below it, when it is: in an array assigned to a
|
|
100
|
+
# variable, above or after the return; in a call's argument, env('X', ['k' => 1]) or
|
|
101
|
+
# ->merge(['k' => 1]); in an array a closure or an arrow function returns; in a match; in old
|
|
102
|
+
# array( ) syntax, as a value or as the whole file; in a list entry, 'list' => [['k' => 1]],
|
|
103
|
+
# where Laravel's key is list.0.k; in the second array of ['a' => 1] + ['b' => 1]; below a key
|
|
104
|
+
# that holds a dot, 'a.b' => ['c' => 1]; in an array indexed at once, ['a' => 1][$k], returned
|
|
105
|
+
# or as a key's value; that key gets a node as a key with no array. A key that holds a dot gets
|
|
106
|
+
# no node itself. A key that is not a text literal gets none, nor does any key below it:
|
|
107
|
+
# 1 => x, CONSTANT => x, Foo::class => x, public_path('x') => x, a double-quoted key holding $,
|
|
108
|
+
# a key holding a backslash escape, 'it\'s', and a key that ends in a text literal but is not
|
|
109
|
+
# one, FOO . '_bar' => x, 'a' . 'b' => x or $c ? 'a' : 'b' => x. Nor does a key at the start of
|
|
110
|
+
# a line after a line that ends in a // or # comment, 'a' => 1, // note; a key right after */ with
|
|
111
|
+
# no space; a key with a comment before its =>, 'a' /* c */ => x; or any key below one of these.
|
|
112
|
+
# A key whose array follows => and a comment, 'a' => /* c */ ['b' => 1], gets a node as a key
|
|
113
|
+
# with no array, and the keys below it get none.
|
|
114
|
+
# - view('mail::html.button') ends at an unresolved view whose name holds ::, not at the package's
|
|
115
|
+
# view. view(view: 'a.b') and view()->make('x') give no
|
|
116
|
+
# edge and go under skipped as argument 0 is missing. response()->view('x') and
|
|
117
|
+
# Route::view('/', 'x') in a function or method give no renders edge.
|
|
118
|
+
# Inertia::render('Books/Index') gives only an unresolved call to Inertia\Inertia::render.
|
|
119
|
+
# - The routes are still read as text. Reading them from the tree needs three things the engine
|
|
120
|
+
# lacks: an id that joins the URI argument with a path value, the upper-cased verb and the
|
|
121
|
+
# prefix of each enclosing group; a route name read from a chained ->name() call on a parent
|
|
122
|
+
# node; and an edge end from an array argument, [BookController::class, 'index'], whose class
|
|
123
|
+
# the file's imports resolve, for the handled_by edge.
|
|
124
|
+
# - @include($name), a concatenated view name, @includeWhen, @includeUnless and @includeFirst give
|
|
125
|
+
# no edge. A Livewire component gives nothing.
|
|
126
|
+
# - A class component's tag never ends at its class. <x-s>, <x-sl>, <x-slo>, a name that starts
|
|
127
|
+
# with a capital, and a namespaced <x-pkg::thing> give nothing.
|
|
128
|
+
#
|
|
129
|
+
# Settings to know:
|
|
130
|
+
# - A project that keeps its routes elsewhere sets routes; one that keeps its templates elsewhere
|
|
131
|
+
# sets views_root, and views then reads every folder below it. A views setting without a final
|
|
132
|
+
# /** reads only the files directly in that folder.
|
|
133
|
+
# - A template gets a node only below views_root, named by its path below it. A template a views
|
|
134
|
+
# setting reads outside views_root gets no node and no reads_config edge, and the report lists
|
|
135
|
+
# it neither as a problem nor as skipped. A config('x.y') in it still gives the key x a key_of
|
|
136
|
+
# edge to the config x, and counts a fire of config_read_in_view and config_key_in_file.
|
|
137
|
+
# - The routes and config folders read only their own files: routes/admin/web.php and
|
|
138
|
+
# config/sub/x.php get no node, and routes/admin.php is read as PHP, so its routes get no node.
|
|
139
|
+
# With routes set to ./routes/**, routes/admin/web.php is read and its routes are admin/web:.
|
|
140
|
+
# - php_basic skips every vendor folder, so resources/views/vendor is not mapped. To map it, add
|
|
141
|
+
# re_include: ['**/resources/views/vendor/**'] to the settings.
|
|
142
|
+
|
|
143
|
+
# A Laravel application: its routes, controllers, Eloquent models, Blade views, config files and
|
|
144
|
+
# migrations, on top of php_basic's classes and methods.
|
|
145
|
+
pack: laravel_basic
|
|
146
|
+
version: 0.0.5
|
|
147
|
+
depends: [php_basic]
|
|
148
|
+
|
|
149
|
+
# Laravel's default layout, relative to the project folder; a project's settings move each one.
|
|
150
|
+
folders:
|
|
151
|
+
routes: ./routes
|
|
152
|
+
# A project that moves its templates sets views_root alone; views reads every folder below it.
|
|
153
|
+
views_root: ./resources/views
|
|
154
|
+
views: '{views_root}/**'
|
|
155
|
+
config_files: ./config
|
|
156
|
+
migrations: ./database/migrations
|
|
157
|
+
controllers: ./app/Http/Controllers/**
|
|
158
|
+
models: ./app/Models/**
|
|
159
|
+
|
|
160
|
+
files:
|
|
161
|
+
types:
|
|
162
|
+
# The route files, by whole name, read as text: a text rule cannot read a file read as a tree.
|
|
163
|
+
route_file:
|
|
164
|
+
names: [web.php, api.php, channels.php, console.php]
|
|
165
|
+
reader: text
|
|
166
|
+
path_values:
|
|
167
|
+
route_file:
|
|
168
|
+
# routes/web.php is web and routes/admin/web.php is admin/web; routing/web.php is web.
|
|
169
|
+
pattern: '^(?<name>.+)\.php$'
|
|
170
|
+
template: '{name}'
|
|
171
|
+
normalize:
|
|
172
|
+
- {replace: '^(?:.*/)?routes/', with: '//'}
|
|
173
|
+
- {replace: '^[^/].*/', with: ''}
|
|
174
|
+
- {replace: '^//', with: ''}
|
|
175
|
+
# PHP comments, strings and inline HTML, so a route written inside one gives nothing. A string
|
|
176
|
+
# is a section so that // inside 'http://x' opens no comment. #[ opens an attribute, not a
|
|
177
|
+
# comment. A heredoc or nowdoc ends at its label at the start of a line, indented or not.
|
|
178
|
+
# A double-quoted string steps over the quotes inside {$...} interpolation.
|
|
179
|
+
# Text these sections leave out is read as code: a quote left unpaired there opens a string
|
|
180
|
+
# that hides the routes after it, and a /* there hides every route up to the next */.
|
|
181
|
+
sections:
|
|
182
|
+
- name: heredoc
|
|
183
|
+
open: '<<<[ \t]*["'']?(?<label>[A-Za-z_][A-Za-z0-9_]*)'
|
|
184
|
+
close: '\n[ \t]*{label}\b'
|
|
185
|
+
# ?> ends PHP inside a // or # comment too; this section is listed before them to win the tie.
|
|
186
|
+
- name: inline_html
|
|
187
|
+
open: '(?://[^\n]*?|#(?:[^\[\n][^\n]*?)?)?\?>'
|
|
188
|
+
close: '<\?(?:php|=)?'
|
|
189
|
+
- name: block_comment
|
|
190
|
+
open: '/\*'
|
|
191
|
+
close: '\*/'
|
|
192
|
+
- name: line_comment
|
|
193
|
+
open: '//'
|
|
194
|
+
close: '\n'
|
|
195
|
+
- name: hash_comment
|
|
196
|
+
open: '#[^\[\n]'
|
|
197
|
+
close: '\n'
|
|
198
|
+
- name: string
|
|
199
|
+
open: ''''
|
|
200
|
+
close: '(?:[^''\\]|\\(?s:.))*'''
|
|
201
|
+
- name: string
|
|
202
|
+
open: '"'
|
|
203
|
+
close: '(?:[^"\\{]|\\(?s:.)|\{\$(?:[^{}"'']|"(?:[^"\\]|\\(?s:.))*"|''(?:[^''\\]|\\(?s:.))*'')*\}|\{)*"'
|
|
204
|
+
- name: string
|
|
205
|
+
open: '`'
|
|
206
|
+
close: '(?:[^`\\]|\\(?s:.))*`'
|
|
207
|
+
# For the config key rules; see config_text.
|
|
208
|
+
- name: operator
|
|
209
|
+
open: '[.?:]\s*(?=[''"])'
|
|
210
|
+
close: '(?=[''"])'
|
|
211
|
+
# A route group written Route::prefix('a')->name('a.')->group(...), its calls chained in any
|
|
212
|
+
# order and with middleware(...) among them; it ends at the parenthesis that closes group(.
|
|
213
|
+
spans:
|
|
214
|
+
- name: group
|
|
215
|
+
open: 'Route::(?:(?:prefix\(\s*[''"](?<prefix>[^''"]*)[''"]\s*\)|name\(\s*[''"](?<name>[^''"]*)[''"]\s*\)|middleware\((?:[^()''"]|''[^'']*''|"[^"]*")*\))\s*->\s*)+group(?=\s*\()'
|
|
216
|
+
balance: ['(', ')']
|
|
217
|
+
# The spans the config key rules read, for a config file this type claims by its name, such as
|
|
218
|
+
# config/api.php. They are config_text's spans; see there.
|
|
219
|
+
- name: config_return
|
|
220
|
+
open: '(?<![\w$>])(?<word>return)\s*(?=\[)(?!\[(?:[^\[\]]|\[(?:[^\[\]]|\[[^\[\]]*\])*\])*\]\s*\[)'
|
|
221
|
+
balance: ['[', ']']
|
|
222
|
+
- name: config_key
|
|
223
|
+
open: '[\[,(\s](?<q>[''"])(?<key>(?:(?!(?P=q))[^\\$])+)(?P=q)\s*(?<arrow>=)>\s*(?=\[)(?!\[(?:[^\[\]]|\[(?:[^\[\]]|\[[^\[\]]*\])*\])*\]\s*\[)'
|
|
224
|
+
balance: ['[', ']']
|
|
225
|
+
- name: config_bracket
|
|
226
|
+
open: '(?=(?<at>\[))'
|
|
227
|
+
balance: ['[', ']']
|
|
228
|
+
- name: config_paren
|
|
229
|
+
open: '(?=(?<at>\())'
|
|
230
|
+
balance: ['(', ')']
|
|
231
|
+
- name: config_brace
|
|
232
|
+
open: '(?=(?<at>\{))'
|
|
233
|
+
balance: ['{', '}']
|
|
234
|
+
# A config file read a second time, as text, for the keys of the array it returns: the php type
|
|
235
|
+
# still gives each file its laravel.config node. Its sections are route_file's less inline HTML,
|
|
236
|
+
# which a valid config file holds only outside the array it returns.
|
|
237
|
+
config_text:
|
|
238
|
+
endings: [php]
|
|
239
|
+
reader: text
|
|
240
|
+
path_values:
|
|
241
|
+
# config/app.php is app.
|
|
242
|
+
config_name:
|
|
243
|
+
pattern: '^(?:.*/)?(?<name>[^/]+)\.php$'
|
|
244
|
+
template: '{name}'
|
|
245
|
+
sections:
|
|
246
|
+
- name: heredoc
|
|
247
|
+
open: '<<<[ \t]*["'']?(?<label>[A-Za-z_][A-Za-z0-9_]*)'
|
|
248
|
+
close: '\n[ \t]*{label}\b'
|
|
249
|
+
- name: block_comment
|
|
250
|
+
open: '/\*'
|
|
251
|
+
close: '\*/'
|
|
252
|
+
- name: line_comment
|
|
253
|
+
open: '//'
|
|
254
|
+
close: '\n'
|
|
255
|
+
- name: hash_comment
|
|
256
|
+
open: '#[^\[\n]'
|
|
257
|
+
close: '\n'
|
|
258
|
+
- name: string
|
|
259
|
+
open: ''''
|
|
260
|
+
close: '(?:[^''\\]|\\(?s:.))*'''
|
|
261
|
+
- name: string
|
|
262
|
+
open: '"'
|
|
263
|
+
close: '(?:[^"\\{]|\\(?s:.)|\{\$(?:[^{}"'']|"(?:[^"\\]|\\(?s:.))*"|''(?:[^''\\]|\\(?s:.))*'')*\}|\{)*"'
|
|
264
|
+
- name: string
|
|
265
|
+
open: '`'
|
|
266
|
+
close: '(?:[^`\\]|\\(?s:.))*`'
|
|
267
|
+
# The operator before a string, so that a key match starting before a string after . ? or :
|
|
268
|
+
# is left out: FOO . 'x' => 1 and $c ? 'a' : 'b' => 1 give no key.
|
|
269
|
+
- name: operator
|
|
270
|
+
open: '[.?:]\s*(?=[''"])'
|
|
271
|
+
close: '(?=[''"])'
|
|
272
|
+
# A key match counts the spans that hold its start. config_return is the array a return
|
|
273
|
+
# statement gives, config_key the array a text key's value is, config_bracket each array,
|
|
274
|
+
# written [ ], config_paren each pair of parentheses and config_brace each pair of braces. A
|
|
275
|
+
# key gets a node only inside one config_return, inside no parentheses and no braces, and
|
|
276
|
+
# when every array that holds it is the return's or a text key's: so not below a list entry,
|
|
277
|
+
# not in a call's argument, not in a closure and not in old array( ) syntax. An array indexed
|
|
278
|
+
# at once, ['a' => 1][$k], opens neither config_return nor config_key, nor is it a key's
|
|
279
|
+
# value, when it holds arrays at most two deep.
|
|
280
|
+
spans:
|
|
281
|
+
- name: config_return
|
|
282
|
+
open: '(?<![\w$>])(?<word>return)\s*(?=\[)(?!\[(?:[^\[\]]|\[(?:[^\[\]]|\[[^\[\]]*\])*\])*\]\s*\[)'
|
|
283
|
+
balance: ['[', ']']
|
|
284
|
+
- name: config_key
|
|
285
|
+
open: '[\[,(\s](?<q>[''"])(?<key>(?:(?!(?P=q))[^\\$])+)(?P=q)\s*(?<arrow>=)>\s*(?=\[)(?!\[(?:[^\[\]]|\[(?:[^\[\]]|\[[^\[\]]*\])*\])*\]\s*\[)'
|
|
286
|
+
balance: ['[', ']']
|
|
287
|
+
- name: config_bracket
|
|
288
|
+
open: '(?=(?<at>\[))'
|
|
289
|
+
balance: ['[', ']']
|
|
290
|
+
- name: config_paren
|
|
291
|
+
open: '(?=(?<at>\())'
|
|
292
|
+
balance: ['(', ')']
|
|
293
|
+
- name: config_brace
|
|
294
|
+
open: '(?=(?<at>\{))'
|
|
295
|
+
balance: ['{', '}']
|
|
296
|
+
# A Blade template ends in .blade.php; the longer ending wins over php_basic's php, so a
|
|
297
|
+
# template is read as text and not parsed as PHP.
|
|
298
|
+
blade:
|
|
299
|
+
endings: [blade.php]
|
|
300
|
+
reader: text
|
|
301
|
+
path_values:
|
|
302
|
+
# Below views_root, resources/views/books/show.blade.php is books.show, the name view() and
|
|
303
|
+
# @include use.
|
|
304
|
+
view:
|
|
305
|
+
pattern: '^(?<name>.+)\.blade\.php$'
|
|
306
|
+
template: '{name}'
|
|
307
|
+
relative_to: views_root
|
|
308
|
+
normalize:
|
|
309
|
+
- {replace: '/', with: '.'}
|
|
310
|
+
sections:
|
|
311
|
+
- name: blade_comment
|
|
312
|
+
open: '\{\{--'
|
|
313
|
+
close: '--\}\}'
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
$schema: "https://periplus.dev/schema/0/pack-file.schema.json"
|
|
2
|
+
|
|
3
|
+
# A controller and an Eloquent model, each its own node beside the php.class php_basic makes for
|
|
4
|
+
# the same class, with an edge to that class. A rule cannot add a type or a role to the class
|
|
5
|
+
# node itself, cannot test what a class extends or its name, and a declaration rule cannot narrow
|
|
6
|
+
# by file name, so both are found by folder alone: a controller is any class in the controllers
|
|
7
|
+
# folder, a model any class in the models folder. No body_child: a second rule on
|
|
8
|
+
# class_declaration with one breaks php_basic's enclosing_class edges.
|
|
9
|
+
|
|
10
|
+
rules:
|
|
11
|
+
|
|
12
|
+
- rule: controller_class
|
|
13
|
+
reads: file
|
|
14
|
+
in: [controllers]
|
|
15
|
+
match: {declaration: class_declaration, name_child: name, filetype: php}
|
|
16
|
+
id: {from: qualified_name}
|
|
17
|
+
emits: [{node: {type: laravel.controller}}]
|
|
18
|
+
confidence: inferred
|
|
19
|
+
|
|
20
|
+
- rule: controller_is_class
|
|
21
|
+
reads: file
|
|
22
|
+
in: [controllers]
|
|
23
|
+
match: {declaration: class_declaration, name_child: name, filetype: php}
|
|
24
|
+
id: {from: qualified_name}
|
|
25
|
+
emits: [{edge: {kind: implemented_by, from: this_node, to: {from: qualified_name}}}]
|
|
26
|
+
confidence: inferred
|
|
27
|
+
|
|
28
|
+
- rule: model_class
|
|
29
|
+
reads: file
|
|
30
|
+
in: [models]
|
|
31
|
+
match: {declaration: class_declaration, name_child: name, filetype: php}
|
|
32
|
+
id: {from: qualified_name}
|
|
33
|
+
emits: [{node: {type: laravel.model}}]
|
|
34
|
+
confidence: inferred
|
|
35
|
+
|
|
36
|
+
- rule: model_is_class
|
|
37
|
+
reads: file
|
|
38
|
+
in: [models]
|
|
39
|
+
match: {declaration: class_declaration, name_child: name, filetype: php}
|
|
40
|
+
id: {from: qualified_name}
|
|
41
|
+
emits: [{edge: {kind: implemented_by, from: this_node, to: {from: qualified_name}}}]
|
|
42
|
+
confidence: inferred
|