VOOZH about

URL: https://deepwiki.com/hypervel/telescope/3.1-package-structure-and-dependencies

⇱ Package Structure and Dependencies | hypervel/telescope | DeepWiki


Loading...
Last indexed: 7 February 2026 (146f77)
Menu

Package Structure and Dependencies

This document describes the hypervel/telescope package structure defined in composer.json1-53 including PSR-4 autoloading configuration, dependency specifications, and dual framework integration points. The package uses both Hyperf's ConfigProvider and Hypervel's ServiceProvider patterns for registration.

For service provider bootstrapping details, see page 2.1.2. For configuration options, see page 4.


Package Metadata

PropertyValueReference
Package Namehypervel/telescopecomposer.json2
Description"The telescope package for Hypervel."composer.json3
LicenseMITcomposer.json4
Keywordsphp, hyperf, telescope, swoole, hypervelcomposer.json5-10
PHP Requirement^8.2composer.json23
Root NamespaceHypervel\Telescope\composer.json33
Source Directorysrc/composer.json33
AuthorAlbert Chen (albert@hypervel.org)composer.json18-19
Issueshttps://github.com/hypervel/components/issuescomposer.json13
Source Repositoryhttps://github.com/hypervel/componentscomposer.json14

Sources: composer.json1-21


PSR-4 Autoloading

The package defines a single PSR-4 autoload mapping composer.json31-34:


Class Resolution Examples


PSR-4 Autoload Resolution

Fully Qualified Class NameFile Path
Hypervel\Telescope\Telescopesrc/Telescope.php
Hypervel\Telescope\TelescopeServiceProvidersrc/TelescopeServiceProvider.php
Hypervel\Telescope\ConfigProvidersrc/ConfigProvider.php
Hypervel\Telescope\Watchers\RequestWatchersrc/Watchers/RequestWatcher.php
Hypervel\Telescope\Storage\DatabaseEntriesRepositorysrc/Storage/DatabaseEntriesRepository.php
Hypervel\Telescope\Contracts\EntriesRepositorysrc/Contracts/EntriesRepository.php
Hypervel\Telescope\Console\ClearCommandsrc/Console/ClearCommand.php
Hypervel\Telescope\Aspects\GuzzleHttpClientAspectsrc/Aspects/GuzzleHttpClientAspect.php

Sources: composer.json31-34


Dependencies


Telescope Dependency Graph

Dependency Details

PackageVersionUsage in Telescope
php^8.2Readonly properties in IncomingEntry, EntryResult; enums for entry types; improved type system
hyperf/context~3.1.0Context::get(), Context::set(), Context::override() for request-scoped flags: SHOULD_RECORD, IS_RECORDING, ENTRIES_QUEUE, UPDATES_QUEUE, BATCH_ID, HAS_STORED
hyperf/support~3.1.0Arr::get(), Arr::only(), Arr::except(), Str::limit() in watchers and entry formatting
hyperf/stringable~3.1.0Stringable class for fluent string manipulation in entry content formatting
hyperf/tappable~3.1.0tap() method for fluent configuration in Telescope::tag(), Telescope::filter() chains
hyperf/collection~3.1.0Collection class for managing entry arrays, tags, and batch operations in storage layer
hypervel/core^0.3Base ServiceProvider class, application instance access, configuration publishing

Version Constraints

ConstraintMeaningApplied To
^8.2>= 8.2.0, < 9.0.0PHP runtime
~3.1.0>= 3.1.0, < 3.2.0Hyperf packages
^0.3>= 0.3.0, < 0.4.0Hypervel core

The ~3.1.0 constraint ensures compatibility within Hyperf 3.1's minor version range while preventing breaking changes from 3.2.

Sources: composer.json22-29


Framework Integration

Telescope uses a dual-provider pattern for integration with both Hyperf and Hypervel, declared in composer.json36-47:


Integration Architecture


Dual Provider Integration Pattern

ConfigProvider (Hyperf Integration)

The extra.hyperf.config key composer.json40-42 points to Hypervel\Telescope\ConfigProvider. This class provides low-level Hyperf integration:

Responsibilities:

  • Returns dependencies array for DI container bindings
  • Returns commands array for console command registration
  • Returns publish array for configuration file publishing
  • Discovered and invoked by Hyperf's config scanner during framework initialization

Example Structure:


TelescopeServiceProvider (Hypervel Integration)

The extra.hypervel.providers array composer.json43-46 declares Hypervel\Telescope\TelescopeServiceProvider. This is the main entry point:

