承接 ronanchilvers/bundler 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ronanchilvers/bundler

Composer 安装命令:

composer require ronanchilvers/bundler

包简介

Simple file bundler

README 文档

README

A simple bundler to concatenate and version static files, optionally writing correct HTML tags.

Goals

  • Simple to use
  • No dependencies
  • Support CSS and JS
  • Support HTML tag generation
  • Support versioning (cache busting)
  • Support multiple bundles
  • Facilitate extending to add extra features such as minification
  • Implement a Config object to centralise configuration variables
  • Support browser inportmaps

Usage

<?php
use Ronanchilvers\Bundler\Bundler;
use Ronanchilvers\Bundler\Output\Decorator\SRI;
?>
<html>
    <head>
    <title>Testing 123</title>
<?= Bundler::stylesheet()
    ->decorate(SRI::class, [
        'source' => __DIR__ . '/source/css',
        'algorithms' => ['sha384'],
    ])
    ->render([
        'resources/css/one.css',
        'resources/css/two.css',
    ]);
?>
    </head>
    <body>
        <h1>Hallo!</h1>
        <p>lorem ipsum quod erat</p>
<?= Bundler::javascript()
    ->decorate(SRI::class, [
        'source' => __DIR__ . '/source/js',
        'algorithms' => ['sha384'],
    ])
    ->render([
        'resources/js/one.js',
        'resources/js/two.js',
    ]);
?>
    </body>
</html>

Development & Testing

This project uses PHPUnit. A basic test harness is already configured.

Install dependencies

composer install

Run the test suite

composer test

Additional scripts

composer test:dox        # Readable "spec" style output
composer test:coverage   # Generates HTML coverage in build/coverage/html
composer test:ci         # Clover + JUnit logs in build/logs/

Writing tests

  • Place unit tests under tests/Unit
  • Name test files with the suffix Test.php (e.g. BundlerTest.php)
  • Use namespaces under Tests\Unit (e.g. namespace Tests\Unit;)
  • Each test method should be public and start with test, or use #[Test] attributes.

An example test exists at tests/Unit/ExampleTest.php covering the Example class in src/Example.php. Feel free to delete these once you begin implementing real functionality.

Code coverage

Coverage reports are written to build/. Add build/ to your .gitignore if you commit coverage locally:

echo "build/" >> .gitignore

Continuous Integration

Use the test:ci script in CI workflows to produce Clover (coverage) and JUnit (test result) artifacts for reporting.

统计信息

  • 总下载量: 1
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-09-21