mlibrary / pride

JavaScript library for interfacing with the U-M Library search backend

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pride

Pride is a JavaScript library that handles all communication between the University of Michigan Library Search's front-end application and the backend.

Setup

npm install

Build

npm run build

All files that are included in the build are found under src/. The directory is organized by object property. Examples:

  • Pride.init is found in src/Pride/init.js
  • Pride.Util is found in src/Pride/Util/index.js
  • Pride.Util.escape is found in src/Pride/Util/escape.js

The pride.min.js build is used for applications that include pride. The pride.js build is used for testing.

Unit Tests

npm run test

The organization of the spec/ directory mirrors the src/ directory. Each test file ends in .spec.js.

Testing in Search

  1. Clone mlibrary/search.
    gh repo clone mlibrary/search
  2. Navigate to the repository and open the package.json file. Edit the dependency URL for pride to point to your local pride repository.
    "pride": "file:../pride",
    Note: If you want to test a specific branch, add # followed by the branch name to the end of the URL.
    "pride": "git+https://github.com/mlibrary/pride.git#your-branch-here",
  3. Install
    npm install
    Note: If this is not a fresh clone, do a clean install.
    rm -rf node_modules && package-lock.json && npm install
  4. Run locally
    npm start

While Search is running locally, the site will automatically refresh whenever pride.min.js changes.

About

JavaScript library for interfacing with the U-M Library search backend

License:Other


Languages

Language:JavaScript 100.0%