@unmap/nuxt 0.1.1 → 0.1.3
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/LICENSE +21 -0
- package/README.md +14 -0
- package/dist/module.d.ts +2 -2
- package/dist/module.js.map +1 -1
- package/package.json +21 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Maps & Apps Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
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,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unmap/nuxt",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Nuxt 3 module for unmap: runtime config + auto-imported @unmap/vue composables",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"unmap",
|
|
8
|
+
"maps",
|
|
9
|
+
"canada",
|
|
10
|
+
"maplibre",
|
|
11
|
+
"nuxt",
|
|
12
|
+
"nuxt-module"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://unmap.dev/docs/overview",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/unmap-dev/unmap.git",
|
|
18
|
+
"directory": "packages/nuxt"
|
|
19
|
+
},
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/unmap-dev/unmap/issues"
|
|
22
|
+
},
|
|
5
23
|
"type": "module",
|
|
6
24
|
"main": "./dist/module.js",
|
|
7
25
|
"module": "./dist/module.js",
|
|
@@ -21,8 +39,8 @@
|
|
|
21
39
|
},
|
|
22
40
|
"dependencies": {
|
|
23
41
|
"@nuxt/kit": "^3.13.0",
|
|
24
|
-
"@unmap/core": "0.1.
|
|
25
|
-
"@unmap/vue": "0.1.
|
|
42
|
+
"@unmap/core": "0.1.3",
|
|
43
|
+
"@unmap/vue": "0.1.3"
|
|
26
44
|
},
|
|
27
45
|
"devDependencies": {
|
|
28
46
|
"@nuxt/schema": "^3.13.0",
|