Skip to content

Commit 6d50519

Browse files
committed
chore: prettier
1 parent fa4b9f4 commit 6d50519

File tree

2 files changed

+31
-31
lines changed

2 files changed

+31
-31
lines changed

packages/commandkit/bin/build.mjs

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -64,40 +64,40 @@ export async function injectShims(outDir, main, antiCrash, polyfillRequire) {
6464
const tail = '\n})();';
6565
const requireScript = polyfillRequire
6666
? [
67-
'// --- CommandKit require() polyfill ---',
68-
' if (typeof require === "undefined") {',
69-
' const { createRequire } = await import("node:module");',
70-
' const __require = createRequire(import.meta.url);',
71-
' Object.defineProperty(globalThis, "require", {',
72-
' value: (id) => {',
73-
' return __require(id);',
74-
' },',
75-
' configurable: true,',
76-
' enumerable: false,',
77-
' writable: true,',
78-
' });',
79-
' }',
80-
'// --- CommandKit require() polyfill ---',
81-
].join('\n')
67+
'// --- CommandKit require() polyfill ---',
68+
' if (typeof require === "undefined") {',
69+
' const { createRequire } = await import("node:module");',
70+
' const __require = createRequire(import.meta.url);',
71+
' Object.defineProperty(globalThis, "require", {',
72+
' value: (id) => {',
73+
' return __require(id);',
74+
' },',
75+
' configurable: true,',
76+
' enumerable: false,',
77+
' writable: true,',
78+
' });',
79+
' }',
80+
'// --- CommandKit require() polyfill ---',
81+
].join('\n')
8282
: '';
8383

8484
const antiCrashScript = antiCrash
8585
? [
86-
'// --- CommandKit Anti-Crash Monitor ---',
87-
" // 'uncaughtException' event is supposed to be used to perform synchronous cleanup before shutting down the process",
88-
' // instead of using it as a means to resume operation.',
89-
' // But it exists here due to compatibility reasons with discord bot ecosystem.',
90-
" const p = (t) => `\\x1b[33m${t}\\x1b[0m`, b = '[CommandKit Anti-Crash Monitor]', l = console.log, e1 = 'uncaughtException', e2 = 'unhandledRejection';",
91-
' if (!process.eventNames().includes(e1)) // skip if it is already handled',
92-
' process.on(e1, (e) => {',
93-
' l(p(`${b} Uncaught Exception`)); l(p(b), p(e.stack || e));',
94-
' })',
95-
' if (!process.eventNames().includes(e2)) // skip if it is already handled',
96-
' process.on(e2, (r) => {',
97-
' l(p(`${b} Unhandled promise rejection`)); l(p(`${b} ${r.stack || r}`));',
98-
' });',
99-
'// --- CommandKit Anti-Crash Monitor ---',
100-
].join('\n')
86+
'// --- CommandKit Anti-Crash Monitor ---',
87+
" // 'uncaughtException' event is supposed to be used to perform synchronous cleanup before shutting down the process",
88+
' // instead of using it as a means to resume operation.',
89+
' // But it exists here due to compatibility reasons with discord bot ecosystem.',
90+
" const p = (t) => `\\x1b[33m${t}\\x1b[0m`, b = '[CommandKit Anti-Crash Monitor]', l = console.log, e1 = 'uncaughtException', e2 = 'unhandledRejection';",
91+
' if (!process.eventNames().includes(e1)) // skip if it is already handled',
92+
' process.on(e1, (e) => {',
93+
' l(p(`${b} Uncaught Exception`)); l(p(b), p(e.stack || e));',
94+
' })',
95+
' if (!process.eventNames().includes(e2)) // skip if it is already handled',
96+
' process.on(e2, (r) => {',
97+
' l(p(`${b} Unhandled promise rejection`)); l(p(`${b} ${r.stack || r}`));',
98+
' });',
99+
'// --- CommandKit Anti-Crash Monitor ---',
100+
].join('\n')
101101
: '';
102102

103103
const contents = await readFile(path, 'utf-8');

packages/commandkit/bin/development.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export async function bootstrapDevelopmentServer(opts) {
6262
entry: [src, '!dist', '!.commandkit', `!${outDir}`].filter(Boolean),
6363
watch: watchMode,
6464
async onSuccess() {
65-
console.log('watch triggered')
65+
console.log('watch triggered');
6666
return await injectShims('.commandkit', main, false, requirePolyfill);
6767
},
6868
});

0 commit comments

Comments
 (0)