Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timber 2.x #135

Open
wants to merge 78 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
1f0e8e2
#131 s/array/Iterable on Post method return types
Sep 28, 2020
b025135
#131 remove get_terms() Twig fn
Sep 28, 2020
f2346c8
#131 fix Timber::context() calls/filters
Sep 28, 2020
3ded01c
optimize dev environment for startup time
Sep 28, 2020
1054541
#131 fix Twig deprecations notices
Sep 29, 2020
1439b41
#131 fix DebugExtension fatal error
Sep 29, 2020
0d6cef5
#131 deprecate Post::get_all()
Sep 29, 2020
0406a09
call Post::categories() instead of deprecated ::get_categories()
Sep 29, 2020
58c5487
#131 fix a class not found error
Sep 29, 2020
c7e2e93
Introduce PHPStan and fix level 0 problems
szepeviktor Oct 7, 2020
cce2796
Fix CS
szepeviktor Oct 7, 2020
a172c40
Improve Travis configuration
szepeviktor Oct 7, 2020
1f276a8
Fix tests
szepeviktor Oct 7, 2020
edaa083
Upgrade Lando
szepeviktor Oct 7, 2020
56c4dad
Drop support for PHP 7.0
szepeviktor Oct 8, 2020
820a06f
Drops support for PHP 7.0
szepeviktor Oct 8, 2020
d3c32b8
Merge pull request #132 from szepeviktor/phpstan2
acobster Oct 9, 2020
471162f
Merge branch 'timber-2.x' into patch-1
szepeviktor Oct 9, 2020
5339d60
Merge branch 'main' into timber-2.x
Oct 12, 2020
ace897e
Merge branch 'timber-2.x' of github.com:sitecrafting/conifer into tim…
Oct 12, 2020
34dfadd
Merge pull request #133 from szepeviktor/patch-1
acobster Oct 12, 2020
83b8524
Merge main into timber-2.x, resolve conflicts manually
Oct 12, 2020
fde5f64
bump req. PHP up to 7.4+, update composer deps
Oct 12, 2020
15eb130
upgrade dev environment to WP 5.5.1
Oct 12, 2020
02a93de
#131 update tooling to reflect phpstan, forthcoming unit/integration …
Oct 12, 2020
104ee30
fix custom search query early return
Oct 13, 2020
3d2cde3
Fix most level-1 coding standards violations
Oct 13, 2020
d01795d
upgrade dev Groot
Oct 13, 2020
dbd664a
fix release script not to hard-code remote branch
Oct 13, 2020
3d4fb45
bump version to 1.0 ALPHA! :tada:
Oct 13, 2020
cc6bd49
restore phpcs lando tooling commands
Oct 13, 2020
596334b
ignore coding standards in CI for now
Oct 14, 2020
9b28532
update code sniffer command in CI
Oct 14, 2020
dd88007
streamline CI builds, ignore coding standards for now
Oct 14, 2020
bf294d0
Skip a bunch of tests - we will need to update these
Oct 14, 2020
3e4fb11
ignore WP CS open paren casting/whitespace rule
Oct 14, 2020
5bcafe2
fix the sniff-fix fixer cmd
Oct 14, 2020
0d50ce2
upgrade WP coding standards dependency
Oct 14, 2020
fe6bd82
Bring code up to updated standards
Oct 14, 2020
9d1e6d6
restore PHPCS checks
Oct 14, 2020
cdddff0
NO FAILURES ALLOWED
Oct 14, 2020
bfd5c3f
Don't install Timber as a plugin
Oct 14, 2020
70b2355
lando clean command
Oct 14, 2020
c05824b
fix Page:get_blog_page() return type annotation
Oct 14, 2020
2aef86e
remove Cypress & doc references to it
Oct 14, 2020
109591a
Fix bugs discovered by PHPStan
Oct 14, 2020
d553c66
Run static analysis in CI
Oct 14, 2020
7396024
remove plugin file - only Composer package will be supported going fo…
Oct 14, 2020
166ac95
Merge branch 'main' into timber-2.x
Oct 14, 2020
f1b2192
Merge branch 'main' into timber-2.x
Oct 14, 2020
5580038
update root conifer directory check
Oct 14, 2020
4ce2983
update Travis badge to timber-2.x build
Oct 14, 2020
5fb8a66
Remove Cypress config
Oct 14, 2020
bbabe99
prep for WP unit test suite
Oct 14, 2020
b6277b7
rebuild yarn deps after removing cypress
Oct 22, 2020
b089066
#119 install WP Unit Test suite on Lando start
Oct 22, 2020
ea77874
configure autoload-dev
Oct 22, 2020
9683872
rename ConiferTest ns to Conifer\Unit
Oct 22, 2020
94be2ed
remove more dead test code
Dec 2, 2020
3ac7191
split out testsuites into different phpunit configs
Dec 2, 2020
7d4869a
revise CI checks and add Lando tooling for running the same
Dec 2, 2020
d03fcc4
Register default classmaps on site init
Dec 2, 2020
49cdaef
Setup integration tests, test Post::create()
Dec 2, 2020
90b3289
port over a skipped unit test to a skipped integration test :P
Dec 3, 2020
1bc63cc
Fix Post::get_related_by_taxonomy() test
Dec 3, 2020
d48e74c
Fix PHPCS ignore rules
Dec 3, 2020
0651c2a
fix minor coding standards violations
Dec 3, 2020
a5f9055
update WP Core and reinstall all composer deps
Dec 18, 2020
dc2c773
Fix Timber $PostClass deprecation warning, accept query args to ::get…
Dec 18, 2020
17e7739
reinstall composer deps w/ official Timber 2.0 alpha
Jan 4, 2021
dff89e3
updated composer dependencies - move to WP v6.5 and timber v2.1, swit…
akoziolsc Jul 30, 2024
500ed21
updated phpunit, phsstan-wordpress, and wp_mock libraries to support …
akoziolsc Jul 31, 2024
096e4c6
fixed some of the phpstan errors
akoziolsc Jul 31, 2024
cd1b5f5
downgrade php requirement to >=7.2
akoziolsc Jul 31, 2024
096d8e0
convert numberposts into posts_per_page. numberposts no longer supported
akoziolsc Aug 9, 2024
64f525d
make Timber a direct dependency for Conifer
akoziolsc Aug 16, 2024
516a111
merged main in, resolved conflicts
akoziolsc Aug 27, 2024
bfe52f9
update to the readme file
akoziolsc Aug 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@
/database-backups/
/conifer

