Skip to content

Commit

Permalink
feat(vscode): preview of Robot Framework Notebook support for VSCode
Browse files Browse the repository at this point in the history
  • Loading branch information
d-biehl committed Dec 5, 2024
1 parent 170287d commit 9185ccd
Show file tree
Hide file tree
Showing 67 changed files with 5,412 additions and 1,299 deletions.
39 changes: 34 additions & 5 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,31 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Node Process",
"port": 9229,
"request": "attach",
"skipFiles": [
"<node_internals>/**"
],
"type": "node",
"autoAttachChildProcesses": true
},


{
"name": "esbuild.mjs",
"program": "${workspaceFolder}/esbuild.mjs",
"request": "launch",
"skipFiles": [
"<node_internals>/**"
],
"type": "node",
"console": "integratedTerminal",
"runtimeArgs": [
"--experimental-modules"
]
},
{
"name": "Python: Debug in terminal",
"type": "debugpy",
Expand Down Expand Up @@ -53,9 +78,10 @@
// "suites",
// // "discover", "tests", "--tags"
// "."
// "discover",
// "files",
// ".."
"discover",
"--no-diagnostics",
"all",
".."
// "config",
// "show",
// "discover",
Expand All @@ -66,9 +92,10 @@
// "E:\\source\\uvtestprj\\tests\\first.robotrepl"
// "analyze",
// "code",
"--help"
// "--help"
// "tests"
//"repl",
// "repl-server",
// "package.json"
// "-v",
// "asd:asd"

Expand Down Expand Up @@ -185,6 +212,8 @@
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
],
"debugWebviews": true,
"debugWebWorkerHost": true,
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
Expand Down
2 changes: 1 addition & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pyproject.toml
**/playground/

# svg files
**/*.svg
#**/*.svg

# coverage
.coverage
Expand Down
83 changes: 83 additions & 0 deletions esbuild.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import * as esbuild from "esbuild";
import * as process from "process";
import { typecheckPlugin } from "@jgoz/esbuild-plugin-typecheck";
/**
* @type {import('esbuild').LogLevel}
*/
const LOG_LEVEL = "error";

/**
* @type {boolean}
*/
const production = process.argv.includes("--production");

/**
* @type {import('esbuild').BuildOptions[]}
*/
const projects = [
{
entryPoints: ["./vscode-client/extension"],
format: "cjs",
platform: "node",
outfile: "out/extension.js",
external: ["vscode"],
},
{
entryPoints: ["./vscode-client/rendererHtml"],
format: "esm",
platform: "browser",
outfile: "out/rendererHtml.js",
external: ["vscode"],
loader: {
".jstemp": "text",
".csstemp": "text",
},
},
{
entryPoints: ["./vscode-client/rendererLog"],
format: "esm",
platform: "browser",
outfile: "out/rendererLog.js",
external: ["vscode"],
loader: {
".ttf": "file",
".css": "text",
},
},
];

/**
*
* @param {import('esbuild').BuildOptions} project
*/
async function buildProject(project) {
const ctx = await esbuild.context({
bundle: true,
minify: production,
sourcemap: !production,
sourcesContent: false,
logLevel: LOG_LEVEL,

...project,

plugins: [
typecheckPlugin({ configFile: project.entryPoints[0] + "/tsconfig.json" }),
/* add to the end of plugins array */
//esbuildProblemMatcherPlugin,
],
});

await ctx.rebuild();
await ctx.dispose();
}

async function main() {
for (const project of projects) {
await buildProject(project);
}
}

main().catch((e) => {
console.error(e);
process.exit(1);
});
4 changes: 3 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ export default [
"**/.pytest_cache/",
"**/site/",
"**/docs/",
"**/packages/",
"**/js",
],
},
{ files: ["**/*.{js,mjs,cjs,ts}"] },
{ files: ["**/*.{ts,tsx}"] },
{ languageOptions: { globals: globals.browser } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
Expand Down
2 changes: 1 addition & 1 deletion hatch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ only-include = ["src", "CHANGELOG.md"]


[envs.default]
installer = "uv"
#installer = "uv"
dependencies = [
"pytest",
"pytest-html",
Expand Down
Loading

0 comments on commit 9185ccd

Please sign in to comment.