@unmap/nuxt 0.0.5 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/dist/module.d.ts +2 -2
- package/dist/module.js.map +1 -1
- package/package.json +20 -3
package/README.md
CHANGED
|
@@ -29,4 +29,18 @@ const { mapContainer } = useUnmap({ key: useRuntimeConfig().public.unmap.key, ce
|
|
|
29
29
|
</template>
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
+
Add MapLibre's stylesheet once, for controls, attribution, markers, and popups:
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
// nuxt.config.ts
|
|
36
|
+
export default defineNuxtConfig({
|
|
37
|
+
modules: ['@unmap/nuxt'],
|
|
38
|
+
unmap: { key: 'um_live_...' },
|
|
39
|
+
css: ['maplibre-gl/dist/maplibre-gl.css'],
|
|
40
|
+
})
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
`maplibre-gl` arrives as a transitive dependency; under pnpm's strict layout add it as a direct
|
|
44
|
+
dependency so the import resolves.
|
|
45
|
+
|
|
32
46
|
Requires Nuxt 3.13 or later. Docs: [unmap.dev/docs](https://unmap.dev/docs/overview).
|
package/dist/module.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
2
|
|
|
3
3
|
interface ModuleOptions {
|
|
4
|
-
/** unmap
|
|
4
|
+
/** unmap API key (um_live_... / um_test_...). */
|
|
5
5
|
key?: string;
|
|
6
|
-
/**
|
|
6
|
+
/** API base URL. Defaults to `https://api.unmap.dev`. */
|
|
7
7
|
gateway?: string;
|
|
8
8
|
}
|
|
9
9
|
interface NormalizedOptions {
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/module.ts","../src/options.ts"],"sourcesContent":["import { defineNuxtModule, addImportsSources } from \"@nuxt/kit\";\nimport { normalizeOptions, type ModuleOptions } from \"./options\";\n\nexport type { ModuleOptions, NormalizedOptions } from \"./options\";\nexport { normalizeOptions } from \"./options\";\n\n/** Composables re-exported from `@unmap/vue`, auto-imported into every component. */\nconst UNMAP_VUE_IMPORTS = [\"useUnmap\", \"useGeocoder\", \"useDirections\"] as const;\n\n/**\n * Nuxt 3 module for unmap. Adds public runtime config `unmap: { key, gateway }`\n * (overridable via `NUXT_PUBLIC_UNMAP_KEY` / `NUXT_PUBLIC_UNMAP_GATEWAY`) and\n * auto-imports the `@unmap/vue` composables.\n *\n * // nuxt.config.ts\n * export default defineNuxtConfig({\n * modules: [\"@unmap/nuxt\"],\n * unmap: { key: \"um_live_...\" },\n * });\n */\nexport default defineNuxtModule<ModuleOptions>({\n meta: {\n name: \"@unmap/nuxt\",\n configKey: \"unmap\",\n compatibility: { nuxt: \">=3.13.0\" },\n },\n defaults: {},\n setup(options, nuxt) {\n const normalized = normalizeOptions(options);\n\n // Publish to public runtime config so the key/gateway reach the client.\n nuxt.options.runtimeConfig.public.unmap = {\n ...(nuxt.options.runtimeConfig.public.unmap as Record<string, unknown> | undefined),\n key: normalized.key,\n gateway: normalized.gateway,\n };\n\n // Auto-import the Vue composables from the published package.\n addImportsSources({\n from: \"@unmap/vue\",\n imports: [...UNMAP_VUE_IMPORTS],\n });\n },\n});\n\ndeclare module \"@nuxt/schema\" {\n interface PublicRuntimeConfig {\n unmap: { key: string; gateway: string };\n }\n interface ConfigSchema {\n unmap?: ModuleOptions;\n }\n}\n","import { DEFAULT_GATEWAY } from \"@unmap/core\";\n\nexport interface ModuleOptions {\n /** unmap
|
|
1
|
+
{"version":3,"sources":["../src/module.ts","../src/options.ts"],"sourcesContent":["import { defineNuxtModule, addImportsSources } from \"@nuxt/kit\";\nimport { normalizeOptions, type ModuleOptions } from \"./options\";\n\nexport type { ModuleOptions, NormalizedOptions } from \"./options\";\nexport { normalizeOptions } from \"./options\";\n\n/** Composables re-exported from `@unmap/vue`, auto-imported into every component. */\nconst UNMAP_VUE_IMPORTS = [\"useUnmap\", \"useGeocoder\", \"useDirections\"] as const;\n\n/**\n * Nuxt 3 module for unmap. Adds public runtime config `unmap: { key, gateway }`\n * (overridable via `NUXT_PUBLIC_UNMAP_KEY` / `NUXT_PUBLIC_UNMAP_GATEWAY`) and\n * auto-imports the `@unmap/vue` composables.\n *\n * // nuxt.config.ts\n * export default defineNuxtConfig({\n * modules: [\"@unmap/nuxt\"],\n * unmap: { key: \"um_live_...\" },\n * });\n */\nexport default defineNuxtModule<ModuleOptions>({\n meta: {\n name: \"@unmap/nuxt\",\n configKey: \"unmap\",\n compatibility: { nuxt: \">=3.13.0\" },\n },\n defaults: {},\n setup(options, nuxt) {\n const normalized = normalizeOptions(options);\n\n // Publish to public runtime config so the key/gateway reach the client.\n nuxt.options.runtimeConfig.public.unmap = {\n ...(nuxt.options.runtimeConfig.public.unmap as Record<string, unknown> | undefined),\n key: normalized.key,\n gateway: normalized.gateway,\n };\n\n // Auto-import the Vue composables from the published package.\n addImportsSources({\n from: \"@unmap/vue\",\n imports: [...UNMAP_VUE_IMPORTS],\n });\n },\n});\n\ndeclare module \"@nuxt/schema\" {\n interface PublicRuntimeConfig {\n unmap: { key: string; gateway: string };\n }\n interface ConfigSchema {\n unmap?: ModuleOptions;\n }\n}\n","import { DEFAULT_GATEWAY } from \"@unmap/core\";\n\nexport interface ModuleOptions {\n /** unmap API key (um_live_... / um_test_...). */\n key?: string;\n /** API base URL. Defaults to `https://api.unmap.dev`. */\n gateway?: string;\n}\n\nexport interface NormalizedOptions {\n key: string;\n gateway: string;\n}\n\n/**\n * Fold module options into the public runtime-config shape, applying the default\n * gateway and trimming trailing slashes. Pure and Nuxt-free, so it can be unit\n * tested without booting a Nuxt app.\n */\nexport function normalizeOptions(options: ModuleOptions = {}): NormalizedOptions {\n const gateway = (options.gateway?.trim() || DEFAULT_GATEWAY).replace(/\\/+$/, \"\");\n return { key: options.key?.trim() ?? \"\", gateway };\n}\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;;;ACApD,SAAS,uBAAuB;AAmBzB,SAAS,iBAAiB,UAAyB,CAAC,GAAsB;AAC/E,QAAM,WAAW,QAAQ,SAAS,KAAK,KAAK,iBAAiB,QAAQ,QAAQ,EAAE;AAC/E,SAAO,EAAE,KAAK,QAAQ,KAAK,KAAK,KAAK,IAAI,QAAQ;AACnD;;;ADfA,IAAM,oBAAoB,CAAC,YAAY,eAAe,eAAe;AAarE,IAAO,iBAAQ,iBAAgC;AAAA,EAC7C,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,WAAW;AAAA,IACX,eAAe,EAAE,MAAM,WAAW;AAAA,EACpC;AAAA,EACA,UAAU,CAAC;AAAA,EACX,MAAM,SAAS,MAAM;AACnB,UAAM,aAAa,iBAAiB,OAAO;AAG3C,SAAK,QAAQ,cAAc,OAAO,QAAQ;AAAA,MACxC,GAAI,KAAK,QAAQ,cAAc,OAAO;AAAA,MACtC,KAAK,WAAW;AAAA,MAChB,SAAS,WAAW;AAAA,IACtB;AAGA,sBAAkB;AAAA,MAChB,MAAM;AAAA,MACN,SAAS,CAAC,GAAG,iBAAiB;AAAA,IAChC,CAAC;AAAA,EACH;AACF,CAAC;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unmap/nuxt",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Nuxt 3 module for unmap: runtime config + auto-imported @unmap/vue composables",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"unmap",
|
|
7
|
+
"maps",
|
|
8
|
+
"canada",
|
|
9
|
+
"maplibre",
|
|
10
|
+
"nuxt",
|
|
11
|
+
"nuxt-module"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://unmap.dev/docs/overview",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/unmap-dev/unmap.git",
|
|
17
|
+
"directory": "packages/nuxt"
|
|
18
|
+
},
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/unmap-dev/unmap/issues"
|
|
21
|
+
},
|
|
5
22
|
"type": "module",
|
|
6
23
|
"main": "./dist/module.js",
|
|
7
24
|
"module": "./dist/module.js",
|
|
@@ -21,8 +38,8 @@
|
|
|
21
38
|
},
|
|
22
39
|
"dependencies": {
|
|
23
40
|
"@nuxt/kit": "^3.13.0",
|
|
24
|
-
"@unmap/core": "0.1.
|
|
25
|
-
"@unmap/vue": "0.1.
|
|
41
|
+
"@unmap/core": "0.1.2",
|
|
42
|
+
"@unmap/vue": "0.1.2"
|
|
26
43
|
},
|
|
27
44
|
"devDependencies": {
|
|
28
45
|
"@nuxt/schema": "^3.13.0",
|