@mobilabs/es6lib 2.2.1 → 2.3.0
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/.github/workflows/ci.yml +1 -1
- package/.husky/pre-commit +1 -3
- 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 +10 -10
- package/scripts/_build.template.js +56 -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 +13 -0
- package/scripts/dep.private.js +49 -45
- 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/.github/workflows/ci.yml
CHANGED
package/.husky/pre-commit
CHANGED
package/_dist/lib/es6lib.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! ****************************************************************************
|
|
2
|
-
* ES6lib v2.
|
|
2
|
+
* ES6lib v2.3.0
|
|
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.
|
|
316
|
+
version: '2.3.0',
|
|
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.
|
|
323
|
+
ES6lib.VERSION = '2.3.0';
|
|
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
|
+
* ES6lib v2.3.0
|
|
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.
|
|
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.3.0"},t},e.NAME="ES6lib",e.VERSION="2.3.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}));
|
package/_dist/lib/es6lib.min.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! ****************************************************************************
|
|
2
|
-
* ES6lib v2.
|
|
2
|
+
* ES6lib v2.3.0
|
|
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.
|
|
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.3.0"},t},e.NAME="ES6lib",e.VERSION="2.3.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;
|
package/_dist/lib/es6lib.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! ****************************************************************************
|
|
2
|
-
* ES6lib v2.
|
|
2
|
+
* ES6lib v2.3.0
|
|
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.
|
|
317
|
+
version: '2.3.0',
|
|
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.
|
|
324
|
+
ES6lib.VERSION = '2.3.0';
|
|
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.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "A template for writing pure ES6 Javascript libraries",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"minified": "_dist/lib/es6lib.min.js",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
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
|
|
51
|
+
"prepare": "husky"
|
|
52
52
|
},
|
|
53
53
|
"repository": {
|
|
54
54
|
"type": "git",
|
|
@@ -74,21 +74,21 @@
|
|
|
74
74
|
},
|
|
75
75
|
"homepage": "https://github.com/jclo/es6lib",
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"nopt": "^7.2.
|
|
77
|
+
"nopt": "^7.2.1",
|
|
78
78
|
"shelljs": "^0.8.5"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
|
-
"c8": "^
|
|
82
|
-
"chai": "^4.4.
|
|
81
|
+
"c8": "^10.1.2",
|
|
82
|
+
"chai": "^4.4.1",
|
|
83
83
|
"cross-env": "^7.0.3",
|
|
84
|
-
"eslint": "^8.
|
|
84
|
+
"eslint": "^8.57.0",
|
|
85
85
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
86
86
|
"eslint-plugin-import": "^2.29.1",
|
|
87
87
|
"http-server": "^14.1.1",
|
|
88
|
-
"husky": "^
|
|
89
|
-
"mocha": "^10.
|
|
90
|
-
"nodemon": "^3.
|
|
91
|
-
"terser": "^5.
|
|
88
|
+
"husky": "^9.1.1",
|
|
89
|
+
"mocha": "^10.7.0",
|
|
90
|
+
"nodemon": "^3.1.4",
|
|
91
|
+
"terser": "^5.31.3"
|
|
92
92
|
},
|
|
93
93
|
"c8": {
|
|
94
94
|
"include": [
|
|
@@ -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,
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
|
|
30
30
|
// -- Vendor Modules
|
|
31
31
|
const fs = require('fs')
|
|
32
|
+
, path = require('path')
|
|
32
33
|
, nopt = require('nopt')
|
|
33
34
|
;
|
|
34
35
|
|
|
@@ -86,13 +87,13 @@ function _help() {
|
|
|
86
87
|
/**
|
|
87
88
|
* Removes the previous build.
|
|
88
89
|
*
|
|
89
|
-
* @function ()
|
|
90
|
+
* @function ([arg1])
|
|
90
91
|
* @private
|
|
91
|
-
* @param {}
|
|
92
|
+
* @param {Function} the function to call at the completion,
|
|
92
93
|
* @returns {Object} returns a promise,
|
|
93
94
|
* @since 0.0.0
|
|
94
95
|
*/
|
|
95
|
-
function _clean() {
|
|
96
|
+
function _clean(done) {
|
|
96
97
|
const d1 = new Date();
|
|
97
98
|
process.stdout.write('Starting \'\x1b[36mclean\x1b[89m\x1b[0m\'...\n');
|
|
98
99
|
|
|
@@ -106,6 +107,7 @@ function _clean() {
|
|
|
106
107
|
const d2 = new Date() - d1;
|
|
107
108
|
process.stdout.write(`Finished '\x1b[36mclean\x1b[89m\x1b[0m' after \x1b[35m${d2} ms\x1b[89m\x1b[0m\n`);
|
|
108
109
|
resolve();
|
|
110
|
+
if (done) done();
|
|
109
111
|
});
|
|
110
112
|
});
|
|
111
113
|
});
|
|
@@ -122,13 +124,13 @@ function _clean() {
|
|
|
122
124
|
*/
|
|
123
125
|
function _doparallel1(done) {
|
|
124
126
|
const d1 = new Date();
|
|
125
|
-
process.stdout.write('Starting \'\x1b[
|
|
127
|
+
process.stdout.write('Starting \'\x1b[36mdo:parallel1\x1b[89m\x1b[0m\'...\n');
|
|
126
128
|
|
|
127
129
|
fs.writeFile(`${destination}/generic1.js`, 'bla bla', { encoding: 'utf8' }, (err) => {
|
|
128
130
|
if (err) throw new Error(err);
|
|
129
131
|
|
|
130
132
|
const d2 = new Date() - d1;
|
|
131
|
-
process.stdout.write(`Finished '\x1b[
|
|
133
|
+
process.stdout.write(`Finished '\x1b[36mdo:doparallel1\x1b[89m\x1b[0m' after \x1b[35m${d2} ms\x1b[89m\x1b[0m\n`);
|
|
132
134
|
done();
|
|
133
135
|
});
|
|
134
136
|
}
|
|
@@ -144,13 +146,13 @@ function _doparallel1(done) {
|
|
|
144
146
|
*/
|
|
145
147
|
function _doparallel2(done) {
|
|
146
148
|
const d1 = new Date();
|
|
147
|
-
process.stdout.write('Starting \'\x1b[
|
|
149
|
+
process.stdout.write('Starting \'\x1b[36mdo:parallel2\x1b[89m\x1b[0m\'...\n');
|
|
148
150
|
|
|
149
151
|
fs.writeFile(`${destination}/generic2.js`, 'bla bla', { encoding: 'utf8' }, (err) => {
|
|
150
152
|
if (err) throw new Error(err);
|
|
151
153
|
|
|
152
154
|
const d2 = new Date() - d1;
|
|
153
|
-
process.stdout.write(`Finished '\x1b[
|
|
155
|
+
process.stdout.write(`Finished '\x1b[36mdo:parallel2\x1b[89m\x1b[0m' after \x1b[35m${d2} ms\x1b[89m\x1b[0m\n`);
|
|
154
156
|
done();
|
|
155
157
|
});
|
|
156
158
|
}
|
|
@@ -166,7 +168,7 @@ function _doparallel2(done) {
|
|
|
166
168
|
*/
|
|
167
169
|
function _delgeneric(done) {
|
|
168
170
|
const d1 = new Date();
|
|
169
|
-
process.stdout.write('Starting \'\x1b[
|
|
171
|
+
process.stdout.write('Starting \'\x1b[36mdel:generic\x1b[89m\x1b[0m\'...\n');
|
|
170
172
|
|
|
171
173
|
/**
|
|
172
174
|
* Wait all the processes are completed.
|
|
@@ -176,7 +178,7 @@ function _delgeneric(done) {
|
|
|
176
178
|
pending -= 1;
|
|
177
179
|
if (!pending) {
|
|
178
180
|
const d2 = new Date() - d1;
|
|
179
|
-
process.stdout.write(`Finished '\x1b[
|
|
181
|
+
process.stdout.write(`Finished '\x1b[36mdel:generic\x1b[89m\x1b[0m' after \x1b[35m${d2} ms\x1b[89m\x1b[0m\n`);
|
|
180
182
|
done();
|
|
181
183
|
}
|
|
182
184
|
}
|
|
@@ -193,55 +195,58 @@ function _delgeneric(done) {
|
|
|
193
195
|
}
|
|
194
196
|
|
|
195
197
|
|
|
196
|
-
// --
|
|
198
|
+
// -- Public Static Methods ----------------------------------------------------
|
|
197
199
|
|
|
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;
|
|
200
|
+
const Lib = {
|
|
209
201
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
202
|
+
/**
|
|
203
|
+
* Executes the script.
|
|
204
|
+
*
|
|
205
|
+
* @method ()
|
|
206
|
+
* @public
|
|
207
|
+
* @param {} -,
|
|
208
|
+
* @returns {} -,
|
|
209
|
+
* @since 0.0.0
|
|
210
|
+
*/
|
|
211
|
+
async run() {
|
|
212
|
+
const PENDING = 2;
|
|
213
|
+
|
|
214
|
+
if (parsed.help) {
|
|
215
|
+
_help();
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
219
218
|
|
|
220
|
-
|
|
221
|
-
|
|
219
|
+
if (parsed.version) {
|
|
220
|
+
process.stdout.write(`version: ${parsed.version}\n`);
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
222
223
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
224
|
+
const d1 = new Date();
|
|
225
|
+
process.stdout.write('Starting \'\x1b[36mbuild:xxx:yyy\x1b[89m\x1b[0m\'...\n');
|
|
226
|
+
|
|
227
|
+
let pending = PENDING;
|
|
228
|
+
/**
|
|
229
|
+
* Executes done until completion.
|
|
230
|
+
*/
|
|
231
|
+
function done() {
|
|
232
|
+
pending -= 1;
|
|
233
|
+
if (!pending) {
|
|
234
|
+
_delgeneric(() => {
|
|
235
|
+
const d2 = new Date() - d1;
|
|
236
|
+
process.stdout.write(`Finished '\x1b[36mbuild:xxx:yyy\x1b[89m\x1b[0m' after \x1b[35m${d2} ms\x1b[89m\x1b[0m\n`);
|
|
237
|
+
});
|
|
238
|
+
}
|
|
234
239
|
}
|
|
235
|
-
}
|
|
236
240
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}
|
|
241
|
+
await _clean();
|
|
242
|
+
_doparallel1(done);
|
|
243
|
+
_doparallel2(done);
|
|
244
|
+
},
|
|
245
|
+
};
|
|
241
246
|
|
|
242
247
|
|
|
243
|
-
//
|
|
244
|
-
run();
|
|
248
|
+
// -- Where the script starts --------------------------------------------------
|
|
249
|
+
Lib.run();
|
|
245
250
|
|
|
246
251
|
|
|
247
252
|
// -- 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 --
|