tito10047/asset-mapper-test-bundle
Composer 安装命令:
composer require tito10047/asset-mapper-test-bundle
包简介
A Symfony bundle that bridges the gap between Symfony AssetMapper and Node.js test runners by creating a symlink-based node_modules structure from your import map.
README 文档
README
Run Node.js tests against packages managed by Symfony AssetMapper —
no npm install, no duplicated dependencies.
Two interchangeable strategies are provided:
| Strategy | Command | How it works |
|---|---|---|
| Symlinks (default) | php bin/console asset-mapper-test:setup |
Creates symlinks in node_modules/ from importmap.php |
| Symlink-free loader | php bin/console asset-mapper-test:export |
Exports importmap.json, a Node.js loader maps imports live |
Pick symlinks for best IDE autocomplete.
Pick the loader when you want zero node_modules, cross-platform cleanliness
(Windows without developer mode), or reproducible CI without filesystem artifacts.
Install
composer require --dev tito10047/asset-mapper-test-bundle
Auto-discovered by Symfony Flex — no additional wiring needed.
Scaffold package.json (interactive)
php bin/console asset-mapper-test:init
Asks which variant (symlink / loader) and which JS runner (node / vitest)
you want, then writes a matching package.json. For node --test it also
drops tests/js/setup.mjs with a ready-to-use happy-dom window bootstrap
(globalThis.window, document, HTMLElement, Event).
Non-interactive (CI) form:
php bin/console asset-mapper-test:init --variant=loader --runner=node
Quick start — Symlink variant
{
"type": "module",
"scripts": {
"pretest": "php bin/console asset-mapper-test:setup",
"test": "node --import ./tests/js/setup.mjs --test 'tests/js/**/*.test.mjs'"
}
}
npm test
Quick start — Loader variant (no node_modules)
{
"type": "module",
"scripts": {
"pretest": "php bin/console asset-mapper-test:export",
"test": "node --import ./vendor/tito10047/asset-mapper-test-bundle/src/Resources/loader/register.mjs --import ./tests/js/setup.mjs --test 'tests/js/**/*.test.mjs'"
}
}
Requires Node.js ≥ 20.6 (or ≥ 18.19) for the stable module.register API.
Documentation
Full documentation lives in docs/:
docs/index.md— overview & table of contentsdocs/init-command.md— interactivepackage.jsonscaffolderdocs/symlink-variant.md— symlink workflow in depthdocs/loader-variant.md— Node.js loader in depthdocs/configuration.md— paths, env vars, loggingdocs/troubleshooting.md— common problems & fixesdocs/architecture.md— internal design, classes, data flow
Requirements
- PHP ≥ 8.2
- Symfony ≥ 6.4 (also works on 7.x and 8.x)
- Symfony AssetMapper
- Node.js ≥ 20.6 for the loader variant (any version for symlinks)
License
MIT — see LICENSE.
tito10047/asset-mapper-test-bundle 适用场景与选型建议
tito10047/asset-mapper-test-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 21 次下载、GitHub Stars 达 4, 最近一次更新时间为 2026 年 04 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 tito10047/asset-mapper-test-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 tito10047/asset-mapper-test-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 21
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 42
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-21