Skip to content

Commit

Permalink
Merge branch 'feature/migrate-to-rspack' into q/128.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bert-e committed Jul 19, 2024
2 parents d2325f6 + 147e2e8 commit feb8dfc
Show file tree
Hide file tree
Showing 320 changed files with 19,509 additions and 15,007 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ jobs:
- name: Install node
uses: actions/setup-node@v4
with:
node-version: "16"
node-version: "20"
- name: Cache node modules
id: cache-npm
uses: actions/cache@v4
Expand Down Expand Up @@ -273,7 +273,7 @@ jobs:
- name: Install node
uses: actions/setup-node@v4
with:
node-version: "16"
node-version: "20"
- name: Cache node modules
id: cache-npm
uses: actions/cache@v4
Expand Down Expand Up @@ -309,7 +309,7 @@ jobs:
- name: Install node
uses: actions/setup-node@v4
with:
node-version: "16"
node-version: "20"
- name: Cache node modules
uses: actions/cache@v4
env:
Expand Down Expand Up @@ -438,7 +438,7 @@ jobs:
- name: Install node
uses: actions/setup-node@v4
with:
node-version: "16"
node-version: "20"
- name: Cache node modules
id: cache-npm
uses: actions/cache@v4
Expand All @@ -459,11 +459,11 @@ jobs:
- name: Build Shell UI
run: |
cd shell-ui
npm run build
npm run rsbuild
- name: Install UI dependencies
run: |
cd ui
npm ci --legacy-peer-deps --no-optional
npm ci --legacy-peer-deps
- name: Build UI
run: |
cd ui
Expand Down Expand Up @@ -516,7 +516,7 @@ jobs:
- name: Install node
uses: actions/setup-node@v4
with:
node-version: "16"
node-version: "20"
- name: Cache node modules
id: cache-npm
uses: actions/cache@v4
Expand Down
4 changes: 1 addition & 3 deletions buildchain/buildchain/shell_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,8 @@ def run_shell_ui_builder(cmd: str) -> docker_command.DockerRun:
"src",
"public",
"index-template.html",
"webpack.common.js",
"webpack.config.prd.js",
"rspack.config.ts",
"babel.config.js",
".flowconfig",
],
)

Expand Down
5 changes: 2 additions & 3 deletions buildchain/buildchain/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,8 @@ def run_ui_builder(cmd: str) -> docker_command.DockerRun:
source_mounts=[
"public",
"src",
"webpack.common.js",
"webpack.prod.js",
"babel.config.js",
"rspack.config.ts",
"@mf-types",
],
)

Expand Down
1 change: 1 addition & 0 deletions salt/metalk8s/addons/ui/deployed/ingress.sls
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ spec:
"/(static.*)",
"/" + stripped_base_path + "/(.well-known.*)" if stripped_base_path else "/(.well-known.*)",
"/" + stripped_base_path + "/(static.*)" if stripped_base_path else "/(static.*)",
"/" + stripped_base_path + "/(mf-manifest.*)" if stripped_base_path else "/(mf-manifest.*)",
"/(" + stripped_base_path + ".*)",
] %}
- path: {{ path }}
Expand Down
16 changes: 8 additions & 8 deletions salt/metalk8s/addons/ui/deployed/ui-configuration.sls
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@ Create metalk8s-shell-ui-config ConfigMap:
label:
en: "Documentation"
fr: "Documentation"
icon: "fas fa-clipboard-list"
icon: "Documentation"
isExternal: true
- url: "{{ cp_ingress_url }}/about"
label:
en: "About"
fr: "À propos"
icon: "fas fa-question-circle"
icon: "Info"
options:
main:
"{{ metalk8s_ui_url }}":
Expand All @@ -171,12 +171,12 @@ Create metalk8s-shell-ui-config ConfigMap:
"{{ cp_ingress_url }}/docs/{{ stripped_base_path }}":
en: "Documentation"
fr: "Documentation"
icon: "fas fa-clipboard-list"
icon: "Documentation"
isExternal: true
"{{ cp_ingress_url }}/about":
en: "About"
fr: "À propos"
icon: "fas fa-question-circle"
icon: "Info"

{%- else %}

