PHPackages                             tito10047/asset-mapper-test-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. tito10047/asset-mapper-test-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

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.

0.2.0(1mo ago)420↓100%MITPHPPHP &gt;=8.4CI passing

Since Apr 21Pushed 1mo agoCompare

[ Source](https://github.com/tito10047/asset-mapper-test-bundle)[ Packagist](https://packagist.org/packages/tito10047/asset-mapper-test-bundle)[ RSS](/packages/tito10047-asset-mapper-test-bundle/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (6)Versions (3)Used By (0)

AssetMapper Test Bundle
=======================

[](#assetmapper-test-bundle)

[![CI](https://github.com/tito10047/asset-mapper-test-bundle/actions/workflows/ci.yml/badge.svg)](https://github.com/tito10047/asset-mapper-test-bundle/actions/workflows/ci.yml)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](./LICENSE)

Run **Node.js tests** against packages managed by **Symfony AssetMapper** — no `npm install`, no duplicated dependencies.

Two interchangeable strategies are provided:

StrategyCommandHow 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 livePick **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
-------

[](#install)

```
composer require --dev tito10047/asset-mapper-test-bundle
```

Auto-discovered by Symfony Flex — no additional wiring needed.

Scaffold `package.json` (interactive)
-------------------------------------

[](#scaffold-packagejson-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
-----------------------------

[](#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`)
------------------------------------------------

[](#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
-------------

[](#documentation)

Full documentation lives in [`docs/`](./docs):

- [`docs/index.md`](./docs/index.md) — overview &amp; table of contents
- [`docs/init-command.md`](./docs/init-command.md) — interactive `package.json` scaffolder
- [`docs/symlink-variant.md`](./docs/symlink-variant.md) — symlink workflow in depth
- [`docs/loader-variant.md`](./docs/loader-variant.md) — Node.js loader in depth
- [`docs/configuration.md`](./docs/configuration.md) — paths, env vars, logging
- [`docs/troubleshooting.md`](./docs/troubleshooting.md) — common problems &amp; fixes
- [`docs/architecture.md`](./docs/architecture.md) — internal design, classes, data flow

Requirements
------------

[](#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
-------

[](#license)

MIT — see [LICENSE](./LICENSE).

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance90

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

2

Last Release

48d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11459248?v=4)[Jozef Môstka](/maintainers/tito10047)[@tito10047](https://github.com/tito10047)

---

Top Contributors

[![tito10047](https://avatars.githubusercontent.com/u/11459248?v=4)](https://github.com/tito10047 "tito10047 (10 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tito10047-asset-mapper-test-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/tito10047-asset-mapper-test-bundle/health.svg)](https://phpackages.com/packages/tito10047-asset-mapper-test-bundle)
```

###  Alternatives

[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

101466.4k44](/packages/friendsoftypo3-content-blocks)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
