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

enhancement/issue 1317 import map generation refactor for exports and leveraging import.meta.resolve #1326

Open
wants to merge 25 commits into
base: master
Choose a base branch
from

Conversation

thescientist13
Copy link
Member

@thescientist13 thescientist13 commented Nov 21, 2024

Related Issue

#1317 / #1309

Test repos (WIP)

Summary of Changes

  1. Complete refactor of import map generation
  2. This now enables support non-JavaScript file formats for import maps #1310
  3. Assuming its in an export map this will now work - auto-resolve dependencies that only import from a directory #907
  4. Upgrade testing dependencies and test dependencies for modern exports (was able to drop @rollup/plugin-replace as a dependency 🎉 )
  5. Resolves auto-resolve dependencies that only import from a directory #907
  6. This will require a minimum NodeJS bump to 20.x for JSON Modules bug and will indirectly resolve Upgrade to Node 20.x (latest LTS) #1202

Plan is to extend import.meta.resolve throughout Greenwood for plugins, building. So for that reason #1313 / #684 will carry over into a follow up PR, which should address all the demo PRs.

Documentation

  1. improve website docs / recommendations on using scripts and styles (non launch gating?) - improve documentation around referencing scripts and import map diagnostics www.greenwoodjs.dev#144
    • avoid /, always use relative
    • node modules compat
    • what our import map resolver supports
  2. Known issues with import maps - improve documentation around referencing scripts and import map diagnostics www.greenwoodjs.dev#144
  3. Minimum Node version - hmm, build seems to be fine on Node 18 and not getting locally at all? Seems like we leave it as is

TODOs

  1. Bump NodeJS version to minimum version per - ERR_INTERNAL_ASSERTION with Strapi CLI nodejs/node#51354
    • engines
    • GitHub Actions
  2. Fix Windows test cases
  3. merge enhancement/issue 1218 native import attributes parsing #1321 and rebase (copy over walker package ranger 1)
  4. error handling / diagnostics
    • console log about building up import map?
    • track / "collapse" module not found error messages
    • warn if valid condition not met
  5. clean up demo code / console logs / leave good comments (backup branch first for easy reference of import maps behavior)

@thescientist13 thescientist13 added bug Something isn't working enhancement Improve something existing (e.g. no docs, new APIs, etc) documentation Greenwood specific docs breaking labels Nov 26, 2024
@thescientist13 thescientist13 added feature New feature or request CLI labels Nov 27, 2024
@thescientist13 thescientist13 linked an issue Nov 27, 2024 that may be closed by this pull request
@thescientist13 thescientist13 marked this pull request as ready for review November 28, 2024 18:23
@thescientist13 thescientist13 force-pushed the enhancement/issue-1317-import-map-generation-refactor branch from b855aab to 42a3ae8 Compare November 28, 2024 21:17
@thescientist13 thescientist13 force-pushed the enhancement/issue-1317-import-map-generation-refactor branch from 42a3ae8 to 86f9c3c Compare November 28, 2024 22:51
@thescientist13 thescientist13 changed the title enhancement/issue 1317 import map generation refactor enhancement/issue 1317 import map generation refactor for exports and leveraging import.meta.resolve Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment