Skip to content

Commit

Permalink
fix: upgrade dependencies to resolve dependabot vulnerability alerts (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
falconandy committed Dec 16, 2022
1 parent 75dcafd commit 9207b46
Show file tree
Hide file tree
Showing 10 changed files with 10,087 additions and 12,570 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [10.x, 12.x, 14.x]
node-version: [14.x, 16.x, 18.x]
os: [macOS-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}

Expand Down
86 changes: 43 additions & 43 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,58 +16,58 @@
"module": "amplitude.esm.js",
"dependencies": {
"@amplitude/ua-parser-js": "0.7.31",
"@amplitude/utils": "^1.10.1",
"@babel/runtime": "^7.3.4",
"blueimp-md5": "^2.10.0",
"query-string": "5",
"@amplitude/utils": "^1.10.2",
"@babel/runtime": "^7.20.6",
"blueimp-md5": "^2.19.0",
"query-string": "8.0.3",
"@amplitude/analytics-connector": "^1.4.6"
},
"devDependencies": {
"@amplitude/eslint-plugin-amplitude": "^1.0.1",
"@babel/core": "^7.3.4",
"@babel/plugin-external-helpers": "^7.2.0",
"@babel/plugin-proposal-object-rest-spread": "^7.3.4",
"@babel/plugin-transform-runtime": "^7.3.4",
"@babel/preset-env": "^7.3.4",
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/exec": "^5.0.0",
"@semantic-release/git": "^9.0.0",
"chai": "^4.1.2",
"date-fns": "^1.30.1",
"eslint": "^7.15.0",
"eslint-config-prettier": "^7.0.0",
"eslint-plugin-mocha": "^8.0.0",
"eslint-plugin-prettier": "^3.3.1",
"express": "^4.16.2",
"fs-extra": "^4.0.2",
"husky": "^4.3.6",
"jsdoc": "^3.6.3",
"jsdoc-to-markdown": "^6.0.1",
"karma": "^4.0.0",
"@babel/core": "^7.20.5",
"@babel/plugin-external-helpers": "^7.18.6",
"@babel/plugin-proposal-object-rest-spread": "^7.20.2",
"@babel/plugin-transform-runtime": "^7.19.6",
"@babel/preset-env": "^7.20.2",
"@semantic-release/changelog": "^6.0.2",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"chai": "^4.3.7",
"date-fns": "^2.29.3",
"eslint": "^8.29.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-mocha": "^10.1.0",
"eslint-plugin-prettier": "^4.2.1",
"express": "^4.18.2",
"fs-extra": "^11.1.0",
"husky": "^8.0.2",
"jsdoc": "^4.0.0",
"jsdoc-to-markdown": "^8.0.0",
"karma": "^6.4.1",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^2.2.0",
"karma-firefox-launcher": "^1.0.1",
"karma-mocha": "^1.3.0",
"karma-chrome-launcher": "^3.1.1",
"karma-firefox-launcher": "^2.1.2",
"karma-mocha": "^2.0.1",
"karma-mocha-reporter": "^2.2.5",
"karma-mocha-webworker": "^1.3.0",
"karma-sauce-launcher": "^2.0.2",
"karma-sauce-launcher": "^4.3.6",
"karma-sinon": "^1.0.5",
"karma-sourcemap-loader": "^0.3.7",
"lint-staged": "^10.5.3",
"mocha": "^4.0.1",
"prettier": "^2.2.1",
"karma-sourcemap-loader": "^0.3.8",
"lint-staged": "^13.1.0",
"mocha": "^10.2.0",
"prettier": "^2.8.1",
"requirejs": "^2.3.6",
"rollup": "^2.26.3",
"@rollup/plugin-babel": "^5.2.0",
"@rollup/plugin-commonjs": "^15.0.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-replace": "^2.3.3",
"@rollup/plugin-legacy": "^2.2.0",
"rollup-plugin-uglify": "^6.0.2",
"semantic-release": "^17.1.1",
"sinon": "^7.0.0",
"uglify-js": "^3.4.9",
"rollup": "^2.79.1",
"@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-commonjs": "^23.0.5",
"@rollup/plugin-json": "^5.0.2",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-replace": "^5.0.1",
"@rollup/plugin-legacy": "^3.0.1",
"rollup-plugin-uglify": "^6.0.4",
"semantic-release": "^19.0.5",
"sinon": "^15.0.0",
"uglify-js": "^3.17.4",
"watch": "^1.0.2"
},
"scripts": {
Expand Down
14 changes: 9 additions & 5 deletions test/amplitude-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('AmplitudeClient', function () {
beforeEach(function () {
amplitude = new AmplitudeClient();
server = sinon.fakeServer.create();
sandbox = sinon.sandbox.create();
sandbox = sinon.createSandbox();
});

afterEach(function () {
Expand Down Expand Up @@ -116,13 +116,13 @@ describe('AmplitudeClient', function () {
});

it('should clear the onInitQueue', function () {
let onInitCalled = false;
let onInit2Called = false;
let onInitCalled = false; /* eslint-disable-line no-unused-vars */
let onInit2Called = false; /* eslint-disable-line no-unused-vars */
amplitude.onInit(() => {
onInitCalled = true; /* eslint-disable-line no-unused-vars */
onInitCalled = true;
});
amplitude.onInit(() => {
onInit2Called = true; /* eslint-disable-line no-unused-vars */
onInit2Called = true;
});

amplitude.init(apiKey);
Expand Down Expand Up @@ -4506,6 +4506,10 @@ describe('AmplitudeClient', function () {
amplitude.init(apiKey);
});

afterEach(function () {
clock.restore();
});

it('should not renew the session id with invalid startNewSession input', function () {
var amplitude = new AmplitudeClient();
// set up initial session
Expand Down
3 changes: 3 additions & 0 deletions test/language.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,21 @@ describe('language', function () {
Object.defineProperty(navigator, 'languages', {
value: null,
configurable: true,
writable: true,
});
}
if (!('language' in navigator)) {
Object.defineProperty(navigator, 'language', {
value: null,
configurable: true,
writable: true,
});
}
if (!('userLanguage' in navigator)) {
Object.defineProperty(navigator, 'userLanguage', {
value: null,
configurable: true,
writable: true,
});
}

Expand Down
4 changes: 2 additions & 2 deletions test/web-worker.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-undef */
importScripts('/base/amplitude.js');
importScripts('/base/node_modules/sinon/pkg/sinon.js');
const { sandbox } = sinon;
const { createSandbox } = sinon;
/* eslint-enable no-undef */

var isTrue = function (a) {
Expand All @@ -13,7 +13,7 @@ var isTrue = function (a) {
describe('web worker', function () {
let sbox;
beforeEach(function () {
sbox = sandbox.create();
sbox = createSandbox();
});

afterEach(function () {
Expand Down
3 changes: 1 addition & 2 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ module.exports = {
organizationName: 'Amplitude',
projectName: 'Amplitude-JavaScript',
themeConfig: {
sidebarCollapsible: false,
navbar: {
logo: {
alt: 'Amplitude Logo',
Expand Down Expand Up @@ -39,11 +38,11 @@ module.exports = {
'@docusaurus/preset-classic',
{
docs: {
homePageId: 'AmplitudeClient',
path: 'docs',
routeBasePath: '/',
sidebarPath: require.resolve('./sidebars.js'),
editUrl: 'https://github.com/amplitude/Amplitude-JavaScript/website',
sidebarCollapsible: false,
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
Expand Down
11 changes: 10 additions & 1 deletion website/generate-jsdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const fs = require('fs');
const path = require('path');
const prettier = require('prettier');
const publicClassFiles = ['amplitude-client.js', 'amplitude.js', 'identify.js', 'revenue.js'];
const homeFile = 'amplitude-client.js';
const publicTypedefFiles = ['options.js'];
const srcDir = path.join(__dirname, '../', 'src');
const outputDir = path.join(__dirname, 'docs');
Expand All @@ -25,7 +26,15 @@ function generateClassMarkdown(inputFile) {
(e) => e.kind === 'constructor' || (e.access === 'public' && (e.kind === 'function' || e.kind === 'member')),
);

const markdownOutput = filteredData.map((item) => documentClassFile(item)).join('\n');
let markdownOutput = filteredData.map((item) => documentClassFile(item)).join('\n');
if (inputFile === homeFile) {
markdownOutput =
`\
---
slug: /
---
` + markdownOutput;
}
fs.writeFileSync(path.join(outputDir, `${className}.md`), prettier.format(markdownOutput, { parser: 'mdx' }));
}

Expand Down
14 changes: 7 additions & 7 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
"serve": "docusaurus build --out-dir build/Amplitude-JavaScript && yarn run docusaurus serve"
},
"dependencies": {
"@docusaurus/core": "^2.0.0-alpha.61",
"@docusaurus/preset-classic": "^2.0.0-alpha.61",
"@mdx-js/react": "^1.5.8",
"clsx": "^1.1.1",
"react": "^16.8.4",
"react-dom": "^16.8.4"
"@docusaurus/core": "^2.2.0",
"@docusaurus/preset-classic": "^2.2.0",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.2.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"browserslist": {
"production": [
Expand All @@ -31,4 +31,4 @@
"last 2 safari version"
]
}
}
}
Loading

0 comments on commit 9207b46

Please sign in to comment.