Skip to content

Commit

Permalink
fix entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
hori-ryota committed Jul 16, 2023
1 parent 3542748 commit a2f8c77
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 9 deletions.
2 changes: 1 addition & 1 deletion deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"test": "deno test -A src/",
"lint": "deno lint",
"check": "deno task fmt:check && deno task lint && deno task test",
"run-for-test": "deno run -A ./src/main.ts ./src/testdata/schemas ./src/testdata/generated.ts"
"run-for-test": "deno run -A ./microcms_sdk_generator.ts ./src/testdata/schemas ./src/testdata/generated.ts"
},
"lint": {
"include": ["./src/"],
Expand Down
72 changes: 72 additions & 0 deletions deno.lock

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

6 changes: 1 addition & 5 deletions microcms_sdk_generator.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
import { main } from "./src/main.ts";

if (import.meta.main) {
await main();
}
await import("./src/main.ts");
4 changes: 1 addition & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@ export async function main() {
await generate({ schemaDir, dstFilePath });
}

if (import.meta.main) {
await main();
}
await main();

0 comments on commit a2f8c77

Please sign in to comment.