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

inspire-next-search-js

v2.0.84

Published

Javascript search components for Inspirehep-Search

Downloads

23

Readme

Inspire-Search-Js

Build Status Coverage LICENSE

Inspire-search Angular JS module used in http://labs.inspirehep.net search results.

Installation

$ npm i

Release

This is a work around, CI doesn't work for the moment.

  1. Update package.json with the version number

  2. Run:

yarn version
git push origin master
git push origin --tags
  1. Release:
# login to npm with cern-sis-ts account
npm publish
  1. :tada:

Demo

$ cd example; npm install; cd ..
$ npm run-script demo

Navigate to http://localhost:8000 to see the demo.

Tests

$ npm test

Docs

$ # build
$ npm run-script docs
$ # read
$ open docs/index.html

How to use?

Check out the example/ to see how to configure your app.

How to develop?

For easy development of inspirehep-search-js on top of inspire-next follow these steps:

  1. Fork this repo and clone your personal fork.

    laptop> $ git clone [email protected]:/inspirehep-search-js.git laptop> $ cd inspirehep-search-js

  2. Set ASSETS_DEBUG=True in your configuration for easier debugging in the browser (files do not get minified).

    laptop> $ vim $DOCKER_DATA/tmp/virtualenv/var/inspirehep-instance/inspirehep.cfg

  3. Install Node.js and npm on your system. If you are using Ubuntu, create a symlink from node to nodejs (needed because of a naming conflict with the node package).

    laptop> $ sudo apt-get update laptop> $ sudo apt-get install nodejs laptop> $ sudo ln -s "$(which nodejs)" /usr/bin/node laptop> $ sudo apt-get install npm

  4. Install PhantomJS on your system and add PHANTOMJS_BIN:$(which phantomjs) env variable in .bashrc or .zshrc. to specify the path to the phantomjs binary.

    laptop> $ sudo apt-get update laptop> $ sudo apt-get install phantomjs

  5. Assuming you followed the current INSPIRE-HEP installation guide documentation, add the volume to services.yml to mount inspire-search-js on Docker.

    laptop> $ vim /inspire-next/services.yml

    static:
        image: busybox
        volumes:
        - "<your-local-path>/inspirehep-search-js:/inspirehep-search-js"
        ```
    
  6. Restart the containers and open a bash in the web container.

    laptop> $ docker-compose kill laptop> $ docker-compose rm laptop> $ docker-compose run web bash

  7. In the container bash, link the js volume to /static/node_modules. CAREFUL: if you run laptop> $ ./inspire-next/scripts/clean_assets, the link will have to be created again!

    container> $ rm -rf /virtualenv/var/inspirehep-instance/static/node_modules/inspirehep-search-js container> $ ln -s /inspirehep-search-js /virtualenv/var/inspirehep-instance/static/node_modules/inspirehep-search-js

  8. To install all dependencies and Gulp.js, in the inspirehep-search-js folder run:

    laptop> $ npm install laptop> $ nmp install gulp

  9. As you run inspire-next, start watching changes in the inspirehep-search-js folder. Every time a JS or HTML file is modified, tests will run and the dist/ folder will be recreated.

    laptop> $ cd inspirehep-search-js laptop> $ gulp watch

  10. Every time you modify a JavaScript or HTML template, hard refresh your browser to avoid caching and see your changes. If the changes are not reflected after refreshing, you might need to delete the gen folder from the container in order to prevent caching.

    container> $ rm -rf /virtualenv/var/inspirehep-instance/static/gen/ .webassets-cache/