Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion components/inspector_panel/SourcesRow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function SourcesRow({ entity, mode, tips }) {
return `https://facebook.com/${source.record_id}`;
case "OpenStreetMap": {
if (!source.record_id) return null;
const match = source.record_id.match(/^([nwr])(\d+)(@\d+)?$/i);
const match = source.record_id.match(/^([nwr])(\d+)(?:@(\d+))?$/i);
if (!match) return null;

const typeMap = {
Expand All @@ -23,7 +23,12 @@ function SourcesRow({ entity, mode, tips }) {

const type = typeMap[match[1].toLowerCase()];
const id = match[2];
const version = match[3];

// If version is present, link to the specific version in history
if (version) {
return `https://www.openstreetmap.org/${type}/${id}/history/${version}`;
}
return `https://www.openstreetmap.org/${type}/${id}`;
}
default:
Expand Down
11 changes: 11 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
"name": "explore-site",
"version": "1.0.0",
"private": true,
"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"
Comment on lines +5 to +14

Copilot AI Mar 30, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
},
Comment on lines +5 to +15

Copilot AI Mar 30, 2026

Copy link

Choose a reason for hiding this comment

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

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).

Suggested change
"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"
},

Copilot uses AI. Check for mistakes.
"scripts": {
"dev": "next dev",
"postinstall": "node scripts/copy-rtl-plugin.mjs",
Expand Down
Loading