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

Next (php 8, bootstrap 5, vanilla js) #168

Merged
merged 34 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f706caf
Assets: added favicon
f3l1x Mar 6, 2022
ee4d89e
App: allow to set debug mode by env
f3l1x Mar 6, 2022
6470732
App: load assets from vendor folder (to match given version)
f3l1x Mar 6, 2022
3a757d5
Bootstrap 5
f3l1x Mar 6, 2022
63cf8ef
Composer: upgrade deps, use datagrid:dev-next
f3l1x Jan 24, 2023
e82c31e
NPM: init
f3l1x Jan 24, 2023
07a832d
Codesniffer: use contributte/qa
f3l1x Jan 24, 2023
25bc996
Build: init vite
f3l1x Jan 24, 2023
bdbcad3
Phpstan: deprecation rules
f3l1x Jan 24, 2023
06f4266
Codesniffer: fixes
f3l1x Jan 24, 2023
4632af3
Config: common -> services
f3l1x Jan 24, 2023
4fa3599
Config: example of local.neon
f3l1x Jan 24, 2023
cae0420
Tests: init
f3l1x Jan 24, 2023
bebb6c3
CI: refactor workflows
f3l1x Jan 24, 2023
d86ac2e
App: upgrade to PHP 8.1, phpstan level 9
f3l1x Jan 24, 2023
a9fa47e
Add .env files
f3l1x Mar 8, 2023
ee14ca5
Update gitignore
f3l1x Mar 8, 2023
ff429f2
Composer: based on nella
f3l1x Mar 8, 2023
5a542d0
NPM: deps
f3l1x Mar 8, 2023
0b861f3
Docker: update compose
f3l1x Mar 8, 2023
14dc645
Makefile: modernize
f3l1x Mar 8, 2023
462f85b
Vite: proper settings
f3l1x Mar 8, 2023
9a92667
App: based on nella
f3l1x Mar 8, 2023
08cfecc
Config: simplify
f3l1x Mar 8, 2023
69c6c58
DB: introduce db folder
f3l1x Mar 8, 2023
a955b37
App: introduce var folder
f3l1x Mar 8, 2023
d966e27
Assets: rewrite
f3l1x Mar 8, 2023
68a1eb0
Phpstan: use var/tmp
f3l1x Mar 8, 2023
36f9e1e
Readme: sync with current setup
f3l1x Mar 8, 2023
e61baa2
Assets: rewrite to TS and plugins
lilianalillyy Jun 6, 2023
beea9cf
Makefile: setup local.neon
f3l1x Jun 7, 2023
5511ee3
Env: disable xdebug
f3l1x Jun 7, 2023
2dc462e
Assets: move to datagrid library
f3l1x Jun 7, 2023
84defdf
Composer: upgrade deps
f3l1x May 3, 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
10 changes: 10 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
DB_DATABASE=contributte
DB_USER=contributte
DB_PASSWORD=contributte
DB_ROOT_PASSWORD=contributte

XDEBUG_MODE=
XDEBUG_HOST=host.docker.internal

NETTE_DEBUG=0
NETTE_ENV=production
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
NETTE_DEBUG=1
NETTE_ENV=development
17 changes: 17 additions & 0 deletions .github/workflows/codesniffer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "Codesniffer"

on:
pull_request:

push:
branches: ["*"]

schedule:
- cron: "0 8 * * 1"

jobs:
codesniffer:
name: "Codesniffer"
uses: contributte/.github/.github/workflows/codesniffer.yml@v1
with:
php: "8.2"
20 changes: 20 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Coverage"

on:
pull_request:

push:
branches: ["*"]

schedule:
- cron: "0 8 * * 1"

jobs:
test80:
name: "Nette Tester"
uses: contributte/.github/.github/workflows/nette-tester-mysql.yml@v1
with:
php: "8.2"
database: tests
coverage: true
make: coverage
133 changes: 0 additions & 133 deletions .github/workflows/main.yaml

This file was deleted.

17 changes: 17 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "Phpstan"

on:
pull_request:

push:
branches: ["*"]

schedule:
- cron: "0 8 * * 1"

jobs:
phpstan:
name: "Phpstan"
uses: contributte/.github/.github/workflows/phpstan.yml@v1
with:
php: "8.2"
25 changes: 25 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Nette Tester"

on:
pull_request:

