@mobilabs/es6lib 2.2.0 → 2.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.
@@ -1,5 +1,5 @@
1
1
  /*! ****************************************************************************
2
- * ES6lib v2.2.0
2
+ * ES6lib v2.2.2
3
3
  *
4
4
  * A template for writing pure ES6 Javascript libraries.
5
5
  * (you can download it from npm or github repositories)
@@ -313,14 +313,14 @@
313
313
  const obj = Object.create(methods);
314
314
  obj._library = {
315
315
  name: 'ES6lib',
316
- version: '2.2.0',
316
+ version: '2.2.2',
317
317
  };
318
318
  return obj;
319
319
  };
320
320
 
321
321
  // Attaches constants to ES6lib that provide name and version of the lib.
322
322
  ES6lib.NAME = 'ES6lib';
323
- ES6lib.VERSION = '2.2.0';
323
+ ES6lib.VERSION = '2.2.2';
324
324
 
325
325
 
326
326
  // -- Private Static Methods -----------------------------------------------
@@ -1,5 +1,5 @@
1
1
  /*! ****************************************************************************
2
- * ES6lib v2.2.0
2
+ * ES6lib v2.2.2
3
3
  *
4
4
  * A template for writing pure ES6 Javascript libraries.
5
5
  * (you can download it from npm or github repositories)
@@ -8,4 +8,4 @@
8
8
  * at: http://www.opensource.org/licenses/mit-license.php).
9
9
  * Built from {{boiler:name}} v{{boiler:name:version}}.
10
10
  * ************************************************************************** */
11
- !function(t,e){"use strict";"function"==typeof define&&define.amd?define([""],e):"object"==typeof exports?module.exports=e(t):t.ES6lib=e(t)}(this,(t=>{"use strict";let e,n;const i={Public:{}};return n=function(t,e){const n=Object.keys(e);for(let i=0;i<n.length;i++)t[n[i]]=e[n[i]]},function(){const t=i.Public;n(t,{getString:()=>"I am a string!",getArray:()=>[1,2,3]})}(),function(){const n=i.Public,r=t.ES6lib;let o;e=function(){const t=Object.create(o);return t._library={name:"ES6lib",version:"2.2.0"},t},e.NAME="ES6lib",e.VERSION="2.2.0",e._setTestMode=function(){return[]},e.noConflict=function(){return t.ES6lib=r,this},o={whoami(){return this._library},getString:()=>n.getString(),getArray:()=>n.getArray()}}(),e}));
11
+ !function(t,e){"use strict";"function"==typeof define&&define.amd?define([""],e):"object"==typeof exports?module.exports=e(t):t.ES6lib=e(t)}(this,(t=>{"use strict";let e,n;const i={Public:{}};return n=function(t,e){const n=Object.keys(e);for(let i=0;i<n.length;i++)t[n[i]]=e[n[i]]},function(){const t=i.Public;n(t,{getString:()=>"I am a string!",getArray:()=>[1,2,3]})}(),function(){const n=i.Public,r=t.ES6lib;let o;e=function(){const t=Object.create(o);return t._library={name:"ES6lib",version:"2.2.2"},t},e.NAME="ES6lib",e.VERSION="2.2.2",e._setTestMode=function(){return[]},e.noConflict=function(){return t.ES6lib=r,this},o={whoami(){return this._library},getString:()=>n.getString(),getArray:()=>n.getArray()}}(),e}));
@@ -1,5 +1,5 @@
1
1
  /*! ****************************************************************************
2
- * ES6lib v2.2.0
2
+ * ES6lib v2.2.2
3
3
  *
4
4
  * A template for writing pure ES6 Javascript libraries.
5
5
  * (you can download it from npm or github repositories)
@@ -8,4 +8,4 @@
8
8
  * at: http://www.opensource.org/licenses/mit-license.php).
9
9
  * Built from {{boiler:name}} v{{boiler:name:version}}.
10
10
  * ************************************************************************** */
