@mobilabs/es6lib 1.2.0 → 2.0.1

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.
@@ -0,0 +1,22 @@
1
+ # This workflow will run tests using node.
2
+ name: CI pipeline
3
+
4
+ on:
5
+ push:
6
+ branches: [ master ]
7
+
8
+ jobs:
9
+ build:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v3
13
+ - uses: actions/setup-node@v3
14
+ with:
15
+ node-version: 18
16
+ - run: npm install
17
+ - run: npm run build:dev
18
+ - run: npm test
19
+ - run: npm run check:coverage
20
+
21
+ - name: Coveralls
22
+ uses: coverallsapp/github-action@v2
package/README.md CHANGED
@@ -2,12 +2,10 @@
2
2
 
3
3
  [![NPM version][npm-image]][npm-url]
4
4
  [![GitHub last commit][commit-image]][commit-url]
5
- [![Travis CI][travis-image]][travis-url]
5
+ [![Github workflow][ci-image]][ci-url]
6
6
  [![Test coverage][coveralls-image]][coveralls-url]
7
7
  [![npm bundle size][npm-bundle-size-image]][npm-bundle-size-url]
8
8
  [![License][license-image]](LICENSE.md)
9
- <!-- [![Dependencies status][dependencies-image]][dependencies-url]
10
- [![Dev Dependencies status][devdependencies-image]][devdependencies-url] -->
11
9
 
12
10
  ES6lib is a template for writing ES6 Javascript libraries and ES6 modules that run on both Node.js and ECMAScript 2015 (ES6) compliant browsers.
13
11
 
@@ -18,11 +16,11 @@ The ES6lib build produces two libraries:
18
16
 
19
17
  This template does not include a transpiler like babel or a module bundler like browserify/webpack or rollup. It relies on Npm scripts to build your library from the source files. Thus, it keeps your library pure (without extra code due to the transpiler or the module bundler).
20
18
 
21
- This template is useful if your library is intended to run on ECMAScript 2015 (ES6) compliant browser.
19
+ This template is useful if your library is intended to run on ECMAScript 2015 (ES6) compliant browser and it is made of just a few files.
22
20
 
