|
1 | 1 | <p align="center"><a href="https://github.com/php-forge/foxy" target="_blank"> |
2 | | - <img src="https://foxypkg.com/assets/img/logo.svg" width="260" alt="Foxy"> |
| 2 | + <img src="https://github.com/php-forge/foxy/blob/main/resources/foxy.svg" width="260" alt="Foxy"> |
3 | 3 | </a></p> |
4 | 4 |
|
5 | 5 | <p align="center"> |
|
20 | 20 | </a> |
21 | 21 | </p> |
22 | 22 |
|
| 23 | +Add to your `composer.json` file. |
| 24 | + |
| 25 | +Manager can be `bun`, `npm`, `yarn` or `pnpm`. For default, `npm` is used. |
| 26 | + |
| 27 | +```json |
| 28 | +{ |
| 29 | + "require": { |
| 30 | + "php-forge/foxy": "^0.1" |
| 31 | + }, |
| 32 | + "config": { |
| 33 | + "foxy": { |
| 34 | + "manager": "bun" |
| 35 | + } |
| 36 | + } |
| 37 | +} |
| 38 | +``` |
| 39 | + |
23 | 40 | > **Important:** |
24 | 41 | > |
25 | 42 | > ⚠ This plugin is based on [Fxpio/Foxy](https://github.com/fxpio/foxy). |
|
28 | 45 | > - PHP version to `8.1` or higher. |
29 | 46 | > - Composer version to `2.0` or higher. |
30 | 47 | > - Composer api version to `2.0` or higher. |
| 48 | +> - Add support for [Bun](https://bun.sh/). |
31 | 49 | > - Remove deprecated methods. |
32 | 50 | > - Add static analysis with [Psalm](https://psalm.dev). |
| 51 | +> - Add code quality with [StyleCI](https://github.styleci.io). |
| 52 | +
|
33 | 53 |
|
34 | 54 | Foxy is a Composer plugin to automate the validation, installation, updating and removing of PHP libraries |
35 | 55 | asset dependencies (javaScript, stylesheets, etc.) defined in the NPM `package.json` file of the project and |
36 | 56 | PHP libraries during the execution of Composer. It handles restoring the project state in case |
37 | | -[Bun](https://github.com/oven-sh/bun) or [NPM](https://www.npmjs.com) or [Yarn](https://yarnpkg.com) or [PNpM](https://PNpM.io) terminates with an error. |
38 | | - |
39 | | -All features and tools are available: [Npmrc](https://docs.npmjs.com/files/npmrc), [Yarnrc](https://yarnpkg.com/en/docs/yarnrc), |
40 | | -[Webpack](https://webpack.js.org), [Gulp](https://gulpjs.com), [Grunt](https://gruntjs.com), |
41 | | -[Babel](https://babeljs.io), [TypeScript](https://www.typescriptlang.org), [Scss/Sass](http://sass-lang.com), |
42 | | -[Less](http://lesscss.org), etc. |
43 | | - |
44 | | -It is certain that each language has its own dependency management system, and that it is highly recommended to use |
45 | | -each package manager. NPM, Yarn or PNpM works very well when the asset dependencies are managed only in the PHP project, |
46 | | -but when you create PHP libraries that using assets, there is no way to automatically add asset dependencies, |
47 | | -and most importantly, no validation of versions can be done automatically. You must tell the developers |
48 | | -the list of asset dependencies that using by your PHP library, and you must ask him to add manually the asset |
49 | | -dependencies to its asset manager of his project. |
50 | | - |
51 | | -However, another solution exist - what many projects propose - you must add the assets in the folder of the |
52 | | -PHP library (like `/assets`, `/Resources/public`). Of course, with this method, the code is duplicated, it |
53 | | -pollutes the source code of the PHP library, no version management/validation is possible, and it is even |
54 | | -less possible, to use all tools such as Babel, Scss, Less, etc ... |
55 | | - |
56 | | -Foxy focuses solely on automation of the validation, addition, updating and deleting of the dependencies in |
57 | | -the definition file of the asset package, while restoring the project state, as well as PHP dependencies if |
58 | | -NPM, Yarn or PNpM terminates with an error. |
| 57 | +[Bun](https://bun.sh/) or [NPM](https://www.npmjs.com) or [Yarn](https://yarnpkg.com) or [PNpM](https://PNpM.io) terminates with an error. |
| 58 | + |
| 59 | +All features and tools are available: |
| 60 | + |
| 61 | +- [Babel](https://babeljs.io) |
| 62 | +- [Bun](https://github.com/oven-sh/bun) |
| 63 | +- [Grunt](https://gruntjs.com) |
| 64 | +- [Gulp](https://gulpjs.com) |
| 65 | +- [Npmrc](https://docs.npmjs.com/files/npmrc) |
| 66 | +- [Less](http://lesscss.org) |
| 67 | +- [Scss/Sass](http://sass-lang.com) |
| 68 | +- [TypeScript](https://www.typescriptlang.org) |
| 69 | +- [Yarnrc](https://yarnpkg.com/en/docs/yarnrc) |
| 70 | +- [Webpack](https://webpack.js.org), , |
| 71 | + |
| 72 | +It is certain that each language has its own dependency management system, and that it is highly recommended to use each |
| 73 | +package manager. NPM, Yarn or PNpM works very well when the asset dependencies are managed only in the PHP project, but |
| 74 | +when you create PHP libraries that using assets, there is no way to automatically add asset dependencies, and most |
| 75 | +importantly, no validation of versions can be done automatically. You must tell the developers the list of asset |
| 76 | +dependencies that using by your PHP library, and you must ask him to add manually the asset dependencies to its asset |
| 77 | +manager of his project. |
| 78 | + |
| 79 | +However, another solution exist - what many projects propose - you must add the assets in the folder of the PHP library |
| 80 | +(like `/assets`, `/Resources/public`). Of course, with this method, the code is duplicated, it pollutes the source code |
| 81 | +of the PHP library, no version management/validation is possible, and it is even less possible, to use all tools such as |
| 82 | +Babel, Scss, Less, etc ... |
| 83 | + |
| 84 | +Foxy focuses solely on automation of the validation, addition, updating and deleting of the dependencies in the |
| 85 | +definition file of the asset package, while restoring the project state, as well as PHP dependencies if Bun, NPM, Yarn |
| 86 | +or PNpM terminates with an error. |
59 | 87 |
|
60 | 88 | #### It is Fast |
61 | 89 |
|
62 | | -Foxy retrieves the list of all Composer dependencies to inject the asset dependencies in the file `package.json`, |
63 | | -and leaves the execution of the analysis, validation and downloading of the libraries to NPM, Yarn or PNpM. Therefore, |
64 | | -no VCS Repository of Composer is used for analyzing the asset dependencies, and you keep the performance |
| 90 | +Foxy retrieves the list of all Composer dependencies to inject the asset dependencies in the file `package.json`, and |
| 91 | +leaves the execution of the analysis, validation and downloading of the libraries to Bun, NPM, Yarn or PNpM. |
| 92 | + |
| 93 | +Therefore, no VCS Repository of Composer is used for analyzing the asset dependencies, and you keep the performance |
65 | 94 | of native package manager used. |
66 | 95 |
|
67 | 96 | #### It is Reliable |
68 | 97 |
|
69 | | -Foxy creates mock packages of the PHP libraries containing only the asset dependencies definition file |
70 | | -in a local directory, and associates these packages in the asset dependencies definition file of the |
71 | | -project. Given that Foxy does not manipulate any asset dependencies, and let alone the version constraints, |
72 | | -this allows NPM, Yarn or PNpM to solve the asset dependencies without any intermediary. Moreover, the entire |
73 | | -validation with the lock file and installation process is left to NPM, Yarn or PNpM. |
| 98 | +Foxy creates mock packages of the PHP libraries containing only the asset dependencies definition file in a local |
| 99 | +directory, and associates these packages in the asset dependencies definition file of the project. Given that Foxy does |
| 100 | +not manipulate any asset dependencies, and let alone the version constraints, this allows Bun, NPM, Yarn or PNpM to |
| 101 | +solve the asset dependencies without any intermediary. Moreover, the entire validation with the lock file and |
| 102 | +installation process is left to Bun, NPM, Yarn or PNpM. |
74 | 103 |
|
75 | 104 | #### It is Secure |
76 | 105 |
|
77 | | -Foxy restores the Composer lock file with all its PHP dependencies, as well as the asset dependencies |
78 | | -definition file, in the previous state if NPM, Yarn or PNpM ends with an error. |
| 106 | +Foxy restores the Composer lock file with all its PHP dependencies, as well as the asset dependencies definition file, |
| 107 | +in the previous state if Bun, NPM, Yarn or PNpM ends with an error. |
79 | 108 |
|
80 | 109 | Features |
81 | 110 | -------- |
82 | 111 |
|
83 | 112 | - Compatible with [Yii Assets](https://github.com/yiisoft/assets) |
84 | 113 | - Compatible with [Symfony Webpack Encore](http://symfony.com/doc/current/frontend.html) |
85 | 114 | and [Laravel Mix](https://laravel.com/docs/master/mix) |
86 | | -- Works with Node.js and NPM, Yarn or PNpM |
| 115 | +- Works with Node.js and Bun, NPM, Yarn or PNpM |
87 | 116 | - Works with the asset dependencies defined in the `package.json` file for projects and PHP libraries |
88 | 117 | - Works with the installation in the dependencies of the project or libraries (not in global mode) |
89 | 118 | - Works with public or private repositories |
|
0 commit comments