Skip to content

chore: update dependencies #153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10,367 changes: 6,037 additions & 4,330 deletions package-lock.json

Large diffs are not rendered by default.

60 changes: 30 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"packages/vscode-js-profile-table"
],
"scripts": {
"clean": "rimraf \"packages/*/out\"",
"clean": "rimraf -g \"packages/*/out\"",
"compile": "npm run clean && npm run compile:core && concurrently \"npm:compile:table\" \"npm:compile:flame\"",
"compile:core": "npm run -w vscode-js-profile-core compile",
"compile:table": "npm run -w vscode-js-profile-table compile",
Expand All @@ -21,7 +21,7 @@
"test": "concurrently \"npm:test:*\"",
"test:lint": "eslint \"packages/**/*.{ts,tsx}\"",
"test:fmt": "prettier --list-different \"packages/**/*.{ts,tsx,css}\" \"!**/out/**\"",
"test:unit": "vitest",
"test:unit": "vitest run",
"vscode:prepublish": "npm run compile"
},
"prettier": {
Expand All @@ -32,44 +32,44 @@
"tabWidth": 2
},
"devDependencies": {
"@types/chai": "^4.3.1",
"@types/glob": "^7.2.0",
"@types/node": "^17.0.35",
"@types/vscode": "^1.67.0",
"@typescript-eslint/eslint-plugin": "^5.25.0",
"@typescript-eslint/parser": "^5.25.0",
"autoprefixer": "^10.4.7",
"@types/chai": "^4.3.10",
"@types/glob": "^8.1.0",
"@types/node": "^20.9.0",
"@types/vscode": "^1.84.1",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser": "^6.10.0",
"autoprefixer": "^10.4.16",
"chokidar-cli": "^3.0.0",
"concurrently": "^7.2.0",
"cpy-cli": "^4.1.0",
"concurrently": "^8.2.2",
"cpy-cli": "^5.0.0",
"cross-env": "^7.0.3",
"css-loader": "^6.7.1",
"cssnano": "^5.1.8",
"devtools-protocol": "0.0.1005172",
"eslint": "^8.15.0",
"css-loader": "^6.8.1",
"cssnano": "^6.0.1",
"devtools-protocol": "0.0.1222075",
"eslint": "^8.53.0",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-react": "^7.30.0",
"glob": "^8.0.3",
"html-webpack-plugin": "^5.5.0",
"eslint-plugin-react": "^7.33.2",
"glob": "^10.3.10",
"html-webpack-plugin": "^5.5.3",
"os-browserify": "^0.3.0",
"path-browserify": "^1.0.1",
"postcss-loader": "^7.0.0",
"preact": "^10.7.2",
"prettier": "^2.6.2",
"postcss-loader": "^7.3.3",
"preact": "^10.18.2",
"prettier": "^3.0.3",
"raw-loader": "^4.0.2",
"rimraf": "^3.0.2",
"source-map-loader": "^3.0.1",
"rimraf": "^5.0.5",
"source-map-loader": "^4.0.1",
"source-map-support": "^0.5.21",
"style-loader": "^3.3.1",
"style-loader": "^3.3.3",
"svg-inline-loader": "^0.8.2",
"ts-loader": "^9.3.0",
"typescript": "^4.6.4",
"vitest": "^0.12.6",
"ts-loader": "^9.5.0",
"typescript": "^5.2.2",
"vitest": "^0.34.6",
"vscode-debugprotocol": "^1.39.0",
"vscode-test": "^1.3.0",
"webpack": "^5.72.1",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.9.0"
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1"
},
"dependencies": {
"preact-virtual-list": "^0.3.1"
Expand Down
6 changes: 1 addition & 5 deletions packages/vscode-js-profile-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
"watch:css": "npm run compile:css && chokidar \"src/**/*.css\" -c \"cpy --parents --cwd=src '**/*.css' ../out/esm\""
},
"dependencies": {
"@vscode/codicons": "^0.0.30",
"isomorphic-unfetch": "^3.1.0"
},
"devDependencies": {
"@types/node-fetch": "^2.6.1"
"@vscode/codicons": "^0.0.35"
}
}
105 changes: 51 additions & 54 deletions packages/vscode-js-profile-core/src/client/rich-filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as CaseSensitive from '@vscode/codicons/src/icons/case-sensitive.svg';
import * as Regex from '@vscode/codicons/src/icons/regex.svg';
import { ComponentChild, Fragment, FunctionComponent, h } from 'preact';
import { useEffect, useState } from 'preact/hooks';
import { evaluate, IDataSource, IQueryResults } from '../ql';
import { IDataSource, IQueryResults, evaluate } from '../ql';
import { Filter } from './filter';
import styles from './rich-filter.css';
import { ToggleButton } from './toggle-button';
Expand Down Expand Up @@ -45,58 +45,55 @@ export type RichFilterComponent<T> = FunctionComponent<{
foot?: ComponentChild;
}>;

