generator-folklore 3.0.3 → 3.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (205) hide show
  1. package/lib/generators/app/index.js +3 -51
  2. package/lib/generators/babel/index.js +28 -101
  3. package/lib/generators/babel/templates/config.js +16 -0
  4. package/lib/generators/browserslist/index.js +4 -9
  5. package/lib/generators/build/index.js +40 -29
  6. package/lib/generators/cli/index.js +92 -0
  7. package/lib/generators/cli/templates/cli.js +22 -0
  8. package/lib/generators/cli/templates/commands/default.js +16 -0
  9. package/lib/generators/docs/index.js +1 -2
  10. package/lib/generators/editorconfig/index.js +12 -22
  11. package/lib/generators/eslint/index.js +12 -13
  12. package/lib/generators/{html → html-project}/index.js +60 -73
  13. package/lib/generators/{html → html-project}/templates/folklore.png +0 -0
  14. package/lib/generators/{html → html-project}/templates/gitignore +0 -0
  15. package/lib/generators/{html → html-project}/templates/index.html.ejs +4 -1
  16. package/lib/generators/intl/index.js +93 -0
  17. package/lib/generators/laravel/index.js +5 -5
  18. package/lib/generators/laravel-mediatheque/index.js +133 -0
  19. package/lib/generators/laravel-mediatheque/templates/app/Models/Media.php +9 -0
  20. package/lib/generators/laravel-mediatheque/templates/app/Models/MediaFile.php +9 -0
  21. package/lib/generators/laravel-panneau/index.js +49 -28
  22. package/lib/generators/laravel-panneau/templates/app/Contracts/Repositories/Pages.php +19 -0
  23. package/lib/generators/laravel-panneau/templates/app/Contracts/Resources/Blocks/Text.php +10 -0
  24. package/lib/generators/laravel-panneau/templates/app/Contracts/Resources/Page.php +10 -0
  25. package/lib/generators/laravel-panneau/templates/app/Contracts/Resources/Pages/Home.php +9 -0
  26. package/lib/generators/laravel-panneau/templates/app/Http/Resources/BlockResource.php +37 -0
  27. package/lib/generators/laravel-panneau/templates/app/Http/Resources/BlocksCollection.php +8 -0
  28. package/lib/generators/laravel-panneau/templates/app/Http/Resources/PageResource.php +47 -0
  29. package/lib/generators/laravel-panneau/templates/app/Http/Resources/PagesCollection.php +10 -0
  30. package/lib/generators/laravel-panneau/templates/app/Models/Block.php +3 -13
  31. package/lib/generators/laravel-panneau/templates/app/Models/Page.php +3 -60
  32. package/lib/generators/laravel-panneau/templates/app/Panneau/Composers/AppComposer.php +50 -0
  33. package/lib/generators/laravel-panneau/templates/app/Panneau/Fields/Block.php +22 -0
  34. package/lib/generators/laravel-panneau/templates/app/Panneau/Fields/Blocks.php +87 -0
  35. package/lib/generators/laravel-panneau/templates/app/Panneau/Fields/Page.php +51 -0
  36. package/lib/generators/laravel-panneau/templates/app/Panneau/Fields/PageSlug.php +34 -0
  37. package/lib/generators/laravel-panneau/templates/app/Panneau/Fields/PageSlugLocalized.php +18 -0
  38. package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Controllers/AccountController.php +41 -0
  39. package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Controllers/Controller.php +19 -0
  40. package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Controllers/HomeController.php +16 -0
  41. package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Controllers/PagesController.php +24 -0
  42. package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Controllers/UploadController.php +27 -0
  43. package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Controllers/UsersController.php +32 -0
  44. package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Requests/AccountUpdateRequest.php +29 -0
  45. package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Requests/UploadRequest.php +29 -0
  46. package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Resources/BlockResource.php +39 -0
  47. package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Resources/BlocksCollection.php +8 -0
  48. package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Resources/PageResource.php +56 -0
  49. package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Resources/PagesCollection.php +10 -0
  50. package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Resources/UserResource.php +24 -0
  51. package/lib/generators/laravel-panneau/templates/app/Panneau/PanneauServiceProvider.php +48 -0
  52. package/lib/generators/laravel-panneau/templates/app/Panneau/Policies/PanneauPolicy.php +32 -0
  53. package/lib/generators/laravel-panneau/templates/app/Panneau/Resources/Blocks/BlockWithBlocks.php +110 -0
  54. package/lib/generators/laravel-panneau/templates/app/Panneau/Resources/Blocks/TextBlock.php +27 -0
  55. package/lib/generators/laravel-panneau/templates/app/Panneau/Resources/Blocks.php +42 -0
  56. package/lib/generators/laravel-panneau/templates/app/Panneau/Resources/Pages/Page.php +28 -0
  57. package/lib/generators/laravel-panneau/templates/app/Panneau/Resources/Pages.php +92 -0
  58. package/lib/generators/laravel-panneau/templates/app/Panneau/Resources/Users.php +57 -0
  59. package/lib/generators/laravel-panneau/templates/app/Repositories/Pages.php +42 -0
  60. package/lib/generators/laravel-panneau/templates/app/Resources/Blocks/TextBlock.php +14 -0
  61. package/lib/generators/laravel-panneau/templates/app/Resources/Page.php +10 -0
  62. package/lib/generators/laravel-panneau/templates/app/Resources/Pages/HomePage.php +10 -0
  63. package/lib/generators/laravel-panneau/templates/app.blade.php +8 -0
  64. package/lib/generators/laravel-panneau/templates/index.js +32 -0
  65. package/lib/generators/laravel-panneau/templates/lang/en/panneau.php +62 -0
  66. package/lib/generators/laravel-panneau/templates/lang/fr/panneau.php +62 -0
  67. package/lib/generators/laravel-panneau/templates/layout.blade.php +17 -48
  68. package/lib/generators/laravel-panneau/templates/resources/assets/js/components/Panneau.jsx +68 -0
  69. package/lib/generators/{js/templates/src/lib/.gitkeep → laravel-panneau/templates/resources/assets/js/components/panneau/fields/PageSlug.jsx} +0 -0
  70. package/lib/generators/laravel-panneau/templates/resources/assets/js/components/panneau/fields/PageSlugLocalized.jsx +43 -0
  71. package/lib/generators/laravel-panneau/templates/resources/assets/js/components/panneau/fields/index.js +2 -0
  72. package/lib/generators/laravel-panneau/templates/resources/assets/styles/panneau.scss +2 -0
  73. package/lib/generators/laravel-panneau/templates/routes.php +30 -0
  74. package/lib/generators/laravel-project/index.js +504 -0
  75. package/lib/generators/laravel-project/templates/env +41 -0
  76. package/lib/generators/laravel-project/templates/laravel/app/Composers/AppComposer.php +48 -0
  77. package/lib/generators/laravel-project/templates/laravel/app/Composers/IntlComposer.php +10 -0
  78. package/lib/generators/laravel-project/templates/laravel/app/Composers/MetaComposer.php +48 -0
  79. package/lib/generators/laravel-project/templates/laravel/app/Composers/RoutesComposer.php +19 -0
  80. package/lib/generators/laravel-project/templates/laravel/app/Contracts/Resources/User.php +10 -0
  81. package/lib/generators/laravel-project/templates/laravel/app/Http/Controllers/HomeController.php +18 -0
  82. package/lib/generators/laravel-project/templates/laravel/app/Http/Middleware/TrustProxies.php +28 -0
  83. package/lib/generators/laravel-project/templates/laravel/app/Http/Resources/UserResource.php +21 -0
  84. package/lib/generators/laravel-project/templates/laravel/app/Models/User.php +50 -0
  85. package/lib/generators/laravel-project/templates/laravel/app/Providers/AppServiceProvider.php +45 -0
  86. package/lib/generators/laravel-project/templates/laravel/app/Providers/RouteServiceProvider.php +64 -0
  87. package/lib/generators/laravel-project/templates/laravel/app/Providers/ViewServiceProvider.php +33 -0
  88. package/lib/generators/laravel-project/templates/laravel/app/Repositories/Users.php +36 -0
  89. package/lib/generators/laravel-project/templates/laravel/app/Resources/User.php +11 -0
  90. package/lib/generators/laravel-project/templates/laravel/config/app.php +216 -0
  91. package/lib/generators/laravel-project/templates/laravel/config/auth.php +116 -0
  92. package/lib/generators/laravel-project/templates/laravel/config/services.php +39 -0
  93. package/lib/generators/laravel-project/templates/laravel/lang/en/content.php +5 -0
  94. package/lib/generators/laravel-project/templates/laravel/lang/en/errors.php +17 -0
  95. package/lib/generators/laravel-project/templates/laravel/lang/en/meta.php +11 -0
  96. package/lib/generators/laravel-project/templates/laravel/lang/en/routes.php +4 -0
  97. package/lib/generators/laravel-project/templates/laravel/lang/fr/auth.php +19 -0
  98. package/lib/generators/laravel-project/templates/laravel/lang/fr/content.php +5 -0
  99. package/lib/generators/laravel-project/templates/laravel/lang/fr/errors.php +17 -0
  100. package/lib/generators/laravel-project/templates/laravel/lang/fr/meta.php +11 -0
  101. package/lib/generators/laravel-project/templates/laravel/lang/fr/pagination.php +19 -0
  102. package/lib/generators/laravel-project/templates/laravel/lang/fr/passwords.php +22 -0
  103. package/lib/generators/laravel-project/templates/laravel/lang/fr/routes.php +12 -0
  104. package/lib/generators/laravel-project/templates/laravel/lang/fr/validation.php +146 -0
  105. package/lib/generators/{js/templates/styles → laravel-project/templates/laravel/resources/assets/fonts}/.gitkeep +0 -0
  106. package/lib/generators/{laravel-panneau/templates/app/Schemas/Fields → laravel-project/templates/laravel/resources/assets/img}/.gitkeep +0 -0
  107. package/lib/generators/laravel-project/templates/laravel/resources/assets/img/folklore.png +0 -0
  108. package/lib/generators/laravel-project/templates/laravel/resources/views/analytics/body.blade.php +3 -0
  109. package/lib/generators/laravel-project/templates/laravel/resources/views/analytics/gpt.blade.php +16 -0
  110. package/lib/generators/laravel-project/templates/laravel/resources/views/analytics/head.blade.php +1 -0
  111. package/lib/generators/laravel-project/templates/laravel/resources/views/app.blade.php +8 -0
  112. package/lib/generators/laravel-project/templates/laravel/resources/views/errors/401.blade.php +8 -0
  113. package/lib/generators/laravel-project/templates/laravel/resources/views/errors/403.blade.php +8 -0
  114. package/lib/generators/laravel-project/templates/laravel/resources/views/errors/404.blade.php +8 -0
  115. package/lib/generators/laravel-project/templates/laravel/resources/views/errors/500.blade.php +8 -0
  116. package/lib/generators/laravel-project/templates/laravel/resources/views/layout.blade.php +33 -0
  117. package/lib/generators/laravel-project/templates/laravel/resources/views/meta/all.blade.php +4 -0
  118. package/lib/generators/laravel-project/templates/laravel/resources/views/meta/base.blade.php +11 -0
  119. package/lib/generators/laravel-project/templates/laravel/resources/views/meta/facebook.blade.php +4 -0
  120. package/lib/generators/laravel-project/templates/laravel/resources/views/meta/opengraph.blade.php +9 -0
  121. package/lib/generators/laravel-project/templates/laravel/resources/views/meta/twitter.blade.php +5 -0
  122. package/lib/generators/laravel-project/templates/laravel/routes/web.php +12 -0
  123. package/lib/generators/lerna-package/index.js +1 -3
  124. package/lib/generators/lerna-repository/index.js +1 -3
  125. package/lib/generators/node-project/index.js +164 -0
  126. package/lib/generators/node-project/templates/index.js +0 -0
  127. package/lib/generators/npm-package/index.js +3 -5
  128. package/lib/generators/prettier/index.js +19 -6
  129. package/lib/generators/prettier/templates/prettierrc.json +3 -1
  130. package/lib/generators/{js → react-app}/index.js +22 -52
  131. package/lib/generators/{js → react-app}/templates/_package.json +0 -0
  132. package/lib/generators/react-app/templates/index.js +23 -0
  133. package/lib/generators/react-app/templates/src/components/App.jsx +46 -0
  134. package/lib/generators/react-app/templates/src/components/Container.jsx +40 -0
  135. package/lib/generators/{js → react-app}/templates/src/components/buttons/Button.jsx +4 -18
  136. package/lib/generators/react-app/templates/src/components/layouts/Main.jsx +27 -0
  137. package/lib/generators/react-app/templates/src/components/menus/Menu.jsx +62 -0
  138. package/lib/generators/{js → react-app}/templates/src/components/pages/Error.jsx +10 -14
  139. package/lib/generators/react-app/templates/src/components/pages/Home.jsx +32 -0
  140. package/lib/generators/{js → react-app}/templates/src/components/partials/PageMeta.jsx +11 -11
  141. package/lib/generators/{js → react-app}/templates/src/contexts/KeysContext.jsx +0 -0
  142. package/lib/generators/react-app/templates/src/lib/.gitkeep +0 -0
  143. package/lib/generators/{js → react-app}/templates/src/lib/PropTypes.js +0 -0
  144. package/lib/generators/{js → react-app}/templates/src/lib/utils.js +0 -0
  145. package/lib/generators/react-app/templates/src/polyfills/index.js +6 -0
  146. package/lib/generators/react-app/templates/src/polyfills/intl-en.js +2 -0
  147. package/lib/generators/react-app/templates/src/polyfills/intl-fr.js +2 -0
  148. package/lib/generators/react-app/templates/src/polyfills/should.js +14 -0
  149. package/lib/generators/react-app/templates/styles/.gitkeep +0 -0
  150. package/lib/generators/{js/templates/styles/buttons/button.scss → react-app/templates/styles/buttons/button.module.scss} +1 -0
  151. package/lib/generators/{js/templates/styles/layouts/main.scss → react-app/templates/styles/layouts/main.module.scss} +0 -0
  152. package/lib/generators/{js/templates/styles/menus/menu.scss → react-app/templates/styles/menus/menu.module.scss} +0 -0
  153. package/lib/generators/{js/templates/styles/pages/error.scss → react-app/templates/styles/pages/error.module.scss} +0 -0
  154. package/lib/generators/{js/templates/styles/pages/home.scss → react-app/templates/styles/pages/home.module.scss} +0 -0
  155. package/lib/generators/rollup/index.js +54 -0
  156. package/lib/generators/rollup/templates/config.js +50 -0
  157. package/lib/generators/scss/index.js +3 -16
  158. package/lib/generators/scss/templates/{main.scss → styles.scss} +0 -0
  159. package/lib/generators/server/index.js +81 -0
  160. package/lib/generators/server/templates/server.js +59 -0
  161. package/lib/generators/storybook/index.js +1 -7
  162. package/lib/generators/stylelint/index.js +13 -14
  163. package/lib/lib/generator.js +9 -0
  164. package/lib/lib/utils.js +17 -0
  165. package/package.json +2 -2
  166. package/lib/generators/babel/templates/babel-preset-react.js +0 -7
  167. package/lib/generators/babel/templates/babel-preset.js +0 -57
  168. package/lib/generators/babel/templates/babelrc +0 -5
  169. package/lib/generators/babel/templates/utils/processScss.js +0 -10
  170. package/lib/generators/babel/templates/utils/transformRequireIgnore.js +0 -80
  171. package/lib/generators/html/templates/index.js +0 -9
  172. package/lib/generators/html/templates/root.js +0 -23
  173. package/lib/generators/html/templates/utils.js +0 -7
  174. package/lib/generators/js/templates/browserslistrc +0 -9
  175. package/lib/generators/js/templates/config.js +0 -33
  176. package/lib/generators/js/templates/index.js +0 -41
  177. package/lib/generators/js/templates/src/actions/LayoutActions.js +0 -12
  178. package/lib/generators/js/templates/src/actions/SiteActions.js +0 -22
  179. package/lib/generators/js/templates/src/components/App.jsx +0 -52
  180. package/lib/generators/js/templates/src/components/Root.jsx +0 -70
  181. package/lib/generators/js/templates/src/components/layouts/Main.jsx +0 -52
  182. package/lib/generators/js/templates/src/components/menus/Menu.jsx +0 -60
  183. package/lib/generators/js/templates/src/components/messages/Success.jsx +0 -36
  184. package/lib/generators/js/templates/src/components/pages/Home.jsx +0 -32
  185. package/lib/generators/js/templates/src/components/partials/Label.jsx +0 -32
  186. package/lib/generators/js/templates/src/reducers/LayoutReducer.js +0 -32
  187. package/lib/generators/js/templates/src/reducers/SiteReducer.js +0 -36
  188. package/lib/generators/js/templates/src/reducers/index.js +0 -7
  189. package/lib/generators/js/templates/src/vendor/polyfills/intl-en.js +0 -2
  190. package/lib/generators/js/templates/src/vendor/polyfills/intl-fr.js +0 -2
  191. package/lib/generators/laravel-panneau/templates/_composer.json +0 -6
  192. package/lib/generators/laravel-panneau/templates/_package.json +0 -11
  193. package/lib/generators/laravel-panneau/templates/app/Http/Controllers/Panneau/HomeController.php +0 -14
  194. package/lib/generators/laravel-panneau/templates/app/Http/Controllers/Panneau/PagesController.php +0 -11
  195. package/lib/generators/laravel-panneau/templates/app/Models/Mediatheque/File.php +0 -13
  196. package/lib/generators/laravel-panneau/templates/app/Models/Mediatheque/Picture.php +0 -13
  197. package/lib/generators/laravel-panneau/templates/app/Models/Mediatheque/Video.php +0 -34
  198. package/lib/generators/laravel-panneau/templates/app/Providers/PanneauServiceProvider.php +0 -23
  199. package/lib/generators/laravel-panneau/templates/app/Reducers/SlugExtractReducer.php +0 -18
  200. package/lib/generators/laravel-panneau/templates/app/Resources/Pages.php +0 -54
  201. package/lib/generators/laravel-panneau/templates/app/Schemas/Blocks/Base.php +0 -22
  202. package/lib/generators/laravel-panneau/templates/app/Schemas/Bubbles/Base.php +0 -22
  203. package/lib/generators/laravel-panneau/templates/app/Schemas/Pages/Base.php +0 -36
  204. package/lib/generators/laravel-panneau/templates/resources/lang/en/panneau.php +0 -12
  205. package/lib/generators/laravel-panneau/templates/resources/lang/fr/panneau.php +0 -12
@@ -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
- }
@@ -1,12 +0,0 @@
1
- <?php
2
-
3
- return [
4
- 'fields' => [
5
- 'slug_label' => 'Slug',
6
- 'title_label' => 'Title',
7
- 'description_label' => 'Description',
8
- 'parent_label' => 'Parent',
9
- 'blocks_label' => 'Blocks',
10
- 'image_label' => 'Image'
11
- ],
12
- ];
@@ -1,12 +0,0 @@
1
- <?php
2
-
3
- return [
4
- 'fields' => [
5
- 'slug_label' => 'Adresse',
6
- 'title_label' => 'Titre',
7
- 'description_label' => 'Description',
8
- 'parent_label' => 'Parent',
9
- 'blocks_label' => 'Blocs',
10
- 'image_label' => 'Image'
11
- ],
12
- ];