Skip to content

Commit

Permalink
Bump typescript and axios
Browse files Browse the repository at this point in the history
* axios needed a bump due to CVE-2023-45857 which was not compatible with typescript 4.0.2

* typescript was bumped to 4.6.4

Signed-off-by: Miki <[email protected]>
  • Loading branch information
AMoo-Miki committed Nov 13, 2023
1 parent 524fd93 commit 0614fa2
Show file tree
Hide file tree
Showing 77 changed files with 124 additions and 112 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"**/node-jose": "^2.2.0",
"**/nth-check": "^2.0.1",
"**/trim": "^0.0.3",
"**/typescript": "4.0.2",
"**/typescript": "4.6.4",
"**/unset-value": "^2.0.1",
"**/jest-config": "npm:@amoo-miki/[email protected]",
"**/jest-jasmine2": "npm:@amoo-miki/[email protected]",
Expand Down Expand Up @@ -453,7 +453,7 @@
"topojson-client": "3.0.0",
"tough-cookie": "^4.1.3",
"tree-kill": "^1.2.2",
"typescript": "4.0.2",
"typescript": "4.6.4",
"ui-select": "0.19.8",
"vega": "^5.23.0",
"vega-interpreter": "npm:@amoo-miki/[email protected]",
Expand Down
2 changes: 1 addition & 1 deletion packages/osd-ace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@osd/dev-utils": "1.0.0",
"@osd/babel-preset": "1.0.0",
"raw-loader": "^4.0.2",
"typescript": "4.0.2",
"typescript": "4.6.4",
"webpack": "npm:@amoo-miki/[email protected]"
},
"@osd/pm": {
Expand Down
2 changes: 1 addition & 1 deletion packages/osd-analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
"@babel/cli": "^7.22.9",
"@osd/dev-utils": "1.0.0",
"@osd/babel-preset": "1.0.0",
"typescript": "4.0.2"
"typescript": "4.6.4"
}
}
2 changes: 1 addition & 1 deletion packages/osd-apm-config-loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"lodash": "^4.17.21"
},
"devDependencies": {
"typescript": "4.0.2",
"typescript": "4.6.4",
"tsd": "^0.21.0"
}
}
4 changes: 2 additions & 2 deletions packages/osd-babel-preset/common_preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
*/

const plugins = [
'@babel/plugin-transform-class-properties',
'@babel/plugin-transform-private-methods',
require.resolve('@babel/plugin-transform-class-properties'),
require.resolve('@babel/plugin-transform-private-methods'),
require.resolve('babel-plugin-add-module-exports'),

// Optional Chaining proposal is stage 4 (https://github.com/tc39/proposal-optional-chaining)
Expand Down
2 changes: 1 addition & 1 deletion packages/osd-config-schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"devDependencies": {
"@osd/cross-platform": "1.0.0",
"tsd": "^0.21.0",
"typescript": "4.0.2"
"typescript": "4.6.4"
},
"peerDependencies": {
"lodash": "^4.17.21",
Expand Down
2 changes: 1 addition & 1 deletion packages/osd-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"devDependencies": {
"@osd/dev-utils": "1.0.0",
"@osd/utility-types": "1.0.0",
"typescript": "4.0.2",
"typescript": "4.6.4",
"tsd": "^0.21.0"
}
}
2 changes: 1 addition & 1 deletion packages/osd-cross-platform/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"osd:bootstrap": "yarn build"
},
"devDependencies": {
"typescript": "4.0.2",
"typescript": "4.6.4",
"tsd": "^0.21.0"
}
}
2 changes: 1 addition & 1 deletion packages/osd-cross-platform/src/repo_root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const readOpenSearchDashboardsPkgJson = (dir: string) => {
return json;
}
} catch (error) {
if (error && error.code === 'ENOENT') {
if (error?.code === 'ENOENT') {
return;
}

Expand Down
4 changes: 2 additions & 2 deletions packages/osd-dev-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"dependencies": {
"@babel/core": "^7.22.9",
"@osd/utils": "1.0.0",
"axios": "^0.27.2",
"axios": "^1.6.1",
"chalk": "^4.1.0",
"cheerio": "0.22.0",
"dedent": "^0.7.0",
Expand All @@ -37,6 +37,6 @@
"@osd/expect": "1.0.0",
"@types/vinyl": "^2.0.4",
"chance": "1.0.18",
"typescript": "4.0.2"
"typescript": "4.6.4"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { ToolingLog } from '../tooling_log';

const isConcliftOnGetError = (error: any) => {
return (
isAxiosResponseError(error) && error.config.method === 'GET' && error.response.status === 409
isAxiosResponseError(error) && error.config?.method === 'GET' && error.response.status === 409
);
};

Expand Down
2 changes: 1 addition & 1 deletion packages/osd-i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"del": "^6.1.1",
"getopts": "^2.2.5",
"supports-color": "^7.0.0",
"typescript": "4.0.2"
"typescript": "4.6.4"
},
"dependencies": {
"intl-format-cache": "^2.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/osd-logging/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"@osd/std": "1.0.0"
},
"devDependencies": {
"typescript": "4.0.2"
"typescript": "4.6.4"
}
}
2 changes: 1 addition & 1 deletion packages/osd-monaco/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"del": "^6.1.1",
"raw-loader": "^4.0.2",
"supports-color": "^7.0.0",
"typescript": "4.0.2",
"typescript": "4.6.4",
"webpack": "npm:@amoo-miki/[email protected]",
"webpack-cli": "^4.9.2"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/osd-opensearch-archiver/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ export function runCli() {
output: process.stdout,
});

