Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace cra with vite #793

Merged
merged 29 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
1b5865f
prepare for replacing cra with vite
Pespiri Jul 5, 2023
561e01b
fix build errors
Pespiri Jul 5, 2023
01be10c
configure vite for host
Pespiri Jul 6, 2023
03c7351
lazy load pages
Pespiri Jul 6, 2023
d7d8367
fix dev entry integrations
Pespiri Jul 7, 2023
c70cded
add vite eslint plugin
Pespiri Jul 7, 2023
8b519b3
fix import of sanitize.css
Pespiri Jul 11, 2023
00b8516
update vite
Pespiri Jul 11, 2023
a892989
move home logos into subdirectory
Pespiri Jul 11, 2023
2ec6e2c
create shared component for lazy load fallback
Pespiri Jul 11, 2023
f3cc486
update nginx and node images
Pespiri Jul 11, 2023
7710559
allow objectNormalizer generic to extend any non-primitive type
Pespiri Jul 12, 2023
fbca4bb
fix incorrect normalizer used on object
Pespiri Jul 12, 2023
d063c7b
stricter type checking for normalizers
Pespiri Jul 12, 2023
35a5a37
update packages and lint
Pespiri Jul 13, 2023
0060a73
add alternative loading component
Pespiri Jul 13, 2023
e1cdf4a
Merge branch 'master' of github.com:equinor/radix-web-console into re…
Pespiri Jul 13, 2023
e4b3e4b
omit dev.* components from build
Pespiri Jul 13, 2023
8e57f8e
Merge branch 'master' of github.com:equinor/radix-web-console into re…
Pespiri Jul 13, 2023
21df6c1
cleanup old index.html entry point
Pespiri Jul 13, 2023
f82e77b
update packages
Pespiri Jul 14, 2023
41c4bad
fix page-about
Pespiri Jul 14, 2023
ae80207
Merge branch 'master' of github.com:equinor/radix-web-console into re…
Pespiri Aug 1, 2023
5003122
update packages
Pespiri Aug 1, 2023
889e8e6
fix incorrect type used for JobSummaryModel status
Pespiri Aug 1, 2023
1a618a5
remove redundant typing
Pespiri Aug 1, 2023
c6f0069
fix speling mitstakes
Pespiri Aug 1, 2023
24c41d4
fix vitest configuration
Pespiri Aug 1, 2023
06d9f57
remove vite environment from radixconfig
Pespiri Aug 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env.template
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## For local development: copy this file, rename it to `.env`, and populate accordingly

# Automatically derived from package.json by NPM
REACT_APP_VERSION=$npm_package_version
VITE_VERSION=$npm_package_version

# Automatically derived from package.json by NPM
REACT_APP_NAME=$npm_package_name
VITE_NAME=$npm_package_name

# Azure client secret for "Omnia Radix Web Console - Development Clusters" app
OAUTH2_PROXY_CLIENT_SECRET=
Expand Down
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build
dist
node_modules
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
FROM node:16-alpine as builder
FROM node:20-alpine as builder
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run lint
RUN npm run deps
RUN CI=true npm run test
RUN CI=true npm run test:no-watch
RUN npm run build

FROM nginxinc/nginx-unprivileged:1.24-alpine
FROM nginxinc/nginx-unprivileged:1.25-alpine
WORKDIR /app
COPY --from=builder /app/build /app
COPY proxy/server.conf /default.conf
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ If you need to nuke `node_modules` you can stop the container and run:

### Without Docker

If you want to connect to local Radix-API, you can omit Docker. You may want to do this for a better experience while debugging JavaScript in your IDE (e.g. JetBrains WebStorm). Run `npm start` with `REACT_APP_RADIX_API_BASE_URI` set to your local instance of Radix-API, e.g.
If you want to connect to local Radix-API, you can omit Docker. You may want to do this for a better experience while debugging JavaScript in your IDE (e.g. JetBrains WebStorm). Run `npm start` with `VITE_RADIX_API_BASE_URI` set to your local instance of Radix-API, e.g.

`REACT_APP_RADIX_API_BASE_URI=127.0.0.1:3002 npm start`
`VITE_RADIX_API_BASE_URI=127.0.0.1:3002 npm start`

Radix-API *must* run with `--useOutClusterClient=false` for this to work.

It should be possible to connect to local instances of radix-cost-allocation-api and radix-vulnerability-scanner-api in a similar fashion by setting the `REACT_APP_COST_API_BASE_URI` and `REACT_APP_SCAN_API_BASE_URI` environment variables, but as of August 2022, these backend applications have not been written with debug options to modify CORS settings to allow direct requests from web browser (as opposed to requests routed through the nginx proxy module in this repository).
It should be possible to connect to local instances of radix-cost-allocation-api and radix-vulnerability-scanner-api in a similar fashion by setting the `VITE_COST_API_BASE_URI` and `VITE_SCAN_API_BASE_URI` environment variables, but as of August 2022, these backend applications have not been written with debug options to modify CORS settings to allow direct requests from web browser (as opposed to requests routed through the nginx proxy module in this repository).

