Skip to content
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

🌱 Refactor shared package imports #100

Merged
merged 1 commit into from
Nov 15, 2024
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
8 changes: 1 addition & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 15 additions & 15 deletions shared/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "@editor-extensions/shared",
"version": "1.0.0",
"private": true,
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"build": "tsc -b tsconfig.json",
"clean": "rimraf dist",
"prebuild": "npm run clean"
},
"devDependencies": {
"rimraf": "^5.0.0",
"typescript": "^5.0.0"
}
}
"name": "@editor-extensions/shared",
"version": "0.0.1",
"private": true,
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"build": "tsc -b tsconfig.json",
"clean": "rimraf dist",
"prebuild": "npm run clean"
},
"devDependencies": {
"rimraf": "^5.0.0",
"typescript": "^5.0.0"
}
}
3 changes: 1 addition & 2 deletions vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,7 @@
"webpack-cli": "^5.1.4"
},
"dependencies": {
"@shared/types": "^1.0.0",
"babel-loader": "^9.2.1",
"diff": "^7.0.0"
}
}
}
2 changes: 1 addition & 1 deletion vscode/src/client/analyzerClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ChildProcessWithoutNullStreams, exec, spawn } from "child_process";
import * as vscode from "vscode";
import * as os from "os";
import * as fs from "fs";
import { Incident, RuleSet } from "@shared/types";
import { Incident, RuleSet } from "@editor-extensions/shared";

import path from "path";

Expand Down
2 changes: 1 addition & 1 deletion vscode/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
loadSolution,
loadStaticResults,
} from "./data";
import { GetSolutionResult, RuleSet } from "@shared/types";
import { GetSolutionResult, RuleSet } from "@editor-extensions/shared";
import {
applyAll,
revertAll,
Expand Down
2 changes: 1 addition & 1 deletion vscode/src/data/analyzerResults.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as vscode from "vscode";
import * as fs from "fs";
import * as yaml from "js-yaml";
import { RuleSet, Category, Incident } from "@shared/types";
import { RuleSet, Category, Incident } from "@editor-extensions/shared";

//Assuming that output is in form of yaml
export function readYamlFile(filePath: string): RuleSet[] | undefined {
Expand Down
2 changes: 1 addition & 1 deletion vscode/src/data/loadResults.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GetSolutionResult, RuleSet } from "@shared/types";
import { GetSolutionResult, RuleSet } from "@editor-extensions/shared";
import { processIncidents } from "./analyzerResults";
import { ExtensionState } from "src/extensionState";
import { writeDataFile } from "./storage";
Expand Down
2 changes: 1 addition & 1 deletion vscode/src/data/loadStaticResults.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as vscode from "vscode";
import { RuleSet } from "@shared/types";
import { RuleSet } from "@editor-extensions/shared";
import { loadStateFromDataFolder, readDataFiles } from "./storage";

export const loadStaticResults = async () => {
Expand Down
2 changes: 1 addition & 1 deletion vscode/src/data/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import path from "path";
import * as vscode from "vscode";
import fs from "fs";

import { RuleSet, GetSolutionResult } from "@shared/types";
import { RuleSet, GetSolutionResult } from "@editor-extensions/shared";
import {
isAnalysis,
isSolution,
Expand Down
2 changes: 1 addition & 1 deletion vscode/src/data/virtualStorage.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GetSolutionResult } from "@shared/types";
import { GetSolutionResult } from "@editor-extensions/shared";
import { Uri, window, workspace } from "vscode";
import { ExtensionState } from "src/extensionState";
import * as Diff from "diff";
Expand Down
2 changes: 1 addition & 1 deletion vscode/src/extensionState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { MemFS } from "./data/fileSystemProvider";
import { KonveyorGUIWebviewViewProvider } from "./KonveyorGUIWebviewViewProvider";
import * as vscode from "vscode";
import { LocalChange } from "./data/virtualStorage";
import { RuleSet } from "@shared/types";
import { RuleSet } from "@editor-extensions/shared";

export class SharedState {
private state: Map<string, any> = new Map();
Expand Down
2 changes: 1 addition & 1 deletion vscode/src/test/analyzerResults.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as assert from "assert";
import { DiagnosticSeverity } from "vscode";
import * as path from "path";
import { processIncidents, readYamlFile } from "../data/analyzerResults";
import { RuleSet } from "@shared/types";
import { RuleSet } from "@editor-extensions/shared";

suite("Extension Test Suite", () => {
test("processIncidents should populate diagnostics correctly", () => {
Expand Down
2 changes: 1 addition & 1 deletion vscode/src/utilities/typeGuards.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GetSolutionResult, RuleSet } from "@shared/types";
import { GetSolutionResult, RuleSet } from "@editor-extensions/shared";
import { Uri } from "vscode";

const isString = (obj: unknown): obj is string => typeof obj === "string";
Expand Down
5 changes: 2 additions & 3 deletions webview-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"@patternfly/react-core": "6.0.0-prerelease.15",
"@patternfly/react-icons": "^5.4.0",
"@patternfly/react-table": "^5.4.1",
"vscode-webview": "^1.0.1-beta.1",
"@shared/types": "^1.0.0"
"vscode-webview": "^1.0.1-beta.1"
},
"devDependencies": {
"@types/vscode-webview": "^1.57.5",
Expand All @@ -25,4 +24,4 @@
"optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "4.9.5"
}
}
}
2 changes: 1 addition & 1 deletion webview-ui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { vscode } from "./utils/vscode";
import GuidedApproachWizard from "./components/GuidedApproachWizard";
import ProgressIndicator from "./components/ProgressIndicator";
import ViolationIncidentsList from "./components/ViolationIncidentsList";
import { Incident, RuleSet } from "@shared/types";
import { Incident, RuleSet } from "@editor-extensions/shared";

const App: React.FC = () => {
const [analysisResults, setAnalysisResults] = useState<RuleSet[] | null>();
Expand Down
2 changes: 1 addition & 1 deletion webview-ui/src/components/GuidedApproachWizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
} from "@patternfly/react-core";
import ViolationIncidentsList from "./ViolationIncidentsList";
import { vscode } from "../utils/vscode";
import { Incident, Violation } from "@shared/types/src/types";
import { Incident, Violation } from "@editor-extensions/shared/src/types";

interface GuidedApproachWizardProps {
violations: Violation[];
Expand Down
2 changes: 1 addition & 1 deletion webview-ui/src/components/ViolationIncidentsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
FileIcon,
EllipsisVIcon,
} from "@patternfly/react-icons";
import { Incident, Violation } from "@shared/types";
import { Incident, Violation } from "@editor-extensions/shared";

type SortOption = "description" | "incidentCount" | "severity";

Expand Down
Loading