Skip to content

Commit d61f4ed

Browse files
committed
feat: add app inspector
1 parent 7895688 commit d61f4ed

File tree

13 files changed

+2995
-171
lines changed

13 files changed

+2995
-171
lines changed

.vscode/tasks.json

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
"version": "2.0.0",
33
"tasks": [
44
{
5-
"label": "watch",
5+
"label": "dev",
66
"dependsOn": [
7-
"npm: watch:localstack-web-mock-server",
8-
"npm: watch:esbuild"
7+
"npm: dev:localstack-web-mock-server",
8+
"npm: dev:extension",
9+
"npm: dev:appinspector-webview"
910
],
1011
"presentation": {
1112
"reveal": "never"
@@ -17,7 +18,7 @@
1718
},
1819
{
1920
"type": "npm",
20-
"script": "watch:esbuild",
21+
"script": "dev:extension",
2122
"group": "build",
2223
"problemMatcher": {
2324
"severity": "error",
@@ -40,23 +41,23 @@
4041
"background": {
4142
"activeOnStart": true,
4243
"beginsPattern": {
43-
"regexp": "\\[watch\\] build started"
44+
"regexp": "\\[dev\\] build started"
4445
},
4546
"endsPattern": {
46-
"regexp": "\\[watch\\] build finished"
47+
"regexp": "\\[dev\\] build finished"
4748
}
4849
}
4950
},
5051
"isBackground": true,
51-
"label": "npm: watch:esbuild",
52+
"label": "npm: dev:extension",
5253
"presentation": {
53-
"group": "watch",
54+
"group": "dev",
5455
"reveal": "never"
5556
}
5657
},
5758
{
5859
"type": "npm",
59-
"script": "watch:localstack-web-mock-server",
60+
"script": "dev:localstack-web-mock-server",
6061
"group": "build",
6162
"isBackground": true,
6263
"problemMatcher": {
@@ -86,9 +87,48 @@
8687
}
8788
}
8889
},
89-
"label": "npm: watch:localstack-web-mock-server",
90+
"label": "npm: dev:localstack-web-mock-server",
9091
"presentation": {
91-
"group": "watch",
92+
"group": "dev",
93+
"reveal": "never"
94+
}
95+
},
96+
{
97+
"type": "npm",
98+
"script": "dev:appinspector-webview",
99+
"group": "build",
100+
"problemMatcher": {
101+
"severity": "error",
102+
"applyTo": "closedDocuments",
103+
"source": "vite",
104+
"fileLocation": "relative",
105+
"pattern": [
106+
{
107+
"regexp": "^[✘▲] \\[([A-Z]+)\\] (.+)",
108+
"severity": 1,
109+
"message": 2
110+
},
111+
{
112+
"regexp": "^(?:\\t| {4})(?!\\s)([^:]+)(?::([0-9]+))?(?::([0-9]+))?:$",
113+
"file": 1,
114+
"line": 2,
115+
"column": 3
116+
}
117+
],
118+
"background": {
119+
// "activeOnStart": true,
120+
"beginsPattern": {
121+
"regexp": "build started..."
122+
},
123+
"endsPattern": {
124+
"regexp": "built in"
125+
}
126+
}
127+
},
128+
"isBackground": true,
129+
"label": "npm: dev:appinspector-webview",
130+
"presentation": {
131+
"group": "dev",
92132
"reveal": "never"
93133
}
94134
}

build/extension.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import esbuild from "esbuild";
22

33
const production = process.argv.includes("--production");
4-
const watch = process.argv.includes("--watch");
4+
const dev = process.argv.includes("--dev");
55

66
/**
77
* @type {import('esbuild').Plugin}
@@ -10,8 +10,7 @@ const esbuildProblemMatcherPlugin = {
1010
name: "esbuild-problem-matcher",
1111
setup(build) {
1212
build.onStart(() => {
13-
console.clear();
14-
console.log("[watch] build started");
13+
console.log("[dev] build started");
1514
});
1615
build.onEnd((result) => {
1716
result.errors.forEach(({ text, location }) => {
@@ -20,7 +19,7 @@ const esbuildProblemMatcherPlugin = {
2019
` ${location.file}:${location.line}:${location.column}:`,
2120
);
2221
});
23-
console.log("[watch] build finished");
22+
console.log("[dev] build finished");
2423
});
2524
},
2625
};
@@ -47,13 +46,14 @@ async function main() {
4746
"process.env.NODE_ENV": JSON.stringify(
4847
process.env.NODE_ENV ?? "development",
4948
),
49+
"import.meta.dirname": "__dirname",
5050
},
5151
plugins: [
5252
/* add to the end of plugins array */
5353
esbuildProblemMatcherPlugin,
5454
],
5555
});
56-
if (watch) {
56+
if (dev) {
5757
await ctx.watch();
5858
} else {
5959
await ctx.rebuild();

0 commit comments

Comments
 (0)