apibara 2.0.0-beta.40 → 2.0.0-beta.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,44 @@
1
+ import { addIndexer } from 'apibara/create';
2
+ import { defineCommand } from 'citty';
3
+
4
+ const add = defineCommand({
5
+ meta: {
6
+ name: "add",
7
+ description: "apibara add helps you add a new indexer to your project with sensible defaults."
8
+ },
9
+ args: {
10
+ indexerId: {
11
+ type: "positional",
12
+ description: "Indexer ID",
13
+ required: false
14
+ },
15
+ chain: {
16
+ type: "string",
17
+ description: "Chain"
18
+ },
19
+ network: {
20
+ type: "string",
21
+ description: "Network"
22
+ },
23
+ storage: {
24
+ type: "string",
25
+ description: "Storage"
26
+ },
27
+ dnaUrl: {
28
+ type: "string",
29
+ description: "DNA URL"
30
+ }
31
+ },
32
+ async run({ args }) {
33
+ const { indexerId, chain, network, storage, dnaUrl } = args;
34
+ await addIndexer({
35
+ argIndexerId: indexerId,
36
+ argChain: chain,
37
+ argNetwork: network,
38
+ argStorage: storage,
39
+ argDnaUrl: dnaUrl
40
+ });
41
+ }
42
+ });
43
+
44
+ export { add as default };
@@ -0,0 +1,41 @@
1
+ import { initializeProject } from 'apibara/create';
2
+ import { defineCommand } from 'citty';
3
+
4
+ const init = defineCommand({
5
+ meta: {
6
+ name: "init",
7
+ description: "Initialize a new Apibara project"
8
+ },
9
+ args: {
10
+ dir: {
11
+ type: "positional",
12
+ description: "Target path to initialize the project",
13
+ required: true
14
+ },
15
+ language: {
16
+ type: "string",
17
+ description: "Language to use: typescript, ts or javascript, js",
18
+ default: "ts",
19
+ alias: "l"
20
+ },
21
+ "no-create-indexer": {
22
+ type: "boolean",
23
+ description: "Do not create an indexer after initialization",
24
+ default: false
25
+ }
26
+ },
27
+ async run({ args }) {
28
+ const {
29
+ dir: targetDir,
30
+ "no-create-indexer": noCreateIndexer,
31
+ language
32
+ } = args;
33
+ await initializeProject({
34
+ argTargetDir: targetDir,
35
+ argLanguage: language,
36
+ argNoCreateIndexer: noCreateIndexer
37
+ });
38
+ }
39
+ });
40
+
41
+ export { init as default };
@@ -11,7 +11,9 @@ const mainCli = defineCommand({
11
11
  dev: () => import('../chunks/dev.mjs').then((r) => r.default),
12
12
  build: () => import('../chunks/build.mjs').then((r) => r.default),
13
13
  start: () => import('../chunks/start.mjs').then((r) => r.default),
14
- prepare: () => import('../chunks/prepare.mjs').then((r) => r.default)
14
+ prepare: () => import('../chunks/prepare.mjs').then((r) => r.default),
15
+ init: () => import('../chunks/init.mjs').then((r) => r.default),
16
+ add: () => import('../chunks/add.mjs').then((r) => r.default)
15
17
  }
16
18
  });
17
19
  runMain(mainCli);
@@ -147,7 +147,6 @@ function formatRollupError(_error) {
147
147
  }
148
148
  const text = error.text || error.frame;
149
149
  logs.push(
150
- // biome-ignore lint/style/useTemplate: <explanation>
151
150
  `Rollup error while processing \`${path}\`` + text ? "\n\n" + text : ""
152
151
  );
153
152
  }
@@ -0,0 +1,17 @@
1
+ type Options$1 = {
2
+ argIndexerId?: string;
3
+ argChain?: string;
4
+ argNetwork?: string;
5
+ argStorage?: string;
6
+ argDnaUrl?: string;
7
+ };
8
+ declare function addIndexer({ argIndexerId, argChain, argNetwork, argStorage, argDnaUrl, }: Options$1): Promise<void>;
9
+
10
+ type Options = {
11
+ argTargetDir: string;
12
+ argLanguage?: string;
13
+ argNoCreateIndexer?: boolean;
14
+ };
15
+ declare function initializeProject({ argTargetDir, argLanguage, argNoCreateIndexer, }: Options): Promise<void>;
16
+
17
+ export { addIndexer, initializeProject };
@@ -0,0 +1,17 @@
1
+ type Options$1 = {
2
+ argIndexerId?: string;
3
+ argChain?: string;
4
+ argNetwork?: string;
5
+ argStorage?: string;
6
+ argDnaUrl?: string;
7
+ };
8
+ declare function addIndexer({ argIndexerId, argChain, argNetwork, argStorage, argDnaUrl, }: Options$1): Promise<void>;
9
+
10
+ type Options = {
11
+ argTargetDir: string;
12
+ argLanguage?: string;
13
+ argNoCreateIndexer?: boolean;
14
+ };
15
+ declare function initializeProject({ argTargetDir, argLanguage, argNoCreateIndexer, }: Options): Promise<void>;
16
+
17
+ export { addIndexer, initializeProject };