Skip to content

Commit d46c493

Browse files
authored
Merge pull request #27 from jsor-labs/escape-src
Move folder from src/ to the root and split data into several files
2 parents cc5f2f7 + 439af5a commit d46c493

File tree

91 files changed

+155
-153
lines changed

Some content is hidden

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

91 files changed

+155
-153
lines changed

config/berti.config.php

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
}
88

99
return function (Pimple\Container $container) {
10-
$data = include __DIR__ . '/../src/data.php';
11-
12-
$container['react.components'] = function ($container) use ($data) {
10+
$container['react.components'] = function ($container) {
1311
/** @var Github\Client $client */
1412
$client = $container['github.client'];
1513

@@ -44,7 +42,7 @@ function ($version) use ($component) {
4442
Github\HttpClient\Message\ResponseMediator::getContent($response),
4543
$component
4644
);
47-
}, $data['components']);
45+
}, include __DIR__ . '/../data/components.php');
4846
};
4947

5048
$container['react.components_by_category'] = function ($container) {
@@ -62,22 +60,22 @@ function ($version) use ($component) {
6260
return $byCategory;
6361
};
6462

65-
$container['react.built_with'] = function ($container) use ($data) {
63+
$container['react.built_with'] = function ($container) {
6664
/** @var Github\Client $client */
6765
$client = $container['github.client'];
6866

6967
return array_map(function($component) use ($client) {
70-
list($username, $repository) = explode('/', $component['repository']);
68+
[$username, $repository] = explode('/', $component['repository']);
7169

7270
return array_merge(
7371
$client->repo()->show($username, $repository),
7472
$component
7573
);
76-
}, $data['built_with']);
74+
}, include __DIR__ . '/../data/built_with.php');
7775
};
7876

79-
$container['react.articles'] = $data['articles'];
80-
$container['react.talks'] = $data['talks'];
77+
$container['react.articles'] = include __DIR__ . '/../data/articles.php';
78+
$container['react.talks'] = include __DIR__ . '/../data/talks.php';
8179

