Skip to content

Commit 080dc93

Browse files
authoredJul 30, 2021
Modifications to allow npm publication and unpkg content delivery. (#500)
* Addresses #493; adding scope allows publishing to npm * typo fix. * Addresses #493 by suggesting a node version. * Addresses #493; rearranged Gruntfile to keep .md files at root and not duplicate package.json in /dist. Apologies for spurious whitespace changes, my IDE chomps trailing spaces on save. * Closes #493; version 0.8.x are available via unpkg and npm, README is updated with an Installation section for these additions. * Correcting syntax highlighting from shell to html.
1 parent 7d6819b commit 080dc93

File tree

4 files changed

+10927
-202
lines changed

4 files changed

+10927
-202
lines changed
 

‎Gruntfile.js

+17-17
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ module.exports = function(grunt) {
3333
// ensure that jshint keeps processing after an error
3434
force: true,
3535
esversion: 6
36-
36+
3737
}
3838
},
3939
watch: {
@@ -47,47 +47,47 @@ module.exports = function(grunt) {
4747
expand: true,
4848
cwd: 'node_modules/leaflet/dist/',
4949
flatten: true,
50-
filter: 'isFile',
51-
src: ['leaflet.css','leaflet-src.js'],
50+
filter: 'isFile',
51+
src: ['leaflet.css','leaflet-src.js'],
5252
dest: 'dist/'
5353
},
5454
{
5555
expand: true,
5656
cwd: 'node_modules/proj4/dist/',
5757
flatten: true,
58-
filter: 'isFile',
59-
src: ['proj4-src.js'],
58+
filter: 'isFile',
59+
src: ['proj4-src.js'],
6060
dest: 'dist/'
6161
},
6262
{
6363
expand: true,
6464
cwd: 'node_modules/proj4leaflet/src/',
6565
flatten: true,
66-
filter: 'isFile',
67-
src: ['proj4leaflet.js'],
66+
filter: 'isFile',
67+
src: ['proj4leaflet.js'],
6868
dest: 'dist/'
6969
},
7070
{
7171
expand: true,
7272
cwd: 'node_modules/@runette/leaflet-fullscreen/dist/',
7373
flatten: true,
74-
filter: 'isFile',
75-
src: ['Leaflet.fullscreen.js','leaflet.fullscreen.css'],
74+
filter: 'isFile',
75+
src: ['Leaflet.fullscreen.js','leaflet.fullscreen.css'],
7676
dest: 'dist/'
7777
},
7878
{
7979
expand: true,
8080
cwd: 'src',
8181
flatten: true,
82-
filter: 'isFile',
83-
src: ['*.js','*.css','*.md','index.html','package.json'],
82+
filter: 'isFile',
83+
src: ['*.js','*.css','*.md','index.html','package.json'],
8484
dest: 'dist/'
8585
},
8686
{
8787
expand: true,
8888
flatten: true,
89-
filter: 'isFile',
90-
src: ['*.md','index.html','package.json'],
89+
filter: 'isFile',
90+
src: ['index.html'],
9191
dest: 'dist/'
9292
}
9393
],
@@ -128,7 +128,7 @@ module.exports = function(grunt) {
128128
}
129129
}
130130
},
131-
images: {
131+
images: {
132132
// if you pass images through the process function, it corrupts them,
133133
// so you have to do this in a separate grunt 'target' ('main' being the
134134
// default one, I believe).
@@ -137,8 +137,8 @@ module.exports = function(grunt) {
137137
expand: true,
138138
cwd: 'node_modules/leaflet/dist/images/',
139139
flatten: true,
140-
filter: 'isFile',
141-
src: ['layers.png','layers-2x.png'],
140+
filter: 'isFile',
141+
src: ['layers.png','layers-2x.png'],
142142
dest: 'dist/images/'
143143
}
144144
]
@@ -175,4 +175,4 @@ module.exports = function(grunt) {
175175
grunt.registerTask('default', ['clean:dist', 'copy', 'jshint', 'rollup', 'uglify']);
176176
grunt.registerTask('build', ['rollup']);
177177

178-
};
178+
};

‎README.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,19 @@ The `<mapml-viewer>` custom element is a prototype implementation of the
88
defined in the MapML (Map Markup Language)
99
[specification](https://maps4html.org/MapML/spec/).
1010

11-
<!-- ## Installation -->
11+
## Installation
12+
13+
Beginning with `v0.8.2`, &lt;mapml-viewer&gt; can be loaded from the [UNPKG content delivery network](https://unpkg.com/)
14+
```html
15+
<script type="module" src="https://unpkg.com/@maps4html/web-map-custom-element@0.8.2/dist/mapml-viewer.js"></script>
16+
```
17+
18+
– or installed using npm.
19+
```bash
20+
npm install @maps4html/web-map-custom-element
21+
```
22+
23+
Note: `v0.8.X` npm releases are functionally equivalent to [standalone release`v0.8.0`](https://github.com/Maps4HTML/Web-Map-Custom-Element/releases/tag/v0.8.0).
1224

1325
## Usage
1426

‎package-lock.json

+10,894-182
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@maps4html/web-map-custom-element",
3-
"version": "0.8.0",
3+
"version": "0.8.2",
44
"description": "web-map customized built-in HTML <map> or custom <mapml-viewer>",
55
"keywords": [
66
"web-components",
@@ -55,5 +55,6 @@
5555
"proj4": "^2.6.2",
5656
"proj4leaflet": "^1.0.2",
5757
"rollup": "^2.23.1"
58-
}
58+
},
59+
"files": [ "dist", "*.md" ]
5960
}

0 commit comments

Comments
 (0)
Please sign in to comment.