Skip to content

Commit

Permalink
feat: integrate console in vscode (take 2) (#3703)
Browse files Browse the repository at this point in the history
See change needed here bc837dd

Original PR #3584

*By submitting this pull request, I confirm that my contribution is made under the terms of the [Wing Cloud Contribution License](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*.
  • Loading branch information
MarkMcCulloh authored Aug 3, 2023
1 parent 953c2f7 commit 52fdcb3
Show file tree
Hide file tree
Showing 68 changed files with 2,007 additions and 1,047 deletions.
1 change: 1 addition & 0 deletions apps/vscode-wing/.eslintrc.json

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

49 changes: 42 additions & 7 deletions apps/vscode-wing/.projen/deps.json

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

14 changes: 7 additions & 7 deletions apps/vscode-wing/.projen/tasks.json

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

75 changes: 68 additions & 7 deletions apps/vscode-wing/.projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const project = new TypeScriptAppProject({
jest: false,
github: false,
npmignoreEnabled: false,
entrypoint: "lib/index.js",
entrypoint: "lib/extension.js",
eslintOptions: {
dirs: ["src"],
prettier: true,
Expand All @@ -48,17 +48,32 @@ const project = new TypeScriptAppProject({
tsconfig: {
compilerOptions: {
noUncheckedIndexedAccess: true,
lib: ["es2021"],
},
},

deps: [
deps: [],
devDeps: [
`@types/vscode@^${VSCODE_BASE_VERSION}`,
"vscode-languageclient",
"which",
"@trpc/client",
"ws",
"open",
"node-fetch@2",
"@types/node",
"@types/which",
"@vscode/vsce",
"@types/node-fetch",
"@types/ws",
"@wingconsole/app@workspace:^",
"@wingconsole/server@workspace:^",
],
devDeps: ["@types/node", "@types/which", "esbuild", "@vscode/vsce"],
});

// because we're bundling, allow dev deps in src
project.eslint?.allowDevDeps("src/**");

project.addGitIgnore("*.vsix");

const vscodeIgnore = new IgnoreFile(project, ".vscodeignore");
Expand Down Expand Up @@ -122,6 +137,26 @@ const contributes: VSCodeExtensionContributions = {
dark: "resources/icon-dark.png",
},
},
{
command: "wingConsole.openResource",
title: "Open resource",
},
{
command: "wingConsole.runTest",
title: "Run test",
icon: {
light: "resources/play-light.svg",
dark: "resources/play-dark.svg",
},
},
{
command: "wingConsole.runAllTests",
title: "Run all tests",
icon: {
light: "resources/play-all-light.svg",
dark: "resources/play-all-dark.svg",
},
},
],
menus: {
"editor/title": [
Expand All @@ -136,6 +171,20 @@ const contributes: VSCodeExtensionContributions = {
group: "navigation",
},
],
"view/item/context": [
{
command: "wingConsole.runTest",
when: "view == consoleTestsExplorer",
group: "inline",
},
],
"explorer/context": [
{
command: "wingConsole.runAllTests",
when: "view == consoleTestsExplorer",
group: "inline",
},
],
},
configuration: [
{
Expand All @@ -150,6 +199,18 @@ const contributes: VSCodeExtensionContributions = {
},
},
],
views: {
explorer: [
{
id: "consoleExplorer",
name: "Wing Resources",
},
{
id: "consoleTestsExplorer",
name: "Wing Tests",
},
],
},
};

project.addFields({
Expand All @@ -166,11 +227,11 @@ project.addFields({
contributes,
});

const esbuildComment =
"esbuild src/extension.ts --outfile=lib/index.js --external:node-gyp --external:vscode --format=cjs --platform=node --bundle";
project.addDevDeps("tsup");

project.compileTask.reset();
project.compileTask.exec(esbuildComment);
project.watchTask.reset(`${esbuildComment} --watch`);
project.compileTask.exec("tsup");
project.watchTask.reset("tsup --watch");

project.packageTask.reset(
"pnpm version ${PROJEN_BUMP_VERSION:-0.0.0} --allow-same-version"
Expand Down
Loading

0 comments on commit 52fdcb3

Please sign in to comment.