Skip to content

Commit e121c60

Browse files
committed
Merge branch 'dev' into release/3.0.5
2 parents 6a4fbbb + 597acce commit e121c60

19 files changed

+3099
-2890
lines changed

.github/workflows/ci_validation.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,10 @@ jobs:
3232

3333
- name: Run unit tests
3434
run: npm test
35+
36+
- name: Verify ESM compatibility
37+
if: matrix.node-version == '16.x'
38+
working-directory: './test-esm'
39+
run: |
40+
npm ci
41+
npm test

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,5 @@ test/development/secrets.ts
3131
.idea/*
3232

3333
testResult.xml
34+
35+
test-esm/lib/*

.npmignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ src/
22
scripts/
33
design/
44
changelogs/
5-
testResult.xml
5+
testResult.xml
6+
test-esm/

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,11 @@ Please see the [contributing guidelines](CONTRIBUTING.md).
205205
- [Microsoft Graph Toolkit: UI Components and Authentication Providers for Microsoft Graph](https://docs.microsoft.com/graph/toolkit/overview)
206206
- [Office Dev Center](http://dev.office.com/)
207207

208+
## Tips and Tricks
209+
210+
- [Microsoft Graph SDK `n.call is not a function` by Lee Ford](https://www.lee-ford.co.uk/posts/graph-sdk-is-not-a-function/)
211+
- [Example of using the Graph JS library with ESM and `importmaps` ](https://github.com/waldekmastykarz/js-graph-101/blob/main/index_esm.html)
212+
208213
## Third Party Notices
209214

210215
See [Third Party Notices](./THIRD%20PARTY%20NOTICES) for information on the packages that are included in the [package.json](./package.json)

docs/AuthCodeMSALBrowserAuthenticationProvider.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,19 @@ Using npm:
3434
import { AuthCodeMSALBrowserAuthenticationProvider, AuthCodeMSALBrowserAuthenticationProviderOptions } from "@microsoft/microsoft-graph-client/authProviders/authCodeMsalBrowser";
3535
import { Client } from "@microsoft/microsoft-graph-client";
3636

37-
const options:AuthCodeMSALBrowserAuthenticationProviderOptions: {
37+
const options: AuthCodeMSALBrowserAuthenticationProviderOptions = {
3838
account: account, // the AccountInfo instance to acquire the token for.
39-
interactionType: InteractionType.PopUp , // msal-browser InteractionType
39+
interactionType: InteractionType.Popup, // msal-browser InteractionType
4040
scopes: ["user.read", "mail.send"] // example of the scopes to be passed
41-
}
41+
};
4242

4343
// Pass the PublicClientApplication instance from step 2 to create AuthCodeMSALBrowserAuthenticationProvider instance
44-
const authProvider: new AuthCodeMSALBrowserAuthenticationProvider(publicClientApplication, options),
44+
const authProvider = new AuthCodeMSALBrowserAuthenticationProvider(publicClientApplication, options);
4545

4646

4747
// Initialize the Graph client
4848
const graphClient = Client.initWithMiddleware({
49-
authprovider
49+
authProvider
5050
});
5151

5252
```

package-lock.json

Lines changed: 892 additions & 2079 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,10 @@
4848
"prepack": "npm install && npm run build && npm run test",
4949
"pre-build": "npm run setVersion",
5050
"setVersion": "gulp setVersion",
51-
"test": "npm run test:cjs && npm run test:esm",
51+
"test": "npm run test:cjs && npm run karma",
5252
"test:cjs": "npm run build:sub_cjs && mocha",
5353
"test:coverage": "TS_NODE_PROJECT='./tsconfig-cjs.json' nyc mocha --require isomorphic-fetch -r ts-node/register test/common/**/*.ts && mocha --require isomorphic-fetch -r ts-node/register test/common/**/*.ts",
54-
"test:development": "tsc --p test/tsconfig-test-development.json && mocha 'lib/test/development/**/*.js' --require isomorphic-fetch",
55-
"test:esm": "npm run build:sub_es && mocha --require esm"
54+
"test:development": "tsc --p test/tsconfig-test-development.json && mocha 'lib/test/development/**/*.js' --require isomorphic-fetch"
5655
},
5756
"mocha": {
5857
"reporter": [
@@ -63,13 +62,10 @@
6362
},
6463
"spec": [
6564
"lib/test/common/**/*.js",
66-
"lib/test/node/**/*.js",
67-
"lib/es/test/common/**/*.js",
68-
"lib/es/test/node/**/*.js"
65+
"lib/test/node/**/*.js"
6966
],
7067
"require": [
71-
"isomorphic-fetch",
72-
"esm"
68+
"isomorphic-fetch"
7369
]
7470
},
7571
"nyc": {
@@ -101,7 +97,7 @@
10197
"@rollup/plugin-node-resolve": "^15.0.0",
10298
"@rollup/plugin-terser": "^0.3.0",
10399
"@types/chai": "^4.2.14",
104-
"@types/mocha": "^9.0.0",
100+
"@types/mocha": "^10.0.1",
105101
"@types/node": "^18.0.0",
106102
"@types/sinon": "^10.0.8",
107103
"@typescript-eslint/eslint-plugin": "^5.12.1",
@@ -111,7 +107,6 @@
111107
"eslint-config-prettier": "^8.3.0",
112108
"eslint-plugin-prettier": "^4.0.0",
113109
"eslint-plugin-simple-import-sort": "^8.0.0",
114-
"esm": "^3.2.25",
115110
"form-data": "^4.0.0",
116111
"gulp": "^4.0.2",
117112
"husky": "^8.0.0",
@@ -123,7 +118,7 @@
123118
"karma-mocha": "^2.0.1",
124119
"karma-typescript": "^5.2.0",
125120
"lint-staged": "^13.0.0",
126-
"mocha": "^6.2.3",
121+
"mocha": "^10.2.0",
127122
"mocha-junit-reporter": "^2.1.1",
128123
"nyc": "^15.1.0",
129124
"prettier": "^2.5.1",

0 commit comments

Comments
 (0)