@mobilabs/es6lib 3.0.0-beta.1.6 → 3.0.0-beta.1.8

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.6
2
+ * ES6lib v3.0.0-beta.1.8
3
3
  *
4
4
  * A template for writing pure ES6 Javascript libraries.
5
5
  * (you can download it from npm or github repositories)
@@ -305,14 +305,14 @@
305
305
  const obj = Object.create(methods);
306
306
  obj._library = {
307
307
  name: 'ES6lib',
308
- version: '3.0.0-beta.1.6',
308
+ version: '3.0.0-beta.1.8',
309
309
  };
310
310
  return obj;
311
311
  };
312
312
 
313
313
  // Attaches constants to ES6lib that provide name and version of the lib.
314
314
  ES6lib.NAME = 'ES6lib';
315
- ES6lib.VERSION = '3.0.0-beta.1.6';
315
+ ES6lib.VERSION = '3.0.0-beta.1.8';
316
316
 
317
317
  // Saves the previous value of the library variable, so that it can be
318
318
  // restored later on, if noConflict is used.
@@ -1,5 +1,5 @@
1
1
  /*! ****************************************************************************
2
- * ES6lib v3.0.0-beta.1.6
2
+ * ES6lib v3.0.0-beta.1.8
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;e=function(){const t=Object.create(o);return t._library={name:"ES6lib",version:"3.0.0-beta.1.6"},t},e.NAME="ES6lib",e.VERSION="3.0.0-beta.1.6";const r=t.ES6lib;e._setTestMode=function(){return[]},e.noConflict=function(){return t.ES6lib=r,this};const 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;e=function(){const t=Object.create(o);return t._library={name:"ES6lib",version:"3.0.0-beta.1.8"},t},e.NAME="ES6lib",e.VERSION="3.0.0-beta.1.8";const r=t.ES6lib;e._setTestMode=function(){return[]},e.noConflict=function(){return t.ES6lib=r,this};const 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.6
2
+ * ES6lib v3.0.0-beta.1.8
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;e=function(){const t=Object.create(o);return t._library={name:"ES6lib",version:"3.0.0-beta.1.6"},t},e.NAME="ES6lib",e.VERSION="3.0.0-beta.1.6";const r=t.ES6lib;e._setTestMode=function(){return[]},e.noConflict=function(){return t.ES6lib=r,this};const 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;e=function(){const t=Object.create(o);return t._library={name:"ES6lib",version:"3.0.0-beta.1.8"},t},e.NAME="ES6lib",e.VERSION="3.0.0-beta.1.8";const r=t.ES6lib;e._setTestMode=function(){return[]},e.noConflict=function(){return t.ES6lib=r,this};const 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.6
2
+ * ES6lib v3.0.0-beta.1.8
3
3
  *
4
4
  * A template for writing pure ES6 Javascript libraries.
5
5
  * (you can download it from npm or github repositories)
@@ -306,14 +306,14 @@ const $__ES6GLOB = {};
306
306
  const obj = Object.create(methods);
307
307
  obj._library = {
308
308
  name: 'ES6lib',
309
- version: '3.0.0-beta.1.6',
309
+ version: '3.0.0-beta.1.8',
310
310
  };
311
311
  return obj;
312
312
  };
313
313
 
314
314
  // Attaches constants to ES6lib that provide name and version of the lib.
315
315
  ES6lib.NAME = 'ES6lib';
316
- ES6lib.VERSION = '3.0.0-beta.1.6';
316
+ ES6lib.VERSION = '3.0.0-beta.1.8';
317
317
 
318
318
  // Saves the previous value of the library variable, so that it can be
319
319
  // restored later on, if noConflict is used.
package/bin/es6lib.js CHANGED
@@ -24,7 +24,7 @@
24
24
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
25
  * THE SOFTWARE.
26
26
  * ************************************************************************** */
27
- /* eslint one-var: 0, semi-style: 0, no-underscore-dangle: 0, curly: 0 */
27
+ /* eslint no-unused-vars: 0, curly: 0 */
28
28
 
29
29
 
30
30
  // -- Vendor Modules
@@ -149,6 +149,8 @@ const gitignore = [
149
149
  '',
150
150
  'coverage',
151
151
  'node_modules',
152
+ '.npmrc',
153
+ 'package.publish.json',
152
154
  '',
153
155
  ].join('\n');
154
156
 
@@ -163,6 +165,10 @@ const npmignore = [
163
165
  '',
164
166
  ].join('\n');
165
167
 
