@localstack/appinspector-ui 1.0.0-dev-86989eb5 → 1.0.0-dev-f61f6d86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -118
- package/dist/index.js +16 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,123 +1,9 @@
|
|
|
1
|
-
# LocalStack AppInspector
|
|
1
|
+
# LocalStack AppInspector UI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This package is used internally in different LocalStack products as an interface for App Inspector.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Installation
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
|
-
npm install
|
|
8
|
+
npm install @localstack/appinspector-ui
|
|
9
9
|
```
|
|
10
|
-
|
|
11
|
-
### Environment Variables
|
|
12
|
-
|
|
13
|
-
The following environment variables are available:
|
|
14
|
-
|
|
15
|
-
- `VITE_LOCALSTACK_API_MOCK`: Set to `true` to use the mock API client.
|
|
16
|
-
|
|
17
|
-
Run `cp .env.example .env` to create a `.env` file, and customize it as needed.
|
|
18
|
-
|
|
19
|
-
## Development
|
|
20
|
-
|
|
21
|
-
Spin up component development:
|
|
22
|
-
|
|
23
|
-
```sh
|
|
24
|
-
npx storybook dev
|
|
25
|
-
# npm run storybook
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
Spin up the end-to-end development:
|
|
29
|
-
|
|
30
|
-
```sh
|
|
31
|
-
npx vite
|
|
32
|
-
# npm run dev
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Testing
|
|
36
|
-
|
|
37
|
-
Run the component tests:
|
|
38
|
-
|
|
39
|
-
```sh
|
|
40
|
-
npx vitest --project=storybook
|
|
41
|
-
# npm run test:storybook
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
Run the end-to-end tests:
|
|
45
|
-
|
|
46
|
-
```sh
|
|
47
|
-
npx playwright test
|
|
48
|
-
# npm run test:playwright
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Start the end-to-end interactive UI mode:
|
|
52
|
-
|
|
53
|
-
```sh
|
|
54
|
-
npx playwright test --ui
|
|
55
|
-
# npm run test:playwright:ui
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
Update the end-to-end snapshots:
|
|
59
|
-
|
|
60
|
-
```sh
|
|
61
|
-
npx playwright test --update-snapshots
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
Auto generate end-to-end tests with Codegen:
|
|
65
|
-
|
|
66
|
-
```sh
|
|
67
|
-
npx playwright codegen
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
Show the end-to-end test results:
|
|
71
|
-
|
|
72
|
-
```sh
|
|
73
|
-
npx playwright show-report
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
### Snapshot testing
|
|
77
|
-
|
|
78
|
-
Snapshot testing is platform-dependent, meaning that snapshots for darwin (our computers) will likely differ from snapshots for linux (GitHub Actions).
|
|
79
|
-
|
|
80
|
-
The following script will update the snapshots for linux using docker:
|
|
81
|
-
|
|
82
|
-
```sh
|
|
83
|
-
npm run test:playwright:update-playwright-snapshots
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
### Testing on LocalStack Web
|
|
87
|
-
|
|
88
|
-
To try the integration in LocalStack Web, make sure to have the `localstack-web` repository alongside with this one, as seen here:
|
|
89
|
-
|
|
90
|
-
```
|
|
91
|
-
Code/
|
|
92
|
-
localstack-appinspector-ui/
|
|
93
|
-
localstack-web/
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
You can clone it with, and make sure to switch to the `integrate-studio-ui-prototype` branch name.
|
|
97
|
-
|
|
98
|
-
```sh
|
|
99
|
-
git clone https://github.com/localstack/localstack-web.git
|
|
100
|
-
git checkout integrate-studio-ui-prototype
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
Now, install Husky globally:
|
|
104
|
-
|
|
105
|
-
```sh
|
|
106
|
-
npm install -g husky
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
Then, run the following script:
|
|
110
|
-
|
|
111
|
-
```sh
|
|
112
|
-
make install-to-localstack-web
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
This will build and package App Inspector UI and install it in `localstack-web`'s related workspace dependencies. Now, you can go to `localstack-web` and run `make start-staged`.
|
|
116
|
-
|
|
117
|
-
Additionally, you can also run the following command to start a watcher:
|
|
118
|
-
|
|
119
|
-
```sh
|
|
120
|
-
make install-to-localstack-web-dev
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
This will start a watcher that will rebuild the App Inspector UI and install it in `localstack-web`'s related workspace dependencies.
|
package/dist/index.js
CHANGED
|
@@ -2901,12 +2901,11 @@ var buildSpansEndpoint = (request) => {
|
|
|
2901
2901
|
};
|
|
2902
2902
|
var createApiClient = ({ localstackEndpoint }) => {
|
|
2903
2903
|
return {
|
|
2904
|
-
deleteSpans: async (
|
|
2904
|
+
deleteSpans: async () => {
|
|
2905
2905
|
return makeRequest({
|
|
2906
2906
|
endpoint: API_ENDPOINTS.SPANS,
|
|
2907
2907
|
localstackEndpoint,
|
|
2908
2908
|
request: {
|
|
2909
|
-
body: JSON.stringify(request),
|
|
2910
2909
|
method: "DELETE"
|
|
2911
2910
|
}
|
|
2912
2911
|
});
|
|
@@ -3000,9 +2999,20 @@ var SpansListPage = () => {
|
|
|
3000
2999
|
const url = resolveLink({ to: "trace-graph", traceId: span.trace_id });
|
|
3001
3000
|
navigate(`${url}?spanId=${span.span_id}`);
|
|
3002
3001
|
}, [navigate, resolveLink]);
|
|
3003
|
-
const clearSpans = useCallback3(() => {
|
|
3004
|
-
|
|
3005
|
-
|
|
3002
|
+
const clearSpans = useCallback3(async () => {
|
|
3003
|
+
setLoading(true);
|
|
3004
|
+
try {
|
|
3005
|
+
await api.deleteSpans();
|
|
3006
|
+
setSpans([]);
|
|
3007
|
+
setFetchError(void 0);
|
|
3008
|
+
await fetchSpans();
|
|
3009
|
+
} catch (error) {
|
|
3010
|
+
console.error("Failed to delete spans:", error);
|
|
3011
|
+
setFetchError(error instanceof Error ? error : new Error("Failed to delete spans", { cause: error }));
|
|
3012
|
+
} finally {
|
|
3013
|
+
setLoading(false);
|
|
3014
|
+
}
|
|
3015
|
+
}, [api, fetchSpans]);
|
|
3006
3016
|
return /* @__PURE__ */ jsx127(
|
|
3007
3017
|
Box5,
|
|
3008
3018
|
{
|
|
@@ -3029,7 +3039,7 @@ var SpansListPage = () => {
|
|
|
3029
3039
|
{
|
|
3030
3040
|
filterWriteOperations,
|
|
3031
3041
|
onClearSpans: () => {
|
|
3032
|
-
clearSpans();
|
|
3042
|
+
void clearSpans();
|
|
3033
3043
|
},
|
|
3034
3044
|
onFilterWriteOperationsChange: (value) => {
|
|
3035
3045
|
setFilterWriteOperations(value);
|