Skip to content

Commit d9c6aa7

Browse files
dwesolowcamiloHimura
authored andcommitted
🔧 chore(inspect): Update UI scripts (open-edge-platform#2974)
* chore(inspect): Update UI scripts * chore: Update github actions * chore: Update port to 8000
1 parent 956012f commit d9c6aa7

File tree

5 files changed

+11
-12
lines changed

5 files changed

+11
-12
lines changed

.github/workflows/geti-inspect.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ jobs:
172172

173173
- name: Build OpenAPI type definitions
174174
working-directory: "app/ui"
175-
run: npm run build:api
175+
run: npm run build:api:types
176176

177177
- name: Prettier
178178
working-directory: "app/ui"
@@ -221,7 +221,7 @@ jobs:
221221

222222
- name: Build OpenAPI type definitions
223223
working-directory: "app/ui"
224-
run: npm run build:api
224+
run: npm run build:api:types
225225

226226
- name: UI Unit tests
227227
working-directory: "app/ui"
@@ -274,7 +274,7 @@ jobs:
274274

275275
- name: Build OpenAPI type definitions
276276
working-directory: "app/ui"
277-
run: npm run build:api
277+
run: npm run build:api:types
278278

279279
- name: Run Playwright tests
280280
working-directory: "app/ui"

app/ui/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
},
1010
"scripts": {
1111
"build": "rsbuild build",
12-
"build:api": "npx openapi-typescript ./src/api/openapi-spec.json -o ./src/api/openapi-spec.d.ts --root-types && prettier --write src/api/openapi-spec.d.ts",
13-
"build:api:download": "curl -o ./src/api/openapi-spec.json http://localhost:7860/api/openapi.json && prettier --write src/api/openapi-spec.json",
14-
"update-spec": "npm run build:api:download && npm run build:api",
12+
"build:api:types": "npx openapi-typescript ./src/api/openapi-spec.json -o ./src/api/openapi-spec.d.ts --root-types && prettier --write src/api/openapi-spec.d.ts",
13+
"build:api:download": "curl -o ./src/api/openapi-spec.json http://localhost:8000/api/openapi.json && prettier --write src/api/openapi-spec.json",
14+
"build:api": "npm run build:api:download && npm run build:api:types",
1515
"clone-geti-ui-packages": "npx degit git@github.com:open-edge-platform/geti.git/web_ui/packages/config packages/config --force && npx degit git@github.com:open-edge-platform/geti.git/web_ui/packages/ui packages/ui --force",
1616
"cyclic-deps-check": "npx madge --circular src/**/*.ts*",
1717
"start": "rsbuild dev",

app/ui/rsbuild.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ export default defineConfig({
2222
define: {
2323
...publicVars,
2424
'import.meta.env.PUBLIC_API_BASE_URL':
25-
publicVars['import.meta.env.PUBLIC_API_BASE_URL'] ?? '"http://localhost:7860"',
25+
publicVars['import.meta.env.PUBLIC_API_BASE_URL'] ?? '"http://localhost:8000"',
2626
'process.env.PUBLIC_API_BASE_URL':
27-
publicVars['process.env.PUBLIC_API_BASE_URL'] ?? '"http://localhost:7860"',
27+
publicVars['process.env.PUBLIC_API_BASE_URL'] ?? '"http://localhost:8000"',
2828
// Needed to prevent an issue with spectrum's picker
2929
// eslint-disable-next-line max-len
3030
// https://github.com/adobe/react-spectrum/blob/6173beb4dad153aef74fc81575fd97f8afcf6cb3/packages/%40react-spectrum/overlays/src/OpenTransition.tsx#L40
@@ -45,7 +45,7 @@ export default defineConfig({
4545
server: {
4646
proxy: {
4747
'/api': {
48-
target: 'http://localhost:7860',
48+
target: 'http://localhost:8000',
4949
changeOrigin: true,
5050
ws: true,
5151
//pathRewrite: { '^/api': '' }, // strip the /api prefix

app/ui/src/api/utils.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ const handlers = await fromOpenApi(JSON.stringify(spec).replace(/}:/g, '}//:'));
88

99
const getOpenApiHttp = (): OpenApiHttpHandlers<paths> => {
1010
const http = createOpenApiHttp<paths>({
11-
baseUrl: 'http://localhost:7860',
12-
//baseUrl: process.env.PUBLIC_API_BASE_URL ?? 'http://localhost:7860',
11+
baseUrl: process.env.PUBLIC_API_BASE_URL ?? 'http://localhost:8000',
1312
});
1413

1514
return {

app/ui/src/setup-tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { afterAll, afterEach, beforeAll } from 'vitest';
55

66
import { server } from './msw-node-setup';
77

8-
process.env.PUBLIC_API_BASE_URL = 'http://localhost:7860';
8+
process.env.PUBLIC_API_BASE_URL = 'http://localhost:8000';
99

1010
beforeAll(() => {
1111
server.listen({ onUnhandledRequest: 'bypass' });

0 commit comments

Comments
 (0)