Code Monkey home page Code Monkey logo

canvas's People

Contributors

blhylton avatar crynobone avatar edersoares avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

canvas's Issues

When running make:xxx command, generated file goes to vendor.

  • Package Version: 9.0.1
  • Laravel Version: 11.1.0
  • PHP Version: 8.3.4

Description:

We use https://github.com/Jeroen-G/laravel-packager for package development.

All make:### commands put the generated result into the vendor folder.

I have not testet every single make-command, but all I tested did not work for me.

Example:
vendor/bin/canvas make:model TestModel

outputs to: ./vendor/orchestra/testbench-core/laravel/app/Models/TestModel.php
but should go to ./src/Models/TestModel.php

Steps To Reproduce:

  1. Create a new package in laravel. We use laravel-packager with this skeleton: https://www.robin-rick.de/laravel11-package-skeleton.zip
    php artisan package:new some-vendor some-package-name --skeleton="https://www.robin-rick.de/laravel11-package-skeleton.zip"
  2. run vendor/bin/canvas preset package (with namespace argument) to generate canvas.yaml
  3. run vendor/bin/canvas make:model TestModel
  4. The generated view file goes inside the vendor folder rather than the packages resources folder.

Command "make:seeder" is not defined.

  • Package Version: 7.4.0
  • Laravel Version: #.#.#
  • PHP Version: ^8.0

Description:

Running the command "make:seeder" results in the error attached as a screenshot.

Steps To Reproduce:

run the command: composer exec canvas make:seeder YourSeeder
seeder_cmd_error

Possible Solution

Add an entry for the $app->add() for Seeder. See attach screenshot

seeder_cmd_solution

When running make:view the view is scaffolded inside the vendor folder

  • Package Version: v8.11.6
  • Laravel Version: v10.41.0
  • PHP Version: 8.1.26

Description:

Running the make:view command in the context of a package with a published canvas file, puts the view inside the following folder:

vendor/bin/canvas make:view

 ┌ What should the view be named? ──────────────────────────────┐
 │ career                                                       │
 └──────────────────────────────────────────────────────────────┘

   INFO  View [vendor/orchestra/testbench-core/laravel/resources/views/career.blade.php] created successfully.

Steps To Reproduce:

  1. Create a new package in Laravel I'm using this skeleton by Spatie and require canvas.
  2. Run vendor/bin/canvas preset package to generate the attached canvas.yml file.
  3. Run the vendor/bin/canvas make:view command and provide a name.
  4. The generated view file goes inside the vendor folder rather than the packages resources folder.
preset: package

namespace: Creode\LaravelCareers
user-auth-model: App\Models\User

paths:
  src: src
  resource: resources

factory:
  path: database/factories

migration:
  path: database/migrations
  prefix: ''

console:
  namespace: Creode\LaravelCareers\Console

model:
  namespace: Creode\LaravelCareers\Models

provider:
  namespace: Creode\LaravelCareers\Providers

testing:
  namespace: Creode\LaravelCareers\Tests

Canvas silently replaces make commands when installed as a transitive dependency

  • Package Version: 8.11.3
  • Laravel Version: 10.30.1
  • PHP Version: 8.2.7

Description:

I noticed my make: commands had a --preset flag with the semi-helpful description Preset used when generating $X that I couldn't find any documentation for, and that didn't appear in the framework's make commands.
Long story short, I discovered the commands had been overridden by canvas, which had been installed via Psalm's Laravel plugin:

composer why orchestra/canvas -t
orchestra/canvas v8.11.3 Code Generators for Laravel Applications and Packages
├──orchestra/canvas-core v8.10.0 (conflicts orchestra/canvas <8.11.0) (circular dependency aborted here)
└──orchestra/workbench v8.0.0 (requires orchestra/canvas ^8.11)
   └──orchestra/testbench v8.14.1 (requires orchestra/workbench ^1.0 || ^8.0)
      └──psalm/plugin-laravel v2.8.0 (requires orchestra/testbench ^7.19 || ^8.0)
         └──my/app dev-main (requires (for development) psalm/plugin-laravel ^2.8)

I understand how and why this works the way it does from the service discovery side, but it still feels way too far-reaching to silently override the commands without any hints to the developer.
I should not have to expect side effects to the way my application works from installing an apparently unrelated third-party dependency.

My suggestion is thus:

  • Canvas should only apply modifications if installed as a direct dependency (or part of workbench).
  • If that isn't possible, the help output of overridden commands should include a message indicating that a modified version is running.

Steps to reproduce:

  1. Install a package that depends on canvas
  2. Observe make commands being replaced

Component Views not created

  • Package Version: 5.4.4
  • Laravel Version: #.#.#
  • PHP Version: 7.3.3

Description:

I'm using this package outside laravel to create my own package
I'm getting error which says Illuminate\Foundation\Inspiring not found while creating component.
u can found the stack trace in this image https://prnt.sc/torwsw

Steps To Reproduce:

mkdir PackageName
cd PackageName
composer init
composer require --dev "orchestra\canvas"
./vendor/bin/canvas preset package --namespace "ClassName"
./vendor/bin/canvas make:component HelloComponent

Version 6 release date.

I'm developing a Laravel ^8.x package so I wanted to use this package as part of my test suite. I was gonna contribute with a PR to support that version of Laravel, but I noticed you already have version 6 in the making which support the version of laravel I'm using. Do you have a ETA for version 6?

Database factory namespace

Hi @crynobone,

Thanks for the package!

Model factory generator assigns Database\Factories namespace by default with the package preset, I guess we should be able to specify a custom namespace in YAML config. What do you think?

Thanks,
E

Pest option doesn't work for `make:test` command

  • Package Version: 7.4.0
  • Laravel Version: 9.50.1
  • PHP Version: 8.0.27, 8.1.14, 8.2.1

Description:

Utilizing the make:test command with the --pest option results in a PHPUnit test.

Steps To Reproduce:

  • Assume a test named MyTest
  • composer exec canvas make:test MyTest -- --pest completes, but utilizes the PHPUnit stub instead of Pest.

Screenshot 2023-02-02 at 10 45 29

Please disregard the default bash prompt and the missing lines from the top of the file due to tail. There were some privacy concerns with using my typical ZSH shell and showing the package namespace, but this does happen in ZSH as well.

Models Path

Hello!

Quick question. Is there a way to specify where models should be placed when running canvas make:model? I tried adding path: src/Models to the yaml file but no luck there.

Thanks in advance for the help!

When running nova:action the files go into the vendor folder

  • Package Version: 8.11.6
  • Laravel Version: 10.43.0
  • PHP Version: 8.2.13

Description:

Similar to this issue #32, running a command on a package to make "Actions" and "Repeatables" (haven't tested the other nova types so this could also affect those). The outputted files get put into: /vendor/orchestra/testbench-core/laravel/app/Nova/Actions

Steps To Reproduce:

Create a new package in Laravel I'm using this skeleton by Spatie and require canvas.

  1. Run vendor/bin/canvas preset package to generate a canvas.yml file.
  2. Run the vendor/bin/canvas nova:action TestAction command.
  3. The generated view file goes inside the /vendor/orchestra/testbench-core/laravel/app/Nova/Actions folder rather than the packages src/Nova/Actions folder.

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.