Skip to content

Commit

Permalink
remove glob as direct dev dep
Browse files Browse the repository at this point in the history
  • Loading branch information
achou11 committed Jan 22, 2025
1 parent 014c4ef commit 30cc3d8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion package-lock.json

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

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@
"eslint": "8.47.0",
"eslint-config-prettier": "9.1.0",
"execa": "8.0.1",
"glob": "10.3.15",
"husky": "8.0.3",
"jest": "29.7.0",
"jest-expo": "50.0.4",
Expand Down
9 changes: 5 additions & 4 deletions scripts/build-translations.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import path from 'node:path';
import fs from 'node:fs';
import {readFile, writeFile} from 'node:fs/promises';
import {glob} from 'glob';

import LANGUAGE_NAME_TRANSLATIONS from '../src/frontend/languages.json' assert {type: 'json'};

Expand Down Expand Up @@ -38,13 +37,15 @@ async function run() {
* @returns {Promise<{ [lang: string]: unknown }>}
*/
async function loadMessages() {
const files = await glob(`${PROJECT_ROOT_DIR_PATH}/messages/**/*.json`);
const files = fs.readdirSync(path.join(PROJECT_ROOT_DIR_PATH, 'messages'), {
withFileTypes: true,
});

/** @type {Array<[string, any]>} */
const loadedMessages = await Promise.all(
files.map(async file => {
const lang = path.parse(file).name;
const msgs = JSON.parse(await readFile(file));
const lang = path.parse(file.name).name;
const msgs = JSON.parse(await readFile(path.join(file.path, file.name)));
return [lang, msgs];
}),
);
Expand Down

0 comments on commit 30cc3d8

Please sign in to comment.