Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/beromir/beromir.ray
Package to debug your Neos CMS site with the Ray app.
https://github.com/beromir/beromir.ray
debug neos-fusion neoscms
Last synced: 11 days ago
JSON representation
Package to debug your Neos CMS site with the Ray app.
- Host: GitHub
- URL: https://github.com/beromir/beromir.ray
- Owner: beromir
- License: gpl-3.0
- Created: 2021-10-04T19:54:43.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-04-21T10:56:13.000Z (over 2 years ago)
- Last Synced: 2024-09-17T02:45:21.121Z (2 months ago)
- Topics: debug, neos-fusion, neoscms
- Language: PHP
- Homepage:
- Size: 32.2 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ray Helper for Neos CMS
Debug your Neos site with the Ray app.
Ray is a debugger app from Spatie. You can find more information about Ray on https://myray.app/.
Official Ray docs: https://spatie.be/docs/ray/v1/introduction.## Installation
Run the following command in your site package:
```
composer require --no-update beromir/neos-ray
```
Then run `composer update` in your project root.## Requirements
You need to have the Ray app installed and a valid license.
You can download the app here: https://spatie.be/docs/ray/v1/the-ray-desktop-app/download-the-free-demo.## Configuration
Create the configuration file `ray.php` in your Neos site root directory.
Configuration options: https://spatie.be/docs/ray/v1/configuration/framework-agnostic-php.
Configuration options when you use Docker: https://spatie.be/docs/ray/v1/environment-specific-configuration/docker.## Usage
You can use all Ray functions from https://spatie.be/docs/ray/v1/usage/framework-agnostic-php-project.
Reference list (just the PHP specific functions): https://spatie.be/docs/ray/v1/usage/reference.To use the functions, you must add them as key-value pairs in Fusion.
If the function does not require any parameters, you can use `null`, `false` or an empty string as the value.
To pass parameters, add them as a value.```html
valueToDebug = 'Show this text in the Ray app.'
[email protected] = Beromir.Ray:Debug {
// Show a label in the Ray app
label = 'Text'
// Colorize the output
red = ''
// Show the output as large text
large = ''
}
``````html
valueToDebug = 'Show this text in the Ray app.'
[email protected] = Beromir.Ray:Debug {
// Show a label in the Ray app
label = 'Text'
// Only send a payload once when in a loop
once = ${node}
}
```**Debug a Fusion expression:**
```html
valueToDebug = 'Show this text in the Ray app.'
[email protected] = Beromir.Ray:Debug
```Alternative ways:
```html
// Debug the current node
debug = Beromir.Ray:Debug {
value = ${node}
}renderer = afx`
{props.debug}
`
``````html
renderer = afx`
`
```**Debug multiple values:**
```html
debug = Beromir.Ray:Debug {
// Pass the values as an array
value = ${[node, site]}
}renderer = afx`
{props.debug}
`
```**Use Debug Actions to debug NodeTypes:**
```html
// Display the NodeType name of the node
debug = Beromir.Ray:Debug {
value = ${node}
debugAction = 'nodeTypeName'
}renderer = afx`
{props.debug}
`
``````html
// Display the properties of the current node and the site node
debug = Beromir.Ray:Debug {
value = ${[node, site]}
debugAction = 'properties'
}renderer = afx`
{props.debug}
`
```You can use the following Debug Actions for NodeTypes:
| Debug Action| Description |
| --- | --- |
| `nodeTypeName` | Display the NodeType name of a node |
| `context` | Display the context of a node |
| `contextPath` | Display the context path of a node |
| `properties` | Display the properties of a node |### Eel Helper
You can also use the Ray Eel helper to debug your site.```
{Beromir.Ray.debug(node)}{Beromir.Ray.debug([node, site])}
```The second parameter can be used to set a debug action for NodeTypes.
```
{Beromir.Ray.debug(node, 'properties')}
```