await new Promise((resolveInput) => {
await new Promise<void>((resolveInput) => {
rl.question(`Press enter when you're done`, () => {
rl.close();
resolveInput();
Expand Down
2 changes: 1 addition & 1 deletion packages/osd-plugin-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
"@types/gulp-zip": "^4.0.1",
"@types/inquirer": "^7.3.1",
"extract-zip": "^2.0.1",
"typescript": "4.0.2"
"typescript": "4.6.4"
}
}
2 changes: 1 addition & 1 deletion packages/osd-pm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"strip-ansi": "^6.0.0",
"strong-log-transformer": "^2.1.0",
"tempy": "^0.3.0",
"typescript": "4.0.2",
"typescript": "4.6.4",
"unlazy-loader": "^0.1.3",
"webpack": "npm:@amoo-miki/[email protected]",
"webpack-cli": "^4.9.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/osd-std/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"devDependencies": {
"@osd/utility-types": "1.0.0",
"typescript": "4.0.2",
"typescript": "4.6.4",
"tsd": "^0.21.0"
},
"@osd/pm": {
Expand Down
2 changes: 1 addition & 1 deletion packages/osd-stylelint-plugin-stylelint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"stylelint": "^14.5.2"
},
"devDependencies": {
"typescript": "4.0.2",
"typescript": "4.6.4",
"tsd": "^0.21.0"
}
}
2 changes: 1 addition & 1 deletion packages/osd-telemetry-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"normalize-path": "^3.0.0",
"@types/lodash": "^4.14.170",
"moment": "^2.24.0",
"typescript": "4.0.2"
"typescript": "4.6.4"
}
}
6 changes: 3 additions & 3 deletions packages/osd-test/src/failed_tests_reporter/github_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* under the License.
*/

import Axios, { AxiosRequestConfig, AxiosInstance } from 'axios';
import Axios, { AxiosRequestConfig, AxiosInstance, AxiosHeaderValue } from 'axios';
import parseLinkHeader from 'parse-link-header';
import { ToolingLog, isAxiosResponseError, isAxiosRequestError } from '@osd/dev-utils';

Expand Down Expand Up @@ -206,7 +206,7 @@ export class GithubApi {
): Promise<{
status: number;
statusText: string;
headers: Record<string, string | string[] | undefined>;
headers: Record<string, AxiosHeaderValue | undefined>;
data: T;
}> {
const executeRequest = !this.dryRun || options.safeForDryRun;
Expand All @@ -231,7 +231,7 @@ export class GithubApi {
const githubApiFailed = isAxiosResponseError(error) && error.response.status >= 500;
const errorResponseLog =
isAxiosResponseError(error) &&
`[${error.config.method} ${error.config.url}] ${error.response.status} ${error.response.statusText} Error`;
`[${error.config?.method} ${error.config?.url}] ${error.response.status} ${error.response.statusText} Error`;

if ((unableToReachGithub || githubApiFailed) && attempt < maxAttempts) {
const waitMs = 1000 * attempt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,17 @@ export class LifecyclePhase<Args extends readonly any[]> {
private readonly beforeSubj = new Rx.Subject<void>();
public readonly before$ = this.beforeSubj.asObservable();

private readonly afterSubj = this.options.singular
? new Rx.ReplaySubject<void>(1)
: new Rx.Subject<void>();
public readonly after$ = this.afterSubj.asObservable();
private readonly afterSubj: Rx.Subject<void>;
public readonly after$: Rx.Observable<void>;

constructor(
private readonly options: {
singular?: boolean;
} = {}
) {}
) {
this.afterSubj = this.options.singular ? new Rx.ReplaySubject<void>(1) : new Rx.Subject<void>();
this.after$ = this.afterSubj.asObservable();
}

public add(fn: (...args: Args) => Promise<void> | void) {
this.handlers.push(fn);
Expand Down
4 changes: 2 additions & 2 deletions packages/osd-ui-shared-deps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@osd/i18n": "1.0.0",
"@osd/monaco": "1.0.0",
"abortcontroller-polyfill": "^1.4.0",
"axios": "^0.27.2",
"axios": "^1.6.1",
"compression-webpack-plugin": "npm:@amoo-miki/[email protected]",
"core-js": "^3.6.5",
"custom-event-polyfill": "^0.3.0",
Expand Down Expand Up @@ -51,4 +51,4 @@
"val-loader": "^2.1.2",
"webpack": "npm:@amoo-miki/[email protected]"
}
}
}
11 changes: 11 additions & 0 deletions packages/osd-ui-shared-deps/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,17 @@ exports.getWebpackConfig = ({ dev = false } = {}) => ({
},
],
},
{
test: /worker_proxy_service\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
babelrc: false,
presets: [require.resolve('@osd/babel-preset/webpack_preset')],
},
},
},
],
},

