Conversation
… and dependencies
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a VS Code extension framework alongside backend tweaks to support a Vue-based UI, enhance logging, and enable cross‐origin requests.
- Backend: Configures console logging format, bumps development log level to Debug, adds a CORS policy for the Vue app, and inserts a debug log in
PackageController. - Extension scaffold: Sets up a Vite + Vue build, defines TypeScript types, implements a webview with
PackageManager.vue,PackageDetails.vue, and a reusableListBox.vue. - Tooling & docs: Adds
tsconfig.json, ESLint rules, VS Code tasks/launch configs, a placeholder README, and the extension manifest.
Reviewed Changes
Copilot reviewed 26 out of 29 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/ParadoxPM.Server/appsettings.json | Added JSON console logger configuration |
| src/ParadoxPM.Server/appsettings.Development.json | Changed default log level from Information to Debug |
| src/ParadoxPM.Server/Program.cs | Registered CORS policy "AllowVueApp" and applied it |
| src/ParadoxPM.Server/Controllers/PackageController.cs | Inserted a debug log for incoming package requests |
| src/ParadoxPM.Extension/vite.config.ts | Configured Vite plugins for Vue and VSCode extension |
| src/ParadoxPM.Extension/tsconfig.json | Established TypeScript compiler settings |
| src/ParadoxPM.Extension/src/types/packageInfo.ts | Introduced PackageInfo, Version, Dependency |
| src/ParadoxPM.Extension/src/types/apiResponse.ts | Introduced generic ApiResponse<T> |
| src/ParadoxPM.Extension/src/html/packageManager.html | Added HTML template for the webview |
| src/ParadoxPM.Extension/src/entry/packageManager.ts | Mounts Vue app to the webview container |
| src/ParadoxPM.Extension/src/components/PackageManager.vue | Implements the main package-list UI |
| src/ParadoxPM.Extension/src/components/PackageDetails.vue | Implements the package-detail UI |
| src/ParadoxPM.Extension/src/components/ListBox.vue | Provides a generic list box with tooltip support |
| src/ParadoxPM.Extension/package.json | Defines the VSCode extension manifest |
| src/ParadoxPM.Extension/extension/packagesManagerViewProvider.ts | Registers the packages-manager view provider |
| src/ParadoxPM.Extension/extension/extension.ts | Activates the extension |
| src/ParadoxPM.Extension/extension/WebviewHelpers.ts | Supplies HTML for the webview |
| src/ParadoxPM.Extension/eslint.config.mjs | Adds ESLint plugin/parser rules for TypeScript |
| src/ParadoxPM.Extension/README.md | Placeholder README for the extension |
| src/ParadoxPM.Extension/.vscodeignore | Specifies files to exclude in the packaged extension |
| src/ParadoxPM.Extension/.vscode/tasks.json | Defines dev/build tasks |
| src/ParadoxPM.Extension/.vscode/settings.json | Workspace settings overrides |
| src/ParadoxPM.Extension/.vscode/launch.json | Debug configurations for extension development |
| src/ParadoxPM.Extension/.vscode/extensions.json | Recommends VSCode extensions for editing |
| src/ParadoxPM.Extension/.npmrc | Enables pre/post npm scripts |
| src/ParadoxPM.Extension/.gitignore | Ignores dist/ builds |
Comments suppressed due to low confidence (5)
src/ParadoxPM.Extension/src/html/packageManager.html:8
- [nitpick] The page title "Traits" is misleading for a package manager view; consider updating it to something like "Package Manager".
<title>Traits</title>
src/ParadoxPM.Extension/package.json:20
- No activation events are specified, so the webview view provider may not be activated; add an entry like
"onView:packages-manager"to ensure the extension loads when the view is opened.
"activationEvents": [],
src/ParadoxPM.Extension/extension/extension.ts:5
- [nitpick] The log message reference "ParadoxPM-Server" does not match the extension's display name
ParadoxPM; update the string to avoid confusion.
console.log('Congratulations, your extension "ParadoxPM-Server" is now active!');
src/ParadoxPM.Extension/extension/WebviewHelpers.ts:6
getHtmlusesVITE_DEV_SERVER_URLwithout fallback for production builds; consider adding logic to load local asset HTML when the development server URL is undefined.
serverUrl: `${process.env.VITE_DEV_SERVER_URL}src/html/${input}.html`,
src/ParadoxPM.Extension/README.md:1
- README contains placeholder template content; update it to include actual project description, features, and usage instructions.
# ParadoxPM-Server README
| [HttpGet("query/{packageId:int}/meta")] | ||
| public async Task<ActionResult<ApiResponse<Package>>> GetPackage(int packageId) | ||
| { | ||
| _logger.ZLogDebug($"ip: {HttpContext.Connection.RemoteIpAddress} 请求获取所有包"); |
There was a problem hiding this comment.
The debug log message says "请求获取所有包" (fetch all packages), but this endpoint returns a single package by ID; update the message to reflect the correct action.
| _logger.ZLogDebug($"ip: {HttpContext.Connection.RemoteIpAddress} 请求获取所有包"); | |
| _logger.ZLogDebug($"ip: {HttpContext.Connection.RemoteIpAddress} 请求获取指定的包, Id: {packageId}"); |
| <div class="container"> | ||
| <div class="left-panel"> | ||
| <div class="search-header"> | ||
| <vscode-textfield class="search-box" placeholder="搜索包..." v-model="searchKeyword" @input="fetchPackages"> |
There was a problem hiding this comment.
Calling fetchPackages on every input event may trigger excessive API requests; consider debouncing the input handler.
| import { ref } from 'vue'; | ||
| import type { PackageInfo } from '../types/packageInfo'; | ||
|
|
||
| const selectedIndex = ref(0); | ||
|
|
||
| defineProps<{ | ||
| package: PackageInfo | null | ||
| }>() | ||
|
|
There was a problem hiding this comment.
When the package prop changes, selectedIndex is not reset to 0, which can cause outdated or invalid version selections; add a watcher to reset selectedIndex when package updates.
| import { ref } from 'vue'; | |
| import type { PackageInfo } from '../types/packageInfo'; | |
| const selectedIndex = ref(0); | |
| defineProps<{ | |
| package: PackageInfo | null | |
| }>() | |
| import { ref, watch } from 'vue'; | |
| import type { PackageInfo } from '../types/packageInfo'; | |
| const selectedIndex = ref(0); | |
| defineProps<{ | |
| package: PackageInfo | null | |
| }>(); | |
| watch(() => package, () => { | |
| selectedIndex.value = 0; | |
| }); |
| import typescriptEslint from "@typescript-eslint/eslint-plugin"; | ||
| import tsParser from "@typescript-eslint/parser"; | ||
|
|
||
| export default [{ |
There was a problem hiding this comment.
ESLint configuration targets only .ts files; consider adding rules or overrides for .vue files to ensure consistent linting across components.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.