@cley_faye/boilerplate 3.1.0 → 3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -27,12 +27,11 @@ For webapp building:
|
|
|
27
27
|
- babel-plugin-transform-define
|
|
28
28
|
- core-js
|
|
29
29
|
- @babel/plugin-transform-runtime
|
|
30
|
-
- @keeex/grunt-contrib-imagemin
|
|
31
30
|
- grunt-contrib-pug
|
|
32
31
|
- grunt-contrib-copy
|
|
33
32
|
- grunt-contrib-watch
|
|
34
33
|
- grunt-sass
|
|
35
|
-
-
|
|
34
|
+
- sass
|
|
36
35
|
- grunt-webpack
|
|
37
36
|
- grunt
|
|
38
37
|
|
|
@@ -155,6 +154,7 @@ The webpack options support a host of properties:
|
|
|
155
154
|
- babelPlugins: array of plugins for Babel
|
|
156
155
|
- mode: The build mode. "development", "production" or "none"
|
|
157
156
|
- defines: a record of value to define using Babel transform-define
|
|
157
|
+
- resolve: a custom "resolve" object for webpack config
|
|
158
158
|
|
|
159
159
|
### SASS
|
|
160
160
|
All `.sass` and `.scss` files in the webapp directory will be processed as `.css` files in the
|
|
@@ -200,7 +200,7 @@ module.exports = grunt => {
|
|
|
200
200
|
)
|
|
201
201
|
);
|
|
202
202
|
grunt.initConfig(baseGruntConfig);
|
|
203
|
-
grunt.
|
|
203
|
+
grunt.registerTask(
|
|
204
204
|
"myWebApp",
|
|
205
205
|
"Build the webapp",
|
|
206
206
|
requiredTasks
|
package/lib/grunt/args.d.ts
CHANGED
|
@@ -66,6 +66,10 @@ export declare type OptionDefinition = OptionDefinitionString | OptionDefinition
|
|
|
66
66
|
* Expected options from command line
|
|
67
67
|
*/
|
|
68
68
|
export declare type ConfigDefinition = Record<string, OptionDefinition>;
|
|
69
|
+
/**
|
|
70
|
+
* Display help to the user
|
|
71
|
+
*/
|
|
72
|
+
export declare const displayHelp: (configDef: ConfigDefinition) => void;
|
|
69
73
|
/**
|
|
70
74
|
* Construct the full config object from command line values.
|
|
71
75
|
*
|
package/lib/grunt/args.js
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
*/
|
|
27
27
|
"use strict";
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.getOptionsFromGruntCLI = exports.OptType = void 0;
|
|
29
|
+
exports.getOptionsFromGruntCLI = exports.displayHelp = exports.OptType = void 0;
|
|
30
30
|
const util_js_1 = require("../util.js");
|
|
31
31
|
// eslint-disable-next-line no-shadow
|
|
32
32
|
var OptType;
|
|
@@ -125,6 +125,7 @@ const displayHelp = (configDef) => {
|
|
|
125
125
|
outputHelp("Accepted command line arguments:");
|
|
126
126
|
Object.keys(configDef).forEach(configKey => displayHelpForConfigKey(configKey, configDef[configKey]));
|
|
127
127
|
};
|
|
128
|
+
exports.displayHelp = displayHelp;
|
|
128
129
|
/**
|
|
129
130
|
* Construct the full config object from command line values.
|
|
130
131
|
*
|
|
@@ -132,7 +133,7 @@ const displayHelp = (configDef) => {
|
|
|
132
133
|
*/
|
|
133
134
|
const getOptionsFromGruntCLI = (optionProvider, configDef) => {
|
|
134
135
|
if (getFromOptionProvider("help", optionProvider) === true) {
|
|
135
|
-
displayHelp(configDef);
|
|
136
|
+
(0, exports.displayHelp)(configDef);
|
|
136
137
|
return null;
|
|
137
138
|
}
|
|
138
139
|
const result = {};
|
|
@@ -18,10 +18,10 @@ export interface ImageOptions extends BaseOptions {
|
|
|
18
18
|
* Options for the image task configuration.
|
|
19
19
|
*
|
|
20
20
|
* @param [imageOptions.options]
|
|
21
|
-
* Options to pass to
|
|
21
|
+
* Options to pass to @cley_faye/imagemin-lite.
|
|
22
22
|
*
|
|
23
23
|
* @param [imageOptions.sourcePath]
|
|
24
|
-
* Path where the
|
|
24
|
+
* Path where the source images can be found. Subdirectories will be searched.
|
|
25
25
|
* Default to "webres/<targetName>"
|
|
26
26
|
*
|
|
27
27
|
* @param [imageOptions.outputPath]
|
|
@@ -47,10 +47,10 @@ const handledExtensions = [
|
|
|
47
47
|
* Options for the image task configuration.
|
|
48
48
|
*
|
|
49
49
|
* @param [imageOptions.options]
|
|
50
|
-
* Options to pass to
|
|
50
|
+
* Options to pass to @cley_faye/imagemin-lite.
|
|
51
51
|
*
|
|
52
52
|
* @param [imageOptions.sourcePath]
|
|
53
|
-
* Path where the
|
|
53
|
+
* Path where the source images can be found. Subdirectories will be searched.
|
|
54
54
|
* Default to "webres/<targetName>"
|
|
55
55
|
*
|
|
56
56
|
* @param [imageOptions.outputPath]
|
|
@@ -63,6 +63,7 @@ const handledExtensions = [
|
|
|
63
63
|
*/
|
|
64
64
|
const handle = (gruntConfig, targetName, imageOptions) => {
|
|
65
65
|
const handledFiles = handledExtensions.map(ext => `**/*${ext}`);
|
|
66
|
+
// TODO use @cley_faye/imagemin-lite once it exists
|
|
66
67
|
const newImageTask = {
|
|
67
68
|
options: imageOptions.options,
|
|
68
69
|
files: [
|
|
@@ -75,7 +76,7 @@ const handle = (gruntConfig, targetName, imageOptions) => {
|
|
|
75
76
|
],
|
|
76
77
|
};
|
|
77
78
|
const requiredTasks = [
|
|
78
|
-
(0, util_js_1.insertTask)(gruntConfig, "
|
|
79
|
+
(0, util_js_1.insertTask)(gruntConfig, "copy", `${targetName}_image`, newImageTask),
|
|
79
80
|
];
|
|
80
81
|
const watchTasks = [
|
|
81
82
|
{
|
|
@@ -45,6 +45,7 @@ export interface WebpackOptions extends BaseOptions {
|
|
|
45
45
|
plugins?: Array<Record<string, unknown>>;
|
|
46
46
|
babelPlugins?: Array<Record<string, unknown>>;
|
|
47
47
|
defines?: Record<string, string>;
|
|
48
|
+
resolve?: unknown;
|
|
48
49
|
}
|
|
49
50
|
/** Add a webpack task for the reactApp recipe
|
|
50
51
|
*
|
|
@@ -221,6 +221,7 @@ const handle = (gruntConfig, targetName, webpackOptions) => {
|
|
|
221
221
|
eslintPlugin(),
|
|
222
222
|
...webpackOptions.plugins ?? [],
|
|
223
223
|
],
|
|
224
|
+
resolve: webpackOptions.resolve,
|
|
224
225
|
};
|
|
225
226
|
// Special case: I'm not sure I can move options in the task-specific part of
|
|
226
227
|
// the configuration, so I add it at the toplevel of the "webpack" task.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cley_faye/boilerplate",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.2",
|
|
4
4
|
"description": "Boilerplate code generator for generic projects",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
},
|
|
18
18
|
"homepage": "https://github.com/CleyFaye/boilerplate#readme",
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@keeex/eslint-config": "^1.
|
|
20
|
+
"@keeex/eslint-config": "^1.5.9",
|
|
21
21
|
"@types/express": "^4.17.11",
|
|
22
22
|
"@types/grunt": "^0.4.25",
|
|
23
23
|
"@types/http-errors": "^1.8.0",
|
|
24
24
|
"@types/node": "^16.0.0",
|
|
25
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
26
|
-
"@typescript-eslint/parser": "^
|
|
25
|
+
"@typescript-eslint/eslint-plugin": "^5.3.1",
|
|
26
|
+
"@typescript-eslint/parser": "^5.3.1",
|
|
27
27
|
"eslint": "^7.20.0",
|
|
28
|
-
"eslint-plugin-promise": "^5.1.
|
|
28
|
+
"eslint-plugin-promise": "^5.1.1",
|
|
29
29
|
"eslint-webpack-plugin": "^3.0.1",
|
|
30
30
|
"express-winston": "^4.0.5",
|
|
31
31
|
"grunt": "^1.4.1",
|
|
@@ -49,11 +49,10 @@
|
|
|
49
49
|
"express-winston": "4.x",
|
|
50
50
|
"grunt": "1.x",
|
|
51
51
|
"grunt-contrib-copy": "1.x",
|
|
52
|
-
"@keeex/grunt-contrib-imagemin": "4.x",
|
|
53
52
|
"grunt-contrib-pug": "3.x",
|
|
54
53
|
"grunt-contrib-watch": "1.x",
|
|
55
54
|
"grunt-sass": "3.x",
|
|
56
|
-
"grunt-webpack": "
|
|
55
|
+
"grunt-webpack": "5.x",
|
|
57
56
|
"sass": "1.x",
|
|
58
57
|
"winston": "3.x"
|
|
59
58
|
},
|
|
@@ -79,9 +78,6 @@
|
|
|
79
78
|
"grunt-contrib-pug": {
|
|
80
79
|
"optional": true
|
|
81
80
|
},
|
|
82
|
-
"grunt-contrib-imagemin": {
|
|
83
|
-
"optional": true
|
|
84
|
-
},
|
|
85
81
|
"@babel/plugin-transform-runtime": {
|
|
86
82
|
"optional": true
|
|
87
83
|
},
|