Use local envio package for testing instead of defaulting to latest - #200
Conversation
|
It also passes integration tests https://github.com/enviodev/hyperindex/actions/runs/10861813153/job/30144136089 |
| { | ||
| "name": "envio", | ||
| "version": "local", | ||
| "private": true, |
There was a problem hiding this comment.
Added private so it's not published by mistake. Otherwise it will be overwritten in ci
| "name": "${node_pkg}", | ||
| "version": "${version}", | ||
| "description": "A ️latency and sync speed optimized, developer friendly blockchain data indexer.", | ||
| "description": "A latency and sync speed optimized, developer friendly blockchain data indexer.", |
There was a problem hiding this comment.
There was an unsupported unicode char for space
There was a problem hiding this comment.
Wow, wonder how that happened 😆
| // Handler for the NewGreeting event | ||
| Handlers.Greeter.NewGreeting.handler(async ({event, context}) => { | ||
| let userId = event.params.user.bits->Address.toString // The id for the User entity | ||
| let userId = event.params.user.bits // The id for the User entity |
| #!/usr/bin/env node | ||
|
|
||
| import { spawnSync } from "child_process"; | ||
| import path from "path"; | ||
| import { fileURLToPath } from "url"; | ||
|
|
||
| /** | ||
| * Runs `envio` with args using nodejs spawn | ||
| */ | ||
| function runLocalEnvio() { | ||
| const args = process.argv.slice(2); | ||
| const __filename = fileURLToPath(import.meta.url); // get the resolved path to the file | ||
| const __dirname = path.dirname(__filename); // get the name of the directory | ||
| const processResult = spawnSync( | ||
| "cargo", | ||
| [ | ||
| "run", | ||
| "--manifest-path", | ||
| path.join(__dirname, "../../Cargo.toml"), | ||
| ...args, | ||
| ], | ||
| { stdio: "inherit" } | ||
| ); | ||
| process.exit(processResult.status ?? 0); | ||
| } | ||
|
|
||
| runLocalEnvio(); |
There was a problem hiding this comment.
This is awesome. Just thinking we replace the suggestion for adding "lenvio" as an alias and rather just linking this with pnpm or something.
There was a problem hiding this comment.
Hmm, might be worth trying
JonoPrest
left a comment
There was a problem hiding this comment.
Cool, I haven't tested this. I hope the CI behaves, let's keep an eye on the main release when this get's merged.
enviopackage