8000 feature #101 TwigComponent & LiveComponent Packages (weaverryan) · symfony/ux@372fca9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 372fca9

Browse files
committed
feature #101 TwigComponent & LiveComponent Packages (weaverryan)
This PR was squashed before being merged into the main branch. Discussion ---------- TwigComponent & LiveComponent Packages | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | Tickets | none | License | MIT Introducing 2 new packages: TwigComponent and LiveComponent Commits ------- 006ee2d removing clean check for now afdf222 configuring CI for new libraries, various tweaks, README c76583e Initial commit of symfony/ux-live-component 5677db1 Initial commit of symfony/ux-twig-component
2 parents ddd7953 + 006ee2d commit 372fca9

File tree

98 files changed

+940 8000 0
-1
lines changed

Some content is hidden

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

98 files changed

+9400
-1
lines changed

.github/build-packages.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
$dir = __DIR__.'/../src/LiveComponent';
4+
$flags = JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE;
5+
6+
$json = ltrim(file_get_contents($dir.'/composer.json'));
7+
if (null === $package = json_decode($json)) {
8+
passthru("composer validate $dir/composer.json");
9+
exit(1);
10+
}
11+
12+
$package->repositories[] = [
13+
'type' => 'path',
14+
'url' => '../TwigComponent',
15+
];
16+
17+
$json = preg_replace('/\n "repositories": \[\n.*?\n \],/s', '', $json);
18+
$json = rtrim(json_encode(['repositories' => $package->repositories], $flags), "\n}").','.substr($json, 1);
19+
$json = preg_replace('/"symfony\/ux-twig-component": "(\^[\d]+\.[\d]+)"/s', '"symfony/ux-twig-component": "@dev"', $json);
20+
file_put_contents($dir.'/composer.json', $json);
21+

.github/workflows/test.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,25 @@ jobs:
5454
cd src/LazyImage
5555
composer update --prefer-lowest --prefer-dist --no-interaction --no-ansi --no-progress
5656
php vendor/bin/simple-phpunit
57+
- name: TwigComponent
58+
run: |
59+
cd src/TwigComponent
60+
composer update --prefer-lowest --prefer-dist --no-interaction --no-ansi --no-progress
61+
php vendor/bin/simple-phpunit
62+
63+
tests-php-low-deps-74:
64+
runs-on: ubuntu-latest
65+
steps:
66+
- uses: actions/checkout@master
67+
- uses: shivammathur/setup-php@v2
68+
with:
69+
php-version: '7.4'
70+
- name: LiveComponent
71+
run: |
72+
cd src/LiveComponent
73+
php ../../.github/build-packages.php
74+
composer update --prefer-lowest --prefer-dist --no-interaction --no-ansi --no-progress
75+
php vendor/bin/simple-phpunit
5776
5877
tests-php-high-deps:
5978
runs-on: ubuntu-latest
@@ -86,6 +105,19 @@ jobs:
86105
composer config platform.php 7.4.99
87106
composer update --prefer-dist --no-interaction --no-ansi --no-progress
88107
php vendor/bin/simple-phpunit
108+
- name: TwigComponent
109+
run: |
110+
cd src/TwigComponent
111+
composer config platform.php 7.4.99
112+
composer update --prefer-dist --no-interaction --no-ansi --no-progress
113+
php vendor/bin/simple-phpunit
114+
- name: LiveComponent
115+
run: |
116+
cd src/LiveComponent
117+
php ../../.github/build-packages.php
118+
composer config platform.php 7.4.99
119+
composer update --prefer-dist --no-interaction --no-ansi --no-progress
120+
php vendor/bin/simple-phpunit
89121
90122
tests-js:
91123
runs-on: ubuntu-latest

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ integrating it into [Webpack Encore](https://github.com/symfony/webpack-encore).
3434
Improve image loading performances through lazy-loading and data-uri thumbnails
3535
- [UX Swup](https://github.com/symfony/ux-swup):
3636
[Swup](https://swup.js.org/) page transition library integration for Symfony
37+
- [Twig Component](https://github.com/symfony/ux-twig-component):
38+
A system to build reusable "components" with Twig
39+
- [Live Component](https://github.com/symfony/ux-live-component):
40+
Gives Twig Components a URL and a JavaScript library to automatically re-render via Ajax as your user interacts with it
3741

3842
## Stimulus Tools around the World
3943

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"private": true,
33
"workspaces": [
4-
"src/**/Resources/assets"
4+
"src/**/Resources/assets",
5+
"src/**/assets"
56
],
67
"scripts": {
78
"build": "yarn workspaces run build",

src/LiveComponent/.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/.github export-ignore
2+
/tests export-ignore

src/LiveComponent/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/composer.lock
2+
/phpunit.xml
3+
/vendor/
4+
/var/
5+
/.phpunit.result.cache

src/LiveComponent/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Fabien Potencier
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is furnished
10+
to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

0 commit comments

Comments
 (0)
0