GithubHelp home page GithubHelp logo

buggregator / trap Goto Github PK

View Code? Open in Web Editor NEW
79.0 79.0 7.0 3.09 MB

Buggregator local debug server for PHP projects as composer package

Home Page: https://buggregator.dev

License: BSD 3-Clause "New" or "Revised" License

PHP 92.78% Batchfile 0.03% HTML 4.88% Makefile 2.30%
buggregator bugregator cli composer composer-package console debug dump hacktoberfest php sentry smtp

trap's Issues

Remove `replaces` block

It is necessary to remove the replaces block, as it can conflict with other packages that have overlaps in the replaces section.
It would also be desirable to find or create a separate reliable package responsible for removing unnecessary polyfills.

Profiling support

Helpers

Thoughts

  • #41 (required to be prepared for adding trap()::profile() methods)
  • SPX
  • XHProf (supported by Buggregator Server and UI)
  • XDebug (local files, cachegrind format, 1)

Parsing formats

  • Parse XHProf content into XHProf events
  • Parse XDebug content into XDebug events
  • Parse SPX content into SPX events

Local profiling files

Rendering:

Integrate PestPHP for Enhanced Testing Support

Summary

I propose integrating PestPHP into buggregator/trap.

PestPHP is known for its elegant syntax and pretty console outputs, enhancing both readability and debugging capabilities.

Reference Example

Please refer to this repository for a guide on integrating PestPHP with Laravel packages: Laravel Package Template with PestPHP.

Benefits

  • Improved test readability and maintenance.
  • Pretty console output for better debugging.
  • Attracts a broader audience familiar with PestPHP.

[Feature]: Add PHPStan Support alongside Psalm

I propose adding PHPStan to our development toolchain alongside Psalm.

Key benefits include:

  • Widespread Adoption: PHPStan is widely used in PHP projects, making integration seamless for most developers.
  • Complementary Tooling: Using both PHPStan and Psalm allows us to leverage their unique strengths in static analysis, enhancing code quality and reliability. See the discussion here for more insights: GitHub Discussion #8986.
  • Minimal Impact on Dependencies: Adding PHPStan should not significantly affect our dev dependencies, as buggregator/trap is included as a dev dependency.

This tool setup would increase the robustness of our code analysis without major overhead.

Websockets support

It miht be useful for elimination of Docker requirement. In that case we shall use PHP only on backend

Add support for a configuration file

Checklist:

  • Choose the format of the future configuration file (leaning towards XML when choosing between PHP, XML, JSON, and YAML).
  • Determine what can be configured (including in the future).
  • Design the file structure.
  • Describe the schema.

Fix SMTP assets

When a user opens an SMTP event with images in the markup, the images do not display.

image

Add support for environment variables.

It would be good to have ability to use TRAP_* env variables to configure /vendor/bin/trap

For example:

TRAP_SENDERS=console,server
TRAP_DEBUG_PORTS=9912,xxxx,yyyy
TRAP_UI_PORT=8000

Which would simplify usage in docker, here is current example:

  trap:
    image: wayofdev/php-dev:8.3-cli-alpine-latest
    container_name: ${COMPOSE_PROJECT_NAME}-trap
    restart: on-failure
    networks:
      - default
    ports:
      - '${TRAP_PORT:-9912}:9912'
      - '${TRAP_UI_PORT:-8000}:8000'
    volumes:
      - ./:/app:rw
      - ~/.composer:/.composer
    env_file:
      - .env
    entrypoint:
      - /app/vendor/bin/trap
      - --ui
      - --port=${TRAP_PORT:-9912}
      - --sender=server
      - --sender=console

Also, currently, there is no way to customize UI port number. 8000 port is used by many other applications, and it would be nice, to be able to customize it via console command attributes and also via ENV variables.

[Docs]: List all vendor/bin/trap commands inside README.md

For those who starts using trap for first time, it would be useful to list all available commands through console --help, inside README.md, so that developers could easily find documentation in one place.

I would propose to create table inside markdown with available options from console:

image

Consider ID list in `Delete all events` endpoint

In the case when a user locks an event, a list of event identifiers for deletion is sent to the endpoint for clearing all events. This needs to be taken into account.
To do this, we need to consider passing additional parameters from the request payload.

  • When calling RPC via a websocket, additional parameters are defined in the data field.
    #37
  • When accessing via HTTP, parameters are passed in the request body, packed in JSON.
    #38

Build PHAR

Need to config CI pipelines to build trap.phar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.