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

@ongov/ontario-search

v0.0.7

Published

React components containing search bar and autosuggest to be used for search on ontario government websites

Downloads

228

Readme

Ontario.ca Search Components Package

This package contains the ontario.ca search bar and the associated autosuggest dropdown for it.

Development

To make development of the NPM package simpler, we have added a hot reload local server workflow to the project. It's very simple.

  1. Install all the required NPM packages by issuing npm install from this folder
  2. Run npm run start to build the development bundle and serve it with hot reload

Note that in order to make this work as expected, we have created separate Webpack files to handle the two scenarios.

Packaging & Deployment

To do a push to NPM, all changes must be pushed to the main branch and a new tag needs to be created and pushed to remote:

  • Navigate to the root folder of the project and ensure you are on the main branch
  • Issue the following command: npm run npm-publish [<newversion> | major | minor | patch] <tagmessage> where <newversion> is replaced with one of major, minor or patch. This will automatically increment the version number in package.json and create a git tag for the version. Note that the versions are prefixed with a npm-v so they look like npm-v1.3.14
  • This will automatically push the tag and prepare the package for publishing to NPM
  • Because the CI is set to manual deploy, you will need to click the publish button to have it published to NPM

Package Use In Projects

To use the NPM package in your own project, you need to do the following:

  1. Import the package into your project
  2. Add server configuration as a script tag on the page like this:
  <script>
      // This is the configuration for the ElasticSearch AppSearch Connector
      window.apiConfig = {
          searchKey: "search-3d52b350d6564c8702597cee",
          engineName: "enterprise-search",
          endpointBase: "https://3d52b350d6564c8702597cee.ent.us-east-1.aws.found.io"
      }
      // This is the endpoint configuration for the search results page for EN and FR
      window.endpointConfig = {
          en: "/search/search-results/",
          fr: "/fr/recherche/resultats-de-recherche/"
      }
  </script>
  1. Import the JS from the NPM package into the page via a script tag
  2. Create an anchor element on the page. Anchor element should have id of ontario-search-autosuggest