Skip to content

Commit 6700923

Browse files
committed
Replaced vocab.ts with packages/vocab/src/mod.ts
1 parent 37531e3 commit 6700923

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

packages/fedify/deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"!src/vocab/vocab.ts"
5454
],
5555
"tasks": {
56-
"codegen": "deno run --allow-read --allow-write --allow-env --check scripts/codegen.ts && deno fmt src/vocab/vocab.ts && deno cache src/vocab/vocab.ts && deno check src/vocab/vocab.ts",
56+
"codegen": "deno run --allow-read --allow-write --allow-env --check scripts/codegen.ts && deno task -f @fedify/vocab check",
5757
"cache": {
5858
"command": "deno cache src/mod.ts",
5959
"dependencies": [

packages/fedify/scripts/codegen.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { generateVocab } from "@fedify/vocab-tools";
2-
import { rename } from "node:fs/promises";
2+
import { mkdir, rename } from "node:fs/promises";
33
import { dirname, join } from "node:path";
44

55
async function codegen() {
@@ -9,8 +9,10 @@ async function codegen() {
99
}
1010
const schemaDir = join(dirname(scriptsDir), "src", "vocab");
1111
const generatedPath = join(schemaDir, `vocab-${crypto.randomUUID()}.ts`);
12-
const realPath = join(schemaDir, "vocab.ts");
12+
const realDir = join(scriptsDir, "..", "..", "vocab", "src");
13+
const realPath = join(realDir, "mod.ts");
1314

15+
await mkdir(realDir, { recursive: true });
1416
await generateVocab(schemaDir, generatedPath);
1517
await rename(generatedPath, realPath);
1618
}

0 commit comments

Comments
 (0)