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.
- package/lib/generators/app/index.js +3 -51
- package/lib/generators/babel/index.js +28 -101
- package/lib/generators/babel/templates/config.js +16 -0
- package/lib/generators/browserslist/index.js +4 -9
- package/lib/generators/build/index.js +40 -29
- package/lib/generators/cli/index.js +92 -0
- package/lib/generators/cli/templates/cli.js +22 -0
- package/lib/generators/cli/templates/commands/default.js +16 -0
- package/lib/generators/docs/index.js +1 -2
- package/lib/generators/editorconfig/index.js +12 -22
- package/lib/generators/eslint/index.js +12 -13
- package/lib/generators/{html → html-project}/index.js +60 -73
- package/lib/generators/{html → html-project}/templates/folklore.png +0 -0
- package/lib/generators/{html → html-project}/templates/gitignore +0 -0
- package/lib/generators/{html → html-project}/templates/index.html.ejs +4 -1
- package/lib/generators/intl/index.js +93 -0
- package/lib/generators/laravel/index.js +5 -5
- package/lib/generators/laravel-mediatheque/index.js +133 -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 +49 -28
- package/lib/generators/laravel-panneau/templates/app/Contracts/Repositories/Pages.php +19 -0
- package/lib/generators/laravel-panneau/templates/app/Contracts/Resources/Blocks/Text.php +10 -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 +3 -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/Panneau/Fields/Block.php +22 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Fields/Blocks.php +87 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Fields/Page.php +51 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Fields/PageSlug.php +34 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Fields/PageSlugLocalized.php +18 -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 +8 -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/PanneauServiceProvider.php +48 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Policies/PanneauPolicy.php +32 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Resources/Blocks/BlockWithBlocks.php +110 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Resources/Blocks/TextBlock.php +27 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Resources/Blocks.php +42 -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/TextBlock.php +14 -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/index.js +32 -0
- package/lib/generators/laravel-panneau/templates/lang/en/panneau.php +62 -0
- package/lib/generators/laravel-panneau/templates/lang/fr/panneau.php +62 -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/{js/templates/src/lib/.gitkeep → laravel-panneau/templates/resources/assets/js/components/panneau/fields/PageSlug.jsx} +0 -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 +504 -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/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 +50 -0
- package/lib/generators/laravel-project/templates/laravel/app/Providers/AppServiceProvider.php +45 -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 +36 -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/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/{js/templates/styles → laravel-project/templates/laravel/resources/assets/fonts}/.gitkeep +0 -0
- package/lib/generators/{laravel-panneau/templates/app/Schemas/Fields → 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/lerna-package/index.js +1 -3
- package/lib/generators/lerna-repository/index.js +1 -3
- package/lib/generators/node-project/index.js +164 -0
- package/lib/generators/node-project/templates/index.js +0 -0
- package/lib/generators/npm-package/index.js +3 -5
- package/lib/generators/prettier/index.js +19 -6
- package/lib/generators/prettier/templates/prettierrc.json +3 -1
- package/lib/generators/{js → react-app}/index.js +22 -52
- package/lib/generators/{js → react-app}/templates/_package.json +0 -0
- package/lib/generators/react-app/templates/index.js +23 -0
- package/lib/generators/react-app/templates/src/components/App.jsx +46 -0
- package/lib/generators/react-app/templates/src/components/Container.jsx +40 -0
- package/lib/generators/{js → react-app}/templates/src/components/buttons/Button.jsx +4 -18
- package/lib/generators/react-app/templates/src/components/layouts/Main.jsx +27 -0
- package/lib/generators/react-app/templates/src/components/menus/Menu.jsx +62 -0
- package/lib/generators/{js → react-app}/templates/src/components/pages/Error.jsx +10 -14
- package/lib/generators/react-app/templates/src/components/pages/Home.jsx +32 -0
- package/lib/generators/{js → react-app}/templates/src/components/partials/PageMeta.jsx +11 -11
- package/lib/generators/{js → react-app}/templates/src/contexts/KeysContext.jsx +0 -0
- package/lib/generators/react-app/templates/src/lib/.gitkeep +0 -0
- package/lib/generators/{js → react-app}/templates/src/lib/PropTypes.js +0 -0
- package/lib/generators/{js → react-app}/templates/src/lib/utils.js +0 -0
- package/lib/generators/react-app/templates/src/polyfills/index.js +6 -0
- package/lib/generators/react-app/templates/src/polyfills/intl-en.js +2 -0
- package/lib/generators/react-app/templates/src/polyfills/intl-fr.js +2 -0
- package/lib/generators/react-app/templates/src/polyfills/should.js +14 -0
- package/lib/generators/react-app/templates/styles/.gitkeep +0 -0
- package/lib/generators/{js/templates/styles/buttons/button.scss → react-app/templates/styles/buttons/button.module.scss} +1 -0
- package/lib/generators/{js/templates/styles/layouts/main.scss → react-app/templates/styles/layouts/main.module.scss} +0 -0
- package/lib/generators/{js/templates/styles/menus/menu.scss → react-app/templates/styles/menus/menu.module.scss} +0 -0
- package/lib/generators/{js/templates/styles/pages/error.scss → react-app/templates/styles/pages/error.module.scss} +0 -0
- package/lib/generators/{js/templates/styles/pages/home.scss → react-app/templates/styles/pages/home.module.scss} +0 -0
- package/lib/generators/rollup/index.js +54 -0
- package/lib/generators/rollup/templates/config.js +50 -0
- package/lib/generators/scss/index.js +3 -16
- package/lib/generators/scss/templates/{main.scss → styles.scss} +0 -0
- package/lib/generators/server/index.js +81 -0
- package/lib/generators/server/templates/server.js +59 -0
- package/lib/generators/storybook/index.js +1 -7
- package/lib/generators/stylelint/index.js +13 -14
- package/lib/lib/generator.js +9 -0
- package/lib/lib/utils.js +17 -0
- package/package.json +2 -2
- package/lib/generators/babel/templates/babel-preset-react.js +0 -7
- package/lib/generators/babel/templates/babel-preset.js +0 -57
- package/lib/generators/babel/templates/babelrc +0 -5
- package/lib/generators/babel/templates/utils/processScss.js +0 -10
- package/lib/generators/babel/templates/utils/transformRequireIgnore.js +0 -80
- package/lib/generators/html/templates/index.js +0 -9
- package/lib/generators/html/templates/root.js +0 -23
- package/lib/generators/html/templates/utils.js +0 -7
- package/lib/generators/js/templates/browserslistrc +0 -9
- package/lib/generators/js/templates/config.js +0 -33
- package/lib/generators/js/templates/index.js +0 -41
- package/lib/generators/js/templates/src/actions/LayoutActions.js +0 -12
- package/lib/generators/js/templates/src/actions/SiteActions.js +0 -22
- package/lib/generators/js/templates/src/components/App.jsx +0 -52
- package/lib/generators/js/templates/src/components/Root.jsx +0 -70
- package/lib/generators/js/templates/src/components/layouts/Main.jsx +0 -52
- package/lib/generators/js/templates/src/components/menus/Menu.jsx +0 -60
- package/lib/generators/js/templates/src/components/messages/Success.jsx +0 -36
- package/lib/generators/js/templates/src/components/pages/Home.jsx +0 -32
- package/lib/generators/js/templates/src/components/partials/Label.jsx +0 -32
- package/lib/generators/js/templates/src/reducers/LayoutReducer.js +0 -32
- package/lib/generators/js/templates/src/reducers/SiteReducer.js +0 -36
- package/lib/generators/js/templates/src/reducers/index.js +0 -7
- package/lib/generators/js/templates/src/vendor/polyfills/intl-en.js +0 -2
- package/lib/generators/js/templates/src/vendor/polyfills/intl-fr.js +0 -2
- 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
@@ -1,16 +1,16 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
+
var _chalk = _interopRequireDefault(require("chalk"));
|
4
|
+
|
3
5
|
var _lodash = _interopRequireDefault(require("lodash"));
|
4
6
|
|
5
7
|
var _path = _interopRequireDefault(require("path"));
|
6
8
|
|
7
|
-
var _chalk = _interopRequireDefault(require("chalk"));
|
8
|
-
|
9
9
|
var _generator = _interopRequireDefault(require("../../lib/generator"));
|
10
10
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
12
12
|
|
13
|
-
module.exports = class
|
13
|
+
module.exports = class HTMLProjectGenerator extends _generator.default {
|
14
14
|
// The name `constructor` is important here
|
15
15
|
constructor(...args) {
|
16
16
|
super(...args);
|
@@ -18,21 +18,11 @@ module.exports = class HTMLGenerator extends _generator.default {
|
|
18
18
|
type: String,
|
19
19
|
required: false
|
20
20
|
});
|
21
|
-
this.option('path', {
|
22
|
-
type: String,
|
23
|
-
desc: 'Path for the html project',
|
24
|
-
defaults: './'
|
25
|
-
});
|
26
21
|
this.option('src-path', {
|
27
22
|
type: String,
|
28
23
|
desc: 'Path for source',
|
29
24
|
defaults: './src'
|
30
25
|
});
|
31
|
-
this.option('tmp-path', {
|
32
|
-
type: String,
|
33
|
-
desc: 'Path for temp files',
|
34
|
-
defaults: './.tmp'
|
35
|
-
});
|
36
26
|
this.option('dest-path', {
|
37
27
|
type: String,
|
38
28
|
desc: 'Path for build',
|
@@ -43,26 +33,11 @@ module.exports = class HTMLGenerator extends _generator.default {
|
|
43
33
|
desc: 'Path for the javascript',
|
44
34
|
defaults: ''
|
45
35
|
});
|
46
|
-
this.option('
|
47
|
-
type: String,
|
48
|
-
desc: 'Path for the css',
|
49
|
-
defaults: 'css'
|
50
|
-
});
|
51
|
-
this.option('scss-path', {
|
36
|
+
this.option('styles-path', {
|
52
37
|
type: String,
|
53
38
|
desc: 'Path for the scss',
|
54
39
|
defaults: 'styles'
|
55
40
|
});
|
56
|
-
this.option('images-path', {
|
57
|
-
type: String,
|
58
|
-
desc: 'Path for the images',
|
59
|
-
defaults: 'img'
|
60
|
-
});
|
61
|
-
this.option('build-path', {
|
62
|
-
type: String,
|
63
|
-
desc: 'Path for the build tools',
|
64
|
-
defaults: 'build'
|
65
|
-
});
|
66
41
|
this.option('server', {
|
67
42
|
type: Boolean,
|
68
43
|
defaults: false,
|
@@ -70,7 +45,12 @@ module.exports = class HTMLGenerator extends _generator.default {
|
|
70
45
|
});
|
71
46
|
this.option('server-path', {
|
72
47
|
type: String,
|
73
|
-
desc: 'Path for the node.js server'
|
48
|
+
desc: 'Path for the node.js server',
|
49
|
+
defaults: ''
|
50
|
+
});
|
51
|
+
this.option('server-filename', {
|
52
|
+
type: String,
|
53
|
+
desc: 'Filename for the node.js server'
|
74
54
|
});
|
75
55
|
|
76
56
|
this.srcPath = filePath => this.destinationPath(_path.default.join(this.options['src-path'], filePath));
|
@@ -84,7 +64,7 @@ module.exports = class HTMLGenerator extends _generator.default {
|
|
84
64
|
}
|
85
65
|
|
86
66
|
console.log(_chalk.default.yellow('\n----------------------'));
|
87
|
-
console.log('HTML Generator');
|
67
|
+
console.log('HTML Project Generator');
|
88
68
|
console.log(_chalk.default.yellow('----------------------\n'));
|
89
69
|
},
|
90
70
|
|
@@ -110,64 +90,75 @@ module.exports = class HTMLGenerator extends _generator.default {
|
|
110
90
|
}
|
111
91
|
|
112
92
|
configuring() {
|
113
|
-
const
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
const jsPath = _lodash.default.get(this.options, 'js-path');
|
124
|
-
|
125
|
-
const jsSrcPath = _path.default.join(projectPath, srcPath, jsPath);
|
93
|
+
const {
|
94
|
+
'project-name': projectName,
|
95
|
+
'src-path': srcPath,
|
96
|
+
'dest-path': destPath,
|
97
|
+
'js-path': jsPath,
|
98
|
+
'styles-path': stylesPath,
|
99
|
+
'server-path': serverPath,
|
100
|
+
'server-filename': serverFilename
|
101
|
+
} = this.options;
|
126
102
|
|
127
|
-
const
|
103
|
+
const jsSrcPath = _path.default.join(srcPath, jsPath);
|
128
104
|
|
129
|
-
const
|
105
|
+
const stylesSrcPath = _path.default.join(srcPath, stylesPath);
|
130
106
|
|
131
|
-
const
|
107
|
+
const serverSrcPath = _path.default.join(srcPath, serverPath);
|
132
108
|
|
133
|
-
this.composeWith('folklore:
|
134
|
-
'
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
'skip-install':
|
109
|
+
this.composeWith('folklore:prettier', {
|
110
|
+
'skip-install': true,
|
111
|
+
quiet: true
|
112
|
+
});
|
113
|
+
this.composeWith('folklore:eslint', {
|
114
|
+
'skip-install': true,
|
115
|
+
quiet: true
|
116
|
+
});
|
117
|
+
this.composeWith('folklore:stylelint', {
|
118
|
+
'skip-install': true,
|
119
|
+
quiet: true
|
120
|
+
});
|
121
|
+
this.composeWith('folklore:browserslist', {
|
122
|
+
'skip-install': true,
|
139
123
|
quiet: true
|
140
124
|
});
|
141
125
|
this.composeWith('folklore:editorconfig', {
|
142
126
|
quiet: true
|
143
127
|
});
|
128
|
+
this.composeWith('folklore:react-app', {
|
129
|
+
'project-name': projectName,
|
130
|
+
path: jsSrcPath,
|
131
|
+
stylesPath: stylesSrcPath,
|
132
|
+
'skip-install': true,
|
133
|
+
quiet: true
|
134
|
+
});
|
144
135
|
this.composeWith('folklore:scss', {
|
145
136
|
'project-name': projectName,
|
146
|
-
path:
|
137
|
+
path: stylesSrcPath,
|
147
138
|
react: true,
|
148
|
-
'skip-install':
|
139
|
+
'skip-install': true,
|
149
140
|
quiet: true
|
150
141
|
});
|
151
142
|
|
152
143
|
if (this.options.server) {
|
153
144
|
this.composeWith('folklore:server', {
|
154
|
-
|
155
|
-
|
156
|
-
'skip-install':
|
145
|
+
path: serverSrcPath,
|
146
|
+
filename: serverFilename,
|
147
|
+
'skip-install': true,
|
157
148
|
quiet: true
|
158
149
|
});
|
159
150
|
}
|
160
151
|
|
152
|
+
console.log(srcPath, jsSrcPath, _path.default.join(jsSrcPath, 'index.js'), _path.default.join(srcPath, 'index.html.ejs'));
|
161
153
|
this.composeWith('folklore:build', {
|
162
|
-
path: buildPath,
|
163
154
|
'src-path': srcPath,
|
164
|
-
'entry-path': _path.default.join(
|
155
|
+
'entry-path': _path.default.join(jsSrcPath, 'index.js'),
|
165
156
|
'html-path': _path.default.join(srcPath, 'index.html.ejs'),
|
166
157
|
'build-path': destPath,
|
167
158
|
'empty-path': destPath,
|
168
159
|
copy: true,
|
169
160
|
'copy-path': _path.default.join(srcPath, '*.{html,ico,txt,png}'),
|
170
|
-
'skip-install':
|
161
|
+
'skip-install': true,
|
171
162
|
quiet: true
|
172
163
|
});
|
173
164
|
}
|
@@ -196,18 +187,6 @@ module.exports = class HTMLGenerator extends _generator.default {
|
|
196
187
|
this.fs.copy(srcPath, destPath);
|
197
188
|
},
|
198
189
|
|
199
|
-
data() {
|
200
|
-
const srcPath = this.templatePath('root.js');
|
201
|
-
const destPath = this.srcPath('data/root.js');
|
202
|
-
this.fs.copy(srcPath, destPath);
|
203
|
-
},
|
204
|
-
|
205
|
-
utils() {
|
206
|
-
const srcPath = this.templatePath('utils.js');
|
207
|
-
const destPath = this.srcPath('lib/utils.js');
|
208
|
-
this.fs.copy(srcPath, destPath);
|
209
|
-
},
|
210
|
-
|
211
190
|
gitignore() {
|
212
191
|
const srcPath = this.templatePath('gitignore');
|
213
192
|
const destPath = this.destinationPath('.gitignore');
|
@@ -217,4 +196,12 @@ module.exports = class HTMLGenerator extends _generator.default {
|
|
217
196
|
};
|
218
197
|
}
|
219
198
|
|
199
|
+
async install() {
|
200
|
+
if (this.options['skip-install']) {
|
201
|
+
return;
|
202
|
+
}
|
203
|
+
|
204
|
+
await this.spawnCommand('npm', ['install']);
|
205
|
+
}
|
206
|
+
|
220
207
|
};
|
File without changes
|
File without changes
|
@@ -0,0 +1,93 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _chalk = _interopRequireDefault(require("chalk"));
|
4
|
+
|
5
|
+
var _path = _interopRequireDefault(require("path"));
|
6
|
+
|
7
|
+
var _generator = _interopRequireDefault(require("../../lib/generator"));
|
8
|
+
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
10
|
+
|
11
|
+
module.exports = class IntlGenerator extends _generator.default {
|
12
|
+
constructor(...args) {
|
13
|
+
super(...args);
|
14
|
+
this.option('translations-path', {
|
15
|
+
type: String,
|
16
|
+
desc: 'Path for to search for translations',
|
17
|
+
defaults: './src/**/*.{js,jsx}'
|
18
|
+
});
|
19
|
+
this.option('locales', {
|
20
|
+
type: String,
|
21
|
+
desc: 'Supported locales',
|
22
|
+
defaults: 'fr,en'
|
23
|
+
});
|
24
|
+
this.option('output-path', {
|
25
|
+
type: String,
|
26
|
+
desc: 'Path to output locale files',
|
27
|
+
defaults: './locale'
|
28
|
+
});
|
29
|
+
this.option('json-path', {
|
30
|
+
type: String,
|
31
|
+
desc: 'Path to copy json files'
|
32
|
+
});
|
33
|
+
this.option('without-id-only', {
|
34
|
+
type: String,
|
35
|
+
desc: 'Extract only messages without id',
|
36
|
+
defaults: false
|
37
|
+
});
|
38
|
+
}
|
39
|
+
|
40
|
+
get prompting() {
|
41
|
+
return {
|
42
|
+
welcome() {
|
43
|
+
if (this.options.quiet) {
|
44
|
+
return;
|
45
|
+
}
|
46
|
+
|
47
|
+
console.log(_chalk.default.yellow('\n----------------------'));
|
48
|
+
console.log('Intl Generator');
|
49
|
+
console.log(_chalk.default.yellow('----------------------\n'));
|
50
|
+
}
|
51
|
+
|
52
|
+
};
|
53
|
+
}
|
54
|
+
|
55
|
+
get writing() {
|
56
|
+
return {
|
57
|
+
packageJSON() {
|
58
|
+
const {
|
59
|
+
'translations-path': translationsPath = null,
|
60
|
+
'output-path': outputPath = null,
|
61
|
+
'json-path': jsonPath = null,
|
62
|
+
'without-id-only': withoutIdOnly = false,
|
63
|
+
locales
|
64
|
+
} = this.options;
|
65
|
+
const intlCommand = `flklr intl --po${withoutIdOnly ? ' --without-id-only' : ''} --output-path$ '${outputPath}' '${translationsPath}'`;
|
66
|
+
this.packageJson.merge({
|
67
|
+
scripts: jsonPath !== null ? {
|
68
|
+
intl: 'npm run intl:build && npm run intl:copy',
|
69
|
+
'intl:build': intlCommand,
|
70
|
+
'intl:copy': `cp ${_path.default.join(outputPath, '*.json')} ${jsonPath}`
|
71
|
+
} : {
|
72
|
+
intl: intlCommand
|
73
|
+
},
|
74
|
+
supportedLocales: locales.split(',')
|
75
|
+
});
|
76
|
+
},
|
77
|
+
|
78
|
+
dependencies() {
|
79
|
+
this.addDevDependencies(['@folklore/cli']);
|
80
|
+
}
|
81
|
+
|
82
|
+
};
|
83
|
+
}
|
84
|
+
|
85
|
+
async install() {
|
86
|
+
if (this.options['skip-install']) {
|
87
|
+
return;
|
88
|
+
}
|
89
|
+
|
90
|
+
await this.spawnCommand('npm', ['install']);
|
91
|
+
}
|
92
|
+
|
93
|
+
};
|
@@ -250,7 +250,7 @@ module.exports = class LaravelGenerator extends _generator.default {
|
|
250
250
|
project_name: this.options['project-name']
|
251
251
|
}).replace(/^(http)?(s)?(:\/\/)?/, 'http$2://');
|
252
252
|
|
253
|
-
this.composeWith('folklore:
|
253
|
+
this.composeWith('folklore:react-app', {
|
254
254
|
'project-name': this.options['project-name'],
|
255
255
|
path: jsSrcPath,
|
256
256
|
'styles-path': stylesSrcPath,
|
@@ -341,11 +341,11 @@ module.exports = class LaravelGenerator extends _generator.default {
|
|
341
341
|
},
|
342
342
|
|
343
343
|
packageJSON() {
|
344
|
-
const jsonPath = this.destinationPath('package.json');
|
345
344
|
const packageJSON = this.fs.exists(jsonPath) ? this.fs.readJSON(jsonPath) : {};
|
346
|
-
|
347
|
-
|
348
|
-
|
345
|
+
this.packageJson.merge(_objectSpread(_objectSpread({}, packageJSON), {}, {
|
346
|
+
scripts: {},
|
347
|
+
devDependencies: {}
|
348
|
+
}));
|
349
349
|
},
|
350
350
|
|
351
351
|
composerJSON() {
|
@@ -0,0 +1,133 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _chalk = _interopRequireDefault(require("chalk"));
|
4
|
+
|
5
|
+
var _glob = _interopRequireDefault(require("glob"));
|
6
|
+
|
7
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
8
|
+
|
9
|
+
var _path = _interopRequireDefault(require("path"));
|
10
|
+
|
11
|
+
var _generator = _interopRequireDefault(require("../../lib/generator"));
|
12
|
+
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
14
|
+
|
15
|
+
module.exports = class LaravelMediathequeGenerator extends _generator.default {
|
16
|
+
constructor(...args) {
|
17
|
+
super(...args);
|
18
|
+
this.argument('project-name', {
|
19
|
+
type: String,
|
20
|
+
required: false
|
21
|
+
});
|
22
|
+
this.argument('overrides', {
|
23
|
+
type: Boolean,
|
24
|
+
required: false,
|
25
|
+
default: false
|
26
|
+
});
|
27
|
+
this.argument('skip-publish', {
|
28
|
+
type: Boolean,
|
29
|
+
required: false,
|
30
|
+
default: false
|
31
|
+
});
|
32
|
+
}
|
33
|
+
|
34
|
+
get prompting() {
|
35
|
+
return {
|
36
|
+
welcome() {
|
37
|
+
if (this.options.quiet) {
|
38
|
+
return;
|
39
|
+
}
|
40
|
+
|
41
|
+
console.log(_chalk.default.yellow('\n----------------------'));
|
42
|
+
console.log('Laravel Mediatheque Generator');
|
43
|
+
console.log(_chalk.default.yellow('----------------------\n'));
|
44
|
+
},
|
45
|
+
|
46
|
+
prompts() {
|
47
|
+
const prompts = [];
|
48
|
+
|
49
|
+
if (!this.options['project-name']) {
|
50
|
+
prompts.push(_generator.default.prompts.project_name);
|
51
|
+
}
|
52
|
+
|
53
|
+
if (!prompts.length) {
|
54
|
+
return null;
|
55
|
+
}
|
56
|
+
|
57
|
+
return this.prompt(prompts).then(answers => {
|
58
|
+
if (answers['project-name']) {
|
59
|
+
this.options['project-name'] = answers['project-name'];
|
60
|
+
}
|
61
|
+
});
|
62
|
+
}
|
63
|
+
|
64
|
+
};
|
65
|
+
}
|
66
|
+
|
67
|
+
get writing() {
|
68
|
+
return {
|
69
|
+
composerJSON() {
|
70
|
+
this.composerJson.merge({
|
71
|
+
require: {
|
72
|
+
'folklore/laravel-folklore': 'v1.x-dev',
|
73
|
+
'folklore/laravel-mediatheque': 'v1.1.x-dev'
|
74
|
+
}
|
75
|
+
});
|
76
|
+
},
|
77
|
+
|
78
|
+
files() {
|
79
|
+
if (!this.options.overrides) {
|
80
|
+
return;
|
81
|
+
}
|
82
|
+
|
83
|
+
const folders = ['app'];
|
84
|
+
folders.forEach(folder => {
|
85
|
+
const templatePath = this.templatePath(folder);
|
86
|
+
const destinationPath = this.destinationPath(folder);
|
87
|
+
|
88
|
+
_glob.default.sync('**', {
|
89
|
+
dot: true,
|
90
|
+
nodir: true,
|
91
|
+
cwd: templatePath
|
92
|
+
}).forEach(file => {
|
93
|
+
const source = _path.default.join(templatePath, file);
|
94
|
+
|
95
|
+
const destination = _path.default.join(destinationPath, file);
|
96
|
+
|
97
|
+
if (file.match(/\.(jpg|jpeg|gif|png)$/i)) {
|
98
|
+
this.fs.copy(source, destination);
|
99
|
+
} else {
|
100
|
+
this.fs.copyTpl(source, destination, {
|
101
|
+
project_name: this.options['project-name']
|
102
|
+
});
|
103
|
+
}
|
104
|
+
});
|
105
|
+
});
|
106
|
+
}
|
107
|
+
|
108
|
+
};
|
109
|
+
}
|
110
|
+
|
111
|
+
get install() {
|
112
|
+
return {
|
113
|
+
composer() {
|
114
|
+
if (this.options['skip-install']) {
|
115
|
+
return;
|
116
|
+
}
|
117
|
+
|
118
|
+
const done = this.async();
|
119
|
+
this.spawnCommand('composer', ['install']).on('close', done);
|
120
|
+
},
|
121
|
+
|
122
|
+
async vendorPublish() {
|
123
|
+
if (this.options['skip-publish']) {
|
124
|
+
return;
|
125
|
+
}
|
126
|
+
|
127
|
+
await this.spawnCommand('php', ['artisan', 'vendor:publish', '--provider=Folklore\\Mediatheque\\ServiceProvider']);
|
128
|
+
}
|
129
|
+
|
130
|
+
};
|
131
|
+
}
|
132
|
+
|
133
|
+
};
|
@@ -1,11 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var _lodash = _interopRequireDefault(require("lodash"));
|
4
|
-
|
5
3
|
var _chalk = _interopRequireDefault(require("chalk"));
|
6
4
|
|
7
5
|
var _glob = _interopRequireDefault(require("glob"));
|
8
6
|
|
7
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
8
|
+
|
9
9
|
var _path = _interopRequireDefault(require("path"));
|
10
10
|
|
11
11
|
var _generator = _interopRequireDefault(require("../../lib/generator"));
|
@@ -19,11 +19,6 @@ module.exports = class LaravelPanneauGenerator extends _generator.default {
|
|
19
19
|
type: String,
|
20
20
|
required: false
|
21
21
|
});
|
22
|
-
this.option('install-npm', {
|
23
|
-
type: Boolean,
|
24
|
-
desc: 'Install NPM dependencies',
|
25
|
-
defaults: false
|
26
|
-
});
|
27
22
|
}
|
28
23
|
|
29
24
|
get prompting() {
|
@@ -62,24 +57,31 @@ module.exports = class LaravelPanneauGenerator extends _generator.default {
|
|
62
57
|
get writing() {
|
63
58
|
return {
|
64
59
|
composerJSON() {
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
60
|
+
this.composerJson.merge({
|
61
|
+
require: {
|
62
|
+
'folklore/laravel-panneau': 'v1.2.x-dev'
|
63
|
+
}
|
64
|
+
});
|
70
65
|
},
|
71
66
|
|
72
67
|
packageJSON() {
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
this.
|
68
|
+
this.addDependencies(['@panneau/app@^1.0.0-alpha.193', '@panneau/core@^1.0.0-alpha.193']);
|
69
|
+
},
|
70
|
+
|
71
|
+
routes() {
|
72
|
+
const source = this.templatePath('routes.php');
|
73
|
+
const destination = this.destinationPath('routes/panneau.php');
|
74
|
+
|
75
|
+
if (this.fs.exists(destination)) {
|
76
|
+
this.fs.delete(destination);
|
77
|
+
}
|
78
|
+
|
79
|
+
this.fs.copyTpl(source, destination, {});
|
78
80
|
},
|
79
81
|
|
80
82
|
layout() {
|
81
83
|
const source = this.templatePath('layout.blade.php');
|
82
|
-
const destination = this.destinationPath('resources/views/vendor/panneau/
|
84
|
+
const destination = this.destinationPath('resources/views/vendor/panneau/layout.blade.php');
|
83
85
|
|
84
86
|
if (this.fs.exists(destination)) {
|
85
87
|
this.fs.delete(destination);
|
@@ -88,8 +90,29 @@ module.exports = class LaravelPanneauGenerator extends _generator.default {
|
|
88
90
|
this.fs.copyTpl(source, destination, {});
|
89
91
|
},
|
90
92
|
|
93
|
+
app() {
|
94
|
+
const source = this.templatePath('app.blade.php');
|
95
|
+
const destination = this.destinationPath('resources/views/vendor/panneau/app.blade.php');
|
96
|
+
|
97
|
+
if (this.fs.exists(destination)) {
|
98
|
+
this.fs.delete(destination);
|
99
|
+
}
|
100
|
+
|
101
|
+
this.fs.copyTpl(source, destination, {});
|
102
|
+
},
|
103
|
+
|
104
|
+
indexJs() {
|
105
|
+
const source = this.templatePath('index.js');
|
106
|
+
const destination = this.destinationPath('resources/assets/js/index.js');
|
107
|
+
this.fs.copyTpl(source, destination, {});
|
108
|
+
},
|
109
|
+
|
110
|
+
npmDependencies() {
|
111
|
+
this.addDependencies(['@panneau/app@^1.0.0-alpha.193', '@panneau/core@^1.0.0-alpha.193', '@panneau/data@^1.0.0-alpha.193', '@panneau/field-text@^1.0.0-alpha.193', '@panneau/field-localized@^1.0.0-alpha.193']);
|
112
|
+
},
|
113
|
+
|
91
114
|
files() {
|
92
|
-
const folders = ['app', 'resources'];
|
115
|
+
const folders = ['app', 'resources', 'lang'];
|
93
116
|
folders.forEach(folder => {
|
94
117
|
const templatePath = this.templatePath(folder);
|
95
118
|
const destinationPath = this.destinationPath(folder);
|
@@ -119,30 +142,28 @@ module.exports = class LaravelPanneauGenerator extends _generator.default {
|
|
119
142
|
|
120
143
|
get install() {
|
121
144
|
return {
|
122
|
-
|
145
|
+
async npm() {
|
123
146
|
if (this.options['skip-install']) {
|
124
147
|
return;
|
125
148
|
}
|
126
149
|
|
127
|
-
|
128
|
-
this.spawnCommand('composer', ['install']).on('close', done);
|
150
|
+
await this.spawnCommand('npm', ['install']);
|
129
151
|
},
|
130
152
|
|
131
|
-
|
153
|
+
async composer() {
|
132
154
|
if (this.options['skip-install']) {
|
133
155
|
return;
|
134
156
|
}
|
135
157
|
|
136
|
-
|
137
|
-
this.spawnCommand('php', ['artisan', 'vendor:publish', '--all']).on('close', done);
|
158
|
+
await this.spawnCommand('composer', ['install']);
|
138
159
|
},
|
139
160
|
|
140
|
-
|
141
|
-
if (this.options['skip-install']
|
161
|
+
async vendorPublish() {
|
162
|
+
if (this.options['skip-install']) {
|
142
163
|
return;
|
143
164
|
}
|
144
165
|
|
145
|
-
this.
|
166
|
+
await this.spawnCommand('php', ['artisan', 'vendor:publish', '--provider=Panneau\\ServiceProvider']);
|
146
167
|
}
|
147
168
|
|
148
169
|
};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<?php
|
2
|
+
|
3
|
+
namespace App\Contracts\Repositories;
|
4
|
+
|
5
|
+
use Folklore\Contracts\Repositories\Pages as BasePages;
|
6
|
+
use App\Contracts\Resources\Page as PageResource;
|
7
|
+
|
8
|
+
interface Pages extends BasePages
|
9
|
+
{
|
10
|
+
public function findById(string $id): ?PageResource;
|
11
|
+
|
12
|
+
public function findByHandle(string $handle): ?PageResource;
|
13
|
+
|
14
|
+
public function findBySlug(string $slug, string $locale = null): ?PageResource;
|
15
|
+
|
16
|
+
public function create(array $data): PageResource;
|
17
|
+
|
18
|
+
public function update(string $id, array $data): ?PageResource;
|
19
|
+
}
|