export const richFilter = <T extends {}>(): RichFilterComponent<T> => ({
placeholder,
data,
onChange,
foot,
}) => {
const [regex, setRegex] = useState(false);
const [caseSensitive, setCaseSensitive] = useState(false);
const [text, setText] = usePersistedState('filterText', '');
const [error, setError] = useState<string | undefined>(undefined);
export const richFilter =
<T,>(): RichFilterComponent<T> =>
({ placeholder, data, onChange, foot }) => {
const [regex, setRegex] = useState(false);
const [caseSensitive, setCaseSensitive] = useState(false);
const [text, setText] = usePersistedState('filterText', '');
const [error, setError] = useState<string | undefined>(undefined);

useEffect(() => {
try {
onChange(
evaluate({
input: text,
regex,
caseSensitive,
datasource: data,
}),
);
setError(undefined);
} catch (e) {
setError((e as Error).message);
}
}, [regex, caseSensitive, text, data]);
useEffect(() => {
try {
onChange(
evaluate({
input: text,
regex,
caseSensitive,
datasource: data,
}),
);
setError(undefined);
} catch (e) {
setError((e as Error).message);
}
}, [regex, caseSensitive, text, data]);

return (
<div className={styles.f}>
<Filter
value={text}
placeholder={placeholder}
onChange={setText}
foot={
<Fragment>
<ToggleButton
icon={CaseSensitive}
label="Match Case"
checked={caseSensitive}
onChange={setCaseSensitive}
/>
<ToggleButton
icon={Regex}
label="Use Regular Expression"
checked={regex}
onChange={setRegex}
/>
</Fragment>
}
/>
{error && <div className={styles.error}>{error}</div>}
{foot}
</div>
);
};
return (
<div className={styles.f}>
<Filter
value={text}
placeholder={placeholder}
onChange={setText}
foot={
<Fragment>
<ToggleButton
icon={CaseSensitive}
label="Match Case"
checked={caseSensitive}
onChange={setCaseSensitive}
/>
<ToggleButton
icon={Regex}
label="Use Regular Expression"
checked={regex}
onChange={setRegex}
/>
</Fragment>
}
/>
{error && <div className={styles.error}>{error}</div>}
{foot}
</div>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { IVscodeApi, VsCodeApi } from './vscodeApi';
/**
* Like useState, but also persists changes to the VS Code webview API.
*/
export const usePersistedState = <T extends unknown>(key: string, defaultValue: T) => {
export const usePersistedState = <T,>(key: string, defaultValue: T) => {
const vscode = useContext(VsCodeApi) as IVscodeApi<{ [key: string]: T }>;
const [value, setValue] = useState(vscode.getState()?.[key] ?? defaultValue);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Vitest Snapshot v1
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`model > models #0 1`] = `
{
Expand Down
5 changes: 4 additions & 1 deletion packages/vscode-js-profile-core/src/cpu/bottomUpGraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ export class BottomUpNode implements IGraphNode {
return this.location.category;
}

constructor(public readonly location: ILocation, public readonly parent?: BottomUpNode) {}
constructor(
public readonly location: ILocation,
public readonly parent?: BottomUpNode,
) {}

public addNode(node: IComputedNode) {
this.selfTime += node.selfTime;
Expand Down
3 changes: 2 additions & 1 deletion packages/vscode-js-profile-core/src/cpu/editorProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import { buildModel, IProfileModel } from './model';
import { ICpuProfileRaw } from './types';

export class CpuProfileEditorProvider
implements vscode.CustomEditorProvider<ReadonlyCustomDocument<IProfileModel>> {
implements vscode.CustomEditorProvider<ReadonlyCustomDocument<IProfileModel>>
{
public readonly onDidChangeCustomDocument = new vscode.EventEmitter<never>().event;

constructor(
Expand Down
4 changes: 2 additions & 2 deletions packages/vscode-js-profile-core/src/cpu/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*--------------------------------------------------------*/
import { ComponentType, Fragment, FunctionComponent, h } from 'preact';
import { useMemo, useState } from 'preact/hooks';
import { richFilter, RichFilterComponent } from '../client/rich-filter';
import { RichFilterComponent, richFilter } from '../client/rich-filter';
import styles from '../common/layout.css';
import { IDataSource, IQueryResults } from '../ql';

Expand All @@ -20,7 +20,7 @@ type CpuProfileLayoutComponent<T> = FunctionComponent<{
/**
* Base layout component to display CPU-profile related info.
*/
export const cpuProfileLayoutFactory = <T extends {}>(): CpuProfileLayoutComponent<T> => {
export const cpuProfileLayoutFactory = <T,>(): CpuProfileLayoutComponent<T> => {
const CpuProfileLayout: CpuProfileLayoutComponent<T> = ({
data,
body: RowBody,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*--------------------------------------------------------*/

import * as vscode from 'vscode';
import fetch from 'isomorphic-unfetch';

/**
* Downloads and displays remote content that the visualizer asks for.
Expand Down
3 changes: 2 additions & 1 deletion packages/vscode-js-profile-core/src/heap/editorProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import { buildModel, IHeapProfileRaw, IProfileModel, ITreeNode } from './model';
import { createTree } from './tree';

export class HeapProfileEditorProvider
implements vscode.CustomEditorProvider<ReadonlyCustomDocument<IProfileModel>> {
implements vscode.CustomEditorProvider<ReadonlyCustomDocument<IProfileModel>>
{
public readonly onDidChangeCustomDocument = new vscode.EventEmitter<never>().event;

constructor(
Expand Down
4 changes: 2 additions & 2 deletions packages/vscode-js-profile-core/src/heap/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*--------------------------------------------------------*/
import { ComponentType, Fragment, FunctionComponent, h } from 'preact';
import { useMemo, useState } from 'preact/hooks';
import { richFilter, RichFilterComponent } from '../client/rich-filter';
import { RichFilterComponent, richFilter } from '../client/rich-filter';
import styles from '../common/layout.css';
import { IDataSource, IQueryResults } from '../ql';

Expand All @@ -20,7 +20,7 @@ type HeapProfileLayoutComponent<T> = FunctionComponent<{
/**
* Base layout component to display heap-profile related info.
*/
export const heapProfileLayoutFactory = <T extends {}>(): HeapProfileLayoutComponent<T> => {
export const heapProfileLayoutFactory = <T,>(): HeapProfileLayoutComponent<T> => {
const HeapProfileLayout: HeapProfileLayoutComponent<T> = ({
data,
body: RowBody,
Expand Down
5 changes: 4 additions & 1 deletion packages/vscode-js-profile-core/src/heap/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ export class TreeNode implements ITreeNode {
return this.node.src;
}

constructor(public readonly node: IProfileModelNode, public readonly parent?: TreeNode) {
constructor(
public readonly node: IProfileModelNode,
public readonly parent?: TreeNode,
) {
this.category = categorize(node.callFrame, undefined);
}

Expand Down
5 changes: 4 additions & 1 deletion packages/vscode-js-profile-core/src/ql/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import { IQuery, PropertyType } from '.';
import { operators } from './operators';

export class ParseError extends Error {
constructor(message: string, public readonly index: number) {
constructor(
message: string,
public readonly index: number,
) {
super(message);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
import { CustomDocument, Uri } from 'vscode';

export class ReadonlyCustomDocument<TData> implements CustomDocument {
constructor(public readonly uri: Uri, public readonly userData: TData) {}
constructor(
public readonly uri: Uri,
public readonly userData: TData,
) {}

/**
* @inheritdoc
Expand Down
4 changes: 2 additions & 2 deletions packages/vscode-js-profile-flame/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,11 @@
"url": "https://github.com/microsoft/vscode-js-profile-visualizer/issues"
},
"devDependencies": {
"@types/chroma-js": "^2.1.3",
"@types/chroma-js": "^2.4.3",
"@types/resize-observer-browser": "^0.1.7"
},
"dependencies": {
"@vscode/codicons": "^0.0.30",
"@vscode/codicons": "^0.0.35",
"chroma-js": "^2.4.2",
"vscode-js-profile-core": "*",
"vscode-webview-tools": "^0.1.1"
Expand Down
Loading