rasendubi / uniorg

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

feat: move to ESM #29

Closed tefkah closed 2 years ago

tefkah commented 2 years ago

Updates all the uniorg packages to use and work with the latest versions of the unified ecosystem, which all solely use Ecmascript modules.

Additionally I added some stricter typings to uniorg-rehype.

Everything works, passes all tests, just need to add a tag!

tefkah commented 2 years ago

The other thing left to do is update all the documentation.

tefkah commented 2 years ago

Okay I will try and fix this later, I'm having the biggest case of "Well it works on my machine" ever grrrr

tefkah commented 2 years ago

I am going to become the joker

tefkah commented 2 years ago

Alright I give up for now, maybe you can have a look at why this fails @rasendubi ? I'm going insane

PS. Sorry for all the notifications!

rasendubi commented 2 years ago

😂😂😂 sure man, I'll take a look this week. maybe tonight

codecov-commenter commented 2 years ago

Codecov Report

Merging #29 (b6490ff) into master (3cefeb8) will increase coverage by 0.04%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master      #29      +/-   ##
==========================================
+ Coverage   95.66%   95.70%   +0.04%     
==========================================
  Files          14       15       +1     
  Lines        1544     1606      +62     
  Branches      493      515      +22     
==========================================
+ Hits         1477     1537      +60     
- Misses         66       68       +2     
  Partials        1        1              
Impacted Files Coverage Δ
packages/uniorg-parse/src/utils.ts 100.00% <ø> (+1.78%) :arrow_up:
packages/orgast-util-visit-ids/src/index.ts 100.00% <100.00%> (ø)
packages/uniorg-attach/src/index.ts 100.00% <100.00%> (ø)
packages/uniorg-extract-keywords/src/index.ts 100.00% <100.00%> (ø)
packages/uniorg-parse/src/parser.ts 94.86% <100.00%> (+0.04%) :arrow_up:
packages/uniorg-parse/src/reader.ts 96.10% <100.00%> (-0.96%) :arrow_down:
packages/uniorg-rehype/src/index.ts 100.00% <100.00%> (ø)
packages/uniorg-rehype/src/org-to-hast.ts 97.58% <100.00%> (-0.40%) :arrow_down:
packages/uniorg-rehype/src/unified-org-rehype.ts 100.00% <100.00%> (ø)
packages/uniorg-slug/src/index.ts 100.00% <100.00%> (ø)
... and 11 more

:mega: Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

rasendubi commented 2 years ago

uniorg v0.5.0 is now ESM-only 🎉

@ThomasFKJorna thank you for doing most of the migration, and congrats on your second PR!

tefkah commented 2 years ago

Fantastic! Did you manage to figure out why the builds were all failing?

tefkah commented 2 years ago

Oh and sorry for leaving the org cite types in, I was working on that separately but mixed those commits in somehow 😅

I would like to add separate support for those if you're okay with that, currently citations such as [cite//b:@Shech2019] aren't picked up by uniorg (unless you add the link types separately of course, but thats a bit of a chore), plus I think providing richer data for citations is useful when writing converters (I'm writing a uniorg-remark one atm).

rasendubi commented 2 years ago

Fantastic! Did you manage to figure out why the builds were all failing?

well, yeah. there were many issues:

  1. Some dependencies have broken semantic versioning, so you couldn't even build master: https://github.com/rasendubi/uniorg/pull/31
  2. The setup-node github action was outdated, so just setting node version to 16.x didn't work. https://github.com/rasendubi/uniorg/pull/32
  3. With node-16, lerna has some bizzare issue when working in CI environment — it simply did not install dependencies. (You could reproduce this with export CI=1.) That's why you would see build not finding dependencies and types. Fixed this by forcing lerna bootstrap --no-ci.
  4. The vercel still used node-12, so org-braindump/org-blog-started jobs failed.

re citation support: I'm absolutely for it! I even started working on it before the war. I don't remember where I stopped, but here are my stashed changes: https://github.com/rasendubi/uniorg/pull/33. You can pick them up (use org-element.el as inspiration) and I'll try to help in a week or two