Selaa lähdekoodia

Update README

cte 11 kuukautta sitten
vanhempi
sitoutus
5b6c6be022
3 muutettua tiedostoa jossa 13 lisäystä ja 9 poistoa
  1. 7 1
      README.md
  2. 1 1
      package.json
  3. 5 7
      src/core/webview/ClineProvider.ts

+ 7 - 1
README.md

@@ -255,9 +255,15 @@ Roo Code is available on:
     ```bash
     code --install-extension bin/roo-code-4.0.0.vsix
     ```
-5. **Debug**:
+5. **Start the webview (Vite/React app with HMR)**:
+    ```bash
+    npm run dev
+    ```
+6. **Debug**:
     - Press `F5` (or **Run** → **Start Debugging**) in VSCode to open a new session with Roo Code loaded.
 
+Changes to the webview will appear immediately. Changes to the core extension will require a restart of the extension host.
+
 We use [changesets](https://github.com/changesets/changesets) for versioning and publishing. Check our `CHANGELOG.md` for release notes.
 
 ---

+ 1 - 1
package.json

@@ -227,7 +227,7 @@
 		"lint": "eslint src --ext ts && npm run lint --prefix webview-ui",
 		"package": "npm run build:webview && npm run check-types && npm run lint && node esbuild.js --production",
 		"pretest": "npm run compile-tests && npm run compile && npm run lint",
-		"start:webview": "cd webview-ui && npm run start",
+		"dev": "cd webview-ui && npm run dev",
 		"test": "jest && npm run test:webview",
 		"test:webview": "cd webview-ui && npm run test",
 		"test:extension": "vscode-test",

+ 5 - 7
src/core/webview/ClineProvider.ts

@@ -281,9 +281,9 @@ export class ClineProvider implements vscode.WebviewViewProvider {
 		}
 
 		webviewView.webview.html =
-			this.context.extensionMode === vscode.ExtensionMode.Production
-				? this.getHtmlContent(webviewView.webview)
-				: this.getHMRHtmlContent(webviewView.webview)
+			this.context.extensionMode === vscode.ExtensionMode.Development
+				? this.getHMRHtmlContent(webviewView.webview)
+				: this.getHtmlContent(webviewView.webview)
 
 		// Sets up an event listener to listen for messages passed from the webview view context
 		// and executes code based on the message that is recieved
@@ -424,10 +424,8 @@ export class ClineProvider implements vscode.WebviewViewProvider {
 		const localServerUrl = `localhost:${localPort}`
 		const scriptUri = `http://${localServerUrl}/${file}`
 
-		const reactRefreshHash = "sha256-YmMpkm5ow6h+lfI3ZRp0uys+EUCt6FOyLkJERkfVnTY="
-
 		const reactRefresh = /*html*/ `
-			<script sha256="${reactRefreshHash}" nonce="${nonce}" type="module">
+			<script nonce="${nonce}" type="module">
 				import RefreshRuntime from "http://localhost:${localPort}/@react-refresh"
 				RefreshRuntime.injectIntoGlobalHook(window)
 				window.$RefreshReg$ = () => {}
@@ -441,7 +439,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
 			`font-src ${webview.cspSource}`,
 			`style-src ${webview.cspSource} 'unsafe-inline' https://* http://${localServerUrl} http://0.0.0.0:${localPort}`,
 			`img-src ${webview.cspSource} data:`,
-			`script-src 'unsafe-eval' https://* http://${localServerUrl} http://0.0.0.0:${localPort} '${reactRefreshHash}' 'nonce-${nonce}'`,
+			`script-src 'unsafe-eval' https://* http://${localServerUrl} http://0.0.0.0:${localPort} 'nonce-${nonce}'`,
 			`connect-src https://* ws://${localServerUrl} ws://0.0.0.0:${localPort} http://${localServerUrl} http://0.0.0.0:${localPort}`,
 		]