Skip to content

Commit

Permalink
Merge pull request #25 from abbadon1334/upgrade/3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
abbadon1334 authored Feb 24, 2022
2 parents 2478869 + 3038709 commit efbaedc
Show file tree
Hide file tree
Showing 29 changed files with 1,030 additions and 1,041 deletions.
14 changes: 14 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
categories:
- title: "Breaking Changes"
labels:
- "BC-break"
- title: "Major Features"
labels:
- "MAJOR"
- title: "Documentation enhancements"
labels:
- "Documentation :books:"
template: |
## What’s Changed
$CHANGES
15 changes: 15 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Build Docs

on:
push:
branches:
- develop

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- name: Run Release Drafter
uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56 changes: 56 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build Release

on:
push:
branches:
- '**\.build'
- 'release/*'
- '!**\.gen'

jobs:
autocommit:
name: Build Release
runs-on: ubuntu-latest
container:
image: ghcr.io/mvorisek/image-php:latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.ref }}

- name: Install PHP dependencies
run: composer update --ansi --prefer-dist --no-interaction --no-progress --optimize-autoloader

- name: Composer unset version
run: composer config version --unset

- name: Update composer.json
run: >-
php -r '
$f = __DIR__ . "/composer.json";
$data = json_decode(file_get_contents($f), true);
foreach ($data as $k => $v) {
if (preg_match("~^(.+)-release$~", $k, $matches)) {
$data[$matches[1]] = $data[$k]; unset($data[$k]);
}
}
$str = json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . "\n";
echo $str;
file_put_contents($f, $str);
'
- name: Composer validate config
run: composer validate --strict --no-check-lock && composer normalize --dry-run --no-check-lock

- name: Commit
run: |
git config --global user.name "$(git show -s --format='%an')"
git config --global user.email "$(git show -s --format='%ae')"
git add -A && git diff --staged && git commit -m "Build Release"
- name: Push
uses: ad-m/github-push-action@master
with:
branch: ${{ github.ref }}.gen
force: true
github_token: ${{ secrets.GITHUB_TOKEN }}
405 changes: 405 additions & 0 deletions .github/workflows/test-unit.yml

Large diffs are not rendered by default.

65 changes: 0 additions & 65 deletions .github/workflows/unit.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ docs/build
yarn.lock
run_local.sh
/coverage
/bower_components/
/assets/
28 changes: 13 additions & 15 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
<?php

$finder = PhpCsFixer\Finder::create()
->in([__DIR__])
->exclude([
'cache',
'build',
'vendor',
])
->in(__DIR__)
;
]);

$config = new PhpCsFixer\Config();
$config->setRiskyAllowed(true)
return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setRules([
'@PhpCsFixer' => true,
'@PhpCsFixer:risky' =>true,
'@PHP71Migration:risky' => true,
'@PHP73Migration' => true,
'@PhpCsFixer:risky' => true,
'@PHP74Migration:risky' => true,
'@PHP74Migration' => true,

// required by PSR-12
'concat_space' => [
Expand All @@ -37,10 +36,8 @@
'equal' => false,
'identical' => false,
],
'native_constant_invocation' => true,
'native_function_invocation' => false,
'non_printable_character' => [
'use_escape_sequences_in_strings' => true,
],
'void_return' => false,
'blank_line_before_statement' => [
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'exit'],
Expand All @@ -58,15 +55,16 @@
'phpdoc_add_missing_param_annotation' => false,
'return_assignment' => false,
'comment_to_phpdoc' => false,
'list_syntax' => ['syntax' => 'short'],
'general_phpdoc_annotation_remove' => [
'annotations' => ['author', 'copyright', 'throws'],
],
'nullable_type_declaration_for_default_null_value' => [
'use_nullable_type_declaration' => false,
],

// fn => without curly brackets is less readable,
// also prevent bounding of unwanted variables for GC
'use_arrow_functions' => false,
])
->setFinder($finder)
->setCacheFile(__DIR__ . '/.php_cs.cache');

