PHPackages                             atomicsmash/compiler-helpers - 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. atomicsmash/compiler-helpers

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

atomicsmash/compiler-helpers
============================

v1.0.0(3mo ago)01.2k2PHPCI passing

Since Apr 11Pushed 3mo ago3 watchersCompare

[ Source](https://github.com/AtomicSmash/compiler-helpers)[ Packagist](https://packagist.org/packages/atomicsmash/compiler-helpers)[ RSS](/packages/atomicsmash-compiler-helpers/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (1)Versions (8)Used By (2)

AS compiler helpers
===================

[](#as-compiler-helpers)

A group of PHP helpers for the new AS compiler. For use with the npm package `@atomicsmash/compiler`.

Usage
-----

[](#usage)

This package currently only does one thing. It contains a PHP class for loading assets using the asset manifest and wordpress dependency info. This takes out a bunch of the hard work of interpreting the manifests and makes it easier to load files by the source names.

### Overview

[](#overview)

First, create your own local Assets class by extending the one in this package:

```
class Assets extends \AtomicSmash\CompilerHelpers\Assets {
	/**
	 * Constructor
	 */
	public function __construct() {
		$this->context_folder = realpath( __DIR__ . '/../' ); // Required.
		$this->build_folder = '/build/'; // Optional. Defaults to `/dist/`.
		parent::__construct();
	}
}
```

Then use that class to enqueue your assets like this:

```
function scripts() {
  $assets = new Assets();

  // Styles
  $example_stylesheet = $assets->get_cached_asset( 'styles/styles.scss' );
  if ( $example_stylesheet === null ) {
    throw new Error( "Failed to load stylesheet styles/styles.scss" );
  }
  wp_enqueue_style( 'handle', $example_stylesheet['source'], $example_stylesheet['dependencies'], $example_stylesheet['version'] );

  // Scripts
  $example_script = $assets->get_cached_asset( 'scripts/example.ts' );
  if ( $example_script === null ) {
    throw new Error( "Failed to load script scripts/example.ts" );
  }
  wp_enqueue_script( 'handle', $example_script['source'], $example_script['dependencies'], $example_script['version'], array( 'strategy' => 'defer' ) );
}
add_action( 'wp_enqueue_scripts', 'scripts', 10 );
```

### `get_cached_asset($source): $output`

[](#get_cached_assetsource-output)

Params:

- `$source` - The source file name relative to the src folder.

Returns:

- `$output` - An array of information about the compiled file, or NULL if the file is not found.
- `$output['source']` - The public URL of the compiled file.
- `$output['dependencies']` - An array of dependencies for any WP packages e.g. array('wp-dom-ready')
- `$output['version']` - The output file fingerprint of the compiled file.

Development
-----------

[](#development)

### To release a new version:

[](#to-release-a-new-version)

1. Make any changes you need to the package
2. Merge into main
3. An automated action will generate a PR called Version Packages. Review it and then merge this in.
4. An action will tag the repo which will in turn cause packagist to release a new version.

###  Health Score

41

—

FairBetter than 88% of packages

Maintenance85

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 78.8% 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 ~56 days

Recently: every ~71 days

Total

6

Last Release

109d ago

Major Versions

v0.1.3 → v1.0.02026-01-19

### Community

Maintainers

![](https://www.gravatar.com/avatar/1ece800089b8d593741a22cab40028b7d5119a3b5e89d86d913a829251562e10?d=identicon)[atomicsmash](/maintainers/atomicsmash)

---

Top Contributors

[![mikeybinns](https://avatars.githubusercontent.com/u/38146638?v=4)](https://github.com/mikeybinns "mikeybinns (26 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (7 commits)")

### Embed Badge

![Health badge](/badges/atomicsmash-compiler-helpers/health.svg)

```
[![Health](https://phpackages.com/badges/atomicsmash-compiler-helpers/health.svg)](https://phpackages.com/packages/atomicsmash-compiler-helpers)
```

###  Alternatives

[kaufmanndigital/gdpr-cookieconsent

A ready-to-run package, that integrates an advanced cookie consent banner into your Neos CMS site.

2540.7k](/packages/kaufmanndigital-gdpr-cookieconsent)[selective/transformer

A strictly typed array transformer with dot-access, fluent interface and filters.

3817.8k1](/packages/selective-transformer)[derhansen/sf_banners

Banner-Management Extension based on Extbase and Fluid. Loads banners asynchronously using JavaScript.

1144.5k](/packages/derhansen-sf-banners)[martin/wn-forms-plugin

Create easy (and almost magic) AJAX forms

212.3k](/packages/martin-wn-forms-plugin)

PHPackages © 2026

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