Skip to content

Commit abed6f3

Browse files
committed
Prepare to release 1.3.0-beta.0
1 parent 16b2949 commit abed6f3

File tree

5 files changed

+93
-83
lines changed

5 files changed

+93
-83
lines changed

README.md

+16-12
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,27 @@ This JavaScript library is part of the [Microsoft Teams developer platform](http
55
[![Build Status](https://travis-ci.org/OfficeDev/microsoft-teams-library-js.svg?branch=master)](https://travis-ci.org/OfficeDev/microsoft-teams-library-js)
66

77
## Getting Started
8-
1. Clone the repo
9-
2. Navigate to the repo root
10-
3. `yarn install`
11-
4. `gulp`
8+
9+
1. Clone the repo
10+
2. Navigate to the repo root
11+
3. `yarn install`
12+
4. `gulp`
1213

1314
### Installation
15+
1416
To install the stable version:
1517

1618
#### npm
1719

18-
`npm install --save @microsoft/teams-js`
20+
`npm install --save @microsoft/teams-js@1.3.0-beta.0`
1921

2022
#### yarn
2123

22-
`yarn add @microsoft/teams-js`
24+
`yarn add @microsoft/teams-js@1.3.0-beta.0`
2325

2426
#### Production
2527

26-
You can access [these files on unpkg](https://unpkg.com/@microsoft/teams-js@1.2.5/dist/MicrosoftTeams.min.js), download them, or point your package manager to them.
28+
You can access [these files on unpkg](https://unpkg.com/@microsoft/teams-js@1.3.0-beta.0/dist/MicrosoftTeams.min.js), download them, or point your package manager to them.
2729

2830
## Usage
2931

@@ -34,26 +36,28 @@ Install either using npm or yarn
3436
**If you are using any dependency loader** such as [RequireJS](http://requirejs.org/) or [SystemJS](https://github.com/systemjs/systemjs) or module bundler such as [browserify](http://browserify.org/), [webpack](https://webpack.github.io/), you can use `import` syntax to import specific modules. For e.g.
3537

3638
```typescript
37-
import * as microsoftTeams from '@microsoft/teams-js';
39+
import * as microsoftTeams from "@microsoft/teams-js";
3840
```
3941

4042
### As a Script Tag
4143

4244
Reference the library inside of your `.html` page using:
45+
4346
```html
4447
<!-- Microsoft Teams JavaScript API (via CDN) -->
45-
<script src="https://unpkg.com/@microsoft/teams-js@1.2.5/dist/MicrosoftTeams.min.js" integrity="sha384-fTjWNTelhUDsOG+6Xvsly5BVO8estmdrfVmaRQuTGRTtcjHYA3oQANo805/kHXvJ" crossorigin="anonymous"></script>
48+
<script src="https://unpkg.com/@microsoft/teams-js@1.3.0-beta.0/dist/MicrosoftTeams.min.js" integrity="6vGuKaCqkCSgnE7MpuIxytX4skvgzP5CmFt48ZCjdy3Sd2kb4DPW1YNoCiupc3iw" crossorigin="anonymous"></script>
4649

4750
<!-- Microsoft Teams JavaScript API (via npm) -->
48-
<script src="node_modules/@microsoft/teams-js@1.2.5/dist/MicrosoftTeams.min.js"></script>
51+
<script src="node_modules/@microsoft/teams-js@1.3.0-beta.0/dist/MicrosoftTeams.min.js"></script>
4952

5053
<!-- Microsoft Teams JavaScript API (via local) -->
5154
<script src="MicrosoftTeams.min.js"></script>
5255
```
5356

5457
## Contributing
58+
5559
We strongly welcome and encourage contributions to this project. Please read the [contributor's guide](CONTRIBUTING.md).
5660

57-
- - -
61+
---
5862

59-
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
63+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.

gulpfile.js

+59-53
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ var del = require("del");
44
var fs = require("fs");
55
var gulp = require("gulp");
66
var gutil = require("gulp-util");
7-
var umd = require('gulp-umd');
7+
var umd = require("gulp-umd");
88
var karma = require("karma").Server;
99
var merge = require("merge2");
1010
var tslint = require("gulp-tslint");
11-
var header = require('gulp-header');
11+
var header = require("gulp-header");
1212
var typescript = require("gulp-typescript");
1313
var rename = require("gulp-rename");
1414
var uglify = require("gulp-uglify");
@@ -20,7 +20,7 @@ var AuthenticationContext = require("adal-node").AuthenticationContext;
2020

2121
var buildDir = "./build/";
2222
var distDir = "./dist/";
23-
var libName = 'microsoftTeams';
23+
var libName = "microsoftTeams";
2424
var dtsHeaderTemplate = `
2525
declare module '@microsoft/teams-js' {
2626
export = microsoftTeams;
@@ -32,16 +32,21 @@ var options = {
3232
connectionString: ""
3333
};
3434

35-
gulp.task("tslint", function () {
36-
return gulp.src(["./src/**/*.ts", "./test/**/*.ts"])
37-
.pipe(tslint({
38-
configuration: "tslint.json",
39-
tslint: require("tslint"),
40-
formatter: "verbose"
41-
}))
42-
.pipe(tslint.report({
43-
summarizeFailureOutput: true
44-
}));
35+
gulp.task("tslint", function() {
36+
return gulp
37+
.src(["./src/**/*.ts", "./test/**/*.ts"])
38+
.pipe(
39+
tslint({
40+
configuration: "tslint.json",
41+
tslint: require("tslint"),
42+
formatter: "verbose"
43+
})
44+
)
45+
.pipe(
46+
tslint.report({
47+
summarizeFailureOutput: true
48+
})
49+
);
4550
});
4651

4752
gulp.task("prettier", () =>
@@ -57,63 +62,62 @@ var tsProject = typescript.createProject("./tsconfig.json", {
5762
typescript: require("typescript")
5863
});
5964

60-
gulp.task("ts", ["tslint"], function () {
61-
var tsResult = tsProject.src()
62-
.pipe(tsProject());
65+
gulp.task("ts", ["tslint"], function() {
66+
var tsResult = tsProject.src().pipe(tsProject());
6367

6468
return merge([
65-
tsResult.dts
66-
.pipe(header(dtsHeaderTemplate))
67-
.pipe(gulp.dest(buildDir)),
69+
tsResult.dts.pipe(header(dtsHeaderTemplate)).pipe(gulp.dest(buildDir)),
6870
tsResult.js
69-
.pipe(umd({
70-
exports: function (file) {
71-
return libName;
72-
},
73-
namespace: function (file) {
74-
return libName;
75-
},
76-
}))
71+
.pipe(
72+
umd({
73+
exports: function(file) {
74+
return libName;
75+
},
76+
namespace: function(file) {
77+
return libName;
78+
}
79+
})
80+
)
7781
.pipe(gulp.dest(buildDir))
7882
.pipe(uglify())
7983
.pipe(rename({ suffix: ".min" }))
80-
.pipe(gulp.dest(buildDir)),
84+
.pipe(gulp.dest(buildDir))
8185
]);
8286
});
8387

84-
gulp.task("test", ["ts"], function (done) {
88+
gulp.task("test", ["ts"], function(done) {
8589
new karma({ configFile: __dirname + "/karma.conf.js" }, done).start();
8690
});
8791

88-
gulp.task("doc", function (done) {
92+
gulp.task("doc", function(done) {
8993
var parse = require("json-schema-to-markdown");
9094
var schema = require("./src/MicrosoftTeams.schema.json");
9195
var markdown = parse(schema);
92-
fs.mkdir(buildDir, function () {
93-
fs.mkdir(buildDir + "/doc", function () {
96+
fs.mkdir(buildDir, function() {
97+
fs.mkdir(buildDir + "/doc", function() {
9498
fs.writeFile(buildDir + "/doc/MicrosoftTeams.schema.md", markdown, done);
9599
});
96100
});
97101
});
98102

99-
gulp.task("dist", ["ts", "doc"], function () {
103+
gulp.task("dist", ["ts", "doc"], function() {
100104
var distFiles = [
101105
buildDir + "/src/**/*.js",
102106
buildDir + "/src/**/*.d.ts",
103-
"./src/**/*.schema.json",
107+
"./src/**/*.schema.json"
104108
];
105109

106110
return gulp.src(distFiles).pipe(gulp.dest(distDir));
107111
});
108112

109113
gulp.task("default", ["prettier", "ts", "test", "doc", "dist"]);
110114

111-
gulp.task("clean", function () {
115+
gulp.task("clean", function() {
112116
return del([buildDir, distDir]);
113117
});
114118

115119
/// tasks for uploading dist assets to CDN
116-
gulp.task("get-connectionstring-from-secret", function (done) {
120+
gulp.task("get-connectionstring-from-secret", function(done) {
117121
var clientId = argv.clientId;
118122
var clientSecret = argv.clientSecret;
119123
var vaultUri = argv.vaultUri;
@@ -128,13 +132,13 @@ gulp.task("get-connectionstring-from-secret", function (done) {
128132
}
129133

130134
// Authenticator - retrieves the access token
131-
var authenticator = function (challenge, callback) {
135+
var authenticator = function(challenge, callback) {
132136
var context = new AuthenticationContext(challenge.authorization);
133137
return context.acquireTokenWithClientCredentials(
134138
challenge.resource,
135139
clientId,
136140
clientSecret,
137-
function (err, tokenResponse) {
141+
function(err, tokenResponse) {
138142
if (err) throw err;
139143
var authorizationValue =
140144
tokenResponse.tokenType + " " + tokenResponse.accessToken;
@@ -146,7 +150,7 @@ gulp.task("get-connectionstring-from-secret", function (done) {
146150
var credentials = new KeyVault.KeyVaultCredentials(authenticator);
147151
var keyVaultClient = new KeyVault.KeyVaultClient(credentials);
148152

149-
keyVaultClient.getSecret(secretIdentifier, function (err, secretBundle) {
153+
keyVaultClient.getSecret(secretIdentifier, function(err, secretBundle) {
150154
if (err) throw err;
151155
options.connectionString = secretBundle.value;
152156
done();
@@ -156,7 +160,7 @@ gulp.task("get-connectionstring-from-secret", function (done) {
156160
gulp.task(
157161
"upload",
158162
["get-connectionstring-from-secret", "dist", "test"],
159-
function () {
163+
function() {
160164
var buildVer = argv.version || "";
161165
if (!buildVer) {
162166
console.error("missing build version argument (--version)!");
@@ -178,19 +182,21 @@ gulp.task(
178182
}
179183
];
180184

181-
var uploadTasks = assetBundles.map(function (assetBundle) {
182-
return gulp.src(assetBundle.glob).pipe(deployCdn({
183-
containerName: "sdk", // container name in blob
184-
serviceOptions: [options.connectionString], // custom arguments to azure.createBlobService
185-
folder: assetBundle.dest, // path within container
186-
zip: true, // gzip files if they become smaller after zipping, content-encoding header will change if file is zipped
187-
deleteExistingBlobs: false, // true means recursively deleting anything under folder
188-
concurrentUploadThreads: 4, // number of concurrent uploads, choose best for your network condition
189-
metadata: {
190-
cacheControl: "public, max-age=31536000", // cache in browser for 1 year
191-
},
192-
testRun: argv.whatIf || false // test run - means no blobs will be actually deleted or uploaded, see log messages for details
193-
}));
185+
var uploadTasks = assetBundles.map(function(assetBundle) {
186+
return gulp.src(assetBundle.glob).pipe(
187+
deployCdn({
188+
containerName: "sdk", // container name in blob
189+
serviceOptions: [options.connectionString], // custom arguments to azure.createBlobService
190+
folder: assetBundle.dest, // path within container
191+
zip: true, // gzip files if they become smaller after zipping, content-encoding header will change if file is zipped
192+
deleteExistingBlobs: false, // true means recursively deleting anything under folder
193+
concurrentUploadThreads: 4, // number of concurrent uploads, choose best for your network condition
194+
metadata: {
195+
cacheControl: "public, max-age=31536000" // cache in browser for 1 year
196+
},
197+
testRun: argv.whatIf || false // test run - means no blobs will be actually deleted or uploaded, see log messages for details
198+
})
199+
);
194200
});
195201

196202
return merge(...uploadTasks).on("error", gutil.log);

package.json

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@microsoft/teams-js",
33
"author": "Microsoft Teams",
4-
"version": "1.2.6",
4+
"version": "1.3.0-beta.0",
55
"description": "Microsoft Client SDK for building app for Microsoft teams",
66
"main": "./dist/MicrosoftTeams.min.js",
77
"typings": "./dist/MicrosoftTeams.d.ts",
@@ -41,9 +41,5 @@
4141
"typescript": "2.5.0",
4242
"yargs": "^8.0.1"
4343
},
44-
"files": [
45-
"dist/**",
46-
"README.md",
47-
"LICENSE"
48-
]
49-
}
44+
"files": ["dist/**", "README.md", "LICENSE"]
45+
}

src/MicrosoftTeams.ts

+14-10
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ interface MessageEvent {
1010
namespace microsoftTeams {
1111
"use strict";
1212

13-
const version = "1.2";
13+
const version = "1.3.0-beta.0";
1414

1515
const validOrigins = [
1616
"https://teams.microsoft.com",
@@ -850,13 +850,13 @@ namespace microsoftTeams {
850850
link.href,
851851
"_blank",
852852
"toolbar=no, location=yes, status=no, menubar=no, scrollbars=yes, top=" +
853-
top +
854-
", left=" +
855-
left +
856-
", width=" +
857-
width +
858-
", height=" +
859-
height
853+
top +
854+
", left=" +
855+
left +
856+
", width=" +
857+
width +
858+
", height=" +
859+
height
860860
);
861861
if (childWindow) {
862862
// Start monitoring the authentication window so that we can detect if it gets closed before the flow completes
@@ -1488,13 +1488,17 @@ namespace microsoftTeams {
14881488
function getTargetMessageQueue(targetWindow: Window): MessageRequest[] {
14891489
return targetWindow === parentWindow
14901490
? parentMessageQueue
1491-
: targetWindow === childWindow ? childMessageQueue : [];
1491+
: targetWindow === childWindow
1492+
? childMessageQueue
1493+
: [];
14921494
}
14931495

14941496
function getTargetOrigin(targetWindow: Window): string {
14951497
return targetWindow === parentWindow
14961498
? parentOrigin
1497-
: targetWindow === childWindow ? childOrigin : null;
1499+
: targetWindow === childWindow
1500+
? childOrigin
1501+
: null;
14981502
}
14991503

15001504
function flushMessageQueue(targetWindow: Window): void {

test/MicrosoftTeams.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ describe("MicrosoftTeams", () => {
129129
expect(initMessage.id).toBe(0);
130130
expect(initMessage.func).toBe("initialize");
131131
expect(initMessage.args.length).toEqual(1);
132-
expect(initMessage.args[0]).toEqual("1.2");
132+
expect(initMessage.args[0]).toEqual("1.3.0-beta.0");
133133
});
134134

135135
it("should allow multiple initialize calls", () => {

0 commit comments

Comments
 (0)