apibara 2.0.0-beta.37 → 2.0.0-beta.39
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.
package/dist/rollup/index.mjs
CHANGED
|
@@ -3,7 +3,6 @@ import commonjs from '@rollup/plugin-commonjs';
|
|
|
3
3
|
import json from '@rollup/plugin-json';
|
|
4
4
|
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
|
5
5
|
import { join } from 'pathe';
|
|
6
|
-
import esbuild from 'rollup-plugin-esbuild';
|
|
7
6
|
import defu from 'defu';
|
|
8
7
|
import virtual from '@rollup/plugin-virtual';
|
|
9
8
|
import MagicString from 'magic-string';
|
|
@@ -119,7 +118,7 @@ function getRollupConfig(apibara) {
|
|
|
119
118
|
onwarn(warning, rollupWarn) {
|
|
120
119
|
if (!["CIRCULAR_DEPENDENCY", "EVAL", "THIS_IS_UNDEFINED"].includes(
|
|
121
120
|
warning.code || ""
|
|
122
|
-
) && !warning.message.includes("Unsupported source map comment") && !warning.message.includes("@__PURE__")) {
|
|
121
|
+
) && !warning.message.includes("Unsupported source map comment") && !warning.message.includes("@__PURE__") && !warning.message.includes("/*#__PURE__*/")) {
|
|
123
122
|
rollupWarn(warning);
|
|
124
123
|
}
|
|
125
124
|
},
|
|
@@ -143,12 +142,6 @@ function getRollupConfig(apibara) {
|
|
|
143
142
|
mainFields: ["main"]
|
|
144
143
|
})
|
|
145
144
|
);
|
|
146
|
-
rollupConfig.plugins.push(
|
|
147
|
-
esbuild({
|
|
148
|
-
target: "es2022",
|
|
149
|
-
sourceMap: apibara.options.sourceMap
|
|
150
|
-
})
|
|
151
|
-
);
|
|
152
145
|
rollupConfig.plugins.push(indexers(apibara));
|
|
153
146
|
rollupConfig.plugins.push(appConfig(apibara));
|
|
154
147
|
return rollupConfig;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { createIndexer as _createIndexer } from "@apibara/indexer";
|
|
2
|
+
import {
|
|
3
|
+
internalContext
|
|
4
|
+
} from "@apibara/indexer/internal/plugins";
|
|
2
5
|
import {
|
|
3
6
|
inMemoryPersistence,
|
|
4
7
|
logger
|
|
@@ -41,6 +44,10 @@ export function createIndexer(indexerName, preset) {
|
|
|
41
44
|
});
|
|
42
45
|
}
|
|
43
46
|
definition.plugins = [
|
|
47
|
+
internalContext({
|
|
48
|
+
indexerName,
|
|
49
|
+
availableIndexers
|
|
50
|
+
}),
|
|
44
51
|
inMemoryPersistence(),
|
|
45
52
|
...definition.plugins ?? [],
|
|
46
53
|
logger({ logger: reporter })
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "apibara",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.39",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/core/index.mjs",
|
|
6
6
|
"exports": {
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"playground:start": "pnpm playground start --dir playground --indexer starknet"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@apibara/starknet": "2.0.0-beta.
|
|
75
|
+
"@apibara/starknet": "2.0.0-beta.39",
|
|
76
76
|
"@types/fs-extra": "^11.0.4",
|
|
77
77
|
"@types/node": "^20.14.0",
|
|
78
78
|
"jiti": "^1.21.0",
|
|
@@ -82,8 +82,8 @@
|
|
|
82
82
|
"vitest": "^1.6.0"
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
|
-
"@apibara/indexer": "2.0.0-beta.
|
|
86
|
-
"@apibara/protocol": "2.0.0-beta.
|
|
85
|
+
"@apibara/indexer": "2.0.0-beta.39",
|
|
86
|
+
"@apibara/protocol": "2.0.0-beta.39",
|
|
87
87
|
"@rollup/plugin-commonjs": "^26.0.1",
|
|
88
88
|
"@rollup/plugin-json": "^6.1.0",
|
|
89
89
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
package/src/rollup/config.ts
CHANGED
|
@@ -5,7 +5,6 @@ import { nodeResolve } from "@rollup/plugin-node-resolve";
|
|
|
5
5
|
import type { Apibara, RollupConfig } from "apibara/types";
|
|
6
6
|
import { join } from "pathe";
|
|
7
7
|
import type { OutputPluginOption } from "rollup";
|
|
8
|
-
import esbuild from "rollup-plugin-esbuild";
|
|
9
8
|
|
|
10
9
|
import defu from "defu";
|
|
11
10
|
import { appConfig } from "./plugins/config";
|
|
@@ -52,7 +51,8 @@ export function getRollupConfig(apibara: Apibara): RollupConfig {
|
|
|
52
51
|
warning.code || "",
|
|
53
52
|
) &&
|
|
54
53
|
!warning.message.includes("Unsupported source map comment") &&
|
|
55
|
-
!warning.message.includes("@__PURE__")
|
|
54
|
+
!warning.message.includes("@__PURE__") &&
|
|
55
|
+
!warning.message.includes("/*#__PURE__*/")
|
|
56
56
|
) {
|
|
57
57
|
rollupWarn(warning);
|
|
58
58
|
}
|
|
@@ -80,14 +80,6 @@ export function getRollupConfig(apibara: Apibara): RollupConfig {
|
|
|
80
80
|
mainFields: ["main"],
|
|
81
81
|
}),
|
|
82
82
|
);
|
|
83
|
-
|
|
84
|
-
rollupConfig.plugins.push(
|
|
85
|
-
esbuild({
|
|
86
|
-
target: "es2022",
|
|
87
|
-
sourceMap: apibara.options.sourceMap,
|
|
88
|
-
}),
|
|
89
|
-
);
|
|
90
|
-
|
|
91
83
|
rollupConfig.plugins.push(indexers(apibara));
|
|
92
84
|
rollupConfig.plugins.push(appConfig(apibara));
|
|
93
85
|
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { createIndexer as _createIndexer } from "@apibara/indexer";
|
|
2
|
+
import {
|
|
3
|
+
type InternalContext,
|
|
4
|
+
internalContext,
|
|
5
|
+
} from "@apibara/indexer/internal/plugins";
|
|
2
6
|
import {
|
|
3
7
|
type ConsolaReporter,
|
|
4
8
|
inMemoryPersistence,
|
|
5
9
|
logger,
|
|
6
10
|
} from "@apibara/indexer/plugins";
|
|
7
|
-
|
|
8
11
|
import { config } from "#apibara-internal-virtual/config";
|
|
9
12
|
import { indexers } from "#apibara-internal-virtual/indexers";
|
|
10
|
-
|
|
11
13
|
import { createLogger } from "./logger";
|
|
12
14
|
|
|
13
15
|
export const availableIndexers = indexers.map((i) => i.name);
|
|
@@ -63,6 +65,10 @@ export function createIndexer(indexerName: string, preset?: string) {
|
|
|
63
65
|
// persistence plugin.
|
|
64
66
|
// Put the logger last since we want to override any user-defined logger.
|
|
65
67
|
definition.plugins = [
|
|
68
|
+
internalContext({
|
|
69
|
+
indexerName,
|
|
70
|
+
availableIndexers,
|
|
71
|
+
} as InternalContext),
|
|
66
72
|
inMemoryPersistence(),
|
|
67
73
|
...(definition.plugins ?? []),
|
|
68
74
|
logger({ logger: reporter }),
|