Skip to content

Commit

Permalink
Merge 92b70f8 into fd59763
Browse files Browse the repository at this point in the history
  • Loading branch information
wongvincent committed Jan 3, 2019
2 parents fd59763 + 92b70f8 commit 5d11b6f
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 50 deletions.
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,23 @@ These include: `Version`, `EventId`, `Timestamp`, `TenantId`, `EventBody.Timesta

### Setup

Install from Bower:
Either use `d2l-telemetry-browser-client` from the CDN or import it as an es6 module (assuming your application will transpile it for browsers that don't support es6 classes)

```shell
bower install Brightspace/d2l-telemetry-browser-client
```

Then import `d2l-telemetry-browser-client.html`:
Reference the script in your html:

```html
<link rel="import" href="../d2l-telemetry-browser-client/d2l-telemetry-browser-client.html">
<script type="module" src="../d2l-telemetry-browser-client/d2l-telemetry-browser-client.js"></script>
```

The HTML import will reference the library from the CDN, but using bower and html imports will allow you to de-dupe different versions.
This will add a `d2lTelemetryBrowserClient` object to the global scope.

Alternatively, you can reference the global d2lTelemetryBrowserClient instance via es6 import

```javascript
import { d2lTelemetryBrowserClient } from '../d2l-telemetry-browser-client/src/index.js';
```

Alternatively you can reference it directly from the CDN
We can also reference it directly from the CDN

```html
<script src="https://s.brightspace.com/lib/d2l-telemetry-browser-client/0.1.0/d2l-telemetry-browser-client.js"></script>
Expand Down Expand Up @@ -100,7 +102,7 @@ The Travis CI build on master branch will bump the version of the library, publi

Refer to `./update.sh` and `./travis.yml` for details on how this publish process works.

You can control the level of verison bump by including either `[increment major]` or `[increment patch]` in your commit message. By default it will increment minor.
You can control the level of version bump by including either `[increment major]` or `[increment patch]` in your commit message. By default it will increment minor.


[ci-url]: https://travis-ci.org/Brightspace/d2l-telemetry-browser-client
Expand Down
26 changes: 0 additions & 26 deletions bower.json

This file was deleted.

3 changes: 0 additions & 3 deletions d2l-telemetry-browser-client.html

This file was deleted.

12 changes: 12 additions & 0 deletions d2l-telemetry-browser-client.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import {Client} from './src/client';
import {TelemetryEvent} from './src/event';
import {EventBody} from './src/eventBody';
import {PerformanceEventBody} from './src/performanceEventBody';
import {ProblemEventBody} from './src/problemEventBody';

window.d2lTelemetryBrowserClient = {};
window.d2lTelemetryBrowserClient.Client = Client;
window.d2lTelemetryBrowserClient.TelemetryEvent = TelemetryEvent;
window.d2lTelemetryBrowserClient.EventBody = EventBody;
window.d2lTelemetryBrowserClient.PerformanceEventBody = PerformanceEventBody;
window.d2lTelemetryBrowserClient.ProblemEventBody = ProblemEventBody;
11 changes: 0 additions & 11 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,9 @@ git config --global user.email "travis@travis-ci.com"
git config --global user.name "Travis CI"

echo "Updating from ${lastVersion} to v${newVersion}"
echo "<!-- CHANGES TO THIS FILE WILL BE LOST - IT IS AUTOMATICALLY GENERATED WHEN d2l-telemetry-browser-client IS RELEASED -->" > d2l-telemetry-browser-client.html
echo "<script src=\"https://s.brightspace.com/lib/d2l-telemetry-browser-client/"$newVersion"/d2l-telemetry-browser-client.js\"></script>" >> d2l-telemetry-browser-client.html
echo "<link rel=\"import\" href=\"../d2l-fetch/d2l-fetch.html\">" >> d2l-telemetry-browser-client.html

# Add the updated d2l-telemetry-browser-client.html, and add a new tag to create the release
git add .
git commit -m "[skip ci] Update to v${newVersion}"

echo "About to tag new version"
git tag -a v${newVersion} -m "v${newVersion} - ${lastLogMessageShort}"

echo "git status"
git status

echo "push new tag"
git push upstream HEAD:master --tags

Expand Down

0 comments on commit 5d11b6f

Please sign in to comment.