Responsibilities:

  • register() method: Merges configuration, registers storage drivers, binds repositories
  • boot() method: Registers routes, publishes resources, initializes watchers, attaches storage listeners
  • Extends Hypervel's ServiceProvider base class
  • Loaded by Hypervel's service provider discovery system

Key Methods:

  • registerRoutes(): Registers /telescope routes
  • registerWatchers(): Instantiates and registers all 18+ watchers
  • listenForStorageOpportunities(): Attaches RequestReceived/RequestHandled listeners
  • configureQueue(): Sets up coroutine context propagation for queue jobs

Sources: composer.json36-47


Discovery and Initialization


Package Discovery and Initialization Sequence

Initialization Phases

PhaseTriggerActionsKey Classes
AutoloadingApplication startupLoad vendor/autoload.php, parse composer.json, register PSR-4 mappingComposer autoloader
Hyperf ConfigHyperf framework bootScan extra.hyperf.config, invoke ConfigProvider::__invoke(), register DI bindings and commandsConfigProvider
Hypervel RegisterHypervel framework bootScan extra.hypervel.providers, call register(), merge config, bind repositoriesTelescopeServiceProvider::register()
Hypervel BootAfter all providers registeredCall boot(), register routes/watchers/listeners, start recordingTelescopeServiceProvider::boot()

Method Call Chain

  1. ConfigProvider::__invoke() → Returns configuration array
  2. TelescopeServiceProvider::register() → Merges config, binds repositories
  3. TelescopeServiceProvider::boot() → Initializes monitoring system
    • registerRoutes() → Registers /telescope routes
    • Telescope::start() → Enables recording system
    • registerWatchers() → Instantiates all watchers
    • listenForStorageOpportunities() → Attaches event listeners

Sources: composer.json31-47


Directory Structure


Package Directory Structure

Directory Organization

DirectoryNamespace SegmentContentsPurpose
composer.jsonN/APackage metadata, dependencies, autoload configPackage definition composer.json1-53
config/N/Atelescope.phpDefault configuration file
src/Hypervel\Telescope\PHP source filesPSR-4 autoload root composer.json33
src/Watchers/Hypervel\Telescope\Watchers\18 watcher classesApplication monitoring implementations
src/Storage/Hypervel\Telescope\Storage\DatabaseEntriesRepositoryData persistence layer
src/Contracts/Hypervel\Telescope\Contracts\Repository interfacesStorage abstraction contracts
src/Console/Hypervel\Telescope\Console\5 command classesConsole commands for management
src/Aspects/Hypervel\Telescope\Aspects\GuzzleHttpClientAspectAOP method interception
public/N/Aapp.js, mix-manifest.jsonCompiled frontend assets
resources/js/N/AVue.js componentsFrontend source code
database/migrations/N/AMigration filesDatabase schema definitions

Key Files by Namespace

File PathFully Qualified Class NameRole
src/Telescope.phpHypervel\Telescope\TelescopeStatic facade for entry recording
src/TelescopeServiceProvider.phpHypervel\Telescope\TelescopeServiceProviderFramework integration and bootstrapping
src/ConfigProvider.phpHypervel\Telescope\ConfigProviderHyperf DI container integration
src/IncomingEntry.phpHypervel\Telescope\IncomingEntryEntry data model during collection
src/EntryResult.phpHypervel\Telescope\EntryResultEntry data model after retrieval
src/ListensForStorageOpportunities.phpHypervel\Telescope\ListensForStorageOpportunitiesTrait for storage lifecycle management

Sources: composer.json31-34


Additional Metadata

Branch Aliasing and Stability

The package includes additional composer configuration composer.json37-52:

Branch Alias:


This maps the dev-main branch to version 0.3-dev, allowing composer require hypervel/telescope:0.3.x-dev to track the main branch.

Minimum Stability:


Allows installation of development versions of dependencies. This is set to "dev" composer.json52

Package Sorting:


Ensures dependencies are alphabetically sorted when running composer update composer.json50

Sources: composer.json37-52


Integration Summary Table

Integration AspectMechanismFile Reference
Package Namehypervel/telescopecomposer.json2
NamespaceHypervel\Telescope\composer.json33
AutoloadingPSR-4 mapping to src/composer.json31-34
Hyperf IntegrationConfigProvider via extra.hyperf.configcomposer.json40-42
Hypervel IntegrationTelescopeServiceProvider via extra.hypervel.providerscomposer.json43-46
PHP Version^8.2composer.json23
Framework VersionHyperf ~3.1.0composer.json24-28
Core DependencyHypervel Core ^0.3composer.json29

Sources: composer.json1-53