Skip to content

Commit c1aa75a

Browse files
authored
Merge branch 'main' into feat/auth/oauth-sso
2 parents 687d519 + cf504ad commit c1aa75a

File tree

462 files changed

+12335
-2127
lines changed

Some content is hidden

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

462 files changed

+12335
-2127
lines changed

.github/workflows/create-gh-release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ jobs:
2323
id: generate_release_notes
2424
with:
2525
args: -v --latest --strip header
26+
env:
27+
GITHUB_REPO: ${{ github.repository }}
2628

2729
- name: Clean up release notes
2830
run: |

.github/workflows/integration-tests.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ jobs:
8989
- name: Install dependencies
9090
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction
9191

92+
- name: "Setup Redis"
93+
if: ${{ matrix.os != 'windows-latest' }}
94+
uses: supercharge/[email protected]
95+
9296
- name: "Setup MySQL"
9397
if: ${{ matrix.database == 'mysql' }}
9498
uses: ankane/setup-mysql@v1
@@ -104,7 +108,7 @@ jobs:
104108
run: php -r "copy('tests/Fixtures/Config/database.${{ matrix.database }}.php', 'tests/Fixtures/Config/database.config.php');"
105109

106110
- name: Tempest about
107-
run: php ./tempest about
111+
run: php ./tempest about -v
108112

109113
- name: List discovered locations
110114
run: php ./tempest discovery:status

CHANGELOG.md

