Browse Source

add homepage && add style and js root && add css autoprefixer to yarn #3

Laszlo Lang 3 months ago
parent
commit
734bbaa631

+ 7
- 0
assets/css/app.scss View File

@@ -0,0 +1,7 @@
1
+@-ms-viewport{
2
+  width: device-width;
3
+}
4
+
5
+* {
6
+  box-sizing: border-box;
7
+}

+ 3
- 3
config/routes.yaml View File

@@ -1,3 +1,3 @@
1
-#index:
2
-#    path: /
3
-#    controller: App\Controller\DefaultController::index
1
+index:
2
+    path: /
3
+    controller: App\Controller\DefaultController::index

+ 4
- 1
package.json View File

@@ -1,7 +1,9 @@
1 1
 {
2 2
     "devDependencies": {
3 3
         "@symfony/webpack-encore": "^0.19.0",
4
+        "autoprefixer": "^9.1.1",
4 5
         "node-sass": "^4.9.3",
6
+        "postcss-loader": "^3.0.0",
5 7
         "sass-loader": "^7.1.0",
6 8
         "webpack-notifier": "^1.6.0"
7 9
     },
@@ -15,5 +17,6 @@
15 17
     },
16 18
     "dependencies": {
17 19
         "@fortawesome/fontawesome-free": "^5.2.0"
18
-    }
20
+    },
21
+    "browserslist": [ "last 7 versions", "ios >= 7" ]
19 22
 }

+ 9
- 0
postcss.config.js View File

@@ -0,0 +1,9 @@
1
+module.exports = {
2
+    plugins: {
3
+        // include whatever plugins you want
4
+        // but make sure you install these via yarn or npm!
5
+
6
+        // add browserslist config to package.json (see below)
7
+        autoprefixer: {}
8
+    }
9
+};

+ 21
- 0
src/Controller/DefaultController.php View File

@@ -0,0 +1,21 @@
1
+<?php
2
+
3
+namespace App\Controller;
4
+
5
+use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
6
+
7
+/**
8
+ * Class DefaultController
9
+ *
10
+ * @package App\Controller
11
+ * @author  system7 <https://www.laszlolang.com>
12
+ */
13
+class DefaultController extends AbstractController
14
+{
15
+    public function index()
16
+    {
17
+        return $this->render('default/index.html.twig', [
18
+            'controller_name' => 'DefaultController',
19
+        ]);
20
+    }
21
+}

+ 4
- 0
templates/base.html.twig View File

@@ -2,6 +2,10 @@
2 2
 <html>
3 3
     <head>
4 4
         <meta charset="UTF-8">
5
+        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
6
+        <meta name="author" content="https://www.laszlolang.com"/>
7
+        <meta name="viewport" content="width=device-width, initial-scale=1"/>
8
+        <meta name="description" content="It is our choices that define us."/>
5 9
         <title>{% block title %}Welcome!{% endblock %}</title>
6 10
         {% block stylesheets %}{% endblock %}
7 11
     </head>

+ 15
- 0
templates/default/index.html.twig View File

@@ -0,0 +1,15 @@
1
+{% extends 'base.html.twig' %}
2
+
3
+{% block title %}SplendidBear Websites{% endblock %}
4
+
5
+{% block body %}
6
+
7
+{% endblock %}
8
+
9
+{% block stylesheets %}
10
+    <link rel="stylesheet" media="screen" href="{{ asset('build/style.css') }}">
11
+{% endblock %}
12
+
13
+{% block javascripts %}
14
+    <script type="text/javascript" language="JavaScript" src="{{ asset('build/app.js') }}"></script>
15
+{% endblock %}

+ 9
- 1
webpack.config.js View File

@@ -26,7 +26,7 @@ Encore
26 26
      * and one CSS file (e.g. app.css) if you JavaScript imports CSS.
27 27
      */
28 28
     .addEntry('app', './assets/js/app.js')
29
-    .addStyleEntry('appStyle', './assets/css/app.scss')
29
+    .addStyleEntry('style', './assets/css/app.scss')
30 30
 