# test artifacts
/test/wp/
/test/wp-tests-lib/

# build artifacts
/conifer-*.tar.gz
/conifer-*.zip

# cypress test artifacts
/cypress/videos
/cypress/screenshots
.Trash*

# yarn artifacts, or "yartifacts"
yarn-error.log

Expand All @@ -27,6 +26,6 @@ wp-cli.local.yml
/docs/reference/*.md
/docs/node_modules/


# VS code
.vscode/*
.vscode/*
.idea
111 changes: 61 additions & 50 deletions .lando.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,33 @@
name: conifer
stats:
- report: false
recipe: wordpress
config:
webroot: wp
php: '7.0'
php: '8.2'

services:
node:
type: node:14

appserver:
run_as_root:
# Temporary hack to get a Debian package to install
# https://github.com/lando/lando/issues/1554
- echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf
- echo "deb [check-valid-until=no] http://archive.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/jessie-backports.list
- sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list

- apt-get update
- apt-get install zip
- apt-get install subversion -y

run:
- composer install
- ./scripts/setup-wordpress.sh

overrides:
environment:
# Pass any non-empty CI envvar from the host into Lando
# This is so we can force non-interactive mode setting up WP
CI: ${CI:-''}

database:
type: mysql:5.7

testdb:
type: mysql:5.7
portforward: true
creds:
user: test
password: test
database: test

gitbook:
type: node:10

Expand All @@ -59,60 +53,84 @@ services:
- appserver

docs:
type: nginx:1.17
type: nginx:1.18
ssl: true
webroot: docs/_book

tooling:
clean:
service: appserver
cmd: 'rm -rf node_modules vendor *.tar.gz *.zip wp'

install:
service: appserver
cmd: './scripts/setup-wordpress.sh'
description: 'Install and configure WordPress for custom plugin dev'

install-test-themes:
service: appserver
cmd: 'rsync --verbose --archive --recursive ./test/themes/ ./wp/wp-content/themes/'
description: 'Sync test themes for e2e testing'

debug:
service: appserver
cmd: 'tail -f ./wp/wp-content/debug.log'
description: 'Get real-time WP debug log output'

cypress:
service: cypress
cmd: 'yarn cypress'
description: 'Run arbitrary cypress commands'

e2e:
service: cypress
cmd: 'yarn cypress run'
description: 'Run end-to-end tests'

unit:
service: appserver
cmd: './vendor/bin/phpunit'
cmd: './vendor/bin/phpunit --config phpunit.xml.dist'
description: 'Run unit tests'

sniff:
integration:
service: appserver
cmd: './vendor/bin/phpunit --config phpunit-integration.xml.dist'
description: 'Run integration tests'

test:
service: appserver
cmd: 'composer sniff'
description: 'Run phpcs code sniffer'
cmd:
- vendor/bin/phpunit --config phpunit.xml.dist
- vendor/bin/phpunit --config phpunit-integration.xml.dist
description: 'Run all unit and integration tests'

install-tests:
service: appserver
cmd: './scripts/install-wp-tests.sh'
description: 'Install the WP Unit Test suite'

sniff-summary:
service: appserver
cmd: 'composer sniff-summary'
description: 'Summarize phpcs results'
cmd: './vendor/bin/phpcs --report=summary --standard=./phpcs.xml test lib'
description: 'Summarize PHPCS code sniffer findings'

sniff:
service: appserver
cmd: './vendor/bin/phpcs --standard=./phpcs.xml test lib'
description: 'Run PHPCS code sniffer on all test and production code'

sniff-fix:
service: appserver
cmd: 'composer sniff-fix'
description: 'Fix coding standards issues that are automatically fixable'
cmd: './vendor/bin/phpcbf --standard=./phpcs.xml test lib'
description: 'Fix all automatically fixable issues found by PHPCS'

analyze:
service: appserver
cmd: './vendor/bin/phpstan analyse'
description: 'Run phpstan coding standards (level 1)'

release:
analyse:
service: appserver
cmd: './scripts/build-release.sh'
description: 'Build a downloadable release of the Conifer WordPress plugin'
cmd: './vendor/bin/phpstan analyse'
description: 'Run phpstan coding standards (level 1)'

ci:
service: appserver
cmd:
- vendor/bin/phpunit --config phpunit.xml.dist
- vendor/bin/phpunit --config phpunit-integration.xml.dist
- vendor/bin/phpcs --standard=phpcs.xml test lib
- vendor/bin/phpstan analyze

phpstan:
service: appserver
cmd: './vendor/bin/phpstan'
description: 'Run phpstan commands for static analysis'

docs:
service: gitbook
Expand All @@ -128,19 +146,12 @@ events:
pre-docs:
- appserver: './scripts/build-api-md.sh'

pre-e2e:
- appserver: 'echo installing test themes...'
- appserver: 'rsync --verbose --archive --recursive ./test/themes/ ./wp/wp-content/themes/'

proxy:
appserver:
- conifer.lndo.site

mailhog:
- mail.conifer.lndo.site

phpmyadmin:
- phpmyadmin.conifer.lndo.site

docs:
- docs.conifer.lndo.site
57 changes: 24 additions & 33 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,40 @@
#
# Conifer build process for Travis CI
#


#
# !!! IMPORTANT !!!
#
# "without the top-level `env`, no job will be allowed to fail."
# https://docs.travis-ci.com/user/customizing-the-build/
env:

# TravisCI configuration for sitecrafting/conifer

language: php

install:
- composer install --prefer-dist
- if [ $TIMBER_VERSION ] ; then composer require timber/timber:$TIMBER_VERSION; fi

script:
- vendor/bin/phpunit
- vendor/bin/phpcs
os:
- linux
dist: bionic

php:
- '7.0'
- '7.1'
- '7.2'
- '7.3'
- '7.4'

env:
- TIMBER_VERSION='' # default to whatever is declared in composer.lock
- TIMBER_VERSION='2.x-dev'
cache:
directories:
- '${HOME}/.composer/cache'

# Test Conifer against PHP 7.x and run end-to-end tests
matrix:
jobs:
include:
- php: '7.4'
- name: 'Building docs'
language: node_js
node_js: 10
cache:
- ~/.cache
install:
- yarn install --frozen-lockfile
script:
- ./scripts/build-docs.sh

allow_failures:
- env: TIMBER_VERSION='2.x-dev'
addons:
apt:
packages:
- subversion

install:
- composer install --no-interaction --prefer-dist
# TODO
# - scrips/install-wp-tests.sh

script:
- vendor/bin/phpunit --config phpunit.xml.dist
- vendor/bin/phpunit --config phpunit-integration.xml.dist
- vendor/bin/phpcs --standard=./phpcs.xml test lib
- vendor/bin/phpstan analyse
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
[![Build Status](https://travis-ci.org/sitecrafting/conifer.svg?branch=main)](https://travis-ci.org/github/sitecrafting/conifer)
[![Packagist Version](https://img.shields.io/packagist/v/sitecrafting/conifer.svg)](https://packagist.org/packages/sitecrafting/conifer)

#### :warning: ALPHA STATUS

> Conifer is in Alpha. We consider the code production-ready, and breaking changes to the API are unlikely. Most of the code has been extracted from components already running in production.
>
> **However, there may be lingering bugs and, if necessary, breaking changes at this early stage.**

## Documentation

For reference documentation, use-cases, and design principles, [check out the docs](https://www.coniferplug.in/).
Expand Down
41 changes: 32 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,34 @@
],
"minimum-stability": "dev",
"require": {
"php": ">=7.0"
"php": ">=7.2",
"timber/timber": "^2.1"
},
"require-dev": {
"10up/wp_mock": "dev-dev",
"phpunit/phpunit": "^6.0",
"mikey179/vfsstream": "~1",
"behat/behat": "^3.4",
"johnpbloch/wordpress-core-installer": "^2.0",
"johnpbloch/wordpress-core": "^5.8",
"johnpbloch/wordpress-core": "6.5.5",
"mnsami/composer-custom-directory-installer": "^2.0",
"sitecrafting/groot": "dev-master",
"sitecrafting/groot": "dev-timber-2.x",
"squizlabs/php_codesniffer": "3.*",
"timber/timber": "^1.7",
"wp-coding-standards/wpcs": "^2.3",
"acobster/wp-cli-yaml-fixtures": "^0.5.0",
"victorjonsson/markdowndocs": "dev-master"
"victorjonsson/markdowndocs": "dev-master",
"szepeviktor/phpstan-wordpress": "^1.3",
"paulthewalton/acf-stubs": "^5.8.7",
"johnpbloch/wordpress-core-installer": "dev-master",
"phpunit/phpunit": "^8",
"10up/wp_mock": "dev-dev"
},
"config": {
"platform": {
"php": "8.2"
},
"allow-plugins": {
"composer/installers": true,
"mnsami/composer-custom-directory-installer": true,
"johnpbloch/wordpress-core-installer": true
}
},
"extra": {
"wordpress-install-dir": {
Expand All @@ -52,10 +64,21 @@
"Conifer\\": "lib/Conifer/"
}
},
"autoload-dev": {
"psr-4": {
"ConiferTest\\": "test/unit/",
"ConiferTestSupport\\": "test/support/",
"Conifer\\Unit\\": "test/unit/",
"Conifer\\Unit\\Support\\": "test/support/"
}
},
"scripts": {
"test": [
"unit": [
"./vendor/bin/phpunit"
],
"phpstan": [
"./vendor/bin/phpstan analyse"
],
"sniff-summary": [
"./vendor/bin/phpcs --report=summary --standard=./phpcs.xml conifer.php test lib"
],
Expand Down
Loading