Skip to content

Commit afdf222

Browse files
committed
configuring CI for new libraries, various tweaks, README
1 parent c76583e commit afdf222

Some content is hidden

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

49 files changed

+1753
-454
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: 40 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,10 +105,31 @@ 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
92124
steps:
93125
- uses: actions/checkout@master
94126
- run: yarn
95127
- run: yarn test
128+
129+
- name: Verify dist files are up to date
130+
run: |
131+
if [ -z "$(git status --porcelain)" ]; then
132+
exit 0
133+
else
134+
exit 1
135+
fi

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/.github/workflows/ci.yml

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

src/LiveComponent/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2004-2021 Fabien Potencier
3+
Copyright (c) 2021 Fabien Potencier
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)