Enable exports - #265
Conversation
Jennings Anderson (jenningsanderson)
commented
Mar 6, 2026
- Add functionality to link to OSM version specifically
- Package up the explore-site so the QA console can use the components
🗺️ Overture Explorer preview is live!
Note ♻️ This preview updates automatically with each push to this PR. |
Alex Iannicelli (atiannicelli)
left a comment
There was a problem hiding this comment.
Cool
|
There is an issue with staging deploys such as https://staging.overturemaps.org/explore-site/pr/265/index.html
This means that fonts and icons don't load and you see 403 errors in the console. |
Should we just throw fonts, icons and other known shared assets into the gh-pages/ directory to avoid these types of errors more generally? |
❌ PR Title Validation FailedError: No release type found in pull request title "Enable exports". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/ Available types:
Examples:
See the Overture Maps Foundation GitHub usage guidelines for full documentation. |
Jennings Anderson (@jenningsanderson) I updated the branch from |
There was a problem hiding this comment.
Pull request overview
This PR aims to make the explore-site package consumable by external clients (e.g., the QA console) via package.json exports, and improves OpenStreetMap source linking by supporting links to a specific OSM element version.
Changes:
- Added an
exportsmap inpackage.jsonto expose app entrypoint, components, selected libs, and global CSS. - Updated OSM source parsing/link generation to support
n|w|r<id>@<version>and link directly to the version’s history page.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| package.json | Introduces subpath exports to enable importing components/libs/CSS from other packages. |
| components/inspector_panel/SourcesRow.jsx | Enhances OSM link generation to support record IDs containing an explicit version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "exports": { | ||
| ".": "./app/page.jsx", | ||
| "./components/*": "./components/*.jsx", | ||
| "./components/nav/*": "./components/nav/*.jsx", | ||
| "./components/inspector_panel/*": "./components/inspector_panel/*.jsx", | ||
| "./components/map": "./components/map/index.js", | ||
| "./components/map/*": "./components/map/*", | ||
| "./lib/*": "./lib/*.js", | ||
| "./lib/util/*": "./lib/util/*.js", | ||
| "./app/globals.css": "./app/globals.css" |
There was a problem hiding this comment.
The exported components rely heavily on the Next/jsconfig path alias @/… (e.g., import … from "@/components/..."). When this package is consumed from another repo (as the PR description suggests), those imports will typically resolve against the consumer app’s @ alias (or not resolve at all), causing build/runtime failures. To make these exports usable as a library, switch internal imports to relative paths (or to this package’s own subpath exports like explore-site/components/...) or add a build step that rewrites/compiles these imports for distribution.
| "exports": { | ||
| ".": "./app/page.jsx", | ||
| "./components/*": "./components/*.jsx", | ||
| "./components/nav/*": "./components/nav/*.jsx", | ||
| "./components/inspector_panel/*": "./components/inspector_panel/*.jsx", | ||
| "./components/map": "./components/map/index.js", | ||
| "./components/map/*": "./components/map/*", | ||
| "./lib/*": "./lib/*.js", | ||
| "./lib/util/*": "./lib/util/*.js", | ||
| "./app/globals.css": "./app/globals.css" | ||
| }, |
There was a problem hiding this comment.
The exports map points directly at source .jsx files that import global .css files. Many bundlers/Node environments can’t execute .jsx from dependencies without a compile step, and Next.js commonly errors on global CSS imports from node_modules. If the goal is to consume these components from another app, consider publishing compiled JS (e.g., dist/ with .js/.mjs) and converting component styles to CSS Modules (or otherwise documenting/handling required consumer configuration like transpilePackages + CSS handling).
| "exports": { | |
| ".": "./app/page.jsx", | |
| "./components/*": "./components/*.jsx", | |
| "./components/nav/*": "./components/nav/*.jsx", | |
| "./components/inspector_panel/*": "./components/inspector_panel/*.jsx", | |
| "./components/map": "./components/map/index.js", | |
| "./components/map/*": "./components/map/*", | |
| "./lib/*": "./lib/*.js", | |
| "./lib/util/*": "./lib/util/*.js", | |
| "./app/globals.css": "./app/globals.css" | |
| }, |
❌ Linked Issue Check FailedThis PR does not reference enough linked issues (found 0, required 1). Please link an issue from this repository, using After adding a linked issue, you may need to manually re-run this check from the Checks tab to update the status. |
|
Jennings Anderson (@jenningsanderson) Do you want to reduce the scope of this to just the OSM linkage so we can merge it in, and then save the export for later? I'm happy to work on the export stuff with you - we could publish this as a package to really make it easy to import :) |