Google Tag Manager - v1.0.0
Contributing
The authoritative contribution guide lives at CONTRIBUTING.md in the package root. This page summarizes what a code contributor to artisanpack-ui/google-tag-manager specifically needs to know.
Development setup
Fork and clone the package repository, then pull it into an ArtisanPack UI dev app via a Composer path repository:
{
"repositories": [
{
"type": "path",
"url": "../artisanpack-ui-google-tag-manager",
"options": { "symlink": true }
}
],
"require": {
"artisanpack-ui/google-tag-manager": "@dev"
}
}
The artisanpack-ui-dev app in the ecosystem is already wired up this way — symlinks live under packages/google-tag-manager/.
Install package dependencies:
composer install
Running the test suite
composer test
Or a filtered run:
./vendor/bin/pest --filter="the string you want to match"
See Testing for what the shipped suite covers and how to write new tests.
Code style
The package uses PHP-CS-Fixer with WordPress-style spacing plus PHPCS with the ArtisanPackUIStandard rules. Fix formatting before pushing:
composer fix # PHP-CS-Fixer auto-fix
composer cs # PHPCS check (no auto-fix)
composer lint # Both, dry-run
Highlights:
- Spaces inside parentheses / brackets (
if ( $x ),[ 'k' => 'v' ]) - Yoda comparisons (
if ( true === $x )) - Real tabs for indentation
- Aligned
=and=>in consecutive assignments - Single quotes for plain strings
Testing your changes end-to-end
The artisanpack-ui-dev app in the ecosystem has this package symlinked. Point a page at @gtmSnippet and open the browser network tab to confirm the container snippet loads. Use a Livewire test route to exercise the container overview / tag list Live components.
Branch conventions
- Branch from
release/1.0for v1.x work - Feature branches:
feature/{issue#}-{slug} - Bug fixes:
bugfix/{issue#}-{slug} - Docs-only:
docs/{issue#}-{slug} - PRs should target
release/1.0unless the issue is on a different milestone
Adding a new admin surface
If you're adding a third Livewire / React / Vue surface (say, "trigger list"), follow the pattern the existing pair uses:
- Add a
TriggerListDataDTO undersrc/Api/if a new response shape is needed - Add a
TriggerListFetchercomposing whateverTagManagerClientcalls are needed - Add a
Livewire\TriggerListcomponent that resolves the fetcher and follows the sameHandlesTagManagerRefreshpattern - Add a
Http\Controllers\TriggerListControllerand a route inroutes/web.php - Add React + Vue components under
resources/js/react/andresources/js/vue/ - If the CMS framework should surface it, add a
CmsFramework\TriggerListWidget - Cover every layer with Pest tests
The tag list surface is the reference implementation — copy its structure.