Skip to content

Commit c76583e

Browse files
weaverryankbond
andcommitted
Initial commit of symfony/ux-live-component
Co-authored-by: Kevin Bond <kevinbond@gmail.com>
1 parent 5677db1 commit c76583e

Some content is hidden

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

47 files changed

+5297
-0
lines changed

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
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
tests:
9+
name: PHP ${{ matrix.php }}, SF ${{ matrix.symfony }} - ${{ matrix.stability }}
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
php: [7.4, 8.0]
14+
stability: [hightest]
15+
symfony: [4.4.*, 5.2.*, 5.3.*]
16+
include:
17+
- php: 7.4
18+
stability: lowest
19+
symfony: '*'
20+
- php: 8.0
21+
stability: highest
22+
symfony: '5.4.*@dev'
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v2.3.3
26+
27+
- name: Setup PHP
28+
uses: shivammathur/setup-php@2.7.0
29+
with:
30+
php-version: ${{ matrix.php }}
31+
coverage: none
32+
33+
- name: Install Symfony Flex
34+
run: composer global require --no-progress --no-scripts --no-plugins symfony/flex dev-main
35+
36+
- name: Set minimum-stability to dev
37+
run: composer config minimum-stability dev
38+
if: ${{ contains(matrix.symfony, '@dev') }}
39+
40+
- name: Install dependencies
41+
uses: ramsey/composer-install@v1
42+
with:
43+
dependency-versions: ${{ matrix.stability }}
44+
composer-options: --prefer-dist
45+
env:
46+
SYMFONY_REQUIRE: ${{ matrix.symfony }}
47+
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
48+
49+
- name: Test
50+
run: vendor/bin/simple-phpunit -v
51+
52+
javascript_tests:
53+
name: JavaScript ${{ matrix.node }}
54+
runs-on: ubuntu-latest
55+
strategy:
56+
matrix:
57+
node: [12, 14, 16]
58+
steps:
59+
- name: Checkout code
60+
uses: actions/checkout@v2.3.3
61+
62+
- name: Install dependencies
63+
working-directory: assets
64+
run: yarn
65+
66+
- name: Build dist file
67+
working-directory: assets
68+
run: yarn build
69+
70+
- name: Verify dist files are up to date
71+
working-directory: assets
72+
run: |
73+
if [ -z "$(git status --porcelain)" ]; then
74+
exit 0
75+
else
76+
exit 1
77+
fi
78+
79+
- name: Run Tests
80+
working-directory: assets
81+
run: yarn test-only

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) 2004-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.

src/LiveComponent/assets/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/node_modules/

src/LiveComponent/assets/.npmignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.babelrc
2+
.gitignore
3+
yarn.lock
4+
/.git
5+
/node_modules
6+
/test

src/LiveComponent/assets/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Live Stimulus
2+
3+
## Installation
4+
5+
Install the library:
6+
7+
```
8+
composer require @symfony/ux-live-component
9+
```
10+
11+
Re-install your assets:
12+
13+
```
14+
yarn install --force
15+
```
16+
17+
Now, register the new controller with Stimulus.
18+
19+
**Symfony:**
20+
21+
```diff
22+
// assets/bootstrap.js
23+
import { startStimulusApp } from '@symfony/stimulus-bridge';
24+
// ...
25+
26+
+import LiveController from '@symfony/ux-live-component';
27+
+app.register('live', LiveController);
28+
29+
+// import some minor CSS
30+
+import '@symfony/ux-live-component/styles/live.css';
31+
```
32+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"presets": [
3+
[
4+
"@babel/env",
5+
{
6+
"targets": {
7+
"node": "current",
8+
"ie": "11"
9+
},
10+
"useBuiltIns": "entry",
11+
"corejs": "3.14.0"
12+
}
13+
]
14+
],
15+
"plugins": [
16+
"@babel/plugin-proposal-class-properties"
17+
]
18+
}

0 commit comments

Comments
 (0)