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

docs/issue 144 best practices and recommendations for import maps and referencing node modules #153

Conversation

thescientist13
Copy link
Member

@thescientist13 thescientist13 commented Dec 16, 2024

Related Issue

resolves #144

Summary of Changes

  1. Update docs around Import Maps implementation details and ecosystem compatibility
  2. Improve Script and Styles docs for best practices regarding using bare and relative specifiers and the "shortcut" alias for referencing /node_modules based paths
  3. Add Lit component library demos link to the Lit ecosystem page
  4. Demonstrate helper utilities in Copy Plugin docs

TODO

  1. Plugins Docs
  2. Typo - https://github.com/ProjectEvergreen/www.greenwoodjs.dev/pull/153/files#r1890986368
  3. Fix open props example in guides too - https://github.com/ProjectEvergreen/www.greenwoodjs.dev/blob/main/src/pages/guides/ecosystem/index.md
  4. Final draft review
  5. Create a discussion for Greenwood on imports - Improved Import Map Generation Error Handling / Diagnostics reporting greenwood#1396
    • most ERR_MODULE_NOT_FOUND are related to typescript files. Any way we can see those project's have a package.json with just a types field (and none of our supported conditions) and suppress the error, since we can assume it's just a types file?
  6. call out ESM needed for import maps?
  7. has to merged after and updated for snippets added in this PR - feature/issue 96 enhanced copy to clipboard with PNPM docs #120

@thescientist13 thescientist13 added the docs Greenwood specific content like docs and guides label Dec 16, 2024
Copy link

netlify bot commented Dec 16, 2024

Deploy Preview for super-tapioca-5987ce ready!

Name Link
🔨 Latest commit 3e68aa0
🔍 Latest deploy log https://app.netlify.com/sites/super-tapioca-5987ce/deploys/679805e6fae51300080f6141
😎 Deploy Preview https://deploy-preview-153--super-tapioca-5987ce.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@thescientist13 thescientist13 changed the title Docs/issue 144 best practices and recommendations for import maps and referencing node modules docs/issue 144 best practices and recommendations for import maps and referencing node modules Dec 16, 2024
@thescientist13 thescientist13 marked this pull request as ready for review December 16, 2024 19:10
@import "../../node_modules/open-props/src/props.fonts.css";
@import "../../node_modules/open-props/src/props.shadows.css";
@import "../../node_modules/open-props/src/props.sizes.css";
@import "../../]node_modules/open-props/borders.min.css";

This comment was marked as resolved.

@thescientist13 thescientist13 marked this pull request as draft December 30, 2024 17:29
Some known issues / examples observed so far include:

- `ERR_MODULE_NOT_FOUND` - Observed with packages like [**@types/trusted-types**](https://github.com/DefinitelyTyped/DefinitelyTyped), which has an [empty string](https://unpkg.com/browse/@types/[email protected]/package.json) for the **main** field, and [**font-awesome**](https://fontawesome.com/), which has [no entry point](https://unpkg.com/browse/[email protected]/package.json) at all, at least as of `v4.x`.
- `ERR_PACKAGE_PATH_NOT_EXPORTED` - Encountered with the [**geist-font** package](https://vercel.com/font), which has [no default export](https://github.com/vercel/geist-font/issues/150) in its exports map
Copy link
Member Author

@thescientist13 thescientist13 Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


Some known issues / examples observed so far include:

- `ERR_MODULE_NOT_FOUND` - Observed with packages like [**@types/trusted-types**](https://github.com/DefinitelyTyped/DefinitelyTyped), which has an [empty string](https://unpkg.com/browse/@types/[email protected]/package.json) for the **main** field, and [**font-awesome**](https://fontawesome.com/), which has [no entry point](https://unpkg.com/browse/[email protected]/package.json) at all, at least as of `v4.x`.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

found another example with type-fest

@thescientist13 thescientist13 force-pushed the docs/issue-144-best-practices-and-recommendations-for-import-maps-and-referencing-node-modules branch from 5056c1a to a4c545c Compare January 27, 2025 22:10
@thescientist13 thescientist13 merged commit c0c4f64 into main Jan 27, 2025
5 checks passed
@thescientist13 thescientist13 deleted the docs/issue-144-best-practices-and-recommendations-for-import-maps-and-referencing-node-modules branch January 27, 2025 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Greenwood specific content like docs and guides release/v0.31.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

improve documentation around referencing scripts, styles, and import map diagnostics
1 participant