Skip to content

Commit d6a7d92

Browse files
authored
refactor: package structure
1 parent 278253d commit d6a7d92

File tree

1,344 files changed

+117
-127
lines changed

Some content is hidden

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

1,344 files changed

+117
-127
lines changed

.github/workflows/integration-tests.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,4 @@ jobs:
100100
run: php ./tempest discovery:status
101101

102102
- name: Execute tests
103-
run: php -d"error_reporting = E_ALL & ~E_DEPRECATED" -dmemory_limit=1G vendor/bin/phpunit --coverage-clover build/reports/clover.xml
104-
105-
# Only upload coverage once.
106-
- if: matrix.php == '8.4' && matrix.database == 'sqlite' && matrix.os == 'ubuntu-latest' && matrix.stability == 'prefer-stable'
107-
name: Coveralls
108-
uses: coverallsapp/github-action@v2
109-
continue-on-error: true
110-
with:
111-
github-token: '${{ secrets.GITHUB_TOKEN }}'
112-
file: build/reports/clover.xml
103+
run: php -d"error_reporting = E_ALL & ~E_DEPRECATED" -dmemory_limit=1G vendor/bin/phpunit

.github/workflows/isolated-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ jobs:
6969
- name: Install dependencies
7070
run: |
7171
./bin/build-changed-packages
72-
cd "src/Tempest/${{ matrix.package.basename }}"
72+
cd "packages/${{ matrix.package.basename }}"
7373
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
7474
7575
- name: Execute tests
76-
run: phpunit -c "src/Tempest/${{ matrix.package.basename }}/phpunit.xml"
76+
run: phpunit -c "packages/${{ matrix.package.basename }}/phpunit.xml"

.github/workflows/subsplit-packages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
if: "!startsWith(github.ref, 'refs/tags/')"
4747
uses: "symplify/[email protected]"
4848
with:
49-
# ↓ split "src/Tempest/Console" directory
49+
# ↓ split "packages/console" directory
5050
package_directory: '${{ matrix.package.directory }}'
5151

