Skip to content

Commit 88e96fd

Browse files
authored
More dependencies (#2)
* Added some dependencies * Added mercure config * Add some small CI * Install webpack
1 parent 6eed578 commit 88e96fd

24 files changed

+732
-95
lines changed

.env

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,16 @@ APP_SECRET=1a9dfc83d27556f6cf6add5b65aed37e
3131
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
3232
# DATABASE_URL="mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7"
3333
DATABASE_URL="postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=13&charset=utf8"
34+
DATABASE_PASSWORD=db_password
3435
###< doctrine/doctrine-bundle ###
36+
37+
HTTP_PORT=80
38+
###> symfony/mercure-bundle ###
39+
# See https://symfony.com/doc/current/mercure.html#configuration
40+
# The URL of the Mercure hub, used by the app to publish updates (can be a local URL)
41+
MERCURE_URL=https://127.0.0.1:8000/.well-known/mercure
42+
# The public URL of the Mercure hub, used by the browser to connect
43+
MERCURE_PUBLIC_URL=https://127.0.0.1:8000/.well-known/mercure
44+
# The secret used to sign the JWTs
45+
MERCURE_JWT_SECRET="!ChangeMe!"
46+
###< symfony/mercure-bundle ###

.github/workflows/.editorconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[*.yml]
2+
indent_size = 2

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: CI
2+
3+
on:
4+
push: ~
5+
pull_request: ~
6+
7+
jobs:
8+
build:
9+
name: Test
10+
runs-on: Ubuntu-20.04
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: Set up PHP
17+
uses: shivammathur/setup-php@v2
18+
with:
19+
php-version: 8.0
20+
coverage: none
21+
22+
- name: Download dependencies
23+
uses: ramsey/composer-install@v1
24+
25+
- name: Run tests
26+
run: ./bin/console cache:warmup --env dev

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,10 @@
1414
.phpunit.result.cache
1515
/phpunit.xml
1616
###< symfony/phpunit-bridge ###
17+
18+
###> symfony/webpack-encore-bundle ###
19+
/node_modules/
20+
/public/build/
21+
npm-debug.log
22+
yarn-error.log
23+
###< symfony/webpack-encore-bundle ###

assets/app.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* Welcome to your app's main JavaScript file!
3+
*
4+
* We recommend including the built version of this JavaScript file
5+
* (and its CSS file) in your base layout (base.html.twig).
6+
*/
7+
8+
// any CSS you import will output into a single css file (app.css in this case)
9+
import './styles/app.css';
10+
11+
// start the Stimulus application
12+
import './bootstrap';

assets/bootstrap.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { startStimulusApp } from '@symfony/stimulus-bridge';
2+
3+
// Registers Stimulus controllers from controllers.json and in the controllers/ directory
4+
export const app = startStimulusApp(require.context(
5+
'@symfony/stimulus-bridge/lazy-controller-loader!./controllers',
6+
true,
7+
/\.(j|t)sx?$/
8+
));
9+
10+
// register any custom, 3rd party controllers here
11+
// app.register('some_controller_name', SomeImportedController);

assets/controllers.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"controllers": [],
3+
"entrypoints": []
4+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { Controller } from 'stimulus';
2+
3+
/*
4+
* This is an example Stimulus controller!
5+
*
6+
* Any element with a data-controller="hello" attribute will cause
7+
* this controller to be executed. The name "hello" comes from the filename:
8+
* hello_controller.js -> "hello"
9+
*
10+
* Delete this file or adapt it for your use!
11+
*/
12+
export default class extends Controller {
13+
connect() {
14+
this.element.textContent = 'Hello Stimulus! Edit me in assets/controllers/hello_controller.js';
15+
}
16+
}

assets/css/.gitignore

Whitespace-only changes.

assets/images/.gitignore

Whitespace-only changes.

assets/js/.gitignore

Whitespace-only changes.

assets/styles/app.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
body {
2+
background-color: lightgray;
3+
}

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
"symfony/http-client": "4.4.*",
2323
"symfony/intl": "4.4.*",
2424
"symfony/mailer": "4.4.*",
25+
"symfony/mercure-bundle": "^0.3.2",
26+
"symfony/messenger": "4.4.*",
2527
"symfony/monolog-bundle": "^3.1",
2628
"symfony/process": "4.4.*",
2729
"symfony/property-access": "4.4.*",
@@ -33,6 +35,7 @@
3335
"symfony/twig-bundle": "^4.4",
3436
"symfony/validator": "4.4.*",
3537
"symfony/web-link": "4.4.*",
38+
"symfony/webpack-encore-bundle": "^1.11",
3639
"symfony/yaml": "4.4.*",
3740
"twig/extra-bundle": "^2.12|^3.0",
3841
"twig/twig": "^2.12|^3.0"

0 commit comments

Comments
 (0)