npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@adaguc/react-webmapjs

v0.1.43

Published

React wrapper for webmapjs, which is an interactive maps library, capable of parsing a OGC WMS getcapabilities and display geographical layers

Downloads

69

Readme

react-webmapjs

Install environment

To run and develop react-webmapjs you need npm. The easiest way to install npm is via nvm. Please visit https://nvm.sh/ and follow the instructions. When nvm is installed, please do the following command:

nvm install 8

After that you need to install its dependencies, do inside the react-webmapjs folder:

npm install

To start the storybook do:

npm run storybook

Usage

To also use the styling, one should import the stylesheet from the dist folder:

import '@adaguc/react-webmapjs/dist/main.css';

Development

Inspecting the components with storybook

Storybook can be used to view the components. If you run npm run storybook a storybook server will start in which you can see all the components for which stories are written.

Writing a new story

Stories live in the stories folder. Here is the documentation on the syntax for adding new stories: https://storybook.js.org/docs/basics/writing-stories/

Deploying a static version of your storybook

The storybook can be compiled to a static version via npm run build-storybook. The static contents is then placed in the folder storybook-react-webmapjs.

Tests

Test can be run by the following command: npm test This will run all the tests specified in the stories without starting a browser. Currently only the mounting of components is tested, no interaction testing is implemented yet.

Testing the package in another project

To test the package in another project without publishing it, you can follow these steps:

  1. npm run build
  2. npm pack
  3. cd <path/to/your/project>
  4. npm install <absolute path/to/tar/created/by/npm pack>

Setting up CI/CD

Creating an authentication token

To be able to publish to npm CI/CD requires an authentication token.

To create a token, see: https://docs.npmjs.com/creating-and-viewing-authentication-tokens

As soon as you've created the token, go to GitLab and:

  1. Click on Settings --> CI/CD --> Variables
  2. Change or create the NPM_TOKEN variable to the created authentication token.

To create a new package:

  1. Adjust version number in package.json
  2. Adjust version numberin WMJSMap.js
  3. Publish:
npm run clean && npm install && npm run build && npm publish