Skip to content

Commit

Permalink
Merge branch 'release/3.0.2' into v3
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Jul 9, 2024
2 parents 687c7d7 + a91cc5a commit ae919a3
Show file tree
Hide file tree
Showing 37 changed files with 4,150 additions and 1,657 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/code-analysis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Code Analysis

on:
pull_request: null
push:
branches:
- develop-v3
workflow_dispatch:
permissions:
contents: read
jobs:
code_analysis:
strategy:
fail-fast: false
matrix:
actions:
- name: 'PHPStan'
run: composer phpstan
- name: 'Coding Standards'
run: composer check-cs
name: ${{ matrix.actions.name }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
- name: Setup PHP
id: setup-php
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
extensions: 'ctype,curl,dom,iconv,imagick,intl,json,mbstring,openssl,pcre,pdo,reflection,spl,zip'
ini-values: post_max_size=256M, max_execution_time=180, memory_limit=512M
tools: composer:v2
- name: Install Composer dependencies
run: composer install --no-interaction --no-ansi --no-progress
- run: ${{ matrix.actions.run }}
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Instant Analytics GA4 Changelog

## 3.0.2 - 2024.07.09
### Added
* Allow access to the `request()` method by making it `public` ([#31](https://github.com/nystudio107/craft-instantanalytics-ga4/issues/31))
* Add `phpstan` and `ecs` code linting
* Add `code-analysis.yaml` GitHub action

### Changed
* Updated docs to use node 20 & a new sitemap plugin
* PHPstan code cleanup
* ECS code cleanup

### Fixed
* Fixed an issue where an exception would be thrown if you're running PHP < `7.4` ([#29](https://github.com/nystudio107/craft-instantanalytics-ga4/issues/29))

## 3.0.1 - 2024.01.11
### Changed
* Updated the buildchain to use Vite 5
Expand Down
58 changes: 58 additions & 0 deletions buildchain/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# `instantanalytics-ga4` buildchain

This buildchain is a self-contained build system for the `seomatic` JavaScript bundle.

## Overview

The buildchain builds & bundles all of the `seomatic` TypeScript/JavaScript code, Vue components, CSS, and any other static resources via Vite via a Docker container.

Source files:

`buildchain/src/`

Built distribution files:

`src/web/assets/dist/`

## Prerequisites

To run the buildchain for development purposes:

- You must have [Docker Desktop](https://www.docker.com/products/docker-desktop/) (or the equivalent) installed
- We assume you're using the [`plugindev`](https://github.com/nystudio107/plugindev) development project. If you're not, see the **If you're not using `plugindev`** section below

## Commands

This buildchain uses `make` as an interface to the buildchain. The following commands are available from the `buildchain/` directory:

- `make build` - Do a distribution build of the CantoDamAsset asset bundle resources into `src/web/assets/dist/`
- `make dev` - Start Vite HMR dev server for local development
- `make clean` - Remove `node_modules/` and `package-lock.json` to start clean (need to run `make image-build` after doing this, see below)
- `make npm XXX` - Run an `npm` command inside the container, e.g.: `make npm run lint` or `make npm install`
- `make ssh` - Open up a shell session into the buildchain Docker container
- `make image-build` - Build the Docker image & run `npm install`

### If you're not using `plugindev`

If you're not using the [`plugindev`](https://github.com/nystudio107/plugindev) development project, you'll need to follow these steps in order to use the HMR for development in local dev:

- For HMR during local development, you'll need the following variable set in your project's `.env` file:
```dotenv
VITE_PLUGIN_DEVSERVER=1
```
The [`craft-plugin-vite`](https://github.com/nystudio107/craft-plugin-vite) library looks for this environment variable to determine whether it should check for a running Vite dev server.

#### If you're also using Docker

- So your project can access the buildchain container over the [internal Docker network](https://docs.docker.com/compose/networking/), you'll need to set the `DOCKER_NETWORK` environment variable before running any buildchain `make` commands:
```bash
env DOCKER_NETWORK=myproject_default make dev
```
...or use any other method for [setting environment variables](https://www.twilio.com/blog/how-to-set-environment-variables.html). This environment variable needs to be set in the shell where you run the buildchain's various `make` commands from, so setting it in your project's `.env` file won't work.

The network your project uses is typically the project name with `_default` appended to it, but it can be explicitly set in the `docker-composer.yaml` like this:
```yaml
networks:
default:
name: someproject_default
```
Loading

0 comments on commit ae919a3

Please sign in to comment.