Skip to content

Commit

Permalink
Task 9901543: Remediate security vulnerabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
MSNev committed Jun 8, 2021
1 parent be8185e commit e95657f
Show file tree
Hide file tree
Showing 22 changed files with 928 additions and 689 deletions.
3 changes: 2 additions & 1 deletion AISKU/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"@microsoft/api-extractor" : "^7.9.11",
"finalhandler": "^1.1.1",
"grunt": "^1.3.0",
"grunt-cli": "^1.3.2",
"grunt-contrib-qunit": "^3.1.0",
"grunt-ts": "^6.0.0-beta.22",
"grunt-tslint": "^5.0.2",
Expand All @@ -61,7 +62,7 @@
"tslib": "^1.13.0"
},
"dependencies": {
"@microsoft/dynamicproto-js": "^1.1.2",
"@microsoft/dynamicproto-js": "^1.1.4",
"@microsoft/applicationinsights-shims" : "2.0.0",
"@microsoft/applicationinsights-analytics-js": "2.6.2",
"@microsoft/applicationinsights-channel-js": "2.6.2",
Expand Down
3 changes: 2 additions & 1 deletion AISKULight/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@microsoft/applicationinsights-rollup-es3" : "1.1.3",
"@microsoft/api-extractor" : "^7.9.11",
"grunt": "^1.3.0",
"grunt-cli": "^1.3.2",
"grunt-contrib-qunit": "^3.1.0",
"grunt-run": "^0.8.1",
"grunt-ts": "^6.0.0-beta.22",
Expand All @@ -38,7 +39,7 @@
"tslint-config-prettier": "^1.18.0"
},
"dependencies": {
"@microsoft/dynamicproto-js": "^1.1.2",
"@microsoft/dynamicproto-js": "^1.1.4",
"@microsoft/applicationinsights-shims" : "2.0.0",
"@microsoft/applicationinsights-common": "2.6.2",
"@microsoft/applicationinsights-channel-js": "2.6.2",
Expand Down
3 changes: 2 additions & 1 deletion channels/applicationinsights-channel-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"@types/qunit": "^2.5.3",
"@types/sinon": "4.3.3",
"grunt": "^1.3.0",
"grunt-cli": "^1.3.2",
"grunt-contrib-qunit": "^3.1.0",
"grunt-run": "^0.8.1",
"grunt-ts": "^6.0.0-beta.22",
Expand All @@ -43,7 +44,7 @@
"sinon": "^7.3.1"
},
"dependencies": {
"@microsoft/dynamicproto-js": "^1.1.2",
"@microsoft/dynamicproto-js": "^1.1.4",
"@microsoft/applicationinsights-shims" : "2.0.0",
"@microsoft/applicationinsights-core-js": "2.6.2",
"@microsoft/applicationinsights-common": "2.6.2"
Expand Down
2 changes: 1 addition & 1 deletion common/Tests/Framework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@
},
"dependencies": {
"@microsoft/applicationinsights-shims" : "2.0.0",
"@microsoft/dynamicproto-js": "^1.1.2"
"@microsoft/dynamicproto-js": "^1.1.4"
}
}
1,015 changes: 346 additions & 669 deletions common/config/rush/npm-shrinkwrap.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions extensions/applicationinsights-analytics-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@
"rollup-plugin-cleanup": "3.2.1",
"rollup": "^2.32.0",
"grunt": "^1.3.0",
"grunt-cli": "^1.3.2",
"grunt-contrib-qunit": "^3.1.0",
"grunt-run": "^0.8.1",
"grunt-ts": "^6.0.0-beta.22",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"qunit": "^2.9.1",
"sinon": "^7.3.1",
"http-server": "0.12.3"
"sinon": "^7.3.1"
},
"dependencies": {
"@microsoft/dynamicproto-js": "^1.1.2",
"@microsoft/dynamicproto-js": "^1.1.4",
"@microsoft/applicationinsights-shims" : "2.0.0",
"@microsoft/applicationinsights-core-js": "2.6.2",
"@microsoft/applicationinsights-common": "2.6.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@
"rollup-plugin-cleanup": "3.2.1",
"rollup": "^2.32.0",
"grunt": "^1.3.0",
"grunt-cli": "^1.3.2",
"grunt-contrib-qunit": "^3.1.0",
"grunt-run": "^0.8.1",
"grunt-ts": "^6.0.0-beta.22",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0"
},
"dependencies": {
"@microsoft/dynamicproto-js": "^1.1.2",
"@microsoft/dynamicproto-js": "^1.1.4",
"@microsoft/applicationinsights-shims": "2.0.0",
"@microsoft/applicationinsights-core-js": "2.6.2",
"@microsoft/applicationinsights-common": "2.6.2",
Expand Down
3 changes: 2 additions & 1 deletion extensions/applicationinsights-debugplugin-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"typescript": "2.5.3",
"tslib": "^1.13.0",
"grunt": "^1.3.0",
"grunt-cli": "^1.3.2",
"grunt-contrib-qunit": "^3.1.0",
"grunt-run": "^0.8.1",
"grunt-ts": "^6.0.0-beta.22",
Expand All @@ -41,7 +42,7 @@
"tslint-config-prettier": "^1.18.0"
},
"dependencies": {
"@microsoft/dynamicproto-js": "^1.1.2",
"@microsoft/dynamicproto-js": "^1.1.4",
"@microsoft/applicationinsights-common": "2.6.2",
"@microsoft/applicationinsights-core-js": "2.6.2",
"@microsoft/applicationinsights-shims": "2.0.0"
Expand Down
3 changes: 2 additions & 1 deletion extensions/applicationinsights-dependencies-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"typescript": "2.5.3",
"tslib": "^1.13.0",
"grunt": "^1.3.0",
"grunt-cli": "^1.3.2",
"grunt-contrib-qunit": "^3.1.0",
"grunt-run": "^0.8.1",
"grunt-ts": "^6.0.0-beta.22",
Expand All @@ -41,7 +42,7 @@
"tslint-config-prettier": "^1.18.0"
},
"dependencies": {
"@microsoft/dynamicproto-js": "^1.1.2",
"@microsoft/dynamicproto-js": "^1.1.4",
"@microsoft/applicationinsights-shims" : "2.0.0",
"@microsoft/applicationinsights-core-js": "2.6.2",
"@microsoft/applicationinsights-common": "2.6.2"
Expand Down
3 changes: 2 additions & 1 deletion extensions/applicationinsights-properties-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"typescript": "2.5.3",
"tslib": "^1.13.0",
"grunt": "^1.3.0",
"grunt-cli": "^1.3.2",
"grunt-contrib-qunit": "^3.1.0",
"grunt-run": "^0.8.1",
"grunt-ts": "^6.0.0-beta.22",
Expand All @@ -44,7 +45,7 @@
"sinon": "^7.3.1"
},
"dependencies": {
"@microsoft/dynamicproto-js": "^1.1.2",
"@microsoft/dynamicproto-js": "^1.1.4",
"@microsoft/applicationinsights-shims" : "2.0.0",
"@microsoft/applicationinsights-core-js": "2.6.2",
"@microsoft/applicationinsights-common": "2.6.2"
Expand Down
5 changes: 3 additions & 2 deletions extensions/applicationinsights-react-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"@types/react": "^16.9.11",
"@types/react-dom": "^16.9.4",
"csstype": "~2.6.7",
"grunt": "1.0.1",
"grunt": "^1.3.0",
"grunt-cli": "^1.3.2",
"jest": "^24.7.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
Expand All @@ -55,7 +56,7 @@
"@microsoft/applicationinsights-shims": "^2.0.0",
"@microsoft/applicationinsights-core-js": "^2.6.2",
"@microsoft/applicationinsights-common": "^2.6.2",
"@microsoft/dynamicproto-js": "^1.1.2",
"@microsoft/dynamicproto-js": "^1.1.4",
"history": "^4.10.1"
},
"peerDependencies": {
Expand Down
7 changes: 4 additions & 3 deletions extensions/applicationinsights-react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@
},
"devDependencies": {
"@microsoft/applicationinsights-rollup-es3": "1.1.3",
"grunt": "1.0.1",
"grunt": "^1.3.0",
"grunt-cli": "^1.3.2",
"grunt-contrib-qunit": "^3.1.0",
"grunt-contrib-uglify": "3.1.0",
"grunt-run": "^0.8.1",
"grunt-ts": "^6.0.0-beta.22",
"grunt-tslint": "^5.0.2",
"qunit": "^2.11.2",
"react": "16.13.1",
"react-native": "0.63.2",
"react-native": "0.64.2",
"react-native-device-info": "^5.6.5",
"globby": "^11.0.0",
"magic-string": "^0.25.7",
Expand All @@ -47,7 +48,7 @@
"@microsoft/applicationinsights-common": "^2.6.2",
"@microsoft/applicationinsights-core-js": "^2.6.2",
"@microsoft/applicationinsights-shims": "^2.0.0",
"@microsoft/dynamicproto-js": "^1.1.2"
"@microsoft/dynamicproto-js": "^1.1.4"
},
"peerDependencies": {
"react-native": "*",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
"devDependencies": {
"grunt": "^1.0.1",
"grunt": "^1.3.0",
"grunt-cli": "^1.3.2",
"grunt-contrib-connect": "^3.0.0",
"grunt-contrib-qunit": "^3.1.0",
Expand Down
7 changes: 6 additions & 1 deletion rush.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush.schema.json",

"npmVersion": "7.10.0",
"npmVersion": "7.16.0",
"rushVersion": "5.44.0",
"projectFolderMaxDepth": 4,
"projects": [
{
"packageName": "applicationinsights-js-release-tools",
"projectFolder": "tools/release-tools",
"shouldPublish": false
},
{
"packageName": "@microsoft/ai-test-framework",
"projectFolder": "common/Tests/Framework",
Expand Down
3 changes: 2 additions & 1 deletion shared/AppInsightsCommon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"@microsoft/applicationinsights-rollup-es3" : "1.1.3",
"@microsoft/api-extractor" : "^7.9.11",
"grunt": "^1.3.0",
"grunt-cli": "^1.3.2",
"grunt-contrib-qunit": "^3.1.0",
"grunt-ts": "^6.0.0-beta.22",
"@rollup/plugin-commonjs": "^15.1.0",
Expand All @@ -42,7 +43,7 @@
"dependencies": {
"@microsoft/applicationinsights-shims" : "2.0.0",
"@microsoft/applicationinsights-core-js": "2.6.2",
"@microsoft/dynamicproto-js": "^1.1.2"
"@microsoft/dynamicproto-js": "^1.1.4"
},
"license": "MIT"
}
3 changes: 2 additions & 1 deletion shared/AppInsightsCore/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"@microsoft/applicationinsights-rollup-es3" : "1.1.3",
"@microsoft/api-extractor" : "^7.9.11",
"grunt": "^1.3.0",
"grunt-cli": "^1.3.2",
"grunt-contrib-qunit": "^3.1.0",
"grunt-ts": "^6.0.0-beta.22",
"globby": "^11.0.0",
Expand All @@ -56,6 +57,6 @@
},
"dependencies": {
"@microsoft/applicationinsights-shims" : "2.0.0",
"@microsoft/dynamicproto-js": "^1.1.2"
"@microsoft/dynamicproto-js": "^1.1.4"
}
}
110 changes: 110 additions & 0 deletions tools/release-tools/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# 1DS JavaScript Release Tools

1DS JavaScript Release tools.

This script is used internally to both prepare a release and to automatically generate beta/nightly builds.

## setVersion.js

This script is designed as a helper for setting and updating the version number used for all components, in both the package.json and versions directly embedded in the source / test files.

When run, it will
- Set the specified version in the version.json (which is used as the default when not specified on the command line)
- Updates the "version" within EVERY package.json for all channels/extensions/shared/skus/snippets/examples
- Updates ALL of the referenced versions for the "@microsoft/1ds-xxx" dependencies/peerDependencies/devDependencies, so that when rush creates references they all reference the local build.

After running this script and the version number has changed you WILL need to also run the "rush update" ```npm run update``` to ensure that the dependencies and hashes identified in the npm-shrinkwrap.json are updated correctly.

### When to use

There are a couple of usages for this script
- When preparing a new release you should run the script with either an explicit version or specify the switch to automatically increment the version number
- ```npm run setVersion 3.2.0``` Sets the version explicitly as 3.2.0 (for ALL components), only use this if all components are on the same version.
- ```npm run setVersion -- -patch``` Increments version to the next patch version number x.y.[z+1] (eg. ```3.1.2``` => ```3.1.3```) This will increment the patch level based on the components current version and not the root package.json version.
- ```npm run setVersion -- -minor``` Increments the version to the next minor version number x.[y+1].0 (eg. ```3.1.2``` => ```3.2.0```)
- During the build pipeline, this script will be called from with the dev-ops pipeline so that we can create an automated pipeline for generating alpha/beta/dev/nightly/release builds, with or without the current build number. This will be used to generate official "Beta" release generation job.
- Note: At this stage the version number will NOT be checked back into the repo

### Example Usages

Not all combinations are show, you can combine several options.

General help displayed when the passed arguments appear to be incorrect.

```
setVersion.js [<newVersion>|-patch|-minor|-major] [-dev|-alpha|-beta|-release] [-bld ######] [-test]
--------------------------
<newVersion> - Identifies the version to set for all packages, must start with x.y.z
-patch - Increment the current version to the next patch number (x.y.z => x.y.[z+1]
-minor - Increment the current version to the next minor number (x.y.z => x.[y+1].0
-major - Increment the current version to the next major number (x.y.z => [x+1].0.0
-dev - Add the 'dev' pre-release to the number (x.y.z => x.y.z-dev)
-alpha - Add the 'alpha' pre-release to the number (x.y.z => x.y.z-alpha)
-beta - Add the 'beta' pre-release to the number (x.y.z => x.y.z-beta)
-release - Remove any existing pre-release tags (x.y.z-prerel => x.y.z)
-bld ###### - Append the provided build number to the version (x.y.z => x.y.z-[prerel].######) [prerel] defaults to dev if not defined
-pre ###### - Set the pre-release to the provided value (x.y.z => x.y.z-[prerel])
-react - Update only the react packages (Require as the react components need to update after the core because of the different versions of TypeScript being used.)
-test - Scan all of the package.json files and log the changes, but DON'T update the files
```
#### Set the version explicitly
To set the version to specific build number, just pass as one of the arguments
```npm run setVersion 3.2.0```

```npm run setVersion -- 3.2.0```

The ```--``` is only when passing switch arguments to the script, so when specifying an explicit version it's optional as npm will pass the argument correctly.

#### Increase to the next patch level

```npm run setVersion -- -patch``` (eg. ```3.1.2``` => ```3.1.3```)

#### Increase to the next minor release

```npm run setVersion -- -minor``` (eg. ```3.1.2``` => ```3.2.0```)

#### Increase to the next major release

```npm run setVersion -- -major``` (eg. ```3.1.2``` => ```4.0.0```)

#### Dev Pre-release

Change the current version as a ```dev``` pre-release build

```npm run setVersion``` (eg. ```3.1.2``` => ```3.1.2-dev```)

```npm run setVersion -- -dev``` (eg. ```3.1.2``` => ```3.1.2-dev```)

#### Dev Pre-release and next patch level

```npm run setVersion -- -patch -dev``` (eg. ```3.1.2``` => ```3.1.3-dev```)

#### Set the version as a release version

Running this removes any current pre-release tag.

```npm run setVersion -- -release``` (eg. ```3.1.2-dev``` => ```3.1.2```)

#### Set as a specific pre-release

```npm run setVersion -- -pre nightly``` (eg. ```3.1.2``` => ```3.1.2-nightly```)

#### Add a build number to the release (implied pre-release)

> Using this switch implies that the resulting version WILL be a pre-release complete with a &lt;pre-release&gt; tag. And when no &lt;pre-release&gt; is specified (dev/alpha/beta/etc) ```dev``` will be assumed and added.
>
> And when also used with the release switch the &lt;pre-release&gt; tag will default to ```rc```
Build numbers are added using the "." prefix as based on the [semver](https://semver.org/) specification the build number "+" does not uniquely identify or define a sequence for resolving precedence.

```npm run setVersion -- -bld 20210525.1``` (eg. ```3.1.2 => 3.1.2-dev.20210525.1```)

```npm run setVersion -- -bld 20210525.1 -dev``` (eg. ```3.1.2 => 3.1.2-dev.20210525.1```)

```npm run setVersion -- -bld 20210525.1 -pre nightly``` (eg. ```3.1.2 => 3.1.2-nightly.20210525.1```)

```npm run setVersion -- -bld 20210525.1 -release``` (eg. ```3.1.2 => 3.1.2-rc.20210525.1```)

28 changes: 28 additions & 0 deletions tools/release-tools/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "applicationinsights-js-release-tools",
"version": "3.1.3-dev",
"author": "Javascript Telemetry SDKs <TelReachSDK@microsoft.com>",
"description": "1DS Web SDK",
"homepage": "https://1dsdocs.azurewebsites.net/sdk.html",
"sideEffects": false,
"scripts": {
"update": "rush update",
"build": "",
"rebuild": "",
"test": "",
"updateVer": "node ./tools/release-tools/updateVersion.js"
},
"keywords": [
"1DS",
"Js",
"SDK"
],
"repository": {
"type": "git",
"url": "https://msasg.visualstudio.com/DefaultCollection/Shared%20Data/_git/1DS.JavaScript"
},
"devDependencies": {
"grunt": "^1.3.0",
"globby": "^11.0.0"
}
}
Loading

0 comments on commit e95657f

Please sign in to comment.