Skip to content

Commit

Permalink
cli: change output directory to .apibara
Browse files Browse the repository at this point in the history
  • Loading branch information
jaipaljadeja committed Aug 6, 2024
1 parent 585a503 commit 8b9075d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions examples/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"private": true,
"scripts": {
"apibara:build": "apibara build",
"apibara:start": "jiti ./dist/main.mjs",
"apibara:start": "jiti ./.apibara/build/main.mjs",
"apibara:prepare": "apibara prepare",
"apibara:dev": "apibara dev",
"typecheck": "tsc --noEmit",
"typecheck": "pnpm apibara:prepare && tsc --noEmit",
"lint": "biome check .",
"lint:fix": "pnpm lint --write",
"format": "biome format . --write"
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/cli/commands/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default defineCommand({
}

const childArgs = [
resolve(apibara.options.outputDir || "./dist", "main.mjs"),
resolve(apibara.options.outputDir || "./.apibara/build", "main.mjs"),
...(args.indexers ? ["--indexers", args.indexers] : []),
...(args.preset ? ["--preset", args.preset] : []),
...(args.sink ? ["--sink", args.sink] : []),
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/cli/commands/prepare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default defineCommand({
...commonArgs,
},
async run({ args }) {
consola.start("Prepairing Types");
consola.start("Preparing Types");
const rootDir = resolve((args.dir || ".") as string);
const apibara = await createApibara({ rootDir });
await writeTypes(apibara);
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/core/config/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { ApibaraConfig } from "apibara/types";

export const ApibaraDefaults: ApibaraConfig = {
rootDir: ".",
outputDir: "./dist",
outputDir: "./.apibara/build",

runtimeConfig: {},
hooks: {},
Expand Down
8 changes: 7 additions & 1 deletion packages/cli/src/rollup/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ runMain(command);
main: "virtual:main.ts",
},
output: {
dir: join(apibara.options.outputDir || "dist"),
dir: join(apibara.options.outputDir || "./.apibara/build"),
format: "esm",
exports: "auto",
entryFileNames: "[name].mjs",
Expand Down Expand Up @@ -177,6 +177,12 @@ runMain(command);
json(),
typescript({
tsconfig: join("./tsconfig.json"),
compilerOptions: {
outDir: join(apibara.options.outputDir || "./.apibara/build"),
declarationDir: join(apibara.options.outputDir || "./.apibara/build"),
noEmit: false,
types: ["node"],
},
}),
],
onwarn(warning, rollupWarn) {
Expand Down

0 comments on commit 8b9075d

Please sign in to comment.