config: improve integration with vscode

this adds recommended extensions, a vscode workspace config, workspace
settings & launch configs for mobile & web apps.
This commit is contained in:
Abdullah Atta
2023-02-13 09:18:01 +05:00
parent ae4afd5154
commit 1fb7541d14
7 changed files with 104 additions and 16 deletions

11
.vscode/extensions.json vendored Normal file
View File

@@ -0,0 +1,11 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"ms-playwright.playwright",
"firefox-devtools.vscode-firefox-debug",
"msjsdiag.vscode-react-native"
]
}

72
.vscode/notesnook.code-workspace vendored Normal file
View File

@@ -0,0 +1,72 @@
{
"folders": [
{
"name": "✨ notesnook",
"path": ".."
},
{
"name": "🚀 @notesnook/mobile",
"path": "../apps/mobile"
},
{
"name": "🚀 @notesnook/web",
"path": "../apps/web"
},
{
"name": "🚀 @notesnook/desktop",
"path": "../apps/web/desktop"
},
{
"name": "🚀 @notesnook/web-clipper",
"path": "../extensions/web-clipper"
},
{
"name": "📦 @notesnook/clipper",
"path": "../packages/clipper"
},
{
"name": "📦 @notesnook/core",
"path": "../packages/core"
},
{
"name": "📦 @notesnook/crypto",
"path": "../packages/crypto"
},
{
"name": "📦 @notesnook/crypto-worker",
"path": "../packages/crypto-worker"
},
{
"name": "📦 @notesnook/editor",
"path": "../packages/editor"
},
{
"name": "📦 @notesnook/editor-mobile",
"path": "../packages/editor-mobile"
},
{
"name": "📦 @notesnook/logger",
"path": "../packages/logger"
},
{
"name": "📦 @notesnook/streamable-fs",
"path": "../packages/streamable-fs"
},
{
"name": "📦 @notesnook/theme",
"path": "../packages/theme"
}
],
"settings": {
"typescript.tsdk": "node_modules/typescript/lib",
"javascript.format.enable": true,
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "modificationsIfAvailable",
"eslint.packageManager": "npm",
"eslint.run": "onSave",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"eslint.execArgv": ["--cache"]
}
}

View File

@@ -1,3 +0,0 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}

View File

@@ -25,4 +25,4 @@
"request": "attach"
}
]
}
}

View File

@@ -1 +0,0 @@
{}

View File

@@ -7,14 +7,21 @@
{
"type": "chrome",
"request": "launch",
"preLaunchTask": "StartReactApp",
"preLaunchTask": "Start Notesnook (web)",
"postDebugTask": "Terminate All Tasks",
"name": "Launch Chrome against localhost",
"name": "Debug Chrome",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}",
"env": { "DISPLAY": ":0" },
"runtimeExecutable": "/usr/bin/brave-browser",
"runtimeArgs": ["--remote-debugging-port=9222"]
"webRoot": "${workspaceFolder}"
},
{
"type": "firefox",
"request": "launch",
"reAttach": true,
"preLaunchTask": "Start Notesnook (web)",
"postDebugTask": "Terminate All Tasks",
"name": "Debug Firefox",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
}
]
}

View File

@@ -5,24 +5,26 @@
"tasks": [
{
"type": "shell",
"command": "yarn debug",
"command": "npm run debug",
"group": {
"kind": "test",
"kind": "build",
"isDefault": true
},
"dependsOn": "Terminate All Tasks",
"isBackground": true, //This prevents the launch.json to wait for the completion of the task
"problemMatcher": {
"fileLocation": "relative",
"owner": "custom", //This is not needed but, required by the problemMatcher Object
"pattern": {
"regexp": "^$" //This is not needed but, required by the problemMatcher Object
},
"background": {
"activeOnStart": true,
"beginsPattern": "Compiling...", //Signals the begin of the Task
"endsPattern": "Compiled .*" //Signals that now the initialization of the task is complete
"beginsPattern": "^$",
"endsPattern": "^You can now view (.*) in the browser.$"
}
},
"label": "StartReactApp"
"label": "Start Notesnook (web)"
},
{
"label": "Terminate All Tasks",