Skip to content

Commit

Permalink
chore(deps) update dependencies to vite 5
Browse files Browse the repository at this point in the history
Signed-off-by: David Edler <[email protected]>
  • Loading branch information
edlerd committed Jan 17, 2024
1 parent 6180c5c commit a5900c4
Show file tree
Hide file tree
Showing 10 changed files with 805 additions and 841 deletions.
File renamed without changes.
92 changes: 9 additions & 83 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,62 +6,6 @@ permissions:

jobs:

commits:
permissions:
pull-requests: read # to get list of commits from the PR
name: Canonical CLA signed and Signed-off-by (DCO)
runs-on: ubuntu-latest
steps:
- name: Check if CLA signed
uses: canonical/has-signed-canonical-cla@v1
- name: Get PR Commits
id: 'get-pr-commits'
uses: tim-actions/get-pr-commits@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Check that all commits are signed-off
uses: tim-actions/dco@master
with:
commits: ${{ steps.get-pr-commits.outputs.commits }}

lint-scss:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: yarn install --immutable

- name: Lint scss
run: yarn lint-scss

lint-js:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install node dependencies
run: yarn install --immutable

- name: Lint JS
run: yarn lint-js

check-inclusive-naming:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Check inclusive naming
uses: canonical/Inclusive-naming@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review
fail-on-error: true

e2e:
name: e2e-tests
runs-on: ubuntu-latest
Expand All @@ -88,21 +32,22 @@ jobs:
sudo chmod 0777 ../lxd-ui
dotrun install
- name: Set keys permissions
run: |
set -x
sudo chmod -R 0666 keys
sudo chmod 0777 keys
- name: Run LXD-UI
env:
ENVIRONMENT: devel
PORT: 8407
LXD_UI_BACKEND_IP: 172.17.0.1
run: |
dotrun &
curl --head --fail --retry-delay 2 --retry 100 --retry-connrefused --insecure https://localhost:8407
vite &
./entrypoint.sh &
curl --retry-delay 2 --retry 100 --retry-connrefused --insecure https://127.0.0.1:8407
- name: Set keys permissions
run: |
set -x
sudo chmod -R 0666 keys
sudo chmod 0777 keys
- name: Save keys
uses: actions/cache/save@v3
with:
Expand Down Expand Up @@ -151,22 +96,3 @@ jobs:
FULL_HTML_REPORT_URL=https://canonical.github.io/lxd-ui/$HTML_REPORT_URL_PATH
echo "::notice title=Published Playwright Test Report::$FULL_HTML_REPORT_URL"
echo "Please wait a few minute for the reports to get published before accessing the url!"
js-tests:
name: js-tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Dotrun
run: |
sudo pip3 install dotrun
- name: Install LXD-UI dependencies
run: |
set -x
sudo chmod 0777 ../lxd-ui
dotrun install
- name: Run Javascript tests
run: dotrun test-js
4 changes: 3 additions & 1 deletion entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ else
echo 'please add the certificates to your local LXD as explained in README.md'
fi
echo 'booting on https://localhost:8407'
cat /tmp/haproxy-local.cfg
haproxy -v

haproxy -f /tmp/haproxy-local.cfg -db
haproxy -f /tmp/haproxy-local.cfg -d

