Skip to content

Commit 8557dd2

Browse files
authored
Merge pull request #2550 from microsoftgraph/main
chore: v3.0.0 release
2 parents 7ab6f4f + f6472ee commit 8557dd2

File tree

587 files changed

+60756
-79492
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

587 files changed

+60756
-79492
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"image": "mcr.microsoft.com/devcontainers/javascript-node:0-14",
2+
"image": "mcr.microsoft.com/devcontainers/javascript-node:0-16",
33
"customizations": {
44
"vscode": {
55
"extensions": [
@@ -8,7 +8,7 @@
88
"runem.lit-plugin",
99
"esbenp.prettier-vscode",
1010
"rebornix.project-snippets",
11-
"ms-vscode.vscode-typescript-tslint-plugin",
11+
"dbaeumer.vscode-eslint",
1212
"mutantdino.resourcemonitor"
1313
]
1414
}

.eslintrc.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es6: true,
5+
node: true
6+
},
7+
extends: ['@microsoft/eslint-config-msgraph'],
8+
parser: '@typescript-eslint/parser',
9+
parserOptions: {
10+
project: [
11+
'packages/mgt/tsconfig.json',
12+
'packages/mgt-element/tsconfig.json',
13+
'packages/mgt-components/tsconfig.json',
14+
'packages/mgt-react/tsconfig.json',
15+
'packages/mgt-spfx/tsconfig.json',
16+
'packages/mgt-spfx-utils/tsconfig.json',
17+
'packages/providers/mgt-electron-provider/tsconfig.authenticator.json',
18+
'packages/providers/mgt-electron-provider/tsconfig.provider.json',
19+
'packages/providers/mgt-mock-provider/tsconfig.json',
20+
'packages/providers/mgt-msal2-provider/tsconfig.json',
21+
'packages/providers/mgt-proxy-provider/tsconfig.json',
22+
'packages/providers/mgt-sharepoint-provider/tsconfig.json',
23+
'packages/providers/mgt-teamsfx-provider/tsconfig.json'
24+
],
25+
sourceType: 'module'
26+
},
27+
plugins: ['eslint-plugin-jsdoc', 'eslint-plugin-prefer-arrow', 'eslint-plugin-react', '@typescript-eslint'],
28+
root: true,
29+
ignorePatterns: ['**/**-css.ts', '.eslintrc.js', '*.cjs'],
30+
rules: {
31+
'@typescript-eslint/prefer-optional-chain': 'warn',
32+
'newline-per-chained-call': 'off'
33+
}
34+
};

.github/policies/microsoft-graph-toolkit-branch-protection.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ configuration:
3434
# Are merge commits prohibited from being pushed to this branch. boolean
3535
requiresLinearHistory: false
3636
# Require branches to be up to date before merging. Requires requiredStatusChecks. boolean
37-
requiresStrictStatusChecks: true
37+
requiresStrictStatusChecks: false
3838
# Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush.
3939
restrictsPushes: false
4040
# Restrict who can dismiss pull request reviews. boolean
@@ -64,7 +64,7 @@ configuration:
6464
# Are merge commits prohibited from being pushed to this branch. boolean
6565
requiresLinearHistory: false
6666
# Require branches to be up to date before merging. Requires requiredStatusChecks. boolean
67-
requiresStrictStatusChecks: true
67+
requiresStrictStatusChecks: false
6868
# Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush.
6969
restrictsPushes: false
7070
# Restrict who can dismiss pull request reviews. boolean
@@ -94,7 +94,7 @@ configuration:
9494
# Are merge commits prohibited from being pushed to this branch. boolean
9595
requiresLinearHistory: false
9696
# Require branches to be up to date before merging. Requires requiredStatusChecks. boolean
97-
requiresStrictStatusChecks: true
97+
requiresStrictStatusChecks: false
9898
# Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush.
9999
restrictsPushes: false
100100
# Restrict who can dismiss pull request reviews. boolean
@@ -128,7 +128,7 @@ configuration:
128128
# Are merge commits prohibited from being pushed to this branch. boolean
129129
requiresLinearHistory: false
130130
# Require branches to be up to date before merging. Requires requiredStatusChecks. boolean
131-
requiresStrictStatusChecks: true
131+
requiresStrictStatusChecks: false
132132
# Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush.
133133
restrictsPushes: false
134134
# Restrict who can dismiss pull request reviews. boolean

