Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gc committed Jul 2, 2024
1 parent 729c7fa commit 8577a0d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"scripts": {
"gen": "concurrently \"prisma generate --no-hints\" \"prisma generate --no-hints --schema prisma/robochimp.prisma\" && echo \"Generated Prisma Client\"",
"lint": "concurrently \"prettier --use-tabs ./**/*.{js,md,json,yml} --write\" \"eslint --quiet *.{ts,mts} \"{src,tests}/**/*.ts\" --fix\"",
"prettify": "prettier --use-tabs ./**/*.{js,md,json,yml} --write",
"lint": "concurrently \"yarn prettify\" \"eslint --quiet *.{ts,mts} \"{src,tests}/**/*.ts\" --fix\"",
"build:tsc": "tsc -p src",
"build": "concurrently \"yarn wipedist\" \"yarn gen\" && concurrently \"yarn prebuild:scripts\" && yarn build:tsc && yarn postbuild && echo \"Finished Building\"",
"build": "concurrently \"yarn wipedist\" \"yarn gen\" && yarn pre:build && yarn build:tsc && yarn post:build && echo \"Finished Building\"",
"wipedist": "rimraf \"dist/\"",
"start": "yarn build && concurrently \"tsc -w -p src\" \"node --enable-source-maps dist/\"",
"test": "concurrently \"tsc -p src\" \"yarn test:lint\" \"yarn test:unit\"",
Expand All @@ -12,8 +13,8 @@
"dev": "yarn wipedist && tsc -w -p src",
"test:watch": "vitest --config vitest.unit.config.mts --coverage",
"test:integration": "tsx ./src/scripts/integration-tests.ts",
"prebuild:scripts": "tsx ./src/scripts/render-creatables-file.ts",
"postbuild": "tsx ./src/scripts/postbuild.ts",
"pre:build": "tsx ./src/scripts/render-creatables-file.ts",
"post:build": "tsx ./src/scripts/postbuild.ts",
"build:esbuild": "esbuild --bundle src/index.ts --outdir=dist --platform=node --loader:.node=file --external:canvas",
"run:node": "node --enable-source-maps dist/index.js"
},
Expand Down
6 changes: 0 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import { CACHED_ACTIVE_USER_IDS, syncActiveUserIDs } from './lib/util/cachedUser
import { interactionHook } from './lib/util/globalInteractions';
import { handleInteractionError } from './lib/util/interactionReply';
import { logError } from './lib/util/logError';
import { sonicBoom } from './lib/util/logger';
import { onStartup } from './mahoji/lib/events';
import { postCommand } from './mahoji/lib/postCommand';
import { preCommand } from './mahoji/lib/preCommand';
Expand Down Expand Up @@ -218,9 +217,4 @@ process.on('unhandledRejection', err => {
logError(err);
});

process.on('exit', exitCode => {
sonicBoom.flushSync();
debugLog('Process Exit', { type: 'PROCESS_EXIT', exitCode });
});

main();

Check warning on line 220 in src/index.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
3 changes: 3 additions & 0 deletions src/scripts/postbuild.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import './no-prisma';

import { execSync } from 'node:child_process';
import { join } from 'node:path';

import { stringMatches } from '@oldschoolgg/toolkit';
Expand Down Expand Up @@ -55,8 +56,10 @@ async function renderCommands() {
}

export async function main() {
console.log('Postbuild');
const commands = await renderCommands();
writeFileSync(`./src/lib/data/${BOT_TYPE.toLowerCase()}.commands.json`, JSON.stringify(commands, null, 4));
execSync('yarn prettify');
}

main().then(() => null);
1 change: 1 addition & 0 deletions src/scripts/render-creatables-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Createables from '../lib/data/createables';
import { makeTable } from '../lib/util/smallUtils';

export function main() {
console.log('Prebuild');
const headers = ['Item name', 'Input Items', 'Output Items', 'GP Cost'];
const rows = Createables.map(i => {
return [i.name, `${new Bank(i.inputItems)}`, `${new Bank(i.outputItems)}`, `${i.GPCost ?? 0}`];
Expand Down

0 comments on commit 8577a0d

Please sign in to comment.