31 31
     /*
32 32
      * FEATURE CONFIG
@@ -46,6 +46,14 @@ Encore
46 46
     // enables Sass/SCSS support
47 47
     .enableSassLoader()
48 48
 
49
+    // enable autoprefixer
50
+    .enablePostCssLoader((options) => {
51
+        options.config = {
52
+            path: 'config/postcss.config.js'
53
+        };
54
+    })
55
+    .enablePostCssLoader()
56
+
49 57
 // uncomment if you use TypeScript
50 58
 //.enableTypeScriptLoader()
51 59
 ;

+ 115
- 3
yarn.lock View File

@@ -92,6 +92,10 @@ adjust-sourcemap-loader@^1.1.0:
92 92
     object-path "^0.9.2"
93 93
     regex-parser "^2.2.9"
94 94
 
95
+ajv-errors@^1.0.0:
96
+  version "1.0.0"
97
+  resolved "https://registry.yarnpkg.com/ajv-errors/-/ajv-errors-1.0.0.tgz#ecf021fa108fd17dfb5e6b383f2dd233e31ffc59"
98
+
95 99
 ajv-keywords@^3.1.0:
96 100
   version "3.2.0"
97 101
   resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.2.0.tgz#e86b819c602cf8821ad637413698f1dec021847a"
@@ -296,6 +300,17 @@ autoprefixer@^6.3.1:
296 300
     postcss "^5.2.16"
297 301
     postcss-value-parser "^3.2.3"
298 302
 
303
+autoprefixer@^9.1.1:
304
+  version "9.1.1"
305
+  resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-9.1.1.tgz#e4ffa96c71270b8a1967d1542abc5f8453920a77"
306
+  dependencies:
307
+    browserslist "^4.0.2"
308
+    caniuse-lite "^1.0.30000876"
309
+    normalize-range "^0.1.2"
310
+    num2fraction "^1.2.2"
311
+    postcss "^7.0.2"
312
+    postcss-value-parser "^3.2.3"
313
+
299 314
 aws-sign2@~0.7.0:
300 315
   version "0.7.0"
301 316
   resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8"
@@ -953,6 +968,14 @@ browserslist@^3.2.6:
953 968
     caniuse-lite "^1.0.30000844"
954 969
     electron-to-chromium "^1.3.47"
955 970
 
971
+browserslist@^4.0.2:
972
+  version "4.0.2"
973
+  resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.0.2.tgz#294388f5844bb3ab15ef7394ca17f49bf7a4e6f1"
974
+  dependencies:
975
+    caniuse-lite "^1.0.30000876"
976
+    electron-to-chromium "^1.3.57"
977
+    node-releases "^1.0.0-alpha.11"
978
+
956 979
 buffer-indexof@^1.0.0:
957 980
   version "1.1.1"
958 981
   resolved "https://registry.yarnpkg.com/buffer-indexof/-/buffer-indexof-1.1.1.tgz#52fabcc6a606d1a00302802648ef68f639da268c"
@@ -1031,7 +1054,7 @@ caniuse-db@^1.0.30000529, caniuse-db@^1.0.30000634, caniuse-db@^1.0.30000639:
1031 1054
   version "1.0.30000877"
1032 1055
   resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000877.tgz#29ea435fdbe8a671cc5b027a75e28a816c17c340"
1033 1056
 
1034
-caniuse-lite@^1.0.30000844:
1057
+caniuse-lite@^1.0.30000844, caniuse-lite@^1.0.30000876:
1035 1058
   version "1.0.30000877"
1036 1059
   resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000877.tgz#f189673b86ecc06436520e3e391de6a13ca923b4"
1037 1060
 
@@ -1295,6 +1318,15 @@ core-util-is@1.0.2, core-util-is@~1.0.0:
1295 1318
   version "1.0.2"
1296 1319
   resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
1297 1320
 
1321
+cosmiconfig@^4.0.0:
1322
+  version "4.0.0"
1323
+  resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-4.0.0.tgz#760391549580bbd2df1e562bc177b13c290972dc"
1324
+  dependencies:
1325
+    is-directory "^0.3.1"
1326
+    js-yaml "^3.9.0"
1327
+    parse-json "^4.0.0"
1328
+    require-from-string "^2.0.1"
1329
+
1298 1330
 create-ecdh@^4.0.0:
1299 1331
   version "4.0.3"
1300 1332
   resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.3.tgz#c9111b6f33045c4697f144787f9254cdc77c45ff"
@@ -1664,7 +1696,7 @@ ee-first@1.1.1:
1664 1696
   version "1.1.1"
1665 1697
   resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
1666 1698
 
1667
-electron-to-chromium@^1.2.7, electron-to-chromium@^1.3.47:
1699
+electron-to-chromium@^1.2.7, electron-to-chromium@^1.3.47, electron-to-chromium@^1.3.57:
1668 1700
   version "1.3.58"
1669 1701
   resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.58.tgz#8267a4000014e93986d9d18c65a8b4022ca75188"
1670 1702
 
@@ -1707,7 +1739,7 @@ errno@^0.1.3:
1707 1739
   dependencies:
1708 1740
     prr "~1.0.1"
1709 1741
 
1710
-error-ex@^1.2.0:
1742
+error-ex@^1.2.0, error-ex@^1.3.1:
1711 1743
   version "1.3.2"
1712 1744
   resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf"
1713 1745
   dependencies:
@@ -1811,6 +1843,10 @@ esprima@^2.6.0:
1811 1843
   version "2.7.3"
1812 1844
   resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581"
1813 1845
 
1846
+esprima@^4.0.0:
1847
+  version "4.0.1"
1848
+  resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
1849
+
1814 1850
 esrecurse@^4.1.0:
1815 1851
   version "4.2.1"
1816 1852
   resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf"
@@ -2503,6 +2539,18 @@ ignore-walk@^3.0.1:
2503 2539
   dependencies:
2504 2540
     minimatch "^3.0.4"
2505 2541
 
2542
+import-cwd@^2.0.0:
2543
+  version "2.1.0"
2544
+  resolved "https://registry.yarnpkg.com/import-cwd/-/import-cwd-2.1.0.tgz#aa6cf36e722761285cb371ec6519f53e2435b0a9"
2545
+  dependencies:
2546
+    import-from "^2.1.0"
2547
+
2548
+import-from@^2.1.0:
2549
+  version "2.1.0"
2550
+  resolved "https://registry.yarnpkg.com/import-from/-/import-from-2.1.0.tgz#335db7f2a7affd53aaa471d4b8021dee36b7f3b1"
2551
+  dependencies:
2552
+    resolve-from "^3.0.0"
2553
+
2506 2554
 import-local@^1.0.0:
2507 2555
   version "1.0.0"
2508 2556
   resolved "https://registry.yarnpkg.com/import-local/-/import-local-1.0.0.tgz#5e4ffdc03f4fe6c009c6729beb29631c2f8227bc"
@@ -2647,6 +2695,10 @@ is-descriptor@^1.0.0, is-descriptor@^1.0.2:
2647 2695
     is-data-descriptor "^1.0.0"
2648 2696
     kind-of "^6.0.2"
2649 2697
 
2698
+is-directory@^0.3.1:
2699
+  version "0.3.1"
2700
+  resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1"
2701
+
2650 2702
 is-dotfile@^1.0.0:
2651 2703
   version "1.0.3"
2652 2704
   resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1"
@@ -2833,6 +2885,13 @@ js-tokens@^3.0.2:
2833 2885
   version "3.0.2"
2834 2886
   resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
2835 2887
 
2888
+js-yaml@^3.9.0:
2889
+  version "3.12.0"
2890
+  resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1"
2891
+  dependencies:
2892
+    argparse "^1.0.7"
2893
+    esprima "^4.0.0"
2894
+
2836 2895
 js-yaml@~3.7.0:
2837 2896
   version "3.7.0"
2838 2897
   resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.7.0.tgz#5c967ddd837a9bfdca5f2de84253abe8a1c03b80"
@@ -2856,6 +2915,10 @@ json-loader@^0.5.4:
2856 2915
   version "0.5.7"
2857 2916
   resolved "https://registry.yarnpkg.com/json-loader/-/json-loader-0.5.7.tgz#dca14a70235ff82f0ac9a3abeb60d337a365185d"
2858 2917
 
2918
+json-parse-better-errors@^1.0.1:
2919
+  version "1.0.2"
2920
+  resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9"
2921
+
2859 2922
 json-schema-traverse@^0.3.0:
2860 2923
   version "0.3.1"
2861 2924
   resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340"
@@ -3424,6 +3487,12 @@ node-pre-gyp@^0.10.0:
3424 3487
     semver "^5.3.0"
3425 3488
     tar "^4"
3426 3489
 
3490
+node-releases@^1.0.0-alpha.11:
3491
+  version "1.0.0-alpha.11"
3492
+  resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.0.0-alpha.11.tgz#73c810acc2e5b741a17ddfbb39dfca9ab9359d8a"
3493
+  dependencies:
3494
+    semver "^5.3.0"
3495
+
3427 3496
 node-sass@^4.9.3:
3428 3497
   version "4.9.3"
3429 3498
   resolved "https://registry.yarnpkg.com/node-sass/-/node-sass-4.9.3.tgz#f407cf3d66f78308bb1e346b24fa428703196224"
@@ -3694,6 +3763,13 @@ parse-json@^2.2.0:
3694 3763
   dependencies:
3695 3764
     error-ex "^1.2.0"
3696 3765
 
3766
+parse-json@^4.0.0:
3767
+  version "4.0.0"
3768
+  resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0"
3769
+  dependencies:
3770
+    error-ex "^1.3.1"
3771
+    json-parse-better-errors "^1.0.1"
3772
+
3697 3773
 parseurl@~1.3.2:
3698 3774
   version "1.3.2"
3699 3775
   resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3"
@@ -3866,6 +3942,22 @@ postcss-filter-plugins@^2.0.0:
3866 3942
   dependencies:
3867 3943
     postcss "^5.0.4"
3868 3944
 
3945
+postcss-load-config@^2.0.0:
3946
+  version "2.0.0"
3947
+  resolved "https://registry.yarnpkg.com/postcss-load-config/-/postcss-load-config-2.0.0.tgz#f1312ddbf5912cd747177083c5ef7a19d62ee484"
3948
+  dependencies:
3949
+    cosmiconfig "^4.0.0"
3950
+    import-cwd "^2.0.0"
3951
+
3952
+postcss-loader@^3.0.0:
3953
+  version "3.0.0"
3954
+  resolved "https://registry.yarnpkg.com/postcss-loader/-/postcss-loader-3.0.0.tgz#6b97943e47c72d845fa9e03f273773d4e8dd6c2d"
3955
+  dependencies:
3956
+    loader-utils "^1.1.0"
3957
+    postcss "^7.0.0"
3958
+    postcss-load-config "^2.0.0"
3959
+    schema-utils "^1.0.0"
3960
+
3869 3961
 postcss-merge-idents@^2.1.5:
3870 3962
   version "2.1.7"
3871 3963
   resolved "https://registry.yarnpkg.com/postcss-merge-idents/-/postcss-merge-idents-2.1.7.tgz#4c5530313c08e1d5b3bbf3d2bbc747e278eea270"
@@ -4051,6 +4143,14 @@ postcss@^6.0.1:
4051 4143
     source-map "^0.6.1"
4052 4144
     supports-color "^5.4.0"
4053 4145
 
4146
+postcss@^7.0.0, postcss@^7.0.2:
4147
+  version "7.0.2"
4148
+  resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.2.tgz#7b5a109de356804e27f95a960bef0e4d5bc9bb18"
4149
+  dependencies:
4150
+    chalk "^2.4.1"
4151
+    source-map "^0.6.1"
4152
+    supports-color "^5.4.0"
4153
+
4054 4154
 prepend-http@^1.0.0:
4055 4155
   version "1.0.4"
4056 4156
   resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc"
@@ -4415,6 +4515,10 @@ require-directory@^2.1.1:
4415 4515
   version "2.1.1"
4416 4516
   resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
4417 4517
 
4518
+require-from-string@^2.0.1:
4519
+  version "2.0.2"
4520
+  resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909"
4521
+
4418 4522
 require-main-filename@^1.0.1:
4419 4523
   version "1.0.1"
4420 4524
   resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1"
@@ -4533,6 +4637,14 @@ schema-utils@^0.3.0:
4533 4637
   dependencies:
4534 4638
     ajv "^5.0.0"
4535 4639
 
4640
+schema-utils@^1.0.0:
4641
+  version "1.0.0"
4642
+  resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-1.0.0.tgz#0b79a93204d7b600d4b2850d1f66c2a34951c770"
4643
+  dependencies:
4644
+    ajv "^6.1.0"
4645
+    ajv-errors "^1.0.0"
4646
+    ajv-keywords "^3.1.0"
4647
+
4536 4648
 scss-tokenizer@^0.2.3:
4537 4649
   version "0.2.3"
4538 4650
   resolved "https://registry.yarnpkg.com/scss-tokenizer/-/scss-tokenizer-0.2.3.tgz#8eb06db9a9723333824d3f5530641149847ce5d1"