eloquent/composer-npm-bridge
最新稳定版本:5.0.1
Composer 安装命令:
composer require eloquent/composer-npm-bridge
包简介
NPM integration for Composer packages.
README 文档
README
No longer maintained
This package is no longer maintained. See this statement for more info.
Composer NPM bridge
NPM integration for Composer packages.
Installation
- Available as Composer package eloquent/composer-npm-bridge.
Requirements
- The
npmexecutable must be available in PATH.
Usage
To utilize the Composer NPM bridge, simply add eloquent/composer-npm-bridge
to the require section of the project's Composer configuration:
composer require eloquent/composer-npm-bridge
NPM dependencies are specified via a package.json configuration file in the
root directory of the Composer package. Source control should be configured to
ignore NPM's node_modules directory, similar to Composer's vendor directory.
How does it work?
The Composer NPM bridge is a Composer plugin that automatically installs and
updates NPM packages whenever the corresponding Composer command is executed.
To detect compatible packages, the bridge inspects Composer package
configuration information to find packages that directly require the
eloquent/composer-npm-bridge Composer package itself.
In addition to normal operation, composer install will install NPM
dependencies for all Composer packages using the bridge. This includes the root
package, as well as Composer dependencies. Similarly, composer update will
install NPM dependencies for all Composer dependencies using the bridge. It
will also update the NPM dependencies for the root project.
NPM dependencies will be installed exactly as if npm install were run from the
root directory of the package. This applies even if the package is installed as
a dependency.
Configuration
The following configuration can be added to composer.json under the
extra.npm-bridge section to customize the behavior on a per-package basis.
Values in the root package will not currently impact any dependency packages
that also use Composer NPM bridge - each package must define its own options.
| Key | Type | Default | Description |
|---|---|---|---|
| timeout | int | 300 |
Specify a custom timeout for the installation (in seconds). |
| optional | bool | false |
Skip instead of throwing an exception if npm is not found when processing the package. |
{ // ... "extra": { "npm-bridge": { "timeout": 9000, "optional": true }, // ... } }
Composer NPM bridge can be completely disabled by setting the
COMPOSER_NPM_BRIDGE_DISABLE environment variable to a non-empty value:
COMPOSER_NPM_BRIDGE_DISABLE=1 composer install
Caveats
Because NPM dependencies are installed underneath the root directory of the
Composer package, Composer may complain about working copy changes when the
package is installed as a dependency. Source control should be configured to
ignore the node_modules directory in order to avoid this.
eloquent/composer-npm-bridge 适用场景与选型建议
eloquent/composer-npm-bridge 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 849.54k 次下载、GitHub Stars 达 81, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「package」 「plugin」 「composer」 「Bridge」 「npm」 「integration」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 eloquent/composer-npm-bridge 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 eloquent/composer-npm-bridge 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 eloquent/composer-npm-bridge 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
CakePHP 4.x AdminLTE Theme.
This composer plugin enables installation of GravityForms WordPress plugin and its addons.
Simple ASCII output of array data
Plugin for YOURLS. Default tools to use in some laemmi plugins
统计信息
- 总下载量: 849.54k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 87
- 点击次数: 23
- 依赖项目数: 18
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 未知