From 5636d10c749ceff5ba53930805ec60b844784125 Mon Sep 17 00:00:00 2001 From: Nikitha Chettiar Date: Fri, 21 Oct 2022 14:27:41 -0700 Subject: [PATCH 1/8] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 000000000..0cce56699 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,35 @@ +# Node.js +# Build a general Node.js project with npm. +# Add steps that analyze code, save build artifacts, deploy, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript + +trigger: +- main + +pool: + vmImage: ubuntu-latest + +steps: +- task: NodeTool@0 + inputs: + versionSpec: '16.x' + displayName: 'Install Node.js' + +- script: | + npm install + npm run build + npm run test + npm run karma + displayName: 'npm install and build' + +- task: CopyFiles@2 + inputs: + sourceFolder: '$(Build.SourcesDirectory)' + targetFolder: $(Build.ArtifactStagingDirectory) + displayName: 'Copy npm package' + +- task: PublishBuildArtifacts@1 + inputs: + pathtoPublish: $(Build.ArtifactStagingDirectory) + artifactName: "release-drop" + displayName: 'Publish artifacts' \ No newline at end of file From cfca916451b3ad395c409379d3544365d12c5436 Mon Sep 17 00:00:00 2001 From: Nikitha Chettiar Date: Thu, 27 Oct 2022 14:33:35 -0700 Subject: [PATCH 2/8] remove trigger --- azure-pipelines.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0cce56699..1d3017d48 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -3,8 +3,6 @@ # Add steps that analyze code, save build artifacts, deploy, and more: # https://docs.microsoft.com/azure/devops/pipelines/languages/javascript -trigger: -- main pool: vmImage: ubuntu-latest From 34c40cc0e3c823003464c1b56c0cb527f2eaf61a Mon Sep 17 00:00:00 2001 From: Nikitha Chettiar Date: Tue, 1 Nov 2022 13:12:12 -0700 Subject: [PATCH 3/8] adding common security template --- .azure-pipelines/ci-build-production.yml | 65 +++++++++++++++++++ .../common-templates/security-post-checks.yml | 53 +++++++++++++++ .../common-templates/security-pre-checks.yml | 21 ++++++ azure-pipelines.yml | 33 ---------- 4 files changed, 139 insertions(+), 33 deletions(-) create mode 100644 .azure-pipelines/ci-build-production.yml create mode 100644 .azure-pipelines/common-templates/security-post-checks.yml create mode 100644 .azure-pipelines/common-templates/security-pre-checks.yml delete mode 100644 azure-pipelines.yml diff --git a/.azure-pipelines/ci-build-production.yml b/.azure-pipelines/ci-build-production.yml new file mode 100644 index 000000000..f3c23a527 --- /dev/null +++ b/.azure-pipelines/ci-build-production.yml @@ -0,0 +1,65 @@ +# Node.js +# Build a general Node.js project with npm. +# Add steps that analyze code, save build artifacts, deploy, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript + +name: $(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r) + +trigger: + branches: + include: + - main + +pr: none + +pool: + vmImage: ubuntu-latest + +stages: +- stage: "Test" + jobs: + - job: + pool: + vmImage: ubuntu-latest + steps: + - task: NodeTool@0 + inputs: + versionSpec: '16.x' + displayName: 'Install Node.js' + + - script: | + npm install + npm run build + npm run test + npm run karma + displayName: 'Test the branch' + +- stage: "Build" + jobs: + - job: + pool: + vmImage: ubuntu-latest + steps: + - template: ./common-templates/security-pre-checks.yml + - task: NodeTool@0 + inputs: + versionSpec: '16.x' + displayName: 'Install Node.js' + + - script: | + npm install + npm run build + displayName: 'Build for production artifact' + - task: CopyFiles@2 + inputs: + sourceFolder: '$(Build.SourcesDirectory)' + targetFolder: $(Build.ArtifactStagingDirectory) + displayName: 'Copy npm package' + + - task: PublishBuildArtifacts@1 + inputs: + pathtoPublish: $(Build.ArtifactStagingDirectory) + artifactName: "release-drop" + displayName: 'Publish artifacts' + + - template: ./common-templates/security-post-checks.yml \ No newline at end of file diff --git a/.azure-pipelines/common-templates/security-post-checks.yml b/.azure-pipelines/common-templates/security-post-checks.yml new file mode 100644 index 000000000..a4c24a4b5 --- /dev/null +++ b/.azure-pipelines/common-templates/security-post-checks.yml @@ -0,0 +1,53 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +steps: + - task: CodesignValidation@0 + + - task: SdtReport@1 + displayName: "Security Analysis Report" + continueOnError: true + condition: succeededOrFailed() + inputs: + AllTools: false + APIScan: false + BinSkim: false + BinSkimBreakOn: "WarningAbove" + CodesignValidation: true + CodesignValidationBreakOn: "WarningAbove" + CredScan: true + FortifySCA: false + FxCop: false + ModernCop: false + MSRD: false + PoliCheck: true + PoliCheckBreakOn: "Severity1" + RoslynAnalyzers: true + RoslynAnalyzersBreakOn: "WarningAbove" + SDLNativeRules: false + Semmle: false + TSLint: false + TSLintBreakOn: "WarningAbove" + ToolLogsNotFoundAction: "Standard" + + - task: PublishSecurityAnalysisLogs@3 + displayName: "Publish Security Analysis Logs" + inputs: + ArtifactName: "CodeAnalysisLogs" + ArtifactType: "Container" + AllTools: false + AntiMalware: false + APIScan: false + BinSkim: false + CodesignValidation: true + CredScan: true + FortifySCA: false + FxCop: false + ModernCop: true + MSRD: false + PoliCheck: true + RoslynAnalyzers: true + SDLNativeRules: false + Semmle: false + TSLint: false + WebScout: false + ToolLogsNotFoundAction: "Standard" \ No newline at end of file diff --git a/.azure-pipelines/common-templates/security-pre-checks.yml b/.azure-pipelines/common-templates/security-pre-checks.yml new file mode 100644 index 000000000..498e37103 --- /dev/null +++ b/.azure-pipelines/common-templates/security-pre-checks.yml @@ -0,0 +1,21 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +steps: + - task: CredScan@2 + displayName: "Run CredScan" + inputs: + debugMode: false + batchSize: 20 + toolMajorVersion: "V2" + searchersFileType: "Skype" + + - task: PoliCheck@1 + displayName: "Run PoliCheck" + condition: and(succeeded(), eq(eq(variables['Build.SourceBranch'], 'refs/heads/main'), false)) + inputs: + targetType: F + SOMEnabled: true + optionsFC: 0 + optionsXS: 0 + optionsHMENABLE: 0 + continueOnError: true \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 1d3017d48..000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,33 +0,0 @@ -# Node.js -# Build a general Node.js project with npm. -# Add steps that analyze code, save build artifacts, deploy, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript - - -pool: - vmImage: ubuntu-latest - -steps: -- task: NodeTool@0 - inputs: - versionSpec: '16.x' - displayName: 'Install Node.js' - -- script: | - npm install - npm run build - npm run test - npm run karma - displayName: 'npm install and build' - -- task: CopyFiles@2 - inputs: - sourceFolder: '$(Build.SourcesDirectory)' - targetFolder: $(Build.ArtifactStagingDirectory) - displayName: 'Copy npm package' - -- task: PublishBuildArtifacts@1 - inputs: - pathtoPublish: $(Build.ArtifactStagingDirectory) - artifactName: "release-drop" - displayName: 'Publish artifacts' \ No newline at end of file From 8d2fd33a4aeeab58e2ca0cdee3e89da55da80862 Mon Sep 17 00:00:00 2001 From: Nikitha Chettiar Date: Tue, 1 Nov 2022 15:41:12 -0700 Subject: [PATCH 4/8] using windows image when testing --- .azure-pipelines/ci-build-production.yml | 26 ++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/.azure-pipelines/ci-build-production.yml b/.azure-pipelines/ci-build-production.yml index f3c23a527..66010ed55 100644 --- a/.azure-pipelines/ci-build-production.yml +++ b/.azure-pipelines/ci-build-production.yml @@ -12,42 +12,52 @@ trigger: pr: none -pool: - vmImage: ubuntu-latest stages: - stage: "Test" jobs: - job: pool: - vmImage: ubuntu-latest + vmImage: windows-latest + strategy: + matrix: + Node 12: + NODE_VERSION: '12.x' + Node 14: + NODE_VERSION: '14.x' + Node 16: + NODE_VERSION: '16.x' + maxParallel: 2 steps: + - template: ./common-templates/security-pre-checks.yml - task: NodeTool@0 inputs: - versionSpec: '16.x' + versionSpec: NODE_VERSION displayName: 'Install Node.js' - script: | - npm install + npm ci npm run build npm run test npm run karma displayName: 'Test the branch' + - template: ./common-templates/security-post-checks.yml + - stage: "Build" jobs: - job: + pool: vmImage: ubuntu-latest steps: - - template: ./common-templates/security-pre-checks.yml - task: NodeTool@0 inputs: versionSpec: '16.x' displayName: 'Install Node.js' - script: | - npm install + npm ci npm run build displayName: 'Build for production artifact' - task: CopyFiles@2 @@ -62,4 +72,4 @@ stages: artifactName: "release-drop" displayName: 'Publish artifacts' - - template: ./common-templates/security-post-checks.yml \ No newline at end of file + \ No newline at end of file From 46150edd53f8757bbff51059f8fbc1e7cab61407 Mon Sep 17 00:00:00 2001 From: Nikitha Chettiar Date: Tue, 1 Nov 2022 16:52:21 -0700 Subject: [PATCH 5/8] junit runner; publish result --- .azure-pipelines/ci-build-production.yml | 9 +- .gitignore | 4 +- .npmignore | 3 +- package-lock.json | 150 ++++++++++++ package.json | 279 ++++++++++++----------- 5 files changed, 307 insertions(+), 138 deletions(-) diff --git a/.azure-pipelines/ci-build-production.yml b/.azure-pipelines/ci-build-production.yml index 66010ed55..33c8891d2 100644 --- a/.azure-pipelines/ci-build-production.yml +++ b/.azure-pipelines/ci-build-production.yml @@ -32,7 +32,7 @@ stages: - template: ./common-templates/security-pre-checks.yml - task: NodeTool@0 inputs: - versionSpec: NODE_VERSION + versionSpec: $(NODE_VERSION) displayName: 'Install Node.js' - script: | @@ -42,6 +42,13 @@ stages: npm run karma displayName: 'Test the branch' + - task: PublishTestResults@2 + displayName: 'Publish Unit Test Results' + inputs: + testResultsFormat: 'JUnit' + testResultsFiles: '**/testResult.xml' + failTaskOnFailedTests: true + - template: ./common-templates/security-post-checks.yml - stage: "Build" diff --git a/.gitignore b/.gitignore index 32c847494..8fc8abe88 100644 --- a/.gitignore +++ b/.gitignore @@ -28,4 +28,6 @@ test/development/secrets.ts .nyc_output/* -.idea/* \ No newline at end of file +.idea/* + +testResult.xml \ No newline at end of file diff --git a/.npmignore b/.npmignore index 94b325d4f..2e238a3ae 100644 --- a/.npmignore +++ b/.npmignore @@ -1,4 +1,5 @@ src/ scripts/ design/ -changelogs/ \ No newline at end of file +changelogs/ +testResult.xml \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index faa8feaea..5359a6777 100644 --- a/package-lock.json +++ b/package-lock.json @@ -47,6 +47,7 @@ "karma-typescript": "^5.2.0", "lint-staged": "^13.0.0", "mocha": "^6.2.3", + "mocha-junit-reporter": "^2.1.1", "nyc": "^15.1.0", "prettier": "^2.5.1", "rollup": "^2.36.2", @@ -3877,6 +3878,15 @@ "node": ">=4" } }, + "node_modules/charenc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", + "integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/check-error": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", @@ -4452,6 +4462,15 @@ "node": ">= 8" } }, + "node_modules/crypt": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", + "integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/crypto-browserify": { "version": "3.12.0", "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", @@ -9128,6 +9147,17 @@ "node": ">=0.10.0" } }, + "node_modules/md5": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", + "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==", + "dev": true, + "dependencies": { + "charenc": "0.0.2", + "crypt": "0.0.2", + "is-buffer": "~1.1.6" + } + }, "node_modules/md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -9353,6 +9383,55 @@ "node": ">= 6.0.0" } }, + "node_modules/mocha-junit-reporter": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/mocha-junit-reporter/-/mocha-junit-reporter-2.1.1.tgz", + "integrity": "sha512-le1Z1uL6u7De/4uh0NQs+a7JledC8soZ4zZg/2IBpnigKDoyhmJ1GIImuV2m2QIlDYsgQ5AkyhVlH+zdYAiopw==", + "dev": true, + "dependencies": { + "debug": "^4.3.4", + "md5": "^2.3.0", + "mkdirp": "~1.0.4", + "strip-ansi": "^6.0.1", + "xml": "^1.0.1" + }, + "peerDependencies": { + "mocha": ">=2.2.5" + } + }, + "node_modules/mocha-junit-reporter/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha-junit-reporter/node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mocha-junit-reporter/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/mocha/node_modules/ansi-colors": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", @@ -13255,6 +13334,12 @@ "node": ">=10.0.0" } }, + "node_modules/xml": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz", + "integrity": "sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw==", + "dev": true + }, "node_modules/xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", @@ -16322,6 +16407,12 @@ "supports-color": "^5.3.0" } }, + "charenc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", + "integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==", + "dev": true + }, "check-error": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", @@ -16825,6 +16916,12 @@ "which": "^2.0.1" } }, + "crypt": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", + "integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==", + "dev": true + }, "crypto-browserify": { "version": "3.12.0", "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", @@ -20543,6 +20640,17 @@ } } }, + "md5": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", + "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==", + "dev": true, + "requires": { + "charenc": "0.0.2", + "crypt": "0.0.2", + "is-buffer": "~1.1.6" + } + }, "md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -20936,6 +21044,42 @@ } } }, + "mocha-junit-reporter": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/mocha-junit-reporter/-/mocha-junit-reporter-2.1.1.tgz", + "integrity": "sha512-le1Z1uL6u7De/4uh0NQs+a7JledC8soZ4zZg/2IBpnigKDoyhmJ1GIImuV2m2QIlDYsgQ5AkyhVlH+zdYAiopw==", + "dev": true, + "requires": { + "debug": "^4.3.4", + "md5": "^2.3.0", + "mkdirp": "~1.0.4", + "strip-ansi": "^6.0.1", + "xml": "^1.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -23845,6 +23989,12 @@ "integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==", "dev": true }, + "xml": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz", + "integrity": "sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw==", + "dev": true + }, "xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", diff --git a/package.json b/package.json index 4a39b2069..d3bfa678c 100644 --- a/package.json +++ b/package.json @@ -1,136 +1,145 @@ { - "name": "@microsoft/microsoft-graph-client", - "version": "3.0.0-Preview.3", - "description": "Microsoft Graph Client Library", - "keywords": [ - "Microsoft", - "Graph", - "SDK", - "JavaScript", - "Client" - ], - "repository": { - "type": "git", - "url": "https://github.com/microsoftgraph/msgraph-sdk-javascript.git" - }, - "license": "MIT", - "main": "lib/src/index.js", - "module": "lib/es/src/index.js", - "browser": { - "./lib/es/src/index.js": "./lib/es/src/browser/index.js", - "stream": "stream-browserify" - }, - "types": "./lib/src/index.d.ts", - "typings": "lib/src/index", - "files": [ - "lib/", - "src/", - "authProviders/", - "shims.d.ts" - ], - "scripts": { - "build": "npm run pre-build && npm run build:sub_cjs && npm run build:sub_es && rollup -c", - "build:cjs": "tsc --p tsconfig-cjs.json", - "build:es": "tsc --p tsconfig-es.json", - "build:sub_cjs": "tsc -b tsconfig-sub-cjs.json", - "build:sub_es": "tsc -b tsconfig-sub-es.json", - "format": "npm run format:css && npm run format:html && npm run format:js && npm run format:json && npm run format:md && npm run format:rc && npm run format:ts", - "format:css": "prettier --write \"**/*.css\"", - "format:html": "prettier --write \"**/*.html\"", - "format:js": "prettier --write \"**/*.js\"", - "format:json": "prettier --write \"**/*.json\"", - "format:md": "prettier --write \"**/*.md\"", - "format:rc": "prettier --write --parser json \"**/.*rc\"", - "format:ts": "prettier --write \"**/*.ts\"", - "karma": "karma start --single-run --browsers ChromeHeadless karma.conf.js", - "lint": "eslint . --ext .ts", - "lint:fix": "eslint . --ext .ts --fix", - "prepack": "npm install && npm run build && npm run test", - "pre-build": "npm run setVersion", - "setVersion": "gulp setVersion", - "test": "npm run test:cjs && npm run test:esm", - "test:cjs": "npm run build:sub_cjs && mocha 'lib/test/common/**/*.js' --require isomorphic-fetch && mocha 'lib/test/node/**/*.js' --require isomorphic-fetch", - "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", - "test:development": "tsc --p test/tsconfig-test-development.json && mocha 'lib/test/development/**/*.js' --require isomorphic-fetch", - "test:esm": "npm run build:sub_es && mocha 'lib/es/test/common/**/*.js' --require esm --require isomorphic-fetch && mocha 'lib/es/test/node/**/*.js' --require esm --require isomorphic-fetch" - }, - "nyc": { - "all": true, - "cache": false, - "exclude": [ - "samples/", - "*.js", - "lib/" - ], - "include": [ - "src/" - ] - }, - "dependencies": { - "@babel/runtime": "^7.12.5", - "tslib": "^2.2.0" - }, - "devDependencies": { - "@azure/identity": "^3.0.0", - "@azure/msal-browser": "^2.15.0", - "@babel/core": "^7.12.10", - "@babel/plugin-transform-runtime": "^7.12.10", - "@babel/preset-env": "^7.12.11", - "@istanbuljs/nyc-config-typescript": "^1.0.1", - "@microsoft/microsoft-graph-types": "^2.11.0", - "@rollup/plugin-babel": "^6.0.0", - "@rollup/plugin-commonjs": "^23.0.0", - "@rollup/plugin-node-resolve": "^15.0.0", - "@types/chai": "^4.2.14", - "@types/mocha": "^9.0.0", - "@types/node": "^18.0.0", - "@types/sinon": "^10.0.8", - "@typescript-eslint/eslint-plugin": "^5.12.1", - "@typescript-eslint/parser": "^5.12.1", - "chai": "^4.2.0", - "eslint": "^8.9.0", - "eslint-config-prettier": "^8.3.0", - "eslint-plugin-prettier": "^4.0.0", - "eslint-plugin-simple-import-sort": "^8.0.0", - "esm": "^3.2.25", - "form-data": "^4.0.0", - "gulp": "^4.0.2", - "husky": "^8.0.0", - "isomorphic-fetch": "^3.0.0", - "karma": "^6.3.2", - "karma-chai": "^0.1.0", - "karma-chrome-launcher": "^3.1.0", - "karma-firefox-launcher": "^2.1.0", - "karma-mocha": "^2.0.1", - "karma-typescript": "^5.2.0", - "lint-staged": "^13.0.0", - "mocha": "^6.2.3", - "nyc": "^15.1.0", - "prettier": "^2.5.1", - "rollup": "^2.36.2", - "rollup-plugin-terser": "^7.0.2", - "sinon": "^14.0.0", - "source-map-support": "^0.5.19", - "stream-browserify": "^3.0.0", - "ts-node": "^10.4.0", - "typescript": "^4.2.4", - "uglify-es": "^3.3.9" - }, - "peerDependenciesMeta": { - "@azure/identity": { - "optional": true - }, - "buffer": { - "optional": true - }, - "stream-browserify": { - "optional": true - }, - "@azure/msal-browser": { - "optional": true - } - }, - "engines": { - "node": ">=12.0.0" - } -} + "name": "@microsoft/microsoft-graph-client", + "version": "3.0.0-Preview.3", + "description": "Microsoft Graph Client Library", + "keywords": [ + "Microsoft", + "Graph", + "SDK", + "JavaScript", + "Client" + ], + "repository": { + "type": "git", + "url": "https://github.com/microsoftgraph/msgraph-sdk-javascript.git" + }, + "license": "MIT", + "main": "lib/src/index.js", + "module": "lib/es/src/index.js", + "browser": { + "./lib/es/src/index.js": "./lib/es/src/browser/index.js", + "stream": "stream-browserify" + }, + "types": "./lib/src/index.d.ts", + "typings": "lib/src/index", + "files": [ + "lib/", + "src/", + "authProviders/", + "shims.d.ts" + ], + "scripts": { + "build": "npm run pre-build && npm run build:sub_cjs && npm run build:sub_es && rollup -c", + "build:cjs": "tsc --p tsconfig-cjs.json", + "build:es": "tsc --p tsconfig-es.json", + "build:sub_cjs": "tsc -b tsconfig-sub-cjs.json", + "build:sub_es": "tsc -b tsconfig-sub-es.json", + "format": "npm run format:css && npm run format:html && npm run format:js && npm run format:json && npm run format:md && npm run format:rc && npm run format:ts", + "format:css": "prettier --write \"**/*.css\"", + "format:html": "prettier --write \"**/*.html\"", + "format:js": "prettier --write \"**/*.js\"", + "format:json": "prettier --write \"**/*.json\"", + "format:md": "prettier --write \"**/*.md\"", + "format:rc": "prettier --write --parser json \"**/.*rc\"", + "format:ts": "prettier --write \"**/*.ts\"", + "karma": "karma start --single-run --browsers ChromeHeadless karma.conf.js", + "lint": "eslint . --ext .ts", + "lint:fix": "eslint . --ext .ts --fix", + "prepack": "npm install && npm run build && npm run test", + "pre-build": "npm run setVersion", + "setVersion": "gulp setVersion", + "test": "npm run test:cjs && npm run test:esm", + "test:cjs": "npm run build:sub_cjs && mocha", + "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", + "test:development": "tsc --p test/tsconfig-test-development.json && mocha 'lib/test/development/**/*.js' --require isomorphic-fetch", + "test:esm": "npm run build:sub_es && mocha --require esm" + }, + "mocha": { + "reporter": ["mocha-junit-reporter"], + "reporterOptions": { + "mochaFile": "./testResult.xml" + }, + "spec": ["lib/test/common/**/*.js", "lib/test/node/**/*.js", "lib/es/test/common/**/*.js", "lib/es/test/node/**/*.js"], + "require": ["isomorphic-fetch","esm"] + }, + "nyc": { + "all": true, + "cache": false, + "exclude": [ + "samples/", + "*.js", + "lib/" + ], + "include": [ + "src/" + ] + }, + "dependencies": { + "@babel/runtime": "^7.12.5", + "tslib": "^2.2.0" + }, + "devDependencies": { + "@azure/identity": "^3.0.0", + "@azure/msal-browser": "^2.15.0", + "@babel/core": "^7.12.10", + "@babel/plugin-transform-runtime": "^7.12.10", + "@babel/preset-env": "^7.12.11", + "@istanbuljs/nyc-config-typescript": "^1.0.1", + "@microsoft/microsoft-graph-types": "^2.11.0", + "@rollup/plugin-babel": "^6.0.0", + "@rollup/plugin-commonjs": "^23.0.0", + "@rollup/plugin-node-resolve": "^15.0.0", + "@types/chai": "^4.2.14", + "@types/mocha": "^9.0.0", + "@types/node": "^18.0.0", + "@types/sinon": "^10.0.8", + "@typescript-eslint/eslint-plugin": "^5.12.1", + "@typescript-eslint/parser": "^5.12.1", + "chai": "^4.2.0", + "eslint": "^8.9.0", + "eslint-config-prettier": "^8.3.0", + "eslint-plugin-prettier": "^4.0.0", + "eslint-plugin-simple-import-sort": "^8.0.0", + "esm": "^3.2.25", + "form-data": "^4.0.0", + "gulp": "^4.0.2", + "husky": "^8.0.0", + "isomorphic-fetch": "^3.0.0", + "karma": "^6.3.2", + "karma-chai": "^0.1.0", + "karma-chrome-launcher": "^3.1.0", + "karma-firefox-launcher": "^2.1.0", + "karma-mocha": "^2.0.1", + "karma-typescript": "^5.2.0", + "lint-staged": "^13.0.0", + "mocha": "^6.2.3", + "mocha-junit-reporter": "^2.1.1", + "nyc": "^15.1.0", + "prettier": "^2.5.1", + "rollup": "^2.36.2", + "rollup-plugin-terser": "^7.0.2", + "sinon": "^14.0.0", + "source-map-support": "^0.5.19", + "stream-browserify": "^3.0.0", + "ts-node": "^10.4.0", + "typescript": "^4.2.4", + "uglify-es": "^3.3.9" + }, + "peerDependenciesMeta": { + "@azure/identity": { + "optional": true + }, + "buffer": { + "optional": true + }, + "stream-browserify": { + "optional": true + }, + "@azure/msal-browser": { + "optional": true + } + }, + "engines": { + "node": ">=12.0.0" + } +} \ No newline at end of file From 003a62d4e15a5bbe828491323227730da705c8fb Mon Sep 17 00:00:00 2001 From: Nikitha Chettiar Date: Tue, 1 Nov 2022 17:23:51 -0700 Subject: [PATCH 6/8] contents to ignore --- .azure-pipelines/ci-build-production.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/ci-build-production.yml b/.azure-pipelines/ci-build-production.yml index 33c8891d2..fac250b2f 100644 --- a/.azure-pipelines/ci-build-production.yml +++ b/.azure-pipelines/ci-build-production.yml @@ -46,7 +46,7 @@ stages: displayName: 'Publish Unit Test Results' inputs: testResultsFormat: 'JUnit' - testResultsFiles: '**/testResult.xml' + testResultsFiles: 'testResult.xml' failTaskOnFailedTests: true - template: ./common-templates/security-post-checks.yml @@ -71,6 +71,14 @@ stages: inputs: sourceFolder: '$(Build.SourcesDirectory)' targetFolder: $(Build.ArtifactStagingDirectory) + Contents: | + **/* + !test/** + !.azure-pipelines/** + !.github/** + !.git/** + !.vscode/** + !node_modules/** displayName: 'Copy npm package' - task: PublishBuildArtifacts@1 From 3434c2d1afde5d5e3c5986b95e8fa078bc7afad0 Mon Sep 17 00:00:00 2001 From: Nikitha Chettiar Date: Wed, 2 Nov 2022 10:45:18 -0700 Subject: [PATCH 7/8] script for each line --- .azure-pipelines/ci-build-production.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.azure-pipelines/ci-build-production.yml b/.azure-pipelines/ci-build-production.yml index fac250b2f..96e850d0d 100644 --- a/.azure-pipelines/ci-build-production.yml +++ b/.azure-pipelines/ci-build-production.yml @@ -35,18 +35,17 @@ stages: versionSpec: $(NODE_VERSION) displayName: 'Install Node.js' - - script: | - npm ci - npm run build - npm run test - npm run karma + - script: npm ci + - script: npm run build + - script: npm run test + - script: npm run karma displayName: 'Test the branch' - task: PublishTestResults@2 displayName: 'Publish Unit Test Results' inputs: testResultsFormat: 'JUnit' - testResultsFiles: 'testResult.xml' + testResultsFiles: '**/testResult.xml' failTaskOnFailedTests: true - template: ./common-templates/security-post-checks.yml From 5465f95600bd58eb6624457d34e4bc833ccd3cab Mon Sep 17 00:00:00 2001 From: Nikitha Chettiar Date: Wed, 2 Nov 2022 13:22:27 -0700 Subject: [PATCH 8/8] displayName for each script --- .azure-pipelines/ci-build-production.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/ci-build-production.yml b/.azure-pipelines/ci-build-production.yml index 96e850d0d..e0402e834 100644 --- a/.azure-pipelines/ci-build-production.yml +++ b/.azure-pipelines/ci-build-production.yml @@ -36,10 +36,13 @@ stages: displayName: 'Install Node.js' - script: npm ci + displayName: 'npm install for tests' - script: npm run build + displayName: 'npm build for tests' - script: npm run test + displayName: 'Run the node tests' - script: npm run karma - displayName: 'Test the branch' + displayName: 'Run karma tests' - task: PublishTestResults@2 displayName: 'Publish Unit Test Results'