5252
# ↓ into https://github.com/tempestphp/tempest-console repository
@@ -64,7 +64,7 @@ jobs:
6464
with:
6565
tag: ${GITHUB_REF#refs/tags/}
6666

67-
# ↓ split "src/Tempest/Console" directory
67+
# ↓ split "packages/console" directory
6868
package_directory: '${{ matrix.package.directory }}'
6969

7070
# ↓ into https://github.com/tempestphp/tempest-console repository

.gitignore

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1+
# Top level directories
2+
/log/
3+
/package-lock.json
4+
5+
# Top-level+Sub directories
16
.cache/
27
.idea/
38
build/
49
sessions/
510
vendor/
11+
# @TODO(aidan-casey): clean this up
12+
packages/database.sqlite
13+
packages/database/src/database.sqlite
614
src/Tempest/database.sqlite
715
tests/Fixtures/database.sqlite
816
tests/Unit/Console/test-console.log
@@ -13,7 +21,7 @@ debug.log
1321
tempest.log
1422
public/static
1523
tests/Unit/Log
16-
log/
24+
!packages/log
1725
node_modules
1826
dist
1927
profile/

bin/get-packages

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* @link https://github.com/ecotoneframework/ecotone-dev/blob/main/bin/get-packages
1212
*/
1313

14-
const PACKAGES_DIRECTORY = __DIR__ . '/../src/Tempest/';
14+
const PACKAGES_DIRECTORY = __DIR__ . '/../packages/';
1515

1616
function getPackageNameFromComposerFile(string $composerFile)
1717
{

bin/get-packages-with-tests

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* @link https://github.com/ecotoneframework/ecotone-dev/blob/main/bin/get-packages
1717
*/
1818

19-
const PACKAGES_DIRECTORY = __DIR__ . '/../src/Tempest/';
19+
const PACKAGES_DIRECTORY = __DIR__ . '/../packages/';
2020

2121
function getPackageNameFromComposerFile(string $composerFile)
2222
{

bin/release

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ require_once getcwd() . '/vendor/autoload.php';
2929
*/
3030
function bumpKernelVersion(string $version): void
3131
{
32-
$kernel = __DIR__ . '/../src/Tempest/Core/src/Kernel.php';
32+
$kernel = __DIR__ . '/../packages/core/src/Kernel.php';
3333
$content = preg_replace(
3434
pattern: '/public const string VERSION = \'.*\';/',
3535
replacement: "public const string VERSION = '{$version}';",
@@ -44,7 +44,7 @@ function bumpKernelVersion(string $version): void
4444
*/
4545
function setPhpDependencyVersion(string $package, string $version): void
4646
{
47-
foreach (glob(__DIR__ . '/../src/Tempest/*/composer.json') as $path) {
47+
foreach (glob(__DIR__ . '/../packages/*/composer.json') as $path) {
4848
updateJsonFile(
4949
path: $path,
5050
callback: function (array $content) use ($version, $package) {
@@ -68,7 +68,7 @@ function bumpPhpPackages(string $version, bool $isMajor): void
6868
// Bumps dependencies
6969
executeCommands("./vendor/bin/monorepo-builder bump-interdependency {$version}");
7070

71-
// Finds all `composer.json` files in `src/Tempest`, and revert the `tempest/highlight` dependency to the saved version
71+
// Finds all `composer.json` files in `packages/`, and revert the `tempest/highlight` dependency to the saved version
7272
setPhpDependencyVersion(
7373
package: 'tempest/highlight',
7474
version: json_decode(file_get_contents(__DIR__ . '/../composer.json'), associative: true)['require']['tempest/highlight'],
@@ -87,7 +87,7 @@ function cleanUpAfterRelease(): void
8787
// to update back all composer files to use `dev-main` instead of a fixed version.
8888
executeCommands('./vendor/bin/monorepo-builder bump-interdependency dev-main');
8989

90-
// Finds all `composer.json` files in `src/Tempest`, and revert the `tempest/highlight` dependency to the saved version
90+
// Finds all `composer.json` files in `packages/`, and revert the `tempest/highlight` dependency to the saved version
9191
setPhpDependencyVersion(
9292
package: 'tempest/highlight',
9393
version: json_decode(file_get_contents(__DIR__ . '/../composer.json'), associative: true)['require']['tempest/highlight'],

composer.json

Lines changed: 76 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -101,105 +101,97 @@
101101
"prefer-stable": true,
102102
"autoload": {
103103
"psr-4": {
104-
"Tempest\\Auth\\": "src/Tempest/Auth/src/",
105-
"Tempest\\Cache\\": "src/Tempest/Cache/src/",
106-
"Tempest\\Clock\\": "src/Tempest/Clock/src/",
107-
"Tempest\\CommandBus\\": "src/Tempest/CommandBus/src",
108-
"Tempest\\Console\\": "src/Tempest/Console/src",
109-
"Tempest\\Container\\": "src/Tempest/Container/src",
110-
"Tempest\\Core\\": "src/Tempest/Core/src",
111-
"Tempest\\Database\\": "src/Tempest/Database/src",
112-
"Tempest\\DateTime\\": "src/Tempest/DateTime/src",
113-
"Tempest\\Debug\\": "src/Tempest/Debug/src",
114-
"Tempest\\Discovery\\": "src/Tempest/Discovery/src",
115-
"Tempest\\EventBus\\": "src/Tempest/EventBus/src",
104+
"Tempest\\Auth\\": "packages/auth/src",
105+
"Tempest\\Cache\\": "packages/cache/src",
106+
"Tempest\\Clock\\": "packages/clock/src",
107+
"Tempest\\CommandBus\\": "packages/command-bus/src",
108+
"Tempest\\Console\\": "packages/console/src",
109+
"Tempest\\Container\\": "packages/container/src",
110+
"Tempest\\Core\\": "packages/core/src",
111+
"Tempest\\Database\\": "packages/database/src",
112+
"Tempest\\DateTime\\": "packages/datetime/src",
113+
"Tempest\\Debug\\": "packages/debug/src",
114+
"Tempest\\Discovery\\": "packages/discovery/src",
115+
"Tempest\\EventBus\\": "packages/event-bus/src",
116116
"Tempest\\Framework\\": "src/Tempest/Framework",
117-
"Tempest\\Generation\\": "src/Tempest/Generation/src",
118-
"Tempest\\HttpClient\\": "src/Tempest/HttpClient/src",
119-
"Tempest\\Http\\": "src/Tempest/Http/src",
120-
"Tempest\\Log\\": "src/Tempest/Log/src",
121-
"Tempest\\Mapper\\": "src/Tempest/Mapper/src",
122-
"Tempest\\Reflection\\": "src/Tempest/Reflection/src",
123-
"Tempest\\Router\\": "src/Tempest/Router/src",
124-
"Tempest\\Storage\\": "src/Tempest/Storage/src",
125-
"Tempest\\Support\\": "src/Tempest/Support/src",
126-
"Tempest\\Validation\\": "src/Tempest/Validation/src",
127-
"Tempest\\View\\": "src/Tempest/View/src",
128-
"Tempest\\Vite\\": "src/Tempest/Vite/src"
117+
"Tempest\\Generation\\": "packages/generation/src",
118+
"Tempest\\HttpClient\\": "packages/http-client/src",
119+
"Tempest\\Http\\": "packages/http/src",
120+
"Tempest\\Log\\": "packages/log/src",
121+
"Tempest\\Mapper\\": "packages/mapper/src",
122+
"Tempest\\Reflection\\": "packages/reflection/src",
123+
"Tempest\\Router\\": "packages/router/src",
124+
"Tempest\\Storage\\": "packages/storage/src",
125+
"Tempest\\Support\\": "packages/support/src",
126+
"Tempest\\Validation\\": "packages/validation/src",
127+
"Tempest\\View\\": "packages/view/src",
128+
"Tempest\\Vite\\": "packages/vite/src"
129129
},
130130
"files": [
131-
"src/Tempest/Clock/src/functions.php",
132-
"src/Tempest/CommandBus/src/functions.php",
133-
"src/Tempest/Container/src/functions.php",
134-
"src/Tempest/Core/src/functions.php",
135-
"src/Tempest/Database/src/functions.php",
136-
"src/Tempest/DateTime/src/constants.php",
137-
"src/Tempest/DateTime/src/functions.php",
138-
"src/Tempest/Debug/src/functions.php",
139-
"src/Tempest/EventBus/src/functions.php",
140-
"src/Tempest/Mapper/src/functions.php",
141-
"src/Tempest/Reflection/src/functions.php",
142-
"src/Tempest/Router/src/functions.php",
143-
"src/Tempest/Support/src/Arr/functions.php",
144-
"src/Tempest/Support/src/Comparison/functions.php",
145-
"src/Tempest/Support/src/Filesystem/functions.php",
146-
"src/Tempest/Support/src/Html/functions.php",
147-
"src/Tempest/Support/src/Json/functions.php",
148-
"src/Tempest/Support/src/Language/functions.php",
149-
"src/Tempest/Support/src/Math/constants.php",
150-
"src/Tempest/Support/src/Math/functions.php",
151-
"src/Tempest/Support/src/Namespace/functions.php",
152-
"src/Tempest/Support/src/Path/functions.php",
153-
"src/Tempest/Support/src/Random/functions.php",
154-
"src/Tempest/Support/src/Regex/functions.php",
155-
"src/Tempest/Support/src/Str/constants.php",
156-
"src/Tempest/Support/src/Str/functions.php",
157-
"src/Tempest/Support/src/functions.php",
158-
"src/Tempest/View/src/functions.php",
159-
"src/Tempest/Vite/src/functions.php"
131+
"packages/clock/src/functions.php",
132+
"packages/command-bus/src/functions.php",
133+
"packages/container/src/functions.php",
134+
"packages/core/src/functions.php",
135+
"packages/database/src/functions.php",
136+
"packages/datetime/src/constants.php",
137+
"packages/datetime/src/functions.php",
138+
"packages/debug/src/functions.php",
139+
"packages/event-bus/src/functions.php",
140+
"packages/mapper/src/functions.php",
141+
"packages/reflection/src/functions.php",
142+
"packages/router/src/functions.php",
143+
"packages/support/src/Arr/functions.php",
144+
"packages/support/src/Comparison/functions.php",
145+
"packages/support/src/Filesystem/functions.php",
146+
"packages/support/src/Html/functions.php",
147+
"packages/support/src/Json/functions.php",
148+
"packages/support/src/Language/functions.php",
149+
"packages/support/src/Math/constants.php",
150+
"packages/support/src/Math/functions.php",
151+
"packages/support/src/Namespace/functions.php",
152+
"packages/support/src/Path/functions.php",
153+
"packages/support/src/Random/functions.php",
154+
"packages/support/src/Regex/functions.php",
155+
"packages/support/src/Str/constants.php",
156+
"packages/support/src/Str/functions.php",
157+
"packages/support/src/functions.php",
158+
"packages/view/src/functions.php",
159+
"packages/vite/src/functions.php"
160160
]
161161
},
162162
"autoload-dev": {
163163
"psr-4": {
164-
"Tempest\\Auth\\Tests\\": "src/Tempest/Auth/tests",
165-
"Tempest\\Cache\\Tests\\": "src/Tempest/Cache/tests",
166-
"Tempest\\Clock\\Tests\\": "src/Tempest/Clock/tests",
167-
"Tempest\\CommandBus\\Tests\\": "src/Tempest/CommandBus/tests",
168-
"Tempest\\Console\\Tests\\": "src/Tempest/Console/tests",
169-
"Tempest\\Container\\Tests\\": "src/Tempest/Container/tests",
170-
"Tempest\\Core\\Tests\\": "src/Tempest/Core/tests",
171-
"Tempest\\Database\\Tests\\": "src/Tempest/Database/tests",
172-
"Tempest\\DateTime\\Tests\\": "src/Tempest/DateTime/tests",
173-
"Tempest\\Discovery\\Tests\\": "src/Tempest/Discovery/tests",
174-
"Tempest\\EventBus\\Tests\\": "src/Tempest/EventBus/tests",
175-
"Tempest\\Generation\\Tests\\": "src/Tempest/Generation/tests",
176-
"Tempest\\HttpClient\\Tests\\": "src/Tempest/HttpClient/tests",
177-
"Tempest\\Http\\Tests\\": [
178-
"src/Tempest/Http/tests",
179-
"src/Tempest/Router/tests"
180-
],
181-
"Tempest\\Log\\Tests\\": "src/Tempest/Log/tests",
182-
"Tempest\\Mapper\\Tests\\": "src/Tempest/Mapper/tests",
183-
"Tempest\\Reflection\\Tests\\": "src/Tempest/Reflection/tests",
184-
"Tempest\\Router\\Tests\\": "src/Tempest/Router/tests",
185-
"Tempest\\Storage\\Tests\\": "src/Tempest/Storage/tests",
186-
"Tempest\\Support\\Tests\\": "src/Tempest/Support/tests",
187-
"Tempest\\Validation\\Tests\\": "src/Tempest/Validation/tests",
188-
"Tempest\\View\\Tests\\": "src/Tempest/View/tests",
189-
"Tempest\\Vite\\Tests\\": "src/Tempest/Vite/tests",
190-
"Tests\\Tempest\\": "tests/"
164+
"Tempest\\Cache\\Tests\\": "packages/cache/tests",
165+
"Tempest\\Clock\\Tests\\": "packages/clock/tests",
166+
"Tempest\\CommandBus\\Tests\\": "packages/command-bus/tests",
167+
"Tempest\\Console\\Tests\\": "packages/console/tests",
168+
"Tempest\\Container\\Tests\\": "packages/container/tests",
169+
"Tempest\\Core\\Tests\\": "packages/core/tests",
170+
"Tempest\\Database\\Tests\\": "packages/database/tests",
171+
"Tempest\\DateTime\\Tests\\": "packages/datetime/tests",
172+
"Tempest\\EventBus\\Tests\\": "packages/event-bus/tests",
173+
"Tempest\\Generation\\Tests\\": "packages/generation/tests",
174+
"Tempest\\HttpClient\\Tests\\": "packages/http-client/tests",
175+
"Tempest\\Http\\Tests\\": "packages/http/tests",
176+
"Tempest\\Log\\Tests\\": "packages/log/tests",
177+
"Tempest\\Mapper\\Tests\\": "packages/mapper/tests",
178+
"Tempest\\Reflection\\Tests\\": "packages/reflection/tests",
179+
"Tempest\\Router\\Tests\\": "packages/router/tests",
180+
"Tempest\\Storage\\Tests\\": "packages/storage/tests",
181+
"Tempest\\Support\\Tests\\": "packages/support/tests",
182+
"Tempest\\Validation\\Tests\\": "packages/validation/tests",
183+
"Tempest\\View\\Tests\\": "packages/view/tests",
184+
"Tempest\\Vite\\Tests\\": "packages/vite/tests",
185+
"Tests\\Tempest\\": "tests"
191186
}
192187
},
193-
"bin": [
194-
"src/Tempest/Console/bin/tempest"
195-
],
196188
"config": {
197189
"allow-plugins": {
198190
"carthage-software/mago": true
199191
}
200192
},
201193
"scripts": {
202-
"phpunit": "vendor/bin/phpunit --display-warnings --display-skipped --display-deprecations --display-errors --display-notices",
194+
"phpunit": "@php -d memory_limit=2G vendor/bin/phpunit --display-warnings --display-skipped --display-deprecations --display-errors --display-notices",
203195
"coverage": "vendor/bin/phpunit --coverage-html build/reports/html --coverage-clover build/reports/clover.xml",
204196
"mago:fmt": "vendor/bin/mago fmt && vendor/bin/mago lint --fix --potentially-unsafe --fmt",
205197
"mago:lint": "vendor/bin/mago lint --minimum-level=note",

mago.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
php_version = "8.4.0"
22

33
[source]
4-
paths = ["src", "tests"]
4+
paths = ["src", "packages", "tests"]
55
includes = ["vendor"]
66
excludes = [
77
"./vendor/symfony/cache/Traits/ValueWrapper.php",

monorepo-builder.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,8 @@
55
use Symplify\MonorepoBuilder\Config\MBConfig;
66

77
return static function (MBConfig $mbConfig): void {
8-
$mbConfig->packageDirectories([__DIR__ . '/src/Tempest']);
8+
$mbConfig->packageDirectories([
9+
__DIR__ . '/src/Tempest',
10+
__DIR__ . '/packages',
11+
]);
912
};

0 commit comments

Comments
 (0)