Expand Down
2 changes: 1 addition & 1 deletion packages/osd-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"load-json-file": "^6.2.0"
},
"devDependencies": {
"typescript": "4.0.2"
"typescript": "4.6.4"
}
}
2 changes: 1 addition & 1 deletion src/core/public/application/application_service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ describe('#start()', () => {
// Create an app and a promise that allows us to control when the app completes mounting
const createWaitingApp = (props: Partial<App>): [App, () => void] => {
let finishMount: () => void;
const mountPromise = new Promise((resolve) => (finishMount = resolve));
const mountPromise = new Promise<void>((resolve) => (finishMount = resolve));
const app = {
id: 'some-id',
title: 'some-title',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ describe('ApplicationService', () => {
const { register } = service.setup(setupDeps);

let resolveMount: () => void;
const promise = new Promise((resolve) => {
const promise = new Promise<void>((resolve) => {
resolveMount = resolve;
});

Expand Down Expand Up @@ -111,7 +111,7 @@ describe('ApplicationService', () => {
const { register } = service.setup(setupDeps);

let resolveMount: () => void;
const promise = new Promise((resolve) => {
const promise = new Promise<void>((resolve) => {
resolveMount = resolve;
});

Expand Down Expand Up @@ -453,7 +453,7 @@ describe('ApplicationService', () => {
const { register } = service.setup(setupDeps);

let resolveMount: () => void;
const promise = new Promise((resolve) => {
const promise = new Promise<void>((resolve) => {
resolveMount = resolve;
});

Expand Down Expand Up @@ -491,7 +491,7 @@ describe('ApplicationService', () => {
const { register } = service.setup(setupDeps);

let resolveMount: () => void;
const promise = new Promise((resolve) => {
const promise = new Promise<void>((resolve) => {
resolveMount = resolve;
});

Expand Down
2 changes: 1 addition & 1 deletion src/core/public/application/ui/app_container.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('AppContainer', () => {
});

const flushPromises = async () => {
await new Promise(async (resolve) => {
await new Promise<void>(async (resolve) => {
setImmediate(() => resolve());
});
};
Expand Down
7 changes: 5 additions & 2 deletions src/core/public/chrome/chrome_service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,12 @@ import { ChromeService } from './chrome_service';
import { getAppInfo } from '../application/utils';

class FakeApp implements App {
public title = `${this.id} App`;
public title: string;
public mount = () => () => {};
constructor(public id: string, public chromeless?: boolean) {}

constructor(public id: string, public chromeless?: boolean) {
this.title = `${this.id} App`;
}
}
const store = new Map();
const originalLocalStorage = window.localStorage;
Expand Down
2 changes: 1 addition & 1 deletion src/core/public/chrome/chrome_service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ interface ConstructorParams {
browserSupportsCsp: boolean;
}

interface StartDeps {
export interface StartDeps {
application: InternalApplicationStart;
docLinks: DocLinksStart;
http: HttpStart;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,9 @@ describe('RecentlyAccessed#start()', () => {

// @ts-expect-error to allow redeclaring a readonly prop
delete window.localStorage;
// @ts-expect-error
window.localStorage = new LocalStorageMock();
});
beforeEach(() => localStorage.clear());
// @ts-expect-error
afterAll(() => (window.localStorage = originalLocalStorage));

const getStart = async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/core/public/context/context_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { PluginOpaqueId } from '../../server';
import { IContextContainer, ContextContainer, HandlerFunction } from '../../utils/context';
import { CoreContext } from '../core_system';

interface StartDeps {
export interface StartDeps {
pluginDependencies: ReadonlyMap<PluginOpaqueId, PluginOpaqueId[]>;
}

Expand Down
Loading

0 comments on commit 0614fa2

Please sign in to comment.