fi
58 changes: 30 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.0.1",
"author": "Canonical Webteam",
"license": "LGPL-3.0-only",
"type": "module",
"scripts": {
"clean": "rm -rf node_modules yarn-error.log *.log build/ .jekyll-metadata .bundle playwright-report test-results haproxy-local.cfg",
"build-html": "cp build/ui/index.html build/index.html",
Expand All @@ -11,20 +12,20 @@
"format-js-prettier": "prettier 'src/**/*.{json,jsx,tsx,ts}' 'tests/**/*.ts' --write",
"format-js": "yarn format-js-eslint && yarn format-js-prettier",
"lint-scss": "stylelint 'src/**/*.scss'",
"lint-js-eslint": "eslint 'src/**/*.{json,tsx,ts}' 'tests/**/*.ts' .eslintrc.js babel.config.js",
"lint-js-prettier": "prettier 'src/**/*.{json,tsx,ts}' 'tests/**/*.ts' .eslintrc.js babel.config.js --check",
"lint-js-eslint": "eslint 'src/**/*.{json,tsx,ts}' 'tests/**/*.ts' .eslintrc.cjs babel.config.js",
"lint-js-prettier": "prettier 'src/**/*.{json,tsx,ts}' 'tests/**/*.ts' .eslintrc.cjs babel.config.js --check",
"lint-js": "yarn lint-js-eslint && yarn lint-js-prettier",
"hooks-add": "husky install",
"hooks-remove": "husky uninstall",
"start": "concurrently --kill-others --raw 'vite | grep -v localhost' 'yarn serve'",
"start": "concurrently --kill-others --raw 'vite' 'yarn serve'",
"serve": "./entrypoint",
"test-js": "react-scripts test src/ --watchAll=false"},
"dependencies": {
"@canonical/react-components": "0.47.1",
"@monaco-editor/react": "^4.6.0",
"@tanstack/react-query": "^5.17.0",
"@tanstack/react-query": "^5.17.15",
"@use-it/event-listener": "^0.1.7",
"axios": "1.6.3",
"axios": "1.6.5",
"cytoscape": "3.28.1",
"cytoscape-popper": "2.0.0",
"formik": "2.4.5",
Expand All @@ -39,56 +40,57 @@
"react-scripts": "5.0.1",
"react-useportal": "^1.0.19",
"serve": "14.2.1",
"vanilla-framework": "4.5.1",
"xterm-addon-fit": "0.6.0",
"vanilla-framework": "4.6.0",
"xterm-addon-fit": "0.8.0",
"xterm-for-react": "1.0.4",
"yup": "1.3.3"
},
"devDependencies": {
"@babel/core": "7.23.7",
"@babel/eslint-parser": "7.23.3",
"@babel/preset-env": "7.23.7",
"@babel/preset-env": "7.23.8",
"@babel/preset-react": "7.23.3",
"@babel/preset-typescript": "7.23.3",
"@playwright/test": "^1.40.1",
"@playwright/test": "^1.41.0",
"@rollup/wasm-node": "4.9.5",
"@types/cytoscape-popper": "2.0.4",
"@types/node-forge": "1.3.10",
"@types/react": "18.2.46",
"@types/node-forge": "1.3.11",
"@types/react": "18.2.48",
"@types/react-cytoscapejs": "1.2.5",
"@types/react-dom": "18.2.18",
"@types/react-router-dom": "5.3.3",
"@types/websocket": "1.0.10",
"@typescript-eslint/eslint-plugin": "6.17.0",
"@typescript-eslint/parser": "6.17.0",
"@typescript-eslint/eslint-plugin": "6.19.0",
"@typescript-eslint/parser": "6.19.0",
"@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "10.4.16",
"babel-loader": "9.1.3",
"babel-plugin-transform-es2015-modules-commonjs": "6.26.2",
"concurrently": "8.2.2",
"css-loader": "6.8.1",
"css-loader": "6.9.0",
"eslint": "8.56.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-prettier": "5.1.2",
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-react": "7.33.2",
"husky": "8.0.3",
"lint-staged": "13.3.0",
"lint-staged": "15.2.0",
"monaco-editor": "0.45.0",
"postcss": "8.4.32",
"postcss-cli": "10.1.0",
"prettier": "3.1.1",
"sass": "1.69.6",
"sass-loader": "13.3.3",
"style-loader": "3.3.3",
"stylelint": "15.11.0",
"postcss": "8.4.33",
"postcss-cli": "11.0.0",
"prettier": "3.2.4",
"sass": "1.69.7",
"sass-loader": "14.0.0",
"style-loader": "3.3.4",
"stylelint": "16.1.0",
"stylelint-config-prettier": "9.0.5",
"stylelint-config-standard-scss": "11.1.0",
"stylelint-config-standard-scss": "13.0.0",
"stylelint-order": "6.0.4",
"stylelint-prettier": "4.1.0",
"stylelint-scss": "5.3.2",
"stylelint-prettier": "5.0.0",
"stylelint-scss": "6.0.0",
"ts-loader": "9.5.1",
"typescript": "5.3.3",
"vite": "4.5.1",
"vite-tsconfig-paths": "4.2.3"
"vite": "5.0.11",
"vite-tsconfig-paths": "4.3.1"
},
"lint-staged": {
"src/**/*.{json,jsx,ts,tsx}": [
Expand Down
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import ClusterGroupLoader from "pages/cluster/ClusterGroupLoader";
import { useAuth } from "context/auth";
import { setTitle } from "util/title";
import CustomLayout from "components/CustomLayout";
import NoMatch from "components/NoMatch";

const CertificateAdd = lazy(() => import("pages/login/CertificateAdd"));
const CertificateGenerate = lazy(
Expand Down Expand Up @@ -35,7 +36,6 @@ const Login = lazy(() => import("pages/login/Login"));
const NetworkDetail = lazy(() => import("pages/networks/NetworkDetail"));
const NetworkList = lazy(() => import("./pages/networks/NetworkList"));
const NetworkMap = lazy(() => import("pages/networks/NetworkMap"));
const NoMatch = lazy(() => import("components/NoMatch"));
const OperationList = lazy(() => import("pages/operations/OperationList"));
const ProfileDetail = lazy(() => import("pages/profiles/ProfileDetail"));
const ProfileList = lazy(() => import("pages/profiles/ProfileList"));
Expand Down
15 changes: 7 additions & 8 deletions src/pages/profiles/ProfileInstances.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,13 @@ const ProfileInstances: FC<Props> = ({
projects
.filter((project) => project.config["features.profiles"] === "false")
.map((project) => project.name)
.forEach(
(project) =>
affectedProjects?.push({
name: project,
instances: usedByInstances.filter(
(instance) => instance.project === project,
),
}),
.forEach((project) =>
affectedProjects?.push({
name: project,
instances: usedByInstances.filter(
(instance) => instance.project === project,
),
}),
);
}

Expand Down
5 changes: 2 additions & 3 deletions src/pages/storage/Storage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import StorageVolumes from "pages/storage/StorageVolumes";
import HelpLink from "components/HelpLink";
import TabLinks from "components/TabLinks";
import { useDocs } from "context/useDocs";

export const tabs: string[] = ["Pools", "Volumes", "Custom ISOs"];
import { storageTabs } from "util/projects";

const Storage: FC = () => {
const docBaseLink = useDocs();
Expand All @@ -37,7 +36,7 @@ const Storage: FC = () => {
<NotificationRow />
<Row>
<TabLinks
tabs={tabs}
tabs={storageTabs}
activeTab={activeTab}
tabUrl={`/ui/project/${project}/storage`}
/>
Expand Down
6 changes: 3 additions & 3 deletions src/util/projects.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { LxdProject } from "types/project";
import { tabs } from "pages/storage/Storage";
import { slugify } from "./slugify";

export const STORAGE_TAB_PATHS = tabs.map((tab) => slugify(tab));
export const storageTabs: string[] = ["Pools", "Volumes", "Custom ISOs"];
export const storageTabPaths = storageTabs.map((tab) => slugify(tab));
export const projectSubpages = [
"instances",
"profiles",
Expand All @@ -19,7 +19,7 @@ export const getSubpageFromUrl = (url: string) => {
const mainSubpage = parts[4];
const tabSubpage = parts[5];

if (mainSubpage === "storage" && STORAGE_TAB_PATHS.includes(tabSubpage)) {
if (mainSubpage === "storage" && storageTabPaths.includes(tabSubpage)) {
return `${mainSubpage}/${tabSubpage}`;
}

Expand Down
10 changes: 3 additions & 7 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"components/*": ["src/components/*"],
"pages/*": ["src/pages/*"],
"types/*": ["src/types/*"],
"util/*": ["src/util/*"]
"util/*": ["src/util/*"],
"*": ["types/*.d.ts"]
},
"target": "ES2020",
"module": "esnext",
Expand All @@ -29,16 +30,11 @@
},
"include": [
"./src",
".eslintrc.js",
".eslintrc.cjs",
"babel.config.js",
"playwright.config.ts",
"webpack.config.js",
"./tests/*.ts",
"vite.config.ts"
],
"paths": [
{
"*": ["types/*.d.ts"]
}
]
}
Loading

0 comments on commit a5900c4

Please sign in to comment.