Skip to content

Commit

Permalink
Modifications to allow npm publication and unpkg content delivery. (#500
Browse files Browse the repository at this point in the history
)

* 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.
  • Loading branch information
erictheise authored Jul 30, 2021
1 parent 7d6819b commit 080dc93
Show file tree
Hide file tree
Showing 4 changed files with 10,927 additions and 202 deletions.
34 changes: 17 additions & 17 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module.exports = function(grunt) {
// ensure that jshint keeps processing after an error
force: true,
esversion: 6

}
},
watch: {
Expand All @@ -47,47 +47,47 @@ module.exports = function(grunt) {
expand: true,
cwd: 'node_modules/leaflet/dist/',
flatten: true,
filter: 'isFile',
src: ['leaflet.css','leaflet-src.js'],
filter: 'isFile',
src: ['leaflet.css','leaflet-src.js'],
dest: 'dist/'
},
{
expand: true,
cwd: 'node_modules/proj4/dist/',
flatten: true,
filter: 'isFile',
src: ['proj4-src.js'],
filter: 'isFile',
src: ['proj4-src.js'],
dest: 'dist/'
},
{
expand: true,
cwd: 'node_modules/proj4leaflet/src/',
flatten: true,
filter: 'isFile',
src: ['proj4leaflet.js'],
filter: 'isFile',
src: ['proj4leaflet.js'],
dest: 'dist/'
},
{
expand: true,
cwd: 'node_modules/@runette/leaflet-fullscreen/dist/',
flatten: true,
filter: 'isFile',
src: ['Leaflet.fullscreen.js','leaflet.fullscreen.css'],
filter: 'isFile',
src: ['Leaflet.fullscreen.js','leaflet.fullscreen.css'],
dest: 'dist/'
},
{
expand: true,
cwd: 'src',
flatten: true,
filter: 'isFile',
src: ['*.js','*.css','*.md','index.html','package.json'],
filter: 'isFile',
src: ['*.js','*.css','*.md','index.html','package.json'],
dest: 'dist/'
},
{
expand: true,
flatten: true,
filter: 'isFile',
src: ['*.md','index.html','package.json'],
filter: 'isFile',
src: ['index.html'],
dest: 'dist/'
}
],
Expand Down Expand Up @@ -128,7 +128,7 @@ module.exports = function(grunt) {
}
}
},
images: {
images: {
// if you pass images through the process function, it corrupts them,
// so you have to do this in a separate grunt 'target' ('main' being the
// default one, I believe).
Expand All @@ -137,8 +137,8 @@ module.exports = function(grunt) {
expand: true,
cwd: 'node_modules/leaflet/dist/images/',
flatten: true,
filter: 'isFile',
src: ['layers.png','layers-2x.png'],
filter: 'isFile',
src: ['layers.png','layers-2x.png'],
dest: 'dist/images/'
}
]
Expand Down Expand Up @@ -175,4 +175,4 @@ module.exports = function(grunt) {
grunt.registerTask('default', ['clean:dist', 'copy', 'jshint', 'rollup', 'uglify']);
grunt.registerTask('build', ['rollup']);

};
};
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,19 @@ The `<mapml-viewer>` custom element is a prototype implementation of the
defined in the MapML (Map Markup Language)
[specification](https://maps4html.org/MapML/spec/).

<!-- ## Installation -->
## Installation

Beginning with `v0.8.2`, &lt;mapml-viewer&gt; can be loaded from the [UNPKG content delivery network](https://unpkg.com/)
```html
<script type="module" src="https://unpkg.com/@maps4html/web-map-custom-element@0.8.2/dist/mapml-viewer.js"></script>
```

– or installed using npm.
```bash
npm install @maps4html/web-map-custom-element
```

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).

## Usage

Expand Down
Loading

0 comments on commit 080dc93

Please sign in to comment.