Skip to content

Commit 2bc7ab5

Browse files
committed
Merge branch 'release/1.2.25' into v1
2 parents ca8ef4e + bc622bb commit 2bc7ab5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+13175
-10637
lines changed

.github/workflows/build-and-deploy-docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ jobs:
2222
strategy:
2323
fail-fast: true
2424
matrix:
25-
node-version: [ 14.x ]
25+
node-version: [ 20.x ]
2626
steps:
27-
- uses: actions/checkout@v2
27+
- uses: actions/checkout@v4
2828
- name: Use Node.js ${{ matrix.node-version }}
29-
uses: actions/setup-node@v2
29+
uses: actions/setup-node@v4
3030
with:
3131
node-version: ${{ matrix.node-version }}
3232
- run: npm ci

.github/workflows/code-analysis.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Code Analysis
2+
3+
on:
4+
pull_request: null
5+
push:
6+
branches:
7+
- develop
8+
workflow_dispatch:
9+
permissions:
10+
contents: read
11+
jobs:
12+
code_analysis:
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
actions:
17+
- name: 'PHPStan'
18+
run: composer phpstan
19+
- name: 'Coding Standards'
20+
run: composer fix-cs
21+
name: ${{ matrix.actions.name }}
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Cache Composer dependencies
26+
uses: actions/cache@v4
27+
with:
28+
path: /tmp/composer-cache
29+
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
30+
- name: Setup PHP
31+
id: setup-php
32+
uses: shivammathur/setup-php@v2
33+
with:
34+
php-version: 8.2
35+
extensions: 'ctype,curl,dom,iconv,imagick,intl,json,mbstring,openssl,pcre,pdo,reflection,spl,zip'
36+
ini-values: post_max_size=256M, max_execution_time=180, memory_limit=512M
37+
tools: composer:v2
38+
- name: Install Composer dependencies
39+
run: composer install --no-interaction --no-ansi --no-progress
40+
- run: ${{ matrix.actions.run }}

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Transcoder Changelog
22

3+
## 1.2.25 - 2024.09.30
4+
## Added
5+
* Add `phpstan` and `ecs` code linting
6+
* Add `code-analysis.yaml` GitHub action
7+
38
## 1.2.24 - 2023.04.20
49
### Changed
510
* Updated the docs to use VitePress `^1.0.0-alpha.29`

Makefile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
MAJOR_VERSION?=3
2+
PLUGINDEV_PROJECT_DIR?=/Users/andrew/webdev/sites/plugindev/cms_v${MAJOR_VERSION}/
3+
VENDOR?=nystudio107
4+
PROJECT_PATH?=${VENDOR}/$(shell basename $(CURDIR))
5+
6+
.PHONY: dev docs release
7+
8+
# Start up the buildchain dev server
9+
dev:
10+
${MAKE} -C buildchain/ dev
11+
# Start up the docs dev server
12+
docs:
13+
${MAKE} -C docs/ dev
14+
# Run code quality tools, tests, and build the buildchain & docs in preparation for a release
15+
release: --code-quality --code-tests --buildchain-clean-build --docs-clean-build
16+
# The internal targets used by the dev & release targets
17+
--buildchain-clean-build:
18+
${MAKE} -C buildchain/ clean
19+
${MAKE} -C buildchain/ image-build
20+
${MAKE} -C buildchain/ build
21+
--code-quality:
22+
${MAKE} -C ${PLUGINDEV_PROJECT_DIR} -- ecs check vendor/${PROJECT_PATH}/src --fix
23+
${MAKE} -C ${PLUGINDEV_PROJECT_DIR} -- phpstan analyze -c vendor/${PROJECT_PATH}/phpstan.neon
24+
--code-tests:
25+
--docs-clean-build:
26+
${MAKE} -C docs/ clean
27+
${MAKE} -C docs/ image-build
28+
${MAKE} -C docs/ fix

buildchain/.gitignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?
25+
26+
# Misc directories & files
27+
coverage/*
28+
.stylelintcache

buildchain/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
ARG TAG=16-alpine
2-
FROM nystudio107/node-dev-base:$TAG
1+
ARG TAG=20-alpine
2+
FROM node:$TAG
33

4-
USER node
4+
RUN npm install -g npm@^10.0.0
55

66
WORKDIR /app/buildchain/
77

buildchain/Makefile

Lines changed: 30 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,39 @@
1-
TAG?=16-alpine
2-
CONTAINER?=$(shell basename $(dir $(CURDIR)))-buildchain
3-
DOCKERRUN=docker container run \
4-
--name ${CONTAINER} \
5-
--rm \
6-
-t \
7-
--network plugindev_default \
8-
-p 3001:3001 \
9-
-v "${CURDIR}"/../:/app \
10-
${CONTAINER}:${TAG}
1+
MAJOR_VERSION?=3
2+
TAG?=20-alpine
3+
CONTAINER?=$(shell basename $(dir $(CURDIR)))-v${MAJOR_VERSION}-buildchain
4+
DEV_PORT?=300${MAJOR_VERSION}
5+
IMAGE_INFO=$(shell docker image inspect $(CONTAINER):$(TAG))
6+
IMAGE_NAME=${CONTAINER}:${TAG}
7+
DOCKER_NETWORK?=plugindev_default
8+
DOCKER_RUN=docker container run --rm -it --network "${DOCKER_NETWORK}" -v "${CURDIR}"/../:/app
119

12-
.PHONY: build dev docker install clean npm
10+
.PHONY: build clean dev image-build image-check npm ssh
1311

14-
# Build the production assets
15-
build: docker install
16-
${DOCKERRUN} \
17-
run build
18-
# Start up the dev server
19-
dev: docker install
20-
${DOCKERRUN} \
21-
run dev
22-
# Start the Docker container
23-
docker:
24-
docker build \
25-
. \
26-
-t ${CONTAINER}:${TAG} \
27-
--build-arg TAG=${TAG} \
28-
--no-cache
29-
# Run an npm install
30-
install: docker
31-
${DOCKERRUN} \
32-
install
33-
# Remove node_modules/* & package-lock.json
12+
# Perform a dist build via npm run build
13+
build: image-check
14+
${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} run build
15+
# Remove node_modules/ & package-lock.json
3416
clean:
3517
rm -rf node_modules/
3618
rm -f package-lock.json
19+
# Run the development server via npm run dev
20+
dev: image-check
21+
${DOCKER_RUN} --name ${CONTAINER}-$@ -e DEV_PORT="${DEV_PORT}" -p ${DEV_PORT}:${DEV_PORT} ${IMAGE_NAME} run dev
22+
# Build the Docker image & run npm install
23+
image-build:
24+
docker build . -t ${IMAGE_NAME} --build-arg TAG=${TAG} --no-cache
25+
${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} install
26+
# Ensure the image has been created
27+
image-check:
28+
ifeq ($(IMAGE_INFO), [])
29+
image-check: image-build
30+
endif
3731
# Run the passed in npm command
38-
npm: docker
39-
${DOCKERRUN} \
40-
$(filter-out $@,$(MAKECMDGOALS))
32+
npm: image-check
33+
${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS)
34+
# Open a shell inside of the container
35+
ssh: image-check
36+
${DOCKER_RUN} --name ${CONTAINER}-$@ --entrypoint=/bin/sh ${IMAGE_NAME}
4137
%:
4238
@:
4339
# ref: https://stackoverflow.com/questions/6273608/how-to-pass-argument-to-makefile-from-command-line

0 commit comments

Comments
 (0)