baraja-core / package-manager
Search all package dependencies automatically and register to your project.
Installs: 64 932
Dependents: 20
Suggesters: 0
Security: 0
Stars: 5
Watchers: 2
Forks: 2
Open Issues: 3
Requires
- php: ^8.0
- ext-json: *
- ext-pdo: *
- baraja-core/lock: ^1.0
- baraja-core/nette-symfony-console: ^1.0
- baraja-core/path-resolvers: ^1.0
- baraja-core/shutdown-terminator: ^1.0
- nette/application: ^3.0
- nette/bootstrap: ^3.0
- nette/di: ^3.0
- nette/finder: ^2.5
- nette/neon: ^3.0
Requires (Dev)
- phpstan/phpstan: ^1.0
- phpstan/phpstan-nette: ^1.0
- roave/security-advisories: dev-master
- spaze/phpstan-disallowed-calls: ^2.0
- tracy/tracy: ^2.8
- dev-master
- v3.4.5
- v3.4.4
- v3.4.3
- v3.4.2
- v3.4.1
- v3.4.0
- v3.3.3
- v3.3.2
- v3.3.1
- v3.3.0
- v3.2.0
- v3.1.0
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0.0
- v2.5.5
- v2.5.4
- v2.5.3
- v2.5.2
- v2.5.1
- v2.5.0
- v2.4.3
- v2.4.2
- v2.4.1
- v2.4.0
- v2.3.1
- v2.3.0
- v2.2.1
- v2.2.0
- v2.1.6
- v2.1.5
- v2.1.4
- v2.1.3
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.6
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v1.1.0
- v1.0.12
- v1.0.11
- v1.0.10
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- dev-renovate/configure
- dev-env-variable
- dev-restyled/renovate/configure
- dev-dependabot/add-v2-config-file
- dev-extensions-with-dependencies
This package is auto-updated.
Last update: 2024-11-09 21:12:02 UTC
README
BRJ organisation
Package manager
Search all package dependencies automatically and register to your project.
📦 Installation & Basic Usage
Simply use Composer:
$ composer require baraja-core/package-manager
And add to your project composer.json
this scripts
section:
"scripts": { "post-autoload-dump": "Baraja\\PackageManager\\PackageRegistrator::composerPostAutoloadDump" }
Now is your project configured.
After each composer ...
command this Package Manager will be called automatically.
🛠️ How to use
In Booting
class add create new instance of PackageRegistrator
:
new PackageRegistrator( __DIR__ . '/../', // root path __DIR__ . '/../temp' // temp path );
Notice: PackageRegistrator can work alone, Nette framework is not required, only recommended.
🗃️ Package.neon
Imagine you want install new package. Then it you must set specific configuration to your project common.neon
.
PackageRegistrator can scan all your installed packages and automatically create package.neon
file with merged configuration. In your common.neon
you define changes only and required parameters.
For correct work to app/Booting.php
add generated configuration.
$configurator->addConfig(__DIR__ . '/config/package.neon')
Warning: Configuration file can be different in all environment. Commit to repository is not recommended.
👷♀️ Tasks
After creating internal container with list of packages, call list of special tasks.
Default task list (but you can add more):
- Config local neon creator and normalizer
- Assets from packages copier
- Project
composer.json
normalizer - Clear cache
If you want add your own task, simply create class with name *Task
implementing ITask
interface. Package manager will find your class automatically in your project or shared package.
Order of tasks can be defined by Priority: xxx
doc comment anotation.
🗺️ Default project assert manager
In case of your package contain directory with name install
or update
, all inner content will be copied to your project automatically.
Structure in directory is same as your project root.
Name convention:
install
copy file and directories only in case when does not exist in your project structure,update
rewrite your project files in all composer actions.
If you want create file jquery.js
to /www/js
for example, simply define package structure:
/src
- files...
/install
/www
/js
- jquery.js
- composer.json
📄 License
baraja-core/package-manager
is licensed under the MIT license. See the LICENSE file for more details.