2.1.2 • Published 7 years ago

lc-package v2.1.2

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

primo-explore Lewis & Clark LCC view package

Setup

  1. Make sure you've installed and configured primo-explore-devenv or primo-explore-devenv-docker.
  2. Download this package with
git clone https://github.com/WatzekDigitalInitiatives/lc-package
  1. Set up the dev environment to point to this package folder.
  2. Navigate to the package folder and run npm install to pull in dependencies.
  3. Checkout the development branch with
git checkout develop

Developing

Git/GitHub

You can work in the develop branch. File a PR to master when you've finished working on and refactoring a customization.

Files

html

html added to the html/templates folder will automatically be compiled into js/customTemplates.js and added to angular's $templateCache.

if you've written templates that belong to a particular component or customization, consider refactoring your javascript into a module and adding the html in as a template literal, e.g.

angular
    .module('myModule', [])
    .component('myNewComponent', {
        template: `
        <div>
        here's the template that I wrote...
        I copy-pasted it from the file I put in html/templates while I was working
        but now it's ready for prime-time!
        </div>
        `,
        controller: function() {
            // etc.
        }
    })

this way, if the customization is published as a package, there is no dependency on external html or the usage of $templateCache.

js

You can add arbitrary .js files to the js directory to be compiled into custom.js. When code is ready to ship, it's a good idea to refactor it into an angular module and publish as an npm package, if applicable.

See the Alliance-PCJWG GitHub for examples of angular customization module packages.

After you refactor the code, remove the originals from the js directory (and any associated files, e.g. html templates) and then npm install --save-dev the package you've published.

This way, finished customization code is kept out of the js directory but still incorporated into custom.js, reducing visual clutter.

Using other packages

Adding packages published by others is as simple as npm install other-package --save-dev.

Fixing bugs

If you find a bug with a previously published customization package, file an issue on its repository. Fix the bug there, npm publish the fix, and then run npm update on this package.

2.1.2

7 years ago

2.1.1

7 years ago