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: move to ESM #29

Merged
merged 53 commits into from
Apr 10, 2022
Merged

feat: move to ESM #29

merged 53 commits into from
Apr 10, 2022

Conversation

tefkah
Copy link
Collaborator

@tefkah tefkah commented Apr 4, 2022

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!

@types/jest
  * orgast-util-to-string: ^26.0.23 → 27.4.1
  * orgast-util-visit-ids: ^26.0.23 → 27.4.1
  * uniorg-attach: ^26.0.23 → 27.4.1
  * uniorg-extract-keywords: ^26.0.23 → 27.4.1
  * uniorg-parse: ^26.0.20 → 27.4.1
  * uniorg-rehype: ^26.0.20 → 27.4.1
  * uniorg-slug: ^26.0.23 → 27.4.1
  * uniorg-stringify: ^26.0.23 → 27.4.1
unified
  * blog-starter: ^9.2.0 → 10.1.2
  * example: ^9.2.0 → 10.1.2
  * extract-keywords-example: ^9.2.1 → 10.1.2
  * org-braindump: ^9.2.0 → 10.1.2
  * uniorg-attach: ^9.2.1 → 10.1.2
  * uniorg-extract-keywords: ^9.2.1 → 10.1.2
  * uniorg-rehype: ^9.2.0 → 10.1.2
  * uniorg-slug: ^9.2.1 → 10.1.2
  * uniorg-stringify: ^9.2.1 → 10.1.2
jest
  * orgast-util-to-string: ^26.6.3 → 27.5.1
  * orgast-util-visit-ids: ^26.6.3 → 27.5.1
  * uniorg-attach: ^26.6.3 → 27.5.1
  * uniorg-extract-keywords: ^26.6.3 → 27.5.1
  * uniorg-parse: ^26.6.3 → 27.5.1
  * uniorg-rehype: ^26.6.3 → 27.5.1
  * uniorg-slug: ^26.6.3 → 27.5.1
  * uniorg-stringify: ^26.6.3 → 27.5.1
@tefkah
Copy link
Collaborator Author

tefkah commented Apr 5, 2022

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
Copy link
Owner

rasendubi commented Apr 5, 2022 via email

This reverts commit 6c42331.

This is not related to ESM support and doesn't match org-elements API.
ESM does not try to guess file extensions, so have to specify one.
vfile-rename simply doesn't work for some reason.
@codecov-commenter
Copy link

codecov-commenter commented Apr 10, 2022

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%) ⬆️
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%) ⬆️
packages/uniorg-parse/src/reader.ts 96.10% <100.00%> (-0.96%) ⬇️
packages/uniorg-rehype/src/index.ts 100.00% <100.00%> (ø)
packages/uniorg-rehype/src/org-to-hast.ts 97.58% <100.00%> (-0.40%) ⬇️
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

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

@rasendubi
Copy link
Owner

uniorg v0.5.0 is now ESM-only 🎉

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

@tefkah
Copy link
Collaborator Author

tefkah commented Apr 10, 2022

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

@tefkah
Copy link
Collaborator Author

tefkah commented Apr 10, 2022

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
Copy link
Owner

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: Update dependencies #31
  2. The setup-node github action was outdated, so just setting node version to 16.x didn't work. chore(ci): update nodejs to 16 in CI #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: #33. You can pick them up (use org-element.el as inspiration) and I'll try to help in a week or two

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.

Update vFile dependency to 5.3.0 version Revisit ES Modules support
3 participants