sqlaravel 1.0.19 → 1.0.21

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
@@ -16,3 +16,30 @@ Base to start projects in Laravel, simply and quickly
16
16
  npm i sqlaravel
17
17
  npm explore sisass -- npm run init -- --path ../../resources
18
18
  ```
19
+
20
+ ## Use
21
+
22
+ sqLaravel works with **Gulp**, to be able to use it, it is necessary to be located in the resources folder and execute gulp command
23
+
24
+ ```bash
25
+ cd resources
26
+ gulp
27
+ ```
28
+
29
+ ### Parameters for the gulp command
30
+
31
+ #### minjs (boolean: false)
32
+
33
+ True to minify the js files.
34
+
35
+ ```bash
36
+ gulp --minjs true
37
+ ```
38
+
39
+ or
40
+
41
+ ```bash
42
+ gulp --minjs
43
+ ```
44
+
45
+
@@ -0,0 +1,22 @@
1
+ exports.arg = (argList => {
2
+ let arg = {}, a, opt, thisOpt, curOpt;
3
+
4
+ for (a = 0; a < argList.length; a++) {
5
+
6
+ thisOpt = argList[a].trim();
7
+ opt = thisOpt.replace(/^\-+/, '');
8
+
9
+ if (opt === thisOpt) {
10
+
11
+ // argument value
12
+ if (curOpt) arg[curOpt] = opt;
13
+ curOpt = null;
14
+
15
+ } else {
16
+ // argument name
17
+ curOpt = opt;
18
+ arg[curOpt] = true;
19
+ }
20
+ }
21
+ return arg;
22
+ })(process.argv);
@@ -0,0 +1,25 @@
1
+ exports.stringToBoolean = ((string) => {
2
+ let result;
3
+
4
+ string = String(string);
5
+
6
+ switch (string.toLowerCase().trim()) {
7
+ case "true":
8
+ case "yes":
9
+ case "1":
10
+ result = true;
11
+ break;
12
+
13
+ case "false":
14
+ case "no":
15
+ case "0":
16
+ result = false;
17
+ break;
18
+
19
+ default:
20
+ result = false;
21
+ break;
22
+ }
23
+
24
+ return result;
25
+ });
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,3 +1,5 @@
1
+ /* Update: 20220929 */
2
+
1
3
  "use strict";
2
4
 
3
5
  import gulp from "gulp";
@@ -7,13 +9,17 @@ import { deleteAsync } from "del";
7
9
  import merge from "merge-stream";
8
10
  import eslint from "gulp-eslint";
9
11
  import uglify from "gulp-uglify";
12
+ import arg from "./config/arg.js";
13
+ import fn from "./config/fn.js";
10
14
 
11
15
  const
16
+ p = arg.arg,
17
+
12
18
  { series, parallel, src, dest, task, watch } = gulp,
13
- sass = gulpSass(dartSass);
14
- ;
19
+ sass = gulpSass(dartSass),
20
+
21
+ minjs = fn.stringToBoolean(p.minjs) || false,
15
22
 
16
- const
17
23
  /*
18
24
  svgmin = require("gulp-svgmin"),
19
25
  postcss = require("gulp-postcss"),
@@ -24,11 +30,17 @@ const
24
30
  paths = {
25
31
  js: {
26
32
  src: [
27
- "js/*.js"
33
+ "js/*.js",
34
+ "js/modules/*.js"
28
35
 
29
36
  ],
30
37
  dest: [
31
- "../public/js/"
38
+ "../public/js/",
39
+ "../public/js/modules/",
40
+ ],
41
+ mindest: [
42
+ "../public/js/min/",
43
+ "../public/js/modules/min",
32
44
  ]
33
45
  }
34
46
  },
@@ -41,11 +53,11 @@ const
41
53
  ],
42
54
  paths_dest_css = [
43
55
  "../public/css/",
44
- "../public/css/components/"
56
+ "../public/css/modules/"
45
57
  ],
46
58
  paths_compile_scss = [
47
59
  "assets/scss/*.scss",
48
- "assets/scss/components/*.scss"
60
+ "assets/scss/modules/*.scss"
49
61
  ],
50
62
 
51
63
  path_svg = "assets/scss/svg/*.scss",
@@ -57,10 +69,12 @@ const
57
69
 
58
70
  paths_js = [
59
71
  "assets/js/*.js",
60
- "assets/js/components/*.js"
72
+ "assets/js/modules/*.js"
61
73
  ]
62
74
  ;
63
75
 
76
+ console.dir(minjs);
77
+
64
78
  /*
65
79
  gulp.task("delete_svg", function () {
66
80
  console.log("");
@@ -120,44 +134,6 @@ gulp.task("scss", function () {
120
134
  });
121
135
  */
122
136
 
123
- task("lint", function() {
124
- console.log("");
125
- console.log("---- ES-LINT ----");
126
-
127
- let task_array = [];
128
-
129
- for (let i = 0; i < paths.js.src.length; i++) {
130
- task_array[i] = src(paths.js.src[i])
131
- .pipe(eslint({}))
132
- .pipe(eslint.format())
133
- .pipe(eslint.results(results => {
134
- // Called once for all ESLint results.
135
- console.log(`Total Results: ${results.length}`);
136
- console.log(`Total Warnings: ${results.warningCount}`);
137
- console.log(`Total Errors: ${results.errorCount}`);
138
- console.log("");
139
- }));
140
- }
141
-
142
- console.log("");
143
- return merge(...task_array);
144
- });
145
-
146
- task("js", function () {
147
- console.log("");
148
- console.log("---- JS ----");
149
-
150
- let task_array = [];
151
-
152
- for (let i = 0; i < paths.js.src.length; i++) {
153
- task_array[i] = src(paths.js.src[i])
154
- .pipe(uglify())
155
- .pipe(gulp.dest(paths.js.dest));
156
- }
157
-
158
- console.log("");
159
- return merge(...task_array);
160
- });
161
137
 
162
138
  /*
163
139
  gulp.task("jsonlint", function () {
@@ -204,6 +180,50 @@ task("watch", function () {
204
180
  });
205
181
  */
206
182
 
183
+ task("lint", function() {
184
+ console.log("");
185
+ console.log("---- ES-LINT ----");
186
+
187
+ let task_array = [];
188
+
189
+ for (let i = 0; i < paths.js.src.length; i++) {
190
+ task_array[i] = src(paths.js.src[i])
191
+ .pipe(eslint({}))
192
+ .pipe(eslint.format())
193
+ .pipe(eslint.results(results => {
194
+ // Called once for all ESLint results.
195
+ console.log(`Total Results: ${results.length}`);
196
+ console.log(`Total Warnings: ${results.warningCount}`);
197
+ console.log(`Total Errors: ${results.errorCount}`);
198
+ console.log("");
199
+ }));
200
+ }
201
+
202
+ console.log("");
203
+ return merge(...task_array);
204
+ });
205
+
206
+ task("js", function () {
207
+ console.log("");
208
+ console.log("---- JS ----");
209
+
210
+ let task_array = [];
211
+
212
+ for (let i = 0; i < paths.js.src.length; i++) {
213
+ if (minjs) {
214
+ task_array[i] = src(paths.js.src[i])
215
+ .pipe(uglify())
216
+ .pipe(gulp.dest(paths.js.mindest[i]));
217
+ } else {
218
+ task_array[i] = src(paths.js.src[i])
219
+ .pipe(gulp.dest(paths.js.dest[i]));
220
+ }
221
+ }
222
+
223
+ console.log("");
224
+ return merge(...task_array);
225
+ });
226
+
207
227
  function watchFiles() {
208
228
  console.log("");
209
229
  console.log("---- INICIADO WATCH ----");
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sqlaravel",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "description": "Base to start projects in Laravel, simply and quickly",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -28,6 +28,7 @@
28
28
  "gulp-postcss": "^9.0.1",
29
29
  "gulp-sass": "^5.1.0",
30
30
  "gulp-svgmin": "^4.1.0",
31
+ "gulp-uglify": "^3.0.2",
31
32
  "merge-stream": "^2.0.0",
32
33
  "postcss": "^8.4.14",
33
34
  "postcss-inline-svg": "^5.0.0",