23
21
  ES6lib relies on [Mocha](https://mochajs.org) and [Chai](http://chaijs.com) for unitary testing. It relies on [Istanbul](https://gotwarlost.github.io/istanbul/) for code coverage.
24
22
 
25
- ES6lib uses [Travis CI](https://travis-ci.com) for continuous integration and [Coveralls.io](https://coveralls.io) to display test coverage.
23
+ ES6lib uses [Github Actions](https://docs.github.com/en/actions) for continuous integration and [Coveralls.io](https://coveralls.io) to display test coverage.
26
24
 
27
25
 
28
26
  ## Quick Startup
@@ -58,6 +56,9 @@ That's almost all! When the script has been executed, your folder contains the f
58
56
 
59
57
  ```bash
60
58
  Your project Folder
59
+ |_ .github
60
+ | |_ workflows
61
+ | |_ ci.yml // Github Workflow file (if you use it),
61
62
  |_ lib
62
63
  | |_ lib.js // Your built ES6 UMD library,
63
64
  | |_ lib.mjs // Your built ES6 Module,
@@ -73,7 +74,6 @@ Your project Folder
73
74
  |_ .eslintrc // A Configuration file for the ESLint linter tool (if you use it),
74
75
  |_ .gitignore // Files that Git must ignore (if you use git),
75
76
  |_ .npmignore // Files that are ignored by npm publish,
76
- |_ .travis.yml // A configuration file for Travis CI (if you use it),
77
77
  |_ .CHANGELOG.md // The changes between your different versions,
78
78
  |_ index.js // The link to your ES5 library,
79
79
  |_ LICENSE.md // The license that applies to your library (here MIT),
@@ -173,19 +173,15 @@ Enjoy!
173
173
  [npm-image]: https://img.shields.io/npm/v/@mobilabs/es6lib.svg?logo=npm&logoColor=fff&label=NPM+package
174
174
  [release-image]: https://img.shields.io/github/release/jclo/es6lib.svg?include_prereleases
175
175
  [commit-image]: https://img.shields.io/github/last-commit/jclo/es6lib.svg?logo=github
176
- [travis-image]: https://img.shields.io/travis/com/jclo/es6lib.svg?logo=travis-ci&logoColor=fff
176
+ [ci-image]: https://github.com/jclo/es6lib/actions/workflows/ci.yml/badge.svg
177
177
  [coveralls-image]: https://img.shields.io/coveralls/jclo/es6lib/master.svg?&logo=coveralls
178
- [dependencies-image]: https://david-dm.org/jclo/es6lib/status.svg?theme=shields.io
179
- [devdependencies-image]: https://david-dm.org/jclo/es6lib/dev-status.svg?theme=shields.io
180
178
  [npm-bundle-size-image]: https://img.shields.io/bundlephobia/minzip/@mobilabs/es6lib.svg
181
179
  [license-image]: https://img.shields.io/npm/l/@mobilabs/es6lib.svg
182
180
 
183
181
  [npm-url]: https://www.npmjs.com/package/@mobilabs/es6lib
184
182
  [release-url]: https://github.com/jclo/es6lib/tags
185
183
  [commit-url]: https://github.com/jclo/es6lib/commits/master
186
- [travis-url]: https://app.travis-ci.com/jclo/es6lib?branch=main
184
+ [ci-url]: https://github.com/jclo/es6lib/actions/workflows/ci.yml
187
185
  [coveralls-url]: https://coveralls.io/github/jclo/es6lib?branch=master
188
- [dependencies-url]: https://david-dm.org/jclo/es6lib
189
- [devdependencies-url]: https://david-dm.org/jclo/es6lib?type=dev
190
186
  [license-url]: http://opensource.org/licenses/MIT
191
187
  [npm-bundle-size-url]: https://img.shields.io/bundlephobia/minzip/@mobilabs/es6lib
package/_dist/README.md CHANGED
@@ -2,12 +2,10 @@
2
2
 
3
3
  [![NPM version][npm-image]][npm-url]
4
4
  [![GitHub last commit][commit-image]][commit-url]
5
- [![Travis CI][travis-image]][travis-url]
5
+ [![Github workflow][ci-image]][ci-url]
6
6
  [![Test coverage][coveralls-image]][coveralls-url]
7
7
  [![npm bundle size][npm-bundle-size-image]][npm-bundle-size-url]
8
8
  [![License][license-image]](LICENSE.md)
9
- <!-- [![Dependencies status][dependencies-image]][dependencies-url]
10
- [![Dev Dependencies status][devdependencies-image]][devdependencies-url] -->
11
9
 
12
10
  ES6lib is a template for writing ES6 Javascript libraries and ES6 modules that run on both Node.js and ECMAScript 2015 (ES6) compliant browsers.
13
11
 
@@ -18,11 +16,11 @@ The ES6lib build produces two libraries:
18
16
 
19
17
  This template does not include a transpiler like babel or a module bundler like browserify/webpack or rollup. It relies on Npm scripts to build your library from the source files. Thus, it keeps your library pure (without extra code due to the transpiler or the module bundler).
20
18
 
21
- This template is useful if your library is intended to run on ECMAScript 2015 (ES6) compliant browser.
19
+ This template is useful if your library is intended to run on ECMAScript 2015 (ES6) compliant browser and it is made of just a few files.
22
20
 
23
21
  ES6lib relies on [Mocha](https://mochajs.org) and [Chai](http://chaijs.com) for unitary testing. It relies on [Istanbul](https://gotwarlost.github.io/istanbul/) for code coverage.
24
22
 
25
- ES6lib uses [Travis CI](https://travis-ci.com) for continuous integration and [Coveralls.io](https://coveralls.io) to display test coverage.
23
+ ES6lib uses [Github Actions](https://docs.github.com/en/actions) for continuous integration and [Coveralls.io](https://coveralls.io) to display test coverage.
26
24
 
27
25
 
28
26
  ## Quick Startup
@@ -58,6 +56,9 @@ That's almost all! When the script has been executed, your folder contains the f
58
56
 
59
57
  ```bash
60
58
  Your project Folder
59
+ |_ .github
60
+ | |_ workflows
61
+ | |_ ci.yml // Github Workflow file (if you use it),
61
62
  |_ lib
62
63
  | |_ lib.js // Your built ES6 UMD library,
63
64
  | |_ lib.mjs // Your built ES6 Module,
@@ -73,7 +74,6 @@ Your project Folder
73
74
  |_ .eslintrc // A Configuration file for the ESLint linter tool (if you use it),
74
75
  |_ .gitignore // Files that Git must ignore (if you use git),
75
76
  |_ .npmignore // Files that are ignored by npm publish,
76
- |_ .travis.yml // A configuration file for Travis CI (if you use it),
77
77
  |_ .CHANGELOG.md // The changes between your different versions,
78
78
  |_ index.js // The link to your ES5 library,
79
79
  |_ LICENSE.md // The license that applies to your library (here MIT),
@@ -173,19 +173,15 @@ Enjoy!
173
173
  [npm-image]: https://img.shields.io/npm/v/@mobilabs/es6lib.svg?logo=npm&logoColor=fff&label=NPM+package
174
174
  [release-image]: https://img.shields.io/github/release/jclo/es6lib.svg?include_prereleases
175
175
  [commit-image]: https://img.shields.io/github/last-commit/jclo/es6lib.svg?logo=github
176
- [travis-image]: https://img.shields.io/travis/com/jclo/es6lib.svg?logo=travis-ci&logoColor=fff
176
+ [ci-image]: https://github.com/jclo/es6lib/actions/workflows/ci.yml/badge.svg
177
177
  [coveralls-image]: https://img.shields.io/coveralls/jclo/es6lib/master.svg?&logo=coveralls
178
- [dependencies-image]: https://david-dm.org/jclo/es6lib/status.svg?theme=shields.io
179
- [devdependencies-image]: https://david-dm.org/jclo/es6lib/dev-status.svg?theme=shields.io
180
178
  [npm-bundle-size-image]: https://img.shields.io/bundlephobia/minzip/@mobilabs/es6lib.svg
181
179
  [license-image]: https://img.shields.io/npm/l/@mobilabs/es6lib.svg
182
180
 
183
181
  [npm-url]: https://www.npmjs.com/package/@mobilabs/es6lib
184
182
  [release-url]: https://github.com/jclo/es6lib/tags
185
183
  [commit-url]: https://github.com/jclo/es6lib/commits/master
186
- [travis-url]: https://app.travis-ci.com/jclo/es6lib?branch=main
184
+ [ci-url]: https://github.com/jclo/es6lib/actions/workflows/ci.yml
187
185
  [coveralls-url]: https://coveralls.io/github/jclo/es6lib?branch=master
188
- [dependencies-url]: https://david-dm.org/jclo/es6lib
189
- [devdependencies-url]: https://david-dm.org/jclo/es6lib?type=dev
190
186
  [license-url]: http://opensource.org/licenses/MIT
191
187
  [npm-bundle-size-url]: https://img.shields.io/bundlephobia/minzip/@mobilabs/es6lib
@@ -1,5 +1,5 @@
1
1
  /*! ****************************************************************************
2
- * ES6lib v1.2.0
2
+ * ES6lib v2.0.1
3
3
  *
4
4
  * A template for writing pure ES6 Javascript libraries.
5
5
  * (you can download it from npm or github repositories)
@@ -14,7 +14,7 @@
14
14
  (function(root, factory) {
15
15
  'use strict';
16
16
 
17
- /* istanbul ignore next */
17
+ /* c8 ignore start */
18
18
  if (typeof define === 'function' && define.amd) {
19
19
  // AMD. Register as an anonymous module.
20
20
  define([''], factory);
@@ -29,6 +29,7 @@
29
29
  /* eslint-disable-next-line no-param-reassign */
30
30
  root.ES6lib = factory(root);
31
31
  }
32
+ /* c8 ignore stop */
32
33
  }(this, (root) => {
33
34
  'use strict';
34
35
 
@@ -312,14 +313,14 @@
312
313
  const obj = Object.create(methods);
313
314
  obj._library = {
314
315
  name: 'ES6lib',
315
- version: '1.2.0',
316
+ version: '2.0.1',
316
317
  };
317
318
  return obj;
318
319
  };
319
320
 
320
321
  // Attaches constants to ES6lib that provide name and version of the lib.
321
322
  ES6lib.NAME = 'ES6lib';
322
- ES6lib.VERSION = '1.2.0';
323
+ ES6lib.VERSION = '2.0.1';
323
324
 
324
325
 
325
326
  // -- Private Static Methods -----------------------------------------------
@@ -1,5 +1,5 @@
1
1
  /*! ****************************************************************************
2
- * ES6lib v1.2.0
2
+ * ES6lib v2.0.1
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:"1.2.0"},t},e.NAME="ES6lib",e.VERSION="1.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.0.1"},t},e.NAME="ES6lib",e.VERSION="2.0.1",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 v1.2.0
2
+ * ES6lib v2.0.1
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:"1.2.0"},t},e.NAME="ES6lib",e.VERSION="1.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.0.1"},t},e.NAME="ES6lib",e.VERSION="2.0.1",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 v1.2.0
2
+ * ES6lib v2.0.1
3
3
  *
4
4
  * A template for writing pure ES6 Javascript libraries.
5
5
  * (you can download it from npm or github repositories)
@@ -15,7 +15,7 @@ const $__ES6GLOB = {};
15
15
  (function(root, factory) {
16
16
  'use strict';
17
17
 
18
- /* istanbul ignore next */
18
+ /* c8 ignore start */
19
19
  if (typeof define === 'function' && define.amd) {
20
20
  // AMD. Register as an anonymous module.
21
21
  define([''], factory);
@@ -30,6 +30,7 @@ const $__ES6GLOB = {};
30
30
  /* eslint-disable-next-line no-param-reassign */
31
31
  root.ES6lib = factory(root);
32
32
  }
33
+ /* c8 ignore stop */
33
34
  }($__ES6GLOB, (root) => {
34
35
  'use strict';
35
36
 
@@ -313,14 +314,14 @@ const $__ES6GLOB = {};
313
314
  const obj = Object.create(methods);
314
315
  obj._library = {
315
316
  name: 'ES6lib',
316
- version: '1.2.0',
317
+ version: '2.0.1',
317
318
  };
318
319
  return obj;
319
320
  };
320
321
 
321
322
  // Attaches constants to ES6lib that provide name and version of the lib.
322
323
  ES6lib.NAME = 'ES6lib';
323
- ES6lib.VERSION = '1.2.0';
324
+ ES6lib.VERSION = '2.0.1';
324
325
 
325
326
 
326
327
  // -- Private Static Methods -----------------------------------------------
package/bin/es6lib.js CHANGED
@@ -269,7 +269,7 @@ function _addSkeleton(base, app, owner, cright) {
269
269
  * @returns {} -,
270
270
  */
271
271
  function _duplicate(source, dest) {
272
- const dupFiles = ['.eslintrc', '.travis.yml', 'rmdstore.sh'];
272
+ const dupFiles = ['.eslintrc', 'rmdstore.sh'];
273
273
 
274
274
  for (let i = 0; i < dupFiles.length; i++) {
275
275
  process.stdout.write(` copied ${dupFiles[i]}\n`);
@@ -427,6 +427,21 @@ function _addHuskyHook(source, dest, folder) {
427
427
  shell.cp('-r', `${source}/${folder}/pre-commit`, `${dest}/${folder}/.`);
428
428
  }
429
429
 
430
+ /**
431
+ * Adds Github workfow.
432
+ *
433
+ * @function (arg1, arg2, arg3)
434
+ * @private
435
+ * @param {String} the source path,
436
+ * @param {String} the destination path,
437
+ * @param {String} the destination folder,
438
+ * @returns {} -,
439
+ */
440
+ function _addGithub(source, dest, folder) {
441
+ shell.mkdir('-p', `${dest}/${folder}`);
442
+ shell.cp('-r', `${source}/${folder}/`, `${dest}/${folder}/.`);
443
+ }
444
+
430
445
  /**
431
446
  * Adds the test files.
432
447
  *
@@ -528,6 +543,9 @@ function _populate(options) {
528
543
  // Copy Husky Hook:
529
544
  _addHuskyHook(baseboiler, baseapp, husky, app, boilerlib);
530
545
 
546
+ // Copy .github/workflows:
547
+ _addGithub(baseboiler, baseapp, '.github');
548
+
531
549
  process.stdout.write('Done. Enjoy!\n');
532
550
  }
533
551
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mobilabs/es6lib",
3
- "version": "1.2.0",
3
+ "version": "2.0.1",
4
4
  "description": "A template for writing pure ES6 Javascript libraries",
5
5
  "main": "index.js",
6
6
  "minified": "_dist/lib/es6lib.min.js",
@@ -29,11 +29,10 @@
29
29
  "build:prod": "npm run build:js:prod",
30
30
 
31
31
  "testing": " --- TESTING --- ",
32
- "test": "cross-env NODE_ENV=test nyc --reporter=lcov mocha ./test/main.js",
32
+ "test": "cross-env NODE_ENV=test c8 --reporter=lcov mocha ./test/main.js",
33
33
  "display:coverage": "open -a safari ./coverage/lcov-report/index.html",
34
- "check:coverage": "nyc check-coverage --statements 100 --branches 100 --functions 100 --lines 100",
35
- "report:coverage": "nyc report --reporter=text-lcov | coveralls",
36
- "report": "nyc report",
34
+ "check:coverage": "c8 check-coverage --statements 100 --branches 100 --functions 100 --lines 100",
35
+ "report": "c8 report",
37
36
 
38
37
  "serving": " --- SERVING --- ",
39
38
  "server:dev": "http-server --port 8080",
@@ -79,8 +78,8 @@
79
78
  "shelljs": "^0.8.5"
80
79
  },
81
80
  "devDependencies": {
81
+ "c8": "^9.0.0",
82
82
  "chai": "^4.4.0",
83
- "coveralls": "^3.1.1",
84
83
  "cross-env": "^7.0.3",
85
84
  "eslint": "^8.56.0",
86
85
  "eslint-config-airbnb-base": "^15.0.0",
@@ -88,7 +87,6 @@
88
87
  "husky": "^8.0.3",
89
88
  "mocha": "^10.2.0",
90
89
  "nodemon": "^3.0.2",
91
- "nyc": "^15.1.0",
92
90
  "terser": "^5.26.0"
93
91
  },
94
92
  "publishConfig": {
package/src/_header CHANGED
@@ -5,7 +5,7 @@
5
5
  (function(root, factory) {
6
6
  'use strict';
7
7
 
8
- /* istanbul ignore next */
8
+ /* c8 ignore start */
9
9
  if (typeof define === 'function' && define.amd) {
10
10
  // AMD. Register as an anonymous module.
11
11
  define([''], factory);
@@ -20,5 +20,6 @@
20
20
  /* eslint-disable-next-line no-param-reassign */
21
21
  root.ES6lib = factory(root);
22
22
  }
23
+ /* c8 ignore stop */
23
24
  }({{lib:es6:link}}, (root) => {
24
25
  'use strict';
package/.travis.yml DELETED
@@ -1,19 +0,0 @@
1
- os:
2
- - linux
3
- dist:
4
- - xenial
5
- language:
6
- - node_js
7
- node_js:
8
- - "16"
9
- notifications:
10
- email: false
11
- before_install:
12
- - npm i -g npm@8
13
- before_script:
14
- - npm prune
15
- script:
16
- - npm run test
17
- - npm run check:coverage
18
- after_success:
19
- - npm run report:coverage