11
- const $__ES6GLOB={};!function(t,e){"use strict";"function"==typeof define&&define.amd?define([""],e):"object"==typeof exports?module.exports=e(t):t.ES6lib=e(t)}($__ES6GLOB,(t=>{"use strict";let e,n;const i={Public:{}};return n=function(t,e){const n=Object.keys(e);for(let i=0;i<n.length;i++)t[n[i]]=e[n[i]]},function(){const t=i.Public;n(t,{getString:()=>"I am a string!",getArray:()=>[1,2,3]})}(),function(){const n=i.Public,r=t.ES6lib;let o;e=function(){const t=Object.create(o);return t._library={name:"ES6lib",version:"2.2.0"},t},e.NAME="ES6lib",e.VERSION="2.2.0",e._setTestMode=function(){return[]},e.noConflict=function(){return t.ES6lib=r,this},o={whoami(){return this._library},getString:()=>n.getString(),getArray:()=>n.getArray()}}(),e}));export default $__ES6GLOB.ES6lib;
11
+ const $__ES6GLOB={};!function(t,e){"use strict";"function"==typeof define&&define.amd?define([""],e):"object"==typeof exports?module.exports=e(t):t.ES6lib=e(t)}($__ES6GLOB,(t=>{"use strict";let e,n;const i={Public:{}};return n=function(t,e){const n=Object.keys(e);for(let i=0;i<n.length;i++)t[n[i]]=e[n[i]]},function(){const t=i.Public;n(t,{getString:()=>"I am a string!",getArray:()=>[1,2,3]})}(),function(){const n=i.Public,r=t.ES6lib;let o;e=function(){const t=Object.create(o);return t._library={name:"ES6lib",version:"2.2.2"},t},e.NAME="ES6lib",e.VERSION="2.2.2",e._setTestMode=function(){return[]},e.noConflict=function(){return t.ES6lib=r,this},o={whoami(){return this._library},getString:()=>n.getString(),getArray:()=>n.getArray()}}(),e}));export default $__ES6GLOB.ES6lib;
@@ -1,5 +1,5 @@
1
1
  /*! ****************************************************************************
2
- * ES6lib v2.2.0
2
+ * ES6lib v2.2.2
3
3
  *
4
4
  * A template for writing pure ES6 Javascript libraries.
5
5
  * (you can download it from npm or github repositories)
@@ -314,14 +314,14 @@ const $__ES6GLOB = {};
314
314
  const obj = Object.create(methods);
315
315
  obj._library = {
316
316
  name: 'ES6lib',
317
- version: '2.2.0',
317
+ version: '2.2.2',
318
318
  };
319
319
  return obj;
320
320
  };
321
321
 
322
322
  // Attaches constants to ES6lib that provide name and version of the lib.
323
323
  ES6lib.NAME = 'ES6lib';
324
- ES6lib.VERSION = '2.2.0';
324
+ ES6lib.VERSION = '2.2.2';
325
325
 
326
326
 
327
327
  // -- Private Static Methods -----------------------------------------------
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mobilabs/es6lib",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "description": "A template for writing pure ES6 Javascript libraries",
5
5
  "main": "index.js",
6
6
  "minified": "_dist/lib/es6lib.min.js",
@@ -12,18 +12,18 @@
12
12
  "scripts": {
13
13
  "general": " --- GENERAL ---",
14
14
 
15
- "build:js": " --- JAVASCRIPT --- ",
15
+ "build:js": " --- BUILDING JAVASCRIPT --- ",
16
16
  "build:js:dev": "node scripts/build.js.dev.js $1",
17
17
  "build:js:prod": "node scripts/build.js.prod.js $1",
18
18
 
19
- "build:css": " --- CSS --- ",
19
+ "build:css": " --- BUILDING CSS --- ",
20
20
 
21
- "build:generic": " --- BUILD (GENERIC) --- ",
21
+ "build:generic": " --- BUILDING (GENERIC) --- ",
22
22
 
23
- "build:development": " --- BUILD (DEVELOPMENT) --- ",
23
+ "build:development": " --- BUILDING (DEVELOPMENT) --- ",
24
24
  "build:dev": "npm run build:js:dev",
25
25
 
26
- "build:production": " --- BUILD (PRODUCTION) --- ",
26
+ "build:production": " --- BUILDING (PRODUCTION) --- ",
27
27
  "build:skeleton:prod": "node scripts/build.skeleton.prod.js $1",
28
28
  "prebuild:prod": "npm run build:dev && npm run build:skeleton:prod",
29
29
  "build:prod": "npm run build:js:prod",
@@ -42,14 +42,13 @@
42
42
  "watch:js": "nodemon --watch './src/**/*.js' --exec npm run build:dev",
