Skip to content

Commit 3d62d67

Browse files
committed
fix(gw2-ui): Generation scripts
1 parent 37845f9 commit 3d62d67

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

gw2-ui/api_typecheck.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ ${e}
120120
*/
121121
const _: ${typename} = ${JSON.stringify(o)};
122122
`;
123-
writeSource(
123+
await writeSource(
124124
`gw2api/typeguards/failures/failure_${('' + failures).padStart(
125125
3,
126126
'0',

gw2-ui/generate_from_api.mjs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ async function run() {
9494
PROFESSIONS[id] = elite_specs;
9595
}
9696

97-
writeSource(
97+
await writeSource(
9898
'data/professions.ts',
9999
`
100100
export type ProfessionTypes = ${as_type(PROFESSION_IDS)};
@@ -108,7 +108,7 @@ export default PROFESSIONS;
108108
`,
109109
);
110110

111-
writeSource(
111+
await writeSource(
112112
'i18n/professions.ts',
113113
`
114114
import type { Translation } from '.';
@@ -127,7 +127,7 @@ export default TRANSLATIONS_PROFESSIONS;
127127
return [p.id, [...p.specializations].sort((a, b) => a - b)];
128128
}),
129129
);
130-
writeSource(
130+
await writeSource(
131131
'data/specializations.ts',
132132
`
133133
import type { ProfessionTypes } from './professions';
@@ -151,7 +151,7 @@ export default SPECIALIZATIONS;
151151
TRANSLATIONS_RACES[id] = translations;
152152
}
153153

154-
writeSource(
154+
await writeSource(
155155
'data/races.ts',
156156
`
157157
export type RacesTypes = ${as_type(RACE_IDS)};
@@ -160,7 +160,7 @@ const RACES: RacesTypes[] = ${JSON.stringify(RACE_IDS.sort())};
160160
export default RACES;`,
161161
);
162162

163-
writeSource(
163+
await writeSource(
164164
'i18n/races.ts',
165165
`
166166
import type { Translation } from '.';
@@ -194,7 +194,7 @@ export default TRANSLATIONS_RACES;
194194
}
195195
if (skill.slot) skill_slots.add(skill.slot);
196196
}
197-
writeSource(
197+
await writeSource(
198198
'gw2api/types/skills/enums.ts',
199199
`
200200
export type GW2ApiSkillCategory = ${as_type(skill_categories)};

node_api_helpers.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ export async function initPrettier() {
1818
url.fileURLToPath(import.meta.url),
1919
);
2020
}
21-
export function writeSource(filepath, content) {
21+
export async function writeSource(filepath, content) {
2222
filepath = path.join('src', filepath);
23-
let prettied = prettier.format(AUTOGENERATE_HEADER + content, {
23+
let prettied = await prettier.format(AUTOGENERATE_HEADER + content, {
2424
...prettier_options,
2525
filepath,
2626
});

0 commit comments

Comments
 (0)