Expand Down Expand Up @@ -251,13 +251,13 @@ Convert old Metalk8s Shell UI ServiceConfiguration to new format:
label:
en: "Documentation"
fr: "Documentation"
icon: "fas fa-clipboard-list"
icon: "Documentation"
isExternal: true
- url: "{{ cp_ingress_url }}/about"
label:
en: "About"
fr: "À propos"
icon: "fas fa-question-circle"
icon: "Info"
{%- if 'options' in config_data.spec %}
options:
{{ config_data.spec.options | yaml(False) | indent(16) }}
Expand All @@ -277,12 +277,12 @@ Convert old Metalk8s Shell UI ServiceConfiguration to new format:
"{{ cp_ingress_url }}/docs/{{ stripped_base_path }}":
en: "Documentation"
fr: "Documentation"
icon: "fas fa-clipboard-list"
icon: "Documentation"
isExternal: true
"{{ cp_ingress_url }}/about":
en: "About"
fr: "À propos"
icon: "fas fa-question-circle"
icon: "Info"
{%- endif %}

{%- elif config_data.apiVersion == 'addons.metalk8s.scality.com/v1alpha2' %}
Expand Down
24 changes: 0 additions & 24 deletions shell-ui/.flowconfig

This file was deleted.

2 changes: 2 additions & 0 deletions shell-ui/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
node_modules
build
@mf-types
build_ts/
11 changes: 5 additions & 6 deletions shell-ui/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
ARG NGINX_IMAGE_VERSION=1.18.0-alpine
ARG NODE_IMAGE_VERSION=16.14.0
ARG NODE_IMAGE_VERSION=20-alpine3.19

FROM node:${NODE_IMAGE_VERSION} AS build-step


USER node
RUN mkdir -p /home/node/app
WORKDIR /home/node/app

COPY package.json package-lock.json tsconfig.json /home/node/

# `npm config set unsafe-perm true` is needed in order to let npm run core-ui prepare script when installing dependencies in a context with root access
# Ref : https://npm.community/t/npm-ci-not-running-prepare-for-git-dependencies-when-run-as-root-in-docker/4485/2
ENV npm_config_cache /home/node/app/.npm
RUN npm config set unsafe-perm true && npm ci --legacy-peer-deps
RUN npm ci --legacy-peer-deps

COPY index-template.html webpack.*.js babel.config.js tsconfig.json .flowconfig /home/node/
COPY index-template.html rspack.config.ts tsconfig.json /home/node/
COPY public /home/node/public
COPY src /home/node/src

RUN npm run build
RUN npm run rsbuild

FROM nginx:${NGINX_IMAGE_VERSION}

Expand Down
23 changes: 0 additions & 23 deletions shell-ui/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,5 @@ if (process.env.NODE_ENV === 'test') {
},
],
],
plugins: ['@babel/plugin-transform-modules-commonjs'],
};
} else {
module.exports = {
plugins: [
[
'babel-plugin-styled-components',
{
namespace: 'shell-ui',
},
],
'@babel/plugin-proposal-class-properties',
],
presets: [
'@babel/preset-env',
'@babel/preset-typescript',
[
'@babel/preset-react',
{
runtime: 'automatic',
},
],
],
};
}
2 changes: 1 addition & 1 deletion shell-ui/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -eu
build() {
# Redirect everything to stderr, to get as much info as possible in case
# of an error.
npm run build 1>&2
npm run rsbuild 1>&2
}

clean() {
Expand Down
24 changes: 11 additions & 13 deletions shell-ui/index-template.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{{#each htmlWebpackPlugin.files.js}}
<link rel="preload" as="script" href="{{this}}" />
{{/each}}
<title>Document</title>
<script language="javascript">window.shellUIRemoteEntryUrl = "/shell/remoteEntry.js?version={{htmlWebpackPlugin.options.version}}"</script>
</head>
<body>
<div id="app"></div>
</body>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<script language="javascript">
window.shellUIRemoteEntryUrl = "/shell/mf-manifest.json?version=<%=version%>";
</script>
</head>
<body>
<div id="app"></div>
</body>
</html>

8 changes: 0 additions & 8 deletions shell-ui/index.alerts.js

This file was deleted.

19 changes: 0 additions & 19 deletions shell-ui/index.all.js

This file was deleted.

8 changes: 0 additions & 8 deletions shell-ui/index.navbar.js

This file was deleted.

Loading

0 comments on commit feb8dfc

Please sign in to comment.