Skip to content

Commit d1e2988

Browse files
authored
Merge pull request #5 from Kocal/feat/reprise-monorepo
Restructure into a Symfony bundle + npm monorepo, rebrand to Reprise
2 parents 2b72e1f + b1de131 commit d1e2988

84 files changed

Lines changed: 1480 additions & 268 deletions

File tree

Some content is hidden

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

.gitattributes

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/.git* export-ignore
2+
/.agents export-ignore
3+
/.claude export-ignore
4+
/.editorconfig export-ignore
5+
/.npmrc export-ignore
6+
/.nvmrc export-ignore
7+
/.php-cs-fixer.dist.php export-ignore
8+
/.symfony.bundle.yaml export-ignore
9+
/AGENTS.md export-ignore
10+
/CLAUDE.md export-ignore
11+
/assets export-ignore
12+
/docs export-ignore
13+
/eslint.config.js export-ignore
14+
/package.json export-ignore
15+
/phpstan.dist.neon export-ignore
16+
/phpunit.xml.dist export-ignore
17+
/playground export-ignore
18+
/pnpm-lock.yaml export-ignore
19+
/pnpm-workspace.yaml export-ignore
20+
/reference-repos.md export-ignore
21+
/tests export-ignore

.github/workflows/ci.yml

Lines changed: 81 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,44 +18,102 @@ jobs:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- uses: actions/checkout@v4
21+
- uses: pnpm/action-setup@v4
2122
- name: Set node
2223
uses: actions/setup-node@v4
2324
with:
24-
node-version: lts/*
25-
26-
- name: Setup
27-
run: npm i -g @antfu/ni
28-
25+
node-version-file: .nvmrc
26+
cache: pnpm
27+
cache-dependency-path: pnpm-lock.yaml
2928
- name: Install
30-
run: nci
31-
29+
run: pnpm install --frozen-lockfile
3230
- name: Lint
33-
run: nr lint
31+
run: pnpm run lint
3432

3533
test:
3634
runs-on: ${{ matrix.os }}
37-
3835
strategy:
36+
fail-fast: false
3937
matrix:
40-
node: [lts/*]
4138
os: [ubuntu-latest, windows-latest, macos-latest]
42-
fail-fast: false
43-
4439
steps:
4540
- uses: actions/checkout@v4
46-
- name: Set node ${{ matrix.node }}
41+
- uses: pnpm/action-setup@v4
42+
- name: Set node
4743
uses: actions/setup-node@v4
4844
with:
49-
node-version: ${{ matrix.node }}
50-
51-
- name: Setup
52-
run: npm i -g @antfu/ni
53-
45+
node-version-file: .nvmrc
46+
cache: pnpm
47+
cache-dependency-path: pnpm-lock.yaml
5448
- name: Install
55-
run: nci
56-
49+
run: pnpm install --frozen-lockfile
5750
- name: Build
58-
run: nr build
59-
51+
run: pnpm build
6052
- name: Test
61-
run: nr test
53+
run: pnpm test
54+
55+
php:
56+
name: PHP ${{ matrix.php-version }} + Symfony ${{ matrix.symfony-version }}${{ matrix.dependency-version == 'lowest' && ' lowest' || '' }} on ${{ matrix.os || 'ubuntu-latest' }}
57+
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
58+
strategy:
59+
fail-fast: false
60+
matrix:
61+
include:
62+
# Symfony 7.4 LTS on the lowest supported PHP, resolving the lowest allowed dependencies.
63+
- php-version: '8.4'
64+
symfony-version: 7.4.*
65+
dependency-version: lowest
66+
- php-version: '8.4'
67+
symfony-version: 8.0.*
68+
- php-version: '8.5'
69+
symfony-version: 7.4.*
70+
- php-version: '8.5'
71+
symfony-version: 8.0.*
72+
73+
# Windows
74+
- php-version: '8.4'
75+
symfony-version: 7.4.*
76+
os: windows-latest
77+
- php-version: '8.5'
78+
symfony-version: 8.1.*
79+
os: windows-latest
80+
env:
81+
# symfony/flex (installed as a global tool below) reads SYMFONY_REQUIRE and forces every
82+
# symfony/* package to this version during the Composer resolution.
83+
SYMFONY_REQUIRE: ${{ matrix.symfony-version }}
84+
steps:
85+
- uses: actions/checkout@v4
86+
- name: Setup PHP
87+
uses: shivammathur/setup-php@v2
88+
with:
89+
php-version: ${{ matrix.php-version }}
90+
tools: flex
91+
- name: Install dependencies
92+
uses: ramsey/composer-install@v3
93+
with:
94+
dependency-versions: ${{ matrix.dependency-version == 'lowest' && 'lowest' || 'highest' }}
95+
composer-options: --prefer-dist
96+
custom-cache-suffix: ${{ matrix.symfony-version }}
97+
- name: PHPUnit
98+
run: vendor/bin/phpunit
99+
100+
php-qa:
101+
runs-on: ubuntu-latest
102+
steps:
103+
- uses: actions/checkout@v4
104+
- name: Setup PHP
105+
uses: shivammathur/setup-php@v2
106+
with:
107+
php-version: '8.4'
108+
tools: composer:v2
109+
- name: Validate composer.json
110+
run: composer validate --strict
111+
- name: Install dependencies
112+
uses: ramsey/composer-install@v3
113+
with:
114+
dependency-versions: highest
115+
composer-options: --prefer-dist
116+
- name: PHPStan
117+
run: vendor/bin/phpstan analyse
118+
- name: PHP-CS-Fixer
119+
run: vendor/bin/php-cs-fixer fix --dry-run --diff

.github/workflows/fabbot.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Fabbot
2+
3+
on:
4+
pull_request:
5+
6+
permissions: {}
7+
8+
jobs:
9+
call-fabbot:
10+
name: Fabbot
11+
permissions:
12+
contents: read
13+
uses: symfony-tools/fabbot/.github/workflows/fabbot.yml@ad55ed5ac95aaa9794c60473178a007b342a73b4 # main
14+
with:
15+
package: Reprise
16+
check_license: true

.gitignore

Lines changed: 16 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,25 @@
11
# Local clones of other people's configs, kept for reference only.
22
.references/
33

4-
# Created by .ignore support plugin (hsz.mobi)
5-
### Node template
6-
# Logs
7-
logs
8-
*.log
9-
npm-debug.log*
10-
yarn-debug.log*
11-
yarn-error.log*
12-
13-
# Runtime data
14-
pids
15-
*.pid
16-
*.seed
17-
*.pid.lock
18-
19-
# Directory for instrumented libs generated by jscoverage/JSCover
20-
lib-cov
21-
22-
# Coverage directory used by tools like istanbul
23-
coverage
24-
25-
# nyc test coverage
26-
.nyc_output
27-
28-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
29-
.grunt
30-
31-
# Bower dependency directory (https://bower.io/)
32-
bower_components
33-
34-
# node-waf configuration
35-
.lock-wscript
36-
37-
# Compiled binary addons (https://nodejs.org/api/addons.html)
38-
build/Release
39-
40-
# Dependency directories
41-
node_modules/
42-
jspm_packages/
43-
44-
# TypeScript v1 declaration files
45-
typings/
46-
47-
# Optional npm cache directory
48-
.npm
49-
50-
# Optional eslint cache
51-
.eslintcache
52-
53-
# Optional REPL history
54-
.node_repl_history
55-
56-
# Output of 'npm pack'
57-
*.tgz
58-
59-
# Yarn Integrity file
60-
.yarn-integrity
61-
62-
# dotenv environment variables file
63-
.env
64-
65-
# parcel-bundler cache (https://parceljs.org/)
66-
.cache
67-
68-
# next.js build output
69-
.next
70-
71-
# nuxt.js build output
72-
.nuxt
73-
74-
# Nuxt generate
75-
dist
76-
77-
# vuepress build output
78-
.vuepress/dist
79-
80-
# Serverless directories
81-
.serverless
82-
83-
# IDE
84-
.idea
85-
864
# Subagent-driven-development scratch (briefs, reports, ledger, diffs)
875
.superpowers/
886

7+
# Node / npm
8+
node_modules/
9+
/assets/dist/
10+
8911
# Test fixtures ship fake node_modules packages on purpose:
9012
# the Stimulus generator resolves them via require(`<pkg>/package.json`).
91-
!test/fixtures/**/node_modules/
92-
!test/fixtures/**/node_modules/**
13+
!assets/test/fixtures/**/node_modules/
14+
!assets/test/fixtures/**/node_modules/**
15+
16+
# Composer (PHP bundle)
17+
/vendor/
18+
/composer.lock
19+
20+
# PHPUnit
21+
/.phpunit.cache/
22+
/.phpunit.result.cache
9323

94-
!playground/.env
24+
# PHP-CS-Fixer
25+
/.php-cs-fixer.cache

.php-cs-fixer.dist.php

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
$fileHeaderParts = [
13+
<<<'EOF'
14+
This file is part of the Symfony package.
15+
16+
(c) Fabien Potencier <fabien@symfony.com>
17+
18+
EOF,
19+
<<<'EOF'
20+
21+
For the full copyright and license information, please view the LICENSE
22+
file that was distributed with this source code.
23+
EOF,
24+
];
25+
26+
return (new PhpCsFixer\Config())
27+
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
28+
->setRules([
29+
'@PHP8x4Migration' => true, // take lowest version from `git grep -h '"php"' **/composer.json | uniq | sort`
30+
'@PHPUnit11x0Migration:risky' => true,
31+
'@Symfony' => true,
32+
'@Symfony:risky' => true,
33+
'header_comment' => [
34+
'header' => implode('', $fileHeaderParts),
35+
'validator' => implode('', [
36+
'/',
37+
preg_quote($fileHeaderParts[0], '/'),
38+
'(?P<EXTRA>.*)??',
39+
preg_quote($fileHeaderParts[1], '/'),
40+
'/s',
41+
]),
42+
],
43+
])
44+
->setRuleCustomisationPolicy(new class implements PhpCsFixer\Config\RuleCustomisationPolicyInterface {
45+
public function getPolicyVersionForCache(): string
46+
{
47+
return hash_file('xxh128', __FILE__);
48+
}
49+
50+
public function getRuleCustomisers(): array
51+
{
52+
return [
53+
'void_return' => static function (SplFileInfo $file) {
54+
// temporary hack due to bug: https://github.com/symfony/symfony/issues/62734
55+
if (!$file instanceof Symfony\Component\Finder\SplFileInfo) {
56+
return false;
57+
}
58+
59+
$relativePathname = $file->getRelativePathname();
60+
61+
if (
62+
str_contains($relativePathname, '/tests/') // don't touch test files, as massive change with little benefit - as outside of public contract anyway
63+
|| str_contains($relativePathname, '/Test/') // public namespace not following the rule, do not mistake it with `/Tests/`
64+
) {
65+
return false;
66+
}
67+
68+
return true;
69+
},
70+
];
71+
}
72+
})
73+
->setRiskyAllowed(true)
74+
->setFinder((new PhpCsFixer\Finder())
75+
->in(__DIR__)
76+
->exclude(['assets', 'playground', 'var'])
77+
->notPath('#/Fixtures/#')
78+
)
79+
;

.symfony.bundle.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
branches: [main]
2+
maintained_branches: [main]
3+
doc_dir: doc

0 commit comments

Comments
 (0)