node package manager

musefind-core-frontend

MuseFind Core FrontEnd Library

Installing/ Updating

To install on front-end platforms:

npm install --save musefind-core-frontend

To add to this library:

  • Create a folder for the component in the src/ directory
  • Supply an index.js in that folder (see HamburgerMenu for example)
  • Export that component in src/index.js
  • Update the version number in musefind-core-frontend/package.json
  • npm run build
  • cd build/
  • npm publish

Note: always update the package.json in the root directory, not the one in build/, which will be copied from the main one at build time.

Then, in the application:

  • npm update musefind-core-frontend

Warning: please ensure that SASS files within this core library import the variables.scss from the Styles folder, if needed.

Using Components/Styles

The library supports two different methods of importing:

import {HamburgerMenu} from 'musefind-core-frontend'

import HamburgerMenu from 'musefind-core-frontend/HamburgerMenu'

To import inside a SASS file, use the following: @import 'node_modules/musefind-core-frontend/Styles/variables';

Distribute

To use the distribute script, all your front-end applications must be in the same folder as musefind-core-frontend, named like so:

  • brand
  • influencer-ui
  • admin

You run the distribute script for a specific platform (npm run distribute:influencer) or distribute to all three at once (npm run distribute).

Doing so will copy the transpiled code directly into the node_modules/musefind-core-frontend of the given platform. Note that it does not change the version in that platform's package.json. Be careful that when you push to production, what will be installed via npm install matches what you have locally.