return $config;
->setCacheFile(sys_get_temp_dir() . '/php-cs-fixer.' . md5(__DIR__) . '.cache');
27 changes: 14 additions & 13 deletions behat.yml.dist
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
default:
suites:
atk4_login:
main:
paths:
features: '%paths.base%/tests-behat'
contexts:
- TextEditor\Behat\Context
- Behat\MinkExtension\Context\MinkContext
- Atk4\TextEditor\Behat\Context
extensions:
Behat\MinkExtension:
show_cmd: 'open %s'
base_url: 'http://127.0.0.1:8888/demos/'
base_url: 'http://127.0.0.1:8888/demos'
sessions:
default:
selenium2:
browser: chrome
wd_host: http://127.0.0.1:4444/wd/hub
capabilities:
chrome:
switches:
- "--headless"
- "--disable-gpu"
- "--window-size=1920,1080"
- "--no-sandbox"
browser: chrome
wd_host: 'http://127.0.0.1:4444/wd/hub'
capabilities:
extra_capabilities:
chrome:
args:
- '--no-sandbox'
- '--headless'
- '--disable-dev-shm-usage'
- '--disable-gpu'
- '--window-size=1920,1200'
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"name": "atk4-trumbowyg",
"version": "1.0.0",
"dependencies": {
"trumbowyg": "^2.19.0"
"trumbowyg": "2.25.1"
}
}
13 changes: 13 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ignore:
- demos
- docs
- tools
comment: false
coverage:
status:
project:
default:
target: auto
threshold: 0.025
patch: false
changes: false
47 changes: 33 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,55 @@
"name": "abbadon1334/atk4-trumbowyg",
"description": "ATK4 WYSIWYG editor using javascript library trumbowyg",
"license": "MIT",
"type": "library",
"authors": [
{
"name": "Francesco Danti",
"email": "fdanti@gmail.com"
}
],
"require": {
"php": ">=7.3",
"atk4/ui": "2.4"
"php": ">=7.4 <8.2",
"atk4/ui": "dev-develop"
},
"require-release": {
"php": ">=7.4 <8.2",
"atk4/ui": "3.1"
},
"require-dev": {
"behat/behat": "3.8.1",
"behat/mink": "1.8.1",
"behat/mink-extension": "2.3.1",
"behat/mink-selenium2-driver": "1.4.0",
"friendsofphp/php-cs-fixer": "3.0.2",
"phpstan/phpstan": "0.12.94",
"phpunit/phpunit": "9.5.8"
"behat/behat": "^3.9",
"behat/mink": "^1.9",
"behat/mink-extension": "^2.3.1",
"behat/mink-selenium2-driver": "^1.5",
"ergebnis/composer-normalize": "^2.13",
"friendsofphp/php-cs-fixer": "^3.0",
"instaclick/php-webdriver": "^1.4.7",
"johnkary/phpunit-speedtrap": "^3.3",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpunit/phpunit": "^9.5.5",
"symfony/console": "^4.4.30 || ^5.3.7",
"symfony/css-selector": "^4.4.24 || ^5.2.9"
},
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
"psr-4": {
"Atk4\\Ui\\Form\\Control\\": "src/"
"Atk4\\TextEditor\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"TextEditor\\Tests\\": "tests/",
"TextEditor\\Behat\\": "tests-behat/Bootstrap/"
"Atk4\\TextEditor\\Behat\\": "tests-behat/",
"Atk4\\TextEditor\\Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true
"config": {
"allow-plugins": {
"ergebnis/composer-normalize": true,
"phpstan/extension-installer": true
},
"sort-packages": true
}
}
26 changes: 26 additions & 0 deletions demos/_demo-data/create-db.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

namespace Atk4\TextEditor\Demos;

use Atk4\Data\Persistence;
use Atk4\Data\Schema\Migrator;
use Atk4\TextEditor\Demos\Model\Post;

require_once __DIR__ . '/../init-autoloader.php';

$sqliteFile = __DIR__ . '/db.sqlite';
if (!file_exists($sqliteFile)) {
new Persistence\Sql('sqlite:' . $sqliteFile);
}
unset($sqliteFile);

/** @var Persistence\Sql $db */
require_once __DIR__ . '/../init-db.php';

echo 'GITHUB_JOB : ' . getenv('GITHUB_JOB') . "\n\n";

(new Migrator(new Post($db)))->create();

echo 'import complete!' . "\n\n";
Loading

0 comments on commit efbaedc

Please sign in to comment.