> If you want debugging with JetBrains WebStorm to work, you may also need to set the `HOST=127.0.0.1` and `JB_IDE_HOST=127.0.0.1` environment variables. If breakpoints are not triggered in your browser, try opening your browser window by holding CTRL+Shift and clicking the link from your process console window in WebStorm.

Expand Down
4 changes: 2 additions & 2 deletions docker-compose-host-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3.8"

services:
web:
image: node:16-alpine
image: node:20-alpine
container_name: radix-web_container
stdin_open: true # because of https://github.com/facebook/create-react-app/issues/8688
working_dir: /app
Expand Down Expand Up @@ -30,7 +30,7 @@ services:
test: "exit 0"

proxy:
image: nginxinc/nginx-unprivileged:1.24-alpine
image: nginxinc/nginx-unprivileged:1.25-alpine
container_name: radix-proxy_container
depends_on:
web:
Expand Down
4 changes: 2 additions & 2 deletions docker-compose-host.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3.8"

services:
web:
image: node:16-alpine
image: node:20-alpine
container_name: radix-web_container
stdin_open: true # because of https://github.com/facebook/create-react-app/issues/8688
working_dir: /app
Expand All @@ -20,7 +20,7 @@ services:
- "9222:9222"

proxy:
image: nginxinc/nginx-unprivileged:1.24-alpine
image: nginxinc/nginx-unprivileged:1.25-alpine
container_name: radix-proxy_container
environment:
- DYNATRACE_API_TOKEN=${DYNATRACE_API_TOKEN}
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3.8"

services:
web:
image: node:16-alpine
image: node:20-alpine
container_name: radix-web_container
stdin_open: true # because of https://github.com/facebook/create-react-app/issues/8688
working_dir: /app
Expand All @@ -23,7 +23,7 @@ services:
- "9222:9222"

proxy:
image: nginxinc/nginx-unprivileged:1.24-alpine
image: nginxinc/nginx-unprivileged:1.25-alpine
container_name: radix-proxy_container
environment:
- DYNATRACE_API_TOKEN=${DYNATRACE_API_TOKEN}
Expand Down
89 changes: 89 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<!DOCTYPE html>
<html lang="en">
<!--

`````````
`````-`````.``
````.`` ```
```.. ```
```` ```
```` ```
.```` ```` ``.
``.: ````` ```
``` ```` ```
```` ```` ````
``/``` ```.`
````` ``````
```.`````.`````
.``..``````
```
```
.``
-``
``
`/`-`
```
```
````..
```-..-
````` ``````
```` ````````
````` ````````````
```.`````: ```` ``````````` `````
````````` ```` `````.``````````
```````:.
`````` `:``
``````````````` .```
``-. ```
`

______ _______ ______ _____ _ _
|_____/ |_____| | \ | \___/
| \_ | | |_____/ __|__ _/ \_

-->
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no" />

<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png?v=1h7zOvlFSE">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png?v=1h7zOvlFSE">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png?v=1h7zOvlFSE">
<link rel="manifest" href="/site.webmanifest?v=1h7zOvlFSE" crossorigin="use-credentials">
<link rel="mask-icon" href="/safari-pinned-tab.svg?v=1h7zOvlFSE" color="#eb0037">
<link rel="shortcut icon" href="/favicon.ico?v=1h7zOvlFSE">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#d0d0d0">

<style media="(prefers-color-scheme: dark)">
html {
background-color: hsl(202, 0%, 18%);
color: hsl(0, 0%, 77%);
}
</style>

<title>Radix Web Console</title>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>

<div id="root"></div>
<script type="module" src="./src/index.ts">
window.RADIX_API_ENVIRONMENT = "${RADIX_API_ENVIRONMENT}";
window.RADIX_CLUSTER_BASE = "${RADIX_DNS_ZONE}";
window.RADIX_CLUSTERNAME = "${RADIX_CLUSTERNAME}";
window.RADIX_CLUSTER_TYPE = "${RADIX_CLUSTER_TYPE}";
window.RADIX_ENVIRONMENT = "${RADIX_ENVIRONMENT}";
window.CLUSTER_EGRESS_IPS = "${CLUSTER_EGRESS_IPS}";
window.CLUSTER_INGRESS_IPS = "${CLUSTER_INGRESS_IPS}";
window.OAUTH2_CLIENT_ID = "${OAUTH2_CLIENT_ID}";
window.OAUTH2_AUTHORITY = "${OAUTH2_AUTHORITY}";
window.SERVICENOW_PROXY_SCOPES = "${SERVICENOW_PROXY_SCOPES}"
window.SERVICENOW_PROXY_BASEURL = "${SERVICENOW_PROXY_BASEURL}"
window.CMDB_CI_URL = "${CMDB_CI_URL}"
window.CLUSTER_OIDC_ISSUER_URL = "${CLUSTER_OIDC_ISSUER_URL}"
</script>
</body>
</html>
Loading