lc-package
v2.1.2
Published
Lewis & Clark College LCC Primo view package
Downloads
3
Readme
primo-explore Lewis & Clark LCC view package
Setup
- Make sure you've installed and configured primo-explore-devenv or primo-explore-devenv-docker.
- Download this package with
git clone https://github.com/WatzekDigitalInitiatives/lc-package
- Set up the dev environment to point to this package folder.
- Navigate to the package folder and run
npm install
to pull in dependencies. - 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.