.github/workflows/next.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
strategy:
1717
matrix:
18-
node-version: [14.x]
18+
node-version: [16.x]
1919

2020
steps:
2121
- uses: actions/checkout@v2

.github/workflows/pr-clean-storybook.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
strategy:
1717
matrix:
18-
node-version: [14.x]
18+
node-version: [16.x]
1919

2020
steps:
2121
- uses: actions/checkout@v2

.github/workflows/pr-reporting.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
name: PR Quality Reporting
2+
13
on:
24
workflow_run:
35
workflows: [Build pr]
46
types:
57
- completed
6-
branches: [main, release/**, next/**, feat/add-jest-tests]
8+
branches: [main, release/**, next/**]
79

810
jobs:
911
pr_report:

.github/workflows/pr-storybook.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
strategy:
1717
matrix:
18-
node-version: [14.x]
18+
node-version: [16.x]
1919

2020
steps:
2121
- uses: actions/checkout@v2

.github/workflows/pr.yml

Lines changed: 38 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
# Tests are executed and coverage reports are emitted as to the action summary
4+
# A dependent workflow which uses workflow_run as a trigger reads the archived outputs and emits comments to the PR triggering this build
35

46
name: Build pr
57

@@ -13,32 +15,53 @@ jobs:
1315

1416
strategy:
1517
matrix:
16-
node-version: [14.x]
18+
node-version: [16.x]
1719

1820
steps:
1921
- uses: actions/checkout@v2
2022
- name: Use Node.js ${{ matrix.node-version }}
2123
uses: actions/setup-node@v1
2224
with:
2325
node-version: ${{ matrix.node-version }}
24-
- run: npm install -g yarn
25-
- run: yarn
26+
- name: Cache Node Modules
27+
id: cache-node-modules
28+
uses: actions/cache@v2
29+
with:
30+
path: |
31+
node_modules
32+
*/*/node_modules
33+
key: ${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
34+
- run: npm install -g yarn lerna
35+
- name: Install node_modules
36+
if: steps.cache-node-modules.outputs.cache-hit != 'true'
37+
run: yarn
2638
- run: node scripts/setVersion.js --next
27-
- run: yarn run tsc -v
2839
- run: yarn build
29-
- run: yarn run pack
30-
31-
- name: Upload a Build Artifact - package
32-
uses: actions/upload-artifact@v2
40+
- run: yarn lint
41+
- run: yarn test
42+
- name: Archive test results
43+
uses: actions/upload-artifact@v2 # upload test results
44+
if: always() # run this step even if previous step failed
3345
with:
34-
name: npm-packages
35-
path: artifacts/*
46+
name: test-results
47+
path: testResults/junit.xml
48+
- name: Archive coverage report
49+
uses: actions/upload-artifact@v2 # upload coverage report
50+
if: always() # run this step even if previous step failed
51+
with:
52+
name: coverage
53+
path: coverage/cobertura-coverage.xml
3654

37-
- name: Upload a Build Artifact - bundle
38-
uses: actions/upload-artifact@v2
55+
- name: Code Coverage Summary Report
56+
uses: irongut/[email protected]
3957
with:
40-
name: bundle
41-
path: packages/mgt/dist/bundle
58+
filename: coverage/cobertura-coverage.xml
59+
badge: true
60+
format: 'markdown'
61+
output: 'both'
62+
63+
- name: Write to Job Summary
64+
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
4265

4366
# The check-build-matrix returns success if all matrix jobs in build are successful; otherwise, it returns a failure.
4467
# Use this as a PR status check for GitHub Policy Service instead of individual matrix entry checks.
@@ -47,7 +70,7 @@ jobs:
4770
needs: build
4871
if: always()
4972
steps:
50-
- name: All build matrix options are successful
73+
- name: All build matrix options are successful
5174
if: ${{ !(contains(needs.*.result, 'failure')) }}
5275
run: exit 0
5376
- name: One or more build matrix options failed
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: Create Preview release
5+
on:
6+
push:
7+
tags: ['v3.*-preview.*', 'v3.*-rc.*']
8+
9+
jobs:
10+
version:
11+
runs-on: ubuntu-latest
12+
13+
outputs:
14+
latest-version: ${{steps.latest-version.outputs.version}}
15+
package-version: ${{steps.package-version.outputs.current-version}}
16+
17+
strategy:
18+
matrix:
19+
node-version: [16.x]
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
24+
- name: Use Node.js ${{ matrix.node-version }}
25+
uses: actions/setup-node@v1
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
registry-url: 'https://registry.npmjs.org'
29+
30+
- name: Get latest version from npm
31+
id: latest-version
32+
run: echo ::set-output name=version::$(npm show @microsoft/mgt version)
33+
34+
- name: Get current package version
35+
id: package-version
36+
uses: martinbeentjes/npm-get-version-action@master
37+
38+
release:
39+
runs-on: ubuntu-latest
40+
needs: version
41+
if: needs.version.outputs.latest-version != needs.version.outputs.package-version
42+
strategy:
43+
matrix:
44+
node-version: [16.x]
45+
46+
environment:
47+
name: release
48+
49+
steps:
50+
- uses: actions/checkout@v2
51+
52+
- name: Use Node.js ${{ matrix.node-version }}
53+
uses: actions/setup-node@v1
54+
with:
55+
node-version: ${{ matrix.node-version }}
56+
registry-url: 'https://registry.npmjs.org'
57+
58+
- name: Install Dependencies
59+
run: |
60+
npm install -g yarn lerna
61+
yarn
62+
63+
- name: Update package version
64+
run: node scripts/setVersion.js
65+
66+
- name: Build 🛠
67+
run: yarn build
68+
69+
- name: Publish npm packages
70+
run: lerna exec --scope @microsoft/* -- "npm publish --tag preview --access=public"
71+
env:
72+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
73+
74+
- name: Attach mgt-spfx solution to GitHub release
75+
run: node scripts/uploadSpfxSolution.js ${{secrets.GITHUB_TOKEN}} ${{needs.version.outputs.package-version}}
76+
77+
- name: ReleaseNotes
78+
uses: anton-yurchenko/[email protected]
79+
env:
80+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
81+
DRAFT_RELEASE: 'true'
82+
PRE_RELEASE: 'true'
83+
CHANGELOG_FILE: 'CHANGELOG.md'
84+
ALLOW_EMPTY_CHANGELOG: 'true'

.github/workflows/push-release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
strategy:
1919
matrix:
20-
node-version: [14.x]
20+
node-version: [16.x]
2121

2222
steps:
2323
- uses: actions/checkout@v2
@@ -42,7 +42,7 @@ jobs:
4242
if: needs.version.outputs.latest-version != needs.version.outputs.package-version
4343
strategy:
4444
matrix:
45-
node-version: [14.x]
45+
node-version: [16.x]
4646

4747
environment:
4848
name: release
@@ -58,7 +58,7 @@ jobs:
5858

5959
- name: Install Dependencies
6060
run: |
61-
npm install -g yarn lerna@6.4.1
61+
npm install -g yarn lerna
6262
yarn
6363
6464
- name: Update package version
@@ -88,7 +88,7 @@ jobs:
8888

8989
strategy:
9090
matrix:
91-
node-version: [14.x]
91+
node-version: [16.x]
9292

9393
steps:
9494
- uses: actions/checkout@v2

0 commit comments

Comments
 (0)