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 684 import meta resolve refactor part 2 #1341

Merged

Conversation

thescientist13
Copy link
Member

@thescientist13 thescientist13 commented Dec 7, 2024

Related Issue

resolves #684 / #1313

See demos here

Summary of Changes

  1. Refactor import maps generation to provide full href, prefixed with a /~/
  2. Fully extend use of import.meta.resolve throughout Greenwood (no hardcoded node_modules location assumptions 💯 )
  3. Added a main entry point to @greenwood/cli's package.json (so things like hashing utils and static router can get resolved with import.meta.resolve)
  4. Was able to remove hacky local monorepo workaround from rollup.config.js 🏆
  5. Now that we are using import.meta.resolve don't need to copy node_modules libs into test cases anymore (although still needed it for context / theme packs, but can look into those later)

Documentation

  1. track additional considerations - improve documentation around referencing scripts, styles, and import map diagnostics www.greenwoodjs.dev#144

TODO

  1. handle last couple of test cases
    • theme pack test cases
    • new import map snapshot
  2. resolve windows test failures
  3. review integration issues with v0.31.0-alpha.0
  4. Final reference checks for hardcoded node_modules
    • CLI -> bundle.js
    • raw plugin matchers
    • commonjs plugin
    • puppeteer plugin
  5. walker package ranger edge cases / diagnostics enhancements
    • ignore warnings for bin only deps? - cannot reproduce
    • some projects assume index.js with no main entry point - https://unpkg.com/browse/[email protected]/
    • duplicate // on wildcard specifiers
    • link to website docs from error message
  6. no more local override hack in rollup config needed now?
  7. now that we are using import.meta.resolve, do we still need to copy node_modules libs into test cases anymore?
    • getDependencyFiles
    • getSetupFiles
  8. Community feedback / validation - CSS build errors not shown in dev mode when using Lit SSR #1339 (reply in thread)
  9. I think we missed a spot! - https://github.com/ProjectEvergreen/greenwood/blob/master/packages/cli/src/plugins/resource/plugin-standard-css.js#L52
  10. remove demo code

@thescientist13 thescientist13 added enhancement Improve something existing (e.g. no docs, new APIs, etc) documentation Greenwood specific docs Plugins Greenwood Plugins CLI labels Dec 7, 2024
@thescientist13 thescientist13 self-assigned this Dec 7, 2024
@thescientist13 thescientist13 linked an issue Dec 7, 2024 that may be closed by this pull request
@thescientist13 thescientist13 marked this pull request as ready for review December 9, 2024 23:45
@thescientist13 thescientist13 added the chore unit testing, maintenance, etc label Dec 12, 2024
@thescientist13 thescientist13 merged commit 0303c95 into master Dec 13, 2024
8 checks passed
@thescientist13 thescientist13 deleted the enhancement/issue-684-import-meta-resolve-refactor-part-2 branch December 13, 2024 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore unit testing, maintenance, etc CLI documentation Greenwood specific docs enhancement Improve something existing (e.g. no docs, new APIs, etc) Plugins Greenwood Plugins
Projects
None yet
1 participant