Skip to content

Commit 5649a0e

Browse files
committed
updating ux.symfony.com live demos for new changes
1 parent ef0a2fe commit 5649a0e

File tree

5 files changed

+36
-5
lines changed

5 files changed

+36
-5
lines changed

ux.symfony.com/bin/link-locally

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env php
2+
<?php
3+
4+
use Symfony\Component\Finder\Finder;
5+
6+
require __DIR__.'/../vendor/autoload.php';
7+
$composerData = json_decode(file_get_contents(__DIR__.'/../composer.json'), true);
8+
9+
$finder = new Finder();
10+
$finder->in(__DIR__.'/../../src')
11+
->depth('== 0')
12+
->directories();
13+
14+
$repositories = [];
15+
foreach ($finder as $packageDirectory) {
16+
$repositories[] = [
17+
'type' => 'path',
18+
'url' => $packageDirectory->getRealPath()
19+
];
20+
}
21+
$composerData['repositories'] = $repositories;
22+
23+
foreach ($composerData['require'] as $package => $version) {
24+
if (!str_starts_with($package, 'symfony/ux-')) {
25+
continue;
26+
}
27+
28+
$composerData['require'][$package] = '2.x-dev';
29+
}
30+
31+
file_put_contents(__DIR__.'/../composer.json', json_encode($composerData, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES));
32+
echo "composer.json updatded to point to local UX packages\n";
33+
echo "Run 'composer update' then 'yarn install --force'\n";
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{# See src/Form/MealPlannerForm.php for the form magic #}
22
<div
33
{{ attributes }}
4-
data-action="change->live#update"
54
>
65
{{ form_start(form) }}
7-
{{ form_widget(form) }}
6+
{{ form_row(form.meal) }}
7+
{{ form_row(form.mainFood) }}
88
{{ form_end(form) }}
99
</div>

ux.symfony.com/templates/components/registration_form.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<div
22
{{ attributes }}
3-
data-action="change->live#update"
43
>
54
{% if isSuccessful %}
65
<div>Welcome {{ newUserEmail}}!</div>
@@ -9,6 +8,7 @@
98
novalidate
109
data-action="live#action"
1110
data-action-name="prevent|saveRegistration"
11+
data-model="on(change)|*"
1212
>
1313
{{ form_row(form.email) }}
1414
{{ form_row(form.password) }}

ux.symfony.com/templates/components/search_packages.html.twig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
type="text"
44
data-model="query"
55
value="{{ query }}"
6-
data-action="live#update"
76
placeholder="Results update as you type..."
87
class="form-control"
98
>

ux.symfony.com/templates/components/todo_list_form.html.twig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<div
22
{{ attributes }}
3-
{{ stimulus_action('live', 'update', 'change') }}
43
>
54
{{ form_start(form) }}
65
<div class="row">

0 commit comments

Comments
 (0)