Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add cli package #93

Merged
merged 10 commits into from
Aug 7, 2024
Merged

feat: add cli package #93

merged 10 commits into from
Aug 7, 2024

Conversation

jaipaljadeja
Copy link
Member

No description provided.

@jaipaljadeja jaipaljadeja marked this pull request as ready for review August 2, 2024 16:58
Copy link
Contributor

@fracek fracek left a comment

Choose a reason for hiding this comment

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

I tested the code and I get an error if I run the apibara:dev command in the example repo. I think we should use a more robust way to invoke the compiled module, for example by loading it with createJiti and invoking it that way. What do you think?

◐ Starting dev server                                                                                                                                            20:10:50
✔ Types generated                                                                                                                                               20:10:51
✔ Output directory cleaned                                                                                                                                      20:10:51
✔ Indexers built in 4269 ms                                                                                                                             apibara 20:10:55
✔ Dev server started                                                                                                                                            20:10:55
✔ Starting indexers                                                                                                                                             20:10:55
node:events:496
      throw er; // Unhandled 'error' event
      ^

Error: spawn jiti ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
    at ChildProcess._handle.onexit (node:internal/child_process:292:12)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn jiti',
  path: 'jiti',
  spawnargs: [
    '/home/fra/Hacks/apibara/typescript-sdk/examples/cli/dist/main.mjs'
  ]
}

Node.js v20.12.2

Copy link
Contributor

@fracek fracek left a comment

Choose a reason for hiding this comment

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

Got it to work by reinstalling. I still think it's worth exploring how feasible it is to use jiti as a library and not relying on it being in the user path.

@jaipaljadeja jaipaljadeja force-pushed the feat/cli branch 2 times, most recently from 5fa842b to 6413527 Compare August 6, 2024 14:10
@fracek fracek merged commit 8eb401b into apibara:develop Aug 7, 2024
1 check passed
@jaipaljadeja jaipaljadeja deleted the feat/cli branch December 9, 2024 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants