@nika-js/onlymap 0.3.1 → 0.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nika-js/onlymap",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "Declarative deck.gl maps for HTML and React \u2014 interactive WebGL mapping with GeoJSON/CSV/Arrow data, MapLibre basemaps, widgets, popups, and live streams from a custom-element manifest or typed React components. TypeScript, no build step.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "publishConfig": {
@@ -47,6 +47,9 @@
47
47
  "module": "./dist/onlymapjs.js",
48
48
  "types": "./dist/index.d.ts",
49
49
  "style": "./dist/onlymapjs.css",
50
+ "comment:cdn-fields": "Bare CDN URLs (https://unpkg.com/@nika-js/onlymap) must serve the single-file standalone bundle, never the code-split entry: rebundling CDNs duplicate the deck.gl/luma.gl runtime across lazy chunks and break shader compilation (see vite.standalone.config.ts).",
51
+ "unpkg": "./dist/onlymap.standalone.js",
52
+ "jsdelivr": "./dist/onlymap.standalone.js",
50
53
  "bin": {
51
54
  "onlymapjs": "bin/onlymapjs.mjs"
52
55
  },
@@ -66,7 +69,13 @@
66
69
  "import": "./dist/deck.js",
67
70
  "default": "./dist/deck.js"
68
71
  },
72
+ "./standalone": {
73
+ "types": "./dist/index.d.ts",
74
+ "import": "./dist/onlymap.standalone.js",
75
+ "default": "./dist/onlymap.standalone.js"
76
+ },
69
77
  "./onlymapjs.css": "./dist/onlymapjs.css",
78
+ "./style.css": "./dist/style.css",
70
79
  "./onlymapjs.html-data.json": "./onlymapjs.html-data.json",
71
80
  "./onlymap.code-snippets": "./.vscode/onlymap.code-snippets",
72
81
  "./package.json": "./package.json"
@@ -97,7 +106,7 @@
97
106
  ],
98
107
  "scripts": {
99
108
  "dev": "vite",
100
- "build": "npm run typecheck && npm run gen:licenses && vite build && vite build --config vite.react.config.ts && vite build --config vite.deck.config.ts && npm run build:types",
109
+ "build": "npm run typecheck && npm run gen:licenses && vite build && vite build --config vite.react.config.ts && vite build --config vite.deck.config.ts && vite build --config vite.standalone.config.ts && npm run build:types",
101
110
  "build:types": "tsc -p tsconfig.build.json --emitDeclarationOnly",
102
111
  "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.e2e.json --noEmit && tsc -p cloud/workers/telemetry/tsconfig.json",
103
112
  "test": "vitest run",
@@ -23,7 +23,7 @@ Use OnlyMapJS as a declarative HTML map library. Write custom elements such as `
23
23
  </script>
24
24
  ```
25
25
 
26
- For no-build CDN examples, use a published module URL such as `https://esm.sh/@nika-js/onlymap@0.3.1`.
26
+ For no-build CDN pages, use the single-file standalone bundle from a raw-file CDN — `https://unpkg.com/@nika-js/onlymap@0.3.2` (the bare package URL serves `dist/onlymap.standalone.js`) — plus `<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.3.2/dist/onlymapjs.css">`. Never a rebundling CDN (esm.sh, skypack): re-bundling duplicates the deck.gl/luma.gl runtime and every layer fails shader compilation.
27
27
 
28
28
  ## React Projects
29
29
 
@@ -13,10 +13,11 @@ Vite/npm project:
13
13
  </script>
14
14
  ```
15
15
 
16
- Static CDN page:
16
+ Static CDN page (raw-file CDNs only — unpkg/jsDelivr; never esm.sh or another rebundling CDN, which duplicates the WebGL runtime and breaks layer shaders):
17
17
 
18
18
  ```html
19
- <script type="module" src="https://esm.sh/@nika-js/onlymap@0.1.0"></script>
19
+ <link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.3.2/dist/onlymapjs.css">
20
+ <script type="module" src="https://unpkg.com/@nika-js/onlymap@0.3.2"></script>
20
21
  ```
21
22
 
22
23
  Always include `onlymapjs.css` — it carries the MapLibre basemap styles and the no-JS fallback rules (`<om-fallback>` / default banner). For the fallback to work in script-disabled previews it must load without JavaScript: a real `<link rel="stylesheet">` or inlined `<style>` on no-build pages (a bundler-emitted stylesheet is fine in npm projects).