# Building Assets

> The Aegis plugin builds Map and Modal blocks, admin dashboard assets, and core/video editor extensions.

## Commands

```
cd wp-content/plugins/aegisnpm cicomposer install          # PHPCS / WPCS (dev only)npm run build             # Admin + video editor (Map/Modal are not compiled)npm run build:admin       # assets/admin/buildnpm run build:editor      # assets/editor/build/video-editor.jsnpm run lint              # ESLint (video editor) and package.json lintcomposer lint             # PHPCS
```

Requires Node 22.13 or later (`.nvmrc`: 22) and PHP 8.1 or later. `composer.lock` pins the PHPCS toolchain; Composer packages are dev-only and never ship in the release zip.

Map and Modal `index.js` / `view.js` are hand-maintained IIFEs, so there is no webpack build for them. Edit those files directly.

Development watch:

```
npm run start:adminnpm run start:editor
```

## What Gets Built

| Output | Source |
| --- | --- |
| Map, Modal block assets | Hand-maintained in `src/Blocks/map/` and `src/Blocks/modal/` (`index.js`, `view.js`, `style.css`) |
| Admin dashboard | `assets/admin/src` (Studio enqueue) / `assets/admin/build` (webpack output) |
| Video editor extension | `assets/editor/` (extends `core/video`) |

The six TypeScript blocks (countdown, slider, slide, toggle, toggle-content, related-posts) are built in this plugin with `npm run build:blocks`.

## Theme Blocks

Until the theme release that removes them, the theme also builds its own copies in the **theme** repository:

```
cd wp-content/themes/aegisnpm run build
```

See [Theme Building Assets](https://www.atmostfear-entertainment.com/docs/aegis/themes/theme/building-assets/).

## Compiled Assets in Git

Compiled assets are committed for environments without Node. Re-run `npm run build` after changing block or admin sources.

In this Studio checkout, admin CSS/JS load from `assets/admin/src` when `assets/admin/build/index.asset.php` exists (`Menu.php` uses the asset file for dependencies/version, then the source files). `.distignore` excludes `assets/admin/src`, so a release zip must ship a current `assets/admin/build` **and** enqueue it. After changing `admin-settings.js` or the admin CSS, run `npm run build:admin` before packaging.

## Release packaging

Release tags (`v*`) run the release workflow (`release.yml`): build assets, run PHPCS, then `rsync` with `.distignore` into an `aegis/` folder and attach `aegis.zip` + SHA256.

| Included in zip | Excluded |
| --- | --- |
| `aegis.php`, `uninstall.php`, `src/`, `config/`, `patterns/`, `templates/`, `languages/`, `public/`, compiled assets | CI configuration, `docs/`, Node/Composer manifests, `vendor/`, admin/editor **sources**, tests/tools |

`.gitattributes` `export-ignore` mirrors `.distignore` for `git archive`. Details: the plugin’s root `CONTRIBUTING.md`.

## Translations

The free plugin ships `languages/aegis.pot` (text domain `aegis`). Do not put plugin strings in the theme POT.

```
cd wp-content/plugins/aegisnpm run translate             # Requires `wp` on PATHnpm run translate:studio      # WordPress Studio (Windows)
```

`wp i18n make-pot` scans PHP and JavaScript (`--skip-block-json`, same as the theme). Integration category labels, stack descriptions, and toggles live in `src/Integrations/Registry.php` — including the **Community** (bbPress) and **Content** (Co-Authors Plus) sections, per-plugin SEO stack copy (Rank Math, Yoast, All in One SEO, SEOPress), Code Block Pro / Syntax Highlighting overlays, AffiliateWP, Easy Digital Downloads, Fluent Forms / Booking, Gravity Forms, Ninja Forms, WooCommerce, and Meta Box. Multi-step checkout button copy lives in `src/Integrations/WooCommerce/MultiStepCheckout.php`. Admin Smart Logic strings live in `assets/admin/smart-conditions.js` (including WP Fusion tag/list/CRM-logged-in labels). The post/hook-pattern extras UI (`assets/admin/hook-patterns-conditions.js`) is scanned for wrapped `wp.i18n` strings. It does not scan TypeScript, so run `npm run build:editor` first if you changed `assets/editor/video-editor.tsx` — those strings come from `assets/editor/build/video-editor.js`. Docs are excluded from the scan.

Theme strings: `wp-content/themes/aegis/languages/aegis.pot`. Pro strings: `wp-content/plugins/aegis-pro/languages/aegis-pro.pot`.

## Verification

With the Aegis theme and plugin active:

- Map and Modal blocks appear in the block inserter
- The **Aegis** admin menu loads without errors
- Countdown, Slider, Toggle, and Related Posts blocks appear (from the plugin build)

## Next Steps

- [Architecture](https://www.atmostfear-entertainment.com/docs/aegis/plugins/dash/architecture/) — Plugin structure
- [Theme Build](https://www.atmostfear-entertainment.com/docs/aegis/themes/theme/building-assets/)

---

Source: https://www.atmostfear-entertainment.com/docs/aegis/plugins/dash/building-assets/ · Updated 2026-11-25
