doxa-maps/plugin-designs/key-cities/index.js
Doxa Maps 45d931fa40 Repair what the union resolution duplicated
Resolving package.json conflicts by unioning unique lines is right for a file
that holds one entry per line. Applied to ordinary source it duplicates
declarations, because both sides of a hunk keep their copy and nothing
de-duplicates across the join.

Eleven plugin entry points ended with the same import twice, and the poster
renderer with two identical `const sheet`. Each is a SyntaxError: every one of
those bundles would have failed to build, and the poster export would not run.

Found by parse-checking every changed .js against the merge base, not by the
gates -- gates:pre passed 101 of 102 with all twelve files broken, because its
parse gates do not cover plugin entry points.

One measurement trap worth recording. `node --check` on a .js file parses it as
CommonJS, so a bare `import` is a syntax error and ALL 28 entry points appear
broken, on development too. That reading says the tree is on fire and is simply
wrong. Copying each file to a .mjs and checking that parses it as a module,
which separates the eleven that are genuinely broken here from the rest that
are fine.
2026-09-29 16:01:45 +00:00

45 lines
1.7 KiB
JavaScript

import { defineMapElement } from '@map/elements/defineMapElement.js'
/**
* plugin-designs/key-cities/index.js — bundle entry for KEY CITIES.
*
* Registers ONE custom-element tag:
* <key-cities-map profile-config='{"profile":"cities-list"}'></key-cities-map>
*
* Same shape as country-posters/index.js — folder = bundle, each flat .vue = a
* profile, `profile` is the FILENAME not the folder. ProfileLoader lives in @map
* and cannot glob into a bundle folder, so the BUNDLE evaluates the glob and hands
* the registry over via app.provide('profileModules').
*
* NO COLOR STRATEGIES registered here: this bundle currently ships a list profile
* only. When the map profile lands it will need one, and it goes in src/colors/
* where the registry auto-discovers it by filename.
*
* NO MAPBOX RTL PLUGIN either — nothing here renders a basemap yet. Adding the
* plugin call before a map exists would be dead code implying a capability the
* bundle does not have.
*/
// Evaluated by Vite at build time relative to THIS file, so it captures only this
// bundle's profiles.
const profileModules = import.meta.glob('./*.vue')
function buildKeyCitiesElement() {
return defineMapElement({
profileModules,
configureApp: (app, { pinia, i18n }) => {
// Per-instance Pinia + i18n so multiple embeds on one page never bleed state.
},
})
}
const KeyCitiesElement = buildKeyCitiesElement()
// Guarded: customElements.define() is one-shot per tag per page session, so an
// IIFE loaded twice would throw without this.
if (typeof customElements !== 'undefined') {
if (!customElements.get('key-cities-map')) {
customElements.define('key-cities-map', KeyCitiesElement)
}
}
export default KeyCitiesElement