Coder Social home page Coder Social logo

capro's Issues

Add dd() and dump() functions ?

Maybe it would be nice to add functions many already know from Symfony and Laravel. the dd() and dump() function...

Could be useful for working with API's when you need to debug...

Autoload client's autoload.php file

Now that it's using phar, it doesn't autoload the client's vendor/autoload.php anylonger, which doesn't work if you are using eg. Guzzle in the config files, then you have to manually require the autoload.php file. So do this automatically.

something like:
if file exists ( getcwd() /vendor/autoload.php
-> require_once getcwd() /vendor/autoload.php

might need to be disabled for the capro-dev itself, so it doesn't double load autoload.php file

Slow Bug

It got super slow, especially the build process which now takes around 15 seconds 馃槾
But also the other commands are slow and takes a second eg capro -v

Seems to work fine in the global capro, but when it's inside a project dir, eg. capro-docs, using capro or vendor/bin/capro it's slooow....

Access config/env variables in yaml front matter

Nice to have.

It can be useful to set view's yaml-front-matter to variables from config/.env file.
eg. to disable build on production (for drafts)

core.disable_build: ${{ config('app.is_production') }}

Probably best to use the same replacement as github action does ${{ like.this }} - as others are using this so this is what people are used to. The eval the content as raw php, so it can be used for config, env, and other things, eg. ${{ env('foo') }}.

Serve command - terminal issues when using global capro

When using composer's global "capro serve" command (instead of vendor/bin/capros serve") the terminal is bugging out after the serve is done... It's super weird but probably something to do with the "passthru()" command the global package uses to send it down to the projects capro package...

Serve: Check if port is busy before serving

Right now capro serve will tell you it's running even if you specify a busy port. It would be nice to check if the port is "free" before starting, and then throw an error if port is busy.

Support for pagination

I was looking at this project and it looks really interesting for me being a Laravel developer previously. I didn't saw this in the documentation but was curious if it supported pagination for collection pages?

Build as a phar file on release

Since composer global "installs" won't always work because of dependency issues, it would be nice to have a phar file to work as the "global" capro binary.

Look into if it can be build automatically on each new release.

After this a capro self-update would be nice, atleast for the phar.

Bug: `capro serve` bugs when having functions in config file

capro serve                                                                                                                                                                                                            
PHP Fatal error:  Cannot redeclare get_cats() (previously declared in .\capro-docs\config\core.php:5) in .\capro-docs\config\core.php on line 5        
禄 Capro development server started at http://127.0.0.1:82                                                                                                                                                                

Temporary fix, use if (!function_exists('foo')) { before each function...

If anyone has any idea on how to fix this, it's greatly appreciated :)


馃巸 For more PHP hacktoberfest issues, see:
https://github.com/search?q=owner%3Axy2z+label%3Ahacktoberfest+is%3Aopen&type=issues&s=comments&o=asc

Alpha test and feedback

I'm hoping to get some community testing before the stable release.

Everyone is welcome to test!

Would be nice to get at least 2-3 testers for each OS. I have tested it on Windows 10 and Ubuntu Server, so it should work on most stuff, but would be nice to get some reports from others :)

When these are done, and all the alpha issues in the Alpha milestone, a stable version can be released.

Status

  • Windows 10 (1/3)
  • Windows 11 (0/3)
  • Linux (eg. Ubuntu) server/desktop (1/3)
  • macOS (0/3)
  • PHP 8.0 ()
  • PHP 8.1 ()
  • PHP 8.2 ()

Prepare test

  • Make sure you're using a PHP version that is supported (see README)
  • Have Composer installed, and make sure the composer global bin directory is in your PATH.

How to test

  1. Start by installing Capro globally composer global require xy2z/capro:@alpha
  2. Make a new capro site (will create a new folder): capro new <name>
  3. Test the site works: cd <name> + php -S localhost:82
  4. Edit a blade file, eg. views/pages/index.blade.php and run capro build (in the project root dir)
  5. Edit a config variable, run capro build and test the config variable is changed in the HTML file.
  6. Add a file in the static directory, run capro build - and validate the file is added to the public directory.

Extended testing

  1. Make a Blade template and test it works after build
  2. Test collections - https://capro.xy2z.io/collections/
  3. Test View Templates - https://capro.xy2z.io/view-templates/
  4. Edit the core config file (directory names) and test build still works - https://capro.xy2z.io/config/
  5. ???

Reporting

Please comment below your test results, including OS version, PHP version and Capro version. And if you had any issues please include the logs. Thanks! 馃憤

Default template has malformed HTML

This is a really basic issue, but the default template used has got a missing closing </div> - opened directly after the body tag as <div class="app">.

I know this is really basic, but I haven't found any actual issues yet and I want to do my part as a good OSS citizen :)

Config command: Dump files not working

If you run capro config app.domain it works as expected.
But if you want to print the complete "app" array (config/app.yml file) - it just prints empty array:

位 capro config app
Array
(
    [app] =>
)

Even though it contains many items...
It might be the LiteConfig package that needs to be updated?

Allow for Custom Collector methods

Eg. a magic method __call() - try to call the custom class/method with $this->data as argument.

Or set the CustomCollector class via the core config, so it points to eg. CustomCollector::class, which should be extended of Capro's Collector class.

It should still return $this, well maybe not necessarily, as it could also be like a sum() method, so probably let it be mixed.

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.