Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "indexer: replace sink with middleware",
"packageName": "@apibara/indexer",
"email": "francesco@ceccon.me",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "indexer: replace sink with middleware",
"packageName": "@apibara/plugin-drizzle",
"email": "francesco@ceccon.me",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "indexer: replace sink with middleware",
"packageName": "@apibara/plugin-mongo",
"email": "francesco@ceccon.me",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "indexer: replace sink with middleware",
"packageName": "@apibara/plugin-sqlite",
"email": "francesco@ceccon.me",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "indexer: replace sink with middleware",
"packageName": "@apibara/protocol",
"email": "francesco@ceccon.me",
"dependentChangeType": "patch"
}
7 changes: 7 additions & 0 deletions change/apibara-3b2198a6-9656-4ad6-acbd-8ae728aa1d15.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "indexer: replace sink with middleware",
"packageName": "apibara",
"email": "francesco@ceccon.me",
"dependentChangeType": "patch"
}
35 changes: 0 additions & 35 deletions examples/indexer/package.json

This file was deleted.

65 changes: 0 additions & 65 deletions examples/indexer/src/indexer.ts

This file was deleted.

43 changes: 0 additions & 43 deletions examples/indexer/src/instrumentation.ts

This file was deleted.

40 changes: 0 additions & 40 deletions examples/indexer/src/main.ts

This file was deleted.

11 changes: 0 additions & 11 deletions examples/starknet-indexer/biome.json

This file was deleted.

34 changes: 0 additions & 34 deletions examples/starknet-indexer/package.json

This file was deleted.

53 changes: 0 additions & 53 deletions examples/starknet-indexer/src/indexer.ts

This file was deleted.

38 changes: 0 additions & 38 deletions examples/starknet-indexer/src/main.ts

This file was deleted.

7 changes: 5 additions & 2 deletions packages/cli/src/runtime/internal/app.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { createIndexer as _createIndexer } from "@apibara/indexer";
import { type ConsolaReporter, logger } from "@apibara/indexer/plugins/logger";
import { inMemoryPersistence } from "@apibara/indexer/plugins/persistence";
import {
type ConsolaReporter,
inMemoryPersistence,
logger,
} from "@apibara/indexer/plugins";

import { config } from "#apibara-internal-virtual/config";
import { indexers } from "#apibara-internal-virtual/indexers";
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/types/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ConsolaReporter } from "@apibara/indexer/plugins/logger";
import type { ConsolaReporter } from "@apibara/indexer/plugins";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Import path consolidation needs attention

The verification revealed inconsistencies in the import patterns:

  • The new consolidated path @apibara/indexer/plugins is used in packages/cli/src/types/config.ts
  • However, several files still use the old path @apibara/indexer/plugins/logger:
    • examples/cli/indexers/1-evm.indexer.ts
    • examples/cli/indexers/2-starknet.indexer.ts
    • examples/cli/indexers/3-starknet-factory.indexer.ts

The plugins/index.ts file correctly re-exports the logger functionality, so all imports should use the consolidated path.

🔗 Analysis chain

LGTM! Import path consolidation improves maintainability.

The updated import path aligns with the new export structure in @apibara/indexer/plugins.

Let's verify the consistency of this import pattern across the codebase:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for consistent import patterns of ConsolaReporter

# Find all imports of ConsolaReporter
rg "import.*ConsolaReporter.*from.*@apibara/indexer" --type typescript

# Ensure no old import paths remain
rg "import.*from.*@apibara/indexer/plugins/logger" --type typescript

Length of output: 213


Script:

#!/bin/bash
# Description: Check for consistent import patterns of ConsolaReporter using ripgrep without file type filter

# Find all imports of ConsolaReporter
rg "import.*ConsolaReporter.*from.*@apibara/indexer"

# Ensure no old import paths remain
rg "import.*from.*@apibara/indexer/plugins/logger"

# Also check for any potential .ts or .tsx files containing these imports
fd "\.(ts|tsx)$" --exec grep -l "ConsolaReporter"

Length of output: 778


Script:

#!/bin/bash
# Let's check the actual implementation and exports in the plugins directory

# Check the exports in plugins/index.ts
cat packages/indexer/src/plugins/index.ts

# Check the logger plugin implementation
cat packages/indexer/src/plugins/logger.ts

# Check how ConsolaReporter is used in the CLI
cat packages/cli/src/runtime/internal/logger.ts

Length of output: 2952

import type { RollupCommonJSOptions } from "@rollup/plugin-commonjs";
import type {
C12InputConfig,
Expand Down
Loading
Loading