From 9b6b3413788d4661cbe43d6b41b2634b982e2784 Mon Sep 17 00:00:00 2001 From: Active Date: Tue, 12 Dec 2023 21:45:57 -0600 Subject: [PATCH] add: versioning to module --- dist/pulse.min.mjs | 2 +- docs/ast/source/pulse.mjs.json | 6501 +++++++++++++++++--------------- docs/file/src/pulse.mjs.html | 4 +- docs/index.json | 4 +- docs/source.html | 4 +- package.json | 1 + src/pulse.mjs | 4 +- webpack.config.js | 8 + 8 files changed, 3401 insertions(+), 3127 deletions(-) diff --git a/dist/pulse.min.mjs b/dist/pulse.min.mjs index d960abb..58ee6ff 100644 --- a/dist/pulse.min.mjs +++ b/dist/pulse.min.mjs @@ -7,4 +7,4 @@ var __webpack_modules__=[,(e,t,s)=>{s.r(t),s.d(t,{Logger:()=>r}); * @copyright Copyright (c) 2022 Evitca Studio * @license Logger does not have a license at this time. For licensing contact the author */ -class r{constructor(e){this.RESET="",this.BRIGHT="",this.DIM="",this.UNDERSCORE="",this.BLINK="",this.REVERSE="",this.HIDDEN="",this.FG_BLACK="",this.FG_RED="",this.FG_GREEN="",this.FG_YELLOW="",this.FG_BLUE="",this.FG_MAGENTA="",this.FG_CYAN="",this.FG_WHITE="",this.FG_GRAY="",this.BG_BLACK="",this.BG_RED="",this.BG_GREEN="",this.BG_YELLOW="",this.BG_BLUE="",this.BG_MAGENTA="",this.BG_CYAN="",this.BG_WHITE="",this.BG_GRAY="",this.TYPE_SPACER_LENGTH=13,this.types={default:this.FG_WHITE},this.currentType="",this.SPACE_CHAR=" ",this.FG_COLORS={};for(let e=0;e<=255;e++)this.FG_COLORS[e]="[38;5;"+e+"m";this.BG_COLORS={};for(let e=0;e<=255;e++)this.BG_COLORS[e]="[48;5;"+e+"m";Array.isArray(e)&&this.registerTypes(e)}prefix(e){return"string"==typeof e&&(this.currentType=e),this}message(e="log",...t){var s,r,o,i=this.currentType||"";0===i.length?console[e](...t):(s=i.length>=this.TYPE_SPACER_LENGTH,o=(r=this.types[i.toLowerCase()]?this.types[i.toLowerCase()]:this.types.default).includes(""),!globalThis.window||o?console[e](r+i+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-i.length,s?1:0))+"|"+this.RESET,...t):console[e]("%c"+i+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-i.length,s?1:0))+"|",r,...t)),this.currentType=""}log(...e){this.message("log",...e)}info(...e){this.message("info",...e)}error(...e){this.message("error",...e)}warn(...e){this.message("warn",...e)}assert(...e){console.assert(...e)}debug(...e){this.message("debug",...e)}count(e){console.count(e)}countReset(e){console.countReset(e)}table(e,t){console.table(e,t)}time(e){this.message("time",e)}timeLog(e){this.message("timeLog",e)}timeEnd(e){this.message("timeEnd",e)}trace(...e){this.message("trace",...e)}group(e){this.message("group",e)}groupCollapsed(e){console.groupCollapsed(e)}groupEnd(){console.groupEnd()}clear(){console.clear()}registerType(e,t){this.types[e]||"string"==typeof e&&"string"==typeof t&&(this.types[e.toLowerCase()]=t)}registerTypes(t){if(Array.isArray(t))for(let e=0;e{for(var s in t)__webpack_require__.o(t,s)&&!__webpack_require__.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={},__webpack_exports__Pulse=((()=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Pulse:()=>t});var e=__webpack_require__(1);class o{static tracker={ids:[]};static storedIDs=[];constructor(){this.logger=new e.Logger,this.logger.registerType("PulseComponent-Module",this.logger.FG_BLUE),this.logger.prefix("PulseComponent-Module").log("PulseComponent module loaded")}generateID(s=7){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";function e(){let t="";for(let e=0;e=this.TYPE_SPACER_LENGTH,o=(r=this.types[i.toLowerCase()]?this.types[i.toLowerCase()]:this.types.default).includes(""),!globalThis.window||o?console[e](r+i+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-i.length,s?1:0))+"|"+this.RESET,...t):console[e]("%c"+i+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-i.length,s?1:0))+"|",r,...t)),this.currentType=""}log(...e){this.message("log",...e)}info(...e){this.message("info",...e)}error(...e){this.message("error",...e)}warn(...e){this.message("warn",...e)}assert(...e){console.assert(...e)}debug(...e){this.message("debug",...e)}count(e){console.count(e)}countReset(e){console.countReset(e)}table(e,t){console.table(e,t)}time(e){this.message("time",e)}timeLog(e){this.message("timeLog",e)}timeEnd(e){this.message("timeEnd",e)}trace(...e){this.message("trace",...e)}group(e){this.message("group",e)}groupCollapsed(e){console.groupCollapsed(e)}groupEnd(){console.groupEnd()}clear(){console.clear()}registerType(e,t){this.types[e]||"string"==typeof e&&"string"==typeof t&&(this.types[e.toLowerCase()]=t)}registerTypes(t){if(Array.isArray(t))for(let e=0;e{for(var s in t)__webpack_require__.o(t,s)&&!__webpack_require__.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={},__webpack_exports__Pulse=((()=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Pulse:()=>t});var e=__webpack_require__(1);class o{static tracker={ids:[]};static storedIDs=[];constructor(){this.logger=new e.Logger,this.logger.registerType("PulseComponent-Module",this.logger.FG_MAGENTA),this.logger.prefix("PulseComponent-Module").log("✅@v1.0.0")}generateID(s=7){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";function e(){let t="";for(let e=0;ePulse PulseComponent - - 5302 byte + 5296 byte 126 - 2023-12-03 23:02:02 (UTC) + 2023-12-04 03:41:48 (UTC) diff --git a/package.json b/package.json index a61fd52..9ec9600 100644 --- a/package.json +++ b/package.json @@ -1,4 +1,5 @@ { + "version": "1.0.0", "dependencies": { "esdoc": "^1.1.0", "esdoc-ecmascript-proposal-plugin": "^1.0.0", diff --git a/src/pulse.mjs b/src/pulse.mjs index 1a5a6ef..23c71a8 100644 --- a/src/pulse.mjs +++ b/src/pulse.mjs @@ -21,8 +21,8 @@ class PulseComponent { * @type {Object} */ this.logger = new Logger(); - this.logger.registerType('PulseComponent-Module', this.logger.FG_BLUE); - this.logger.prefix('PulseComponent-Module').log('PulseComponent module loaded'); + this.logger.registerType('PulseComponent-Module', this.logger.FG_MAGENTA); + this.logger.prefix('PulseComponent-Module').log(`✅@v${__VERSION__}`); } /** diff --git a/webpack.config.js b/webpack.config.js index 3c9edce..eac225d 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,4 +1,7 @@ const path = require('path'); +const webpack = require('webpack'); +const packageJson = require('./package.json'); + module.exports = { entry: { pulse: './src/pulse.mjs', @@ -14,6 +17,11 @@ module.exports = { type: 'module' }, }, + plugins: [ + new webpack.DefinePlugin({ + '__VERSION__': JSON.stringify(packageJson.version), + }), + ], module: { rules: [ {