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 improve import map generation diagnostics #1389

Merged

Conversation

thescientist13
Copy link
Member

@thescientist13 thescientist13 commented Jan 19, 2025

Related Issue

#684

Documentation

  1. docs/issue 144 best practices and recommendations for import maps and referencing node modules www.greenwoodjs.dev#153

Summary of Changes

  1. Made diagnostics output a bit more readable

       ****************************************************************************
       - ERROR (ERR_PACKAGE_PATH_NOT_EXPORTED): unable to resolve specifier => `@libsql/core` 
       No "exports" main defined in /Users/owenbuckley/Workspace/analogstudiosri/api/node_modules/@libsql/core/package.json imported from /Users/owenbuckley/Workspace/analogstudiosri/api/node_modules/@greenwood/cli/src/lib/walker-package-ranger.js
    
    • ERROR (ERR_PACKAGE_PATH_NOT_EXPORTED): unable to resolve specifier => @types/ws
      No "exports" main defined in /Users/owenbuckley/Workspace/analogstudiosri/api/node_modules/@types/ws/package.json imported from /Users/owenbuckley/Workspace/analogstudiosri/api/node_modules/@greenwood/cli/src/lib/walker-package-ranger.js

    • ERROR (ERR_PACKAGE_PATH_NOT_EXPORTED): unable to resolve specifier => dunder-proto
      No "exports" main defined in /Users/owenbuckley/Workspace/analogstudiosri/api/node_modules/dunder-proto/package.json imported from /Users/owenbuckley/Workspace/analogstudiosri/api/node_modules/@greenwood/cli/src/lib/walker-package-ranger.js

    • ERROR (ERR_PACKAGE_PATH_NOT_EXPORTED): unable to resolve specifier => math-intrinsics
      No "exports" main defined in /Users/owenbuckley/Workspace/analogstudiosri/api/node_modules/math-intrinsics/package.json imported from /Users/owenbuckley/Workspace/analogstudiosri/api/node_modules/@greenwood/cli/src/lib/walker-package-ranger.js

    • ERROR (ERR_MODULE_NOT_FOUND): unable to resolve specifier => type-fest
      Cannot find package 'type-fest' imported from /Users/owenbuckley/Workspace/analogstudiosri/api/node_modules/@greenwood/cli/src/lib/walker-package-ranger.js

    Learn more about these warnings at https://greenwoodjs.dev/docs/introduction/web-standards/#import-maps <<<


  2. Handle NodeJS resolving to built-ins - https://github.com/thescientist13/import-meta-resolve-demo?tab=readme-ov-file#node-built-ins-hijacking-dependencies

TODO

  1. Node built ins (expected behavior) - https://github.com/thescientist13/import-meta-resolve-demo?tab=readme-ov-file#node-built-ins-hijacking-dependencies
  2. See if we can better handle ERR_PACKAGE_PATH_NOT_EXPORTED - just going to document best we can for now - Improved Import Map Generation Error Handling / Diagnostics reporting #1396
  3. Make diagnostics a Map
  4. final website documentation / takeaways / best practices - docs/issue 144 best practices and recommendations for import maps and referencing node modules www.greenwoodjs.dev#153
  5. absorb diagnostics logging output configuration #1394? - Not right now

@thescientist13 thescientist13 force-pushed the enhancement/improve-import-map-generation-diagnostics branch from d04cb78 to 86e04ac Compare January 23, 2025 19:43
@thescientist13 thescientist13 marked this pull request as ready for review January 23, 2025 20:02
@thescientist13 thescientist13 merged commit a1423cd into master Jan 23, 2025
10 checks passed
@thescientist13 thescientist13 deleted the enhancement/improve-import-map-generation-diagnostics branch January 23, 2025 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alpha.6 CLI documentation Greenwood specific docs question Further information is requested v0.31.0
Projects
1 participant