@mobilabs/es6lib 3.0.0-beta.1.0 → 3.0.0-beta.1.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 v3.0.0-beta.1.0
2
+ * ES6lib v3.0.0-beta.1.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: '3.0.0-beta.1.0',
316
+ version: '3.0.0-beta.1.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 = '3.0.0-beta.1.0';
323
+ ES6lib.VERSION = '3.0.0-beta.1.2';
324
324
 
325
325
 
326
326
  // -- Private Static Methods -----------------------------------------------
@@ -1,5 +1,5 @@
1
1
  /*! ****************************************************************************
2
- * ES6lib v3.0.0-beta.1.0
2
+ * ES6lib v3.0.0-beta.1.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:"3.0.0-beta.1.0"},t},e.NAME="ES6lib",e.VERSION="3.0.0-beta.1.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:"3.0.0-beta.1.2"},t},e.NAME="ES6lib",e.VERSION="3.0.0-beta.1.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 v3.0.0-beta.1.0
2
+ * ES6lib v3.0.0-beta.1.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:"3.0.0-beta.1.0"},t},e.NAME="ES6lib",e.VERSION="3.0.0-beta.1.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:"3.0.0-beta.1.2"},t},e.NAME="ES6lib",e.VERSION="3.0.0-beta.1.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 v3.0.0-beta.1.0
2
+ * ES6lib v3.0.0-beta.1.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: '3.0.0-beta.1.0',
317
+ version: '3.0.0-beta.1.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 = '3.0.0-beta.1.0';
324
+ ES6lib.VERSION = '3.0.0-beta.1.2';
325
325
 
326
326
 
327
327
  // -- Private Static Methods -----------------------------------------------
package/bin/es6lib.js CHANGED
@@ -139,9 +139,8 @@ const changelog = [
139
139
  ].join('\n');
140
140
 
141
141
  const index = [
142
- "'use strict';",
143
- '',
144
- "module.exports = require('./lib/{{lib:lowname}}');",
142
+ "import {{lib:name}} from './lib/{{lib:lowname}}.mjs';",
143
+ "export default {{lib:name}};",
145
144
  '',
146
145
  ].join('\n');
147
146
 
@@ -260,7 +259,7 @@ function _addSkeleton(base, app, owner, cright) {
260
259
  let s;
261
260
  for (let i = 0; i < newFiles[0].length; i++) {
262
261
  input = newFiles[0][i]
263
- .replace('{{lib:name}}', app)
262
+ .replace(/{{lib:name}}/g, app)
264
263
  .replace('{{lib:lowname}}', app.toLowerCase())
265
264
  .replace('{{lib:copyright}}', cright)
266
265
  .replace('{{author:name}}', owner.name)
@@ -0,0 +1,96 @@
1
+ import js from "@eslint/js";
2
+ import importPlugin from "eslint-plugin-import";
3
+ import globals from "globals";
4
+
5
+ export default [
6
+ js.configs.recommended,
7
+
8
+ {
9
+ files: ["**/*.js"],
10
+ languageOptions: {
11
+ sourceType: "module",
12
+ ecmaVersion: "latest",
13
+ globals: {
14
+ // ...globals.browser // Add browser global variables
15
+ ...globals.node // Add Node.js global variables
16
+ }
17
+ },
18
+
19
+ plugins: {
20
+ import: importPlugin
21
+ },
22
+
23
+ rules: {
24
+ // ========================
25
+ // 🔒 Style proche Airbnb
26
+ // ========================
27
+ "strict": ["error", "global"],
28
+ "func-names": ["error", "never"],
29
+
30
+ "space-before-function-paren": ["error", {
31
+ anonymous: "never",
32
+ named: "never",
33
+ asyncArrow: "always"
34
+ }],
35
+
36
+ "no-plusplus": ["error", { allowForLoopAfterthoughts: true }],
37
+
38
+ "no-multi-spaces": ["error", {
39
+ exceptions: { VariableDeclarator: true }
40
+ }],
41
+
42
+ "comma-style": ["error", "first", {
43
+ exceptions: {
44
+ ArrayExpression: true,
45
+ ObjectExpression: true
46
+ }
47
+ }],
48
+
49
+ "indent": ["error", 2, {
50
+ SwitchCase: 1,
51
+ VariableDeclarator: { const: 2 }
52
+ }],
53
+
54
+ "no-multiple-empty-lines": ["error", {
55
+ max: 2,
56
+ maxEOF: 0
57
+ }],
58
+
59
+ // ========================
60
+ // 📦 Imports (Airbnb core)
61
+ // ========================
62
+ "import/no-unresolved": "error",
63
+ "import/named": "error",
64
+ "import/default": "error",
65
+ "import/no-duplicates": "error",
66
+ "import/export": "error",
67
+ "import/extensions": ["error", "ignorePackages"],
68
+
69
+ // ========================
70
+ // 🧹 Bonnes pratiques Airbnb
71
+ // ========================
72
+ "no-var": "error",
73
+ "prefer-const": "error",
74
+ "object-shorthand": ["error", "always"],
75
+ "no-unused-vars": ["warn"],
76
+
77
+ "eqeqeq": ["error", "always"],
78
+ "curly": ["error", "all"],
79
+
80
+ // ========================
81
+ // ⚠️ Airbnb tolérances
82
+ // ========================
83
+ "no-console": "warn",
84
+ "no-underscore-dangle": "off",
85
+
86
+ // ========================
87
+ // 🧩 Tes overrides existants
88
+ // ========================
89
+ // (déjà intégrés ci-dessus)
90
+ "no-trailing-spaces": "error",
91
+ "eol-last": ["error", "always"],
92
+ "no-mixed-spaces-and-tabs": "error",
93
+ "semi": ["error", "always"],
94
+ }
95
+ }
96
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mobilabs/es6lib",
3
- "version": "3.0.0-beta.1.0",
3
+ "version": "3.0.0-beta.1.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",