push:
branches: ["*"]

schedule:
- cron: "0 8 * * 1"

jobs:
test82:
name: "Nette Tester"
uses: contributte/.github/.github/workflows/nette-tester-mysql.yml@v1
with:
php: "8.2"
database: tests

test81:
name: "Nette Tester"
uses: contributte/.github/.github/workflows/nette-tester-mysql.yml@v1
with:
php: "8.1"
database: tests
21 changes: 19 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/_data
# IDE
.idea

# Docker
/.docker

# Composer
/vendor
/ftp-deployment

# Nette
/config/local.neon

# Assets
/www/dist

# Node
/node_modules

# Envs
.env
86 changes: 70 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,56 +1,110 @@
# Include variables
include .env.dist
-include .env
export

############################################################
# PROJECT ##################################################
############################################################
.PHONY: project install setup clean

.PHONY: project
project: install setup

install:
.PHONY: install
install: install-php install-node

.PHONY: install-php
install-php:
composer install

.PHONY: install-node
install-node:
npm install

.PHONY: setup
setup:
mkdir -p temp temp/sessions log
chmod +0777 temp temp/sessions log
cp -n .env.example .env || true
cp -n config/local.neon.dist config/local.neon || true
mkdir -p var/log var/tmp var/tmp/sessions
chmod 0777 var/log var/tmp var/tmp/sessions

.PHONY: clean
clean:
find temp -mindepth 1 ! -name '.gitignore' -type f,d -exec rm -rf {} +
find log -mindepth 1 ! -name '.gitignore' -type f,d -exec rm -rf {} +
find var/tmp -mindepth 1 ! -name '.gitignore' -type f,d -exec rm -rf {} +
find var/log -mindepth 1 ! -name '.gitignore' -type f,d -exec rm -rf {} +

############################################################
# DEVELOPMENT ##############################################
############################################################
.PHONY: qa dev cs csf phpstan tests coverage dev build

.PHONY: qa
qa: cs phpstan

.PHONY: cs
cs:
vendor/bin/codesniffer app
ifdef GITHUB_ACTION
vendor/bin/phpcs --standard=ruleset.xml --extensions=php,phpt --tab-width=4 --ignore=tests/tmp -q --report=checkstyle app tests | cs2pr
else
vendor/bin/phpcs --standard=ruleset.xml --extensions=php,phpt --tab-width=4 --ignore=tests/tmp --colors -nsp app tests
endif

.PHONY: csf
csf:
vendor/bin/codefixer app
vendor/bin/phpcbf --standard=ruleset.xml --extensions=php,phpt --tab-width=4 --ignore=tests/tmp --colors -nsp app tests

.PHONY: phpstan
phpstan:
vendor/bin/phpstan analyse -c phpstan.neon --memory-limit=512M app
vendor/bin/phpstan analyse -c phpstan.neon --memory-limit=512M

.PHONY: tests
tests:
echo "OK"
vendor/bin/tester -s -p php --colors 1 -C tests/Cases

.PHONY: coverage
coverage:
echo "OK"
ifdef GITHUB_ACTION
vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage coverage.xml --coverage-src app tests/Cases
else
vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage coverage.html --coverage-src app tests/Cases
endif

.PHONY: dev
dev:
NETTE_DEBUG=1 NETTE_ENV=dev php -S 0.0.0.0:8000 -t www

.PHONY: build
build:
echo "BUILD OK"
npm run build

.PHONY: watch
watch:
npm run watch

############################################################
# DEPLOYMENT ###############################################
############################################################
.PHONY: deploy

deploy:
$(MAKE) clean
$(MAKE) project
$(MAKE) build
$(MAKE) clean

############################################################
# DOCKER ###################################################
############################################################
.PHONY: docker-up
docker-up:
docker compose up

.PHONY: docker-mariadb
docker-mariadb: ## Spin MariaDB docker container
docker run \
-it \
--rm \
-p 3306:3306 \
-v $(CURDIR)/.docker/data/mariadb:/var/lib/mysql \
-v $(CURDIR)/db/init.sql:/docker-entrypoint-initdb.d/init.sql \
-e MYSQL_USER=${DB_USER} \
-e MYSQL_PASSWORD=${DB_PASSWORD} \
-e MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD} \
-e MYSQL_DATABASE=${DB_DATABASE} \
mariadb:10.11
Loading
Loading