Looking for the pre-Daylight brightspace-integration
? It's over here.
The goal of this project is to bring together many other external libraries and modules for inclusion into a particular build of Brightspace.
The first time you build, install dependencies:
npm install
Rebuild assets to the build
directory:
npm run build
Building BSI in Windows doesn't always go smoothly. Here are some of the issues that have been encountered, and their potential solutions:
Trouble | Shooting |
---|---|
build:icons fails: cannot copy from `...'images\**\*.*'` to `...'images\**\*.*'`: cannot read from `...'images\**\*.*'`: ENOENT: no such file or directory, open '...'images\**\*.*'' |
remove single quotes from package.json .scripts .build:icons |
To test against a local Brightspace environment, first start serving the compiled assets:
npm run serve
This will run a web server on port 8080
pointing at the build
directory. You'll need to manually rebuild if any of the assets change.
To point your Brightspace instance at the local integration project:
- Go to your
{instance}/config/Infrastructure
directory - Edit
D2L.LP.Web.UI.Html.Bsi.config.json
- Change the
daylight-polymer-<version>
property to thebrightspace-integration (BSI)
localhost server (or your computer's hostname) - note the trailing/
- Restart IIS
The config file will get overwritten during the build.
We use lock files to lock both our NPM and Bower dependencies. This ensures we only pick up changes to dependencies when we explicitly ask for them and are prepared to test them.
To install a new dependency or update an existing one:
- If you haven't already, install
bower-locker
globally usingnpm install -g bower-locker
- Unlock
bower.json
by runningbower-locker unlock
- Make changes to
bower.json
manually or viabower install <component>
- Update dependencies in
bower_components
viabower update
or by removing the directory and doing a freshbower install
- Lock
bower.json
again by runningbower-locker lock
- Inspect the diff to ensure the changes match your expectations
Read more in the bower-locker
documentation...
Any command that would normally add or update package.json
will also update package-lock.json
-- npm install
, npm update
etc. Just be cognizant of the changes you're making.
Read more in the package-lock
documentation...
This project serves as an integration point for our web components and we are using Polymer CLI's build
command to manage common dependencies between components and generate web component bundles.
To integrate a new web component into BSI, perform the following steps:
- Unlock
bower.json
by following the instructions above forbower-locker
- Reference your component as a bower dependency using the path to the repository plus a version tag (i.e.
bower install --save https://github.com/Brightspace/my-component.git#1.0.0
) - Add an HTML file (i.e.
d2l-my-component.html
) to theweb-components
directory that references the new bower component. (i.e.../bower_components/my-component/my-component.html
) - Reference the new html file from the fragments list in
polymer.json
The project assets (build
directory) will be automatically published to the Brightspace CDN by its Travis CI job after each successful build of a tagged commit.
The publish location will be: https://s.brightspace.com/lib/bsi/{version}/
Contributions are welcome, please submit a pull request!
This repository is configured with EditorConfig rules and contributions should make use of them.