43
43
  "watch": "npm run watch:js",
44
44
 
45
- "deployment": " --- DEPLOYMENT --- ",
45
+ "deployment": " --- DEPLOYING --- ",
46
46
  "dep:prod": "rm -rf _dist-$npm_package_version && npm run build:prod && cp -r _dist _dist-$npm_package_version",
47
47
  "dep:private:package": "npm run build:prod && node scripts/dep.private.js && sh scripts/compress.sh ${npm_package_name} ${npm_package_version} @mobilabs",
48
- "dep:npm:private:package": "npm pack && sh scripts/dep.npm.private.sh ${npm_package_name} ${npm_package_version} @mobilabs",
48
+ "dep:npm:private:package": "npm run build:prod && npm pack && sh scripts/dep.npm.private.sh ${npm_package_name} ${npm_package_version} @mobilabs",
49
49
 
50
50
  "others": " --- OTHERS ---",
51
- "prepare": "husky install",
52
- "doc": ""
51
+ "prepare": "husky install"
53
52
  },
54
53
  "repository": {
55
54
  "type": "git",
@@ -85,6 +84,7 @@
85
84
  "eslint": "^8.56.0",
86
85
  "eslint-config-airbnb-base": "^15.0.0",
87
86
  "eslint-plugin-import": "^2.29.1",
87
+ "http-server": "^14.1.1",
88
88
  "husky": "^8.0.3",
89
89
  "mocha": "^10.2.0",
90
90
  "nodemon": "^3.0.2",
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Does ...
5
5
  *
6
- * build:template script is a framework to build npm build scripts;
6
+ * build:template script is a framework to build npm build scripts.
7
7
  *
8
8
  * Private Functions:
9
9
  * . _help displays the help message,
@@ -86,13 +86,13 @@ function _help() {
86
86
  /**
87
87
  * Removes the previous build.
88
88
  *
89
- * @function ()
89
+ * @function ([arg1])
90
90
  * @private
91
- * @param {} -,
91
+ * @param {Function} the function to call at the completion,
92
92
  * @returns {Object} returns a promise,
93
93
  * @since 0.0.0
94
94
  */
95
- function _clean() {
95
+ function _clean(done) {
96
96
  const d1 = new Date();
97
97
  process.stdout.write('Starting \'\x1b[36mclean\x1b[89m\x1b[0m\'...\n');
98
98
 
@@ -106,6 +106,7 @@ function _clean() {
106
106
  const d2 = new Date() - d1;
107
107
  process.stdout.write(`Finished '\x1b[36mclean\x1b[89m\x1b[0m' after \x1b[35m${d2} ms\x1b[89m\x1b[0m\n`);
108
108
  resolve();
109
+ if (done) done();
109
110
  });
110
111
  });
111
112
  });
@@ -122,13 +123,13 @@ function _clean() {
122
123
  */
123
124
  function _doparallel1(done) {
124
125
  const d1 = new Date();
125
- process.stdout.write('Starting \'\x1b[36mdoparallel1\x1b[89m\x1b[0m\'...\n');
126
+ process.stdout.write('Starting \'\x1b[36mdo:parallel1\x1b[89m\x1b[0m\'...\n');
126
127
 
127
128
  fs.writeFile(`${destination}/generic1.js`, 'bla bla', { encoding: 'utf8' }, (err) => {
128
129
  if (err) throw new Error(err);
129
130
 
130
131
  const d2 = new Date() - d1;
131
- process.stdout.write(`Finished '\x1b[36mdodoparallel1\x1b[89m\x1b[0m' after \x1b[35m${d2} ms\x1b[89m\x1b[0m\n`);
132
+ process.stdout.write(`Finished '\x1b[36mdo:doparallel1\x1b[89m\x1b[0m' after \x1b[35m${d2} ms\x1b[89m\x1b[0m\n`);
132
133
  done();
133
134
  });
134
135
  }
@@ -144,13 +145,13 @@ function _doparallel1(done) {
144
145
  */
145
146
  function _doparallel2(done) {
146
147
  const d1 = new Date();
147
- process.stdout.write('Starting \'\x1b[36mdoparallel2\x1b[89m\x1b[0m\'...\n');
148
+ process.stdout.write('Starting \'\x1b[36mdo:parallel2\x1b[89m\x1b[0m\'...\n');
148
149
 
149
150
  fs.writeFile(`${destination}/generic2.js`, 'bla bla', { encoding: 'utf8' }, (err) => {
150
151
  if (err) throw new Error(err);
151
152
 
152
153
  const d2 = new Date() - d1;
153
- process.stdout.write(`Finished '\x1b[36mdodoparallel2\x1b[89m\x1b[0m' after \x1b[35m${d2} ms\x1b[89m\x1b[0m\n`);
154
+ process.stdout.write(`Finished '\x1b[36mdo:parallel2\x1b[89m\x1b[0m' after \x1b[35m${d2} ms\x1b[89m\x1b[0m\n`);
154
155
  done();
155
156
  });
156
157
  }
@@ -166,7 +167,7 @@ function _doparallel2(done) {
166
167
  */
167
168
  function _delgeneric(done) {
168
169
  const d1 = new Date();
169
- process.stdout.write('Starting \'\x1b[36mdelgeneric\x1b[89m\x1b[0m\'...\n');
170
+ process.stdout.write('Starting \'\x1b[36mdel:generic\x1b[89m\x1b[0m\'...\n');
170
171
 
171
172
  /**
172
173
  * Wait all the processes are completed.
@@ -176,7 +177,7 @@ function _delgeneric(done) {
176
177
  pending -= 1;
177
178
  if (!pending) {
178
179
  const d2 = new Date() - d1;
179
- process.stdout.write(`Finished '\x1b[36mdelgeneric\x1b[89m\x1b[0m' after \x1b[35m${d2} ms\x1b[89m\x1b[0m\n`);
180
+ process.stdout.write(`Finished '\x1b[36mdel:generic\x1b[89m\x1b[0m' after \x1b[35m${d2} ms\x1b[89m\x1b[0m\n`);
180
181
  done();
181
182
  }
182
183
  }
@@ -193,55 +194,58 @@ function _delgeneric(done) {
193
194
  }
194
195
 
195
196
 
196
- // -- Main ---------------------------------------------------------------------
197
+ // -- Public Static Methods ----------------------------------------------------
197
198
 
198
- /**
199
- * Executes the script.
200
- *
201
- * @function ()
202
- * @public
203
- * @param {} -,
204
- * @returns {} -,
205
- * @since 0.0.0
206
- */
207
- async function run() {
208
- const PENDING = 2;
199
+ const Lib = {
209
200
 
210
- if (parsed.help) {
211
- _help();
212
- return;
213
- }
214
-
215
- if (parsed.version) {
216
- process.stdout.write(`version: ${parsed.version}\n`);
217
- return;
218
- }
201
+ /**
202
+ * Executes the script.
203
+ *
204
+ * @method ()
205
+ * @public
206
+ * @param {} -,
207
+ * @returns {} -,
208
+ * @since 0.0.0
209
+ */
210
+ async run() {
211
+ const PENDING = 2;
212
+
213
+ if (parsed.help) {
214
+ _help();
215
+ return;
216
+ }
219
217
 
220
- const d1 = new Date();
221
- process.stdout.write('Starting \'\x1b[36mbuild:xxx:yyy\x1b[89m\x1b[0m\'...\n');
218
+ if (parsed.version) {
219
+ process.stdout.write(`version: ${parsed.version}\n`);
220
+ return;
221
+ }
222
222
 
223
- let pending = PENDING;
224
- /**
225
- * Executes done until completion.
226
- */
227
- function done() {
228
- pending -= 1;
229
- if (!pending) {
230
- _delgeneric(() => {
231
- const d2 = new Date() - d1;
232
- process.stdout.write(`Finished '\x1b[36mbuild:xxx:yyy\x1b[89m\x1b[0m' after \x1b[35m${d2} ms\x1b[89m\x1b[0m\n`);
233
- });
223
+ const d1 = new Date();
224
+ process.stdout.write('Starting \'\x1b[36mbuild:xxx:yyy\x1b[89m\x1b[0m\'...\n');
225
+
226
+ let pending = PENDING;
227
+ /**
228
+ * Executes done until completion.
229
+ */
230
+ function done() {
231
+ pending -= 1;
232
+ if (!pending) {
233
+ _delgeneric(() => {
234
+ const d2 = new Date() - d1;
235
+ process.stdout.write(`Finished '\x1b[36mbuild:xxx:yyy\x1b[89m\x1b[0m' after \x1b[35m${d2} ms\x1b[89m\x1b[0m\n`);
236
+ });
237
+ }
234
238
  }
235
- }
236
239
 
237
- await _clean();
238
- _doparallel1(done);
239
- _doparallel2(done);
240
- }
240
+ await _clean();
241
+ _doparallel1(done);
242
+ _doparallel2(done);
243
+ },
244
+ };
241
245
 
242
246
 
243
- // Start script.
244
- run();
247
+ // -- Where the script starts --------------------------------------------------
248
+ Lib.run();
245
249
 
246
250
 
247
251
  // -- oOo --
@@ -95,10 +95,10 @@ function _help() {
95
95
  /**
96
96
  * Removes the previous build.
97
97
  *
98
- * @function (arg1)
98
+ * @function ([arg1])
99
99
  * @private
100
100
  * @param {Function} the function to call at the completion,
101
- * @returns {} -,
101
+ * @returns {object} returns a promise,
102
102
  * @since 0.0.0
103
103
  */
104
104
  function _clean(done) {
@@ -279,42 +279,45 @@ function _doLibs(done) {
279
279
  }
280
280
 
281
281
 
282
- // -- Main ---------------------------------------------------------------------
282
+ // -- Public Static Methods ----------------------------------------------------
283
283
 
284
- /**
285
- * Executes the script.
286
- *
287
- * @function ()
288
- * @public
289
- * @param {} -,
290
- * @returns {} -,
291
- * @since 0.0.0
292
- */
293
- function run() {
294
- if (parsed.help) {
295
- _help();
296
- return;
297
- }
284
+ const Lib = {
298
285
 
299
- if (parsed.version) {
300
- process.stdout.write(`version: ${parsed.version}\n`);
301
- return;
302
- }
286
+ /**
287
+ * Executes the script.
288
+ *
289
+ * @method ()
290
+ * @public
291
+ * @param {} -,
292
+ * @returns {} -,
293
+ * @since 0.0.0
294
+ */
295
+ async run() {
296
+ if (parsed.help) {
297
+ _help();
298
+ return;
299
+ }
303
300
 
304
- const d1 = new Date();
305
- process.stdout.write('Starting \'\x1b[36mbuild:js:dev\x1b[89m\x1b[0m\'...\n');
301
+ if (parsed.version) {
302
+ process.stdout.write(`version: ${parsed.version}\n`);
303
+ return;
304
+ }
306
305
 
307
- _clean(() => {
308
- _doLibs(() => {
309
- const d2 = new Date() - d1;
310
- process.stdout.write(`Finished '\x1b[36mbuild:js:dev\x1b[89m\x1b[0m' after \x1b[35m${d2} ms\x1b[89m\x1b[0m\n`);
306
+ const d1 = new Date();
307
+ process.stdout.write('Starting \'\x1b[36mbuild:js:dev\x1b[89m\x1b[0m\'...\n');
308
+
309
+ _clean(() => {
310
+ _doLibs(() => {
311
+ const d2 = new Date() - d1;
312
+ process.stdout.write(`Finished '\x1b[36mbuild:js:dev\x1b[89m\x1b[0m' after \x1b[35m${d2} ms\x1b[89m\x1b[0m\n`);
313
+ });
311
314
  });
312
- });
313
- }
315
+ },
316
+ };
314
317
 
315
318
 
316
- // Start script.
317
- run();
319
+ // -- Where the script starts --------------------------------------------------
320
+ Lib.run();
318
321
 
319
322
 
320
323
  // -- oOo --
@@ -9,10 +9,10 @@
9
9
  * Private Functions:
10
10
  * . _help displays the help message,
11
11
  * . _clean removes the previous js production files,
12
- * . _makeminifiedm builds and minifies the ES6 module production file,
13
- * . _makeminified builds and minifies the js production file,
14
- * . _copydevm builds the ES6 module production file,
15
12
  * . _copydev builds the js production file,
13
+ * . _copydevm builds the ES6 module production file,
14
+ * . _makeminified builds and minifies the js production file,
15
+ * . _makeminifiedm builds and minifies the ES6 module production file,
16
16
  * . _doLibs builds the js production libraries,
17
17
  *
18
18
  *
@@ -98,7 +98,7 @@ function _help() {
98
98
  * @function (arg1)
99
99
  * @private
100
100
  * @param {Function} the function to call at the completion,
101
- * @returns {} -,
101
+ * @returns {object} returns a promise,
102
102
  * @since 0.0.0
103
103
  */
104
104
  function _clean(done) {
@@ -122,7 +122,7 @@ function _clean(done) {
122
122
  }
123
123
 
124
124
  /**
125
- * Builds and minifies the ES6 module production file.
125
+ * Builds the js production file.
126
126
  *
127
127
  * @function (arg1)
128
128
  * @private
@@ -130,26 +130,50 @@ function _clean(done) {
130
130
  * @returns {} -,
131
131
  * @since 0.0.0
132
132
  */
133
- function _makeminifiedm(done) {
133
+ function _copydev(done) {
134
134
  const d1 = new Date();
135
- process.stdout.write('Starting \'\x1b[36mmake:minified:es6\x1b[89m\x1b[0m\'...\n');
135
+ process.stdout.write("Starting '\x1b[36mcopy:umd\x1b[89m\x1b[0m'...\n");
136
136
 
137
- fs.readFile(`${libdir}/${name}.mjs`, 'utf8', (err1, data) => {
137
+ fs.readFile(`${libdir}/${name}.js`, 'utf8', (err1, data) => {
138
138
  if (err1) throw new Error(err1);
139
139
 
140
140
  let content = license;
141
- content += data.replace(/\/\*! \*\*\*/g, '/** ***');
141
+ content += data;
142
+ fs.writeFile(`${dist}/lib/${name}.js`, content, { encoding: 'utf8' }, (err2) => {
143
+ if (err2) throw new Error(err2);
142
144
 
143
- minify(content, {})
144
- .then((result) => {
145
- fs.writeFile(`${dist}/lib/${name}.min.mjs`, result.code, { encoding: 'utf8' }, (err2) => {
146
- if (err2) throw new Error(err2);
145
+ const d2 = new Date() - d1;
146
+ process.stdout.write(`Finished '\x1b[36mcopy:umd\x1b[89m\x1b[0m' after \x1b[35m${d2} ms\x1b[89m\x1b[0m\n`);
147
+ done();
148
+ });
149
+ });
150
+ }
147
151
 
148
- const d2 = new Date() - d1;
149
- process.stdout.write(`Finished '\x1b[36mmake:minified:es6\x1b[89m\x1b[0m' after \x1b[35m${d2} ms\x1b[89m\x1b[0m\n`);
150
- done();
151
- });
152
- });
152
+ /**
153
+ * Builds the ES6 module production file.
154
+ *
155
+ * @function (arg1)
156
+ * @private
157
+ * @param {Function} the function to call at the completion,
158
+ * @returns {} -,
159
+ * @since 0.0.0
160
+ */
161
+ function _copydevm(done) {
162
+ const d1 = new Date();
163
+ process.stdout.write("Starting '\x1b[36mcopy:es6\x1b[89m\x1b[0m'...\n");
164
+
165
+ fs.readFile(`${libdir}/${name}.mjs`, 'utf8', (err1, data) => {
166
+ if (err1) throw new Error(err1);
167
+
168
+ let content = license;
169
+ content += data;
170
+ fs.writeFile(`${dist}/lib/${name}.mjs`, content, { encoding: 'utf8' }, (err2) => {
171
+ if (err2) throw new Error(err2);
172
+
173
+ const d2 = new Date() - d1;
174
+ process.stdout.write(`Finished '\x1b[36mcopy:es6\x1b[89m\x1b[0m' after \x1b[35m${d2} ms\x1b[89m\x1b[0m\n`);
175
+ done();
176
+ });
153
177
  });
154
178
  }
155
179
 
@@ -186,7 +210,7 @@ function _makeminified(done) {
186
210
  }
187
211
 
188
212
  /**
189
- * Builds the ES6 module production file.
213
+ * Builds and minifies the ES6 module production file.
190
214
  *
191
215
  * @function (arg1)
192
216
  * @private
@@ -194,50 +218,26 @@ function _makeminified(done) {
194
218
  * @returns {} -,
195
219
  * @since 0.0.0
196
220
  */
197
- function _copydevm(done) {
221
+ function _makeminifiedm(done) {
198
222
  const d1 = new Date();
199
- process.stdout.write("Starting '\x1b[36mcopy:es6\x1b[89m\x1b[0m'...\n");
223
+ process.stdout.write('Starting \'\x1b[36mmake:minified:es6\x1b[89m\x1b[0m\'...\n');
200
224
 
201
225
  fs.readFile(`${libdir}/${name}.mjs`, 'utf8', (err1, data) => {
202
226
  if (err1) throw new Error(err1);
203
227
 
204
228
  let content = license;
205
- content += data;
206
- fs.writeFile(`${dist}/lib/${name}.mjs`, content, { encoding: 'utf8' }, (err2) => {
207
- if (err2) throw new Error(err2);
208
-
209
- const d2 = new Date() - d1;
210
- process.stdout.write(`Finished '\x1b[36mcopy:es6\x1b[89m\x1b[0m' after \x1b[35m${d2} ms\x1b[89m\x1b[0m\n`);
211
- done();
212
- });
213
- });
214
- }
215
-
216
- /**
217
- * Builds the js production file.
218
- *
219
- * @function (arg1)
220
- * @private
221
- * @param {Function} the function to call at the completion,
222
- * @returns {} -,
223
- * @since 0.0.0
224
- */
225
- function _copydev(done) {
226
- const d1 = new Date();
227
- process.stdout.write("Starting '\x1b[36mcopy:umd\x1b[89m\x1b[0m'...\n");
228
-
229
- fs.readFile(`${libdir}/${name}.js`, 'utf8', (err1, data) => {
230
- if (err1) throw new Error(err1);
229
+ content += data.replace(/\/\*! \*\*\*/g, '/** ***');
231
230
 
232
- let content = license;
233
- content += data;
234
- fs.writeFile(`${dist}/lib/${name}.js`, content, { encoding: 'utf8' }, (err2) => {
235
- if (err2) throw new Error(err2);
231
+ minify(content, {})
232
+ .then((result) => {
233
+ fs.writeFile(`${dist}/lib/${name}.min.mjs`, result.code, { encoding: 'utf8' }, (err2) => {
234
+ if (err2) throw new Error(err2);
236
235
 
237
- const d2 = new Date() - d1;
238
- process.stdout.write(`Finished '\x1b[36mcopy:umd\x1b[89m\x1b[0m' after \x1b[35m${d2} ms\x1b[89m\x1b[0m\n`);
239
- done();
240
- });
236
+ const d2 = new Date() - d1;
237
+ process.stdout.write(`Finished '\x1b[36mmake:minified:es6\x1b[89m\x1b[0m' after \x1b[35m${d2} ms\x1b[89m\x1b[0m\n`);
238
+ done();
239
+ });
240
+ });
241
241
  });
242
242
  }
243
243
 
@@ -269,52 +269,55 @@ function _doLibs(done) {
269
269
  }
270
270
 
271
271
 
272
- // -- Main ---------------------------------------------------------------------
272
+ // -- Public Static Methods ----------------------------------------------------
273
273
 
274
- /**
275
- * Executes the script.
276
- *
277
- * @function ()
278
- * @public
279
- * @param {} -,
280
- * @returns {} -,
281
- * @since 0.0.0
282
- */
283
- async function run() {
284
- const PENDING = 1;
274
+ const Lib = {
285
275
 
286
- if (parsed.help) {
287
- _help();
288
- return;
289
- }
276
+ /**
277
+ * Executes the script.
278
+ *
279
+ * @method ()
280
+ * @public
281
+ * @param {} -,
282
+ * @returns {} -,
283
+ * @since 0.0.0
284
+ */
285
+ async run() {
286
+ const PENDING = 1;
287
+
288
+ if (parsed.help) {
289
+ _help();
290
+ return;
291
+ }
290
292
 
291
- if (parsed.version) {
292
- process.stdout.write(`version: ${parsed.version}\n`);
293
- return;
294
- }
293
+ if (parsed.version) {
294
+ process.stdout.write(`version: ${parsed.version}\n`);
295
+ return;
296
+ }
295
297
 
296
- const d1 = new Date();
297
- process.stdout.write('Starting \'\x1b[36mbuild:js:prod\x1b[89m\x1b[0m\'...\n');
298
+ const d1 = new Date();
299
+ process.stdout.write('Starting \'\x1b[36mbuild:js:prod\x1b[89m\x1b[0m\'...\n');
298
300
 
299
- let pending = PENDING;
300
- /**
301
- * Executes done until completion.
302
- */
303
- function done() {
304
- pending -= 1;
305
- if (!pending) {
306
- const d2 = new Date() - d1;
307
- process.stdout.write(`Finished '\x1b[36mbuild:js:prod\x1b[89m\x1b[0m' after \x1b[35m${d2} ms\x1b[89m\x1b[0m\n`);
301
+ let pending = PENDING;
302
+ /**
303
+ * Executes done until completion.
304
+ */
305
+ function done() {
306
+ pending -= 1;
307
+ if (!pending) {
308
+ const d2 = new Date() - d1;
309
+ process.stdout.write(`Finished '\x1b[36mbuild:js:prod\x1b[89m\x1b[0m' after \x1b[35m${d2} ms\x1b[89m\x1b[0m\n`);
310
+ }
308
311
  }
309
- }
310
312
 
311
- await _clean();
312
- _doLibs(done);
313
- }
313
+ await _clean();
314
+ _doLibs(done);
315
+ },
316
+ };
314
317
 
315
318
 
316
- // Start script.
317
- run();
319
+ // -- Where the script starts --------------------------------------------------
320
+ Lib.run();
318
321
 
319
322
 
320
323
  // -- oOo --