168
+ const npmrc = [
169
+ '//registry.npmjs.org/:_authToken=<the active Granular Token>',
170
+ ].join('\n');
171
+
166
172
 
167
173
  // -- Private Functions --------------------------------------------------------
168
174
 
@@ -248,10 +254,10 @@ function _isFolderEmpty(folder) {
248
254
  */
249
255
  function _addSkeleton(base, app, owner, cright) {
250
256
  const newFiles = [
251
- [readme, license, changelog, gitignore, eslintignore, npmignore, index],
257
+ [readme, license, changelog, gitignore, eslintignore, npmignore, npmrc, index],
252
258
  [
253
259
  'README.md', 'LICENSE.md', 'CHANGELOG.md', '.gitignore', '.eslintignore',
254
- '.npmignore', 'index.js',
260
+ '.npmignore', '.npmrc', 'index.js',
255
261
  ],
256
262
  ];
257
263
 
@@ -324,8 +330,12 @@ function _customize(source, dest, app, owner, boilerlib) {
324
330
  delete pack.scripts['dep:private:package'];
325
331
  delete pack.scripts['dep:npm:private:package'];
326
332
 
333
+ pack.scripts['npm:make:package:json'] = 'node scripts/make:package:publish:json.js $1';
334
+ pack.scripts['prepack'] = 'if [[ ! -f package.publish.json ]]; then npm run npm:make:package:json ; fi && mv package.json package.dev.json && cp package.publish.json package.json';
335
+ pack.scripts['postpack'] = 'mv package.dev.json package.json';
336
+
327
337
  pack.repository = obj.repository;
328
- pack.repository.url = `https://github.com/${owner.acronym}/${app.toLowerCase()}.git`;
338
+ pack.repository.url = `git+https://github.com/${owner.acronym}/${app.toLowerCase()}.git`;
329
339
  pack.keywords = ['ES6'];
330
340
  pack.author = obj.author;
331
341
  pack.author.name = owner.name;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@mobilabs/es6lib",
3
- "version": "3.0.0-beta.1.6",
3
+ "version": "3.0.0-beta.1.8",
4
4
  "description": "A template for writing pure ES6 Javascript libraries",
5
5
  "main": "index.js",
6
6
  "minified": "_dist/lib/es6lib.min.js",
7
7
  "unpkg": "_dist/lib/es6lib.mjs",
8
8
  "module": "_dist/lib/es6lib.min.mjs",
9
9
  "bin": {
10
- "es6lib": "./bin/es6lib.js"
10
+ "es6lib": "bin/es6lib.js"
11
11
  },
12
12
  "type": "module",
13
13
  "scripts": {
@@ -27,7 +27,7 @@
27
27
  "build:production": " --- BUILDING (PRODUCTION) --- ",
28
28
  "build:skeleton:prod": "node scripts/build.skeleton.prod.js $1",
29
29
  "prebuild:prod": "npm run build:dev && npm run build:skeleton:prod",
30
- "build:prod": "npm run build:js:prod",
30
+ "build:prod": "npm run build:js:prod && npm run npm:make:package:json",
31
31
 
32
32
  "testing": " --- TESTING --- ",
33
33
  "test": "cross-env NODE_ENV=test c8 --reporter=lcov mocha ./test/main.js",
@@ -48,8 +48,13 @@
48
48
  "dep:private:package": "npm run build:prod && node scripts/dep.private.js && sh scripts/compress.sh ${npm_package_name} ${npm_package_version} @mobilabs",
49
49
  "dep:npm:private:package": "npm run build:prod && npm pack && sh scripts/dep.npm.private.sh ${npm_package_name} ${npm_package_version} @mobilabs",
50
50
 
51
+ "npm:publishing": " --- PUBLISHING --- ",
52
+ "npm:make:package:json": "",
53
+ "prepack": "",
54
+ "postpack": "",
55
+
51
56
  "doc:site:web": " --- DOCUMENTING --- ",
52
- "doc:site:init": "kasar xxx orion run once only",
57
+ "doc:site:init": "kasar init --theme <theme-name>",
53
58
  "doc:site:build": "kasar build",
54
59
  "doc:site:watch": "kasar watch",
55
60
  "doc:site:start": "kasar serve --port $1",
@@ -59,7 +64,7 @@
59
64
  },
60
65
  "repository": {
61
66
  "type": "git",
62
- "url": "https://github.com/jclo/es6lib.git"
67
+ "url": "git+https://github.com/jclo/es6lib.git"
63
68
  },
64
69
  "keywords": [
65
70
  "ES6",
@@ -26,8 +26,8 @@
26
26
 
27
27
 
28
28
  // -- Vendor Modules
29
- import fs from 'fs';
30
- import path from 'path';
29
+ import fs from 'node:fs';
30
+ import path from 'node:path';
31
31
  import nopt from 'nopt';
32
32
 
33
33
 
@@ -30,7 +30,7 @@
30
30
 
31
31
 
32
32
  // -- Vendor Modules
33
- import fs from 'fs';
33
+ import fs from 'node:fs';
34
34
  import nopt from 'nopt';
35
35
 
36
36
 
@@ -31,7 +31,7 @@
31
31
 
32
32
 
33
33
  // -- Vendor Modules
34
- import fs from 'fs';
34
+ import fs from 'node:fs';
35
35
  import nopt from 'nopt';
36
36
  import { minify } from 'terser';
37
37
 
@@ -27,8 +27,8 @@
27
27
 
28
28
 
29
29
  // -- Vendor Modules
30
- import fs from 'fs';
31
- import path from 'path';
30
+ import fs from 'node:fs';
31
+ import path from 'node:path';
32
32
  import nopt from 'nopt';
33
33
 
34
34
 
@@ -28,8 +28,8 @@
28
28
 
29
29
 
30
30
  // -- Vendor Modules
31
- import fs from 'fs';
32
- import path from 'path';
31
+ import fs from 'node:fs';
32
+ import path from 'node:path';
33
33
  import nopt from 'nopt';
34
34
 
35
35
 
@@ -0,0 +1,223 @@
1
+ #!/usr/bin/env node
2
+ /* *****************************************************************************
3
+ *
4
+ * Creates package.publish.jon.
5
+ *
6
+ * make:package:publish:json.js script creates the package.json version
7
+ * to be published on NPM.
8
+ *
9
+ * Private Functions:
10
+ * . _help displays the help message,
11
+ * . _clean removes the previous package.publish.json,
12
+ * . _dopublish creates package.publish.json,
13
+ *
14
+ *
15
+ * Public Static Methods:
16
+ * . run executes the script,
17
+ *
18
+ *
19
+ * @namespace -
20
+ * @dependencies none
21
+ * @exports -
22
+ * @author -
23
+ * @since 0.0.0
24
+ * @version -
25
+ * ************************************************************************** */
26
+ /* eslint curly: 1 */
27
+
28
+
29
+ // -- Vendor Modules
30
+ import fs from 'node:fs';
31
+ import nopt from 'nopt';
32
+
33
+
34
+ // -- Local Modules
35
+ import pack from '../package.json' with { type: 'json' };
36
+
37
+
38
+ // -- Local Constants
39
+ const VERSION = '0.0.0-alpha.0'
40
+ , opts = {
41
+ help: [Boolean, false],
42
+ version: [String, null],
43
+ }
44
+ , shortOpts = {
45
+ h: ['--help'],
46
+ v: ['--version', VERSION],
47
+ }
48
+ , parsed = nopt(opts, shortOpts, process.argv, 2)
49
+ , destination = '.'
50
+ ;
51
+
52
+
53
+ // -- Local Variables
54
+
55
+
56
+ // -- Private Functions --------------------------------------------------------
57
+
58
+ /**
59
+ * Dispays the help message.
60
+ *
61
+ * @function ()
62
+ * @private
63
+ * @param {} -,
64
+ * @returns {} -,
65
+ * @since 0.0.0
66
+ */
67
+ function _help() {
68
+ const message = ['',
69
+ 'Usage: command [options]',
70
+ '',
71
+ ' creates package.publish.json',
72
+ '',
73
+ 'Options:',
74
+ '',
75
+ '-h, --help output usage information',
76
+ '-v, --version output the version number',
77
+ '',
78
+ ].join('\n');
79
+
80
+ process.stdout.write(`${message}\n`);
81
+ }
82
+
83
+ /**
84
+ * Removes the previous package.publish.json.
85
+ *
86
+ * @function ([arg1])
87
+ * @private
88
+ * @param {Function} the function to call at the completion,
89
+ * @returns {Object} returns a promise,
90
+ * @since 0.0.0
91
+ */
92
+ function _clean(done) {
93
+ const d1 = new Date();
94
+ process.stdout.write('Starting \'\x1b[36mclean\x1b[89m\x1b[0m\'...\n');
95
+
96
+ return new Promise((resolve) => {
97
+ fs.rm(`${destination}/package.publish.json`, { force: true }, (err1) => {
98
+ if (err1) {
99
+ throw new Error(err1);
100
+ }
101
+
102
+ const d2 = new Date() - d1;
103
+ process.stdout.write(`Finished '\x1b[36mclean\x1b[89m\x1b[0m' after \x1b[35m${d2} ms\x1b[89m\x1b[0m\n`);
104
+ resolve();
105
+ if (done) {
106
+ done();
107
+ }
108
+ });
109
+ });
110
+ }
111
+
112
+ /**
113
+ * Creates package.publish.json.
114
+ *
115
+ * @function (arg1)
116
+ * @private
117
+ * @param {Function} the function to call at the completion,
118
+ * @returns {} -,
119
+ * @since 0.0.0
120
+ */
121
+ function _dopublish(done) {
122
+ const d1 = new Date();
123
+ process.stdout.write('Starting \'\x1b[36mdo:publish\x1b[89m\x1b[0m\'...\n');
124
+
125
+ const pubpack = {};
126
+ pubpack.name = pack.name;
127
+ pubpack.version = pack.version;
128
+ pubpack.description = pack.description;
129
+ pubpack.main = pack.main;
130
+ pubpack.minified = pack.minified;
131
+ pubpack.unpkg = pack.unpkg;
132
+ pubpack.module = pack.module;
133
+
134
+ // pubpack.bin = pack.bin;
135
+ // pubpack.type = pack.type;
136
+
137
+ pubpack.scripts = {};
138
+ pubpack.scripts.postpack = pack.scripts.postpack;
139
+
140
+ pubpack.repository = pack.repository;
141
+ pubpack.keywords = pack.keywords;
142
+
143
+ pubpack.author = pack.author;
144
+ pubpack.author.name = pack.author.name;
145
+ pubpack.author.email = pack.author.email;
146
+ pubpack.author.url = pack.author.url;
147
+
148
+ pubpack.license = pack.license;
149
+ pubpack.bugs = pack.bugs;
150
+ pubpack.bugs.url = pack.bugs.url;
151
+ pubpack.homepage = pack.homepage;
152
+
153
+ pubpack.dependencies = {};
154
+ pubpack.devDependencies = {};
155
+
156
+ // pubpack.c8 = pack.c8;
157
+ pubpack.publishConfig = pack.publishConfig;
158
+ pubpack.private = pack.private;
159
+
160
+ fs.writeFile(`${destination}/package.publish.json`, JSON.stringify(pubpack, null, 2), { encoding: 'utf8' }, (err) => {
161
+ if (err) {
162
+ throw new Error(err);
163
+ }
164
+
165
+ const d2 = new Date() - d1;
166
+ process.stdout.write(`Finished '\x1b[36mdo:dopublish\x1b[89m\x1b[0m' after \x1b[35m${d2} ms\x1b[89m\x1b[0m\n`);
167
+ done();
168
+ });
169
+ }
170
+
171
+
172
+ // -- Public Static Methods ----------------------------------------------------
173
+
174
+ const Lib = {
175
+
176
+ /**
177
+ * Executes the script.
178
+ *
179
+ * @method ()
180
+ * @public
181
+ * @param {} -,
182
+ * @returns {} -,
183
+ * @since 0.0.0
184
+ */
185
+ async run() {
186
+ const PENDING = 1;
187
+
188
+ if (parsed.help) {
189
+ _help();
190
+ return;
191
+ }
192
+
193
+ if (parsed.version) {
194
+ process.stdout.write(`version: ${parsed.version}\n`);
195
+ return;
196
+ }
197
+
198
+ const d1 = new Date();
199
+ process.stdout.write('Starting \'\x1b[36mmake:package:publish:json\x1b[89m\x1b[0m\'...\n');
200
+
201
+ let pending = PENDING;
202
+ /**
203
+ * Executes done until completion.
204
+ */
205
+ function done() {
206
+ pending -= 1;
207
+ if (!pending) {
208
+ const d2 = new Date() - d1;
209
+ process.stdout.write(`Finished '\x1b[36mmake:package:publish:json\x1b[89m\x1b[0m' after \x1b[35m${d2} ms\x1b[89m\x1b[0m\n`);
210
+ }
211
+ }
212
+
213
+ await _clean();
214
+ _dopublish(done);
215
+ },
216
+ };
217
+
218
+
219
+ // -- Where the script starts --------------------------------------------------
220
+ Lib.run();
221
+
222
+
223
+ // -- oOo --