Lines changed: 161 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,166 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [1.5.1](https://github.com/tempestphp/tempest-framework/compare/v1.5.0..1.5.1) — 2025-07-29
6+
7+
### 🚀 Features
8+
9+
- **core**: improve exceptions related to internal storage (#1434) ([00caadf](https://github.com/tempestphp/tempest-framework/commit/00caadf2f8d37d927de8f696e035cd446ee2910d))
10+
- **testing**: add view data assertions (#1440) ([f573fd1](https://github.com/tempestphp/tempest-framework/commit/f573fd1cceb29a2a44254422599f03f4858898a9))
11+
- **view**: add csrf token in x-form (#1441) ([e4daa51](https://github.com/tempestphp/tempest-framework/commit/e4daa515e0bdee48179504e9365df1e34eefb019))
12+
13+
14+
## [1.5.0](https://github.com/tempestphp/tempest-framework/compare/v1.4.0..v1.5.0) — 2025-07-28
15+
16+
### 🚨 Breaking changes
17+
18+
- **http**: [**breaking**] add cross-site request forgery protection (#1411) ([2bb4fcf](https://github.com/tempestphp/tempest-framework/commit/2bb4fcf8de8fa774f779d2d77eb031e7a76a94f7))
19+
- **view**: [**breaking**] properly handle scoped view-components (#1435) ([c6237db](https://github.com/tempestphp/tempest-framework/commit/c6237db3b01b9736b27bf22fde1a7ae60a044f05))
20+
- **view**: [**breaking**] support overriding vendor view components (#1439) ([3483fe4](https://github.com/tempestphp/tempest-framework/commit/3483fe4f051035ee025a073ecce1515df1ec31bb))
21+
22+
### 🚀 Features
23+
24+
- **database**: add pagination support (#1417) ([07f9f4d](https://github.com/tempestphp/tempest-framework/commit/07f9f4dddc4949124a57a9ac08d0e1c71b67b1ef))
25+
- **http**: add `csrf_token` function (#1415) ([4386578](https://github.com/tempestphp/tempest-framework/commit/43865783825e953e8eed006ef81ca92d442c2382))
26+
- **kv-store**: introduce key-value store component (#1252) ([daee10d](https://github.com/tempestphp/tempest-framework/commit/daee10dcd19f05248e13c9d08f048fa3989470f2))
27+
- **response**: add a new Response class for json responses (#1423) ([d25bc44](https://github.com/tempestphp/tempest-framework/commit/d25bc4470fd04027edf3b5c37e03464cb69e094f))
28+
- **router**: json serializable as response body (#1420) ([4af4429](https://github.com/tempestphp/tempest-framework/commit/4af44299b02b17689df7a58efd672db7f2423f29))
29+
- **view**: make default slot available as dynamic slot (#1419) ([0f6f261](https://github.com/tempestphp/tempest-framework/commit/0f6f261039e2fcc68a4040586b480587440e2942))
30+
- **view**: add meta command for view components (#1424) ([051078b](https://github.com/tempestphp/tempest-framework/commit/051078b321928cf13a046a296ad889e59f39bba3))
31+
- **view**: add `x-markdown` component (#1430) ([b81b9ed](https://github.com/tempestphp/tempest-framework/commit/b81b9edfbfde5c8c2b65baffb086edcc459674db))
32+
33+
### 🐛 Bug fixes
34+
35+
- **http**: don't cache csrf tokens in views (#1412) ([9db65f0](https://github.com/tempestphp/tempest-framework/commit/9db65f0f58e1724bd9db7bf9257eddd641881ae1))
36+
- **http**: prevent CSRF token variable name collision (#1413) ([361c2fb](https://github.com/tempestphp/tempest-framework/commit/361c2fbf6a39e9a0b17b99fff7e2991a62a85daa))
37+
- **http**: properly handle cookies lifecycle (#1416) ([1089f61](https://github.com/tempestphp/tempest-framework/commit/1089f61c4d72aa4c25b9823b1d84eabe8c77dd97))
38+
- **http**: respect file session locks during reads (#1418) ([55cb06f](https://github.com/tempestphp/tempest-framework/commit/55cb06f6e246c0730e51fdf06f360eef41d27643))
39+
- **mapper**: support casting `bool`, `int`, `float` and enums (#1414) ([c7292e2](https://github.com/tempestphp/tempest-framework/commit/c7292e2f0cd0ff93e1919f94e98ee60f6cdd927a))
40+
- **vite**: prevent syntax errors on prefetching script (#1421) ([15c303e](https://github.com/tempestphp/tempest-framework/commit/15c303e99caf33bbb40322430f3140521ca1785d))
41+
42+
### 🚜 Refactor
43+
44+
- **view**: attach tokens to relevant elements for raw slot content support (#1428) ([47a9ad3](https://github.com/tempestphp/tempest-framework/commit/47a9ad36719f95feabb2704efccfb7a1d68c1819))
45+
- **view**: improve slot importing to prevent view compiler failures (#1431) ([4284e8b](https://github.com/tempestphp/tempest-framework/commit/4284e8bdf65c2c0f9e2078f24aed1bbaf92470da))
46+
47+
48+
## [1.4.0](https://github.com/tempestphp/tempest-framework/compare/v1.3.1..v1.4.0) — 2025-07-17
49+
50+
### 🚀 Features
51+
52+
- **auth**: add class-level permission support (#1405) ([1404246](https://github.com/tempestphp/tempest-framework/commit/14042463f81e6915a61212abaf468a351ca5b2b9))
53+
- **mailer**: introduce mailer component (#1227) ([3f5f31e](https://github.com/tempestphp/tempest-framework/commit/3f5f31eacfc80a6ba8ac724f042eefd5cf8e6412))
54+
- **support**: add json encode/decode to array and string utilities (#1396) ([978bba2](https://github.com/tempestphp/tempest-framework/commit/978bba2d3f5017c4c90920d272c2c3d143aa2485))
55+
- **vite**: inject react refresh when needed (#1406) ([b57bf7f](https://github.com/tempestphp/tempest-framework/commit/b57bf7f9c79179f7135c1eb72894406d80d6a606))
56+
57+
### 🐛 Bug fixes
58+
59+
- **mail**: fix typos (#1410) ([0e29b0e](https://github.com/tempestphp/tempest-framework/commit/0e29b0e83be94a968d4f004d87191ad70b385f3d))
60+
- **mailer**: small tweaks and bugfixes (#1408) ([f80536a](https://github.com/tempestphp/tempest-framework/commit/f80536a5ba5784978df9cad9cc8453be564b0110))
61+
- **vite**: exclude `.tempest` from vite's file watcher (#1384) ([e1bdcf2](https://github.com/tempestphp/tempest-framework/commit/e1bdcf2daedcdd2076b33048de2bcd963a403dca))
62+
63+
64+
## [1.3.0](https://github.com/tempestphp/tempest-framework/compare/v1.2.3..v1.3.0) — 2025-07-10
65+
66+
### 🚀 Features
67+
68+
- **database**: run `migrate:fresh` without validation by default (#1390) ([665c825](https://github.com/tempestphp/tempest-framework/commit/665c825230a6803e0e52a64d08c28623aa267b48))
69+
70+
### 🐛 Bug fixes
71+
72+
- **commandbus**: require console as a dependency (#1397) ([e56cb6d](https://github.com/tempestphp/tempest-framework/commit/e56cb6d72678e632c413c01ba7dc317396f1e7ba))
73+
- **router**: change the `Bindable::resolve` return type from `static` to `self` (#1391) ([3ac0e3a](https://github.com/tempestphp/tempest-framework/commit/3ac0e3aa0489ecd57e0d7dbe23c7e84ad392bfa2))
74+
- **view**: remove multiline comments before AST parsing (#1395) ([f2c03df](https://github.com/tempestphp/tempest-framework/commit/f2c03df89977fdf0008b40c1777f31cde91108ca))
75+
76+
### 🚜 Refactor
77+
78+
- **mapper**: remove redundant string check (#1393) ([9d0bf46](https://github.com/tempestphp/tempest-framework/commit/9d0bf46854e55eb22b9572847c8e000bddd3a2e3))
79+
80+
81+
## [1.2.3](https://github.com/tempestphp/tempest-framework/compare/v1.2.2..v1.2.3) — 2025-07-08
82+
83+
### 🐛 Bug fixes
84+
85+
- **database**: fix datetime serialization for mysql database (#1383) ([dde0e84](https://github.com/tempestphp/tempest-framework/commit/dde0e84a6bba614c4fa3932914ffaee2dd4916e7))
86+
87+
88+
## [1.2.2](https://github.com/tempestphp/tempest-framework/compare/v1.2.1..v1.2.2) — 2025-07-08
89+
90+
### 🚀 Features
91+
92+
- **vite**: make which extensions vite discovers configurable (#1375) ([de2d6d4](https://github.com/tempestphp/tempest-framework/commit/de2d6d41c2a9fedb6282f1d720279ffcd236f313))
93+
94+
### 🐛 Bug fixes
95+
96+
- **http**: allow session id cookies when on a local non-secure host (#1381) ([47e993a](https://github.com/tempestphp/tempest-framework/commit/47e993a291dcd4147ab260bf4715cde1ba2cecd8))
97+
98+
99+
## [1.2.1](https://github.com/tempestphp/tempest-framework/compare/v1.2.0..v1.2.1) — 2025-07-07
100+
101+
### 🐛 Bug fixes
102+
103+
- **http**: register request interface as singleton as soon as possible (#1379) ([b7d1d41](https://github.com/tempestphp/tempest-framework/commit/b7d1d4183f6752c51870e3a80dc9c3adbe200e07))
104+
105+
106+
## [1.2.0](https://github.com/tempestphp/tempest-framework/compare/v1.1.0..v1.2.0) — 2025-07-07
107+
108+
### 🚨 Breaking changes
109+
110+
- **database**: [**breaking**] query builder refactor (#1367) ([21ca22c](https://github.com/tempestphp/tempest-framework/commit/21ca22ca362536d38ca716d53bf793367162d6f8))
111+
- **database**: [**breaking**] remove `ModelDefinition` in favor or `ModelInspector` (#1372) ([7e8bfc6](https://github.com/tempestphp/tempest-framework/commit/7e8bfc6d10779281212292fca759b1fc93b406e7))
112+
113+
### 🚀 Features
114+
115+
- **database**: add `having` and `groupBy` in select query builder (#1370) ([6bf5c06](https://github.com/tempestphp/tempest-framework/commit/6bf5c060d441a9ed99e2a5a401db2e029ee0277a))
116+
- **view**: add view comments (#1356) ([c61519b](https://github.com/tempestphp/tempest-framework/commit/c61519b775b5ec220e8b5c09f9fec25d81b2aec9))
117+
118+
### 🐛 Bug fixes
119+
120+
- **database**: throw `QueryWasInvalid` on database fetch failure (#1371) ([95b660b](https://github.com/tempestphp/tempest-framework/commit/95b660b2b3ccfc4dc447119633437852ba7abca3))
121+
- **http**: use exclusive locks for file session writes (#1366) ([c3c8d03](https://github.com/tempestphp/tempest-framework/commit/c3c8d03073330adc0390dd7c594768a7c20866ea))
122+
- **http**: prevent mapping request data to reserved properties on request objects (#1374) ([96bd1b0](https://github.com/tempestphp/tempest-framework/commit/96bd1b06c34758a74154608558c080fc71e8ba2a))
123+
124+
### 🚜 Refactor
125+
126+
- **filesystem**: switch to the recommended azure blog storage lib (#1363) ([e096186](https://github.com/tempestphp/tempest-framework/commit/e0961865523b9a1ddcaefe5c89e7806c37be53b9))
127+
128+
### ⚡ Performance
129+
130+
- **reflection**: improve class reflector memoization (#1360) ([d8c502d](https://github.com/tempestphp/tempest-framework/commit/d8c502d6cfbb639a5477fab9611724be437e02bd))
131+
132+
133+
## [1.1.0](https://github.com/tempestphp/tempest-framework/compare/v1.0.3..v1.1.0) — 2025-07-05
134+
135+
### 🚀 Features
136+
137+
- **database**: display sqlite path in `about` command (#1353) ([9d8449c](https://github.com/tempestphp/tempest-framework/commit/9d8449c9f2ca2b972e25679e0cbeef11232fb6e4))
138+
- **database**: add database seeder support (#1354) ([0a49e1f](https://github.com/tempestphp/tempest-framework/commit/0a49e1fd9c1af59cd4c8804d0316c8be286e3f14))
139+
- **http**: support implicit host in serve command (#1350) ([ebde2c6](https://github.com/tempestphp/tempest-framework/commit/ebde2c6ea02d5e5d9d46402ff4fe7d44abc0a3fd))
140+
- **session**: add reflash method to session (#1338) ([8e8d839](https://github.com/tempestphp/tempest-framework/commit/8e8d839a6fc7462584fca97415a929ed0dc1485d))
141+
- **validation**: add HexColor validation rule (#1332) ([e9a5a17](https://github.com/tempestphp/tempest-framework/commit/e9a5a170a31216110b97125a4b6f0aaf8cb5f3a3))
142+
143+
### 🐛 Bug fixes
144+
145+
- **core**: fix SkipDiscovery attributes not being detected in vendor packages (#1337) ([b049dd9](https://github.com/tempestphp/tempest-framework/commit/b049dd9eb9ec871437457407ab084f947e60eeec))
146+
- **core**: add missing config cache initializer (#1340) ([bf4770e](https://github.com/tempestphp/tempest-framework/commit/bf4770ea55faa320a3104ce8e3f7cc1fb60c04b9))
147+
- **icon**: enable icon cache by default (#1339) ([34e0d2d](https://github.com/tempestphp/tempest-framework/commit/34e0d2ddce5a17411d24c7ef18c6ca8febc643ba))
148+
- **log**: fix driver resolving not accounting log level (#1343) ([e197b3c](https://github.com/tempestphp/tempest-framework/commit/e197b3c9244a405a07e11418dc1ae90cbe072490))
149+
- **router**: support implicit HEAD requests (#1349) ([f912d6a](https://github.com/tempestphp/tempest-framework/commit/f912d6ab92108b26984aa1fb392569ca99a70f7d))
150+
151+
### 🚜 Refactor
152+
153+
- **core**: consistently use json and filesystem utils (#1330) ([11704f2](https://github.com/tempestphp/tempest-framework/commit/11704f2078f245a6bdb93af7ccc6591b881131de))
154+
155+
### ⚡ Performance
156+
157+
- **core**: improve overall discovery performance (#1333) ([0199fa3](https://github.com/tempestphp/tempest-framework/commit/0199fa30c56a8e5278a278b14b426b4a352816e5))
158+
- **core**: improve config loading performance (#1341) ([d28e896](https://github.com/tempestphp/tempest-framework/commit/d28e89613d1a6c39f367b5d421a11d66ec2b9bc2))
159+
160+
### 🧪 Tests
161+
162+
- **intl**: force `en-US` locale to prevent locale-dependent failures (#1347) ([ef25aa4](https://github.com/tempestphp/tempest-framework/commit/ef25aa4531ccc5271d876447bc94e8b59914109f))
163+
164+
5165
## [1.0.1](https://github.com/tempestphp/tempest-framework/compare/v1.0.0..v1.0.1) — 2025-06-27
6166

7167
### 🚀 Features
@@ -474,7 +634,7 @@ All notable changes to this project will be documented in this file.
474634
- add release script ([e1a1107](https://github.com/tempestphp/tempest-framework/commit/e1a110750c7329c8dcfb05bfc9cc5bfa0152ca8e))
475635

476636

477-
## [1.0.0-alpha.2](https://github.com/tempestphp/tempest-framework/compare/0.0.1..v1.0.0-alpha.2) — 2024-10-04
637+
## 1.0.0-alpha.2 — 2024-10-04
478638

479639
### 🚀 Features
480640

@@ -539,7 +699,3 @@ All notable changes to this project will be documented in this file.
539699
- update console readme (#444) ([7c6f1b0](https://github.com/tempestphp/tempest-framework/commit/7c6f1b083fd429d58cbde2d30b4af2143e9c58f0))
540700

541701

542-
## 0.0.1 — 2024-02-09
543-
544-
545-
<!-- generated by git-cliff -->

bin/release

Lines changed: 50 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use Composer\Semver\VersionParser;
1818
use Tempest\Console\Console;
1919
use Tempest\Console\ConsoleApplication;
2020
use Tempest\Console\Exceptions\InterruptException;
21-
use Tempest\Http\Status;
21+
use Tempest\Http\Response;
2222
use Tempest\HttpClient\HttpClient;
2323
use Tempest\Support\Json;
2424

@@ -168,28 +168,51 @@ function performPreReleaseChecks(string $remote, string $branch): void
168168
}
169169
}
170170

171-
/**
171+
/**
172172
* Disables the protection ruleset, so the release branch can be pushed to without a pull request.
173173
*/
174174
function updateBranchProtection(bool $enabled): void
175175
{
176176
// https://github.com/tempestphp/tempest-framework/settings/rules/1879240
177177
$ruleset = '1879240';
178178
$token = Tempest\env('RELEASE_GITHUB_TOKEN');
179-
$url = "https://api.github.com/repos/tempestphp/tempest-framework/rulesets/{$ruleset}";
179+
$uri = "https://api.github.com/repos/tempestphp/tempest-framework/rulesets/{$ruleset}";
180180

181181
$httpClient = Tempest\get(HttpClient::class);
182182
$response = $httpClient->put(
183-
uri: $url,
183+
uri: $uri,
184184
headers: ['Authorization' => "Bearer {$token}"],
185-
body: Json\encode(['enforcement' => $enabled ? 'active' : 'disabled'])
185+
body: Json\encode(['enforcement' => $enabled ? 'active' : 'disabled']),
186186
);
187187

188-
if ($response->status !== Status::OK) {
188+
if (! $response->status->isSuccessful()) {
189189
throw new Exception('Failed to update branch ruleset.');
190190
}
191191
}
192192

193+
function triggerSubsplit(): void
194+
{
195+
$token = Tempest\env('RELEASE_GITHUB_TOKEN');
196+
$uri = 'https://api.github.com/repos/tempestphp/tempest-framework/actions/workflows/subsplit-packages.yml/dispatches';
197+
198+
$httpClient = Tempest\get(HttpClient::class);
199+
200+
$response = $httpClient->post(
201+
uri: $uri,
202+
headers: [
203+
'Authorization' => "Bearer {$token}",
204+
'Accept' => 'application/vnd.github+json',
205+
'X-GitHub-Api-Version' => '2022-11-28',
206+
],
207+
body: Json\encode(['ref' => 'main']),
208+
);
209+
210+
if (! $response->status->isSuccessful()) {
211+
throw new Exception('Failed to update branch ruleset.');
212+
}
213+
}
214+
215+
193216
/**
194217
* Gets the current version.
195218
*/
@@ -210,9 +233,9 @@ function suggestNextVersions(string $current): array
210233
}
211234

212235
$isStable = ! isset($matches[4]);
213-
$major = (int) $matches[1];
214-
$minor = (int) $matches[2];
215-
$patch = (int) $matches[3];
236+
$major = (int)$matches[1];
237+
$minor = (int)$matches[2];
238+
$patch = (int)$matches[3];
216239

217240
// Current version is stable
218241
if ($isStable) {
@@ -280,8 +303,8 @@ function updateJsonFile(string $path, Closure $callback): void
280303
$content = $callback(json_decode($content, associative: true), $indent);
281304
$content = preg_replace_callback(
282305
'/^ +/m',
283-
fn ($m) => str_repeat($indent, \strlen($m[0]) / 4),
284-
json_encode($content, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES),
306+
fn ($m) => str_repeat($indent, strlen($m[0]) / 4),
307+
json_encode($content, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES),
285308
);
286309

287310
file_put_contents($path, $content . "\n");
@@ -329,13 +352,13 @@ try {
329352
$new = $console->ask(
330353
question: 'What should the new version be?',
331354
options: arr(suggestNextVersions($current))
332-
->map(fn (string $version, string $type) => (string) str($type)->replace('_', ' ')->append(': ', $version))
355+
->map(fn (string $version, string $type) => (string)str($type)->replace('_', ' ')->append(': ', $version))
333356
->values()
334357
->toArray(),
335358
);
336359

337360
$isMajor = str_contains($new, 'major');
338-
$version = (string) str($new)->afterLast(': ');
361+
$version = (string)str($new)->afterLast(': ');
339362
$tag = "v{$version}";
340363

341364
// Check the tag
@@ -349,10 +372,10 @@ try {
349372
// Bump PHP packages
350373
$console->task(
351374
label: 'Bumping PHP packages',
352-
handler: fn () => [
353-
bumpKernelVersion($version),
354-
bumpPhpPackages($version, $isMajor),
355-
],
375+
handler: function () use ($version, $isMajor) {
376+
bumpKernelVersion($version);
377+
bumpPhpPackages($version, $isMajor);
378+
},
356379
);
357380

358381
// Bump JavaScript packages
@@ -373,27 +396,27 @@ try {
373396
// Push tags
374397
$console->task(
375398
label: 'Releasing',
376-
handler: fn () => [
377-
commit("chore: release {$tag}"),
399+
handler: function () use ($tag) {
400+
commit("chore: release {$tag}");
378401
executeCommands([
379402
"git tag {$tag}",
380403
"git push origin tag {$tag}",
381-
]),
382-
],
404+
]);
405+
},
383406
);
384407

385408
// Clean up
386409
$console->task(
387410
label: 'Cleaning up',
388-
handler: fn () => [
389-
cleanUpAfterRelease(),
390-
commit('chore: post-release clean up'),
391-
executeCommands('git push'),
392-
],
411+
handler: function () {
412+
cleanUpAfterRelease();
413+
commit('chore: post-release clean up');
414+
executeCommands('git push');
415+
},
393416
);
394417

395-
// Re-enable protection
396418
updateBranchProtection(enabled: true);
419+
triggerSubsplit();
397420

398421
$console->success(sprintf(
399422
'Released <em>%1$s</em>. The <href="https://github.com/tempestphp/tempest-framework/releases/tag/%1$s">GitHub release</href> will be created automatically in a few seconds.',

bin/validate-packages

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function checkPackageLicense(array $package): void
3333

3434
if (! file_exists($licenseFile)) {
3535
throw new UnexpectedValueException(
36-
sprintf('Package [tempest/%s] is missing it\'s license.', $package['name'])
36+
sprintf('Package [tempest/%s] is missing it\'s license (%s).', $package['name'], $licenseFile)
3737
);
3838
}
3939

0 commit comments

Comments
 (0)