Giter VIP home page Giter VIP logo

cybercog / laravel-paket Goto Github PK

View Code? Open in Web Editor NEW
173.0 5.0 20.0 2.69 MB

Composer GUI. Manage Laravel dependencies from web interface without switching to command line!

Home Page: https://komarev.com/sources/laravel-paket

License: MIT License

PHP 45.48% JavaScript 8.11% Vue 45.18% SCSS 0.55% Blade 0.68%
laravel cog paket composer gui package-manager package installer library-management-system dependencies

laravel-paket's People

Contributors

afrizal423 avatar antonkomarev avatar caneco avatar dependabot[bot] avatar justmd5 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  avatar

laravel-paket's Issues

Add enum for Job Status

Introduce enumerable statuses for the Job entity.

Possible namesapce candidates:

  • Cog\Laravel\Paket\JobStatus\Enums\JobStatus
  • Cog\Laravel\Paket\Job\JobStatus\Enums\JobStatus
  • Cog\Laravel\Paket\Job\Status\Enums\Status

Revise Support Composer implementation

Need to refactor Composer support class methods install & uninstall. They shouldn't know anything about Job entity.

executeCommand doing too many things. It's doing JobFileRepository work. Maybe it will be better to make a new ProcessFileRepository class which will be responsible for process output read\write.

[idea] have install that agent

My idea simple in many cases you want see what happened on remote location while the dashboard in local or someware else it bit poinless the dashboard if you can setup remote monitor but love the idea

Revise jobs & requirements HTTP API

Current API

To install requirement we can send POST /requirements request:

{
  name: "cybercog/laravel-love",
  version: "^7.1",
  isDevelopment: false
}

To uninstall requirement we can send DELETE /requirements/{uid} request, where {uid} is base64 encoded package name.

New API

But in fact we are not creating requirement. We are asking server to create a job to install this requirement. It might be better to have unified API endpoint to create all types of jobs.

To install requirement we will send POST /jobs request:

{
  type: "RequirementInstall",
  requirement: {
    name: "cybercog/laravel-love",
    version: "^7.1",
    isDevelopment: false
  },
}

To uninstall requirement we will send POST /jobs request:

{
  type: "RequirementUninstall",
  requirement: {
    name: "cybercog/laravel-love",
    version: null,
    isDevelopment: false
  },
}

[Concept] Add more Process classes

  • NullProcess - for the cases when process not yet launched and doesn't have any output and no exitCode.
  • Process - for the cases when process executing but not yet completed
  • TerminatedProcess - for the cases when process has been completed

Current Process could become AbstractProcess class.

php8 support

does your package not support php 8?

[InvalidArgumentException]
  Package cybercog/laravel-paket has a PHP requirement incompatible with your PHP version, PHP extensions and Compose
  r version

some times the composer commond not in /usr/bin

some times the composer commond not in

/usr/bin

,such as. in mac or other linux os dont have permission to write,so often we put the composer in

/usr/local/bin

consider removing the definition of path and switching to the definition of environment path or any other better choice ?

Real time terminal log

We can implement it with polling /api/jobs/{job} because it's local development machine and there is no need to worry about server load.

Protect HTTP API in production environment

Before 1.0 release we must have mechanism to protect production applications from developers mistakes.

  • requirement could be added to composer.json without --dev flag
  • requirements could be installed on production without --no-dev flag

By default Paket should be available on local environment only.

This behavior could be configured in config/paket.php file paket.middlewares key.
Authorize middleware class is responsible for this restriction.

You may export configuration file using the php artisan vendor:publish --tag=paket-config command.

Job domain name

There are many names: Job, Task, Process, Process Group, what are they?

Process - a process is an instance of a program that is being executed. In some systems it's called Task. When we are trying to install or uninstall requirement - we are running OS process via Symfony\Component\Process\Process. It might possible that installation & uninstallation will require to run multiple processes one by one, so we need to aggregate processes to a group.

Linux shell creates a process group for each Job it launches, and places each process it starts into the appropriate process group. For example, ls | head is a pipeline of two processes, which the shell considers a single job, and will belong to a single, new process group.

To not over-engineer system at this stage we will have Job entity, which have only one Process for the sake of simplicity. In next versions we should revise need of ProcessGroup aggregate.

Usage of word Job might confuse developers because Laravel uses it for Queue Jobs. To avoid confusion jobs on framework side will be called queue jobs and will be placed in \QueueJobs\ namespace.

Paket Job Runner will be located in queue job Cog\Laravel\Paket\Job\QueueJobs\RunJob.

Refactor HTTP controllers structure

Current implementation

  • Cog\Laravel\Paket\Http\Controllers\Api\Jobs\Collect\Action
  • Cog\Laravel\Paket\Http\Controllers\Api\Jobs\Collect\Request
  • Cog\Laravel\Paket\Http\Controllers\Api\Jobs\Collect\Response

New implementation

  • Cog\Laravel\Paket\Http\Controllers\Api\Jobs\CollectAction
  • Cog\Laravel\Paket\Http\Controllers\Api\Jobs\CollectRequest
  • Cog\Laravel\Paket\Http\Controllers\Api\Jobs\CollectResponse

Revise types of requirements

Current

Now we have 2 types of requirements depends of usage purpose:

  • Root Requirement — package required for development & production.
  • Dev Requirement — package required for development purposes only.

And 2 types depends of package is required as main functionality or is required by requirement:

  • Essential Requirement — fundamental application package requirements.
  • Dependency Requirement — a package required by other packages to be installed (because they relies on functionality provided by it).

But I've started to think that I've named it wrong.
Root Requirement should become Essential Requirement and vice a versa.

New

Now we have 2 types of requirements depends of usage purpose:

  • Essential Requirement — package required for development & production.
  • Dev Requirement — package required for development purposes only.

And 2 types depends of package is required as main functionality or is required by requirement:

  • Root Requirement — fundamental application package requirements.
  • Dependency Requirement — a package required by other packages to be installed (because they relies on functionality provided by it).

Revise Job & Requirement relation

Need to revise relation between Job & Requirement entities:

  • is Requirement belongs to Job?
  • can Job accept null instead of Requirement?

It looks like I'm missing one more entity which links Job & Requirement entities.

New design proposal for the layout

Nice little package! Love it so far :)

But we could improve the layout a bit. It always works better when the design is more coherent.

I have roughly prepared a draft for the dashboard and the simple requirements page. Tell me what you think about it :)

I would agree to make the implementation in Vue, if you want. But would rather do it on the side, so it might take a while for me.

dashboard

requirements

Simplify JobRepository store method

Current API:

public function store(JobContract $job, RequirementContract $requirement): void

New API:

public function store(JobContract $job): void

Package name in Packagist

Should we keep using cybercog/laravel-paket or switch to new cog/laravel-paket namespace?

No. We can't do it:

The vendor is already taken by someone else. You may ask them to add your package and give you maintainership access. If they add you as a maintainer on any package in that vendor namespace, you will then be able to add new packages in that namespace. The packages already in that vendor namespace can be found at cog

Add warning when Queue is not available

Otherwise developer wouldn't understand why job isn't starting. This info should be in Environment section of the Dashboard & displayed as warning icon in the top menu.

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.