Skip to content

Commit

Permalink
Detach from monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
vudaltsov committed Sep 7, 2024
1 parent 3ec2546 commit ce0c215
Show file tree
Hide file tree
Showing 66 changed files with 14,218 additions and 6 deletions.
10 changes: 10 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/.github/ export-ignore
/stubs/ export-ignore
/tests/ export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php-cs-fixer.dist.php export-ignore
/composer.lock export-ignore
/infection.json.dist export-ignore
/phpunit.xml.dist export-ignore
/psalm.xml.dist export-ignore
96 changes: 96 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Check

on:
push:
branches: ['main', '*.*.x']
pull_request: ~

jobs:
composer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: 8.1
tools: composer:v2
coverage: none
- uses: ramsey/composer-install@v3
with:
composer-options: --optimize-autoloader
- run: composer validate
- run: composer normalize --dry-run
- run: composer check-require
- run: composer check-unused

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: 8.1
tools: composer:v2
coverage: none
- uses: ramsey/composer-install@v3
with:
composer-options: --optimize-autoloader
- run: composer fixcs -- --dry-run --format=checkstyle

psalm:
runs-on: ubuntu-latest
strategy:
matrix:
dependency-versions: [locked, lowest, highest]
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: 8.1
tools: composer:v2
coverage: none
- uses: ramsey/composer-install@v3
with:
composer-options: --optimize-autoloader
dependency-versions: ${{ matrix.dependency-versions }}
- run: composer psalm -- --stats --output-format=github ${{ matrix.dependency-versions == 'locked' && '--shepherd' || '' }}

test:
runs-on: ubuntu-latest
strategy:
matrix:
php: [8.1, 8.2, 8.3]
dependency-versions: [locked, lowest, highest]
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-file: development
tools: composer:v2
coverage: ${{ matrix.php == '8.1' && matrix.dependency-versions == 'locked' && 'pcov' || '' }}
- uses: ramsey/composer-install@v3
with:
composer-options: --optimize-autoloader
dependency-versions: ${{ matrix.dependency-versions }}
- run: composer test -- --colors=always --coverage-clover coverage.xml
- if: ${{ matrix.php == '8.1' && matrix.dependency-versions == 'locked' }}
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

infection:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: 8.1
ini-file: development
tools: composer:v2
- uses: ramsey/composer-install@v3
with:
composer-options: --optimize-autoloader
- run: composer infection
env:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**/vendor/
/var/
/.php-cs-fixer.php
/phpstan.neon
/phpunit.xml
/psalm.xml
26 changes: 26 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

use PhpCsFixer\Config;
use PhpCsFixer\Finder;
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;
use PHPyh\CodingStandard\PhpCsFixerCodingStandard;

$config = (new Config())
->setFinder(
Finder::create()
->in(__DIR__ . '/src')
->in(__DIR__ . '/tests')
->append([
__FILE__,
]),
)
->setParallelConfig(ParallelConfigFactory::detect())
->setCacheFile(__DIR__ . '/var/' . basename(__FILE__) . '.cache');

(new PhpCsFixerCodingStandard())->applyTo($config, [
'final_public_method_for_abstract_class' => false,
]);

return $config;
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Typhoon Type

This repository is a readonly Typhoon monorepo subsplit.
Please, open pull requests and issues in the [main repository](https://github.com/typhoon-php/typhoon).
[![PHP Version Requirement](https://img.shields.io/packagist/dependency-v/typhoon/type/php)](https://packagist.org/packages/typhoon/type)
[![GitHub Release](https://img.shields.io/github/v/release/typhoon-php/type)](https://github.com/typhoon-php/type/releases)
[![Psalm Level](https://shepherd.dev/github/typhoon-php/type/level.svg)](https://shepherd.dev/github/typhoon-php/type)
[![Psalm Type Coverage](https://shepherd.dev/github/typhoon-php/type/coverage.svg)](https://shepherd.dev/github/typhoon-php/type)
[![Code Coverage](https://codecov.io/gh/typhoon-php/type/branch/0.4.x/graph/badge.svg)](https://codecov.io/gh/typhoon-php/type/tree/0.4.x)
[![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Ftyphoon-php%2Ftype%2F0.4.x)](https://dashboard.stryker-mutator.io/reports/github.com/typhoon-php/type/0.4.x)

Read [documentation](https://github.com/typhoon-php/typhoon/tree/0.4.x).
## Installation

```shell
composer require typhoon/type
```
53 changes: 50 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "typhoon/type",
"description": "Typhoon Type",
"description": "Typhoon Type System",
"license": "MIT",
"type": "library",
"authors": [
Expand All @@ -17,12 +17,59 @@
"php": "^8.1",
"typhoon/declaration-id": "^0.4"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2",
"dragon-code/benchmark": "^2.6",
"ergebnis/composer-normalize": "^2.43.0",
"friendsofphp/php-cs-fixer": "^3.64.0",
"infection/infection": "^0.29.6",
"phpstan/phpstan": "^1.12.2",
"phpunit/phpunit": "^10.5.32",
"phpyh/coding-standard": "^2.6.2",
"symfony/var-dumper": "^6.4.11 || ^7.1.3"
},
"autoload": {
"psr-4": {
"Typhoon\\Type\\": ""
"Typhoon\\Type\\": "src/"
},
"files": [
"functions.php"
"src/functions.php"
]
},
"autoload-dev": {
"psr-4": {
"Typhoon\\Type\\": "tests/"
}
},
"config": {
"allow-plugins": {
"bamarni/composer-bin-plugin": true,
"ergebnis/composer-normalize": true,
"infection/extension-installer": true
},
"platform": {
"php": "8.1"
},
"sort-packages": true
},
"extra": {
"bamarni-bin": {
"bin-links": false,
"forward-command": true,
"target-directory": "tools"
}
},
"scripts": {
"bump-dev": [
"@composer bump --dev-only",
"@composer bin all bump --dev-only"
],
"check-require": "tools/composer-require-checker/vendor/bin/composer-require-checker",
"check-unused": "tools/composer-unused/vendor/bin/composer-unused",
"fixcs": "php-cs-fixer fix --diff",
"infection": "infection --show-mutations",
"pre-command-run": "mkdir -p var",
"psalm": "tools/psalm/vendor/bin/psalm --show-info --no-diff --no-cache",
"test": "phpunit"
}
}
Loading

0 comments on commit ce0c215

Please sign in to comment.