generator-folklore 3.0.5 → 3.0.7
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/generators/build/index.js +1 -1
- package/lib/generators/eslint/index.js +1 -1
- package/lib/generators/intl/index.js +93 -0
- package/lib/generators/laravel-mediatheque/index.js +151 -0
- package/lib/generators/laravel-mediatheque/instructions/ServiceProvider.php +26 -0
- package/lib/generators/laravel-mediatheque/templates/app/Models/Media.php +9 -0
- package/lib/generators/laravel-mediatheque/templates/app/Models/MediaFile.php +9 -0
- package/lib/generators/laravel-panneau/index.js +89 -28
- package/lib/generators/laravel-panneau/instructions/ServiceProvider.php +21 -0
- package/lib/generators/laravel-panneau/instructions/config.php +13 -0
- package/lib/generators/laravel-panneau/templates/app/Contracts/Repositories/Pages.php +19 -0
- package/lib/generators/laravel-panneau/templates/app/Contracts/Resources/Blocks/Image.php +15 -0
- package/lib/generators/laravel-panneau/templates/app/Contracts/Resources/Blocks/Text.php +12 -0
- package/lib/generators/laravel-panneau/templates/app/Contracts/Resources/Page.php +10 -0
- package/lib/generators/laravel-panneau/templates/app/Contracts/Resources/Pages/Home.php +9 -0
- package/lib/generators/laravel-panneau/templates/app/Http/Resources/BlockResource.php +37 -0
- package/lib/generators/laravel-panneau/templates/app/Http/Resources/BlocksCollection.php +8 -0
- package/lib/generators/laravel-panneau/templates/app/Http/Resources/PageResource.php +47 -0
- package/lib/generators/laravel-panneau/templates/app/Http/Resources/PagesCollection.php +10 -0
- package/lib/generators/laravel-panneau/templates/app/Models/Block.php +4 -13
- package/lib/generators/laravel-panneau/templates/app/Models/Page.php +3 -60
- package/lib/generators/laravel-panneau/templates/app/Panneau/Composers/AppComposer.php +50 -0
- package/lib/generators/laravel-panneau/templates/app/{Schemas → Panneau}/Fields/.gitkeep +0 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Controllers/AccountController.php +41 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Controllers/Controller.php +19 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Controllers/HomeController.php +16 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Controllers/PagesController.php +24 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Controllers/UploadController.php +27 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Controllers/UsersController.php +32 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Requests/AccountUpdateRequest.php +29 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Requests/UploadRequest.php +29 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Resources/BlockResource.php +39 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Resources/BlocksCollection.php +10 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Resources/PageResource.php +56 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Resources/PagesCollection.php +10 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Resources/UserResource.php +24 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Resources/UsersCollection.php +10 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/PanneauServiceProvider.php +74 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Policies/PanneauPolicy.php +32 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Resources/Blocks/ImageBlock.php +30 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Resources/Blocks/TextBlock.php +28 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Resources/Blocks.php +45 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Resources/Pages/Page.php +28 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Resources/Pages.php +92 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Resources/Users.php +57 -0
- package/lib/generators/laravel-panneau/templates/app/Repositories/Pages.php +42 -0
- package/lib/generators/laravel-panneau/templates/app/Resources/Blocks/ImageBlock.php +27 -0
- package/lib/generators/laravel-panneau/templates/app/Resources/Blocks/TextBlock.php +19 -0
- package/lib/generators/laravel-panneau/templates/app/Resources/Page.php +10 -0
- package/lib/generators/laravel-panneau/templates/app/Resources/Pages/HomePage.php +10 -0
- package/lib/generators/laravel-panneau/templates/app.blade.php +8 -0
- package/lib/generators/laravel-panneau/templates/config.php +29 -0
- package/lib/generators/laravel-panneau/templates/index.js +32 -0
- package/lib/generators/laravel-panneau/templates/lang/en/panneau.php +66 -0
- package/lib/generators/laravel-panneau/templates/lang/fr/panneau.php +66 -0
- package/lib/generators/laravel-panneau/templates/layout.blade.php +17 -48
- package/lib/generators/laravel-panneau/templates/resources/assets/js/components/Panneau.jsx +68 -0
- package/lib/generators/laravel-panneau/templates/resources/assets/js/components/panneau/fields/PageSlug.jsx +68 -0
- package/lib/generators/laravel-panneau/templates/resources/assets/js/components/panneau/fields/PageSlugLocalized.jsx +43 -0
- package/lib/generators/laravel-panneau/templates/resources/assets/js/components/panneau/fields/index.js +2 -0
- package/lib/generators/laravel-panneau/templates/resources/assets/styles/panneau.scss +2 -0
- package/lib/generators/laravel-panneau/templates/routes.php +30 -0
- package/lib/generators/laravel-project/index.js +519 -0
- package/lib/generators/laravel-project/templates/env +41 -0
- package/lib/generators/laravel-project/templates/laravel/app/Composers/AppComposer.php +48 -0
- package/lib/generators/laravel-project/templates/laravel/app/Composers/IntlComposer.php +10 -0
- package/lib/generators/laravel-project/templates/laravel/app/Composers/MetaComposer.php +48 -0
- package/lib/generators/laravel-project/templates/laravel/app/Composers/RoutesComposer.php +19 -0
- package/lib/generators/laravel-project/templates/laravel/app/Contracts/Repositories/Users.php +17 -0
- package/lib/generators/laravel-project/templates/laravel/app/Contracts/Resources/User.php +10 -0
- package/lib/generators/laravel-project/templates/laravel/app/Http/Controllers/HomeController.php +18 -0
- package/lib/generators/laravel-project/templates/laravel/app/Http/Middleware/TrustProxies.php +28 -0
- package/lib/generators/laravel-project/templates/laravel/app/Http/Resources/UserResource.php +21 -0
- package/lib/generators/laravel-project/templates/laravel/app/Models/User.php +20 -0
- package/lib/generators/laravel-project/templates/laravel/app/Providers/AppServiceProvider.php +120 -0
- package/lib/generators/laravel-project/templates/laravel/app/Providers/RouteServiceProvider.php +64 -0
- package/lib/generators/laravel-project/templates/laravel/app/Providers/ViewServiceProvider.php +33 -0
- package/lib/generators/laravel-project/templates/laravel/app/Repositories/Users.php +37 -0
- package/lib/generators/laravel-project/templates/laravel/app/Resources/User.php +11 -0
- package/lib/generators/laravel-project/templates/laravel/config/app.php +216 -0
- package/lib/generators/laravel-project/templates/laravel/config/auth.php +116 -0
- package/lib/generators/laravel-project/templates/laravel/config/image.php +204 -0
- package/lib/generators/laravel-project/templates/laravel/config/services.php +39 -0
- package/lib/generators/laravel-project/templates/laravel/lang/en/content.php +5 -0
- package/lib/generators/laravel-project/templates/laravel/lang/en/errors.php +17 -0
- package/lib/generators/laravel-project/templates/laravel/lang/en/meta.php +11 -0
- package/lib/generators/laravel-project/templates/laravel/lang/en/routes.php +4 -0
- package/lib/generators/laravel-project/templates/laravel/lang/fr/auth.php +19 -0
- package/lib/generators/laravel-project/templates/laravel/lang/fr/content.php +5 -0
- package/lib/generators/laravel-project/templates/laravel/lang/fr/errors.php +17 -0
- package/lib/generators/laravel-project/templates/laravel/lang/fr/meta.php +11 -0
- package/lib/generators/laravel-project/templates/laravel/lang/fr/pagination.php +19 -0
- package/lib/generators/laravel-project/templates/laravel/lang/fr/passwords.php +22 -0
- package/lib/generators/laravel-project/templates/laravel/lang/fr/routes.php +12 -0
- package/lib/generators/laravel-project/templates/laravel/lang/fr/validation.php +146 -0
- package/lib/generators/laravel-project/templates/laravel/resources/assets/fonts/.gitkeep +0 -0
- package/lib/generators/laravel-project/templates/laravel/resources/assets/img/.gitkeep +0 -0
- package/lib/generators/laravel-project/templates/laravel/resources/assets/img/folklore.png +0 -0
- package/lib/generators/laravel-project/templates/laravel/resources/views/analytics/body.blade.php +3 -0
- package/lib/generators/laravel-project/templates/laravel/resources/views/analytics/gpt.blade.php +16 -0
- package/lib/generators/laravel-project/templates/laravel/resources/views/analytics/head.blade.php +1 -0
- package/lib/generators/laravel-project/templates/laravel/resources/views/app.blade.php +8 -0
- package/lib/generators/laravel-project/templates/laravel/resources/views/errors/401.blade.php +8 -0
- package/lib/generators/laravel-project/templates/laravel/resources/views/errors/403.blade.php +8 -0
- package/lib/generators/laravel-project/templates/laravel/resources/views/errors/404.blade.php +8 -0
- package/lib/generators/laravel-project/templates/laravel/resources/views/errors/500.blade.php +8 -0
- package/lib/generators/laravel-project/templates/laravel/resources/views/layout.blade.php +33 -0
- package/lib/generators/laravel-project/templates/laravel/resources/views/meta/all.blade.php +4 -0
- package/lib/generators/laravel-project/templates/laravel/resources/views/meta/base.blade.php +11 -0
- package/lib/generators/laravel-project/templates/laravel/resources/views/meta/facebook.blade.php +4 -0
- package/lib/generators/laravel-project/templates/laravel/resources/views/meta/opengraph.blade.php +9 -0
- package/lib/generators/laravel-project/templates/laravel/resources/views/meta/twitter.blade.php +5 -0
- package/lib/generators/laravel-project/templates/laravel/routes/web.php +12 -0
- package/lib/generators/prettier/index.js +1 -1
- package/lib/generators/react-app/index.js +2 -2
- package/lib/generators/react-app/templates/src/components/App.jsx +3 -2
- package/lib/generators/react-app/templates/src/components/pages/Error.jsx +2 -2
- package/lib/generators/stylelint/index.js +1 -1
- package/lib/lib/generator.js +9 -0
- package/package.json +5 -4
- package/lib/generators/laravel-panneau/templates/_composer.json +0 -6
- package/lib/generators/laravel-panneau/templates/_package.json +0 -11
- package/lib/generators/laravel-panneau/templates/app/Http/Controllers/Panneau/HomeController.php +0 -14
- package/lib/generators/laravel-panneau/templates/app/Http/Controllers/Panneau/PagesController.php +0 -11
- package/lib/generators/laravel-panneau/templates/app/Models/Mediatheque/File.php +0 -13
- package/lib/generators/laravel-panneau/templates/app/Models/Mediatheque/Picture.php +0 -13
- package/lib/generators/laravel-panneau/templates/app/Models/Mediatheque/Video.php +0 -34
- package/lib/generators/laravel-panneau/templates/app/Providers/PanneauServiceProvider.php +0 -23
- package/lib/generators/laravel-panneau/templates/app/Reducers/SlugExtractReducer.php +0 -18
- package/lib/generators/laravel-panneau/templates/app/Resources/Pages.php +0 -54
- package/lib/generators/laravel-panneau/templates/app/Schemas/Blocks/Base.php +0 -22
- package/lib/generators/laravel-panneau/templates/app/Schemas/Bubbles/Base.php +0 -22
- package/lib/generators/laravel-panneau/templates/app/Schemas/Pages/Base.php +0 -36
- package/lib/generators/laravel-panneau/templates/resources/lang/en/panneau.php +0 -12
- package/lib/generators/laravel-panneau/templates/resources/lang/fr/panneau.php +0 -12
Binary file
|
package/lib/generators/laravel-project/templates/laravel/resources/views/analytics/gpt.blade.php
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
@if(!empty($tagManagerId) && (!isset($body) || !$body))
|
2
|
+
<!-- Google Tag Manager -->
|
3
|
+
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
4
|
+
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
5
|
+
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
6
|
+
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
7
|
+
})(window,document,'script','dataLayer','{{ $tagManagerId }}');</script>
|
8
|
+
<!-- End Google Tag Manager -->
|
9
|
+
@endif
|
10
|
+
|
11
|
+
@if (!empty($tagManagerId) && isset($body) && $body)
|
12
|
+
<!-- Google Tag Manager (noscript) -->
|
13
|
+
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-P2CF52F"
|
14
|
+
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
|
15
|
+
<!-- End Google Tag Manager (noscript) -->
|
16
|
+
@endif
|
package/lib/generators/laravel-project/templates/laravel/resources/views/analytics/head.blade.php
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
@include('analytics.gpt')
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<!--[if IE ]> <html class="ie" lang="{{ $locale }}"> <![endif]-->
|
3
|
+
<!--[if !(IE) ]><!--> <html lang="{{ $locale }}"> <!--<![endif]-->
|
4
|
+
<head>
|
5
|
+
<meta charset="utf-8">
|
6
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
8
|
+
|
9
|
+
@include('meta.all')
|
10
|
+
|
11
|
+
@include('analytics.head')
|
12
|
+
|
13
|
+
@if(!isset($inWebpack) || !$inWebpack)
|
14
|
+
@include('assets.head')
|
15
|
+
@endif
|
16
|
+
</head>
|
17
|
+
<body>
|
18
|
+
@include('analytics.body')
|
19
|
+
|
20
|
+
@section('body')
|
21
|
+
<div id="app"></div>
|
22
|
+
<script type="text/javascript">
|
23
|
+
var props = @json($props);
|
24
|
+
</script>
|
25
|
+
@show
|
26
|
+
|
27
|
+
@if(isset($inWebpack) && $inWebpack)
|
28
|
+
<script type="text/javascript" src="/static/js/bundle.js"></script>
|
29
|
+
@else
|
30
|
+
@include('assets.body')
|
31
|
+
@endif
|
32
|
+
</body>
|
33
|
+
</html>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<title>{{ $title }}</title>
|
2
|
+
|
3
|
+
<meta name="language" content="{{ $locale }}">
|
4
|
+
<meta name="description" content="{{ $description }}" data-react-helmet="true">
|
5
|
+
|
6
|
+
@if (isset($keywords) && sizeof($keywords))
|
7
|
+
<meta name="keywords" content="{{ $keywords->implode(',') }}" data-react-helmet="true">
|
8
|
+
@endif
|
9
|
+
|
10
|
+
<link rel="shortcut icon" href="{{ asset('static/media/favicon/favicon.ico') }}" type="image/x-ico" data-react-helmet="true">
|
11
|
+
<link rel="icon" href="{{ asset('static/media/favicon/favicon.png') }}" type="image/png" data-react-helmet="true">
|
package/lib/generators/laravel-project/templates/laravel/resources/views/meta/opengraph.blade.php
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
<!-- Open Graph -->
|
2
|
+
<meta property="og:locale" content="{{$locale}}">
|
3
|
+
<meta property="og:title" content="{{ $title }}" data-react-helmet="true">
|
4
|
+
<meta property="og:type" content="website" data-react-helmet="true">
|
5
|
+
<meta property="og:description" content="{{ $description }}" data-react-helmet="true">
|
6
|
+
<meta property="og:url" content="{{ $url }}" data-react-helmet="true">
|
7
|
+
@if(isset($image))
|
8
|
+
<meta property="og:image" content="{{ $image }}" data-react-helmet="true">
|
9
|
+
@endif
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<?php
|
2
|
+
|
3
|
+
use App\Http\Controllers\HomeController;
|
4
|
+
|
5
|
+
//Redirect to current langage home
|
6
|
+
Route::get('/', [HomeController::class, 'redirect'])->name('home');
|
7
|
+
|
8
|
+
Route::groupWithLocales(function () {
|
9
|
+
Route::getTrans('/', [HomeController::class, 'index'])->nameWithLocale('home');
|
10
|
+
Route::getTrans('/test', [HomeController::class, 'index'])->nameWithLocale('test');
|
11
|
+
Route::getTrans('/test/{with_param}', [HomeController::class, 'index'])->nameWithLocale('test_with_param');
|
12
|
+
});
|
@@ -31,7 +31,7 @@ module.exports = class PrettierGenerator extends _generator.default {
|
|
31
31
|
},
|
32
32
|
|
33
33
|
dependencies() {
|
34
|
-
this.addDevDependencies(['prettier', '@prettier/plugin-php', '@trivago/prettier-plugin-sort-imports']);
|
34
|
+
this.addDevDependencies(['prettier@^2.0.0', '@prettier/plugin-php@^0.18.0', '@trivago/prettier-plugin-sort-imports@^3.0.0']);
|
35
35
|
}
|
36
36
|
|
37
37
|
};
|
@@ -108,8 +108,8 @@ module.exports = class ReactAppGenerator extends _generator.default {
|
|
108
108
|
},
|
109
109
|
|
110
110
|
dependencies() {
|
111
|
-
this.addDependencies(['react', 'react-dom', 'prop-types', 'react-intl', 'react-router', 'react-router-dom', 'react-helmet', 'classnames', '@folklore/routes', '@folklore/fonts', '@folklore/forms', '@folklore/fetch', '@folklore/hooks', '@folklore/tracking', // Polyfills
|
112
|
-
'intl', '@formatjs/intl-locale', '@formatjs/intl-pluralrules', 'intersection-observer', 'resize-observer-polyfill']);
|
111
|
+
this.addDependencies(['react@^18.0.0', 'react-dom@^18.0.0', 'prop-types@^15.0.0', 'react-intl@^6.0.0', 'react-router@^6.0.0', 'react-router-dom@^6.0.0', 'react-helmet@^6.0.0', 'classnames@^2.0.0', '@folklore/routes@^0.1.0', '@folklore/fonts@^0.0.1', '@folklore/forms@^0.0.1', '@folklore/fetch@^0.1.0', '@folklore/hooks@^0.0.1', '@folklore/tracking@^0.0.1', // Polyfills
|
112
|
+
'intl@^1.0.0', '@formatjs/intl-locale@^3.0.0', '@formatjs/intl-pluralrules@^5.0.0', 'intersection-observer@^0.12.0', 'resize-observer-polyfill@1.0.0']);
|
113
113
|
}
|
114
114
|
|
115
115
|
};
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
// import PropTypes from 'prop-types';
|
3
3
|
import { Route, Routes } from 'react-router-dom';
|
4
|
+
import { useRoutes } from '@folklore/routes';
|
4
5
|
|
5
6
|
// import { useUrlGenerator } from '@folklore/routes';
|
6
7
|
// import * as AppPropTypes from '../lib/PropTypes';
|
@@ -15,11 +16,11 @@ const propTypes = {};
|
|
15
16
|
const defaultProps = {};
|
16
17
|
|
17
18
|
function App() {
|
18
|
-
|
19
|
+
const routes = useRoutes() || {};
|
19
20
|
return (
|
20
21
|
<Routes>
|
21
22
|
<Route
|
22
|
-
path=
|
23
|
+
path={routes.home || '/'}
|
23
24
|
exact
|
24
25
|
element={
|
25
26
|
<MainLayout>
|
@@ -78,7 +78,7 @@ const defaultProps = {
|
|
78
78
|
};
|
79
79
|
|
80
80
|
function ErrorPage({ statusCode }) {
|
81
|
-
const
|
81
|
+
const url = useUrlGenerator();
|
82
82
|
return (
|
83
83
|
<div className={styles.container}>
|
84
84
|
<PageMeta title={messages[`metaTitle${statusCode || 404}`]} />
|
@@ -90,7 +90,7 @@ function ErrorPage({ statusCode }) {
|
|
90
90
|
<FormattedMessage {...messages[`description${statusCode || 404}`]} />
|
91
91
|
</p>
|
92
92
|
<div className={styles.actions}>
|
93
|
-
<Link to={
|
93
|
+
<Link to={url('home')}>
|
94
94
|
<FormattedMessage {...messages.gotoHome} />
|
95
95
|
</Link>
|
96
96
|
</div>
|
@@ -37,7 +37,7 @@ module.exports = class StylelintGenerator extends _generator.default {
|
|
37
37
|
},
|
38
38
|
|
39
39
|
dependencies() {
|
40
|
-
this.addDevDependencies(['stylelint', 'stylelint-config-standard-scss', 'stylelint-config-idiomatic-order', 'stylelint-config-prettier']);
|
40
|
+
this.addDevDependencies(['stylelint@^14.0.0', 'stylelint-config-standard-scss@^5.0.0', 'stylelint-config-idiomatic-order@^8.0.0', 'stylelint-config-prettier@^9.0.0']);
|
41
41
|
}
|
42
42
|
|
43
43
|
};
|
package/lib/lib/generator.js
CHANGED
@@ -25,12 +25,21 @@ class Generator extends _yeomanGenerator.default {
|
|
25
25
|
|
26
26
|
constructor(args, options) {
|
27
27
|
super(args, options);
|
28
|
+
this._composerJson = null;
|
28
29
|
this.option('quiet', {
|
29
30
|
type: Boolean,
|
30
31
|
defaults: false
|
31
32
|
});
|
32
33
|
}
|
33
34
|
|
35
|
+
get composerJson() {
|
36
|
+
if (!this._composerJson) {
|
37
|
+
this._composerJson = this.createStorage('composer.json');
|
38
|
+
}
|
39
|
+
|
40
|
+
return this._composerJson;
|
41
|
+
}
|
42
|
+
|
34
43
|
getConfig() {
|
35
44
|
const configPath = Generator.getConfigPath();
|
36
45
|
return this.fs.exists(configPath) ? this.fs.readJSON(configPath) : {};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "generator-folklore",
|
3
|
-
"version": "3.0.
|
3
|
+
"version": "3.0.7",
|
4
4
|
"description": "Yeoman generator for projects at Folklore",
|
5
5
|
"keywords": [
|
6
6
|
"yeoman-generator"
|
@@ -9,9 +9,9 @@
|
|
9
9
|
"scripts": {
|
10
10
|
"clean:lib": "rm -rf lib/*",
|
11
11
|
"clean": "npm run clean:lib",
|
12
|
-
"copy:
|
12
|
+
"copy:dirs": "find src/ -type d | grep -E '(/templates|/instructions)$' | sed 's/src\\/\\///g' | xargs -I{} cp -r \"src/{}\" \"lib/{}\"",
|
13
13
|
"compile": "../../node_modules/.bin/babel -d lib/ src/",
|
14
|
-
"build": "npm run compile && npm run copy:
|
14
|
+
"build": "npm run compile && npm run copy:dirs",
|
15
15
|
"test": "echo \"Error: no test specified\" && exit 1",
|
16
16
|
"prepare": "npm run clean && npm run build"
|
17
17
|
},
|
@@ -31,6 +31,7 @@
|
|
31
31
|
"dependencies": {
|
32
32
|
"chalk": "^4.0.0",
|
33
33
|
"change-case": "^4.1.2",
|
34
|
+
"cli-highlight": "^2.1.11",
|
34
35
|
"glob": "^7.2.0",
|
35
36
|
"immutable": "^4.0.0",
|
36
37
|
"is-utf8": "^0.2.1",
|
@@ -39,5 +40,5 @@
|
|
39
40
|
"yeoman-generator": "^5.6.1",
|
40
41
|
"yeoman-remote": "^1.0.1"
|
41
42
|
},
|
42
|
-
"gitHead": "
|
43
|
+
"gitHead": "bc3878a65d256dd8742a6deea2699252d4a4dfb0"
|
43
44
|
}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"scripts": {
|
3
|
-
"build:panneau": "node ./build/scripts/build.js --config ./resources/assets/vendor/panneau/webpack.config.js",
|
4
|
-
"build:site": "node ./build/scripts/build.js --config ./build/webpack.config.prod.js",
|
5
|
-
"build": "node ./build/scripts/build.js --config ./resources/assets/vendor/panneau/webpack.config.js --config ./build/webpack.config.prod.js",
|
6
|
-
"server:panneau": "node ./build/scripts/server.js --config ./resources/assets/vendor/panneau/webpack.config.js",
|
7
|
-
"server:site": "node ./build/scripts/server.js --config ./build/webpack.config.dev.js",
|
8
|
-
"server": "node ./build/scripts/server.js --config ./resources/assets/vendor/panneau/webpack.config.js --config ./build/webpack.config.dev.js",
|
9
|
-
"start": "npm run server"
|
10
|
-
}
|
11
|
-
}
|
package/lib/generators/laravel-panneau/templates/app/Http/Controllers/Panneau/HomeController.php
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
<?php
|
2
|
-
|
3
|
-
namespace App\Http\Controllers\Panneau;
|
4
|
-
|
5
|
-
use Illuminate\Http\Request;
|
6
|
-
use Folklore\Panneau\Http\Controllers\HomeController as BaseHomeController;
|
7
|
-
|
8
|
-
class HomeController extends BaseHomeController
|
9
|
-
{
|
10
|
-
public function index(Request $request)
|
11
|
-
{
|
12
|
-
return redirect()->route('panneau.resource.index', ['pages']);
|
13
|
-
}
|
14
|
-
}
|
@@ -1,34 +0,0 @@
|
|
1
|
-
<?php
|
2
|
-
|
3
|
-
namespace App\Models\Mediatheque;
|
4
|
-
|
5
|
-
use Folklore\Mediatheque\Models\Video as BaseVideo;
|
6
|
-
|
7
|
-
class Video extends BaseVideo
|
8
|
-
{
|
9
|
-
protected $hidden = [
|
10
|
-
'pivot',
|
11
|
-
];
|
12
|
-
|
13
|
-
protected $appends = [
|
14
|
-
'original_file',
|
15
|
-
'thumbnails',
|
16
|
-
'url',
|
17
|
-
'duration_human',
|
18
|
-
'type',
|
19
|
-
'mp4_url',
|
20
|
-
'thumbnail'
|
21
|
-
];
|
22
|
-
|
23
|
-
protected function getMp4UrlAttribute()
|
24
|
-
{
|
25
|
-
$mp4 = $this->files->mp4;
|
26
|
-
return !is_null($mp4) ? $mp4->url : $this->url;
|
27
|
-
}
|
28
|
-
|
29
|
-
protected function getThumbnailAttribute()
|
30
|
-
{
|
31
|
-
$thumbnails = $this->getThumbnails();
|
32
|
-
return sizeof($thumbnails) ? image()->url($thumbnails[0]->getUrl(), ['thumbnail']) : null;
|
33
|
-
}
|
34
|
-
}
|
@@ -1,23 +0,0 @@
|
|
1
|
-
<?php
|
2
|
-
|
3
|
-
namespace App\Providers;
|
4
|
-
|
5
|
-
use Illuminate\Support\Facades\Schema;
|
6
|
-
use Illuminate\Support\ServiceProvider;
|
7
|
-
|
8
|
-
class PanneauServiceProvider extends ServiceProvider
|
9
|
-
{
|
10
|
-
/**
|
11
|
-
* Register any application services.
|
12
|
-
*
|
13
|
-
* @return void
|
14
|
-
*/
|
15
|
-
public function register()
|
16
|
-
{
|
17
|
-
$this->app->bind(\Folklore\Panneau\Contracts\Page::class, \App\Models\Page::class);
|
18
|
-
$this->app->bind(\Folklore\Panneau\Contracts\Block::class, \App\Models\Block::class);
|
19
|
-
$this->app->bind(\Folklore\Mediatheque\Contracts\Models\Video::class, \App\Models\Mediatheque\Video::class);
|
20
|
-
$this->app->bind(\Folklore\Mediatheque\Contracts\Models\Picture::class, \App\Models\Mediatheque\Picture::class);
|
21
|
-
$this->app->bind(\Folklore\Mediatheque\Contracts\Models\File::class, \App\Models\Mediatheque\File::class);
|
22
|
-
}
|
23
|
-
}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
<?php
|
2
|
-
|
3
|
-
namespace App\Reducers;
|
4
|
-
|
5
|
-
use Folklore\Panneau\Support\ExtractColumnReducer;
|
6
|
-
|
7
|
-
class SlugExtractReducer extends ExtractColumnReducer
|
8
|
-
{
|
9
|
-
protected function getExtractedColumns()
|
10
|
-
{
|
11
|
-
$columns = [];
|
12
|
-
$locales = config('locale.locales', [config('app.locale')]);
|
13
|
-
foreach ($locales as $locale) {
|
14
|
-
$columns['slug_'.$locale] = 'data.slug.'.$locale;
|
15
|
-
}
|
16
|
-
return $columns;
|
17
|
-
}
|
18
|
-
}
|
@@ -1,54 +0,0 @@
|
|
1
|
-
<?php
|
2
|
-
|
3
|
-
namespace App\Resources;
|
4
|
-
|
5
|
-
use Folklore\Panneau\Resources\Pages as BasePages;
|
6
|
-
|
7
|
-
class Pages extends BasePages
|
8
|
-
{
|
9
|
-
protected function controller()
|
10
|
-
{
|
11
|
-
return \App\Http\Controllers\Panneau\PagesController::class;
|
12
|
-
}
|
13
|
-
|
14
|
-
protected function lists()
|
15
|
-
{
|
16
|
-
$locale = app()->getLocale();
|
17
|
-
return [
|
18
|
-
'type' => 'table',
|
19
|
-
'cols' => [
|
20
|
-
[
|
21
|
-
'id' => 'id',
|
22
|
-
'path' => 'id',
|
23
|
-
'label' => 'ID',
|
24
|
-
'width' => 50
|
25
|
-
],
|
26
|
-
[
|
27
|
-
'id' => 'name',
|
28
|
-
'path' => 'title',
|
29
|
-
'label' => 'Titre'
|
30
|
-
],
|
31
|
-
[
|
32
|
-
'id' => 'url',
|
33
|
-
'path' => 'url',
|
34
|
-
'label' => 'Url'
|
35
|
-
],
|
36
|
-
[
|
37
|
-
'id' => 'type',
|
38
|
-
'path' => 'type',
|
39
|
-
'label' => 'Type'
|
40
|
-
],
|
41
|
-
[
|
42
|
-
'id' => 'actions',
|
43
|
-
'type' => 'actions',
|
44
|
-
'align' => 'right',
|
45
|
-
'withoutLabel' => true,
|
46
|
-
'width' => 150,
|
47
|
-
'showAction' => [
|
48
|
-
'linkItemPath' => 'url',
|
49
|
-
],
|
50
|
-
]
|
51
|
-
]
|
52
|
-
];
|
53
|
-
}
|
54
|
-
}
|
@@ -1,22 +0,0 @@
|
|
1
|
-
<?php
|
2
|
-
|
3
|
-
namespace App\Schemas\Blocks;
|
4
|
-
|
5
|
-
use Folklore\Panneau\Support\Block;
|
6
|
-
|
7
|
-
class Base extends Block
|
8
|
-
{
|
9
|
-
protected function attributes()
|
10
|
-
{
|
11
|
-
return [
|
12
|
-
'label' => trans('panneau::models.blocks.base.label')
|
13
|
-
];
|
14
|
-
}
|
15
|
-
|
16
|
-
protected function properties()
|
17
|
-
{
|
18
|
-
return [
|
19
|
-
|
20
|
-
];
|
21
|
-
}
|
22
|
-
}
|
@@ -1,22 +0,0 @@
|
|
1
|
-
<?php
|
2
|
-
|
3
|
-
namespace App\Schemas\Bubbles;
|
4
|
-
|
5
|
-
use Folklore\Panneau\Support\Bubble;
|
6
|
-
|
7
|
-
class Base extends Bubble
|
8
|
-
{
|
9
|
-
protected function attributes()
|
10
|
-
{
|
11
|
-
return [
|
12
|
-
'label' => trans('panneau::models.bubbles.base.label')
|
13
|
-
];
|
14
|
-
}
|
15
|
-
|
16
|
-
protected function properties()
|
17
|
-
{
|
18
|
-
return [
|
19
|
-
|
20
|
-
];
|
21
|
-
}
|
22
|
-
}
|
@@ -1,36 +0,0 @@
|
|
1
|
-
<?php
|
2
|
-
|
3
|
-
namespace App\Schemas\Pages;
|
4
|
-
|
5
|
-
use Folklore\Panneau\Support\Page;
|
6
|
-
|
7
|
-
class Base extends Page
|
8
|
-
{
|
9
|
-
protected function attributes()
|
10
|
-
{
|
11
|
-
return [
|
12
|
-
'label' => 'Page'
|
13
|
-
];
|
14
|
-
}
|
15
|
-
|
16
|
-
protected function properties()
|
17
|
-
{
|
18
|
-
return [
|
19
|
-
'slug' => field('text_locale', [
|
20
|
-
'label' => trans('panneau.fields.slug_label'),
|
21
|
-
]),
|
22
|
-
|
23
|
-
'title' => field('text_locale', [
|
24
|
-
'label' => trans('panneau.fields.title_label'),
|
25
|
-
]),
|
26
|
-
|
27
|
-
'parent' => field('page', [
|
28
|
-
'label' => trans('panneau.fields.parent_label'),
|
29
|
-
]),
|
30
|
-
|
31
|
-
'blocks' => field('blocks', [
|
32
|
-
'label' => trans('panneau.fields.blocks_label'),
|
33
|
-
]),
|
34
|
-
];
|
35
|
-
}
|
36
|
-
}
|