Skip to content

Commit

Permalink
Merge pull request #53 from DestinyItemManager/remove-deps
Browse files Browse the repository at this point in the history
Remove outdated dependencies
  • Loading branch information
bhollis authored Jan 14, 2025
2 parents 9bdf89b + 2f9e073 commit 406ea76
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 98 deletions.
2 changes: 0 additions & 2 deletions .env

This file was deleted.

7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"lintcached:eslint": "pnpm lint:eslint --cache --cache-location .eslintcache --cache-strategy content",
"lint-report": "pnpm lint:eslint --output-file eslint_report.json --format json",
"lint-report:cached": "pnpm lintcached:eslint --output-file eslint.results.json --format json",
"generate-data-main": "dotenv node built/src/main.js generate-font-glyph-enums generate-custom-glyph-enums generate-symbols",
"generate-data-sub": "tsc && resolve-tspaths && dotenv node built/src/main.js",
"generate-data-main": "node built/src/main.js generate-font-glyph-enums generate-custom-glyph-enums generate-symbols",
"generate-data-sub": "tsc && resolve-tspaths && node built/src/main.js",
"generate-data": "pnpm build && pnpm generate-data-main"
},
"husky": {
Expand All @@ -30,16 +30,13 @@
}
},
"devDependencies": {
"@types/fs-extra": "^11.0.4",
"@types/node": "^22.10.5",
"@types/opentype.js": "^1.3.8",
"@typescript-eslint/eslint-plugin": "^8.19.1",
"@typescript-eslint/parser": "^8.19.1",
"dotenv-cli": "^7.4.2",
"eslint": "v8",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.31.0",
"fs-extra": "^11.2.0",
"husky": "^9.1.7",
"lint-staged": "^15.3.0",
"opentype.js": "^1.3.4",
Expand Down
72 changes: 0 additions & 72 deletions pnpm-lock.yaml

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

3 changes: 1 addition & 2 deletions src/generate-custom-glyph-enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import { parse } from 'opentype.js';
import { webfont } from 'webfont';
import { writeFile, toArrayBuffer } from './helpers.js';
import { infoLog } from './log.js';
import fse from 'fs-extra';
import { writeFileSync } from 'node:fs';

const { writeFileSync } = fse;
const acc: Record<string, number> = {};
const TAG = 'CUSTOM-GLYPHS';

Expand Down
5 changes: 1 addition & 4 deletions src/generate-font-glyph-enums.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import ttf2woff2 from 'ttf2woff2';
import { readFileSync } from 'fs';
import fse from 'fs-extra';
import { readFileSync, writeFileSync } from 'node:fs';
import { loadSync } from 'opentype.js';
import { writeFile } from './helpers.js';
import { infoLog } from './log.js';

const { writeFileSync } = fse;

const TAG = 'FONT-GLYPH';
const otfIn = readFileSync('./Destiny-2-Font-Symbols/fonts/destiny_symbols_common.otf');
const font = loadSync('./Destiny-2-Font-Symbols/fonts/destiny_symbols_common.otf');
Expand Down
15 changes: 5 additions & 10 deletions src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
||
\*================================================================================================================================*/
import { execSync } from 'child_process';
import { writeFile as writeFileFS } from 'fs';
import fse from 'fs-extra';
import { promisify } from 'util';
import { writeFileSync, existsSync, mkdirSync } from 'node:fs';
import { writeFile as writeFileFS } from 'node:fs/promises';
import { infoLog } from './log.js';

const TAG = 'UTILS';
const { writeFileSync /*,copyFileSync */ } = fse;

type WriteHook = (fileName: string) => void;
const writeHooks: WriteHook[] = [];
Expand Down Expand Up @@ -71,22 +69,19 @@ export function sortObject<T extends Record<string, any>>(o: T): T {

return sorted as T;
}

export const writeFilePromise = promisify(writeFileFS);

export function downloadFile(url: string, outputPath: string) {
return fetch(url)
.then((x) => x.arrayBuffer())
.then((x) => writeFilePromise(outputPath, Buffer.from(x)));
.then((x) => writeFileFS(outputPath, Buffer.from(x)));
}

export function uriToFileName(uri: string) {
return uri.substring(uri.lastIndexOf('/') + 1);
}

export function makeDirIfMissing(dir: string) {
if (!fse.existsSync(dir)) {
fse.mkdirSync(dir);
if (!existsSync(dir)) {
mkdirSync(dir);
}
}

Expand Down
4 changes: 1 addition & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import { load, setApiKey } from '@d2api/manifest-node';
import { spawnSync } from 'child_process';
import { readdirSync } from 'fs';
import fse from 'fs-extra';
import { readdirSync, copyFileSync } from 'node:fs';
import path, { basename, dirname } from 'path';
import { fileURLToPath } from 'url';
import { registerWriteHook } from './helpers.js';
import { infoLog, infoTable } from './log.js';

const TAG = 'MAIN';
const { copyFileSync } = fse;

setApiKey(process.env.API_KEY);
await load();
Expand Down

0 comments on commit 406ea76

Please sign in to comment.