Skip to content

Commit

Permalink
fix: hotfix for esm shim
Browse files Browse the repository at this point in the history
  • Loading branch information
Edgar-P-yan committed May 14, 2024
1 parent 1389c46 commit 2f38a92
Show file tree
Hide file tree
Showing 14 changed files with 139 additions and 73 deletions.
20 changes: 8 additions & 12 deletions dist/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
Object.defineProperty(exports, '__esModule', { value: true });

var child = require('child_process');
var events = require('events');
var readline = require('readline');
var Debug = require('debug');
var path = require('path');
var os = require('os');
var fs = require('fs-extra');
var events = require('events');
var xdebug = require('debug');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

Expand All @@ -38,10 +38,10 @@ function _interopNamespace(e) {

var child__namespace = /*#__PURE__*/_interopNamespace(child);
var readline__namespace = /*#__PURE__*/_interopNamespace(readline);
var Debug__default = /*#__PURE__*/_interopDefaultLegacy(Debug);
var path__namespace = /*#__PURE__*/_interopNamespace(path);
var os__namespace = /*#__PURE__*/_interopNamespace(os);
var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
var xdebug__default = /*#__PURE__*/_interopDefaultLegacy(xdebug);

function getTrayBinPath(debug = false, copyDir = false) {
const binName = {
Expand All @@ -52,7 +52,7 @@ function getTrayBinPath(debug = false, copyDir = false) {
if (!binName) {
throw new Error(`node-systray-v2: unsupported platform ${process.platform}.`);
}
const binPath = path__namespace.resolve(`${__dirname}/../traybin/${binName}`);
const binPath = path__namespace.resolve(`${getDirName()}/../traybin/${binName}`);
if (copyDir) {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const pkg = require('../package.json');
Expand All @@ -68,8 +68,11 @@ function getTrayBinPath(debug = false, copyDir = false) {
}
return binPath;
}
const getDirName = (function getDirNameScope() {
return () => __dirname;
})();

const debug = Debug__default["default"]('systray');
const debug = xdebug__default["default"]('systray');
const CHECK_STR = ' (√)';
function updateCheckedInLinux(item) {
if (process.platform !== 'linux') {
Expand Down Expand Up @@ -142,13 +145,6 @@ class SysTray extends events.EventEmitter {
this.writeLine(JSON.stringify(action));
return this;
}
/**
* Kill the systray process.
*
* ## Change notes:
* ### v2.0.0
* Removed parameter `exitNode` that automatically killed nodejs process when systray exitted.
*/
kill() {
this._rl.close();
this._process.kill();
Expand Down
2 changes: 1 addition & 1 deletion dist/index.cjs.map

Large diffs are not rendered by default.

26 changes: 15 additions & 11 deletions dist/index.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.esm.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 8 additions & 12 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2f38a92

Please sign in to comment.