8280
$container['github.url_generator'] = $container->extend('github.url_generator', function (callable $urlGenerator) {
8381
return function (string $repository, string $url, string $cwd = null) use ($urlGenerator) {
@@ -95,7 +93,7 @@ function ($version) use ($component) {
9593
};
9694
});
9795

98-
$container['template.theme'] = __DIR__ . '/../src/theme';
96+
$container['template.theme'] = __DIR__ . '/../theme';
9997

10098
$container['template.map'] = [
10199
'index.html' => 'homepage.html.twig'
@@ -375,7 +373,7 @@ function ($string) {
375373
$twig->addGlobal(
376374
'asset_manifest',
377375
json_decode(
378-
file_get_contents(__DIR__.'/../src/static-files/assets/manifest.json'),
376+
file_get_contents(__DIR__.'/../static-files/assets/manifest.json'),
379377
true
380378
)
381379
);
@@ -397,7 +395,7 @@ function ($string) {
397395
->files()
398396
->ignoreDotFiles(false)
399397
->notName('.DS_Store')
400-
->in($path . '/src/static-files');
398+
->in($path . '/static-files');
401399
});
402400

403401
$container['document.finder'] = $container->protect(function ($path) {
@@ -408,6 +406,6 @@ function ($string) {
408406
->name('LICENSE')
409407
->files()
410408
->in($path . '/tmp/components')
411-
->in($path . '/src/pages');
409+
->in($path . '/pages');
412410
});
413411
};

config/webpack-dev-server.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ const path = require('path');
22

33
module.exports = {
44
entry: [
5-
path.resolve(process.cwd(), 'src/theme/assets/promise-polyfill.js'),
6-
path.resolve(process.cwd(), 'src/theme/assets/main-critical.js'),
7-
path.resolve(process.cwd(), 'src/theme/assets/main.js')
5+
path.resolve(process.cwd(), 'theme/assets/promise-polyfill.js'),
6+
path.resolve(process.cwd(), 'theme/assets/main-critical.js'),
7+
path.resolve(process.cwd(), 'theme/assets/main.js')
88
],
99
output: {
1010
publicPath: 'http://localhost:8080/_assets/',

config/webpack.config.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ const ManifestPlugin = require('webpack-manifest-plugin');
66
module.exports = {
77
entry: {
88
'main-critical': [
9-
path.resolve(process.cwd(), 'src/theme/assets/webpack-public-path.js'),
10-
path.resolve(process.cwd(), 'src/theme/assets/main-critical.js')
9+
path.resolve(process.cwd(), 'theme/assets/webpack-public-path.js'),
10+
path.resolve(process.cwd(), 'theme/assets/main-critical.js')
1111
],
1212
main: [
13-
path.resolve(process.cwd(), 'src/theme/assets/webpack-public-path.js'),
14-
path.resolve(process.cwd(), 'src/theme/assets/promise-polyfill.js'),
15-
path.resolve(process.cwd(), 'src/theme/assets/main.js')
13+
path.resolve(process.cwd(), 'theme/assets/webpack-public-path.js'),
14+
path.resolve(process.cwd(), 'theme/assets/promise-polyfill.js'),
15+
path.resolve(process.cwd(), 'theme/assets/main.js')
1616
]
1717
},
1818
output: {
19-
path: path.resolve(process.cwd(), 'src/static-files/assets'),
19+
path: path.resolve(process.cwd(), 'static-files/assets'),
2020
filename: '[name].[chunkhash].js',
2121
chunkFilename: '[name].[chunkhash].js'
2222
},

data/articles.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
return [
4+
[
5+
'title' => 'Sergey Zhuk',
6+
'description' => 'A series of articles covering ReactPHP: from the basics to the real application examples.',
7+
'link' => 'http://sergeyzhuk.me/reactphp-series',
8+
],
9+
[
10+
'title' => 'Cees-Jan Kiewiet',
11+
'description' => 'Blog series about several ReactPHP components and how they work.',
12+
'link' => 'http://blog.wyrihaximus.net/categories/reactphp-series/',
13+
],
14+
[
15+
'title' => 'Loïc Faugeron',
16+
'description' => 'Super Speed Symfony - ReactPHP.',
17+
'link' => 'https://gnugat.github.io/2016/04/13/super-speed-sf-react-php.html',
18+
],
19+
[
20+
'title' => 'Marc J. Schmidt',
21+
'description' => 'Bring High Performance Into Your PHP App (with ReactPHP).',
22+
'link' => 'http://marcjschmidt.de/blog/2014/02/08/php-high-performance.html',
23+
],
24+
];

data/built_with.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
return [
4+
[
5+
'title' => 'Thruway',
6+
'repository' => 'voryx/Thruway'
7+
],
8+
[
9+
'title' => 'PPM - PHP Process Manager',
10+
'repository' => 'php-pm/php-pm'
11+
],
12+
[
13+
'title' => 'php-ar-drone',
14+
'repository' => 'jolicode/php-ar-drone'
15+
],
16+
[
17+
'title' => 'Ratchet',
18+
'repository' => 'ratchetphp/Ratchet'
19+
],
20+
[
21+
'title' => 'Predis\Async',
22+
'repository' => 'nrk/predis-async'
23+
],
24+
[
25+
'title' => 'clue/redis-server',
26+
'repository' => 'clue/redis-server'
27+
],
28+
];

data/components.php

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?php
2+
3+
return [
4+
[
5+
'title' => 'EventLoop',
6+
'repository' => 'reactphp/event-loop',
7+
'category' => 'Core Components'
8+
],
9+
[
10+
'title' => 'Stream',
11+
'repository' => 'reactphp/stream',
12+
'category' => 'Core Components'
13+
],
14+
[
15+
'title' => 'Promise',
16+
'repository' => 'reactphp/promise',
17+
'category' => 'Core Components'
18+
],
19+
[
20+
'title' => 'Socket',
21+
'repository' => 'reactphp/socket',
22+
'category' => 'Network Components'
23+
],
24+
[
25+
'title' => 'Datagram',
26+
'repository' => 'reactphp/datagram',
27+
'category' => 'Network Components'
28+
],
29+
[
30+
'title' => 'HTTP',
31+
'repository' => 'reactphp/http',
32+
'category' => 'Protocol Components'
33+
],
34+
[
35+
'title' => 'HTTPClient',
36+
'repository' => 'reactphp/http-client',
37+
'category' => 'Protocol Components'
38+
],
39+
[
40+
'title' => 'DNS',
41+
'repository' => 'reactphp/dns',
42+
'category' => 'Protocol Components'
43+
],
44+
[
45+
'title' => 'Cache',
46+
'repository' => 'reactphp/cache',
47+
'category' => 'Utility Components'
48+
],
49+
[
50+
'title' => 'ChildProcess',
51+
'repository' => 'reactphp/child-process',
52+
'category' => 'Utility Components'
53+
],
54+
[
55+
'title' => 'PromiseTimer',
56+
'repository' => 'reactphp/promise-timer',
57+
'category' => 'Utility Components'
58+
],
59+
[
60+
'title' => 'PromiseStream',
61+
'repository' => 'reactphp/promise-stream',
62+
'category' => 'Utility Components'
63+
],
64+
];

data/talks.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
return [
4+
[
5+
'link' => 'https://www.youtube.com/watch?v=-5ZdGUvOqx4',
6+
'embed_url' => 'https://www.youtube.com/embed/-5ZdGUvOqx4'
7+
],
8+
[
9+
'link' => 'https://www.youtube.com/watch?v=s6xrnYae1FU',
10+
'embed_url' => 'https://www.youtube.com/embed/s6xrnYae1FU'
11+
],
12+
[
13+
'link' => 'https://www.youtube.com/watch?v=MWNcItWuKpI',
14+
'embed_url' => 'https://www.youtube.com/embed/MWNcItWuKpI'
15+
],
16+
];

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
"author": "Jan Sorgalla <[email protected]>",
77
"license": "MIT",
88
"scripts": {
9-
"build": "rimraf ./src/static-files/assets/* && webpack --config ./config/webpack.config.js",
10-
"watch": "rimraf ./src/static-files/assets/* && webpack --config ./config/webpack.config.js --watch",
9+
"build": "rimraf ./static-files/assets/* && webpack --config ./config/webpack.config.js",
10+
"watch": "rimraf ./static-files/assets/* && webpack --config ./config/webpack.config.js --watch",
1111
"dev-server": "webpack-dev-server --config ./config/webpack-dev-server.config.js --hot",
12-
"update-webfonts": "webfont-dl https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700 --out ./src/theme/assets/fonts/fonts.css --woff1=link --woff2=omit --svg=omit --ttf=omit --eot=omit"
12+
"update-webfonts": "webfont-dl https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700 --out ./theme/assets/fonts/fonts.css --woff1=link --woff2=omit --svg=omit --ttf=omit --eot=omit"
1313
},
1414
"browserslist": [
1515
">1%",

src/data.php

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

0 commit comments

Comments
 (0)