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

feat: add "Install Hermione" action #1

Merged
merged 2 commits into from
Mar 27, 2024

Conversation

DudaGod
Copy link
Member

@DudaGod DudaGod commented Feb 15, 2024

Add new vscode extension with ability to Install Hermione and set keybinding to send code to terminal in REPL mode.

Its first base implementation in near future this plugin will be improved significantly.

@DudaGod DudaGod force-pushed the HERMIONE-1383.install-hermione branch from 3b5391d to f6e5182 Compare February 16, 2024 08:42
@@ -0,0 +1,4 @@
vscode.d.ts
vscode.proposed.d.ts
out
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The result of the build extension is added to this folder - out

@@ -0,0 +1,18 @@
module.exports = {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use from hermione

contact_links:
- name: File an issue
url: https://github.com/gemini-testing/hermione/issues
about: We track issues in the gemini-testing/hermione repository
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to handle all issues in our hermione repository

out/
node_modules
.vscode-test/
*.vsix
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bundled file which should be published as vscode extension

.nvmrc Outdated
@@ -0,0 +1 @@
20
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With lower version I was unable to run the build

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?
Will i be able to use this extension in my node@18 project?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. It's only for development.
But looks like it was strange bug and know I can use node@18.

"keybindings": {
"command": "workbench.action.terminal.runSelectedText",
"key": "ctrl+shift+8",
"mac": "cmd+shift+8",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should use some another keybinding which is more comfortable to press

},
"license": "MIT",
"scripts": {
"vscode:prepublish": "npm run esbuild-base -- --minify",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used by vscode

import * as vscode from "vscode";

export function activate(context: vscode.ExtensionContext): void {
const disposable = vscode.commands.registerCommand("hrm.install", async () => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

describe command the install hermione in user folder

const disposable = vscode.commands.registerCommand("hrm.install", async () => {
const [workspaceFolder] = vscode.workspace.workspaceFolders || [];
if (!workspaceFolder) {
await vscode.window.showErrorMessage("Open a folder in VS Code to initialize Hermione");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

workspace folder must exists


terminal.show();

terminal.sendText(`npm init hermione-app -- --yes`, true);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run hermione-app without any questions

@DudaGod DudaGod force-pushed the HERMIONE-1383.install-hermione branch from f6e5182 to b4093dd Compare February 16, 2024 09:18
Copy link
Member

@KuznetsovRoman KuznetsovRoman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise /ok

.nvmrc Outdated
@@ -0,0 +1 @@
20
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?
Will i be able to use this extension in my node@18 project?

@@ -0,0 +1,7 @@
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this for?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's recommended extensions which user can install with main extension. It was installed by default when create default vscode project. I just add connor4312.esbuild-problem-matchers because I had some problems with correct build extension. Currently everything build without any problems so I just delete it.

"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"${workspaceFolder}/../examples/test-project"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not ${workspaceFolder}/examples/test-project? I think its more convenient to have examples folder inside of our project (while it still being included in .gitignore and such)

README.md Outdated

## Using the REPL mode

Adds a keybinding (`cmd+shift+8` for mac and `ctrl+shift+8` for others) to run a dedicated section of code in the VSCode terminal. More infor about [REPL mode][hermione-repl-mode]. You can overwrite this keybinding in [keyboard shortcuts][vscode-keyboard-shortcuts].
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: "More infor" -> "More info"

package.json Outdated
"Testing"
],
"activationEvents": [
"workspaceContains:**/.hermione.conf.{ts,js}",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should remove this event, because ** matches node_modules, and we don't want this extension to search all over node_modules. Especially considering:

  • node_modules/.bin/hermione is enough
  • hermione config file could potentially be named in a different way

@DudaGod DudaGod force-pushed the HERMIONE-1383.install-hermione branch from b4093dd to 51ff077 Compare March 27, 2024 21:29
@DudaGod DudaGod force-pushed the HERMIONE-1383.install-hermione branch from 51ff077 to da5138a Compare March 27, 2024 21:37
@DudaGod DudaGod merged commit fccef98 into master Mar 27, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants