rasendubi / uniorg

An accurate Org-mode parser for JavaScript/TypeScript
https://oleksii.shmalko.com/uniorg
GNU General Public License v3.0
256 stars 24 forks source link

orgx package might be missing dependencies in package.json #78

Closed venikx closed 1 year ago

venikx commented 1 year ago

Hi! First, I want to say: Lovely project! I've been testing the org-braindump minimal example for a while now, and it's great.

For my personal site, I wanted to try out Astro instead and I've tried using a minimal example with Astro and astro-org.

However, since astro-org requires rollup-plugin-orgx, which requires orgx I had to install uniorg-parse and uniorg-rehype before orgx was able to function. See errors:

12:28:37 AM [vite] Error when evaluating SSR module /.../astro.config.ts: failed to import "astro-org"
|- Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'uniorg-parse' imported from /.../node_modules/@uniorgjs/orgx/lib/core.js

and

12:31:45 AM [vite] Error when evaluating SSR module /.../astro.config.ts: failed to import "astro-org"
|- Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'uniorg-rehype' imported from /.../node_modules/@uniorgjs/orgx/lib/core.js

I believe uniorg-parse and uniorg-rehype are missing from the deps in package.json (or maybe should be peerDeps) of orgx? If these at least get defined as peerDependencies we'd get a warning that these are missing when installing astro-org.

The scuffed and horrible minimal setup I have, just to try this out, is working now, but I had to install uniorg-parse and uniorg-rehype even though I'm not currently using it yet.

If orgx is not meant to be used yet, my apologies for reason this issue.

rasendubi commented 1 year ago

Hey. yeah, this seems to be a bug. Would you like to submit a PR?

venikx commented 1 year ago

Hey. yeah, this seems to be a bug. Would you like to submit a PR?

Sure, it's a nice way to get my feet wet on this project, since I can't live without org-mode and the web support kinda pains me atm. So most likely will contribute in the future as well.

venikx commented 1 year ago

@rasendubi Hi again, I'm not super familiar with pnpm and turbo, but for some reason pnpm dev and pnpm build fail to run. I saw that you have a flake.nix as well, so I was curious if you encountered the same issue before?

The error is:

 turbo run build

thread 'main' panicked at 'Failed to execute turbo.: Os { code: 2, kind: NotFound, message: "No such file or directory" }', crates/turborepo/src/main.rs:23:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 ELIFECYCLE  Command failed with exit code 101.

Some other issues were raised in turbo, related to libc6-dev, but not sure how to go about fixing that in nixos.

rasendubi commented 1 year ago

uhm... I haven't seen this one, although I'm not on nixos

This is most likely because you can't use pre-built binaries on nixos (because of infamous /lib/ld.so). To test this hypothesis, you can try running ./node_modules/.bin/turbo manually — if that fails with not found error (or ENOENT), that's it.

There seems to be a turbo package in nixpkgs, so we might add it to nativeBuildInputs

venikx commented 1 year ago

Yeah, noticed the same after reading some turbo packages. It seems to have similar workarounds as prisma :)

Please let me know what you think about these changes: https://github.com/rasendubi/uniorg/pull/79.