@mobilabs/es6lib 2.2.1 → 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.
- package/_dist/lib/es6lib.js +3 -3
- package/_dist/lib/es6lib.min.js +2 -2
- package/_dist/lib/es6lib.min.mjs +2 -2
- package/_dist/lib/es6lib.mjs +3 -3
- package/package.json +1 -1
- package/scripts/_build.template.js +55 -51
- package/scripts/build.js.dev.js +34 -31
- package/scripts/build.js.prod.js +95 -92
- package/scripts/build.skeleton.prod.js +49 -45
- package/scripts/compress.sh +3 -0
- package/scripts/config.js +15 -0
- package/scripts/dep.private.js +47 -43
- package/test/index.html +1 -1
- package/test/int/libbasic.js +3 -0
- package/test/int/libfunctional.js +3 -0
- package/test/int/libprototypal.js +3 -0
- package/test/main.js +3 -0
- package/scripts/_old_build.js.dev.js +0 -284
- package/scripts/_old_build.js.prod.js +0 -294
package/_dist/lib/es6lib.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! ****************************************************************************
|
|
2
|
-
* ES6lib v2.2.
|
|
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.
|
|
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.
|
|
323
|
+
ES6lib.VERSION = '2.2.2';
|
|
324
324
|
|
|
325
325
|
|
|
326
326
|
// -- Private Static Methods -----------------------------------------------
|
package/_dist/lib/es6lib.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! ****************************************************************************
|
|
2
|
-
* ES6lib v2.2.
|
|
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.
|
|
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}));
|
package/_dist/lib/es6lib.min.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! ****************************************************************************
|
|
2
|
-
* ES6lib v2.2.
|
|
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.
|
|
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;
|
package/_dist/lib/es6lib.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! ****************************************************************************
|
|
2
|
-
* ES6lib v2.2.
|
|
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.
|
|
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.
|
|
324
|
+
ES6lib.VERSION = '2.2.2';
|
|
325
325
|
|
|
326
326
|
|
|
327
327
|
// -- Private Static Methods -----------------------------------------------
|
package/package.json
CHANGED
|
@@ -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[
|
|
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[
|
|
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[
|
|
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[
|
|
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[
|
|
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[
|
|
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
|
-
// --
|
|
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
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
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
|
-
|
|
221
|
-
|
|
218
|
+
if (parsed.version) {
|
|
219
|
+
process.stdout.write(`version: ${parsed.version}\n`);
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
222
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
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
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}
|
|
240
|
+
await _clean();
|
|
241
|
+
_doparallel1(done);
|
|
242
|
+
_doparallel2(done);
|
|
243
|
+
},
|
|
244
|
+
};
|
|
241
245
|
|
|
242
246
|
|
|
243
|
-
//
|
|
244
|
-
run();
|
|
247
|
+
// -- Where the script starts --------------------------------------------------
|
|
248
|
+
Lib.run();
|
|
245
249
|
|
|
246
250
|
|
|
247
251
|
// -- oOo --
|
package/scripts/build.js.dev.js
CHANGED
|
@@ -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
|
-
// --
|
|
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
|
-
|
|
300
|
-
|
|
301
|
-
|
|
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
|
-
|
|
305
|
-
|
|
301
|
+
if (parsed.version) {
|
|
302
|
+
process.stdout.write(`version: ${parsed.version}\n`);
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
306
305
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
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
|
-
//
|
|
317
|
-
run();
|
|
319
|
+
// -- Where the script starts --------------------------------------------------
|
|
320
|
+
Lib.run();
|
|
318
321
|
|
|
319
322
|
|
|
320
323
|
// -- oOo --
|
package/scripts/build.js.prod.js
CHANGED
|
@@ -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
|
|
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
|
|
133
|
+
function _copydev(done) {
|
|
134
134
|
const d1 = new Date();
|
|
135
|
-
process.stdout.write(
|
|
135
|
+
process.stdout.write("Starting '\x1b[36mcopy:umd\x1b[89m\x1b[0m'...\n");
|
|
136
136
|
|
|
137
|
-
fs.readFile(`${libdir}/${name}.
|
|
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
|
|
141
|
+
content += data;
|
|
142
|
+
fs.writeFile(`${dist}/lib/${name}.js`, content, { encoding: 'utf8' }, (err2) => {
|
|
143
|
+
if (err2) throw new Error(err2);
|
|
142
144
|
|
|
143
|
-
|
|
144
|
-
.
|
|
145
|
-
|
|
146
|
-
|
|
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
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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
|
|
221
|
+
function _makeminifiedm(done) {
|
|
198
222
|
const d1 = new Date();
|
|
199
|
-
process.stdout.write(
|
|
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
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
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
|
-
|
|
238
|
-
|
|
239
|
-
|
|
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
|
-
// --
|
|
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
|
-
|
|
287
|
-
|
|
288
|
-
|
|
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
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
293
|
+
if (parsed.version) {
|
|
294
|
+
process.stdout.write(`version: ${parsed.version}\n`);
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
295
297
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
+
const d1 = new Date();
|
|
299
|
+
process.stdout.write('Starting \'\x1b[36mbuild:js:prod\x1b[89m\x1b[0m\'...\n');
|
|
298
300
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
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
|
-
|
|
312
|
-
|
|
313
|
-
}
|
|
313
|
+
await _clean();
|
|
314
|
+
_doLibs(done);
|
|
315
|
+
},
|
|
316
|
+
};
|
|
314
317
|
|
|
315
318
|
|
|
316
|
-
//
|
|
317
|
-
run();
|
|
319
|
+
// -- Where the script starts --------------------------------------------------
|
|
320
|
+
Lib.run();
|
|
318
321
|
|
|
319
322
|
|
|
320
323
|
// -- oOo --
|