Publishing packages to NPM
In package.json verify the name and update the version. Add additional files
if needed.
{
"name": "@maps4html/mapml",
"version": "X.X.X",
...
"files": [
"dist",
"*.md",
"Add more here if needed"
]
}Note that when releasing on npm, you are distributing leaflet, proj4 etc., so you need to distribute the text of their licenses with the dist folder.
Open the command prompt and cd into the MapML.js project directory.
Type in –
npm login– fill in your NPM credentials, then publish using:
npm publish --access=publicWhen it publishes successfully you should see:
+@maps4html/mapml@X.X.XGitHub release procedure
To create a new release on GitHub, visit the release page,
then click Draft a new release.
Enter the new release version in the Choose a tag dropdown, fill in the title and description
if needed, and then publish the release.
Publishing packages to GitHub
Create a personal access token on GitHub
and check write:packages and delete:packages.
Open the command prompt and cd into the MapML.js project directory. Enter:
npm login --scope=@Maps4HTML --registry=https://npm.pkg.github.comFor the credentials, enter:
Username: GitHub username
Password: Personal access token
Email: GitHub emailIn package.json, add:
"publishConfig": {
"registry":"https://npm.pkg.github.com"
},Publish to GitHub using:
npm publishWhen it publishes successfully you should see:
+@maps4html/mapml@X.X.XNow "publishConfig" can be removed from package.json.