Skip to content

Commit 5d3bf81

Browse files
authored
Merge branch 'main' into feature/vite-config-path
2 parents d17b76c + f573fd1 commit 5d3bf81

File tree

118 files changed

+1671
-934
lines changed

Some content is hidden

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

118 files changed

+1671
-934
lines changed

CHANGELOG.md

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,41 @@
22

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

5-
## [1.4.0](https://github.com/tempestphp/tempest-framework/compare/v1.3.1..1.4.0) — 2025-07-17
5+
## [1.5.0](https://github.com/tempestphp/tempest-framework/compare/v1.4.0..1.5.0) — 2025-07-28
6+
7+
### 🚨 Breaking changes
8+
9+
- **http**: [**breaking**] add cross-site request forgery protection (#1411) ([2bb4fcf](https://github.com/tempestphp/tempest-framework/commit/2bb4fcf8de8fa774f779d2d77eb031e7a76a94f7))
10+
- **view**: [**breaking**] properly handle scoped view-components (#1435) ([c6237db](https://github.com/tempestphp/tempest-framework/commit/c6237db3b01b9736b27bf22fde1a7ae60a044f05))
11+
- **view**: [**breaking**] support overriding vendor view components (#1439) ([3483fe4](https://github.com/tempestphp/tempest-framework/commit/3483fe4f051035ee025a073ecce1515df1ec31bb))
12+
13+
### 🚀 Features
14+
15+
- **database**: add pagination support (#1417) ([07f9f4d](https://github.com/tempestphp/tempest-framework/commit/07f9f4dddc4949124a57a9ac08d0e1c71b67b1ef))
16+
- **http**: add `csrf_token` function (#1415) ([4386578](https://github.com/tempestphp/tempest-framework/commit/43865783825e953e8eed006ef81ca92d442c2382))
17+
- **kv-store**: introduce key-value store component (#1252) ([daee10d](https://github.com/tempestphp/tempest-framework/commit/daee10dcd19f05248e13c9d08f048fa3989470f2))
18+
- **response**: add a new Response class for json responses (#1423) ([d25bc44](https://github.com/tempestphp/tempest-framework/commit/d25bc4470fd04027edf3b5c37e03464cb69e094f))
19+
- **router**: json serializable as response body (#1420) ([4af4429](https://github.com/tempestphp/tempest-framework/commit/4af44299b02b17689df7a58efd672db7f2423f29))
20+
- **view**: make default slot available as dynamic slot (#1419) ([0f6f261](https://github.com/tempestphp/tempest-framework/commit/0f6f261039e2fcc68a4040586b480587440e2942))
21+
- **view**: add meta command for view components (#1424) ([051078b](https://github.com/tempestphp/tempest-framework/commit/051078b321928cf13a046a296ad889e59f39bba3))
22+
- **view**: add `x-markdown` component (#1430) ([b81b9ed](https://github.com/tempestphp/tempest-framework/commit/b81b9edfbfde5c8c2b65baffb086edcc459674db))
23+
24+
### 🐛 Bug fixes
25+
26+
- **http**: don't cache csrf tokens in views (#1412) ([9db65f0](https://github.com/tempestphp/tempest-framework/commit/9db65f0f58e1724bd9db7bf9257eddd641881ae1))
27+
- **http**: prevent CSRF token variable name collision (#1413) ([361c2fb](https://github.com/tempestphp/tempest-framework/commit/361c2fbf6a39e9a0b17b99fff7e2991a62a85daa))
28+
- **http**: properly handle cookies lifecycle (#1416) ([1089f61](https://github.com/tempestphp/tempest-framework/commit/1089f61c4d72aa4c25b9823b1d84eabe8c77dd97))
29+
- **http**: respect file session locks during reads (#1418) ([55cb06f](https://github.com/tempestphp/tempest-framework/commit/55cb06f6e246c0730e51fdf06f360eef41d27643))
30+
- **mapper**: support casting `bool`, `int`, `float` and enums (#1414) ([c7292e2](https://github.com/tempestphp/tempest-framework/commit/c7292e2f0cd0ff93e1919f94e98ee60f6cdd927a))
31+
- **vite**: prevent syntax errors on prefetching script (#1421) ([15c303e](https://github.com/tempestphp/tempest-framework/commit/15c303e99caf33bbb40322430f3140521ca1785d))
32+
33+
### 🚜 Refactor
34+
35+
- **view**: attach tokens to relevant elements for raw slot content support (#1428) ([47a9ad3](https://github.com/tempestphp/tempest-framework/commit/47a9ad36719f95feabb2704efccfb7a1d68c1819))
36+
- **view**: improve slot importing to prevent view compiler failures (#1431) ([4284e8b](https://github.com/tempestphp/tempest-framework/commit/4284e8bdf65c2c0f9e2078f24aed1bbaf92470da))
37+
38+
39+
## [1.4.0](https://github.com/tempestphp/tempest-framework/compare/v1.3.1..v1.4.0) — 2025-07-17
640

741
### 🚀 Features
842

@@ -591,7 +625,7 @@ All notable changes to this project will be documented in this file.
591625
- add release script ([e1a1107](https://github.com/tempestphp/tempest-framework/commit/e1a110750c7329c8dcfb05bfc9cc5bfa0152ca8e))
592626

593627

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

596630
### 🚀 Features
597631

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

658692

659-
## 0.0.1 — 2024-02-09
660-
661-
662-
<!-- generated by git-cliff -->

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"giggsey/libphonenumber-for-php-lite": "^9.0",
1818
"guzzlehttp/guzzle": "^7.8.2",
1919
"laminas/laminas-diactoros": "^3.3",
20+
"league/commonmark": "^2.7",
2021
"league/flysystem": "^3.29.1",
2122
"monolog/monolog": "^3.7.0",
2223
"nette/php-generator": "^4.1.6",

packages/console/src/Components/Interactive/MultipleChoiceComponent.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ private function getControls(): array
7373
...(
7474
$this->bufferEnabled
7575
? [
76-
'esc' => 'select',
76+
'esc or /' => 'select',
7777
] : [
7878
'/' => 'filter',
7979
'space' => 'select',
@@ -110,6 +110,11 @@ public function input(string $key): void
110110
$this->bufferEnabled = true;
111111
$this->updateQuery();
112112

113+
return;
114+
} elseif ($this->bufferEnabled && $key === '/') {
115+
$this->bufferEnabled = false;
116+
$this->updateQuery();
117+
113118
return;
114119
}
115120

packages/console/src/Components/Interactive/SingleChoiceComponent.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ private function getControls(): array
7474
$controls = [];
7575

7676
if ($this->bufferEnabled) {
77-
$controls['esc'] = 'select';
77+
$controls['esc or /'] = 'select';
7878
} else {
7979
$controls['/'] = 'filter';
8080
$controls['space'] = 'select';
@@ -114,6 +114,10 @@ public function input(string $key): void
114114
if (! $this->bufferEnabled && $key === '/') {
115115
$this->bufferEnabled = true;
116116

117+
return;
118+
} elseif ($this->bufferEnabled && $key === '/') {
119+
$this->bufferEnabled = false;
120+
117121
return;
118122
}
119123

packages/console/src/HasConsole.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,13 @@ public function keyValue(string $key, ?string $value = null): self
144144
return $this;
145145
}
146146

147+
public function header(string $header, ?string $subheader = null): self
148+
{
149+
$this->console->header($header, $subheader);
150+
151+
return $this;
152+
}
153+
147154
public function task(string $label, null|Process|Closure $handler): bool
148155
{
149156
return $this->console->task($label, $handler);

packages/core/src/FrameworkKernel.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,15 @@ public function registerInternalStorage(): self
168168
$path = $this->root . '/.tempest';
169169

170170
if (! is_dir($path)) {
171-
mkdir($path, recursive: true);
171+
if (file_exists($path)) {
172+
throw new \RuntimeException('Unable to create internal storage directory, as a file with the same name (.tempest) already exists.');
173+
}
174+
175+
if (! mkdir($path, recursive: true)) {
176+
throw new \RuntimeException('Unable to create internal storage directory because of insufficient user permission on the root directory.');
177+
}
178+
} elseif (! is_writable($path)) {
179+
throw new \RuntimeException('Insufficient user permission to write to internal storage directory.');
172180
}
173181

174182
$this->internalStorage = realpath($path);

packages/core/src/Kernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
interface Kernel
1010
{
11-
public const string VERSION = '1.4.0';
11+
public const string VERSION = '1.5.0';
1212

1313
public string $root {
1414
get;

packages/discovery/src/DiscoveryLocation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function __construct(
2323

2424
public function isVendor(): bool
2525
{
26-
return str_contains($this->path, '/vendor/') || str_contains($this->path, '\\vendor\\');
26+
return str_contains($this->path, '/vendor/') || str_contains($this->path, '\\vendor\\') || str_starts_with($this->namespace, 'Tempest');
2727
}
2828

2929
public function toClassName(string $path): string

packages/http/src/Session/CsrfTokenComponent.php

Lines changed: 0 additions & 25 deletions
This file was deleted.

packages/http/src/Session/Session.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,17 @@ public function get(string $key, mixed $default = null): mixed
8383
return $value;
8484
}
8585

86+
/** @return \Tempest\Validation\Rule[] */
87+
public function getErrorsFor(string $name): array
88+
{
89+
return $this->get(self::VALIDATION_ERRORS)[$name] ?? [];
90+
}
91+
92+
public function getOriginalValueFor(string $name, mixed $default = ''): mixed
93+
{
94+
return $this->get(self::ORIGINAL_VALUES)[$name] ?? $default;
95+
}
96+
8697
public function getPreviousUrl(): string
8798
{
8899
return $this->get(self::PREVIOUS_URL, default: '');

0 commit comments

Comments
 (0)