From b7a55ef7e0de56eb3e49a248b97430ff79b43328 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Sun, 9 Jun 2024 03:42:40 +0200 Subject: [PATCH 01/74] feat: add title bar --- .gitignore | 3 + bins/.gitkeep | 0 index.html | 3 +- package.json | 4 +- src-tauri/Cargo.toml | 3 + src-tauri/cli/Cargo.toml | 3 + src-tauri/dev/Cargo.toml | 3 + src-tauri/src/main.rs | 4 +- src/App.tsx | 37 +- src/components/FileExplorer/Node.tsx | 67 +- src/components/FileExplorer/index.tsx | 5 +- src/components/Toaster.tsx | 2 +- src/elements/Button.tsx | 4 +- src/elements/Logger.tsx | 11 +- src/elements/Main.tsx | 9 - src/hooks/useForceUpdate.ts | 2 +- src/index.tsx | 86 +- src/layouts/MainMenu/Button.tsx | 6 +- src/layouts/MainMenu/index.tsx | 6 +- src/layouts/Screen.tsx | 9 +- src/layouts/TitleBar.tsx | 29 + src/screens/Cloud.tsx | 17 +- src/screens/Dashboard.tsx | 12 +- src/screens/Scanner.tsx | 27 +- src/screens/Settings/constants.ts | 10 +- src/screens/Settings/index.tsx | 50 +- yarn.lock | 1521 ++++++++++++++----------- 27 files changed, 1105 insertions(+), 828 deletions(-) create mode 100644 bins/.gitkeep delete mode 100644 src/elements/Main.tsx create mode 100644 src/layouts/TitleBar.tsx diff --git a/.gitignore b/.gitignore index c2695083..4c6fa44c 100644 --- a/.gitignore +++ b/.gitignore @@ -154,6 +154,9 @@ dist ######################################## # Custom +/bins/* +!/bins/.gitkeep + /.debug/* !/.debug/.gitkeep diff --git a/bins/.gitkeep b/bins/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/index.html b/index.html index 412c7e1a..a2e7e6ef 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,4 @@ - + @@ -11,6 +11,7 @@ diff --git a/package.json b/package.json index 51242f9e..ff89482f 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,8 @@ "postversion": "git push origin HEAD --tags" }, "dependencies": { + "@fontsource/poppins": "5.0.14", + "@fontsource/reddit-mono": "5.0.3", "@lezer/highlight": "1.2.1", "@tauri-apps/api": "1.6.0", "@uiw/codemirror-extensions-langs": "4.23.0", @@ -55,7 +57,7 @@ "@biomejs/biome": "1.8.3", "@commitlint/cli": "19.4.0", "@commitlint/config-conventional": "19.2.2", - "@ivangabriele/biome-config": "1.3.0", + "@ivangabriele/biome-config": "1.5.0", "@ivangabriele/commitlint-config": "2.0.3", "@ivangabriele/tsconfig-react": "2.0.0", "@swc/core": "1.7.14", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 571645d1..73821f7c 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -43,3 +43,6 @@ mockall = "0.13.0" [package.metadata.deb] copyright = "2022-present, Ivan Gabriele " + +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tarpaulin_include)'] } diff --git a/src-tauri/cli/Cargo.toml b/src-tauri/cli/Cargo.toml index ac3c658f..9c78af40 100644 --- a/src-tauri/cli/Cargo.toml +++ b/src-tauri/cli/Cargo.toml @@ -11,3 +11,6 @@ tokio = { version = "1.39.3", features = ["full"] } [dev-dependencies] dev = { path = "../dev" } jrest = "0.2.3" + +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tarpaulin_include)'] } diff --git a/src-tauri/dev/Cargo.toml b/src-tauri/dev/Cargo.toml index cb0aa920..2f675bc7 100644 --- a/src-tauri/dev/Cargo.toml +++ b/src-tauri/dev/Cargo.toml @@ -7,3 +7,6 @@ edition = "2021" [dev-dependencies] jrest = "0.2.3" + +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tarpaulin_include)'] } diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index bb01d382..18bfc297 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -30,12 +30,12 @@ fn main() { let window = app.get_window("main").expect("Could not get window."); window .set_size(LogicalSize:: { - height: 768, + height: 900, width: 1024, }) .expect("Could not set window size."); window - .set_always_on_top(true) + .set_always_on_top(false) .expect("Could not set always on top."); window.open_devtools(); diff --git a/src/App.tsx b/src/App.tsx index 2a0542d7..76dd4317 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,9 +1,10 @@ import { useState } from 'react' +import styled from 'styled-components' import { Toaster } from './components/Toaster' import { Page } from './constants' -import { Main } from './elements/Main' import { MainMenu } from './layouts/MainMenu' +import { TitleBar } from './layouts/TitleBar' import { Cloud } from './screens/Cloud' import { Dashboard } from './screens/Dashboard' import { Scanner } from './screens/Scanner' @@ -13,16 +14,30 @@ export function App() { const [page, setPage] = useState(Page.Dashboard) return ( - <> - -
- {page === Page.Dashboard && } - {page === Page.Scanner && } - {page === Page.Cloud && } - {page === Page.Config && } + + + + + <> + {page === Page.Dashboard && } + {page === Page.Scanner && } + {page === Page.Cloud && } + {page === Page.Config && } - -
- + + + + ) } + +const Box = styled.div` + display: flex; + flex-direction: column; + flex-grow: 1; +` + +const Content = styled.div` + display: flex; + flex-grow: 1; +` diff --git a/src/components/FileExplorer/Node.tsx b/src/components/FileExplorer/Node.tsx index ec65fb52..171d31b8 100644 --- a/src/components/FileExplorer/Node.tsx +++ b/src/components/FileExplorer/Node.tsx @@ -1,3 +1,4 @@ +import { MdArrowDropDown, MdArrowRight } from 'react-icons/md' import styled from 'styled-components' import type { Promisable } from 'type-fest' @@ -14,16 +15,15 @@ export function Node({ node, onCheck, onExpand, parentIsChecked }: NodeProps) { onCheck(node)} type="checkbox" /> - onExpand(node)} type="button"> - {node.is_expanded ? '🞃' : '🞂'} - - {/* biome-ignore lint/a11y/useKeyWithClickEvents: */} - onExpand(node)} style={{ cursor: 'pointer' }}> - {node.name} - + onExpand(node)}> + + {node.is_expanded ? : } + + {node.name} + - {node.children.map((nodeChild) => ( + {node.children.map(nodeChild => ( p.$depth}rem; + padding-left: ${p => p.$depth}rem; + + > div:not(:first-child) { + margin-top: 8px; + } ` const Row = styled.div` align-items: center; display: flex; - height: 32px; - - > span { - color: white; - font-size: 125%; - line-height: 1; - margin-left: 4px; - } + height: 24px; ` const Checkbox = styled.input` appearance: none; background-color: #fff; - border-radius: 0.15rem; - border: 0.15rem solid currentColor; + border-radius: 4px; + border: 0; color: currentColor; display: grid; - font: inherit; - height: 1.15rem; + height: 20px; margin: 0; place-content: center; transform: translateY(-0.075rem); - width: 1.15rem; + width: 20px; &::before { box-shadow: inset 1em 1em rebeccapurple; clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); content: ''; - height: 0.65rem; + height: 16px; transform-origin: bottom left; transform: scale(0); transition: 120ms transform ease-in-out; - width: 0.65rem; + width: 16px; /* Windows High Contrast Mode */ background-color: CanvasText; @@ -103,20 +98,30 @@ const Checkbox = styled.input` } &:focus { - outline: max(2px, 0.15rem) solid currentColor; - outline-offset: max(2px, 0.15rem); + outline: 0; + } +` + +const Clickable = styled.span` + align-items: center; + color: white; + cursor: pointer; + display: flex; + + * { + cursor: pointer; } ` -const ExpansionButton = styled.button<{ +const ExpandButton = styled.button<{ $isExpanded: boolean }>` background-color: transparent; border: 0; color: gray; - cursor: pointer; - font-size: 120%; - margin: ${(p) => (p.$isExpanded ? '6px' : '4px')} 4px 0 16px; + font-size: 150%; + line-height: 1; + margin: ${p => (p.$isExpanded ? '6px' : '4px')} 4px 0 16px; padding: 0; :hover { diff --git a/src/components/FileExplorer/index.tsx b/src/components/FileExplorer/index.tsx index 975794d9..89aa8d5d 100644 --- a/src/components/FileExplorer/index.tsx +++ b/src/components/FileExplorer/index.tsx @@ -13,7 +13,7 @@ type FileExplorerProps = { export function FileExplorer({ onCheck, onExpand, tree }: FileExplorerProps) { return ( - {tree.map((node) => ( + {tree.map(node => ( ))} @@ -21,6 +21,9 @@ export function FileExplorer({ onCheck, onExpand, tree }: FileExplorerProps) { } const Box = styled.div` + display: flex; + flex-direction: column; flex-grow: 1; + height: 384px; overflow-y: auto; ` diff --git a/src/components/Toaster.tsx b/src/components/Toaster.tsx index 9198441b..05cc53e1 100644 --- a/src/components/Toaster.tsx +++ b/src/components/Toaster.tsx @@ -70,7 +70,7 @@ export function Toaster() { return ( - {(thisToast) => ( + {thisToast => ( {({ icon, message }) => ( <> diff --git a/src/elements/Button.tsx b/src/elements/Button.tsx index 23905e7f..0d578953 100644 --- a/src/elements/Button.tsx +++ b/src/elements/Button.tsx @@ -7,7 +7,7 @@ export function Button({ ...nativeProps }: ButtonProps) { return } -const StyledButton = styled.button` +const StyledButton = styled.button.attrs({ className: 'Button' })` background-color: #3f80ea; border: solid 1px #3f80ea; border-radius: 5px; @@ -16,7 +16,7 @@ const StyledButton = styled.button` font-family: inherit; font-size: 100%; font-weight: 400; - padding: 0.5rem 1rem; + padding: 8px 16px; transition-delay: 0s, 0s, 0s, 0s; transition-duration: 0.15s, 0.15s, 0.15s, 0.15s; transition-property: color, background-color, border-color, box-shadow; diff --git a/src/elements/Logger.tsx b/src/elements/Logger.tsx index 0f62c6c2..5ca016f1 100644 --- a/src/elements/Logger.tsx +++ b/src/elements/Logger.tsx @@ -48,13 +48,16 @@ export const Logger = memo(UnmemoizedLogger, (prevProps, nextProps) => prevProps const Pre = styled.pre` background-color: black; - border-radius: 5px; + border-radius: 6px; cursor: text; color: white; flex-grow: 1; - margin: 16px 0 0; - max-width: 891px; - min-width: 0; + font-family: 'Reddit Mono', monospace; + font-size: 90%; + font-weight: 400; + margin: 0; + height: 384px; + width: 872px; opacity: 0.65; overflow-x: hidden; overflow-y: scroll; diff --git a/src/elements/Main.tsx b/src/elements/Main.tsx deleted file mode 100644 index ce231144..00000000 --- a/src/elements/Main.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import styled from 'styled-components' - -export const Main = styled.div` - align-items: center; - border-radius: 1rem; - display: flex; - flex-grow: 1; - justify-content: center; -` diff --git a/src/hooks/useForceUpdate.ts b/src/hooks/useForceUpdate.ts index b072cdf6..499e55e0 100644 --- a/src/hooks/useForceUpdate.ts +++ b/src/hooks/useForceUpdate.ts @@ -9,7 +9,7 @@ import type { DispatchWithoutAction } from 'react' * @see https://reactjs.org/docs/hooks-faq.html#is-there-something-like-forceupdate */ export function useForceUpdate() { - const [_, forceUpdate] = useReducer((x) => x + 1, 0) + const [_, forceUpdate] = useReducer(x => x + 1, 0) const forceDebouncedUpdate: DispatchWithoutAction = useMemo(() => debounce(forceUpdate, 500), []) diff --git a/src/index.tsx b/src/index.tsx index 5da26e53..f9129944 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -2,49 +2,48 @@ import React from 'react' import reactDom from 'react-dom/client' import { ThemeProvider, createGlobalStyle } from 'styled-components' +import '@fontsource/poppins/300.css' +import '@fontsource/poppins/400.css' +import '@fontsource/poppins/500.css' +import '@fontsource/reddit-mono/400.css' +import '@fontsource/reddit-mono/600.css' + import { App } from './App' // TODO Clean that. const GlobalStyleCustom = createGlobalStyle` - html, body { - height: 100%; - } - - body { - font-family: 'Poppins', sans-serif; - font-size: 100%; - font-weight: 300; - line-height: 1.5; - margin: 0; - color: #495057; - } - * { box-sizing: border-box; - } + cursor: default; + user-select: none; + -webkit-user-select: none; - :focus-visible { - outline: none; - } + &:focus-visible { + outline: none; + } - ::placeholder { - color: #6c757d; - } + &::placeholder { + color: #6c757d; + } - h1, h2, h3, h4, h5, h6, p { - margin: 0; - } + &::-webkit-scrollbar { + width: 12px; + } - * > p:not(:first-child) { - margin-top: 8px; - } + &::-webkit-scrollbar-track { + background-color: transparent; + } - * > .Tag:not(:first-child) { - margin-left: 8px; - } + &::-webkit-scrollbar-thumb { + background-color: #333333; + border-radius: 5px; + outline: 0; + } +} - html, body, #root { - height: 100%; + html { + display: flex; + max-height: 528px; overflow: hidden; width: 100%; } @@ -52,18 +51,29 @@ const GlobalStyleCustom = createGlobalStyle` body { background-color: #1b1f38; border-radius: 16px; + color: #495057; + display: flex; + flex-grow: 1; + font-family: 'Poppins', sans-serif; + font-size: 100%; + font-weight: 300; + line-height: 1.5; + margin: 0; + overflow: hidden; + } + + h1, h2, h3, h4, h5, h6, p { + margin: 0; } - body, #root { display: flex; + flex-direction: column; + height: 100%; + flex-grow: 1; + overflow: hidden; + width: 100%; } - - * { - cursor: default; - user-select: none; - -webkit-user-select: none; - } ` const root = reactDom.createRoot(document.getElementById('root') as HTMLElement) diff --git a/src/layouts/MainMenu/Button.tsx b/src/layouts/MainMenu/Button.tsx index 8b414db7..63b1c238 100644 --- a/src/layouts/MainMenu/Button.tsx +++ b/src/layouts/MainMenu/Button.tsx @@ -21,7 +21,7 @@ export function Button({ isActive, onClick, ...nativeProps }: ButtonProps) { const StyledButton = styled.button<{ $isActive: boolean }>` - background-color: ${(p) => (p.$isActive ? 'rgba(21, 23, 44, 0)' : 'rgb(21, 23, 44)')}; + background-color: ${p => (p.$isActive ? 'rgba(21, 23, 44, 0)' : 'rgb(21, 23, 44)')}; border: 0; border-radius: 0; cursor: pointer; @@ -33,13 +33,13 @@ const StyledButton = styled.button<{ } > svg { - fill: ${(p) => (p.$isActive ? 'rgba(255, 255, 255, 1)' : 'rgba(255, 255, 255, 0.5)')}; + fill: ${p => (p.$isActive ? 'rgba(255, 255, 255, 1)' : 'rgba(255, 255, 255, 0.5)')}; height: 3rem; width: 3rem; } &:hover { > svg { - fill: ${(p) => (p.$isActive ? 'rgba(255, 255, 255, 1)' : 'rgba(255, 255, 255, 0.75)')}; + fill: ${p => (p.$isActive ? 'rgba(255, 255, 255, 1)' : 'rgba(255, 255, 255, 0.75)')}; } } ` diff --git a/src/layouts/MainMenu/index.tsx b/src/layouts/MainMenu/index.tsx index 28aad8a6..9132ba25 100644 --- a/src/layouts/MainMenu/index.tsx +++ b/src/layouts/MainMenu/index.tsx @@ -10,7 +10,7 @@ type MainMenuProps = { } export function MainMenu({ currentPage, onChange }: MainMenuProps) { return ( - + @@ -30,5 +30,7 @@ export function MainMenu({ currentPage, onChange }: MainMenuProps) { const Box = styled.div` display: flex; flex-direction: column; - width: 6rem; + height: 100%; + max-width: 120px; + min-width: 120px; ` diff --git a/src/layouts/Screen.tsx b/src/layouts/Screen.tsx index f0ffc575..5190f51e 100644 --- a/src/layouts/Screen.tsx +++ b/src/layouts/Screen.tsx @@ -20,16 +20,15 @@ export function Screen({ children, isLoading }: ScreenProps) { return {children} } -const Box = styled.div<{ +const Box = styled.div.attrs({ className: 'Screen' })<{ $isLoading?: boolean }>` display: flex; - flex-direction: ${(p) => (p.$isLoading ? 'row' : 'column')}; + flex-direction: ${p => (p.$isLoading ? 'row' : 'column')}; flex-grow: 1; - height: 100%; - padding: 1rem; + padding: 16px; - ${(p) => + ${p => p.$isLoading && css` align-items: center; diff --git a/src/layouts/TitleBar.tsx b/src/layouts/TitleBar.tsx new file mode 100644 index 00000000..45077ae0 --- /dev/null +++ b/src/layouts/TitleBar.tsx @@ -0,0 +1,29 @@ +import styled from 'styled-components' + +export function TitleBar() { + return ( + + ClamAV Desktop + + ) +} + +const Box = styled.div` + align-items: center; + background-color: rgb(21, 23, 44); + border-top-left-radius: 16px; + border-top-right-radius: 16px; + display: flex; + max-height: 48px; + min-height: 48px; + justify-content: center; + width: 100%; +` + +const Title = styled.span` + color: white; + display: block; + font-weight: 400; + font-size: 110%; + opacity: 0.1; +` diff --git a/src/screens/Cloud.tsx b/src/screens/Cloud.tsx index 1299c98f..774c3c12 100644 --- a/src/screens/Cloud.tsx +++ b/src/screens/Cloud.tsx @@ -31,7 +31,7 @@ export function Cloud() { useEffect(() => { invoke('get_cloud_state') - listen('cloud:state', (event) => { + listen('cloud:state', event => { setState(event.payload) }) @@ -48,26 +48,27 @@ export function Cloud() { return ( + {logsAsString} + {!!state && state.daemon_status === Core.CloudDaemonStatus.RUNNING && ( <> - )} {!!state && state.daemon_status === Core.CloudDaemonStatus.STOPPED && ( - )} {!!state && state.daemon_status === Core.CloudDaemonStatus.UNKNOWN && ( - )} - {!!state && state.is_running ? ( - ) : ( @@ -75,15 +76,13 @@ export function Cloud() { data-testid="cloud__button" disabled={!state || state.daemon_status !== Core.CloudDaemonStatus.STOPPED} onClick={startCloudUpdate} - style={{ marginTop: 8 }} + style={{ marginTop: 16 }} > {state?.daemon_status === Core.CloudDaemonStatus.STOPPED ? 'Update Virus Database' : 'Stop the Cloud Daemon first if you want to update manually'} )} - - {logsAsString} ) } diff --git a/src/screens/Dashboard.tsx b/src/screens/Dashboard.tsx index 5e5e0ab5..8e2cd6aa 100644 --- a/src/screens/Dashboard.tsx +++ b/src/screens/Dashboard.tsx @@ -28,7 +28,7 @@ export function Dashboard() { useEffect(() => { invoke('get_dashboard_state') - listen('dashboard:state', (event) => { + listen('dashboard:state', event => { setState(event.payload) }) @@ -45,23 +45,23 @@ export function Dashboard() { return ( + {logsAsString} + {(!state?.is_ready || state.status === Core.DashboardStatus.UNKNOWN) && ( - )} {!!state && state.is_ready && state.status === Core.DashboardStatus.RUNNING && ( - )} {!!state && state.is_ready && state.status === Core.DashboardStatus.STOPPED && ( - )} - - {logsAsString} ) } diff --git a/src/screens/Scanner.tsx b/src/screens/Scanner.tsx index ad012411..26574f45 100644 --- a/src/screens/Scanner.tsx +++ b/src/screens/Scanner.tsx @@ -41,11 +41,11 @@ export function Scanner() { useEffect(() => { invoke('load_scanner_state') - listen('scanner:state', (event) => { + listen('scanner:state', event => { setState(event.payload) }) - listen('scanner:status', (event) => { + listen('scanner:status', event => { setStatus(event.payload) }) }, [setState, setStatus]) @@ -55,41 +55,50 @@ export function Scanner() { return ( {!!state && !state.is_running && ( - <> + - - + + )} {!!state && state.is_running && status && ( - <> - + + {numeral(status.progress || 0).format('0.00%')} 0}> {!!currentFilePath && currentFilePath.length > 0 ? currentFilePath : `${status?.step}...`} - + - + )} ) } const Box = styled.div` + display: flex; + flex-direction: column; + flex-grow: 1; +` + +const InnerBox = styled.div` align-items: center; display: flex; flex-direction: column; diff --git a/src/screens/Settings/constants.ts b/src/screens/Settings/constants.ts index 6ccf0a5c..69d18e6a 100644 --- a/src/screens/Settings/constants.ts +++ b/src/screens/Settings/constants.ts @@ -34,6 +34,8 @@ export const CODE_MIRROR_THEME = createTheme({ settings: { background: '#000000', caret: '#c9d1d9', + fontFamily: "'Reddit Mono', monospace", + fontSize: '90%', foreground: '#c9d1d9', gutterBackground: 'transparent', gutterBorder: 'transparent', @@ -56,13 +58,13 @@ export const CODE_MIRROR_THEME = createTheme({ { color: '#bb9af7', tag: [t.operator, t.operatorKeyword] }, { color: '#b4f9f8', tag: [t.url, t.escape, t.regexp, t.link] }, { color: '#444b6a', tag: [t.meta, t.comment] }, - { fontWeight: 'bold', tag: t.strong }, + { fontWeight: '600', tag: t.strong }, { fontStyle: 'italic', tag: t.emphasis }, - { tag: t.link, textDecoration: 'underline' }, - { color: '#89ddff', fontWeight: 'bold', tag: t.heading }, + { fontWeight: '400', tag: t.link, textDecoration: 'underline' }, + { color: '#89ddff', fontWeight: '600', tag: t.heading }, { color: '#c0caf5', tag: [t.atom, t.bool, t.special(t.variableName)] }, { color: '#ff5370', tag: t.invalid }, - { tag: t.strikethrough, textDecoration: 'line-through' }, + { fontWeight: '400', tag: t.strikethrough, textDecoration: 'line-through' }, ], theme: 'dark', }) diff --git a/src/screens/Settings/index.tsx b/src/screens/Settings/index.tsx index cf1451ba..7efbcc8e 100644 --- a/src/screens/Settings/index.tsx +++ b/src/screens/Settings/index.tsx @@ -40,7 +40,7 @@ export function Settings() { nextSource: clamdConfFileSourceRef.current, }) - updateState((prevState) => ({ + updateState(prevState => ({ ...prevState, // biome-ignore lint/style/useNamingConvention: Core event data. is_writing: true, @@ -65,7 +65,7 @@ export function Settings() { useEffect(() => { invoke('load_settings_state') - listen('settings:state', (event) => { + listen('settings:state', event => { setState(event.payload) clamdConfFileSourceRef.current = event.payload.clamd_conf_file_source @@ -73,35 +73,29 @@ export function Settings() { }, [setState]) return ( - + {!!state.clamd_conf_file_source && ( - )} - + ) } -const Box = styled.div` - display: flex; - flex-direction: column; - - .cm-editor { - margin-bottom: 16px; - } - +const StyledScreen = styled(Screen)` .cm-scroller { &::-webkit-scrollbar { width: 12px; @@ -121,3 +115,31 @@ const Box = styled.div` cursor: text; } ` + +const Box = styled.div` + display: flex; + flex-direction: column; + flex-grow: 1; + + > .cm-theme { + font-weight: 400; + + > .cm-editor { + border-radius: 6px; + + > .cm-scroller { + > .cm-gutters { + padding: 0 8px 0 8px; + } + + > .cm-content { + padding: 0; + + > .cm-line { + cursor: text; + } + } + } + } + } +` diff --git a/yarn.lock b/yarn.lock index 9c71e01a..d1efad49 100644 --- a/yarn.lock +++ b/yarn.lock @@ -32,86 +32,58 @@ __metadata: languageName: node linkType: hard -"@babel/compat-data@npm:^7.24.7": - version: 7.24.7 - resolution: "@babel/compat-data@npm:7.24.7" - checksum: 10/6edc09152ca51a22c33741c441f33f9475598fa59edc53369edb74b49f4ea4bef1281f5b0ed2b9b67fb66faef2da2069e21c4eef83405d8326e524b301f4e7e2 +"@babel/compat-data@npm:^7.25.2": + version: 7.25.4 + resolution: "@babel/compat-data@npm:7.25.4" + checksum: 10/d37a8936cc355a9ca3050102e03d179bdae26bd2e5c99a977637376c192b23637a039795f153c849437a086727628c9860e2c6af92d7151396e2362c09176337 languageName: node linkType: hard "@babel/core@npm:^7.11.6, @babel/core@npm:^7.12.3, @babel/core@npm:^7.23.9, @babel/core@npm:^7.24.5": - version: 7.24.7 - resolution: "@babel/core@npm:7.24.7" + version: 7.25.2 + resolution: "@babel/core@npm:7.25.2" dependencies: "@ampproject/remapping": "npm:^2.2.0" "@babel/code-frame": "npm:^7.24.7" - "@babel/generator": "npm:^7.24.7" - "@babel/helper-compilation-targets": "npm:^7.24.7" - "@babel/helper-module-transforms": "npm:^7.24.7" - "@babel/helpers": "npm:^7.24.7" - "@babel/parser": "npm:^7.24.7" - "@babel/template": "npm:^7.24.7" - "@babel/traverse": "npm:^7.24.7" - "@babel/types": "npm:^7.24.7" + "@babel/generator": "npm:^7.25.0" + "@babel/helper-compilation-targets": "npm:^7.25.2" + "@babel/helper-module-transforms": "npm:^7.25.2" + "@babel/helpers": "npm:^7.25.0" + "@babel/parser": "npm:^7.25.0" + "@babel/template": "npm:^7.25.0" + "@babel/traverse": "npm:^7.25.2" + "@babel/types": "npm:^7.25.2" convert-source-map: "npm:^2.0.0" debug: "npm:^4.1.0" gensync: "npm:^1.0.0-beta.2" json5: "npm:^2.2.3" semver: "npm:^6.3.1" - checksum: 10/ef8cc1afa3ccecee6d1f5660c487ccc2a3f25106830ea9040e80ef4b2092e053607ee4ddd03493e4f7ef2f9967a956ca53b830d54c5bee738eeb58cce679dd4a + checksum: 10/0d6ec10ff430df66f654c089d6f7ef1d9bed0c318ac257ad5f0dfa0caa45666011828ae75f998bcdb279763e892b091b2925d0bc483299e61649d2c7a2245e33 languageName: node linkType: hard -"@babel/generator@npm:^7.24.7, @babel/generator@npm:^7.7.2": - version: 7.24.7 - resolution: "@babel/generator@npm:7.24.7" +"@babel/generator@npm:^7.25.0, @babel/generator@npm:^7.25.4, @babel/generator@npm:^7.7.2": + version: 7.25.4 + resolution: "@babel/generator@npm:7.25.4" dependencies: - "@babel/types": "npm:^7.24.7" + "@babel/types": "npm:^7.25.4" "@jridgewell/gen-mapping": "npm:^0.3.5" "@jridgewell/trace-mapping": "npm:^0.3.25" jsesc: "npm:^2.5.1" - checksum: 10/c71d24a4b41b19c10d2f2eb819f27d4cf94220e2322f7c8fed8bfbbb115b2bebbdd6dc1f27dac78a175e90604def58d763af87e0fa81ce4ab1582858162cf768 + checksum: 10/35b05e1f230649469c64971e034b5101079c37d23f8cc658323f1209e39daf58d29ec4ce6de1d6d31dacddd39ffbf6b7e9a2b124d4f6b360a5f7046ae10fbaf4 languageName: node linkType: hard -"@babel/helper-compilation-targets@npm:^7.24.7": - version: 7.24.7 - resolution: "@babel/helper-compilation-targets@npm:7.24.7" +"@babel/helper-compilation-targets@npm:^7.25.2": + version: 7.25.2 + resolution: "@babel/helper-compilation-targets@npm:7.25.2" dependencies: - "@babel/compat-data": "npm:^7.24.7" - "@babel/helper-validator-option": "npm:^7.24.7" - browserslist: "npm:^4.22.2" + "@babel/compat-data": "npm:^7.25.2" + "@babel/helper-validator-option": "npm:^7.24.8" + browserslist: "npm:^4.23.1" lru-cache: "npm:^5.1.1" semver: "npm:^6.3.1" - checksum: 10/8f8bc89af70a606ccb208513aa25d83e19b88f91b64a33174f7701a9479e67ddbb0a9c89033265070375cd24e690b93380b3a3ea11e4b3a711d742f0f4699ee7 - languageName: node - linkType: hard - -"@babel/helper-environment-visitor@npm:^7.24.7": - version: 7.24.7 - resolution: "@babel/helper-environment-visitor@npm:7.24.7" - dependencies: - "@babel/types": "npm:^7.24.7" - checksum: 10/079d86e65701b29ebc10baf6ed548d17c19b808a07aa6885cc141b690a78581b180ee92b580d755361dc3b16adf975b2d2058b8ce6c86675fcaf43cf22f2f7c6 - languageName: node - linkType: hard - -"@babel/helper-function-name@npm:^7.24.7": - version: 7.24.7 - resolution: "@babel/helper-function-name@npm:7.24.7" - dependencies: - "@babel/template": "npm:^7.24.7" - "@babel/types": "npm:^7.24.7" - checksum: 10/2ceb3d9b2b35a0fc4100fc06ed7be3bc38f03ff0bf128ff0edbc0cc7dd842967b1496fc70b5c616c747d7711c2b87e7d025c8888f48740631d6148a9d3614f85 - languageName: node - linkType: hard - -"@babel/helper-hoist-variables@npm:^7.24.7": - version: 7.24.7 - resolution: "@babel/helper-hoist-variables@npm:7.24.7" - dependencies: - "@babel/types": "npm:^7.24.7" - checksum: 10/6cfdcf2289cd12185dcdbdf2435fa8d3447b797ac75851166de9fc8503e2fd0021db6baf8dfbecad3753e582c08e6a3f805c8d00cbed756060a877d705bd8d8d + checksum: 10/eccb2d75923d2d4d596f9ff64716e8664047c4192f1b44c7d5c07701d4a3498ac2587a72ddae1046e65a501bc630eb7df4557958b08ec2dcf5b4a264a052f111 languageName: node linkType: hard @@ -125,25 +97,24 @@ __metadata: languageName: node linkType: hard -"@babel/helper-module-transforms@npm:^7.24.7": - version: 7.24.7 - resolution: "@babel/helper-module-transforms@npm:7.24.7" +"@babel/helper-module-transforms@npm:^7.25.2": + version: 7.25.2 + resolution: "@babel/helper-module-transforms@npm:7.25.2" dependencies: - "@babel/helper-environment-visitor": "npm:^7.24.7" "@babel/helper-module-imports": "npm:^7.24.7" "@babel/helper-simple-access": "npm:^7.24.7" - "@babel/helper-split-export-declaration": "npm:^7.24.7" "@babel/helper-validator-identifier": "npm:^7.24.7" + "@babel/traverse": "npm:^7.25.2" peerDependencies: "@babel/core": ^7.0.0 - checksum: 10/4f2b232bf6d1be8d3a72b084a2a7ac1b0b93ea85717411a11ae1fb6375d4392019e781d8cc155789e649a2caa7eec378dd1404210603d6d4230f042c5feacffb + checksum: 10/a3bcf7815f3e9d8b205e0af4a8d92603d685868e45d119b621357e274996bf916216bb95ab5c6a60fde3775b91941555bf129d608e3d025b04f8aac84589f300 languageName: node linkType: hard -"@babel/helper-plugin-utils@npm:^7.0.0, @babel/helper-plugin-utils@npm:^7.10.4, @babel/helper-plugin-utils@npm:^7.12.13, @babel/helper-plugin-utils@npm:^7.14.5, @babel/helper-plugin-utils@npm:^7.24.7, @babel/helper-plugin-utils@npm:^7.8.0": - version: 7.24.7 - resolution: "@babel/helper-plugin-utils@npm:7.24.7" - checksum: 10/dad51622f0123fdba4e2d40a81a6b7d6ef4b1491b2f92fd9749447a36bde809106cf117358705057a2adc8fd73d5dc090222e0561b1213dae8601c8367f5aac8 +"@babel/helper-plugin-utils@npm:^7.0.0, @babel/helper-plugin-utils@npm:^7.10.4, @babel/helper-plugin-utils@npm:^7.12.13, @babel/helper-plugin-utils@npm:^7.14.5, @babel/helper-plugin-utils@npm:^7.24.7, @babel/helper-plugin-utils@npm:^7.24.8, @babel/helper-plugin-utils@npm:^7.8.0": + version: 7.24.8 + resolution: "@babel/helper-plugin-utils@npm:7.24.8" + checksum: 10/adbc9fc1142800a35a5eb0793296924ee8057fe35c61657774208670468a9fbfbb216f2d0bc46c680c5fefa785e5ff917cc1674b10bd75cdf9a6aa3444780630 languageName: node linkType: hard @@ -157,19 +128,10 @@ __metadata: languageName: node linkType: hard -"@babel/helper-split-export-declaration@npm:^7.24.7": - version: 7.24.7 - resolution: "@babel/helper-split-export-declaration@npm:7.24.7" - dependencies: - "@babel/types": "npm:^7.24.7" - checksum: 10/ff04a3071603c87de0d6ee2540b7291ab36305b329bd047cdbb6cbd7db335a12f9a77af1cf708779f75f13c4d9af46093c00b34432e50b2411872c658d1a2e5e - languageName: node - linkType: hard - -"@babel/helper-string-parser@npm:^7.24.7": - version: 7.24.7 - resolution: "@babel/helper-string-parser@npm:7.24.7" - checksum: 10/603d8d962bbe89907aa99a8f19a006759ab7b2464615f20a6a22e3e2e8375af37ddd0e5175c9e622e1c4b2d83607ffb41055a59d0ce34404502af30fde573a5c +"@babel/helper-string-parser@npm:^7.24.8": + version: 7.24.8 + resolution: "@babel/helper-string-parser@npm:7.24.8" + checksum: 10/6d1bf8f27dd725ce02bdc6dffca3c95fb9ab8a06adc2edbd9c1c9d68500274230d1a609025833ed81981eff560045b6b38f7b4c6fb1ab19fc90e5004e3932535 languageName: node linkType: hard @@ -180,20 +142,20 @@ __metadata: languageName: node linkType: hard -"@babel/helper-validator-option@npm:^7.24.7": - version: 7.24.7 - resolution: "@babel/helper-validator-option@npm:7.24.7" - checksum: 10/9689166bf3f777dd424c026841c8cd651e41b21242dbfd4569a53086179a3e744c8eddd56e9d10b54142270141c91581b53af0d7c00c82d552d2540e2a919f7e +"@babel/helper-validator-option@npm:^7.24.8": + version: 7.24.8 + resolution: "@babel/helper-validator-option@npm:7.24.8" + checksum: 10/a52442dfa74be6719c0608fee3225bd0493c4057459f3014681ea1a4643cd38b68ff477fe867c4b356da7330d085f247f0724d300582fa4ab9a02efaf34d107c languageName: node linkType: hard -"@babel/helpers@npm:^7.24.7": - version: 7.24.7 - resolution: "@babel/helpers@npm:7.24.7" +"@babel/helpers@npm:^7.25.0": + version: 7.25.0 + resolution: "@babel/helpers@npm:7.25.0" dependencies: - "@babel/template": "npm:^7.24.7" - "@babel/types": "npm:^7.24.7" - checksum: 10/f7496f0d7a0b13ea86136ac2053371027125734170328215f8a90eac96fafaaae4e5398c0729bdadf23261c00582a31e14bc70113427653b718220641a917f9d + "@babel/template": "npm:^7.25.0" + "@babel/types": "npm:^7.25.0" + checksum: 10/4fcb8167eba9853e30b8b235b81b923ef7b707396b0e23d7a4fa3e811729506755576cb9ec736e8b92cf19e5a1ec61e83d182904d8e6a0953803c6bebc2e1592 languageName: node linkType: hard @@ -209,12 +171,14 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.23.9, @babel/parser@npm:^7.24.7": - version: 7.24.7 - resolution: "@babel/parser@npm:7.24.7" +"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.23.9, @babel/parser@npm:^7.25.0, @babel/parser@npm:^7.25.4": + version: 7.25.4 + resolution: "@babel/parser@npm:7.25.4" + dependencies: + "@babel/types": "npm:^7.25.4" bin: parser: ./bin/babel-parser.js - checksum: 10/ef9ebce60e13db560ccc7af9235d460f6726bb7e23ae2d675098c1fc43d5249067be60d4118889dad33b1d4f85162cf66baf554719e1669f29bb20e71322568e + checksum: 10/343b8a76c43549e370fe96f4f6d564382a6cdff60e9c3b8a594c51e4cefd58ec9945e82e8c4dfbf15ac865a04e4b29806531440760748e28568e6aec21bc9cb5 languageName: node linkType: hard @@ -240,7 +204,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-class-properties@npm:^7.8.3": +"@babel/plugin-syntax-class-properties@npm:^7.12.13": version: 7.12.13 resolution: "@babel/plugin-syntax-class-properties@npm:7.12.13" dependencies: @@ -251,7 +215,29 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-import-meta@npm:^7.8.3": +"@babel/plugin-syntax-class-static-block@npm:^7.14.5": + version: 7.14.5 + resolution: "@babel/plugin-syntax-class-static-block@npm:7.14.5" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.14.5" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/3e80814b5b6d4fe17826093918680a351c2d34398a914ce6e55d8083d72a9bdde4fbaf6a2dcea0e23a03de26dc2917ae3efd603d27099e2b98380345703bf948 + languageName: node + linkType: hard + +"@babel/plugin-syntax-import-attributes@npm:^7.24.7": + version: 7.24.7 + resolution: "@babel/plugin-syntax-import-attributes@npm:7.24.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.24.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/22fc50bd85a491bb8d22065f330a41f60d66f2f2d7a1deb73e80c8a4b5d7a42a092a03f8da18800650eca0fc14585167cc4e5c9fab351f0d390d1592347162ae + languageName: node + linkType: hard + +"@babel/plugin-syntax-import-meta@npm:^7.10.4": version: 7.10.4 resolution: "@babel/plugin-syntax-import-meta@npm:7.10.4" dependencies: @@ -284,7 +270,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-logical-assignment-operators@npm:^7.8.3": +"@babel/plugin-syntax-logical-assignment-operators@npm:^7.10.4": version: 7.10.4 resolution: "@babel/plugin-syntax-logical-assignment-operators@npm:7.10.4" dependencies: @@ -306,7 +292,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-numeric-separator@npm:^7.8.3": +"@babel/plugin-syntax-numeric-separator@npm:^7.10.4": version: 7.10.4 resolution: "@babel/plugin-syntax-numeric-separator@npm:7.10.4" dependencies: @@ -350,7 +336,18 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-top-level-await@npm:^7.8.3": +"@babel/plugin-syntax-private-property-in-object@npm:^7.14.5": + version: 7.14.5 + resolution: "@babel/plugin-syntax-private-property-in-object@npm:7.14.5" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.14.5" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/b317174783e6e96029b743ccff2a67d63d38756876e7e5d0ba53a322e38d9ca452c13354a57de1ad476b4c066dbae699e0ca157441da611117a47af88985ecda + languageName: node + linkType: hard + +"@babel/plugin-syntax-top-level-await@npm:^7.14.5": version: 7.14.5 resolution: "@babel/plugin-syntax-top-level-await@npm:7.14.5" dependencies: @@ -362,13 +359,13 @@ __metadata: linkType: hard "@babel/plugin-syntax-typescript@npm:^7.7.2": - version: 7.24.7 - resolution: "@babel/plugin-syntax-typescript@npm:7.24.7" + version: 7.25.4 + resolution: "@babel/plugin-syntax-typescript@npm:7.25.4" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.7" + "@babel/helper-plugin-utils": "npm:^7.24.8" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10/2518cc06323f5673c93142935879c112fea0ee836dfa9a9ec744fc972fdeaf22a06fe631c23817562aaaddadf64626a4fbba98c300b3e2c828f48f0f1cca0ce0 + checksum: 10/0771b45a35fd536cd3b3a48e5eda0f53e2d4f4a0ca07377cc247efa39eaf6002ed1c478106aad2650e54aefaebcb4f34f3284c4ae9252695dbd944bf66addfb0 languageName: node linkType: hard @@ -395,51 +392,48 @@ __metadata: linkType: hard "@babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.18.6, @babel/runtime@npm:^7.7.2, @babel/runtime@npm:^7.8.7, @babel/runtime@npm:^7.9.2": - version: 7.24.7 - resolution: "@babel/runtime@npm:7.24.7" + version: 7.25.4 + resolution: "@babel/runtime@npm:7.25.4" dependencies: regenerator-runtime: "npm:^0.14.0" - checksum: 10/7b77f566165dee62db3db0296e71d08cafda3f34e1b0dcefcd68427272e17c1704f4e4369bff76651b07b6e49d3ea5a0ce344818af9116e9292e4381e0918c76 + checksum: 10/70d2a420c24a3289ea6c4addaf3a1c4186bc3d001c92445faa3cd7601d7d2fbdb32c63b3a26b9771e20ff2f511fa76b726bf256f823cdb95bc37b8eadbd02f70 languageName: node linkType: hard -"@babel/template@npm:^7.24.7, @babel/template@npm:^7.3.3": - version: 7.24.7 - resolution: "@babel/template@npm:7.24.7" +"@babel/template@npm:^7.25.0, @babel/template@npm:^7.3.3": + version: 7.25.0 + resolution: "@babel/template@npm:7.25.0" dependencies: "@babel/code-frame": "npm:^7.24.7" - "@babel/parser": "npm:^7.24.7" - "@babel/types": "npm:^7.24.7" - checksum: 10/5975d404ef51cf379515eb0f80b115981d0b9dff5539e53a47516644abb8c83d7559f5b083eb1d4977b20d8359ebb2f911ccd4f729143f8958fdc465f976d843 + "@babel/parser": "npm:^7.25.0" + "@babel/types": "npm:^7.25.0" + checksum: 10/07ebecf6db8b28244b7397628e09c99e7a317b959b926d90455c7253c88df3677a5a32d1501d9749fe292a263ff51a4b6b5385bcabd5dadd3a48036f4d4949e0 languageName: node linkType: hard -"@babel/traverse@npm:^7.24.7": - version: 7.24.7 - resolution: "@babel/traverse@npm:7.24.7" +"@babel/traverse@npm:^7.24.7, @babel/traverse@npm:^7.25.2": + version: 7.25.4 + resolution: "@babel/traverse@npm:7.25.4" dependencies: "@babel/code-frame": "npm:^7.24.7" - "@babel/generator": "npm:^7.24.7" - "@babel/helper-environment-visitor": "npm:^7.24.7" - "@babel/helper-function-name": "npm:^7.24.7" - "@babel/helper-hoist-variables": "npm:^7.24.7" - "@babel/helper-split-export-declaration": "npm:^7.24.7" - "@babel/parser": "npm:^7.24.7" - "@babel/types": "npm:^7.24.7" + "@babel/generator": "npm:^7.25.4" + "@babel/parser": "npm:^7.25.4" + "@babel/template": "npm:^7.25.0" + "@babel/types": "npm:^7.25.4" debug: "npm:^4.3.1" globals: "npm:^11.1.0" - checksum: 10/785cf26383a992740e492efba7016de964cd06c05c9d7146fa1b5ead409e054c444f50b36dc37856884a56e32cf9d3105ddf1543486b6df68300bffb117a245a + checksum: 10/a85c16047ab8e454e2e758c75c31994cec328bd6d8b4b22e915fa7393a03b3ab96d1218f43dc7ef77c957cc488dc38100bdf504d08a80a131e89b2e49cfa2be5 languageName: node linkType: hard -"@babel/types@npm:^7.0.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.24.7, @babel/types@npm:^7.3.3, @babel/types@npm:^7.8.3": - version: 7.24.7 - resolution: "@babel/types@npm:7.24.7" +"@babel/types@npm:^7.0.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.24.7, @babel/types@npm:^7.25.0, @babel/types@npm:^7.25.2, @babel/types@npm:^7.25.4, @babel/types@npm:^7.3.3": + version: 7.25.4 + resolution: "@babel/types@npm:7.25.4" dependencies: - "@babel/helper-string-parser": "npm:^7.24.7" + "@babel/helper-string-parser": "npm:^7.24.8" "@babel/helper-validator-identifier": "npm:^7.24.7" to-fast-properties: "npm:^2.0.0" - checksum: 10/ad3c8c0d6fb4acb0bb74bb5b4bb849b181bf6185677ef9c59c18856c81e43628d0858253cf232f0eca806f02e08eff85a1d3e636a3e94daea737597796b0b430 + checksum: 10/d4a1194612d0a2a6ce9a0be325578b43d74e5f5278c67409468ba0a924341f0ad349ef0245ee8a36da3766efe5cc59cd6bb52547674150f97d8dc4c8cfa5d6b8 languageName: node linkType: hard @@ -542,8 +536,8 @@ __metadata: linkType: hard "@codemirror/autocomplete@npm:^6.0.0, @codemirror/autocomplete@npm:^6.3.2, @codemirror/autocomplete@npm:^6.7.1": - version: 6.16.2 - resolution: "@codemirror/autocomplete@npm:6.16.2" + version: 6.18.0 + resolution: "@codemirror/autocomplete@npm:6.18.0" dependencies: "@codemirror/language": "npm:^6.0.0" "@codemirror/state": "npm:^6.0.0" @@ -554,7 +548,7 @@ __metadata: "@codemirror/state": ^6.0.0 "@codemirror/view": ^6.0.0 "@lezer/common": ^1.0.0 - checksum: 10/0573740e55d80347df92f9ef638dc2f0dbecb99db1740daae45942fe8c39d40b90a7417ae7bf35129743d7525509a2e97fd853795652ea8b82687a712b668761 + checksum: 10/29cf0857bc81ef1d7de963863b96d9597cbd90d992578a8d91943b5ca2b97f6e0c7c5f868ee9c2f844c1466f11b40799502e0237ee4c45394335c47af3b4765f languageName: node linkType: hard @@ -778,8 +772,8 @@ __metadata: linkType: hard "@codemirror/lang-sql@npm:^6.0.0, @codemirror/lang-sql@npm:^6.4.0": - version: 6.6.4 - resolution: "@codemirror/lang-sql@npm:6.6.4" + version: 6.7.1 + resolution: "@codemirror/lang-sql@npm:6.7.1" dependencies: "@codemirror/autocomplete": "npm:^6.0.0" "@codemirror/language": "npm:^6.0.0" @@ -787,7 +781,7 @@ __metadata: "@lezer/common": "npm:^1.2.0" "@lezer/highlight": "npm:^1.0.0" "@lezer/lr": "npm:^1.0.0" - checksum: 10/03475559063011c626e0d0dbb3c1018fa91b37e97b931125496ac53ad2a54046c710ac170cd5e912d4621566a760edf298c3819fa6b97f2fa622933b5fc94767 + checksum: 10/a0d2af06bd00c79459739a275f979444326ba33ce91ab397ebfa78b6f803d7ad20cb69915a82209b4fe62577f3f4184e6942dcdd1c9c0d76a2981504dab51da1 languageName: node linkType: hard @@ -890,22 +884,22 @@ __metadata: linkType: hard "@codemirror/legacy-modes@npm:>=6.0.0, @codemirror/legacy-modes@npm:^6.4.0": - version: 6.4.0 - resolution: "@codemirror/legacy-modes@npm:6.4.0" + version: 6.4.1 + resolution: "@codemirror/legacy-modes@npm:6.4.1" dependencies: "@codemirror/language": "npm:^6.0.0" - checksum: 10/0f3f47cd867c95704ee7648eeb41b991f736ccd9ef4f6668210a82386333d3bc5e1beb6fa60391f6064327d6ac2037b17428decdee440c115a553f280a75bf61 + checksum: 10/3b2256905d62d7b700495ecec296db10f77b3ecd41cb9a55441c45b21b067da67a1e6fe28bef1bf079957e4c33376f3a282b68f8745c6ef522e1cd992c9f9119 languageName: node linkType: hard "@codemirror/lint@npm:^6.0.0": - version: 6.8.0 - resolution: "@codemirror/lint@npm:6.8.0" + version: 6.8.1 + resolution: "@codemirror/lint@npm:6.8.1" dependencies: "@codemirror/state": "npm:^6.0.0" "@codemirror/view": "npm:^6.0.0" crelt: "npm:^1.0.5" - checksum: 10/36424cb20e2f9fc7b01180100a8be84208805acf99ab647d001c937149d1df3af5e08f2181dcf7912c59c9704247d7d040189571e19585ea043a9d3b0bbb0d2e + checksum: 10/4ad146daa834b1a0429cdcb029b9cc18f0a06b9f555b8160496cbfa887ad1621172b99ab10799fd96170daf5d189feac6c4e30d7de6e95348576bf5a401e24f5 languageName: node linkType: hard @@ -940,13 +934,13 @@ __metadata: linkType: hard "@codemirror/view@npm:^6.0.0, @codemirror/view@npm:^6.17.0, @codemirror/view@npm:^6.23.0, @codemirror/view@npm:^6.27.0": - version: 6.27.0 - resolution: "@codemirror/view@npm:6.27.0" + version: 6.32.0 + resolution: "@codemirror/view@npm:6.32.0" dependencies: "@codemirror/state": "npm:^6.4.0" style-mod: "npm:^4.1.0" w3c-keyname: "npm:^2.2.4" - checksum: 10/dc57315690cd575897a69e3d64fc84d7268a5181fd9e7770d3cfda1c287352f818c667e44c88b2a7368c222d27f5ad0ee60c544dd3a35078217188a7bb10990d + checksum: 10/bd67efbf692027175bff3a90620f32776eab203edd1bb4ccd57043203b30c12de65cac0ca5a36ab718c7f8d7105475905515383862d0c1ccf80b8412d9a3f295 languageName: node linkType: hard @@ -1344,6 +1338,20 @@ __metadata: languageName: node linkType: hard +"@fontsource/poppins@npm:5.0.14": + version: 5.0.14 + resolution: "@fontsource/poppins@npm:5.0.14" + checksum: 10/72683d2428d8198a25d35e47a3933dc9f7979dc954a9050e1516f01f582af44836c8c4a4d621d0f94d71f0f380c61dc028abbb2c4a2d866a5d425447d4de044a + languageName: node + linkType: hard + +"@fontsource/reddit-mono@npm:5.0.3": + version: 5.0.3 + resolution: "@fontsource/reddit-mono@npm:5.0.3" + checksum: 10/3a35291fa9536c8ecc48768fb9ff13a21ccbc4ee0dac92f7ca76f4095bbc8ac0ae14768a05787829c0b0c8cd6c5cb071ed2fd2dfb5188f9877c4159109825977 + languageName: node + linkType: hard + "@isaacs/cliui@npm:^8.0.2": version: 8.0.2 resolution: "@isaacs/cliui@npm:8.0.2" @@ -1378,12 +1386,12 @@ __metadata: languageName: node linkType: hard -"@ivangabriele/biome-config@npm:1.3.0": - version: 1.3.0 - resolution: "@ivangabriele/biome-config@npm:1.3.0" +"@ivangabriele/biome-config@npm:1.5.0": + version: 1.5.0 + resolution: "@ivangabriele/biome-config@npm:1.5.0" peerDependencies: "@biomejs/biome": ^1 - checksum: 10/5e4cc33e2a32e1747283482b6a90c5cc9849b5cfc5cc129968b3b0d7ec13ce5cfcf836394b233aaccafc379f9d377a3483e6d7ff880a2e226d7af433dfff2ba5 + checksum: 10/328395f37bc41b37f4a10775d7cb139e08115282556229b4ff2066eab0048214d409c3f51e2c1a68689376bcca286525c46ad9f1aa0a61daf50fa46ef8ad612f languageName: node linkType: hard @@ -1672,10 +1680,10 @@ __metadata: languageName: node linkType: hard -"@jridgewell/sourcemap-codec@npm:^1.4.10, @jridgewell/sourcemap-codec@npm:^1.4.14, @jridgewell/sourcemap-codec@npm:^1.4.15": - version: 1.4.15 - resolution: "@jridgewell/sourcemap-codec@npm:1.4.15" - checksum: 10/89960ac087781b961ad918978975bcdf2051cd1741880469783c42de64239703eab9db5230d776d8e6a09d73bb5e4cb964e07d93ee6e2e7aea5a7d726e865c09 +"@jridgewell/sourcemap-codec@npm:^1.4.10, @jridgewell/sourcemap-codec@npm:^1.4.14, @jridgewell/sourcemap-codec@npm:^1.5.0": + version: 1.5.0 + resolution: "@jridgewell/sourcemap-codec@npm:1.5.0" + checksum: 10/4ed6123217569a1484419ac53f6ea0d9f3b57e5b57ab30d7c267bdb27792a27eb0e4b08e84a2680aa55cc2f2b411ffd6ec3db01c44fdc6dc43aca4b55f8374fd languageName: node linkType: hard @@ -1739,7 +1747,7 @@ __metadata: languageName: node linkType: hard -"@lezer/highlight@npm:1.2.1": +"@lezer/highlight@npm:1.2.1, @lezer/highlight@npm:^1.0.0, @lezer/highlight@npm:^1.1.3, @lezer/highlight@npm:^1.1.6, @lezer/highlight@npm:^1.2.0": version: 1.2.1 resolution: "@lezer/highlight@npm:1.2.1" dependencies: @@ -1748,15 +1756,6 @@ __metadata: languageName: node linkType: hard -"@lezer/highlight@npm:^1.0.0, @lezer/highlight@npm:^1.1.3, @lezer/highlight@npm:^1.1.6, @lezer/highlight@npm:^1.2.0": - version: 1.2.0 - resolution: "@lezer/highlight@npm:1.2.0" - dependencies: - "@lezer/common": "npm:^1.0.0" - checksum: 10/14a80cbfb0cd1ce716decb4f3a045d42e7146f539cfd483b62ce46c4586a26d2f4fbdc35ace1cad81645304be4d30eafb95a2b057c34dfd471d56c7fbd82df3a - languageName: node - linkType: hard - "@lezer/html@npm:^1.3.0": version: 1.3.10 resolution: "@lezer/html@npm:1.3.10" @@ -1780,13 +1779,13 @@ __metadata: linkType: hard "@lezer/javascript@npm:^1.0.0": - version: 1.4.16 - resolution: "@lezer/javascript@npm:1.4.16" + version: 1.4.17 + resolution: "@lezer/javascript@npm:1.4.17" dependencies: "@lezer/common": "npm:^1.2.0" "@lezer/highlight": "npm:^1.1.3" "@lezer/lr": "npm:^1.3.0" - checksum: 10/1b9d144721e06f7365c2b59f938e70639a08dbe2d54f94c42a9d3b02d55e10b0b1a5b24b53df0e6acdb6d812430afff4728396c7e5bb1d1e7d27f52654ffe9a7 + checksum: 10/76c38b30a4a4d85a8d5fea4b0ac2d3f5c881f64f431203f40d881df46227632d56ef31f706a7fb36d2a0488eb72cf226c32d31b930c095bfc050f16647aec2ae languageName: node linkType: hard @@ -1812,11 +1811,11 @@ __metadata: linkType: hard "@lezer/lr@npm:^1.0.0, @lezer/lr@npm:^1.1.0, @lezer/lr@npm:^1.3.0, @lezer/lr@npm:^1.3.1, @lezer/lr@npm:^1.3.10, @lezer/lr@npm:^1.3.3, @lezer/lr@npm:^1.4.0": - version: 1.4.1 - resolution: "@lezer/lr@npm:1.4.1" + version: 1.4.2 + resolution: "@lezer/lr@npm:1.4.2" dependencies: "@lezer/common": "npm:^1.0.0" - checksum: 10/6b5e155188f868cf3a86e051453ca5e3d98c6bddcd06601b51d7313bba33385ee128e79ccf841c1d72f3e887cddcd31648524400e7a9da33f92647ac5052c5ed + checksum: 10/f7b505906c8d8df14c07866553cf3dae1e065b1da8b28fbb4193fd67ab8d187eb45f92759e29a2cfe4283296f0aa864b38a0a91708ecfc3e24b8f662d626e0c6 languageName: node linkType: hard @@ -1953,14 +1952,12 @@ __metadata: languageName: node linkType: hard -"@promptbook/utils@npm:0.50.0-10": - version: 0.50.0-10 - resolution: "@promptbook/utils@npm:0.50.0-10" +"@promptbook/utils@npm:0.67.0-1": + version: 0.67.0-1 + resolution: "@promptbook/utils@npm:0.67.0-1" dependencies: - moment: "npm:2.30.1" - prettier: "npm:2.8.1" - spacetrim: "npm:0.11.25" - checksum: 10/bc02f16e94edd1135fccb3b92adc0cc4854795f08c3bfdbf9de08e890568c3e4940226b897c864bb00dd88407aab77bb7dbae2e65d8a65567ab4b4b9120e08e6 + spacetrim: "npm:0.11.39" + checksum: 10/49fe59e060093a815635f9993f69269066ae74b55b39222a0cd63fe17969cc01329c256484c977c329597d20e8ca09e29413fc9e54e362a1b6773a67986f4907 languageName: node linkType: hard @@ -1986,7 +1983,7 @@ __metadata: languageName: node linkType: hard -"@puppeteer/browsers@npm:^1.6.0": +"@puppeteer/browsers@npm:1.9.1, @puppeteer/browsers@npm:^1.6.0": version: 1.9.1 resolution: "@puppeteer/browsers@npm:1.9.1" dependencies: @@ -2063,114 +2060,114 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-android-arm-eabi@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-android-arm-eabi@npm:4.18.0" +"@rollup/rollup-android-arm-eabi@npm:4.21.0": + version: 4.21.0 + resolution: "@rollup/rollup-android-arm-eabi@npm:4.21.0" conditions: os=android & cpu=arm languageName: node linkType: hard -"@rollup/rollup-android-arm64@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-android-arm64@npm:4.18.0" +"@rollup/rollup-android-arm64@npm:4.21.0": + version: 4.21.0 + resolution: "@rollup/rollup-android-arm64@npm:4.21.0" conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-darwin-arm64@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-darwin-arm64@npm:4.18.0" +"@rollup/rollup-darwin-arm64@npm:4.21.0": + version: 4.21.0 + resolution: "@rollup/rollup-darwin-arm64@npm:4.21.0" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-darwin-x64@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-darwin-x64@npm:4.18.0" +"@rollup/rollup-darwin-x64@npm:4.21.0": + version: 4.21.0 + resolution: "@rollup/rollup-darwin-x64@npm:4.21.0" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@rollup/rollup-linux-arm-gnueabihf@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.18.0" +"@rollup/rollup-linux-arm-gnueabihf@npm:4.21.0": + version: 4.21.0 + resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.21.0" conditions: os=linux & cpu=arm & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-arm-musleabihf@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.18.0" +"@rollup/rollup-linux-arm-musleabihf@npm:4.21.0": + version: 4.21.0 + resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.21.0" conditions: os=linux & cpu=arm & libc=musl languageName: node linkType: hard -"@rollup/rollup-linux-arm64-gnu@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.18.0" +"@rollup/rollup-linux-arm64-gnu@npm:4.21.0": + version: 4.21.0 + resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.21.0" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-arm64-musl@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-linux-arm64-musl@npm:4.18.0" +"@rollup/rollup-linux-arm64-musl@npm:4.21.0": + version: 4.21.0 + resolution: "@rollup/rollup-linux-arm64-musl@npm:4.21.0" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@rollup/rollup-linux-powerpc64le-gnu@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.18.0" +"@rollup/rollup-linux-powerpc64le-gnu@npm:4.21.0": + version: 4.21.0 + resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.21.0" conditions: os=linux & cpu=ppc64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-riscv64-gnu@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.18.0" +"@rollup/rollup-linux-riscv64-gnu@npm:4.21.0": + version: 4.21.0 + resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.21.0" conditions: os=linux & cpu=riscv64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-s390x-gnu@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.18.0" +"@rollup/rollup-linux-s390x-gnu@npm:4.21.0": + version: 4.21.0 + resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.21.0" conditions: os=linux & cpu=s390x & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-x64-gnu@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-linux-x64-gnu@npm:4.18.0" +"@rollup/rollup-linux-x64-gnu@npm:4.21.0": + version: 4.21.0 + resolution: "@rollup/rollup-linux-x64-gnu@npm:4.21.0" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-x64-musl@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-linux-x64-musl@npm:4.18.0" +"@rollup/rollup-linux-x64-musl@npm:4.21.0": + version: 4.21.0 + resolution: "@rollup/rollup-linux-x64-musl@npm:4.21.0" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@rollup/rollup-win32-arm64-msvc@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.18.0" +"@rollup/rollup-win32-arm64-msvc@npm:4.21.0": + version: 4.21.0 + resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.21.0" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-win32-ia32-msvc@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.18.0" +"@rollup/rollup-win32-ia32-msvc@npm:4.21.0": + version: 4.21.0 + resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.21.0" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@rollup/rollup-win32-x64-msvc@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-win32-x64-msvc@npm:4.18.0" +"@rollup/rollup-win32-x64-msvc@npm:4.21.0": + version: 4.21.0 + resolution: "@rollup/rollup-win32-x64-msvc@npm:4.21.0" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -2752,9 +2749,9 @@ __metadata: linkType: hard "@types/lodash@npm:*": - version: 4.17.4 - resolution: "@types/lodash@npm:4.17.4" - checksum: 10/3ec19f9fc48200006e71733e08bcb1478b0398673657fcfb21a8643d41a80bcce09a01000077c3b23a3c6d86b9b314abe0672a8fdfc0fd66b893bd41955cfab8 + version: 4.17.7 + resolution: "@types/lodash@npm:4.17.7" + checksum: 10/b8177f19cf962414a66989837481b13f546afc2e98e8d465bec59e6ac03a59c584eb7053ce511cde3a09c5f3096d22a5ae22cfb56b23f3b0da75b0743b6b1a44 languageName: node linkType: hard @@ -2766,22 +2763,22 @@ __metadata: linkType: hard "@types/mocha@npm:^10.0.0": - version: 10.0.6 - resolution: "@types/mocha@npm:10.0.6" - checksum: 10/fc73626e81e89c32d06b7ff9b72c4177b46d579cdd932f796614adc026852d84cb849d743473ba572cb4d9ea6d8c04e3749552d326c26495ec1c4b46e6e0a0c0 + version: 10.0.7 + resolution: "@types/mocha@npm:10.0.7" + checksum: 10/4494871e8a867633d818b00d6f29d47379f9e23655b89ca728166ff2f0a406b97d376fcc3e7a570a3840f72abb03c886c5e66f50ae0f018376e4dc10ed179564 languageName: node linkType: hard -"@types/node@npm:*, @types/node@npm:^20.1.0, @types/node@npm:^20.1.1, @types/node@npm:^20.11.28": - version: 20.14.2 - resolution: "@types/node@npm:20.14.2" +"@types/node@npm:*, @types/node@npm:^22.2.0": + version: 22.5.0 + resolution: "@types/node@npm:22.5.0" dependencies: - undici-types: "npm:~5.26.4" - checksum: 10/c38e47b190fa0a8bdfde24b036dddcf9401551f2fb170a90ff33625c7d6f218907e81c74e0fa6e394804a32623c24c60c50e249badc951007830f0d02c48ee0f + undici-types: "npm:~6.19.2" + checksum: 10/89af3bd217b1559b645a9ed16d4ae3add75749814cbd8eefddd1b96003d1973afb1c8a2b23d69f3a8cc6c532e3aa185eaf5cc29a6e7c42c311a2aad4c99430ae languageName: node linkType: hard -"@types/node@npm:20.16.1": +"@types/node@npm:20.16.1, @types/node@npm:^20.1.0, @types/node@npm:^20.1.1, @types/node@npm:^20.11.28": version: 20.16.1 resolution: "@types/node@npm:20.16.1" dependencies: @@ -2829,7 +2826,17 @@ __metadata: languageName: node linkType: hard -"@types/react@npm:*, @types/react@npm:18.3.3": +"@types/react@npm:*": + version: 18.3.4 + resolution: "@types/react@npm:18.3.4" + dependencies: + "@types/prop-types": "npm:*" + csstype: "npm:^3.0.2" + checksum: 10/359973924be42cf9e7366e1d885b28e0b3bd56d31f24458c5351af7a3f2fc070511e90d517b2195fb229146cdcb70342db6318e279c31dd5057beec1105b704e + languageName: node + linkType: hard + +"@types/react@npm:18.3.3": version: 18.3.3 resolution: "@types/react@npm:18.3.3" dependencies: @@ -2889,11 +2896,11 @@ __metadata: linkType: hard "@types/ws@npm:^8.5.3": - version: 8.5.10 - resolution: "@types/ws@npm:8.5.10" + version: 8.5.12 + resolution: "@types/ws@npm:8.5.12" dependencies: "@types/node": "npm:*" - checksum: 10/9b414dc5e0b6c6f1ea4b1635b3568c58707357f68076df9e7cd33194747b7d1716d5189c0dbdd68c8d2521b148e88184cf881bac7429eb0e5c989b001539ed31 + checksum: 10/d8a3ddfb5ff8fea992a043113579d61ac1ea21e8464415af9e2b01b205ed19d817821ad64ca1b3a90062d1df1c23b0f586d8351d25ca6728844df99a74e8f76d languageName: node linkType: hard @@ -2905,11 +2912,11 @@ __metadata: linkType: hard "@types/yargs@npm:^17.0.8": - version: 17.0.32 - resolution: "@types/yargs@npm:17.0.32" + version: 17.0.33 + resolution: "@types/yargs@npm:17.0.33" dependencies: "@types/yargs-parser": "npm:*" - checksum: 10/1e2b2673847011ce43607df690d392f137d95a2d6ea85aa319403eadda2ef4277365efd4982354d8843f2611ef3846c88599660aaeb537fa9ccddae83c2a89de + checksum: 10/16f6681bf4d99fb671bf56029141ed01db2862e3db9df7fc92d8bea494359ac96a1b4b1c35a836d1e95e665fb18ad753ab2015fc0db663454e8fd4e5d5e2ef91 languageName: node linkType: hard @@ -3035,7 +3042,16 @@ __metadata: languageName: node linkType: hard -"@vitest/snapshot@npm:^1.2.1, @vitest/snapshot@npm:^1.2.2": +"@vitest/pretty-format@npm:2.0.5": + version: 2.0.5 + resolution: "@vitest/pretty-format@npm:2.0.5" + dependencies: + tinyrainbow: "npm:^1.2.0" + checksum: 10/70bf452dd0b8525e658795125b3f11110bd6baadfaa38c5bb91ca763bded35ec6dc80e27964ad4e91b91be6544d35e18ea7748c1997693988f975a7283c3e9a0 + languageName: node + linkType: hard + +"@vitest/snapshot@npm:^1.2.1": version: 1.6.0 resolution: "@vitest/snapshot@npm:1.6.0" dependencies: @@ -3046,6 +3062,17 @@ __metadata: languageName: node linkType: hard +"@vitest/snapshot@npm:^2.0.3": + version: 2.0.5 + resolution: "@vitest/snapshot@npm:2.0.5" + dependencies: + "@vitest/pretty-format": "npm:2.0.5" + magic-string: "npm:^0.30.10" + pathe: "npm:^1.1.2" + checksum: 10/fb46bc65851d4c8dcbbf86279c4146d5e7c17ad0d1be97132dedd98565d37f70ac8b0bf51ead0c6707786ffb15652535398c14d4304fa2146b0393d3db26fdff + languageName: node + linkType: hard + "@wdio/cli@npm:8.38.2": version: 8.38.2 resolution: "@wdio/cli@npm:8.38.2" @@ -3095,7 +3122,22 @@ __metadata: languageName: node linkType: hard -"@wdio/globals@npm:8.38.2, @wdio/globals@npm:^8.29.3": +"@wdio/config@npm:8.40.3": + version: 8.40.3 + resolution: "@wdio/config@npm:8.40.3" + dependencies: + "@wdio/logger": "npm:8.38.0" + "@wdio/types": "npm:8.40.3" + "@wdio/utils": "npm:8.40.3" + decamelize: "npm:^6.0.0" + deepmerge-ts: "npm:^5.0.0" + glob: "npm:^10.2.2" + import-meta-resolve: "npm:^4.0.0" + checksum: 10/8c4463ff37b2b812266df4ec49109569e6309dd237bb998c6f4af6aaa18ed1850c01a98ad436610dbaf07d7641286e3cfde83284b6842d92c6b9018901e8a340 + languageName: node + linkType: hard + +"@wdio/globals@npm:8.38.2": version: 8.38.2 resolution: "@wdio/globals@npm:8.38.2" dependencies: @@ -3110,6 +3152,21 @@ __metadata: languageName: node linkType: hard +"@wdio/globals@npm:^8.29.3": + version: 8.40.3 + resolution: "@wdio/globals@npm:8.40.3" + dependencies: + expect-webdriverio: "npm:^4.11.2" + webdriverio: "npm:8.40.3" + dependenciesMeta: + expect-webdriverio: + optional: true + webdriverio: + optional: true + checksum: 10/0c3b2d147181a5c0d0c34c91f750b64f00917a68e8de8d906ead7ac98ffbb398f0010ce42204e72b0cba379a8422d819c3539232556c644b751c4a48dc303855 + languageName: node + linkType: hard + "@wdio/local-runner@npm:8.38.2": version: 8.38.2 resolution: "@wdio/local-runner@npm:8.38.2" @@ -3126,7 +3183,7 @@ __metadata: languageName: node linkType: hard -"@wdio/logger@npm:8.38.0, @wdio/logger@npm:^8.28.0": +"@wdio/logger@npm:8.38.0, @wdio/logger@npm:^8.28.0, @wdio/logger@npm:^8.38.0": version: 8.38.0 resolution: "@wdio/logger@npm:8.38.0" dependencies: @@ -3138,6 +3195,18 @@ __metadata: languageName: node linkType: hard +"@wdio/logger@npm:^9.0.0": + version: 9.0.4 + resolution: "@wdio/logger@npm:9.0.4" + dependencies: + chalk: "npm:^5.1.2" + loglevel: "npm:^1.6.0" + loglevel-plugin-prefix: "npm:^0.8.4" + strip-ansi: "npm:^7.1.0" + checksum: 10/cc42a355b63520418100447c84af4a6119a5ace6c2f56ec590bc5fde184a2d03d28c913d1bb00d7189dfc1c973ffc9ae0e3bf15d5bdc70157fef5e6ebd3fd020 + languageName: node + linkType: hard + "@wdio/mocha-framework@npm:8.38.2": version: 8.38.2 resolution: "@wdio/mocha-framework@npm:8.38.2" @@ -3159,6 +3228,13 @@ __metadata: languageName: node linkType: hard +"@wdio/protocols@npm:8.40.3": + version: 8.40.3 + resolution: "@wdio/protocols@npm:8.40.3" + checksum: 10/ea5898a6181498c38cfff9bde4df87f63162762d9b393a7a9ec75347da472fe09ba023df79eeac70478d31e7ae28e2a7c23dddb2cb02df766d0836491843247c + languageName: node + linkType: hard + "@wdio/repl@npm:8.24.12": version: 8.24.12 resolution: "@wdio/repl@npm:8.24.12" @@ -3168,6 +3244,15 @@ __metadata: languageName: node linkType: hard +"@wdio/repl@npm:8.40.3": + version: 8.40.3 + resolution: "@wdio/repl@npm:8.40.3" + dependencies: + "@types/node": "npm:^22.2.0" + checksum: 10/48929af5bf99b72f1e3e626212db0b57f3425cae6b5d0d0992a2e28badb2d1a30b15b5cb10589600374c913c24d9e5e7137bbd83735ce1b7a2c2e76f0722218f + languageName: node + linkType: hard + "@wdio/reporter@npm:8.38.2": version: 8.38.2 resolution: "@wdio/reporter@npm:8.38.2" @@ -3222,6 +3307,15 @@ __metadata: languageName: node linkType: hard +"@wdio/types@npm:8.40.3": + version: 8.40.3 + resolution: "@wdio/types@npm:8.40.3" + dependencies: + "@types/node": "npm:^22.2.0" + checksum: 10/9e5b4879321c6411244b330ba2f4685ce0b43d62527dbc29bdf384a76edc8d448ff119401a8a932488ab98cbc4caed0efb22ea06a10e402325d8fd22a30cc3f8 + languageName: node + linkType: hard + "@wdio/utils@npm:8.38.2": version: 8.38.2 resolution: "@wdio/utils@npm:8.38.2" @@ -3243,10 +3337,31 @@ __metadata: languageName: node linkType: hard -"@zip.js/zip.js@npm:^2.7.44": - version: 2.7.45 - resolution: "@zip.js/zip.js@npm:2.7.45" - checksum: 10/9c1fecb6d1acb9c0295ff38542cda9c04e982cc3a5a0bb21096fa2458b3b06ee853da8807698ed23fa637ef5e9d20ff64dd469015fdc14402fb737c32866b998 +"@wdio/utils@npm:8.40.3": + version: 8.40.3 + resolution: "@wdio/utils@npm:8.40.3" + dependencies: + "@puppeteer/browsers": "npm:^1.6.0" + "@wdio/logger": "npm:8.38.0" + "@wdio/types": "npm:8.40.3" + decamelize: "npm:^6.0.0" + deepmerge-ts: "npm:^5.1.0" + edgedriver: "npm:^5.5.0" + geckodriver: "npm:^4.3.1" + get-port: "npm:^7.0.0" + import-meta-resolve: "npm:^4.0.0" + locate-app: "npm:^2.1.0" + safaridriver: "npm:^0.1.0" + split2: "npm:^4.2.0" + wait-port: "npm:^1.0.4" + checksum: 10/79e5dba7c7b0442014c08ddb3735853dadd402242ceee3d275c6ba180db5cdba19273107f8a4b9d6daa90df190ce32407b7215eaf3860adc9f5ebe61bc524838 + languageName: node + linkType: hard + +"@zip.js/zip.js@npm:^2.7.48": + version: 2.7.51 + resolution: "@zip.js/zip.js@npm:2.7.51" + checksum: 10/40bcae4cc7ca4520b55cb3994b5d0ae4332f2d75acad8f57ce2c666ef305304e7132f181c473610d9bea8c81aeacbf39c4a2ad25444a4efd7433f611f3ea6a9a languageName: node linkType: hard @@ -3296,18 +3411,20 @@ __metadata: linkType: hard "acorn-walk@npm:^8.0.2, acorn-walk@npm:^8.1.1": - version: 8.3.2 - resolution: "acorn-walk@npm:8.3.2" - checksum: 10/57dbe2fd8cf744f562431775741c5c087196cd7a65ce4ccb3f3981cdfad25cd24ad2bad404997b88464ac01e789a0a61e5e355b2a84876f13deef39fb39686ca + version: 8.3.3 + resolution: "acorn-walk@npm:8.3.3" + dependencies: + acorn: "npm:^8.11.0" + checksum: 10/59701dcb7070679622ba8e9c7f37577b4935565747ca0fd7c1c3ad30b3f1b1b008276282664e323b5495eb49f77fa12d3816fd06dc68e18f90fbebe759f71450 languageName: node linkType: hard -"acorn@npm:^8.1.0, acorn@npm:^8.4.1, acorn@npm:^8.8.1": - version: 8.11.3 - resolution: "acorn@npm:8.11.3" +"acorn@npm:^8.1.0, acorn@npm:^8.11.0, acorn@npm:^8.4.1, acorn@npm:^8.8.1": + version: 8.12.1 + resolution: "acorn@npm:8.12.1" bin: acorn: bin/acorn - checksum: 10/b688e7e3c64d9bfb17b596e1b35e4da9d50553713b3b3630cf5690f2b023a84eac90c56851e6912b483fe60e8b4ea28b254c07e92f17ef83d72d78745a8352dd + checksum: 10/d08c2d122bba32d0861e0aa840b2ee25946c286d5dc5990abca991baf8cdbfbe199b05aacb221b979411a2fea36f83e26b5ac4f6b4e0ce49038c62316c1848f0 languageName: node linkType: hard @@ -3340,21 +3457,21 @@ __metadata: linkType: hard "ajv@npm:^8.11.0": - version: 8.16.0 - resolution: "ajv@npm:8.16.0" + version: 8.17.1 + resolution: "ajv@npm:8.17.1" dependencies: fast-deep-equal: "npm:^3.1.3" + fast-uri: "npm:^3.0.1" json-schema-traverse: "npm:^1.0.0" require-from-string: "npm:^2.0.2" - uri-js: "npm:^4.4.1" - checksum: 10/9b4b380efaf8be2639736d535662bd142a6972b43075b404380165c37ab6ceb72f01c7c987536747ff3e9e21eb5cd2e2a194f1e0fa8355364ea6204b1262fcd1 + checksum: 10/ee3c62162c953e91986c838f004132b6a253d700f1e51253b99791e2dbfdb39161bc950ebdc2f156f8568035bb5ed8be7bd78289cd9ecbf3381fe8f5b82e3f33 languageName: node linkType: hard -"ansi-colors@npm:4.1.1": - version: 4.1.1 - resolution: "ansi-colors@npm:4.1.1" - checksum: 10/e862fddd0a9ca88f1e7c9312ea70674cec3af360c994762309f6323730525e92c77d2715ee5f08aa8f438b7ca18efe378af647f501fc92b15b8e4b3b52d09db4 +"ansi-colors@npm:^4.1.3": + version: 4.1.3 + resolution: "ansi-colors@npm:4.1.3" + checksum: 10/43d6e2fc7b1c6e4dc373de708ee76311ec2e0433e7e8bd3194e7ff123ea6a747428fc61afdcf5969da5be3a5f0fd054602bec56fc0ebe249ce2fcde6e649e3c2 languageName: node linkType: hard @@ -3518,9 +3635,9 @@ __metadata: linkType: hard "async@npm:^3.2.3, async@npm:^3.2.4": - version: 3.2.5 - resolution: "async@npm:3.2.5" - checksum: 10/323c3615c3f0ab1ac25a6f953296bc0ac3213d5e0f1c0debdb12964e55963af288d570293c11e44f7967af58c06d2a88d0ea588c86ec0fbf62fa98037f604a0f + version: 3.2.6 + resolution: "async@npm:3.2.6" + checksum: 10/cb6e0561a3c01c4b56a799cc8bab6ea5fef45f069ab32500b6e19508db270ef2dffa55e5aed5865c5526e9907b1f8be61b27530823b411ffafb5e1538c86c368 languageName: node linkType: hard @@ -3581,24 +3698,27 @@ __metadata: linkType: hard "babel-preset-current-node-syntax@npm:^1.0.0": - version: 1.0.1 - resolution: "babel-preset-current-node-syntax@npm:1.0.1" + version: 1.1.0 + resolution: "babel-preset-current-node-syntax@npm:1.1.0" dependencies: "@babel/plugin-syntax-async-generators": "npm:^7.8.4" "@babel/plugin-syntax-bigint": "npm:^7.8.3" - "@babel/plugin-syntax-class-properties": "npm:^7.8.3" - "@babel/plugin-syntax-import-meta": "npm:^7.8.3" + "@babel/plugin-syntax-class-properties": "npm:^7.12.13" + "@babel/plugin-syntax-class-static-block": "npm:^7.14.5" + "@babel/plugin-syntax-import-attributes": "npm:^7.24.7" + "@babel/plugin-syntax-import-meta": "npm:^7.10.4" "@babel/plugin-syntax-json-strings": "npm:^7.8.3" - "@babel/plugin-syntax-logical-assignment-operators": "npm:^7.8.3" + "@babel/plugin-syntax-logical-assignment-operators": "npm:^7.10.4" "@babel/plugin-syntax-nullish-coalescing-operator": "npm:^7.8.3" - "@babel/plugin-syntax-numeric-separator": "npm:^7.8.3" + "@babel/plugin-syntax-numeric-separator": "npm:^7.10.4" "@babel/plugin-syntax-object-rest-spread": "npm:^7.8.3" "@babel/plugin-syntax-optional-catch-binding": "npm:^7.8.3" "@babel/plugin-syntax-optional-chaining": "npm:^7.8.3" - "@babel/plugin-syntax-top-level-await": "npm:^7.8.3" + "@babel/plugin-syntax-private-property-in-object": "npm:^7.14.5" + "@babel/plugin-syntax-top-level-await": "npm:^7.14.5" peerDependencies: "@babel/core": ^7.0.0 - checksum: 10/94561959cb12bfa80867c9eeeace7c3d48d61707d33e55b4c3fdbe82fc745913eb2dbfafca62aef297421b38aadcb58550e5943f50fbcebbeefd70ce2bed4b74 + checksum: 10/46331111ae72b7121172fd9e6a4a7830f651ad44bf26dbbf77b3c8a60a18009411a3eacb5e72274004290c110371230272109957d5224d155436b4794ead2f1b languageName: node linkType: hard @@ -3622,9 +3742,9 @@ __metadata: linkType: hard "bare-events@npm:^2.0.0, bare-events@npm:^2.2.0": - version: 2.3.1 - resolution: "bare-events@npm:2.3.1" - checksum: 10/ffe968dbcb5ca7dd640b57ae31ad6deceecdd7119c08cfc11807c05b3fda46419c970b6971513b83ca94970609f7fd7ce809ead08d4c5c8eb541e1c9403209c6 + version: 2.4.2 + resolution: "bare-events@npm:2.4.2" + checksum: 10/c1006ad13b7e62a412466d4eac8466b4ceb46ce84a5e2fc164cd4b10edaaa5016adc684147134b67a6a3865aaf5aa007191647bdb5dbf859b1d5735d2a9ddf3b languageName: node linkType: hard @@ -3640,9 +3760,9 @@ __metadata: linkType: hard "bare-os@npm:^2.1.0": - version: 2.3.0 - resolution: "bare-os@npm:2.3.0" - checksum: 10/e317105f36d41b04c0b498fe069cdf5b2cc12020e3725c6fe9d863328721a512d1ea8e6f36660ed49a35f2d5477a24a914e686e08dc2bdc19ab2a584d9a80155 + version: 2.4.0 + resolution: "bare-os@npm:2.4.0" + checksum: 10/3514944652d29cdde7be554a89440306be326f2760c3e50c7dda507d540f21c0b89bd9f4ecb4642401501860f22ddd11c4403f7f5dacaf687fc75320738e1176 languageName: node linkType: hard @@ -3656,11 +3776,11 @@ __metadata: linkType: hard "bare-stream@npm:^2.0.0": - version: 2.1.2 - resolution: "bare-stream@npm:2.1.2" + version: 2.1.3 + resolution: "bare-stream@npm:2.1.3" dependencies: streamx: "npm:^2.18.0" - checksum: 10/1684c57f62bf2c87a470321f63ac0940ba39a085f1d88f210044aa7cb40c4882b56f0775bbf120e0e6952e8776d885629e43a63aadd8707413efeac1f4045ac7 + checksum: 10/05ef8f2e691cd9649a0dda3a37580f4cf1aa1d1a08d489f64fbe10455acad63ac08b390f9381917c41700ee7adf5fc178106eb2c6d4be3b5453f1433c4147841 languageName: node linkType: hard @@ -3731,24 +3851,24 @@ __metadata: languageName: node linkType: hard -"browser-stdout@npm:1.3.1": +"browser-stdout@npm:^1.3.1": version: 1.3.1 resolution: "browser-stdout@npm:1.3.1" checksum: 10/ac70a84e346bb7afc5045ec6f22f6a681b15a4057447d4cc1c48a25c6dedb302a49a46dd4ddfb5cdd9c96e0c905a8539be1b98ae7bc440512152967009ec7015 languageName: node linkType: hard -"browserslist@npm:^4.22.2": - version: 4.23.0 - resolution: "browserslist@npm:4.23.0" +"browserslist@npm:^4.23.1": + version: 4.23.3 + resolution: "browserslist@npm:4.23.3" dependencies: - caniuse-lite: "npm:^1.0.30001587" - electron-to-chromium: "npm:^1.4.668" - node-releases: "npm:^2.0.14" - update-browserslist-db: "npm:^1.0.13" + caniuse-lite: "npm:^1.0.30001646" + electron-to-chromium: "npm:^1.5.4" + node-releases: "npm:^2.0.18" + update-browserslist-db: "npm:^1.1.0" bin: browserslist: cli.js - checksum: 10/496c3862df74565dd942b4ae65f502c575cbeba1fa4a3894dad7aa3b16130dc3033bc502d8848147f7b625154a284708253d9598bcdbef5a1e34cf11dc7bad8e + checksum: 10/e266d18c6c6c5becf9a1a7aa264477677b9796387972e8fce34854bb33dc1666194dc28389780e5dc6566e68a95e87ece2ce222e1c4ca93c2b75b61dfebd5f1c languageName: node linkType: hard @@ -3803,8 +3923,8 @@ __metadata: linkType: hard "cacache@npm:^18.0.0": - version: 18.0.3 - resolution: "cacache@npm:18.0.3" + version: 18.0.4 + resolution: "cacache@npm:18.0.4" dependencies: "@npmcli/fs": "npm:^3.1.0" fs-minipass: "npm:^3.0.0" @@ -3818,7 +3938,7 @@ __metadata: ssri: "npm:^10.0.0" tar: "npm:^6.1.11" unique-filename: "npm:^3.0.0" - checksum: 10/d4c161f071524bb636334b8cf94780c014e29c180a886b8184da8f2f44d2aca88d5664797c661e9f74bdbd34697c2f231ed7c24c256cecbb0a0563ad1ada2219 + checksum: 10/ca2f7b2d3003f84d362da9580b5561058ccaecd46cba661cbcff0375c90734b610520d46b472a339fd032d91597ad6ed12dde8af81571197f3c9772b5d35b104 languageName: node linkType: hard @@ -3885,10 +4005,10 @@ __metadata: languageName: node linkType: hard -"caniuse-lite@npm:^1.0.30001587": - version: 1.0.30001629 - resolution: "caniuse-lite@npm:1.0.30001629" - checksum: 10/3345bbf1f114b4ba6f862361f2ae6c3f9898b9e061e5d2edd829eff8d2d138f86a6b8d34b2eea48fbf71e6b860e4b6559b31437a7da85568e9d95d03ec042fa9 +"caniuse-lite@npm:^1.0.30001646": + version: 1.0.30001651 + resolution: "caniuse-lite@npm:1.0.30001651" + checksum: 10/fe4857b2a91a9cb77993eec9622de68bea0df17c31cb9584ca5c562f64bb3b8fda316d898aa3b1ee3ee9f7d80f6bf13c42acb09d9a56a1a6c64afaf7381472fa languageName: node linkType: hard @@ -3944,25 +4064,6 @@ __metadata: languageName: node linkType: hard -"chokidar@npm:3.5.3": - version: 3.5.3 - resolution: "chokidar@npm:3.5.3" - dependencies: - anymatch: "npm:~3.1.2" - braces: "npm:~3.0.2" - fsevents: "npm:~2.3.2" - glob-parent: "npm:~5.1.2" - is-binary-path: "npm:~2.1.0" - is-glob: "npm:~4.0.1" - normalize-path: "npm:~3.0.0" - readdirp: "npm:~3.6.0" - dependenciesMeta: - fsevents: - optional: true - checksum: 10/863e3ff78ee7a4a24513d2a416856e84c8e4f5e60efbe03e8ab791af1a183f569b62fc6f6b8044e2804966cb81277ddbbc1dc374fba3265bd609ea8efd62f5b3 - languageName: node - linkType: hard - "chokidar@npm:^3.5.3": version: 3.6.0 resolution: "chokidar@npm:3.6.0" @@ -4000,6 +4101,18 @@ __metadata: languageName: node linkType: hard +"chromium-bidi@npm:0.5.8": + version: 0.5.8 + resolution: "chromium-bidi@npm:0.5.8" + dependencies: + mitt: "npm:3.0.1" + urlpattern-polyfill: "npm:10.0.0" + peerDependencies: + devtools-protocol: "*" + checksum: 10/2eaa4d07ebee562f2a1ddbefea6b0e935ae78b51d2b6b7c38a9932b6168db56bae3a760c9bc8ddf2cbde6ff629b4402d45895db656e82e638c6a011801950afc + languageName: node + linkType: hard + "ci-info@npm:^3.2.0": version: 3.9.0 resolution: "ci-info@npm:3.9.0" @@ -4021,7 +4134,9 @@ __metadata: "@biomejs/biome": "npm:1.8.3" "@commitlint/cli": "npm:19.4.0" "@commitlint/config-conventional": "npm:19.2.2" - "@ivangabriele/biome-config": "npm:1.3.0" + "@fontsource/poppins": "npm:5.0.14" + "@fontsource/reddit-mono": "npm:5.0.3" + "@ivangabriele/biome-config": "npm:1.5.0" "@ivangabriele/commitlint-config": "npm:2.0.3" "@ivangabriele/tsconfig-react": "npm:2.0.0" "@lezer/highlight": "npm:1.2.1" @@ -4556,15 +4671,15 @@ __metadata: languageName: node linkType: hard -"debug@npm:4, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.4": - version: 4.3.5 - resolution: "debug@npm:4.3.5" +"debug@npm:4, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.4, debug@npm:^4.3.5, debug@npm:~4.3.6": + version: 4.3.6 + resolution: "debug@npm:4.3.6" dependencies: ms: "npm:2.1.2" peerDependenciesMeta: supports-color: optional: true - checksum: 10/cb6eab424c410e07813ca1392888589972ce9a32b8829c6508f5e1f25f3c3e70a76731610ae55b4bbe58d1a2fffa1424b30e97fa8d394e49cd2656a9643aedd2 + checksum: 10/d3adb9af7d57a9e809a68f404490cf776122acca16e6359a2702c0f462e510e91f9765c07f707b8ab0d91e03bad57328f3256f5082631cefb5393d0394d50fb7 languageName: node linkType: hard @@ -4580,18 +4695,6 @@ __metadata: languageName: node linkType: hard -"debug@npm:~4.3.6": - version: 4.3.6 - resolution: "debug@npm:4.3.6" - dependencies: - ms: "npm:2.1.2" - peerDependenciesMeta: - supports-color: - optional: true - checksum: 10/d3adb9af7d57a9e809a68f404490cf776122acca16e6359a2702c0f462e510e91f9765c07f707b8ab0d91e03bad57328f3256f5082631cefb5393d0394d50fb7 - languageName: node - linkType: hard - "decamelize@npm:^4.0.0": version: 4.0.0 resolution: "decamelize@npm:4.0.0" @@ -4714,6 +4817,13 @@ __metadata: languageName: node linkType: hard +"devtools-protocol@npm:0.0.1232444": + version: 0.0.1232444 + resolution: "devtools-protocol@npm:0.0.1232444" + checksum: 10/c2b56a501ed8cda9220e1dc8b12364732bdc2bbad7d16a00fbbcaae5bf8a07414b0dfec1224fa1c3d9ce5851eb952a21c086938e73891630a7a6c440e4a1f0b0 + languageName: node + linkType: hard + "devtools-protocol@npm:^0.0.1302984": version: 0.0.1302984 resolution: "devtools-protocol@npm:0.0.1302984" @@ -4721,6 +4831,13 @@ __metadata: languageName: node linkType: hard +"devtools-protocol@npm:^0.0.1340018": + version: 0.0.1340018 + resolution: "devtools-protocol@npm:0.0.1340018" + checksum: 10/678a4eed3a095a5d7f50224b6c568349ab8ca1b96443d54d1d6aeb9838c6176a4a2434071a1863b075bbbbba8022569dbcfdd0bd0dec5b14e8b691d442b1e27c + languageName: node + linkType: hard + "diff-sequences@npm:^29.6.3": version: 29.6.3 resolution: "diff-sequences@npm:29.6.3" @@ -4728,13 +4845,6 @@ __metadata: languageName: node linkType: hard -"diff@npm:5.0.0": - version: 5.0.0 - resolution: "diff@npm:5.0.0" - checksum: 10/4a179a75b17cbb420eb9145be913f9ddb34b47cb2ba4301e80ae745122826a468f02ca8f5e56945958de26ace594899c8381acb6659c88e7803ef078b53d690c - languageName: node - linkType: hard - "diff@npm:^4.0.1": version: 4.0.2 resolution: "diff@npm:4.0.2" @@ -4742,7 +4852,7 @@ __metadata: languageName: node linkType: hard -"diff@npm:^5.0.0": +"diff@npm:^5.0.0, diff@npm:^5.2.0": version: 5.2.0 resolution: "diff@npm:5.2.0" checksum: 10/01b7b440f83a997350a988e9d2f558366c0f90f15be19f4aa7f1bb3109a4e153dfc3b9fbf78e14ea725717017407eeaa2271e3896374a0181e8f52445740846d @@ -4829,18 +4939,19 @@ __metadata: linkType: hard "edgedriver@npm:^5.5.0": - version: 5.6.0 - resolution: "edgedriver@npm:5.6.0" + version: 5.6.1 + resolution: "edgedriver@npm:5.6.1" dependencies: - "@wdio/logger": "npm:^8.28.0" - "@zip.js/zip.js": "npm:^2.7.44" + "@wdio/logger": "npm:^8.38.0" + "@zip.js/zip.js": "npm:^2.7.48" decamelize: "npm:^6.0.0" edge-paths: "npm:^3.0.5" + fast-xml-parser: "npm:^4.4.1" node-fetch: "npm:^3.3.2" which: "npm:^4.0.0" bin: edgedriver: bin/edgedriver.js - checksum: 10/6727ee3b7b0ca8663661bf56ea95e53c3e2f630fabf2527ffe1742c582699971bde557635978e0df769774d139f543b7cabf4f5532c2e654efd8e0efe8bd0201 + checksum: 10/c258272be3bb304697294539f0de5309b1d4398fa9a0ec151fa08c291180d922874dbd3bddd10bf954e787aff5b2a26041df3d89e392f8755c50b7230eafa2e7 languageName: node linkType: hard @@ -4855,10 +4966,10 @@ __metadata: languageName: node linkType: hard -"electron-to-chromium@npm:^1.4.668": - version: 1.4.796 - resolution: "electron-to-chromium@npm:1.4.796" - checksum: 10/af3c22d0cbde460a17a9e2b3ad44fa767d154f0fe431bdb3ac9009f712d4b20f2cea5d3c8cfe32fbd8da732e4f9abb12a29f7083174d3b28a27dce17453eca2e +"electron-to-chromium@npm:^1.5.4": + version: 1.5.13 + resolution: "electron-to-chromium@npm:1.5.13" + checksum: 10/b3de6dbca66e399eacd4f7e2b7603394c8949c9e724d838a45e092725005ff435aabfbf00f738e45451eb23147684f7f9251a5ed75619a539642b2bccea20b45 languageName: node linkType: hard @@ -5048,13 +5159,6 @@ __metadata: languageName: node linkType: hard -"escape-string-regexp@npm:4.0.0": - version: 4.0.0 - resolution: "escape-string-regexp@npm:4.0.0" - checksum: 10/98b48897d93060f2322108bf29db0feba7dd774be96cd069458d1453347b25ce8682ecc39859d4bca2203cc0ab19c237bcc71755eff49a0f8d90beadeeba5cc5 - languageName: node - linkType: hard - "escape-string-regexp@npm:^1.0.5": version: 1.0.5 resolution: "escape-string-regexp@npm:1.0.5" @@ -5069,6 +5173,13 @@ __metadata: languageName: node linkType: hard +"escape-string-regexp@npm:^4.0.0": + version: 4.0.0 + resolution: "escape-string-regexp@npm:4.0.0" + checksum: 10/98b48897d93060f2322108bf29db0feba7dd774be96cd069458d1453347b25ce8682ecc39859d4bca2203cc0ab19c237bcc71755eff49a0f8d90beadeeba5cc5 + languageName: node + linkType: hard + "escape-string-regexp@npm:^5.0.0": version: 5.0.0 resolution: "escape-string-regexp@npm:5.0.0" @@ -5208,10 +5319,10 @@ __metadata: linkType: hard "expect-webdriverio@npm:^4.11.2, expect-webdriverio@npm:^4.12.0": - version: 4.14.0 - resolution: "expect-webdriverio@npm:4.14.0" + version: 4.15.4 + resolution: "expect-webdriverio@npm:4.15.4" dependencies: - "@vitest/snapshot": "npm:^1.2.2" + "@vitest/snapshot": "npm:^2.0.3" "@wdio/globals": "npm:^8.29.3" "@wdio/logger": "npm:^8.28.0" expect: "npm:^29.7.0" @@ -5225,7 +5336,7 @@ __metadata: optional: true webdriverio: optional: true - checksum: 10/7b8525e5e429c06b99d0797b2d4773f3ebc58fce0869e657436e01031afd184009ab69d2be5869daf823c0e7894200191b8fd4a39872398feccdf8b78ac04b3b + checksum: 10/3313a59a32063a51029a9e841a6b7736eaabb56fc1431f8996f8d531e2553ef8a51f0fd03b179df629dee9da9518dd221c2dde6eb395418fee9dbd65453d9709 languageName: node linkType: hard @@ -5305,6 +5416,24 @@ __metadata: languageName: node linkType: hard +"fast-uri@npm:^3.0.1": + version: 3.0.1 + resolution: "fast-uri@npm:3.0.1" + checksum: 10/e8ee4712270de0d29eb0fbf41ffad0ac80952e8797be760e8bb62c4707f08f50a86fe2d7829681ca133c07d6eb4b4a75389a5fc36674c5b254a3ac0891a68fc7 + languageName: node + linkType: hard + +"fast-xml-parser@npm:^4.4.1": + version: 4.4.1 + resolution: "fast-xml-parser@npm:4.4.1" + dependencies: + strnum: "npm:^1.0.5" + bin: + fxparser: src/cli/cli.js + checksum: 10/0c05ab8703630d8c857fafadbd78d0020d3a8e54310c3842179cd4a0d9d97e96d209ce885e91241f4aa9dd8dfc2fd924a682741a423d65153cad34da2032ec44 + languageName: node + linkType: hard + "fb-watchman@npm:^2.0.0": version: 2.0.2 resolution: "fb-watchman@npm:2.0.2" @@ -5370,16 +5499,6 @@ __metadata: languageName: node linkType: hard -"find-up@npm:5.0.0": - version: 5.0.0 - resolution: "find-up@npm:5.0.0" - dependencies: - locate-path: "npm:^6.0.0" - path-exists: "npm:^4.0.0" - checksum: 10/07955e357348f34660bde7920783204ff5a26ac2cafcaa28bace494027158a97b9f56faaf2d89a6106211a8174db650dd9f503f9c0d526b1202d5554a00b9095 - languageName: node - linkType: hard - "find-up@npm:^4.0.0, find-up@npm:^4.1.0": version: 4.1.0 resolution: "find-up@npm:4.1.0" @@ -5390,6 +5509,16 @@ __metadata: languageName: node linkType: hard +"find-up@npm:^5.0.0": + version: 5.0.0 + resolution: "find-up@npm:5.0.0" + dependencies: + locate-path: "npm:^6.0.0" + path-exists: "npm:^4.0.0" + checksum: 10/07955e357348f34660bde7920783204ff5a26ac2cafcaa28bace494027158a97b9f56faaf2d89a6106211a8174db650dd9f503f9c0d526b1202d5554a00b9095 + languageName: node + linkType: hard + "find-up@npm:^6.3.0": version: 6.3.0 resolution: "find-up@npm:6.3.0" @@ -5421,12 +5550,12 @@ __metadata: linkType: hard "foreground-child@npm:^3.1.0": - version: 3.1.1 - resolution: "foreground-child@npm:3.1.1" + version: 3.3.0 + resolution: "foreground-child@npm:3.3.0" dependencies: cross-spawn: "npm:^7.0.0" signal-exit: "npm:^4.0.1" - checksum: 10/087edd44857d258c4f73ad84cb8df980826569656f2550c341b27adf5335354393eec24ea2fabd43a253233fb27cee177ebe46bd0b7ea129c77e87cb1e9936fb + checksum: 10/e3a60480f3a09b12273ce2c5fcb9514d98dd0e528f58656a1b04680225f918d60a2f81f6a368f2f3b937fcee9cfc0cbf16f1ad9a0bc6a3a6e103a84c9a90087e languageName: node linkType: hard @@ -5529,20 +5658,20 @@ __metadata: linkType: hard "geckodriver@npm:^4.3.1": - version: 4.4.1 - resolution: "geckodriver@npm:4.4.1" + version: 4.4.3 + resolution: "geckodriver@npm:4.4.3" dependencies: - "@wdio/logger": "npm:^8.28.0" - "@zip.js/zip.js": "npm:^2.7.44" + "@wdio/logger": "npm:^9.0.0" + "@zip.js/zip.js": "npm:^2.7.48" decamelize: "npm:^6.0.0" http-proxy-agent: "npm:^7.0.2" - https-proxy-agent: "npm:^7.0.4" + https-proxy-agent: "npm:^7.0.5" node-fetch: "npm:^3.3.2" tar-fs: "npm:^3.0.6" which: "npm:^4.0.0" bin: geckodriver: bin/geckodriver.js - checksum: 10/99ce04e8028cbc55d6602b641a8016f8eb88366a89f9172dc6e55d6c70462d5751dff472e5eb8e8bcb4601a8d3956a37db771e8fde8b4a93402285421e23c128 + checksum: 10/e22db018be70d4c239acec3b95de7e491be2f9bfcb42e8a9b52cd914b2fe264b59068add1117be76237f95013983c501b9f1c3876e00ed14814bceab7d239587 languageName: node linkType: hard @@ -5661,31 +5790,19 @@ __metadata: languageName: node linkType: hard -"glob@npm:8.1.0": - version: 8.1.0 - resolution: "glob@npm:8.1.0" - dependencies: - fs.realpath: "npm:^1.0.0" - inflight: "npm:^1.0.4" - inherits: "npm:2" - minimatch: "npm:^5.0.1" - once: "npm:^1.3.0" - checksum: 10/9aab1c75eb087c35dbc41d1f742e51d0507aa2b14c910d96fb8287107a10a22f4bbdce26fc0a3da4c69a20f7b26d62f1640b346a4f6e6becfff47f335bb1dc5e - languageName: node - linkType: hard - "glob@npm:^10.0.0, glob@npm:^10.2.2, glob@npm:^10.3.10": - version: 10.4.1 - resolution: "glob@npm:10.4.1" + version: 10.4.5 + resolution: "glob@npm:10.4.5" dependencies: foreground-child: "npm:^3.1.0" jackspeak: "npm:^3.1.2" minimatch: "npm:^9.0.4" minipass: "npm:^7.1.2" + package-json-from-dist: "npm:^1.0.0" path-scurry: "npm:^1.11.1" bin: glob: dist/esm/bin.mjs - checksum: 10/d7bb49d2b413f77bdd59fea4ca86dcc12450deee221af0ca93e09534b81b9ef68fe341345751d8ff0c5b54bad422307e0e44266ff8ad7fbbd0c200e8ec258b16 + checksum: 10/698dfe11828b7efd0514cd11e573eaed26b2dff611f0400907281ce3eab0c1e56143ef9b35adc7c77ecc71fba74717b510c7c223d34ca8a98ec81777b293d4ac languageName: node linkType: hard @@ -5703,6 +5820,19 @@ __metadata: languageName: node linkType: hard +"glob@npm:^8.1.0": + version: 8.1.0 + resolution: "glob@npm:8.1.0" + dependencies: + fs.realpath: "npm:^1.0.0" + inflight: "npm:^1.0.4" + inherits: "npm:2" + minimatch: "npm:^5.0.1" + once: "npm:^1.3.0" + checksum: 10/9aab1c75eb087c35dbc41d1f742e51d0507aa2b14c910d96fb8287107a10a22f4bbdce26fc0a3da4c69a20f7b26d62f1640b346a4f6e6becfff47f335bb1dc5e + languageName: node + linkType: hard + "glob@npm:~7.1.1": version: 7.1.7 resolution: "glob@npm:7.1.7" @@ -5832,7 +5962,7 @@ __metadata: languageName: node linkType: hard -"hasown@npm:^2.0.0": +"hasown@npm:^2.0.0, hasown@npm:^2.0.2": version: 2.0.2 resolution: "hasown@npm:2.0.2" dependencies: @@ -5841,7 +5971,7 @@ __metadata: languageName: node linkType: hard -"he@npm:1.2.0": +"he@npm:^1.2.0": version: 1.2.0 resolution: "he@npm:1.2.0" bin: @@ -5932,13 +6062,13 @@ __metadata: languageName: node linkType: hard -"https-proxy-agent@npm:^7.0.0, https-proxy-agent@npm:^7.0.1, https-proxy-agent@npm:^7.0.2, https-proxy-agent@npm:^7.0.4": - version: 7.0.4 - resolution: "https-proxy-agent@npm:7.0.4" +"https-proxy-agent@npm:^7.0.0, https-proxy-agent@npm:^7.0.1, https-proxy-agent@npm:^7.0.2, https-proxy-agent@npm:^7.0.5": + version: 7.0.5 + resolution: "https-proxy-agent@npm:7.0.5" dependencies: agent-base: "npm:^7.0.2" debug: "npm:4" - checksum: 10/405fe582bba461bfe5c7e2f8d752b384036854488b828ae6df6a587c654299cbb2c50df38c4b6ab303502c3c5e029a793fbaac965d1e86ee0be03faceb554d63 + checksum: 10/6679d46159ab3f9a5509ee80c3a3fc83fba3a920a5e18d32176c3327852c3c00ad640c0c4210a8fd70ea3c4a6d3a1b375bf01942516e7df80e2646bdc77658ab languageName: node linkType: hard @@ -6015,14 +6145,14 @@ __metadata: linkType: hard "import-local@npm:^3.0.2": - version: 3.1.0 - resolution: "import-local@npm:3.1.0" + version: 3.2.0 + resolution: "import-local@npm:3.2.0" dependencies: pkg-dir: "npm:^4.2.0" resolve-cwd: "npm:^3.0.0" bin: import-local-fixture: fixtures/cli.js - checksum: 10/bfcdb63b5e3c0e245e347f3107564035b128a414c4da1172a20dc67db2504e05ede4ac2eee1252359f78b0bfd7b19ef180aec427c2fce6493ae782d73a04cddd + checksum: 10/0b0b0b412b2521739fbb85eeed834a3c34de9bc67e670b3d0b86248fc460d990a7b116ad056c084b87a693ef73d1f17268d6a5be626bb43c998a8b1c8a230004 languageName: node linkType: hard @@ -6127,12 +6257,12 @@ __metadata: languageName: node linkType: hard -"is-core-module@npm:^2.13.0, is-core-module@npm:^2.8.1": - version: 2.13.1 - resolution: "is-core-module@npm:2.13.1" +"is-core-module@npm:^2.13.0": + version: 2.15.1 + resolution: "is-core-module@npm:2.15.1" dependencies: - hasown: "npm:^2.0.0" - checksum: 10/d53bd0cc24b0a0351fb4b206ee3908f71b9bbf1c47e9c9e14e5f06d292af1663704d2abd7e67700d6487b2b7864e0d0f6f10a1edf1892864bdffcb197d1845a2 + hasown: "npm:^2.0.2" + checksum: 10/77316d5891d5743854bcef2cd2f24c5458fb69fbc9705c12ca17d54a2017a67d0693bbf1ba8c77af376c0eef6bf6d1b27a4ab08e4db4e69914c3789bdf2ceec5 languageName: node linkType: hard @@ -6324,15 +6454,15 @@ __metadata: linkType: hard "istanbul-lib-instrument@npm:^6.0.0": - version: 6.0.2 - resolution: "istanbul-lib-instrument@npm:6.0.2" + version: 6.0.3 + resolution: "istanbul-lib-instrument@npm:6.0.3" dependencies: "@babel/core": "npm:^7.23.9" "@babel/parser": "npm:^7.23.9" "@istanbuljs/schema": "npm:^0.1.3" istanbul-lib-coverage: "npm:^3.2.0" semver: "npm:^7.5.4" - checksum: 10/3aee19be199350182827679a137e1df142a306e9d7e20bb5badfd92ecc9023a7d366bc68e7c66e36983654a02a67401d75d8debf29fc6d4b83670fde69a594fc + checksum: 10/aa5271c0008dfa71b6ecc9ba1e801bf77b49dc05524e8c30d58aaf5b9505e0cd12f25f93165464d4266a518c5c75284ecb598fbd89fec081ae77d2c9d3327695 languageName: node linkType: hard @@ -6369,21 +6499,21 @@ __metadata: linkType: hard "jackspeak@npm:^3.1.2": - version: 3.4.0 - resolution: "jackspeak@npm:3.4.0" + version: 3.4.3 + resolution: "jackspeak@npm:3.4.3" dependencies: "@isaacs/cliui": "npm:^8.0.2" "@pkgjs/parseargs": "npm:^0.11.0" dependenciesMeta: "@pkgjs/parseargs": optional: true - checksum: 10/5032c43c0c1fb92e72846ce496df559214253bc6870c90399cbd7858571c53169d9494b7c152df04abcb75f2fb5e9cffe65651c67d573380adf3a482b150d84b + checksum: 10/96f8786eaab98e4bf5b2a5d6d9588ea46c4d06bbc4f2eb861fdd7b6b182b16f71d8a70e79820f335d52653b16d4843b29dd9cdcf38ae80406756db9199497cf3 languageName: node linkType: hard "jake@npm:^10.8.5": - version: 10.9.1 - resolution: "jake@npm:10.9.1" + version: 10.9.2 + resolution: "jake@npm:10.9.2" dependencies: async: "npm:^3.2.3" chalk: "npm:^4.0.2" @@ -6391,7 +6521,7 @@ __metadata: minimatch: "npm:^3.1.2" bin: jake: bin/cli.js - checksum: 10/82603513de5a61bc12360d2b8ba2be9f6bb52495b73f4d1b541cdfef9e43314b132ca10e73d2b41e3c1ea16bf79ec30a64afc9b9e2d2c72a4d4575a8db61cbc8 + checksum: 10/3be324708f99f031e0aec49ef8fd872eb4583cbe8a29a0c875f554f6ac638ee4ea5aa759bb63723fd54f77ca6d7db851eaa78353301734ed3700db9cb109a0cd languageName: node linkType: hard @@ -6856,11 +6986,11 @@ __metadata: linkType: hard "jiti@npm:^1.19.1": - version: 1.21.3 - resolution: "jiti@npm:1.21.3" + version: 1.21.6 + resolution: "jiti@npm:1.21.6" bin: jiti: bin/jiti.js - checksum: 10/5a9f36c610f8a5f750ebdea9295d7966dbf77129e8daaa8fc6ea2e60f38019a61bd79fced4e917023305ffdd66f4fc5bddcbdd6be450881393121a55d02b2241 + checksum: 10/289b124cea411c130a14ffe88e3d38376ab44b6695616dfa0a1f32176a8f20ec90cdd6d2b9d81450fc6467cfa4d865f04f49b98452bff0f812bc400fd0ae78d6 languageName: node linkType: hard @@ -6871,17 +7001,6 @@ __metadata: languageName: node linkType: hard -"js-yaml@npm:4.1.0, js-yaml@npm:^4.1.0": - version: 4.1.0 - resolution: "js-yaml@npm:4.1.0" - dependencies: - argparse: "npm:^2.0.1" - bin: - js-yaml: bin/js-yaml.js - checksum: 10/c138a34a3fd0d08ebaf71273ad4465569a483b8a639e0b118ff65698d257c2791d3199e3f303631f2cb98213fa7b5f5d6a4621fd0fff819421b990d30d967140 - languageName: node - linkType: hard - "js-yaml@npm:^3.13.1": version: 3.14.1 resolution: "js-yaml@npm:3.14.1" @@ -6894,6 +7013,17 @@ __metadata: languageName: node linkType: hard +"js-yaml@npm:^4.1.0": + version: 4.1.0 + resolution: "js-yaml@npm:4.1.0" + dependencies: + argparse: "npm:^2.0.1" + bin: + js-yaml: bin/js-yaml.js + checksum: 10/c138a34a3fd0d08ebaf71273ad4465569a483b8a639e0b118ff65698d257c2791d3199e3f303631f2cb98213fa7b5f5d6a4621fd0fff819421b990d30d967140 + languageName: node + linkType: hard + "jsbn@npm:1.1.0": version: 1.1.0 resolution: "jsbn@npm:1.1.0" @@ -6987,9 +7117,9 @@ __metadata: linkType: hard "jsonc-parser@npm:^3.2.0": - version: 3.2.1 - resolution: "jsonc-parser@npm:3.2.1" - checksum: 10/fe2df6f39e21653781d52cae20c5b9e0ab62461918d97f9430b216cea9b6500efc1d8b42c6584cc0a7548b4c996055e9cdc39f09b9782fa6957af2f45306c530 + version: 3.3.1 + resolution: "jsonc-parser@npm:3.3.1" + checksum: 10/9b0dc391f20b47378f843ef1e877e73ec652a5bdc3c5fa1f36af0f119a55091d147a86c1ee86a232296f55c929bba174538c2bf0312610e0817a22de131cc3f4 languageName: node linkType: hard @@ -7144,13 +7274,13 @@ __metadata: linkType: hard "locate-app@npm:^2.1.0": - version: 2.4.15 - resolution: "locate-app@npm:2.4.15" + version: 2.4.29 + resolution: "locate-app@npm:2.4.29" dependencies: - "@promptbook/utils": "npm:0.50.0-10" + "@promptbook/utils": "npm:0.67.0-1" type-fest: "npm:2.13.0" userhome: "npm:1.0.0" - checksum: 10/3f7aad0e35420a65da8b4abb1803b22d127b30d03dd2894f2bd5ed01699a5bc68bc9fade16630f5df83668d5dbbdc89b1b83aa5aa434a14d91c841873efae0d7 + checksum: 10/28c5403edbb3926b8a9def374ebf8fb326e5546a3899d14fd8189e715476bec482dfa5b937f17cd6b33d87c759efec9da0c66888efc4d39952042730e4100751 languageName: node linkType: hard @@ -7307,7 +7437,7 @@ __metadata: languageName: node linkType: hard -"log-symbols@npm:4.1.0, log-symbols@npm:^4.1.0": +"log-symbols@npm:^4.1.0": version: 4.1.0 resolution: "log-symbols@npm:4.1.0" dependencies: @@ -7363,9 +7493,9 @@ __metadata: linkType: hard "lru-cache@npm:^10.0.1, lru-cache@npm:^10.2.0": - version: 10.2.2 - resolution: "lru-cache@npm:10.2.2" - checksum: 10/ff1a496d30b5eaec2c9079080965bb0cede203cf878371f7033a007f1e54cd4aa13cc8abf7ccec4c994a83a22ed5476e83a55bb57cc07e6c1547a42937e42c37 + version: 10.4.3 + resolution: "lru-cache@npm:10.4.3" + checksum: 10/e6e90267360476720fa8e83cc168aa2bf0311f3f2eea20a6ba78b90a885ae72071d9db132f40fda4129c803e7dcec3a6b6a6fbb44ca90b081630b810b5d6a41a languageName: node linkType: hard @@ -7394,12 +7524,12 @@ __metadata: languageName: node linkType: hard -"magic-string@npm:^0.30.5": - version: 0.30.10 - resolution: "magic-string@npm:0.30.10" +"magic-string@npm:^0.30.10, magic-string@npm:^0.30.5": + version: 0.30.11 + resolution: "magic-string@npm:0.30.11" dependencies: - "@jridgewell/sourcemap-codec": "npm:^1.4.15" - checksum: 10/9f8bf6363a14c98a9d9f32ef833b194702a5c98fb931b05ac511b76f0b06fd30ed92beda6ca3261d2d52d21e39e891ef1136fbd032023f6cbb02d0b7d5767201 + "@jridgewell/sourcemap-codec": "npm:^1.5.0" + checksum: 10/b784d2240252f5b1e755d487354ada4c672cbca16f045144f7185a75b059210e5fcca7be7be03ef1bac2ca754c4428b21d36ae64a9057ba429916f06b8c54eb2 languageName: node linkType: hard @@ -7556,15 +7686,6 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:5.0.1": - version: 5.0.1 - resolution: "minimatch@npm:5.0.1" - dependencies: - brace-expansion: "npm:^2.0.1" - checksum: 10/2656580f18d9f38ada186196fcc72dc9076d70f7227adc664e72614d464e075dc4ae3936e6742519e09e336996ef33c6035e606888b12f65ca7fda792ddd2085 - languageName: node - linkType: hard - "minimatch@npm:^3.0.4, minimatch@npm:^3.0.5, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": version: 3.1.2 resolution: "minimatch@npm:3.1.2" @@ -7574,7 +7695,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^5.0.1, minimatch@npm:^5.1.0": +"minimatch@npm:^5.0.1, minimatch@npm:^5.1.0, minimatch@npm:^5.1.6": version: 5.1.6 resolution: "minimatch@npm:5.1.6" dependencies: @@ -7584,11 +7705,11 @@ __metadata: linkType: hard "minimatch@npm:^9.0.0, minimatch@npm:^9.0.4": - version: 9.0.4 - resolution: "minimatch@npm:9.0.4" + version: 9.0.5 + resolution: "minimatch@npm:9.0.5" dependencies: brace-expansion: "npm:^2.0.1" - checksum: 10/4cdc18d112b164084513e890d6323370db14c22249d536ad1854539577a895e690a27513dc346392f61a4a50afbbd8abc88f3f25558bfbbbb862cd56508b20f5 + checksum: 10/dd6a8927b063aca6d910b119e1f2df6d2ce7d36eab91de83167dd136bb85e1ebff97b0d3de1cb08bd1f7e018ca170b4962479fefab5b2a69e2ae12cb2edc8348 languageName: node linkType: hard @@ -7699,6 +7820,13 @@ __metadata: languageName: node linkType: hard +"mitt@npm:3.0.1": + version: 3.0.1 + resolution: "mitt@npm:3.0.1" + checksum: 10/287c70d8e73ffc25624261a4989c783768aed95ecb60900f051d180cf83e311e3e59865bfd6e9d029cdb149dc20ba2f128a805e9429c5c4ce33b1416c65bbd14 + languageName: node + linkType: hard + "mkdirp-classic@npm:^0.5.2": version: 0.5.3 resolution: "mkdirp-classic@npm:0.5.3" @@ -7716,40 +7844,33 @@ __metadata: linkType: hard "mocha@npm:^10.0.0": - version: 10.4.0 - resolution: "mocha@npm:10.4.0" + version: 10.7.3 + resolution: "mocha@npm:10.7.3" dependencies: - ansi-colors: "npm:4.1.1" - browser-stdout: "npm:1.3.1" - chokidar: "npm:3.5.3" - debug: "npm:4.3.4" - diff: "npm:5.0.0" - escape-string-regexp: "npm:4.0.0" - find-up: "npm:5.0.0" - glob: "npm:8.1.0" - he: "npm:1.2.0" - js-yaml: "npm:4.1.0" - log-symbols: "npm:4.1.0" - minimatch: "npm:5.0.1" - ms: "npm:2.1.3" - serialize-javascript: "npm:6.0.0" - strip-json-comments: "npm:3.1.1" - supports-color: "npm:8.1.1" - workerpool: "npm:6.2.1" - yargs: "npm:16.2.0" - yargs-parser: "npm:20.2.4" - yargs-unparser: "npm:2.0.0" + ansi-colors: "npm:^4.1.3" + browser-stdout: "npm:^1.3.1" + chokidar: "npm:^3.5.3" + debug: "npm:^4.3.5" + diff: "npm:^5.2.0" + escape-string-regexp: "npm:^4.0.0" + find-up: "npm:^5.0.0" + glob: "npm:^8.1.0" + he: "npm:^1.2.0" + js-yaml: "npm:^4.1.0" + log-symbols: "npm:^4.1.0" + minimatch: "npm:^5.1.6" + ms: "npm:^2.1.3" + serialize-javascript: "npm:^6.0.2" + strip-json-comments: "npm:^3.1.1" + supports-color: "npm:^8.1.1" + workerpool: "npm:^6.5.1" + yargs: "npm:^16.2.0" + yargs-parser: "npm:^20.2.9" + yargs-unparser: "npm:^2.0.0" bin: _mocha: bin/_mocha mocha: bin/mocha.js - checksum: 10/0147b2a86c8a3b134b3bda949006aa5f2b08db606b9394e38eb3fa0d97dd2f54f06eb4afb270d4ae08aa6fb7674282737ed556b9a8bc407f9b8488380852eca4 - languageName: node - linkType: hard - -"moment@npm:2.30.1": - version: 2.30.1 - resolution: "moment@npm:2.30.1" - checksum: 10/ae42d876d4ec831ef66110bdc302c0657c664991e45cf2afffc4b0f6cd6d251dde11375c982a5c0564ccc0fa593fc564576ddceb8c8845e87c15f58aa6baca69 + checksum: 10/5757aeb320df2507338bfba41731070ce16d27177c5876672fff4bcc4f7b7bcf1afe6ec761bfded43a5d28032d7b797b8b905b5b44c9420203f3ee71457732c1 languageName: node linkType: hard @@ -7760,7 +7881,7 @@ __metadata: languageName: node linkType: hard -"ms@npm:2.1.3": +"ms@npm:^2.1.3": version: 2.1.3 resolution: "ms@npm:2.1.3" checksum: 10/aa92de608021b242401676e35cfa5aa42dd70cbdc082b916da7fb925c542173e36bce97ea3e804923fe92c0ad991434e4a38327e15a1b5b5f945d66df615ae6d @@ -7837,8 +7958,8 @@ __metadata: linkType: hard "node-gyp@npm:latest": - version: 10.1.0 - resolution: "node-gyp@npm:10.1.0" + version: 10.2.0 + resolution: "node-gyp@npm:10.2.0" dependencies: env-paths: "npm:^2.2.0" exponential-backoff: "npm:^3.1.1" @@ -7846,13 +7967,13 @@ __metadata: graceful-fs: "npm:^4.2.6" make-fetch-happen: "npm:^13.0.0" nopt: "npm:^7.0.0" - proc-log: "npm:^3.0.0" + proc-log: "npm:^4.1.0" semver: "npm:^7.3.5" - tar: "npm:^6.1.2" + tar: "npm:^6.2.1" which: "npm:^4.0.0" bin: node-gyp: bin/node-gyp.js - checksum: 10/89e105e495e66cd4568af3cf79cdeb67d670eb069e33163c7781d3366470a30367c9bd8dea59e46db16370020139e5bf78b1fbc03284cb571754dfaa59744db5 + checksum: 10/41773093b1275751dec942b985982fd4e7a69b88cae719b868babcef3880ee6168aaec8dcaa8cd0b9fa7c84873e36cc549c6cac6a124ee65ba4ce1f1cc108cfe languageName: node linkType: hard @@ -7863,10 +7984,10 @@ __metadata: languageName: node linkType: hard -"node-releases@npm:^2.0.14": - version: 2.0.14 - resolution: "node-releases@npm:2.0.14" - checksum: 10/0f7607ec7db5ef1dc616899a5f24ae90c869b6a54c2d4f36ff6d84a282ab9343c7ff3ca3670fe4669171bb1e8a9b3e286e1ef1c131f09a83d70554f855d54f24 +"node-releases@npm:^2.0.18": + version: 2.0.18 + resolution: "node-releases@npm:2.0.18" + checksum: 10/241e5fa9556f1c12bafb83c6c3e94f8cf3d8f2f8f904906ecef6e10bcaa1d59aa61212d4651bec70052015fc54bd3fdcdbe7fc0f638a17e6685aa586c076ec4e languageName: node linkType: hard @@ -7882,14 +8003,13 @@ __metadata: linkType: hard "normalize-package-data@npm:^6.0.0": - version: 6.0.1 - resolution: "normalize-package-data@npm:6.0.1" + version: 6.0.2 + resolution: "normalize-package-data@npm:6.0.2" dependencies: hosted-git-info: "npm:^7.0.0" - is-core-module: "npm:^2.8.1" semver: "npm:^7.3.5" validate-npm-package-license: "npm:^3.0.4" - checksum: 10/eb0b1815a105adcba09df26befc35da1dc1c3149784b8ddbcaa90c581925b7a9f1d94aefd344b6020eb0261a5f0575a8a9ef8e92c57eb86182de9a510282c2b2 + checksum: 10/7c4216a2426aa76c0197f8372f06b23a0484d62b3518fb5c0f6ebccb16376bdfab29ceba96f95c75f60506473198f1337fe337b945c8df0541fe32b8049ab4c9 languageName: node linkType: hard @@ -7933,9 +8053,9 @@ __metadata: linkType: hard "nwsapi@npm:^2.2.2": - version: 2.2.10 - resolution: "nwsapi@npm:2.2.10" - checksum: 10/b310e9dd0886da338cbbb1be9fec473a50269e2935d537f95a03d0038f7ea831ce12b4816d97f42e458e5273158aea2a6c86bc4bb60f79911226154aa66740f7 + version: 2.2.12 + resolution: "nwsapi@npm:2.2.12" + checksum: 10/172119e9ef492467ebfb337f9b5fd12a94d2b519377cde3f6ec2f74a86f6d5c00ef3873539bed7142f908ffca4e35383179be2319d04a563071d146bfa3f1673 languageName: node linkType: hard @@ -7947,9 +8067,9 @@ __metadata: linkType: hard "object-inspect@npm:^1.12.0": - version: 1.13.1 - resolution: "object-inspect@npm:1.13.1" - checksum: 10/92f4989ed83422d56431bc39656d4c780348eb15d397ce352ade6b7fec08f973b53744bd41b94af021901e61acaf78fcc19e65bf464ecc0df958586a672700f0 + version: 1.13.2 + resolution: "object-inspect@npm:1.13.2" + checksum: 10/7ef65583b6397570a17c56f0c1841e0920e83900f2c94638927abb7b81ac08a19c7aae135bd9dcca96208cac0c7332b4650fb927f027b0cf92d71df2990d0561 languageName: node linkType: hard @@ -8091,22 +8211,22 @@ __metadata: linkType: hard "pac-proxy-agent@npm:^7.0.0, pac-proxy-agent@npm:^7.0.1": - version: 7.0.1 - resolution: "pac-proxy-agent@npm:7.0.1" + version: 7.0.2 + resolution: "pac-proxy-agent@npm:7.0.2" dependencies: "@tootallnate/quickjs-emscripten": "npm:^0.23.0" agent-base: "npm:^7.0.2" debug: "npm:^4.3.4" get-uri: "npm:^6.0.1" http-proxy-agent: "npm:^7.0.0" - https-proxy-agent: "npm:^7.0.2" - pac-resolver: "npm:^7.0.0" - socks-proxy-agent: "npm:^8.0.2" - checksum: 10/b9055d13b2a48acf77689c2e510d033486fd90e50a1c7f6bd5f09cd9270bac62ec54bc8fcdd0edbef26e357194cbce70f6794bd99a454d796bc780de6235a61e + https-proxy-agent: "npm:^7.0.5" + pac-resolver: "npm:^7.0.1" + socks-proxy-agent: "npm:^8.0.4" + checksum: 10/bb9b53b32ba98f085fd98ad0ea5e4201498585bf8d9390b3365c057b692b8562997be166d44224878ac216a81f1016c1f55f4e1dec52a6d92e5aa659eba9124c languageName: node linkType: hard -"pac-resolver@npm:^7.0.0": +"pac-resolver@npm:^7.0.1": version: 7.0.1 resolution: "pac-resolver@npm:7.0.1" dependencies: @@ -8116,6 +8236,13 @@ __metadata: languageName: node linkType: hard +"package-json-from-dist@npm:^1.0.0": + version: 1.0.0 + resolution: "package-json-from-dist@npm:1.0.0" + checksum: 10/ac706ec856a5a03f5261e4e48fa974f24feb044d51f84f8332e2af0af04fbdbdd5bbbfb9cbbe354190409bc8307c83a9e38c6672c3c8855f709afb0006a009ea + languageName: node + linkType: hard + "pako@npm:~1.0.2": version: 1.0.11 resolution: "pako@npm:1.0.11" @@ -8232,7 +8359,7 @@ __metadata: languageName: node linkType: hard -"pathe@npm:^1.1.1": +"pathe@npm:^1.1.1, pathe@npm:^1.1.2": version: 1.1.2 resolution: "pathe@npm:1.1.2" checksum: 10/f201d796351bf7433d147b92c20eb154a4e0ea83512017bf4ec4e492a5d6e738fb45798be4259a61aa81270179fce11026f6ff0d3fa04173041de044defe9d80 @@ -8314,15 +8441,6 @@ __metadata: languageName: node linkType: hard -"prettier@npm:2.8.1": - version: 2.8.1 - resolution: "prettier@npm:2.8.1" - bin: - prettier: bin-prettier.js - checksum: 10/135801ef4c609f24f3606607f8b4e71bd42d6a2efb2579d7709d9079377614800a295f9cc5683b10c6070381106e805e00700a278a506b79a4e29c3548ef4ec1 - languageName: node - linkType: hard - "pretty-format@npm:^27.0.2": version: 27.5.1 resolution: "pretty-format@npm:27.5.1" @@ -8355,22 +8473,15 @@ __metadata: linkType: hard "pretty-ms@npm:^9.0.0": - version: 9.0.0 - resolution: "pretty-ms@npm:9.0.0" + version: 9.1.0 + resolution: "pretty-ms@npm:9.1.0" dependencies: parse-ms: "npm:^4.0.0" - checksum: 10/b11e1eda41a2efcc16aab218392c8e457a8ae5c8edf63aafba0477123426b1268136b9b532cbfd84625bcb826739120ec8490286dab66102b9f09e717bdb4e45 - languageName: node - linkType: hard - -"proc-log@npm:^3.0.0": - version: 3.0.0 - resolution: "proc-log@npm:3.0.0" - checksum: 10/02b64e1b3919e63df06f836b98d3af002b5cd92655cab18b5746e37374bfb73e03b84fe305454614b34c25b485cc687a9eebdccf0242cda8fda2475dd2c97e02 + checksum: 10/3622a8999e4b2aa05ff64bf48c7e58143b3ede6e3434f8ce5588def90ebcf6af98edf79532344c4c9e14d5ad25deb3f0f5ca9f9b91e5d2d1ac26dad9cf428fc0 languageName: node linkType: hard -"proc-log@npm:^4.2.0": +"proc-log@npm:^4.1.0, proc-log@npm:^4.2.0": version: 4.2.0 resolution: "proc-log@npm:4.2.0" checksum: 10/4e1394491b717f6c1ade15c570ecd4c2b681698474d3ae2d303c1e4b6ab9455bd5a81566211e82890d5a5ae9859718cc6954d5150bb18b09b72ecb297beae90a @@ -8485,7 +8596,7 @@ __metadata: languageName: node linkType: hard -"punycode@npm:^2.1.0, punycode@npm:^2.1.1": +"punycode@npm:^2.1.1": version: 2.3.1 resolution: "punycode@npm:2.3.1" checksum: 10/febdc4362bead22f9e2608ff0171713230b57aff9dddc1c273aa2a651fbd366f94b7d6a71d78342a7c0819906750351ca7f2edd26ea41b626d87d6a13d1bd059 @@ -8511,6 +8622,20 @@ __metadata: languageName: node linkType: hard +"puppeteer-core@npm:^21.11.0": + version: 21.11.0 + resolution: "puppeteer-core@npm:21.11.0" + dependencies: + "@puppeteer/browsers": "npm:1.9.1" + chromium-bidi: "npm:0.5.8" + cross-fetch: "npm:4.0.0" + debug: "npm:4.3.4" + devtools-protocol: "npm:0.0.1232444" + ws: "npm:8.16.0" + checksum: 10/44bda6ab4995a224358d6cf8bd877ed2251446fbe9e36c38325bf5e09fd7e783e27ba4a76046140a38bfdd3c47df8ded6597c832e418db3212bebfb193382692 + languageName: node + linkType: hard + "pure-rand@npm:^6.0.0": version: 6.1.0 resolution: "pure-rand@npm:6.1.0" @@ -8915,25 +9040,25 @@ __metadata: linkType: hard "rollup@npm:^4.13.0": - version: 4.18.0 - resolution: "rollup@npm:4.18.0" - dependencies: - "@rollup/rollup-android-arm-eabi": "npm:4.18.0" - "@rollup/rollup-android-arm64": "npm:4.18.0" - "@rollup/rollup-darwin-arm64": "npm:4.18.0" - "@rollup/rollup-darwin-x64": "npm:4.18.0" - "@rollup/rollup-linux-arm-gnueabihf": "npm:4.18.0" - "@rollup/rollup-linux-arm-musleabihf": "npm:4.18.0" - "@rollup/rollup-linux-arm64-gnu": "npm:4.18.0" - "@rollup/rollup-linux-arm64-musl": "npm:4.18.0" - "@rollup/rollup-linux-powerpc64le-gnu": "npm:4.18.0" - "@rollup/rollup-linux-riscv64-gnu": "npm:4.18.0" - "@rollup/rollup-linux-s390x-gnu": "npm:4.18.0" - "@rollup/rollup-linux-x64-gnu": "npm:4.18.0" - "@rollup/rollup-linux-x64-musl": "npm:4.18.0" - "@rollup/rollup-win32-arm64-msvc": "npm:4.18.0" - "@rollup/rollup-win32-ia32-msvc": "npm:4.18.0" - "@rollup/rollup-win32-x64-msvc": "npm:4.18.0" + version: 4.21.0 + resolution: "rollup@npm:4.21.0" + dependencies: + "@rollup/rollup-android-arm-eabi": "npm:4.21.0" + "@rollup/rollup-android-arm64": "npm:4.21.0" + "@rollup/rollup-darwin-arm64": "npm:4.21.0" + "@rollup/rollup-darwin-x64": "npm:4.21.0" + "@rollup/rollup-linux-arm-gnueabihf": "npm:4.21.0" + "@rollup/rollup-linux-arm-musleabihf": "npm:4.21.0" + "@rollup/rollup-linux-arm64-gnu": "npm:4.21.0" + "@rollup/rollup-linux-arm64-musl": "npm:4.21.0" + "@rollup/rollup-linux-powerpc64le-gnu": "npm:4.21.0" + "@rollup/rollup-linux-riscv64-gnu": "npm:4.21.0" + "@rollup/rollup-linux-s390x-gnu": "npm:4.21.0" + "@rollup/rollup-linux-x64-gnu": "npm:4.21.0" + "@rollup/rollup-linux-x64-musl": "npm:4.21.0" + "@rollup/rollup-win32-arm64-msvc": "npm:4.21.0" + "@rollup/rollup-win32-ia32-msvc": "npm:4.21.0" + "@rollup/rollup-win32-x64-msvc": "npm:4.21.0" "@types/estree": "npm:1.0.5" fsevents: "npm:~2.3.2" dependenciesMeta: @@ -8973,7 +9098,7 @@ __metadata: optional: true bin: rollup: dist/bin/rollup - checksum: 10/2320fe653cfd5e3d72ecab2f1d52d47e7b624a6ab02919f53c1ad1c5efa3b66e277c3ecfef03bb97651e79cef04bfefd34ad1f6e648f496572bf76c834f19599 + checksum: 10/27ac47d5049719249d2a44982e31f01423158a3625cabff2f2362219aee64bdc14c32572b669169c22c324c3a965044ce8f06e27eee00fd8802861cd13697f87 languageName: node linkType: hard @@ -9049,11 +9174,11 @@ __metadata: linkType: hard "semver@npm:^7.3.5, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0": - version: 7.6.2 - resolution: "semver@npm:7.6.2" + version: 7.6.3 + resolution: "semver@npm:7.6.3" bin: semver: bin/semver.js - checksum: 10/296b17d027f57a87ef645e9c725bff4865a38dfc9caf29b26aa084b85820972fbe7372caea1ba6857162fa990702c6d9c1d82297cecb72d56c78ab29070d2ca2 + checksum: 10/36b1fbe1a2b6f873559cd57b238f1094a053dbfd997ceeb8757d79d1d2089c56d1321b9f1069ce263dc64cfa922fa1d2ad566b39426fe1ac6c723c1487589e10 languageName: node linkType: hard @@ -9066,12 +9191,12 @@ __metadata: languageName: node linkType: hard -"serialize-javascript@npm:6.0.0": - version: 6.0.0 - resolution: "serialize-javascript@npm:6.0.0" +"serialize-javascript@npm:^6.0.2": + version: 6.0.2 + resolution: "serialize-javascript@npm:6.0.2" dependencies: randombytes: "npm:^2.1.0" - checksum: 10/ed3dabfbb565c48c9eb1ca8fe58f0d256902ab70a8a605be634ddd68388d5f728bb0bd1268e94fab628748ba8ad8392f01b05f3cbe1e4878b5c58c669fd3d1b4 + checksum: 10/445a420a6fa2eaee4b70cbd884d538e259ab278200a2ededd73253ada17d5d48e91fb1f4cd224a236ab62ea7ba0a70c6af29fc93b4f3d3078bf7da1c031fde58 languageName: node linkType: hard @@ -9187,18 +9312,18 @@ __metadata: languageName: node linkType: hard -"socks-proxy-agent@npm:^8.0.1, socks-proxy-agent@npm:^8.0.2, socks-proxy-agent@npm:^8.0.3": - version: 8.0.3 - resolution: "socks-proxy-agent@npm:8.0.3" +"socks-proxy-agent@npm:^8.0.1, socks-proxy-agent@npm:^8.0.2, socks-proxy-agent@npm:^8.0.3, socks-proxy-agent@npm:^8.0.4": + version: 8.0.4 + resolution: "socks-proxy-agent@npm:8.0.4" dependencies: agent-base: "npm:^7.1.1" debug: "npm:^4.3.4" - socks: "npm:^2.7.1" - checksum: 10/c2112c66d6322e497d68e913c3780f3683237fd394bfd480b9283486a86e36095d0020db96145d88f8ccd9cc73261b98165b461f9c1bf5dc17abfe75c18029ce + socks: "npm:^2.8.3" + checksum: 10/c8e7c2b398338b49a0a0f4d2bae5c0602aeeca6b478b99415927b6c5db349ca258448f2c87c6958ebf83eea17d42cbc5d1af0bfecb276cac10b9658b0f07f7d7 languageName: node linkType: hard -"socks@npm:^2.7.1": +"socks@npm:^2.8.3": version: 2.8.3 resolution: "socks@npm:2.8.3" dependencies: @@ -9232,10 +9357,10 @@ __metadata: languageName: node linkType: hard -"spacetrim@npm:0.11.25": - version: 0.11.25 - resolution: "spacetrim@npm:0.11.25" - checksum: 10/6dc93b23892f0aabd9b311c2e80ce41ff73a7ff015d293617270e3c3d5365b2297125e493c5494aac8a1839953786a04fc90bbd3774d115977ef4d8969aa3481 +"spacetrim@npm:0.11.39": + version: 0.11.39 + resolution: "spacetrim@npm:0.11.39" + checksum: 10/53b3d76b40cc16ee4f68aecee621a117809cf18d77cf5ba8312fe299165bdf598f612c5fea669f9eafcd70f68d4b06a9c314f7d1572d4f801e3c3e3fcd150dce languageName: node linkType: hard @@ -9267,9 +9392,9 @@ __metadata: linkType: hard "spdx-license-ids@npm:^3.0.0": - version: 3.0.18 - resolution: "spdx-license-ids@npm:3.0.18" - checksum: 10/45fdbb50c4bbe364720ef0acd19f4fc1914d73ba1e2b1ce9db21ee12d7f9e8bf14336289f6ad3d5acac3dc5b91aafe61e9c652d5806b31cbb8518a14979a16ff + version: 3.0.20 + resolution: "spdx-license-ids@npm:3.0.20" + checksum: 10/30e566ea74b04232c64819d1f5313c00d92e9c73d054541650331fc794499b3bcc4991bcd90fa3c2fc4d040006f58f63104706255266e87a9d452e6574afc60c languageName: node linkType: hard @@ -9313,15 +9438,15 @@ __metadata: linkType: hard "stream-buffers@npm:^3.0.2": - version: 3.0.2 - resolution: "stream-buffers@npm:3.0.2" - checksum: 10/66e55fb770929527f5cf7798f0e4c3b48e04970bf242b3d200140d9e3c0425ba14da4203d3b877be2f8a981b8f3027a5f5d2ad56f8c9f51cb70b3cbb6ba7c5b3 + version: 3.0.3 + resolution: "stream-buffers@npm:3.0.3" + checksum: 10/8a1d5ea656fc8c3ed8daaf18e0f3755829683912c4a182f47360480f29c4757fe558518a9f5375075c71578fa1a3f18d72a0270f90fbf5288b6f119f347b156f languageName: node linkType: hard "streamx@npm:^2.15.0, streamx@npm:^2.18.0": - version: 2.18.0 - resolution: "streamx@npm:2.18.0" + version: 2.19.0 + resolution: "streamx@npm:2.19.0" dependencies: bare-events: "npm:^2.2.0" fast-fifo: "npm:^1.3.2" @@ -9330,7 +9455,7 @@ __metadata: dependenciesMeta: bare-events: optional: true - checksum: 10/039e828e7e76399d65fed022ddaeb7ab3ee77f66d170733643b7f7510823a605315f3ee841e5c01f16df5a44dca18a97fc39460a2b42010484e7976f29c79296 + checksum: 10/3e57a12402200cce347bd0658b5e7ef14a41636341256d2a9f43100e5c4f5d82166a4df77aef92082686150805a1b14f74370f3c96b4ed3d6d9889da1e3b3c21 languageName: node linkType: hard @@ -9374,13 +9499,13 @@ __metadata: linkType: hard "string-width@npm:^7.0.0": - version: 7.1.0 - resolution: "string-width@npm:7.1.0" + version: 7.2.0 + resolution: "string-width@npm:7.2.0" dependencies: emoji-regex: "npm:^10.3.0" get-east-asian-width: "npm:^1.0.0" strip-ansi: "npm:^7.1.0" - checksum: 10/a183573fe7209e0d294f661846d33f8caf72aa86d983e5b48a0ed45ab15bcccb02c6f0344b58b571988871105457137b8207855ea536827dbc4a376a0f31bf8f + checksum: 10/42f9e82f61314904a81393f6ef75b832c39f39761797250de68c041d8ba4df2ef80db49ab6cd3a292923a6f0f409b8c9980d120f7d32c820b4a8a84a2598a295 languageName: node linkType: hard @@ -9457,13 +9582,20 @@ __metadata: languageName: node linkType: hard -"strip-json-comments@npm:3.1.1, strip-json-comments@npm:^3.1.1": +"strip-json-comments@npm:^3.1.1": version: 3.1.1 resolution: "strip-json-comments@npm:3.1.1" checksum: 10/492f73e27268f9b1c122733f28ecb0e7e8d8a531a6662efbd08e22cccb3f9475e90a1b82cab06a392f6afae6d2de636f977e231296400d0ec5304ba70f166443 languageName: node linkType: hard +"strnum@npm:^1.0.5": + version: 1.0.5 + resolution: "strnum@npm:1.0.5" + checksum: 10/d3117975db8372d4d7b2c07601ed2f65bf21cc48d741f37a8617b76370d228f2ec26336e53791ebc3638264d23ca54e6c241f57f8c69bd4941c63c79440525ca + languageName: node + linkType: hard + "style-mod@npm:^4.0.0, style-mod@npm:^4.1.0": version: 4.1.2 resolution: "style-mod@npm:4.1.2" @@ -9498,15 +9630,6 @@ __metadata: languageName: node linkType: hard -"supports-color@npm:8.1.1, supports-color@npm:^8.0.0": - version: 8.1.1 - resolution: "supports-color@npm:8.1.1" - dependencies: - has-flag: "npm:^4.0.0" - checksum: 10/157b534df88e39c5518c5e78c35580c1eca848d7dbaf31bbe06cdfc048e22c7ff1a9d046ae17b25691128f631a51d9ec373c1b740c12ae4f0de6e292037e4282 - languageName: node - linkType: hard - "supports-color@npm:^5.3.0": version: 5.5.0 resolution: "supports-color@npm:5.5.0" @@ -9525,6 +9648,15 @@ __metadata: languageName: node linkType: hard +"supports-color@npm:^8.0.0, supports-color@npm:^8.1.1": + version: 8.1.1 + resolution: "supports-color@npm:8.1.1" + dependencies: + has-flag: "npm:^4.0.0" + checksum: 10/157b534df88e39c5518c5e78c35580c1eca848d7dbaf31bbe06cdfc048e22c7ff1a9d046ae17b25691128f631a51d9ec373c1b740c12ae4f0de6e292037e4282 + languageName: node + linkType: hard + "supports-preserve-symlinks-flag@npm:^1.0.0": version: 1.0.0 resolution: "supports-preserve-symlinks-flag@npm:1.0.0" @@ -9578,7 +9710,7 @@ __metadata: languageName: node linkType: hard -"tar@npm:^6.1.11, tar@npm:^6.1.2": +"tar@npm:^6.1.11, tar@npm:^6.2.1": version: 6.2.1 resolution: "tar@npm:6.2.1" dependencies: @@ -9604,11 +9736,11 @@ __metadata: linkType: hard "text-decoder@npm:^1.1.0": - version: 1.1.0 - resolution: "text-decoder@npm:1.1.0" + version: 1.1.1 + resolution: "text-decoder@npm:1.1.1" dependencies: b4a: "npm:^1.6.4" - checksum: 10/4c0c9997a59f5531e604d80f0e5a8a2206e25adc11bdd090d0a01190467134383dfe27d13c834b31966e411a358c6bf8c97e96098573a7080a2e205fa49fd050 + checksum: 10/c6981b93850daeafc8bd1dbd8f984d4fb2d14632f450de0892692b5bbee2d2f4cbef8a807142527370649fd357f58491ede4915d43669eca624cb52b8dd247b6 languageName: node linkType: hard @@ -9626,6 +9758,13 @@ __metadata: languageName: node linkType: hard +"tinyrainbow@npm:^1.2.0": + version: 1.2.0 + resolution: "tinyrainbow@npm:1.2.0" + checksum: 10/2924444db6804355e5ba2b6e586c7f77329d93abdd7257a069a0f4530dff9f16de484e80479094e3f39273462541b003a65ee3a6afc2d12555aa745132deba5d + languageName: node + linkType: hard + "tmp@npm:^0.0.33": version: 0.0.33 resolution: "tmp@npm:0.0.33" @@ -9759,7 +9898,7 @@ __metadata: languageName: node linkType: hard -"type-fest@npm:4.25.0": +"type-fest@npm:4.25.0, type-fest@npm:^4.2.0": version: 4.25.0 resolution: "type-fest@npm:4.25.0" checksum: 10/16ddf51dbfeef45e6f0a139c16f06d6cd05b61be76b048c41e79997f150a66422219d7ec10a2717ab926505402d59b1ddc8560f5f6c245e1b8a35971c2f1b754 @@ -9787,13 +9926,6 @@ __metadata: languageName: node linkType: hard -"type-fest@npm:^4.2.0": - version: 4.20.0 - resolution: "type-fest@npm:4.20.0" - checksum: 10/df037c11f6393312f27825ea6eb2c8cd62b1ba21c31144bed41854648ba2a18dcb8c68a930607c7227dd531b42006cc7c7a60f7f034668d1c92c205523ae1ea2 - languageName: node - linkType: hard - "types-ramda@npm:^0.30.1": version: 0.30.1 resolution: "types-ramda@npm:0.30.1" @@ -9833,13 +9965,6 @@ __metadata: languageName: node linkType: hard -"undici-types@npm:~5.26.4": - version: 5.26.5 - resolution: "undici-types@npm:5.26.5" - checksum: 10/0097779d94bc0fd26f0418b3a05472410408877279141ded2bd449167be1aed7ea5b76f756562cb3586a07f251b90799bab22d9019ceba49c037c76445f7cddd - languageName: node - linkType: hard - "undici-types@npm:~6.19.2": version: 6.19.8 resolution: "undici-types@npm:6.19.8" @@ -9886,9 +10011,9 @@ __metadata: languageName: node linkType: hard -"update-browserslist-db@npm:^1.0.13": - version: 1.0.16 - resolution: "update-browserslist-db@npm:1.0.16" +"update-browserslist-db@npm:^1.1.0": + version: 1.1.0 + resolution: "update-browserslist-db@npm:1.1.0" dependencies: escalade: "npm:^3.1.2" picocolors: "npm:^1.0.1" @@ -9896,16 +10021,7 @@ __metadata: browserslist: ">= 4.21.0" bin: update-browserslist-db: cli.js - checksum: 10/071bf0b2fb8568db6cd42ee2598ac9b87c794a7229fcbf1b035ae7f883e770c07143f16a5371525d5bcb94b99f9a1b279036142b0195ffd4cf5a0008fc4a500e - languageName: node - linkType: hard - -"uri-js@npm:^4.4.1": - version: 4.4.1 - resolution: "uri-js@npm:4.4.1" - dependencies: - punycode: "npm:^2.1.0" - checksum: 10/b271ca7e3d46b7160222e3afa3e531505161c9a4e097febae9664e4b59912f4cbe94861361a4175edac3a03fee99d91e44b6a58c17a634bc5a664b19fc76fbcb + checksum: 10/d70b9efeaf4601aadb1a4f6456a7a5d9118e0063d995866b8e0c5e0cf559482671dab6ce7b079f9536b06758a344fbd83f974b965211e1c6e8d1958540b0c24c languageName: node linkType: hard @@ -9919,6 +10035,13 @@ __metadata: languageName: node linkType: hard +"urlpattern-polyfill@npm:10.0.0": + version: 10.0.0 + resolution: "urlpattern-polyfill@npm:10.0.0" + checksum: 10/346819dbe718e929988298d02a988b8ddfa601d08daaa7e69b1148eab699c86c0f0f933d68d8c8cf913166fe64156ed28904e673200d18ef7e9ed6b58cea3fc7 + languageName: node + linkType: hard + "use-debounce@npm:10.0.3": version: 10.0.3 resolution: "use-debounce@npm:10.0.3" @@ -9950,13 +10073,13 @@ __metadata: linkType: hard "v8-to-istanbul@npm:^9.0.1": - version: 9.2.0 - resolution: "v8-to-istanbul@npm:9.2.0" + version: 9.3.0 + resolution: "v8-to-istanbul@npm:9.3.0" dependencies: "@jridgewell/trace-mapping": "npm:^0.3.12" "@types/istanbul-lib-coverage": "npm:^2.0.1" convert-source-map: "npm:^2.0.0" - checksum: 10/18dd8cebfb6790f27f4e41e7cff77c7ab1c8904085f354dd7875e2eb65f4261c4cf40939132502875779d92304bfea46b8336346ecb40b6f33c3a3979e6f5729 + checksum: 10/fb1d70f1176cb9dc46cabbb3fd5c52c8f3e8738b61877b6e7266029aed0870b04140e3f9f4550ac32aebcfe1d0f38b0bac57e1e8fb97d68fec82f2b416148166 languageName: node linkType: hard @@ -10086,7 +10209,26 @@ __metadata: languageName: node linkType: hard -"webdriverio@npm:8.38.2, webdriverio@npm:^8.29.3": +"webdriver@npm:8.40.3": + version: 8.40.3 + resolution: "webdriver@npm:8.40.3" + dependencies: + "@types/node": "npm:^22.2.0" + "@types/ws": "npm:^8.5.3" + "@wdio/config": "npm:8.40.3" + "@wdio/logger": "npm:8.38.0" + "@wdio/protocols": "npm:8.40.3" + "@wdio/types": "npm:8.40.3" + "@wdio/utils": "npm:8.40.3" + deepmerge-ts: "npm:^5.1.0" + got: "npm:^12.6.1" + ky: "npm:^0.33.0" + ws: "npm:^8.8.0" + checksum: 10/f55a7da18c40991bcc8db45bf12704aa01a9f70e74e9007ebfabe608001dc25ca2640351152401aa4af6b98dea61d5813bd37d42c5680b6ec9ddc1bec833a626 + languageName: node + linkType: hard + +"webdriverio@npm:8.38.2": version: 8.38.2 resolution: "webdriverio@npm:8.38.2" dependencies: @@ -10124,6 +10266,44 @@ __metadata: languageName: node linkType: hard +"webdriverio@npm:8.40.3, webdriverio@npm:^8.29.3": + version: 8.40.3 + resolution: "webdriverio@npm:8.40.3" + dependencies: + "@types/node": "npm:^22.2.0" + "@wdio/config": "npm:8.40.3" + "@wdio/logger": "npm:8.38.0" + "@wdio/protocols": "npm:8.40.3" + "@wdio/repl": "npm:8.40.3" + "@wdio/types": "npm:8.40.3" + "@wdio/utils": "npm:8.40.3" + archiver: "npm:^7.0.0" + aria-query: "npm:^5.0.0" + css-shorthand-properties: "npm:^1.1.1" + css-value: "npm:^0.0.1" + devtools-protocol: "npm:^0.0.1340018" + grapheme-splitter: "npm:^1.0.2" + import-meta-resolve: "npm:^4.0.0" + is-plain-obj: "npm:^4.1.0" + jszip: "npm:^3.10.1" + lodash.clonedeep: "npm:^4.5.0" + lodash.zip: "npm:^4.2.0" + minimatch: "npm:^9.0.0" + puppeteer-core: "npm:^21.11.0" + query-selector-shadow-dom: "npm:^1.0.0" + resq: "npm:^1.9.1" + rgb2hex: "npm:0.2.5" + serialize-error: "npm:^11.0.1" + webdriver: "npm:8.40.3" + peerDependencies: + devtools: ^8.14.0 + peerDependenciesMeta: + devtools: + optional: true + checksum: 10/0ac827d5d49944e22155521935b4cd66748e36335db2c565b37249c5f1857ba7f73d57d8f1c25ee3936ac40e29acce7e9790bba887060ed94148f99086e15596 + languageName: node + linkType: hard + "webidl-conversions@npm:^3.0.0": version: 3.0.1 resolution: "webidl-conversions@npm:3.0.1" @@ -10196,10 +10376,10 @@ __metadata: languageName: node linkType: hard -"workerpool@npm:6.2.1": - version: 6.2.1 - resolution: "workerpool@npm:6.2.1" - checksum: 10/3e637f76320cab92eaeffa4fbefb351db02e20aa29245d8ee05fa7c088780ef7b4446bfafff2668a22fd94b7d9d97c7020117036ac77a76370ecea278b9a9b91 +"workerpool@npm:^6.5.1": + version: 6.5.1 + resolution: "workerpool@npm:6.5.1" + checksum: 10/b1b00139fe62f2ebec556a2af8085bf6e7502ad26cf2a4dcb34fb4408b2e68aa12c88b0a50cb463b24f2806d60fa491fc0da933b56ec3b53646aeec0025d14cb languageName: node linkType: hard @@ -10265,8 +10445,8 @@ __metadata: linkType: hard "ws@npm:>=8.17.1": - version: 8.17.1 - resolution: "ws@npm:8.17.1" + version: 8.18.0 + resolution: "ws@npm:8.18.0" peerDependencies: bufferutil: ^4.0.1 utf-8-validate: ">=5.0.2" @@ -10275,7 +10455,7 @@ __metadata: optional: true utf-8-validate: optional: true - checksum: 10/4264ae92c0b3e59c7e309001e93079b26937aab181835fb7af79f906b22cd33b6196d96556dafb4e985742dd401e99139572242e9847661fdbc96556b9e6902d + checksum: 10/70dfe53f23ff4368d46e4c0b1d4ca734db2c4149c6f68bc62cb16fc21f753c47b35fcc6e582f3bdfba0eaeb1c488cddab3c2255755a5c3eecb251431e42b3ff6 languageName: node linkType: hard @@ -10323,14 +10503,7 @@ __metadata: languageName: node linkType: hard -"yargs-parser@npm:20.2.4": - version: 20.2.4 - resolution: "yargs-parser@npm:20.2.4" - checksum: 10/db8f251ae40e24782d5c089ed86883ba3c0ce7f3c174002a67ec500802f928df9d505fea5d04829769221ce20b0f69f6fb1138fbb2e2fb102e3e9d426d20edab - languageName: node - linkType: hard - -"yargs-parser@npm:^20.2.2": +"yargs-parser@npm:^20.2.2, yargs-parser@npm:^20.2.9": version: 20.2.9 resolution: "yargs-parser@npm:20.2.9" checksum: 10/0188f430a0f496551d09df6719a9132a3469e47fe2747208b1dd0ab2bb0c512a95d0b081628bbca5400fb20dbf2fabe63d22badb346cecadffdd948b049f3fcc @@ -10344,7 +10517,7 @@ __metadata: languageName: node linkType: hard -"yargs-unparser@npm:2.0.0": +"yargs-unparser@npm:^2.0.0": version: 2.0.0 resolution: "yargs-unparser@npm:2.0.0" dependencies: @@ -10356,21 +10529,6 @@ __metadata: languageName: node linkType: hard -"yargs@npm:16.2.0": - version: 16.2.0 - resolution: "yargs@npm:16.2.0" - dependencies: - cliui: "npm:^7.0.2" - escalade: "npm:^3.1.1" - get-caller-file: "npm:^2.0.5" - require-directory: "npm:^2.1.1" - string-width: "npm:^4.2.0" - y18n: "npm:^5.0.5" - yargs-parser: "npm:^20.2.2" - checksum: 10/807fa21211d2117135d557f95fcd3c3d390530cda2eca0c840f1d95f0f40209dcfeb5ec18c785a1f3425896e623e3b2681e8bb7b6600060eda1c3f4804e7957e - languageName: node - linkType: hard - "yargs@npm:17.7.1": version: 17.7.1 resolution: "yargs@npm:17.7.1" @@ -10401,6 +10559,21 @@ __metadata: languageName: node linkType: hard +"yargs@npm:^16.2.0": + version: 16.2.0 + resolution: "yargs@npm:16.2.0" + dependencies: + cliui: "npm:^7.0.2" + escalade: "npm:^3.1.1" + get-caller-file: "npm:^2.0.5" + require-directory: "npm:^2.1.1" + string-width: "npm:^4.2.0" + y18n: "npm:^5.0.5" + yargs-parser: "npm:^20.2.2" + checksum: 10/807fa21211d2117135d557f95fcd3c3d390530cda2eca0c840f1d95f0f40209dcfeb5ec18c785a1f3425896e623e3b2681e8bb7b6600060eda1c3f4804e7957e + languageName: node + linkType: hard + "yauzl@npm:^2.10.0": version: 2.10.0 resolution: "yauzl@npm:2.10.0" @@ -10426,16 +10599,16 @@ __metadata: linkType: hard "yocto-queue@npm:^1.0.0": - version: 1.0.0 - resolution: "yocto-queue@npm:1.0.0" - checksum: 10/2cac84540f65c64ccc1683c267edce396b26b1e931aa429660aefac8fbe0188167b7aee815a3c22fa59a28a58d898d1a2b1825048f834d8d629f4c2a5d443801 + version: 1.1.1 + resolution: "yocto-queue@npm:1.1.1" + checksum: 10/f2e05b767ed3141e6372a80af9caa4715d60969227f38b1a4370d60bffe153c9c5b33a862905609afc9b375ec57cd40999810d20e5e10229a204e8bde7ef255c languageName: node linkType: hard "yoctocolors@npm:^2.0.0": - version: 2.0.2 - resolution: "yoctocolors@npm:2.0.2" - checksum: 10/cac20504b5fc954ff117e3a3fbde09db8ac0807bba59e68c5c08f3a43173ef46ccb1853b15b37bd96d0d8187bc444627f160fee7e5aede0b421382cf379d2438 + version: 2.1.1 + resolution: "yoctocolors@npm:2.1.1" + checksum: 10/563fbec88bce9716d1044bc98c96c329e1d7a7c503e6f1af68f1ff914adc3ba55ce953c871395e2efecad329f85f1632f51a99c362032940321ff80c42a6f74d languageName: node linkType: hard From 6cabb04a03887fc78fbdf0e7c95f4702c030b49e Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Sat, 15 Jun 2024 15:02:49 +0200 Subject: [PATCH 02/74] ci(github): prepare next MSI build with sidecars --- .github/workflows/analysis.yml | 32 +++---- .github/workflows/build.yml | 154 +++++++++++++++++------------- .github/workflows/integration.yml | 70 +++++++------- .github/workflows/unit.yml | 142 +++++++++++++-------------- .gitignore | 3 + sidecars/.gitkeep | 0 6 files changed, 214 insertions(+), 187 deletions(-) create mode 100644 sidecars/.gitkeep diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index 23c12afa..7b933436 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -33,17 +33,17 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - build-mode: ${{ matrix.build-mode }} - # https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - queries: 'security-and-quality,security-extended' - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 - with: - category: '/language:${{matrix.language}}' + # - name: Initialize CodeQL + # uses: github/codeql-action/init@v3 + # with: + # languages: ${{ matrix.language }} + # build-mode: ${{ matrix.build-mode }} + # # https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: 'security-and-quality,security-extended' + # - name: Perform CodeQL Analysis + # uses: github/codeql-action/analyze@v3 + # with: + # category: '/language:${{matrix.language}}' cargo_audit: name: Cargo Audit @@ -53,8 +53,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Install cargo-audit - run: cargo install cargo-audit - - name: Run - run: cargo audit - working-directory: ./src-tauri + # - name: Install cargo-audit + # run: cargo install cargo-audit + # - name: Run + # run: cargo audit + # working-directory: ./src-tauri diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c9801a2a..963877cb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,76 +3,100 @@ name: Build on: push jobs: - build_deb_release: - name: Build DEB Release - runs-on: ubuntu-latest - container: - image: ivangabriele/tauri:debian-bullseye-18 - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: true - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - cache: yarn - node-version: 20 - - name: Install - run: yarn - - name: Build - run: yarn release:deb - - name: Upload - uses: actions/upload-artifact@v4 - with: - name: ci-release-deb - path: src-tauri/target/release/bundle/deb/*.deb - retention-days: 1 + # build_deb_release: + # name: Build DEB Release + # runs-on: ubuntu-latest + # container: + # image: ivangabriele/tauri:debian-bullseye-18 + # steps: + # - name: Checkout + # uses: actions/checkout@v4 + # with: + # submodules: true + # - name: Setup Node.js + # uses: actions/setup-node@v4 + # with: + # cache: yarn + # node-version: 20 + # - name: Install + # run: yarn + # - name: Build + # run: yarn release:deb + # - name: Upload + # uses: actions/upload-artifact@v4 + # with: + # name: ci-release-deb + # path: src-tauri/target/release/bundle/deb/*.deb + # retention-days: 1 - build_dmg_release: - name: Build DMG Release - runs-on: macos-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: true - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - cache: yarn - node-version: 20 - - name: Install - run: yarn - - name: Build - run: yarn release:dmg - - name: Upload - uses: actions/upload-artifact@v4 - with: - name: ci-release-dmg - path: src-tauri/target/release/bundle/dmg/*.dmg - retention-days: 1 + # build_dmg_release: + # name: Build DMG Release + # runs-on: macos-latest + # steps: + # - name: Checkout + # uses: actions/checkout@v4 + # with: + # submodules: true + # - name: Setup Node.js + # uses: actions/setup-node@v4 + # with: + # cache: yarn + # node-version: 20 + # - name: Install + # run: yarn + # - name: Build + # run: yarn release:dmg + # - name: Upload + # uses: actions/upload-artifact@v4 + # with: + # name: ci-release-dmg + # path: src-tauri/target/release/bundle/dmg/*.dmg + # retention-days: 1 + + # build_msi_release: + # name: Build MSI Release + # runs-on: windows-latest + # steps: + # - name: Checkout + # uses: actions/checkout@v4 + # with: + # submodules: true + # - name: Setup Node.js + # uses: actions/setup-node@v4 + # with: + # cache: yarn + # node-version: 20 + # - name: Install + # run: yarn + # - name: Build + # run: yarn release:msi + # - name: Upload + # uses: actions/upload-artifact@v4 + # with: + # name: ci-release-msi + # path: src-tauri/target/release/bundle/msi/*.msi + # retention-days: 1 - build_msi_release: - name: Build MSI Release + build_msi_release_next: + name: Build MSI Release (Next) runs-on: windows-latest steps: - name: Checkout uses: actions/checkout@v4 with: submodules: true - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - cache: yarn - node-version: 20 - - name: Install - run: yarn - - name: Build - run: yarn release:msi - - name: Upload - uses: actions/upload-artifact@v4 - with: - name: ci-release-msi - path: src-tauri/target/release/bundle/msi/*.msi - retention-days: 1 + # - name: Setup Node.js + # uses: actions/setup-node@v4 + # with: + # cache: yarn + # node-version: 20 + # - name: Install + # run: yarn + # - name: Build + # run: yarn release:msi + # - name: Upload + # uses: actions/upload-artifact@v4 + # with: + # name: ci-release-msi + # path: src-tauri/target/release/bundle/msi/*.msi + # retention-days: 1 diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 56b8db9a..41a92fa9 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -13,38 +13,38 @@ jobs: uses: actions/checkout@v4 with: submodules: true - # https://github.com/Swatinem/rust-cache#example-usage - - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - key: integration_e2e_debian-latest - prefix-key: rust-cache - shared-key: v0 - workspaces: './src-tauri -> target' - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - cache: yarn - node-version: 20 - - name: Install Debian dependencies - run: | - apt-get update - apt-get install -y dbus-x11 - - name: Install ClamAV - run: | - apt-get install -y clamav - - name: Print ClamAV version - run: clamscan -V - - name: Install Node.js dependencies - run: yarn --frozen-lockfile - - name: Build binary - run: yarn release:bin - - name: Run tests - uses: nick-fields/retry@v3 - with: - timeout_seconds: 600 - max_attempts: 3 - retry_on: error - command: | - fuser -n tcp -k 4445 - yarn test:e2e + # # https://github.com/Swatinem/rust-cache#example-usage + # - uses: Swatinem/rust-cache@v2 + # with: + # cache-on-failure: true + # key: integration_e2e_debian-latest + # prefix-key: rust-cache + # shared-key: v0 + # workspaces: './src-tauri -> target' + # - name: Setup Node.js + # uses: actions/setup-node@v4 + # with: + # cache: yarn + # node-version: 20 + # - name: Install Debian dependencies + # run: | + # apt-get update + # apt-get install -y dbus-x11 + # - name: Install ClamAV + # run: | + # apt-get install -y clamav + # - name: Print ClamAV version + # run: clamscan -V + # - name: Install Node.js dependencies + # run: yarn --frozen-lockfile + # - name: Build binary + # run: yarn release:bin + # - name: Run tests + # uses: nick-fields/retry@v3 + # with: + # timeout_seconds: 600 + # max_attempts: 3 + # retry_on: error + # command: | + # fuser -n tcp -k 4445 + # yarn test:e2e diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index cea8db11..63ea487d 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -9,21 +9,21 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - cache: yarn - node-version: 20 - - name: Install Node.js dependencies - run: yarn - - name: Run - run: yarn test:unit:webview --coverage - - name: Upload Coverage - uses: codecov/codecov-action@v4 - with: - fail_ci_if_error: true - flags: webview - token: ${{ secrets.CODECOV_TOKEN }} + # - name: Setup Node.js + # uses: actions/setup-node@v4 + # with: + # cache: yarn + # node-version: 20 + # - name: Install Node.js dependencies + # run: yarn + # - name: Run + # run: yarn test:unit:webview --coverage + # - name: Upload Coverage + # uses: codecov/codecov-action@v4 + # with: + # fail_ci_if_error: true + # flags: webview + # token: ${{ secrets.CODECOV_TOKEN }} core_test_debian: name: Test Core (debian-latest) @@ -38,37 +38,37 @@ jobs: uses: actions/checkout@v4 with: submodules: true - # https://github.com/Swatinem/rust-cache#example-usage - - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - key: unit_core_test_debian-latest - prefix-key: rust-cache - shared-key: v0 - workspaces: './src-tauri -> target' - - name: Install ClamAV - run: | - apt-get update - apt-get install -y clamav - - name: Print versions - run: | - cat /etc/os-release - rustc -V - cargo -V - clamscan -V - # https://github.com/tauri-apps/tauri/issues/3142 - - name: Create fake /dist directory - run: mkdir ./dist - - name: Run unit tests (with coverage) - run: cargo tarpaulin --frozen --no-fail-fast --out Xml --workspace -- --nocapture - working-directory: ./src-tauri - - name: Upload tests coverage - uses: codecov/codecov-action@v4 - with: - directory: ./src-tauri - fail_ci_if_error: true - flags: core - token: ${{ secrets.CODECOV_TOKEN }} + # # https://github.com/Swatinem/rust-cache#example-usage + # - uses: Swatinem/rust-cache@v2 + # with: + # cache-on-failure: true + # key: unit_core_test_debian-latest + # prefix-key: rust-cache + # shared-key: v0 + # workspaces: './src-tauri -> target' + # - name: Install ClamAV + # run: | + # apt-get update + # apt-get install -y clamav + # - name: Print versions + # run: | + # cat /etc/os-release + # rustc -V + # cargo -V + # clamscan -V + # # https://github.com/tauri-apps/tauri/issues/3142 + # - name: Create fake /dist directory + # run: mkdir ./dist + # - name: Run unit tests (with coverage) + # run: cargo tarpaulin --frozen --no-fail-fast --out Xml --workspace -- --nocapture + # working-directory: ./src-tauri + # - name: Upload tests coverage + # uses: codecov/codecov-action@v4 + # with: + # directory: ./src-tauri + # fail_ci_if_error: true + # flags: core + # token: ${{ secrets.CODECOV_TOKEN }} core_test_macos_and_windows: name: Test Core @@ -86,31 +86,31 @@ jobs: uses: actions/checkout@v4 with: submodules: true - # https://github.com/Swatinem/rust-cache#example-usage - - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - key: unit_core_test_${{ matrix.os }} - prefix-key: rust-cache - shared-key: v0 - workspaces: './src-tauri -> target' - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - - name: Print versions - run: | - rustc -V - cargo -V - # clamscan -V - # https://github.com/tauri-apps/tauri/issues/3142 - - name: Create fake /dist directory - run: mkdir ./dist - - name: Build - run: cargo build - working-directory: ./src-tauri - - name: Run tests - run: cargo test --no-fail-fast --workspace -- --nocapture - working-directory: ./src-tauri + # # https://github.com/Swatinem/rust-cache#example-usage + # - uses: Swatinem/rust-cache@v2 + # with: + # cache-on-failure: true + # key: unit_core_test_${{ matrix.os }} + # prefix-key: rust-cache + # shared-key: v0 + # workspaces: './src-tauri -> target' + # - uses: actions-rs/toolchain@v1 + # with: + # toolchain: stable + # - name: Print versions + # run: | + # rustc -V + # cargo -V + # # clamscan -V + # # https://github.com/tauri-apps/tauri/issues/3142 + # - name: Create fake /dist directory + # run: mkdir ./dist + # - name: Build + # run: cargo build + # working-directory: ./src-tauri + # - name: Run tests + # run: cargo test --no-fail-fast --workspace -- --nocapture + # working-directory: ./src-tauri # webview_build: # name: Build Webview diff --git a/.gitignore b/.gitignore index 4c6fa44c..c9ba4b15 100644 --- a/.gitignore +++ b/.gitignore @@ -161,3 +161,6 @@ dist !/.debug/.gitkeep # /clamav/build + +/sidecars/* +!/sidecars/.gitkeep diff --git a/sidecars/.gitkeep b/sidecars/.gitkeep new file mode 100644 index 00000000..e69de29b From 1961b2d08ef096f3d25fb04165d0665a6d5f7634 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Sat, 15 Jun 2024 15:29:32 +0200 Subject: [PATCH 03/74] ci(github): normalize workflow events & enable pull request auto-cancellation --- .github/workflows/analysis.yml | 4 ++++ .github/workflows/build.yml | 10 +++++++++- .github/workflows/check.yml | 10 +++++++++- .github/workflows/integration.yml | 10 +++++++++- .github/workflows/unit.yml | 10 +++++++++- 5 files changed, 40 insertions(+), 4 deletions(-) diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index 7b933436..5ac12218 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -9,6 +9,10 @@ on: # Every day at 12:00 UTC - cron: '0 12 * * *' +concurrency: + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + jobs: codeql: name: CodeQL (${{ matrix.label }}) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 963877cb..685c9da2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,14 @@ name: Build -on: push +on: + push: + branches: ['main'] + pull_request: + branches: ['main'] + +concurrency: + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} jobs: # build_deb_release: diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index dd213822..58aa356b 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,6 +1,14 @@ name: Check -on: push +on: + push: + branches: ['main'] + pull_request: + branches: ['main'] + +concurrency: + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} jobs: pull-request_check: diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 41a92fa9..70e7e680 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -1,6 +1,14 @@ name: Integration -on: push +on: + push: + branches: ['main'] + pull_request: + branches: ['main'] + +concurrency: + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} jobs: e2e_debian: diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index 63ea487d..d0b7bff0 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -1,6 +1,14 @@ name: Unit -on: push +on: + push: + branches: ['main'] + pull_request: + branches: ['main'] + +concurrency: + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} jobs: webview_test: From 16ecc6458a4136ad7927b324942b96c0a66545c9 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Sat, 15 Jun 2024 15:38:40 +0200 Subject: [PATCH 04/74] ci(github): add Chocolatey installation step in next MSI build workflow --- .github/workflows/build.yml | 40 ++--- .github/workflows/build_with_clamav.yml | 199 ++++++++++++++++++++++++ .gitignore | 2 - .gitmodules | 3 + clamav | 1 + 5 files changed, 217 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/build_with_clamav.yml create mode 100644 .gitmodules create mode 160000 clamav diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 685c9da2..3a0a0162 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -61,38 +61,26 @@ jobs: # path: src-tauri/target/release/bundle/dmg/*.dmg # retention-days: 1 - # build_msi_release: - # name: Build MSI Release - # runs-on: windows-latest - # steps: - # - name: Checkout - # uses: actions/checkout@v4 - # with: - # submodules: true - # - name: Setup Node.js - # uses: actions/setup-node@v4 - # with: - # cache: yarn - # node-version: 20 - # - name: Install - # run: yarn - # - name: Build - # run: yarn release:msi - # - name: Upload - # uses: actions/upload-artifact@v4 - # with: - # name: ci-release-msi - # path: src-tauri/target/release/bundle/msi/*.msi - # retention-days: 1 - - build_msi_release_next: - name: Build MSI Release (Next) + build_msi_release: + name: Build MSI Release runs-on: windows-latest steps: - name: Checkout uses: actions/checkout@v4 with: submodules: true + - name: Download last ClamAV release + run: | + Invoke-WebRequest ` + -Uri https://github.com/Cisco-Talos/clamav/releases/download/clamav-1.3.1/clamav-1.3.1.win.x64.zip ` + -OutFile clamav-1.3.1.win.x64.zip + Invoke-WebRequest ` + -Uri https://github.com/Cisco-Talos/clamav/releases/download/clamav-1.3.1/clamav-1.3.1.win.x64.zip.sig ` + -OutFile clamav-1.3.1.win.x64.zip.sig + echo "${{ secrets.TALOS_GPG_PUBLIC_KEY }}" | gpg --import + gpg --verify clamav-1.3.1.win.x64.zip.sig clamav-1.3.1.win.x64.zip + working-directory: .\sidecars + # - name: Setup Node.js # uses: actions/setup-node@v4 # with: diff --git a/.github/workflows/build_with_clamav.yml b/.github/workflows/build_with_clamav.yml new file mode 100644 index 00000000..4d818e8c --- /dev/null +++ b/.github/workflows/build_with_clamav.yml @@ -0,0 +1,199 @@ +name: Build With ClamAV + +on: + workflow_dispatch: + +jobs: + # build_deb_release: + # name: Build DEB Release (With ClamAV) + # runs-on: ubuntu-latest + # container: + # image: ivangabriele/tauri:debian-bullseye-18 + # steps: + # - name: Checkout + # uses: actions/checkout@v4 + # with: + # submodules: true + # - name: Setup Node.js + # uses: actions/setup-node@v4 + # with: + # cache: yarn + # node-version: 20 + # - name: Install + # run: yarn + # - name: Build + # run: yarn release:deb + # - name: Upload + # uses: actions/upload-artifact@v4 + # with: + # name: ci-release-deb + # path: src-tauri/target/release/bundle/deb/*.deb + # retention-days: 1 + + # build_dmg_release: + # name: Build DMG Release + # runs-on: macos-latest + # steps: + # - name: Checkout + # uses: actions/checkout@v4 + # with: + # submodules: true + # - name: Setup Node.js + # uses: actions/setup-node@v4 + # with: + # cache: yarn + # node-version: 20 + # - name: Install + # run: yarn + # - name: Build + # run: yarn release:dmg + # - name: Upload + # uses: actions/upload-artifact@v4 + # with: + # name: ci-release-dmg + # path: src-tauri/target/release/bundle/dmg/*.dmg + # retention-days: 1 + + # build_msi_release: + # name: Build MSI Release + # runs-on: windows-latest + # steps: + # - name: Checkout + # uses: actions/checkout@v4 + # with: + # submodules: true + # - name: Setup Node.js + # uses: actions/setup-node@v4 + # with: + # cache: yarn + # node-version: 20 + # - name: Install + # run: yarn + # - name: Build + # run: yarn release:msi + # - name: Upload + # uses: actions/upload-artifact@v4 + # with: + # name: ci-release-msi + # path: src-tauri/target/release/bundle/msi/*.msi + # retention-days: 1 + + build_msi_release: + name: Build MSI Release (With ClamAV) + strategy: + fail-fast: true + matrix: + architecture: [x86, x86-64] + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: true + # https://docs.clamav.net/manual/Installing/Installing-from-source-Windows.html#install-prerequisites + # (`choco install activeperl cmake nasm wixtoolset`) + # `perl` is installed by default on all GitHub Actions runners. + # `wixtoolset` is installed by default on GitHub Actions Windows runners. + - name: Install ClamAV build prerequisites + run: | + # perl -v + choco install ` + cmake nasm + python3 -m pip install mussels + - name: Output ClamAV Git submodule status + run: | + git submodule foreach 'git fetch --tags' + $gitCommitSha = git rev-parse HEAD + $gitTag = git describe --tags --exact-match $gitCommitSha 2>$null + Write-Output "Git Commit SHA: $gitCommitSha" + Write-Output "Git Tag: $gitTag" + working-directory: .\clamav + - name: Prepare ClamAV build + run: | + mkdir build && cd build + msl update + msl cookbook trust -y clamav + working-directory: .\clamav + - name: Build ClamAV libraries (${{ matrix.architecture }}) + run: | + if [ "${{ matrix.architecture }}" == "x86-64" ]; then + msl build clamav_deps + else + msl build clamav_deps -t x86 + fi + working-directory: .\clamav\build + - name: Build ClamAV binaries (${{ matrix.architecture }}) + run: | + if [ "${{ matrix.architecture }}" == "x86-64" ]; then + cmake .. -G "Visual Studio 16 2019" -A x64 ` + -D JSONC_INCLUDE_DIR="$home\.mussels\install\x64\include\json-c" ` + -D JSONC_LIBRARY="$home\.mussels\install\x64\lib\json-c.lib" ` + -D ENABLE_JSON_SHARED=OFF ` + -D BZIP2_INCLUDE_DIR="$home\.mussels\install\x64\include" ` + -D BZIP2_LIBRARY_RELEASE="$home\.mussels\install\x64\lib\libbz2.lib" ` + -D CURL_INCLUDE_DIR="$home\.mussels\install\x64\include" ` + -D CURL_LIBRARY="$home\.mussels\install\x64\lib\libcurl_imp.lib" ` + -D OPENSSL_ROOT_DIR="$home\.mussels\install\x64" ` + -D OPENSSL_INCLUDE_DIR="$home\.mussels\install\x64\include" ` + -D OPENSSL_CRYPTO_LIBRARY="$home\.mussels\install\x64\lib\libcrypto.lib" ` + -D OPENSSL_SSL_LIBRARY="$home\.mussels\install\x64\lib\libssl.lib" ` + -D ZLIB_LIBRARY="$home\.mussels\install\x64\lib\libssl.lib" ` + -D LIBXML2_INCLUDE_DIR="$home\.mussels\install\x64\include" ` + -D LIBXML2_LIBRARY="$home\.mussels\install\x64\lib\libxml2.lib" ` + -D PCRE2_INCLUDE_DIR="$home\.mussels\install\x64\include" ` + -D PCRE2_LIBRARY="$home\.mussels\install\x64\lib\pcre2-8.lib" ` + -D CURSES_INCLUDE_DIR="$home\.mussels\install\x64\include" ` + -D CURSES_LIBRARY="$home\.mussels\install\x64\lib\pdcurses.lib" ` + -D PThreadW32_INCLUDE_DIR="$home\.mussels\install\x64\include" ` + -D PThreadW32_LIBRARY="$home\.mussels\install\x64\lib\pthreadVC2.lib" ` + -D ZLIB_INCLUDE_DIR="$home\.mussels\install\x64\include" ` + -D ZLIB_LIBRARY="$home\.mussels\install\x64\lib\zlibstatic.lib" ` + -D LIBCHECK_INCLUDE_DIR="$home\.mussels\install\x64\include" ` + -D LIBCHECK_LIBRARY="$home\.mussels\install\x64\lib\checkDynamic.lib" ` + -D CMAKE_INSTALL_PREFIX="install" + else + cmake .. -G "Visual Studio 16 2019" ` + -D JSONC_INCLUDE_DIR="$home\.mussels\install\x64\include\json-c" ` + -D JSONC_LIBRARY="$home\.mussels\install\x64\lib\json-c.lib" ` + -D ENABLE_JSON_SHARED=OFF ` + -D BZIP2_INCLUDE_DIR="$home\.mussels\install\x64\include" ` + -D BZIP2_LIBRARY_RELEASE="$home\.mussels\install\x64\lib\libbz2.lib" ` + -D CURL_INCLUDE_DIR="$home\.mussels\install\x64\include" ` + -D CURL_LIBRARY="$home\.mussels\install\x64\lib\libcurl_imp.lib" ` + -D OPENSSL_ROOT_DIR="$home\.mussels\install\x64" ` + -D OPENSSL_INCLUDE_DIR="$home\.mussels\install\x64\include" ` + -D OPENSSL_CRYPTO_LIBRARY="$home\.mussels\install\x64\lib\libcrypto.lib" ` + -D OPENSSL_SSL_LIBRARY="$home\.mussels\install\x64\lib\libssl.lib" ` + -D ZLIB_LIBRARY="$home\.mussels\install\x64\lib\libssl.lib" ` + -D LIBXML2_INCLUDE_DIR="$home\.mussels\install\x64\include" ` + -D LIBXML2_LIBRARY="$home\.mussels\install\x64\lib\libxml2.lib" ` + -D PCRE2_INCLUDE_DIR="$home\.mussels\install\x64\include" ` + -D PCRE2_LIBRARY="$home\.mussels\install\x64\lib\pcre2-8.lib" ` + -D CURSES_INCLUDE_DIR="$home\.mussels\install\x64\include" ` + -D CURSES_LIBRARY="$home\.mussels\install\x64\lib\pdcurses.lib" ` + -D PThreadW32_INCLUDE_DIR="$home\.mussels\install\x64\include" ` + -D PThreadW32_LIBRARY="$home\.mussels\install\x64\lib\pthreadVC2.lib" ` + -D ZLIB_INCLUDE_DIR="$home\.mussels\install\x64\include" ` + -D ZLIB_LIBRARY="$home\.mussels\install\x64\lib\zlibstatic.lib" ` + -D LIBCHECK_INCLUDE_DIR="$home\.mussels\install\x64\include" ` + -D LIBCHECK_LIBRARY="$home\.mussels\install\x64\lib\checkDynamic.lib" ` + -D CMAKE_INSTALL_PREFIX="install" + fi + cmake --build . --config RelWithDebInfo + working-directory: .\clamav\build + # - name: Setup Node.js + # uses: actions/setup-node@v4 + # with: + # cache: yarn + # node-version: 20 + # - name: Install + # run: yarn + # - name: Build + # run: yarn release:msi + # - name: Upload + # uses: actions/upload-artifact@v4 + # with: + # name: ci-release-msi + # path: src-tauri/target/release/bundle/msi/*.msi + # retention-days: 1 diff --git a/.gitignore b/.gitignore index c9ba4b15..11ee5fe0 100644 --- a/.gitignore +++ b/.gitignore @@ -160,7 +160,5 @@ dist /.debug/* !/.debug/.gitkeep -# /clamav/build - /sidecars/* !/sidecars/.gitkeep diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..10a3e9f8 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "clamav"] + path = clamav + url = https://github.com/Cisco-Talos/clamav.git diff --git a/clamav b/clamav new file mode 160000 index 00000000..ae81c213 --- /dev/null +++ b/clamav @@ -0,0 +1 @@ +Subproject commit ae81c213b97595e26768e4f02bd339b08c4677ca From 9d3967c38f1231ba4aa47d72fae659dab11f9f90 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Fri, 23 Aug 2024 05:25:57 +0200 Subject: [PATCH 05/74] refactor: re-lint project --- src/screens/Settings/constants.ts | 8 +++++ src/screens/Settings/index.tsx | 18 ++++------- src/types.ts | 53 +++++++++++-------------------- 3 files changed, 33 insertions(+), 46 deletions(-) diff --git a/src/screens/Settings/constants.ts b/src/screens/Settings/constants.ts index 69d18e6a..c6152c9c 100644 --- a/src/screens/Settings/constants.ts +++ b/src/screens/Settings/constants.ts @@ -2,6 +2,7 @@ import { tags as t } from '@lezer/highlight' import createTheme from '@uiw/codemirror-themes' import type { BasicSetupOptions } from '@uiw/react-codemirror' +import type { Core } from '../../types' export const CODE_MIRROR_OPTIONS: BasicSetupOptions = { allowMultipleSelections: false, @@ -68,3 +69,10 @@ export const CODE_MIRROR_THEME = createTheme({ ], theme: 'dark', }) + +export const INITIAL_SETTINGS_STATE: Core.SettingsState = { + clamd_conf_file_path: null, + clamd_conf_file_source: null, + is_ready: false, + is_writing: false, +} diff --git a/src/screens/Settings/index.tsx b/src/screens/Settings/index.tsx index 7efbcc8e..767d8a97 100644 --- a/src/screens/Settings/index.tsx +++ b/src/screens/Settings/index.tsx @@ -9,21 +9,15 @@ import { Button } from '../../elements/Button' import { useCachedState } from '../../hooks/useCachedState' import { Screen } from '../../layouts/Screen' import { type Core, Webview } from '../../types' -import { CODE_MIRROR_OPTIONS, CODE_MIRROR_THEME } from './constants' +import { CODE_MIRROR_OPTIONS, CODE_MIRROR_THEME, INITIAL_SETTINGS_STATE } from './constants' export function Settings() { const clamdConfFileSourceRef = useRef(null) - const [state, setState, updateState] = useCachedState(Webview.CacheKey.SETTINGS_STATE, { - // biome-ignore lint/style/useNamingConvention: Core event data. - clamd_conf_file_path: null, - // biome-ignore lint/style/useNamingConvention: Core event data. - clamd_conf_file_source: null, - // biome-ignore lint/style/useNamingConvention: Core event data. - is_ready: false, - // biome-ignore lint/style/useNamingConvention: Core event data. - is_writing: false, - }) + const [state, setState, updateState] = useCachedState( + Webview.CacheKey.SETTINGS_STATE, + INITIAL_SETTINGS_STATE, + ) const isLoading = !state.is_ready @@ -42,7 +36,7 @@ export function Settings() { updateState(prevState => ({ ...prevState, - // biome-ignore lint/style/useNamingConvention: Core event data. + // biome-ignore lint/style/useNamingConvention: is_writing: true, })) diff --git a/src/types.ts b/src/types.ts index 9f902bbf..ce588b7b 100644 --- a/src/types.ts +++ b/src/types.ts @@ -7,22 +7,15 @@ export namespace Core { // Cloud export type CloudState = { - // biome-ignore lint/style/useNamingConvention: Core event data. daemon_status: CloudDaemonStatus - // biome-ignore lint/style/useNamingConvention: Core event data. - // biome-ignore lint/style/useNamingConvention: Core event data. is_ready: boolean - // biome-ignore lint/style/useNamingConvention: Core event data. is_running: boolean logs: string[] } export enum CloudDaemonStatus { - // biome-ignore lint/style/useNamingConvention: Core event data. RUNNING = 'Running', - // biome-ignore lint/style/useNamingConvention: Core event data. STOPPED = 'Stopped', - // biome-ignore lint/style/useNamingConvention: Core event data. UNKNOWN = 'Unknown', } @@ -30,18 +23,14 @@ export namespace Core { // Dashboard export type DashboardState = { - // biome-ignore lint/style/useNamingConvention: Core event data. is_ready: boolean logs: string[] status: DashboardStatus } export enum DashboardStatus { - // biome-ignore lint/style/useNamingConvention: Core event data. RUNNING = 'Running', - // biome-ignore lint/style/useNamingConvention: Core event data. STOPPED = 'Stopped', - // biome-ignore lint/style/useNamingConvention: Core event data. UNKNOWN = 'Unknown', } @@ -52,31 +41,29 @@ export namespace Core { children: FileExplorerTree depth: number drive: string - // biome-ignore lint/style/useNamingConvention: Core event data. + index_path: string[] - // biome-ignore lint/style/useNamingConvention: Core event data. + is_checked: boolean - // biome-ignore lint/style/useNamingConvention: Core event data. + is_expanded: boolean kind: FileKind name: string path: string - // biome-ignore lint/style/useNamingConvention: Core event data. + path_components: string[] } export type FileExplorerTree = FileExplorerNode[] export type ScannerState = { - // biome-ignore lint/style/useNamingConvention: Core event data. file_explorer_tree: FileExplorerTree - // biome-ignore lint/style/useNamingConvention: Core event data. + is_ready: boolean - // biome-ignore lint/style/useNamingConvention: Core event data. + is_running: boolean } export type ScannerStatus = { - // biome-ignore lint/style/useNamingConvention: Core event data. current_file_path: string progress: number step: ScannerStatusStep @@ -84,22 +71,22 @@ export namespace Core { export enum ScannerStatusStep { /** Counting the files to scan. */ - // biome-ignore lint/style/useNamingConvention: Core event data. + COUNTING = 'Counting', /** Default step (= waiting for a new job). */ - // biome-ignore lint/style/useNamingConvention: Core event data. + IDLE = 'Idle', /** Listing the files to scan. */ - // biome-ignore lint/style/useNamingConvention: Core event data. + LISTING = 'Listing', /** Scanning the files. */ - // biome-ignore lint/style/useNamingConvention: Core event data. + RUNNING = 'Running', /** Starting (= has called `clamscan` CLI command). */ - // biome-ignore lint/style/useNamingConvention: Core event data. + STARTING = 'Starting', /** Stopping (= has called `clamscan` CLI command). */ - // biome-ignore lint/style/useNamingConvention: Core event data. + STOPPING = 'Stopping', } @@ -107,28 +94,26 @@ export namespace Core { // Settings export type SettingsState = { - // biome-ignore lint/style/useNamingConvention: Core event data. clamd_conf_file_path: string | null - // biome-ignore lint/style/useNamingConvention: Core event data. + clamd_conf_file_source: string | null - // biome-ignore lint/style/useNamingConvention: Core event data. + is_ready: boolean - // biome-ignore lint/style/useNamingConvention: Core event data. + is_writing: boolean } } export namespace Webview { export enum CacheKey { - // biome-ignore lint/style/useNamingConvention: Core event data. CLOUD_STATE = 'CLOUD_STATE', - // biome-ignore lint/style/useNamingConvention: Core event data. + DASHBOARD_STATE = 'DAEMON_STATE', - // biome-ignore lint/style/useNamingConvention: Core event data. + SCANNER_STATE = 'SCANNER_STATE', - // biome-ignore lint/style/useNamingConvention: Core event data. + SCANNER_STATUS = 'SCANNER_STATUS', - // biome-ignore lint/style/useNamingConvention: Core event data. + SETTINGS_STATE = 'SETTINGS_STATE', } } From f1c5cbbb7cfcfe07a87d44d6208254c9e794cf4e Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Fri, 23 Aug 2024 05:28:22 +0200 Subject: [PATCH 06/74] ci(husky): update hooks following v9 deprecations --- .husky/commit-msg | 3 --- .husky/pre-commit | 3 --- 2 files changed, 6 deletions(-) diff --git a/.husky/commit-msg b/.husky/commit-msg index 0a360099..ba13e99e 100755 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -1,6 +1,3 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - [ -n "$CI" ] && exit 0 yarn commitlint --edit "$1" diff --git a/.husky/pre-commit b/.husky/pre-commit index 13f9af66..84da7111 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,6 +1,3 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - [ -n "$CI" ] && exit 0 if command -v ggshield >/dev/null; then From 56b81931706cd161f9510a6b7a4b1628dc72d45d Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Fri, 23 Aug 2024 14:02:18 +0200 Subject: [PATCH 07/74] build(clamav): bump from v1.3.1 to v1.4.0 --- .gitignore | 1 + clamav | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 11ee5fe0..0468c6c1 100644 --- a/.gitignore +++ b/.gitignore @@ -156,6 +156,7 @@ dist /bins/* !/bins/.gitkeep +!/bins/*.c /.debug/* !/.debug/.gitkeep diff --git a/clamav b/clamav index ae81c213..cad552d1 160000 --- a/clamav +++ b/clamav @@ -1 +1 @@ -Subproject commit ae81c213b97595e26768e4f02bd339b08c4677ca +Subproject commit cad552d115e764c11c492f77b8a9f76819443108 From 67275b51fdc2217994bd9fad9de33f08794bf50b Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Sun, 25 Aug 2024 20:10:06 +0200 Subject: [PATCH 08/74] build(npm): add test:unit:webview:debug & test:unit:webview:watch scripts --- package.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ff89482f..be8f74e0 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "build:core": "cd ./src-tauri && cargo build", "build:linux:debian": "sh ./scripts/build_linux_debian.sh", "build:webview": "tsc -p ./tsconfig.build.json && vite build", - "clean": "rm -Rf ./.e2e ./coverage ./dist ./node_modules/.vite ./src-tauri/target ./src-tauri/cobertura.xml", + "clean": "rm -fr ./.e2e ./coverage ./dist ./node_modules/.vite ./src-tauri/target ./src-tauri/cobertura.xml", "dev": "cross-env RUST_BACKTRACE=full TAURI_DEV=true tauri dev", "dev:webview": "vite", "postinstall": "node ./scripts/dev/post_install.js", @@ -29,7 +29,9 @@ "test:sec": "ggshield iac scan all", "test:type": "tsc --noEmit -p ./tsconfig.ci.json", "test:unit:core": "make test", - "test:unit:webview": "jest --config=./configs/jest.config.js --detectOpenHandles", + "test:unit:webview": "jest --config=./configs/jest.config.js", + "test:unit:webview:debug": "test:unit:webview --detectOpenHandles", + "test:unit:webview:watch": "test:unit:webview --watch", "postversion": "git push origin HEAD --tags" }, "dependencies": { From e7bc84306a15f75ba4fc8ec1d0fc4ea8e86f8e7a Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Sun, 25 Aug 2024 20:13:24 +0200 Subject: [PATCH 09/74] build(tsc): enable incremental build --- tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/tsconfig.json b/tsconfig.json index e77c4fe0..c41d4858 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "@ivangabriele/tsconfig-react/tsconfig.json", "compilerOptions": { + "incremental": true, "jsx": "react-jsx", "noImplicitAny": false, "noImplicitOverride": true, From 366c4c9d3295ad2ad8a4cab83ae7f2b1e987b6b4 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Sun, 25 Aug 2024 22:33:25 +0200 Subject: [PATCH 10/74] build(scripts): add Windows resources download, extraction & verification --- .editorconfig | 12 + .github/workflows/build.yml | 27 +- .gitignore | 8 +- meta.json | 5 + package.json | 12 +- {bins => resources}/.gitkeep | 0 .../actions/downloadClamavStandaloneBuild.js | 120 ++ scripts/build/cisco-talos-gpg-public-key.asc | 63 + scripts/build/prepare_core_build.js | 19 + sidecars/.gitkeep | 0 src-tauri/tauri.conf.json | 5 +- vite.config.ts | 9 +- yarn.lock | 1158 ++++++++++++++++- 13 files changed, 1374 insertions(+), 64 deletions(-) create mode 100644 meta.json rename {bins => resources}/.gitkeep (100%) create mode 100644 scripts/build/actions/downloadClamavStandaloneBuild.js create mode 100644 scripts/build/cisco-talos-gpg-public-key.asc create mode 100644 scripts/build/prepare_core_build.js delete mode 100644 sidecars/.gitkeep diff --git a/.editorconfig b/.editorconfig index 750c5f19..d4c2ac36 100644 --- a/.editorconfig +++ b/.editorconfig @@ -14,6 +14,9 @@ trim_trailing_whitespace = true max_line_length = 0 trim_trailing_whitespace = false +[*.{c,cpp,h,hpp}] +indent_size = 4 + [*.py] indent_size = 4 @@ -31,3 +34,12 @@ max_line_length = 0 indent_size = 8 indent_style = tab max_line_length = 80 + +# Ignored files +[*.{asc,cer,crt,der,key,pem}] +charset = unset +end_of_line = unset +insert_final_newline = unset +trim_trailing_whitespace = unset +indent_style = unset +indent_size = unset diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3a0a0162..6c07a59f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,23 +63,26 @@ jobs: build_msi_release: name: Build MSI Release + strategy: + matrix: + target: ['arm64ec-pc-windows-msvc', 'i686-pc-windows-msvc', 'x86_64-pc-windows-msvc'] runs-on: windows-latest steps: - name: Checkout uses: actions/checkout@v4 with: - submodules: true - - name: Download last ClamAV release - run: | - Invoke-WebRequest ` - -Uri https://github.com/Cisco-Talos/clamav/releases/download/clamav-1.3.1/clamav-1.3.1.win.x64.zip ` - -OutFile clamav-1.3.1.win.x64.zip - Invoke-WebRequest ` - -Uri https://github.com/Cisco-Talos/clamav/releases/download/clamav-1.3.1/clamav-1.3.1.win.x64.zip.sig ` - -OutFile clamav-1.3.1.win.x64.zip.sig - echo "${{ secrets.TALOS_GPG_PUBLIC_KEY }}" | gpg --import - gpg --verify clamav-1.3.1.win.x64.zip.sig clamav-1.3.1.win.x64.zip - working-directory: .\sidecars + submodules: false + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + cache: yarn + node-version: 20 + - name: Install + run: yarn + - name: Download latest ClamAV release + run: yarn release:msi + env: + TARGET: ${{ matrix.target }} # - name: Setup Node.js # uses: actions/setup-node@v4 diff --git a/.gitignore b/.gitignore index 0468c6c1..4a0b53d1 100644 --- a/.gitignore +++ b/.gitignore @@ -154,12 +154,8 @@ dist ######################################## # Custom -/bins/* -!/bins/.gitkeep -!/bins/*.c +/resources/* +!/resources/.gitkeep /.debug/* !/.debug/.gitkeep - -/sidecars/* -!/sidecars/.gitkeep diff --git a/meta.json b/meta.json new file mode 100644 index 00000000..03be50cb --- /dev/null +++ b/meta.json @@ -0,0 +1,5 @@ +{ + "clamav": { + "version": "1.4.0" + } +} diff --git a/package.json b/package.json index be8f74e0..949fc407 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,8 @@ "npm": "10" }, "scripts": { + "prebuild:core": "yarn build:webview && node ./scripts/build/prepare_core_build.js", "build": "cd ./src-tauri && cargo build", - "build:core": "cd ./src-tauri && cargo build", "build:linux:debian": "sh ./scripts/build_linux_debian.sh", "build:webview": "tsc -p ./tsconfig.build.json && vite build", "clean": "rm -fr ./.e2e ./coverage ./dist ./node_modules/.vite ./src-tauri/target ./src-tauri/cobertura.xml", @@ -22,6 +22,7 @@ "release:deb:install": "yarn release:deb && sudo dpkg -i ./src-tauri/target/release/bundle/deb/clamav-desktop_0.3.24_amd64.deb", "release:dmg": "tauri build -b dmg", "release:msi": "tauri build -b msi", + "release:msi:x64": "TARGET=x86_64-pc-windows-msvc yarn release:msi", "start": "./src-tauri/target/release/clamav-desktop", "test": "yarn test:lint && yarn test:type && yarn test:unit:core && test:unit:webview", "test:e2e": "xvfb-run wdio run ./configs/wdio.config.ts", @@ -69,6 +70,9 @@ "@testing-library/jest-dom": "6.4.8", "@testing-library/react": "16.0.0", "@testing-library/user-event": "14.5.2", + "@types/decompress": "^4", + "@types/download": "8.0.5", + "@types/fs-extra": "^11", "@types/jest": "29.5.12", "@types/lodash.debounce": "4.0.9", "@types/node": "20.16.1", @@ -85,13 +89,19 @@ "@wdio/spec-reporter": "8.38.2", "bhala": "3.0.4", "cross-env": "7.0.3", + "decompress": "4.2.1", + "del": "7.1.0", + "download": "8.0.0", "esm-path": "1.0.1", "execa": "9.3.1", + "fs-extra": "11.2.0", "husky": "9.1.4", "jest": "29.7.0", "jest-environment-jsdom": "29.7.0", "lint-staged": "15.2.9", "make-dir-cli": "4.0.0", + "openpgp": "5.11.2", + "ora": "8.1.0", "shelljs": "0.8.5", "ts-node": "10.9.2", "type-fest": "4.25.0", diff --git a/bins/.gitkeep b/resources/.gitkeep similarity index 100% rename from bins/.gitkeep rename to resources/.gitkeep diff --git a/scripts/build/actions/downloadClamavStandaloneBuild.js b/scripts/build/actions/downloadClamavStandaloneBuild.js new file mode 100644 index 00000000..c66287bb --- /dev/null +++ b/scripts/build/actions/downloadClamavStandaloneBuild.js @@ -0,0 +1,120 @@ +import { promises as fs } from 'node:fs' +import { join, sep } from 'node:path' +import { B } from 'bhala' +import decompress from 'decompress' +import { deleteAsync } from 'del' +import download from 'download' +import { move } from 'fs-extra' +import { createMessage, enums, readKey, readSignature, verify } from 'openpgp' + +// Key: rustc target triple, Value: ClamAV architecture file name +const OS_WITH_ARCH_MAP = { + 'arm64ec-pc-windows-msvc': 'win.arm64', + 'i686-pc-windows-msvc': 'win.x32', + 'x86_64-pc-windows-msvc': 'win.x64', +} + +/** + * Download ClamAV standalone build for Windows. + */ +export async function downloadClamavStandaloneBuild(target, rootPath) { + // We only download the standalone build for Windows, for simplicity. For Linux and macOS, we build them from source. + if (process.platform !== 'win32') { + B.info('[prepare_core_build.js]', 'Not a Windows machine. Skipping standalone download...') + + return + } + + const metaSource = await fs.readFile(`${rootPath}/meta.json`, 'utf8') + const meta = JSON.parse(metaSource) + + const clamavVersion = meta.clamav.version + const resourcesPath = join(rootPath, 'resources') + const signaturePublicKeyPath = join(rootPath, 'scripts/build/cisco-talos-gpg-public-key.asc') + const targetSlug = OS_WITH_ARCH_MAP[target] + + const downloadedBuildPath = join(resourcesPath, `clamav-${clamavVersion}.${targetSlug}`) + const downloadedBuildZipPath = `${downloadedBuildPath}.zip` + const downloadedBuildZipSignaturePath = `${downloadedBuildZipPath}.sig` + const targetBuildPath = join(resourcesPath, 'clamav') + + // ----------------------------------------------------------------------------- + // Clean up resources + + B.info('[prepare_core_build.js]', 'Cleaning up resources directory...') + await deleteAsync([`${resourcesPath}${sep}*`, `!${resourcesPath}${sep}.gitkeep`]) + + // ----------------------------------------------------------------------------- + // Download ClamAV standalone build + + const buildDownloadUrl = [ + 'https://github.com/Cisco-Talos/clamav/releases/download', + `clamav-${clamavVersion}`, + `clamav-${clamavVersion}.${targetSlug}.zip`, + ].join('/') + const signatureDownloadUrl = `${buildDownloadUrl}.sig` + + B.info( + '[prepare_core_build.js]', + `Downloading ClamAV v${clamavVersion} standalone build for target: ${targetSlug}...`, + ) + await download(buildDownloadUrl, resourcesPath) + B.info( + '[prepare_core_build.js]', + `Downloading ClamAV v${clamavVersion} standalone build signature for target: ${targetSlug}...`, + ) + await download(signatureDownloadUrl, resourcesPath) + + // ----------------------------------------------------------------------------- + // Verify ClamAV standalone build signature + + B.info('[prepare_core_build.js]', `Verifying ClamAV v${clamavVersion} standalone build signature...`) + const publicKeyArmored = await fs.readFile(signaturePublicKeyPath, 'utf8') + const signatureArmored = await fs.readFile(downloadedBuildZipSignaturePath, 'utf8') + const zipFile = await fs.readFile(downloadedBuildZipPath) + + const publicKey = await readKey({ armoredKey: publicKeyArmored }) + const signature = await readSignature({ armoredSignature: signatureArmored }) + const verificationResult = await verify({ + message: await createMessage({ binary: zipFile }), + signature: signature, + verificationKeys: publicKey, + config: { + // Seems to be hashed with SHA1 + // (to avoid: `Error: Insecure message hash algorithm: SHA1`) + // https://github.com/openpgpjs/openpgpjs/blob/main/src/config/config.js#L241 + rejectMessageHashAlgorithms: new Set([enums.hash.md5, enums.hash.ripemd]), + }, + }) + + try { + await verificationResult.signatures[0].verified // Throws an error if verification fails + } catch (err) { + B.error('[prepare_core_build.js]', 'ClamAV v${clamavVersion} standalone build signature verification failed.') + console.error(err) + + process.exit(1) + } + + // ----------------------------------------------------------------------------- + // Extract ClamAV standalone build + + B.info('[prepare_core_build.js]', `Extracting ClamAV v${clamavVersion} standalone build...`) + await decompress(downloadedBuildZipPath, resourcesPath) + + // ----------------------------------------------------------------------------- + // Clean up downloaded files + + B.info('[prepare_core_build.js]', 'Cleaning up downloaded files...') + await deleteAsync([downloadedBuildZipPath, downloadedBuildZipSignaturePath]) + + // ----------------------------------------------------------------------------- + // Normalize extracted directory name + + B.info('[prepare_core_build.js]', 'Normalizing extracted directory name...') + await move(downloadedBuildPath, targetBuildPath) + + // ----------------------------------------------------------------------------- + + B.success('[prepare_core_build.js]', `ClamAV v${clamavVersion} standalone build downloaded successfully.`) +} diff --git a/scripts/build/cisco-talos-gpg-public-key.asc b/scripts/build/cisco-talos-gpg-public-key.asc new file mode 100644 index 00000000..d23279a3 --- /dev/null +++ b/scripts/build/cisco-talos-gpg-public-key.asc @@ -0,0 +1,63 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBGQPO58BEACsF0vtWepeSZRklvCG170RKuZL+9aH8U3zVVtQgDlmcboVRiFf ++fgraQCRVh8cbRM76mqqGoMT0BlwZ1OfrzpZcrNUg5uAgok51P7SoCy3zummnv4M +TadwDLEHNf/38HSnrJe196IiwMEtyuKMGDfzyjQnr357Owem+7FgT2/sU7XwWD2B ++tn/yhbw+HpJuUjdmxmEqJr/4okRSj9OSWV+EFhS9owMNK8zntwHkJzmv4ctS1Ak +Zryh/J3jEnPqzSJDsH729XzKpG4BxCxnybP5WuMsJuNvSlVhVko1PaSi84Dy003w +WoQIgtQHNm6i8CcetrpNCULELTU8sViwdBQXIlGjCa3N+dq1ZOErasp4QzlCVOus +iOkm1KltvbJWPfVDW0A0Z4mP19YRlQTc0jn4w9R5ROmwcLf6Co8nBD2AV8MFjVJA +E21Mfj6LfksplmYg/DEa4kCe8KYPSATq6LFSf+o96fkmnsZovOi6zZ6RtV9l4Aya +pkcvk9iO2cvJMDYJ6iA2dC8EHC2m1tt1Rs2abJqOmsUJATo7MUpK7MD7NyhVvkjJ +j5QRES25uV4OY9ck091GB+XXAf3gGf3Pi2jop1gauGoxyBqLT4SkwqsnsrFF8eEh +A8UdBmo4K6MWFaxw6JsBPpIM63Qe848RzlQRanxS2n50ZZwMLIJrI2MEFQARAQAB +tDtUYWxvcyAoVGFsb3MsIENpc2NvIFN5c3RlbXMgSW5jLikgPHJlc2VhcmNoQHNv +dXJjZWZpcmUuY29tPokCPgQTAQIAKAUCZA87nwIbAwUJA8JnAAYLCQgHAwIGFQgC +CQoLBBYCAwECHgECF4AACgkQzODf0h7Bqb8gjw/9FYbuwzBjuVCVhHfoY4rfCDoj +eh3NVaTdHIWO1yp6JSM/ny+Z3wDzZLtyQlBcnaJlerncS961iOEG2gBA3v8fZudN +JFpvRC1gxd9IEhGXIDDg+BeOAJUbY9LQTc/dnzWBB04nun20+lM/Rad2BlkQ+YSz +uRUaFsgk0lQPCSDQfoahtoap14jWFsa19aOjTXhAF1MGEDXuoCXM6ByH6wJjtz+z +QJrXvmHS4v8yh8z/pibLGV7IgNrtoW2ej4jFadzEEn/MDajI+5N3C2w5rD41L7Lm +j1uCIBe1G54fgJSstvBxZcnAj9qTF2FBBUpQ1q/ONFfUjpAGQKG2qh1UNBiOZNS3 +gDVN2T8h083WRN2gQvNJnJwXaF4Nm6zhmX4sUqE9nexUrDF8VG8xXJwPgZijaHPV +nZdgDZvQ47BKiJOUj80O9/qYyWo89pX6Rr/YmfbURhRe/kiPon9kIVFCzDDFPniJ +svICjpdkz7wZ0kUN+L7BtDQJfjFjTJPNA2nOV6l64DcdCiyutOFSz4Zf85GoT9wK +Mqv1UmpLwsq2FnF+Gpk1GLZCLprSCu3n16pr+gdRshnE93cvJbMGlP0+jcuFF5hr +Lsvujl7O81JrIjmGXrulHHpdrZQ4J2A3UpDDc60DOHG9ubnBnN7k2kQPY+9a1rzf +WPkMQKaxVo3uH1XRO/GJAhwEEAECAAYFAmQPQKgACgkQYJsCTys+3QcvuA//cuJX +LDfsGn9pWTCU83cF6eiQ5Id5FPKldyhSqYRgavgRov0fwD6ZU79dpURf+YsWxxtI +pIntn9hUgSgmdyUw+0GcAmFq6gJOQxWY2nij6X0A9Pskr2qW+WhMGKKVbYez65qw +fgGdlDFT/4nzVBGpIlRGGuOC0aT3jDhBXbp8Eusxi+5He7Kx2Chem7kCX9xBpUYS +FrujMlaMs8O1bsBW3xTWLpHhX6O6bpEY8zDfWavSAqCmzw5RtytAJWsAG1clU9AK +FwSKC+10ODo5VFzmRSgF727Gtuow1WnPhFM/7Cn+M+knCTm2vRz6Vz29/a6DUrZl +CbyKGPR8a9C3UG4VT8C3+fi1boZ+/trUw27YtrKp70FDy3UdgLDF2eO9B77vs35n ++hf2EipG407CGBqb8q6boOdxC0BN/Fcy30Oms4DSUTqEiqvSA/35BhyGfOmJb5tt +kMEHLPveJvilICKBMQdYHemR3mk+muzAO7+y4VOKl+rP0xXCp6y6PAiEu14lzxzI +isQu6omEJBOUiad2iZz+4OUU1Dil0YgUpNgJQyKaDUOR0MSzFU9IM5pzZJ14XkdG +6iriPEX1V9SlfZlaJDNlN11vFlVFeu02vJTcddAaHYad2tKD09GAEuZkib0ToWxz +S+4cBxojti6vMUHVSIlbov7ZMHd/WMqQUb1tSl65Ag0EZA87nwEQALkEL5rxEnv7 +rcwcF3KwcppfHTWjkTV0dyMmE/kLf9e3QnMdCaiZMypxmYipOe9Z/9G6YGH+Qujp +N0mzenNgKljs961VTbOUYTusgwTz1qFienX8lg+eYRQIpqPjisb1xGlISojI7vWO +FZT/LrxVI6Y+HLSXkZjPD7TqyefgOlP2YchmFAjC/e+rtKAZ+FLlguotvDRxl/zp +AA8LLFup8Y8+BvQIWiy6jwwAjJMiJdwBtUz1OxpMuGU/C6bWCkAAFKjhC5F9JQEI +9jHh7/cQEGabDmjIGfywj9jniJrP79hrLfuryFvo6qbw7EwirJbKpoHJwS03ei29 +Uwttw2Dn41dZ0MvjfpYwI61cE5NpvKCBJkkEho6SDXGvLABerEu3ASGlYybQOzrg +aHO9AxGXgD2tFjI0NNunVxy/0KQ+kWcdQ1p/dk/O2U6w5CfFHU68aZgAxmj7jngx +YKjs3IAUy8mwkxtyyFiLJ3E19NdB8+t0cjJMtDVtXOgmoi7HaP8RghdaitaI4q/z +ocIAWhJhN7IkzrYWJ/Bkq4j0doKmaDR8GPP3i5Keg1c1z4yGX1c9MWTMy49l5Nwl +/bUjUiIRocCc33dZCqL5KPMBdtLJOUiIG/KZoMqr6Ozxyriv4Nn/CT2/SSvatYtP +SN91kt61c2FmoBBSltiFwncbUVmB3HmDABEBAAGJAiUEGAECAA8FAmQPO58CGwwF +CQPCZwAACgkQzODf0h7Bqb/ueQ/7BofldLW0/GqvTMEDnysUB/tchWzae6LnBeur +EhIB6smOVkMiuzrRLl2/vFVmv6H1UZK2fRPpaI/3V2mg+ML5ioVVgBrg3IQxcDpY +sYiictUFXJQ9y/ygAl8zxbkE4v4BWAwk5kIFWw1q/sb3IUc07GeK16PLY0+ocPdV +vMyiV8w5wKBlkyPwdntjuJEyfU3lsIeR2iBcQe4HL1Y0/pm6Ilpn+uj2ZYlYZzhN +zBuLy9HB3it161KP/RyxWNB1AEAAx8Mh0IhHOEWLvbfjHJxkJ2GX0TgL5wa45l2a +3clP4Dw2MpLfzIHs+CxG7t6IdSvoX1+0gZPvmo9JXDsLNa7+uu/lcCUjXY9TWdvc +VIZRwlSBQQC8WnGpbkvsBDsJ2BskPWOmv0ol3aiiekJJhVT1K9M1ZwDGX1ts8hLr +mf0kCFDq0RImCg6WZAM6z3Fg/1pPGPRktJ4tmSui3GYzrVA34gTunvlqPYKCFYHA +EdUdqycz7UAroj7k3OndZGnnT2r/qKaIYF53/u+6SXM/lUSrJfwxG9eXiw80P/YW +K9VjT3CbQA74vz7pC1bxpYDas6w39DRpkYR1bn1GIhmJhK2CUj5FQla+opVN2Wmg +sk0O7hoet7RDvKpoUyBHxHOJseDQEzWc38bOxD+x0vz/MirBnLdBx8g836tgqy7h +ab6V2qU= +=X+5e +-----END PGP PUBLIC KEY BLOCK----- \ No newline at end of file diff --git a/scripts/build/prepare_core_build.js b/scripts/build/prepare_core_build.js new file mode 100644 index 00000000..9aa74f54 --- /dev/null +++ b/scripts/build/prepare_core_build.js @@ -0,0 +1,19 @@ +import { B } from 'bhala' +import { getAbsolutePath } from 'esm-path' + +import { downloadClamavStandaloneBuild } from './actions/downloadClamavStandaloneBuild.js' + +// `rustc --print target-list` to get the list of supported targets +const ALLOWED_TARGETS = ['arm64ec-pc-windows-msvc', 'i686-pc-windows-msvc', 'x86_64-pc-windows-msvc'] + +const ROOT_PATH = getAbsolutePath(import.meta.url, '../..') + +const { TARGET } = process.env +if (!ALLOWED_TARGETS.includes(TARGET)) { + B.error('[prepare_core_build.js]', `Invalid target: \`${TARGET}\`.`) + + process.exit(1) +} + +B.info('[prepare_core_build.js]', 'Downloading ClamAV standalone build...') +await downloadClamavStandaloneBuild(TARGET, ROOT_PATH) diff --git a/sidecars/.gitkeep b/sidecars/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index dbb97517..9ff74f63 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "../node_modules/@tauri-apps/cli/schema.json", "build": { - "beforeBuildCommand": "yarn build:webview", + "beforeBuildCommand": "yarn prebuild:core", "beforeDevCommand": "yarn dev:webview", "devPath": "http://localhost:1420", "distDir": "../dist", @@ -26,7 +26,6 @@ "/usr/share/polkit-1/actions/com.clamav-desktop.app.policy": "../assets/deb/com.clamav-desktop.app.policy" } }, - "externalBin": [], "icon": [ "../assets/icons/32x32.png", "../assets/icons/128x128.png", @@ -43,7 +42,7 @@ "providerShortName": null, "signingIdentity": null }, - "resources": [], + "resources": ["../resources/*"], "shortDescription": "ClamAV Antivirus Desktop Application", "targets": "all", "windows": { diff --git a/vite.config.ts b/vite.config.ts index f691bb2e..49cf4838 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,15 +1,11 @@ import react from '@vitejs/plugin-react' import { defineConfig } from 'vite' -// https://vitejs.dev/config/ export default defineConfig({ build: { - // don't minify for debug builds - minify: process.env.TAURI_DEBUG ? false : 'esbuild', - - // produce sourcemaps for debug builds + // minify: process.env.TAURI_DEBUG ? false : 'esbuild', + minify: false, sourcemap: !!process.env.TAURI_DEBUG, - // Tauri supports es2021 target: process.env.TAURI_PLATFORM === 'windows' ? 'chrome105' : 'safari13', }, @@ -23,6 +19,7 @@ export default defineConfig({ envPrefix: ['VITE_', 'TAURI_'], plugins: [react()], + // tauri expects a fixed port, fail if that port is not available server: { port: 1420, diff --git a/yarn.lock b/yarn.lock index d1efad49..9d5224d8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1923,6 +1923,33 @@ __metadata: languageName: node linkType: hard +"@nodelib/fs.scandir@npm:2.1.5": + version: 2.1.5 + resolution: "@nodelib/fs.scandir@npm:2.1.5" + dependencies: + "@nodelib/fs.stat": "npm:2.0.5" + run-parallel: "npm:^1.1.9" + checksum: 10/6ab2a9b8a1d67b067922c36f259e3b3dfd6b97b219c540877a4944549a4d49ea5ceba5663905ab5289682f1f3c15ff441d02f0447f620a42e1cb5e1937174d4b + languageName: node + linkType: hard + +"@nodelib/fs.stat@npm:2.0.5, @nodelib/fs.stat@npm:^2.0.2": + version: 2.0.5 + resolution: "@nodelib/fs.stat@npm:2.0.5" + checksum: 10/012480b5ca9d97bff9261571dbbec7bbc6033f69cc92908bc1ecfad0792361a5a1994bc48674b9ef76419d056a03efadfce5a6cf6dbc0a36559571a7a483f6f0 + languageName: node + linkType: hard + +"@nodelib/fs.walk@npm:^1.2.3": + version: 1.2.8 + resolution: "@nodelib/fs.walk@npm:1.2.8" + dependencies: + "@nodelib/fs.scandir": "npm:2.1.5" + fastq: "npm:^1.6.0" + checksum: 10/40033e33e96e97d77fba5a238e4bba4487b8284678906a9f616b5579ddaf868a18874c0054a75402c9fbaaa033a25ceae093af58c9c30278e35c23c9479e79b0 + languageName: node + linkType: hard + "@npmcli/agent@npm:^2.0.0": version: 2.2.2 resolution: "@npmcli/agent@npm:2.2.2" @@ -2186,6 +2213,13 @@ __metadata: languageName: node linkType: hard +"@sindresorhus/is@npm:^0.7.0": + version: 0.7.0 + resolution: "@sindresorhus/is@npm:0.7.0" + checksum: 10/ff5a58748fc04dfcc1fd4e8f94d450937e37ab3bfdee3ba7638adaf13b0ae4cff4da55d5e454f3068fb3d59b91139a783ca1319a6858f4ee73f2977b68a29efb + languageName: node + linkType: hard + "@sindresorhus/is@npm:^5.2.0": version: 5.6.0 resolution: "@sindresorhus/is@npm:5.6.0" @@ -2650,6 +2684,26 @@ __metadata: languageName: node linkType: hard +"@types/decompress@npm:*, @types/decompress@npm:^4": + version: 4.2.7 + resolution: "@types/decompress@npm:4.2.7" + dependencies: + "@types/node": "npm:*" + checksum: 10/f2fcc588e0bbeed4f3897e25980d3a5cceba334b900f83c9ad91b9885e3b25b50bdc283a6d684b73442368f9f12f34b4eabfc7f422067c6a882591ed844aa65b + languageName: node + linkType: hard + +"@types/download@npm:8.0.5": + version: 8.0.5 + resolution: "@types/download@npm:8.0.5" + dependencies: + "@types/decompress": "npm:*" + "@types/got": "npm:^9" + "@types/node": "npm:*" + checksum: 10/10e807e9e4a6dc21918ff3ec302c41db529ba5488c7b296cd6ee7d5cefc872b35f0078d6f47671eb5dd40661d5128eab552c1882982c69fb4825b8a4943f30c9 + languageName: node + linkType: hard + "@types/estree@npm:1.0.5": version: 1.0.5 resolution: "@types/estree@npm:1.0.5" @@ -2657,6 +2711,16 @@ __metadata: languageName: node linkType: hard +"@types/fs-extra@npm:^11": + version: 11.0.4 + resolution: "@types/fs-extra@npm:11.0.4" + dependencies: + "@types/jsonfile": "npm:*" + "@types/node": "npm:*" + checksum: 10/acc4c1eb0cde7b1f23f3fe6eb080a14832d8fa9dc1761aa444c5e2f0f6b6fa657ed46ebae32fb580a6700fc921b6165ce8ac3e3ba030c3dd15f10ad4dd4cae98 + languageName: node + linkType: hard + "@types/glob@npm:~7.2.0": version: 7.2.0 resolution: "@types/glob@npm:7.2.0" @@ -2667,6 +2731,17 @@ __metadata: languageName: node linkType: hard +"@types/got@npm:^9": + version: 9.6.12 + resolution: "@types/got@npm:9.6.12" + dependencies: + "@types/node": "npm:*" + "@types/tough-cookie": "npm:*" + form-data: "npm:^2.5.0" + checksum: 10/21d300355d0ce460490659763fa761b79d8ca381c0fce3fcc98002ace7e43abe7806aed5905cbf3b1e754aec079afc08417ae489d0a8dc63a430d978b16e04b3 + languageName: node + linkType: hard + "@types/graceful-fs@npm:^4.1.3": version: 4.1.9 resolution: "@types/graceful-fs@npm:4.1.9" @@ -2739,6 +2814,24 @@ __metadata: languageName: node linkType: hard +"@types/jsonfile@npm:*": + version: 6.1.4 + resolution: "@types/jsonfile@npm:6.1.4" + dependencies: + "@types/node": "npm:*" + checksum: 10/309fda20eb5f1cf68f2df28931afdf189c5e7e6bec64ac783ce737bb98908d57f6f58757ad5da9be37b815645a6f914e2d4f3ac66c574b8fe1ba6616284d0e97 + languageName: node + linkType: hard + +"@types/keyv@npm:^3.1.1": + version: 3.1.4 + resolution: "@types/keyv@npm:3.1.4" + dependencies: + "@types/node": "npm:*" + checksum: 10/e009a2bfb50e90ca9b7c6e8f648f8464067271fd99116f881073fa6fa76dc8d0133181dd65e6614d5fb1220d671d67b0124aef7d97dc02d7e342ab143a47779d + languageName: node + linkType: hard + "@types/lodash.debounce@npm:4.0.9": version: 4.0.9 resolution: "@types/lodash.debounce@npm:4.0.9" @@ -2846,6 +2939,15 @@ __metadata: languageName: node linkType: hard +"@types/responselike@npm:^1.0.0": + version: 1.0.3 + resolution: "@types/responselike@npm:1.0.3" + dependencies: + "@types/node": "npm:*" + checksum: 10/6ac4b35723429b11b117e813c7acc42c3af8b5554caaf1fc750404c1ae59f9b7376bc69b9e9e194a5a97357a597c2228b7173d317320f0360d617b6425212f58 + languageName: node + linkType: hard + "@types/shelljs@npm:0.8.15": version: 0.8.15 resolution: "@types/shelljs@npm:0.8.15" @@ -3456,6 +3558,16 @@ __metadata: languageName: node linkType: hard +"aggregate-error@npm:^4.0.0": + version: 4.0.1 + resolution: "aggregate-error@npm:4.0.1" + dependencies: + clean-stack: "npm:^4.0.0" + indent-string: "npm:^5.0.0" + checksum: 10/bb3ffdfd13447800fff237c2cba752c59868ee669104bb995dfbbe0b8320e967d679e683dabb640feb32e4882d60258165cde0baafc4cd467cc7d275a13ad6b5 + languageName: node + linkType: hard + "ajv@npm:^8.11.0": version: 8.17.1 resolution: "ajv@npm:8.17.1" @@ -3549,6 +3661,15 @@ __metadata: languageName: node linkType: hard +"archive-type@npm:^4.0.0": + version: 4.0.0 + resolution: "archive-type@npm:4.0.0" + dependencies: + file-type: "npm:^4.2.0" + checksum: 10/271f0d118294dd0305831f0700b635e8a9475f97693212d548eee48017f917e14349a25ad578f8e13486ba4b7cde1972d53e613d980e8738cfccea5fc626c76f + languageName: node + linkType: hard + "archiver-utils@npm:^5.0.0, archiver-utils@npm:^5.0.2": version: 5.0.2 resolution: "archiver-utils@npm:5.0.2" @@ -3618,6 +3739,18 @@ __metadata: languageName: node linkType: hard +"asn1.js@npm:^5.0.0": + version: 5.4.1 + resolution: "asn1.js@npm:5.4.1" + dependencies: + bn.js: "npm:^4.0.0" + inherits: "npm:^2.0.1" + minimalistic-assert: "npm:^1.0.0" + safer-buffer: "npm:^2.1.0" + checksum: 10/63d57c766f6afc81ff175bbf922626b3778d770c8b91b32cbcf672d7bf73b4198aca66c60a6427bff3aebc48feff1eab4a161f2681b7300b6c5b775a1e6fd791 + languageName: node + linkType: hard + "ast-types@npm:^0.13.4": version: 0.13.4 resolution: "ast-types@npm:0.13.4" @@ -3812,6 +3945,16 @@ __metadata: languageName: node linkType: hard +"bl@npm:^1.0.0": + version: 1.2.3 + resolution: "bl@npm:1.2.3" + dependencies: + readable-stream: "npm:^2.3.5" + safe-buffer: "npm:^5.1.1" + checksum: 10/11d775b09ebd7d8c0df1ed7efd03cc8a2b1283c804a55153c81a0b586728a085fa24240647cac9a60163eb6f36a28cf8c45b80bf460a46336d4c84c40205faff + languageName: node + linkType: hard + "bl@npm:^4.1.0": version: 4.1.0 resolution: "bl@npm:4.1.0" @@ -3823,6 +3966,13 @@ __metadata: languageName: node linkType: hard +"bn.js@npm:^4.0.0": + version: 4.12.0 + resolution: "bn.js@npm:4.12.0" + checksum: 10/10f8db196d3da5adfc3207d35d0a42aa29033eb33685f20ba2c36cadfe2de63dad05df0a20ab5aae01b418d1c4b3d4d205273085262fa020d17e93ff32b67527 + languageName: node + linkType: hard + "brace-expansion@npm:^1.1.7": version: 1.1.11 resolution: "brace-expansion@npm:1.1.11" @@ -3881,6 +4031,23 @@ __metadata: languageName: node linkType: hard +"buffer-alloc-unsafe@npm:^1.1.0": + version: 1.1.0 + resolution: "buffer-alloc-unsafe@npm:1.1.0" + checksum: 10/c5e18bf51f67754ec843c9af3d4c005051aac5008a3992938dda1344e5cfec77c4b02b4ca303644d1e9a6e281765155ce6356d85c6f5ccc5cd21afc868def396 + languageName: node + linkType: hard + +"buffer-alloc@npm:^1.2.0": + version: 1.2.0 + resolution: "buffer-alloc@npm:1.2.0" + dependencies: + buffer-alloc-unsafe: "npm:^1.1.0" + buffer-fill: "npm:^1.0.0" + checksum: 10/560cd27f3cbe73c614867da373407d4506309c62fe18de45a1ce191f3785ec6ca2488d802ff82065798542422980ca25f903db078c57822218182c37c3576df5 + languageName: node + linkType: hard + "buffer-crc32@npm:^1.0.0": version: 1.0.0 resolution: "buffer-crc32@npm:1.0.0" @@ -3895,6 +4062,13 @@ __metadata: languageName: node linkType: hard +"buffer-fill@npm:^1.0.0": + version: 1.0.0 + resolution: "buffer-fill@npm:1.0.0" + checksum: 10/c29b4723ddeab01e74b5d3b982a0c6828f2ded49cef049ddca3dac661c874ecdbcecb5dd8380cf0f4adbeb8cff90a7de724126750a1f1e5ebd4eb6c59a1315b1 + languageName: node + linkType: hard + "buffer-from@npm:^1.0.0": version: 1.1.2 resolution: "buffer-from@npm:1.1.2" @@ -3964,6 +4138,21 @@ __metadata: languageName: node linkType: hard +"cacheable-request@npm:^2.1.1": + version: 2.1.4 + resolution: "cacheable-request@npm:2.1.4" + dependencies: + clone-response: "npm:1.0.2" + get-stream: "npm:3.0.0" + http-cache-semantics: "npm:3.8.1" + keyv: "npm:3.0.0" + lowercase-keys: "npm:1.0.0" + normalize-url: "npm:2.0.1" + responselike: "npm:1.0.2" + checksum: 10/53ecb0c5eff4fa92546d83df3027fb2a1fba03632801971e32c643b380ac9b619bb2028fa679217beac952c3b4883451dc682b3dfb3ee65e230339e3e4fbc7d2 + languageName: node + linkType: hard + "call-bind@npm:^1.0.7": version: 1.0.7 resolution: "call-bind@npm:1.0.7" @@ -4148,6 +4337,9 @@ __metadata: "@testing-library/jest-dom": "npm:6.4.8" "@testing-library/react": "npm:16.0.0" "@testing-library/user-event": "npm:14.5.2" + "@types/decompress": "npm:^4" + "@types/download": "npm:8.0.5" + "@types/fs-extra": "npm:^11" "@types/jest": "npm:29.5.12" "@types/lodash.debounce": "npm:4.0.9" "@types/node": "npm:20.16.1" @@ -4167,8 +4359,12 @@ __metadata: "@wdio/spec-reporter": "npm:8.38.2" bhala: "npm:3.0.4" cross-env: "npm:7.0.3" + decompress: "npm:4.2.1" + del: "npm:7.1.0" + download: "npm:8.0.0" esm-path: "npm:1.0.1" execa: "npm:9.3.1" + fs-extra: "npm:11.2.0" husky: "npm:9.1.4" jest: "npm:29.7.0" jest-environment-jsdom: "npm:29.7.0" @@ -4178,6 +4374,8 @@ __metadata: lodash.throttle: "npm:4.1.1" make-dir-cli: "npm:4.0.0" numeral: "npm:2.0.6" + openpgp: "npm:5.11.2" + ora: "npm:8.1.0" ramda: "npm:0.30.1" react: "npm:18.3.1" react-dom: "npm:18.3.1" @@ -4202,6 +4400,15 @@ __metadata: languageName: node linkType: hard +"clean-stack@npm:^4.0.0": + version: 4.2.0 + resolution: "clean-stack@npm:4.2.0" + dependencies: + escape-string-regexp: "npm:5.0.0" + checksum: 10/373f656a31face5c615c0839213b9b542a0a48057abfb1df66900eab4dc2a5c6097628e4a0b5aa559cdfc4e66f8a14ea47be9681773165a44470ef5fb8ccc172 + languageName: node + linkType: hard + "cli-cursor@npm:^3.1.0": version: 3.1.0 resolution: "cli-cursor@npm:3.1.0" @@ -4220,7 +4427,7 @@ __metadata: languageName: node linkType: hard -"cli-spinners@npm:^2.5.0, cli-spinners@npm:^2.9.0": +"cli-spinners@npm:^2.5.0, cli-spinners@npm:^2.9.0, cli-spinners@npm:^2.9.2": version: 2.9.2 resolution: "cli-spinners@npm:2.9.2" checksum: 10/a0a863f442df35ed7294424f5491fa1756bd8d2e4ff0c8736531d886cec0ece4d85e8663b77a5afaf1d296e3cbbebff92e2e99f52bbea89b667cbe789b994794 @@ -4266,6 +4473,15 @@ __metadata: languageName: node linkType: hard +"clone-response@npm:1.0.2": + version: 1.0.2 + resolution: "clone-response@npm:1.0.2" + dependencies: + mimic-response: "npm:^1.0.0" + checksum: 10/2d0e61547fc66276e0903be9654ada422515f5a15741691352000d47e8c00c226061221074ce2c0064d12e975e84a8687cfd35d8b405750cb4e772f87b256eda + languageName: node + linkType: hard + "clone@npm:^1.0.2": version: 1.0.4 resolution: "clone@npm:1.0.4" @@ -4359,7 +4575,7 @@ __metadata: languageName: node linkType: hard -"combined-stream@npm:^1.0.8": +"combined-stream@npm:^1.0.6, combined-stream@npm:^1.0.8": version: 1.0.8 resolution: "combined-stream@npm:1.0.8" dependencies: @@ -4368,6 +4584,13 @@ __metadata: languageName: node linkType: hard +"commander@npm:^2.8.1": + version: 2.20.3 + resolution: "commander@npm:2.20.3" + checksum: 10/90c5b6898610cd075984c58c4f88418a4fb44af08c1b1415e9854c03171bec31b336b7f3e4cefe33de994b3f12b03c5e2d638da4316df83593b9e82554e7e95b + languageName: node + linkType: hard + "commander@npm:^9.3.0": version: 9.5.0 resolution: "commander@npm:9.5.0" @@ -4412,6 +4635,15 @@ __metadata: languageName: node linkType: hard +"content-disposition@npm:^0.5.2": + version: 0.5.4 + resolution: "content-disposition@npm:0.5.4" + dependencies: + safe-buffer: "npm:5.2.1" + checksum: 10/b7f4ce176e324f19324be69b05bf6f6e411160ac94bc523b782248129eb1ef3be006f6cff431aaea5e337fe5d176ce8830b8c2a1b721626ead8933f0cbe78720 + languageName: node + linkType: hard + "conventional-changelog-angular@npm:^7.0.0": version: 7.0.0 resolution: "conventional-changelog-angular@npm:7.0.0" @@ -4716,6 +4948,22 @@ __metadata: languageName: node linkType: hard +"decode-uri-component@npm:^0.2.0": + version: 0.2.2 + resolution: "decode-uri-component@npm:0.2.2" + checksum: 10/17a0e5fa400bf9ea84432226e252aa7b5e72793e16bf80b907c99b46a799aeacc139ec20ea57121e50c7bd875a1a4365928f884e92abf02e21a5a13790a0f33e + languageName: node + linkType: hard + +"decompress-response@npm:^3.3.0": + version: 3.3.0 + resolution: "decompress-response@npm:3.3.0" + dependencies: + mimic-response: "npm:^1.0.0" + checksum: 10/952552ac3bd7de2fc18015086b09468645c9638d98a551305e485230ada278c039c91116e946d07894b39ee53c0f0d5b6473f25a224029344354513b412d7380 + languageName: node + linkType: hard + "decompress-response@npm:^6.0.0": version: 6.0.0 resolution: "decompress-response@npm:6.0.0" @@ -4725,6 +4973,69 @@ __metadata: languageName: node linkType: hard +"decompress-tar@npm:^4.0.0, decompress-tar@npm:^4.1.0, decompress-tar@npm:^4.1.1": + version: 4.1.1 + resolution: "decompress-tar@npm:4.1.1" + dependencies: + file-type: "npm:^5.2.0" + is-stream: "npm:^1.1.0" + tar-stream: "npm:^1.5.2" + checksum: 10/820c645dfa9a0722c4c817363431d07687374338e2af337cc20c9a44b285fdd89296837a1d1281ee9fa85c6f03d7c0f50670aec9abbd4eb198a714bb179ea0bd + languageName: node + linkType: hard + +"decompress-tarbz2@npm:^4.0.0": + version: 4.1.1 + resolution: "decompress-tarbz2@npm:4.1.1" + dependencies: + decompress-tar: "npm:^4.1.0" + file-type: "npm:^6.1.0" + is-stream: "npm:^1.1.0" + seek-bzip: "npm:^1.0.5" + unbzip2-stream: "npm:^1.0.9" + checksum: 10/519c81337730159a1f2d7072a6ee8523ffd76df48d34f14c27cb0a27f89b4e2acf75dad2f761838e5bc63230cea1ac154b092ecb7504be4e93f7d0e32ddd6aff + languageName: node + linkType: hard + +"decompress-targz@npm:^4.0.0": + version: 4.1.1 + resolution: "decompress-targz@npm:4.1.1" + dependencies: + decompress-tar: "npm:^4.1.1" + file-type: "npm:^5.2.0" + is-stream: "npm:^1.1.0" + checksum: 10/22738f58eb034568dc50d370c03b346c428bfe8292fe56165847376b5af17d3c028fefca82db642d79cb094df4c0a599d40a8f294b02aad1d3ddec82f3fd45d4 + languageName: node + linkType: hard + +"decompress-unzip@npm:^4.0.1": + version: 4.0.1 + resolution: "decompress-unzip@npm:4.0.1" + dependencies: + file-type: "npm:^3.8.0" + get-stream: "npm:^2.2.0" + pify: "npm:^2.3.0" + yauzl: "npm:^2.4.2" + checksum: 10/ba9f3204ab2415bedb18d796244928a18148ef40dbb15174d0d01e5991b39536b03d02800a8a389515a1523f8fb13efc7cd44697df758cd06c674879caefd62b + languageName: node + linkType: hard + +"decompress@npm:4.2.1, decompress@npm:^4.2.1": + version: 4.2.1 + resolution: "decompress@npm:4.2.1" + dependencies: + decompress-tar: "npm:^4.0.0" + decompress-tarbz2: "npm:^4.0.0" + decompress-targz: "npm:^4.0.0" + decompress-unzip: "npm:^4.0.1" + graceful-fs: "npm:^4.1.10" + make-dir: "npm:^1.0.0" + pify: "npm:^2.3.0" + strip-dirs: "npm:^2.0.0" + checksum: 10/8247a31c6db7178413715fdfb35a482f019c81dfcd6e8e623d9f0382c9889ce797ce0144de016b256ed03298907a620ce81387cca0e69067a933470081436cb8 + languageName: node + linkType: hard + "dedent@npm:^1.0.0": version: 1.5.3 resolution: "dedent@npm:1.5.3" @@ -4789,6 +5100,22 @@ __metadata: languageName: node linkType: hard +"del@npm:7.1.0": + version: 7.1.0 + resolution: "del@npm:7.1.0" + dependencies: + globby: "npm:^13.1.2" + graceful-fs: "npm:^4.2.10" + is-glob: "npm:^4.0.3" + is-path-cwd: "npm:^3.0.0" + is-path-inside: "npm:^4.0.0" + p-map: "npm:^5.5.0" + rimraf: "npm:^3.0.2" + slash: "npm:^4.0.0" + checksum: 10/93527e78e95125809ff20a112814b00648ed64af204be1a565862698060c9ec8f5c5fe1a4866725acfde9b0da6423f4b7a7642c1d38cd4b05cbeb643a7b089e3 + languageName: node + linkType: hard + "delayed-stream@npm:~1.0.0": version: 1.0.0 resolution: "delayed-stream@npm:1.0.0" @@ -4859,6 +5186,15 @@ __metadata: languageName: node linkType: hard +"dir-glob@npm:^3.0.1": + version: 3.0.1 + resolution: "dir-glob@npm:3.0.1" + dependencies: + path-type: "npm:^4.0.0" + checksum: 10/fa05e18324510d7283f55862f3161c6759a3f2f8dbce491a2fc14c8324c498286c54282c1f0e933cb930da8419b30679389499b919122952a4f8592362ef4615 + languageName: node + linkType: hard + "dom-accessibility-api@npm:^0.5.9": version: 0.5.16 resolution: "dom-accessibility-api@npm:0.5.16" @@ -4908,6 +5244,32 @@ __metadata: languageName: node linkType: hard +"download@npm:8.0.0": + version: 8.0.0 + resolution: "download@npm:8.0.0" + dependencies: + archive-type: "npm:^4.0.0" + content-disposition: "npm:^0.5.2" + decompress: "npm:^4.2.1" + ext-name: "npm:^5.0.0" + file-type: "npm:^11.1.0" + filenamify: "npm:^3.0.0" + get-stream: "npm:^4.1.0" + got: "npm:^8.3.1" + make-dir: "npm:^2.1.0" + p-event: "npm:^2.1.0" + pify: "npm:^4.0.1" + checksum: 10/8a26b21eee8d23352265729dba8eea9f18cba0ebfa3e064041afffeefdfe508fc31e54a08bd0606ff8b0d548466bdb2e2e32b571a8f95227efa5b7c09c261a2f + languageName: node + linkType: hard + +"duplexer3@npm:^0.1.4": + version: 0.1.5 + resolution: "duplexer3@npm:0.1.5" + checksum: 10/e677cb4c48f031ca728601d6a20bf6aed4c629d69ef9643cb89c67583d673c4ec9317cc6427501f38bd8c368d3a18f173987cc02bd99d8cf8fe3d94259a22a20 + languageName: node + linkType: hard + "eastasianwidth@npm:^0.2.0": version: 0.2.0 resolution: "eastasianwidth@npm:0.2.0" @@ -5010,7 +5372,7 @@ __metadata: languageName: node linkType: hard -"end-of-stream@npm:^1.1.0": +"end-of-stream@npm:^1.0.0, end-of-stream@npm:^1.1.0": version: 1.4.4 resolution: "end-of-stream@npm:1.4.4" dependencies: @@ -5159,7 +5521,14 @@ __metadata: languageName: node linkType: hard -"escape-string-regexp@npm:^1.0.5": +"escape-string-regexp@npm:5.0.0, escape-string-regexp@npm:^5.0.0": + version: 5.0.0 + resolution: "escape-string-regexp@npm:5.0.0" + checksum: 10/20daabe197f3cb198ec28546deebcf24b3dbb1a5a269184381b3116d12f0532e06007f4bc8da25669d6a7f8efb68db0758df4cd981f57bc5b57f521a3e12c59e + languageName: node + linkType: hard + +"escape-string-regexp@npm:^1.0.2, escape-string-regexp@npm:^1.0.5": version: 1.0.5 resolution: "escape-string-regexp@npm:1.0.5" checksum: 10/6092fda75c63b110c706b6a9bfde8a612ad595b628f0bd2147eea1d3406723020810e591effc7db1da91d80a71a737a313567c5abb3813e8d9c71f4aa595b410 @@ -5180,13 +5549,6 @@ __metadata: languageName: node linkType: hard -"escape-string-regexp@npm:^5.0.0": - version: 5.0.0 - resolution: "escape-string-regexp@npm:5.0.0" - checksum: 10/20daabe197f3cb198ec28546deebcf24b3dbb1a5a269184381b3116d12f0532e06007f4bc8da25669d6a7f8efb68db0758df4cd981f57bc5b57f521a3e12c59e - languageName: node - linkType: hard - "escodegen@npm:^2.0.0, escodegen@npm:^2.1.0": version: 2.1.0 resolution: "escodegen@npm:2.1.0" @@ -5360,6 +5722,25 @@ __metadata: languageName: node linkType: hard +"ext-list@npm:^2.0.0": + version: 2.2.2 + resolution: "ext-list@npm:2.2.2" + dependencies: + mime-db: "npm:^1.28.0" + checksum: 10/fe69fedbef044e14d4ce9e84c6afceb696ba71500c15b8d0ce0a1e280237e17c95031b3d62d5e597652fea0065b9bf957346b3900d989dff59128222231ac859 + languageName: node + linkType: hard + +"ext-name@npm:^5.0.0": + version: 5.0.0 + resolution: "ext-name@npm:5.0.0" + dependencies: + ext-list: "npm:^2.0.0" + sort-keys-length: "npm:^1.0.0" + checksum: 10/f598269bd5de4295540ea7d6f8f6a01d82a7508f148b7700a05628ef6121648d26e6e5e942049e953b3051863df6b54bd8fe951e7877f185e34ace5d44370b33 + languageName: node + linkType: hard + "external-editor@npm:^3.1.0": version: 3.1.0 resolution: "external-editor@npm:3.1.0" @@ -5409,6 +5790,19 @@ __metadata: languageName: node linkType: hard +"fast-glob@npm:^3.3.0": + version: 3.3.2 + resolution: "fast-glob@npm:3.3.2" + dependencies: + "@nodelib/fs.stat": "npm:^2.0.2" + "@nodelib/fs.walk": "npm:^1.2.3" + glob-parent: "npm:^5.1.2" + merge2: "npm:^1.3.0" + micromatch: "npm:^4.0.4" + checksum: 10/222512e9315a0efca1276af9adb2127f02105d7288fa746145bf45e2716383fb79eb983c89601a72a399a56b7c18d38ce70457c5466218c5f13fad957cee16df + languageName: node + linkType: hard + "fast-json-stable-stringify@npm:^2.1.0": version: 2.1.0 resolution: "fast-json-stable-stringify@npm:2.1.0" @@ -5434,6 +5828,15 @@ __metadata: languageName: node linkType: hard +"fastq@npm:^1.6.0": + version: 1.17.1 + resolution: "fastq@npm:1.17.1" + dependencies: + reusify: "npm:^1.0.4" + checksum: 10/a443180068b527dd7b3a63dc7f2a47ceca2f3e97b9c00a1efe5538757e6cc4056a3526df94308075d7727561baf09ebaa5b67da8dcbddb913a021c5ae69d1f69 + languageName: node + linkType: hard + "fb-watchman@npm:^2.0.0": version: 2.0.2 resolution: "fb-watchman@npm:2.0.2" @@ -5481,6 +5884,41 @@ __metadata: languageName: node linkType: hard +"file-type@npm:^11.1.0": + version: 11.1.0 + resolution: "file-type@npm:11.1.0" + checksum: 10/d11c271f380b68c7dfd97e970d1a14e1d26d7c2e63f94d9a7dc48493b18b478a61bbd467fdc2438ba783770505aeb107fccc40ac1b2280c4b90c8c43eec566fb + languageName: node + linkType: hard + +"file-type@npm:^3.8.0": + version: 3.9.0 + resolution: "file-type@npm:3.9.0" + checksum: 10/1c8bc99bbb9cfcf13d3489e0c0250188dde622658b5a990f2ba09e6c784f183556b37b7de22104b4b0fd87f478ce12f8dc199b988616ce7cdcb41248dc0a79f9 + languageName: node + linkType: hard + +"file-type@npm:^4.2.0": + version: 4.4.0 + resolution: "file-type@npm:4.4.0" + checksum: 10/92b417a5c736ee972ba34e6a67413a6e7a3b652a624861beb5c6ace748eb684904b59712a250ac79f807d9928ba5980188bff1d8e853a72e43fb27ad340e19b2 + languageName: node + linkType: hard + +"file-type@npm:^5.2.0": + version: 5.2.0 + resolution: "file-type@npm:5.2.0" + checksum: 10/73b44eaba7a3e0684d35f24bb3f98ea8a943bf897e103768371b747b0714618301411e66ceff717c866db780af6f5bb1a3da15b744c2e04fa83d605a0682b72b + languageName: node + linkType: hard + +"file-type@npm:^6.1.0": + version: 6.2.0 + resolution: "file-type@npm:6.2.0" + checksum: 10/c7214c3cf6c72a4ed02b473a792841b4bf626a8e95bb010bd8679016b86e5bf52117264c3133735a8424bfde378c3a39b90e1f4902f5f294c41de4e81ec85fdc + languageName: node + linkType: hard + "filelist@npm:^1.0.4": version: 1.0.4 resolution: "filelist@npm:1.0.4" @@ -5490,6 +5928,24 @@ __metadata: languageName: node linkType: hard +"filename-reserved-regex@npm:^2.0.0": + version: 2.0.0 + resolution: "filename-reserved-regex@npm:2.0.0" + checksum: 10/9322b45726b86c45d0b4fe91be5c51e62b2e7e63db02c4a6ff3fd499bbc134d12fbf3c8b91979440ef45b3be834698ab9c3e66cb63b79fea4817e33da237d32a + languageName: node + linkType: hard + +"filenamify@npm:^3.0.0": + version: 3.0.0 + resolution: "filenamify@npm:3.0.0" + dependencies: + filename-reserved-regex: "npm:^2.0.0" + strip-outer: "npm:^1.0.0" + trim-repeated: "npm:^1.0.0" + checksum: 10/d419eaa1b8c331ab8616e1fffe33e4af135c60b5364320bbe015bc93ded89c6c301363f69593991de18a8f9dd278324c0a0d89fd554c30250306f4c16c956673 + languageName: node + linkType: hard + "fill-range@npm:^7.1.1": version: 7.1.1 resolution: "fill-range@npm:7.1.1" @@ -5566,6 +6022,17 @@ __metadata: languageName: node linkType: hard +"form-data@npm:^2.5.0": + version: 2.5.1 + resolution: "form-data@npm:2.5.1" + dependencies: + asynckit: "npm:^0.4.0" + combined-stream: "npm:^1.0.6" + mime-types: "npm:^2.1.12" + checksum: 10/2e2e5e927979ba3623f9b4c4bcc939275fae3f2dea9dafc8db3ca656a3d75476605de2c80f0e6f1487987398e056f0b4c738972d6e1edd83392d5686d0952eed + languageName: node + linkType: hard + "form-data@npm:^4.0.0": version: 4.0.0 resolution: "form-data@npm:4.0.0" @@ -5586,7 +6053,24 @@ __metadata: languageName: node linkType: hard -"fs-extra@npm:^11.2.0": +"from2@npm:^2.1.1": + version: 2.3.0 + resolution: "from2@npm:2.3.0" + dependencies: + inherits: "npm:^2.0.1" + readable-stream: "npm:^2.0.0" + checksum: 10/9164fbe5bbf9a48864bb8960296ccd1173c570ba1301a1c20de453b06eee39b52332f72279f2393948789afe938d8e951d50fea01064ba69fb5674b909f102b6 + languageName: node + linkType: hard + +"fs-constants@npm:^1.0.0": + version: 1.0.0 + resolution: "fs-constants@npm:1.0.0" + checksum: 10/18f5b718371816155849475ac36c7d0b24d39a11d91348cfcb308b4494824413e03572c403c86d3a260e049465518c4f0d5bd00f0371cdfcad6d4f30a85b350d + languageName: node + linkType: hard + +"fs-extra@npm:11.2.0, fs-extra@npm:^11.2.0": version: 11.2.0 resolution: "fs-extra@npm:11.2.0" dependencies: @@ -5723,6 +6207,32 @@ __metadata: languageName: node linkType: hard +"get-stream@npm:3.0.0, get-stream@npm:^3.0.0": + version: 3.0.0 + resolution: "get-stream@npm:3.0.0" + checksum: 10/de14fbb3b4548ace9ab6376be852eef9898c491282e29595bc908a1814a126d3961b11cd4b7be5220019fe3b2abb84568da7793ad308fc139925a217063fa159 + languageName: node + linkType: hard + +"get-stream@npm:^2.2.0": + version: 2.3.1 + resolution: "get-stream@npm:2.3.1" + dependencies: + object-assign: "npm:^4.0.1" + pinkie-promise: "npm:^2.0.0" + checksum: 10/712738e6a39b06da774aea5d35efa16a8f067a0d93b1b564e8d0e733fafddcf021e03098895735bc45d6594d3094369d700daa0d33891f980595cf6495e33294 + languageName: node + linkType: hard + +"get-stream@npm:^4.1.0": + version: 4.1.0 + resolution: "get-stream@npm:4.1.0" + dependencies: + pump: "npm:^3.0.0" + checksum: 10/12673e8aebc79767d187b203e5bfabb8266304037815d3bcc63b6f8c67c6d4ad0d98d4d4528bcdc1cbea68f1dd91bcbd87827aa3cdcfa9c5fa4a4644716d72c2 + languageName: node + linkType: hard + "get-stream@npm:^5.1.0": version: 5.2.0 resolution: "get-stream@npm:5.2.0" @@ -5781,7 +6291,7 @@ __metadata: languageName: node linkType: hard -"glob-parent@npm:~5.1.2": +"glob-parent@npm:^5.1.2, glob-parent@npm:~5.1.2": version: 5.1.2 resolution: "glob-parent@npm:5.1.2" dependencies: @@ -5863,6 +6373,19 @@ __metadata: languageName: node linkType: hard +"globby@npm:^13.1.2": + version: 13.2.2 + resolution: "globby@npm:13.2.2" + dependencies: + dir-glob: "npm:^3.0.1" + fast-glob: "npm:^3.3.0" + ignore: "npm:^5.2.4" + merge2: "npm:^1.4.1" + slash: "npm:^4.0.0" + checksum: 10/4494a9d2162a7e4d327988b26be66d8eab87d7f59a83219e74b065e2c3ced23698f68fb10482bf9337133819281803fb886d6ae06afbb2affa743623eb0b1949 + languageName: node + linkType: hard + "globule@npm:^1.0.0": version: 1.3.4 resolution: "globule@npm:1.3.4" @@ -5911,7 +6434,32 @@ __metadata: languageName: node linkType: hard -"graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9": +"got@npm:^8.3.1": + version: 8.3.2 + resolution: "got@npm:8.3.2" + dependencies: + "@sindresorhus/is": "npm:^0.7.0" + cacheable-request: "npm:^2.1.1" + decompress-response: "npm:^3.3.0" + duplexer3: "npm:^0.1.4" + get-stream: "npm:^3.0.0" + into-stream: "npm:^3.1.0" + is-retry-allowed: "npm:^1.1.0" + isurl: "npm:^1.0.0-alpha5" + lowercase-keys: "npm:^1.0.0" + mimic-response: "npm:^1.0.0" + p-cancelable: "npm:^0.4.0" + p-timeout: "npm:^2.0.1" + pify: "npm:^3.0.0" + safe-buffer: "npm:^5.1.1" + timed-out: "npm:^4.0.1" + url-parse-lax: "npm:^3.0.0" + url-to-options: "npm:^1.0.1" + checksum: 10/8636edd9bf5d2fcd04dabadf964bc637f00d0e51a1f369a89c4c0158c1d100ddb6816e9edbb8fa38efb9810bae38669948206b6cc22c3574fd821946e4d69821 + languageName: node + linkType: hard + +"graceful-fs@npm:^4.1.10, graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.10, graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9": version: 4.2.11 resolution: "graceful-fs@npm:4.2.11" checksum: 10/bf152d0ed1dc159239db1ba1f74fdbc40cb02f626770dcd5815c427ce0688c2635a06ed69af364396da4636d0408fcf7d4afdf7881724c3307e46aff30ca49e2 @@ -5955,6 +6503,13 @@ __metadata: languageName: node linkType: hard +"has-symbol-support-x@npm:^1.4.1": + version: 1.4.2 + resolution: "has-symbol-support-x@npm:1.4.2" + checksum: 10/c6ea5f3a8114e70f5b1ee260c2140ebc2146253aa955d35100d5525a8e841680f5fbbaaaf03f45a3c28082f7037860e6f240af9e9f891a66f20e2115222fbba6 + languageName: node + linkType: hard + "has-symbols@npm:^1.0.3": version: 1.0.3 resolution: "has-symbols@npm:1.0.3" @@ -5962,6 +6517,15 @@ __metadata: languageName: node linkType: hard +"has-to-string-tag-x@npm:^1.2.0": + version: 1.4.1 + resolution: "has-to-string-tag-x@npm:1.4.1" + dependencies: + has-symbol-support-x: "npm:^1.4.1" + checksum: 10/9ef3fe5e79a7265aaff14f117417a67f46edfcb7c93af8a897613941a669009062cf8eae15496e531c688227dd46524e6b51c5c2f88ed578276a7f9b4242781e + languageName: node + linkType: hard + "hasown@npm:^2.0.0, hasown@npm:^2.0.2": version: 2.0.2 resolution: "hasown@npm:2.0.2" @@ -6014,6 +6578,13 @@ __metadata: languageName: node linkType: hard +"http-cache-semantics@npm:3.8.1": + version: 3.8.1 + resolution: "http-cache-semantics@npm:3.8.1" + checksum: 10/88821cd3082a0aaced65d2aa8d1670672aaf27b0b4e6dbf6acca9ac11f6b58dd0f9628934baa9ea98191a60d6e9f60605b83c4859774ae066de0116c63be404c + languageName: node + linkType: hard + "http-cache-semantics@npm:^4.1.1": version: 4.1.1 resolution: "http-cache-semantics@npm:4.1.1" @@ -6127,6 +6698,13 @@ __metadata: languageName: node linkType: hard +"ignore@npm:^5.2.4": + version: 5.3.2 + resolution: "ignore@npm:5.3.2" + checksum: 10/cceb6a457000f8f6a50e1196429750d782afce5680dd878aa4221bd79972d68b3a55b4b1458fc682be978f4d3c6a249046aa0880637367216444ab7b014cfc98 + languageName: node + linkType: hard + "immediate@npm:~3.0.5": version: 3.0.6 resolution: "immediate@npm:3.0.6" @@ -6177,6 +6755,13 @@ __metadata: languageName: node linkType: hard +"indent-string@npm:^5.0.0": + version: 5.0.0 + resolution: "indent-string@npm:5.0.0" + checksum: 10/e466c27b6373440e6d84fbc19e750219ce25865cb82d578e41a6053d727e5520dc5725217d6eb1cc76005a1bb1696a0f106d84ce7ebda3033b963a38583fb3b3 + languageName: node + linkType: hard + "inflight@npm:^1.0.4": version: 1.0.6 resolution: "inflight@npm:1.0.6" @@ -6187,7 +6772,7 @@ __metadata: languageName: node linkType: hard -"inherits@npm:2, inherits@npm:^2.0.3, inherits@npm:^2.0.4, inherits@npm:~2.0.3": +"inherits@npm:2, inherits@npm:^2.0.1, inherits@npm:^2.0.3, inherits@npm:^2.0.4, inherits@npm:~2.0.3": version: 2.0.4 resolution: "inherits@npm:2.0.4" checksum: 10/cd45e923bee15186c07fa4c89db0aace24824c482fb887b528304694b2aa6ff8a898da8657046a5dcf3e46cd6db6c61629551f9215f208d7c3f157cf9b290521 @@ -6231,6 +6816,16 @@ __metadata: languageName: node linkType: hard +"into-stream@npm:^3.1.0": + version: 3.1.0 + resolution: "into-stream@npm:3.1.0" + dependencies: + from2: "npm:^2.1.1" + p-is-promise: "npm:^1.1.0" + checksum: 10/50679f91eed37ee87e7e06d8671e01f0e6707e7eb1209d4a752ea8de63e3e92b876e6352f241c084c3a5959f5b5d2194914d26f88e269dcde270a13ab8b476b6 + languageName: node + linkType: hard + "ip-address@npm:^9.0.5": version: 9.0.5 resolution: "ip-address@npm:9.0.5" @@ -6303,7 +6898,7 @@ __metadata: languageName: node linkType: hard -"is-glob@npm:^4.0.1, is-glob@npm:~4.0.1": +"is-glob@npm:^4.0.1, is-glob@npm:^4.0.3, is-glob@npm:~4.0.1": version: 4.0.3 resolution: "is-glob@npm:4.0.3" dependencies: @@ -6319,24 +6914,66 @@ __metadata: languageName: node linkType: hard -"is-lambda@npm:^1.0.1": - version: 1.0.1 - resolution: "is-lambda@npm:1.0.1" - checksum: 10/93a32f01940220532e5948538699ad610d5924ac86093fcee83022252b363eb0cc99ba53ab084a04e4fb62bf7b5731f55496257a4c38adf87af9c4d352c71c35 +"is-interactive@npm:^2.0.0": + version: 2.0.0 + resolution: "is-interactive@npm:2.0.0" + checksum: 10/e8d52ad490bed7ae665032c7675ec07732bbfe25808b0efbc4d5a76b1a1f01c165f332775c63e25e9a03d319ebb6b24f571a9e902669fc1e40b0a60b5be6e26c + languageName: node + linkType: hard + +"is-lambda@npm:^1.0.1": + version: 1.0.1 + resolution: "is-lambda@npm:1.0.1" + checksum: 10/93a32f01940220532e5948538699ad610d5924ac86093fcee83022252b363eb0cc99ba53ab084a04e4fb62bf7b5731f55496257a4c38adf87af9c4d352c71c35 + languageName: node + linkType: hard + +"is-natural-number@npm:^4.0.1": + version: 4.0.1 + resolution: "is-natural-number@npm:4.0.1" + checksum: 10/3e5e3d52e0dfa4fea923b5d2b8a5cdbd9bf110c4598d30304b98528b02f40c9058a2abf1bae10bcbaf2bac18ace41cff7bc9673aff339f8c8297fae74ae0e75d + languageName: node + linkType: hard + +"is-number@npm:^7.0.0": + version: 7.0.0 + resolution: "is-number@npm:7.0.0" + checksum: 10/6a6c3383f68afa1e05b286af866017c78f1226d43ac8cb064e115ff9ed85eb33f5c4f7216c96a71e4dfea289ef52c5da3aef5bbfade8ffe47a0465d70c0c8e86 + languageName: node + linkType: hard + +"is-obj@npm:^2.0.0": + version: 2.0.0 + resolution: "is-obj@npm:2.0.0" + checksum: 10/c9916ac8f4621962a42f5e80e7ffdb1d79a3fab7456ceaeea394cd9e0858d04f985a9ace45be44433bf605673c8be8810540fe4cc7f4266fc7526ced95af5a08 + languageName: node + linkType: hard + +"is-object@npm:^1.0.1": + version: 1.0.2 + resolution: "is-object@npm:1.0.2" + checksum: 10/db53971751c50277f0ed31d065d93038d23cb9785090ab5c8070a903cf5bab16cdb18f05b8855599ad87ec19eb4c85afa05980bcda77dd4a8482120b6348c73c + languageName: node + linkType: hard + +"is-path-cwd@npm:^3.0.0": + version: 3.0.0 + resolution: "is-path-cwd@npm:3.0.0" + checksum: 10/bc34d13b6a03dfca4a3ab6a8a5ba78ae4b24f4f1db4b2b031d2760c60d0913bd16a4b980dcb4e590adfc906649d5f5132684079a3972bd219da49deebb9adea8 languageName: node linkType: hard -"is-number@npm:^7.0.0": - version: 7.0.0 - resolution: "is-number@npm:7.0.0" - checksum: 10/6a6c3383f68afa1e05b286af866017c78f1226d43ac8cb064e115ff9ed85eb33f5c4f7216c96a71e4dfea289ef52c5da3aef5bbfade8ffe47a0465d70c0c8e86 +"is-path-inside@npm:^4.0.0": + version: 4.0.0 + resolution: "is-path-inside@npm:4.0.0" + checksum: 10/8810fa11c58e6360b82c3e0d6cd7d9c7d0392d3ac9eb10f980b81f9839f40ac6d1d6d6f05d069db0d227759801228f0b072e1b6c343e4469b065ab5fe0b68fe5 languageName: node linkType: hard -"is-obj@npm:^2.0.0": - version: 2.0.0 - resolution: "is-obj@npm:2.0.0" - checksum: 10/c9916ac8f4621962a42f5e80e7ffdb1d79a3fab7456ceaeea394cd9e0858d04f985a9ace45be44433bf605673c8be8810540fe4cc7f4266fc7526ced95af5a08 +"is-plain-obj@npm:^1.0.0": + version: 1.1.0 + resolution: "is-plain-obj@npm:1.1.0" + checksum: 10/0ee04807797aad50859652a7467481816cbb57e5cc97d813a7dcd8915da8195dc68c436010bf39d195226cde6a2d352f4b815f16f26b7bf486a5754290629931 languageName: node linkType: hard @@ -6361,6 +6998,20 @@ __metadata: languageName: node linkType: hard +"is-retry-allowed@npm:^1.1.0": + version: 1.2.0 + resolution: "is-retry-allowed@npm:1.2.0" + checksum: 10/50d700a89ae31926b1c91b3eb0104dbceeac8790d8b80d02f5c76d9a75c2056f1bb24b5268a8a018dead606bddf116b2262e5ac07401eb8b8783b266ed22558d + languageName: node + linkType: hard + +"is-stream@npm:^1.1.0": + version: 1.1.0 + resolution: "is-stream@npm:1.1.0" + checksum: 10/351aa77c543323c4e111204482808cfad68d2e940515949e31ccd0b010fc13d5fba4b9c230e4887fd24284713040f43e542332fbf172f6b9944b7d62e389c0ec + languageName: node + linkType: hard + "is-stream@npm:^2.0.0, is-stream@npm:^2.0.1": version: 2.0.1 resolution: "is-stream@npm:2.0.1" @@ -6398,7 +7049,7 @@ __metadata: languageName: node linkType: hard -"is-unicode-supported@npm:^1.2.0": +"is-unicode-supported@npm:^1.2.0, is-unicode-supported@npm:^1.3.0": version: 1.3.0 resolution: "is-unicode-supported@npm:1.3.0" checksum: 10/20a1fc161afafaf49243551a5ac33b6c4cf0bbcce369fcd8f2951fbdd000c30698ce320de3ee6830497310a8f41880f8066d440aa3eb0a853e2aa4836dd89abc @@ -6498,6 +7149,16 @@ __metadata: languageName: node linkType: hard +"isurl@npm:^1.0.0-alpha5": + version: 1.0.0 + resolution: "isurl@npm:1.0.0" + dependencies: + has-to-string-tag-x: "npm:^1.2.0" + is-object: "npm:^1.0.1" + checksum: 10/28a96e019269d57015fa5869f19dda5a3ed1f7b21e3e0c4ff695419bd0541547db352aa32ee4a3659e811a177b0e37a5bc1a036731e71939dd16b59808ab92bd + languageName: node + linkType: hard + "jackspeak@npm:^3.1.2": version: 3.4.3 resolution: "jackspeak@npm:3.4.3" @@ -7079,6 +7740,13 @@ __metadata: languageName: node linkType: hard +"json-buffer@npm:3.0.0": + version: 3.0.0 + resolution: "json-buffer@npm:3.0.0" + checksum: 10/6e364585600598c42f1cc85d1305569aeb1a6a13e7c67960f17b403f087e2700104ec8e49fc681ab6d6278ee4d132ac033f2625c22a9777ed9b83b403b40f23e + languageName: node + linkType: hard + "json-buffer@npm:3.0.1": version: 3.0.1 resolution: "json-buffer@npm:3.0.1" @@ -7155,6 +7823,15 @@ __metadata: languageName: node linkType: hard +"keyv@npm:3.0.0": + version: 3.0.0 + resolution: "keyv@npm:3.0.0" + dependencies: + json-buffer: "npm:3.0.0" + checksum: 10/00e8ad7ced1c1236933aa463ef632c2e01510c58734b922c803fef72db4088f459429cc46229daec8a81e7f413ddea6828bfa8afbad68d74548ca0857c6cb7af + languageName: node + linkType: hard + "keyv@npm:^4.5.3": version: 4.5.4 resolution: "keyv@npm:4.5.4" @@ -7447,6 +8124,16 @@ __metadata: languageName: node linkType: hard +"log-symbols@npm:^6.0.0": + version: 6.0.0 + resolution: "log-symbols@npm:6.0.0" + dependencies: + chalk: "npm:^5.3.0" + is-unicode-supported: "npm:^1.3.0" + checksum: 10/510cdda36700cbcd87a2a691ea08d310a6c6b449084018f7f2ec4f732ca5e51b301ff1327aadd96f53c08318e616276c65f7fe22f2a16704fb0715d788bc3c33 + languageName: node + linkType: hard + "log-update@npm:^6.1.0": version: 6.1.0 resolution: "log-update@npm:6.1.0" @@ -7485,6 +8172,20 @@ __metadata: languageName: node linkType: hard +"lowercase-keys@npm:1.0.0": + version: 1.0.0 + resolution: "lowercase-keys@npm:1.0.0" + checksum: 10/12f836ba9cbd13c32818b31c895328d0b95618943a983928e3205c936c5968c0454f073cfef7bb79b0445246e5a2fd029be0922031e07c23770eb510752d8860 + languageName: node + linkType: hard + +"lowercase-keys@npm:^1.0.0": + version: 1.0.1 + resolution: "lowercase-keys@npm:1.0.1" + checksum: 10/12ba64572dc25ae9ee30d37a11f3a91aea046c1b6b905fdf8ac77e2f268f153ed36e60d39cb3bfa47a89f31d981dae9a8cc9915124a56fe51ff01ed6e8bb68fa + languageName: node + linkType: hard + "lowercase-keys@npm:^3.0.0": version: 3.0.0 resolution: "lowercase-keys@npm:3.0.0" @@ -7545,6 +8246,25 @@ __metadata: languageName: node linkType: hard +"make-dir@npm:^1.0.0": + version: 1.3.0 + resolution: "make-dir@npm:1.3.0" + dependencies: + pify: "npm:^3.0.0" + checksum: 10/c564f6e7bb5ace1c02ad56b3a5f5e07d074af0c0b693c55c7b2c2b148882827c8c2afc7b57e43338a9f90c125b58d604e8cf3e6990a48bf949dfea8c79668c0b + languageName: node + linkType: hard + +"make-dir@npm:^2.1.0": + version: 2.1.0 + resolution: "make-dir@npm:2.1.0" + dependencies: + pify: "npm:^4.0.1" + semver: "npm:^5.6.0" + checksum: 10/043548886bfaf1820323c6a2997e6d2fa51ccc2586ac14e6f14634f7458b4db2daf15f8c310e2a0abd3e0cddc64df1890d8fc7263033602c47bb12cbfcf86aab + languageName: node + linkType: hard + "make-dir@npm:^4.0.0": version: 4.0.0 resolution: "make-dir@npm:4.0.0" @@ -7618,6 +8338,13 @@ __metadata: languageName: node linkType: hard +"merge2@npm:^1.3.0, merge2@npm:^1.4.1": + version: 1.4.1 + resolution: "merge2@npm:1.4.1" + checksum: 10/7268db63ed5169466540b6fb947aec313200bcf6d40c5ab722c22e242f651994619bcd85601602972d3c85bd2cc45a358a4c61937e9f11a061919a1da569b0c2 + languageName: node + linkType: hard + "micromatch@npm:^4.0.4, micromatch@npm:~4.0.7": version: 4.0.7 resolution: "micromatch@npm:4.0.7" @@ -7635,6 +8362,13 @@ __metadata: languageName: node linkType: hard +"mime-db@npm:^1.28.0": + version: 1.53.0 + resolution: "mime-db@npm:1.53.0" + checksum: 10/82409c568a20254cc67a763a25e581d2213e1ef5d070a0af805239634f8a655f5d8a15138200f5f81c5b06fc6623d27f6168c612d447642d59e37eb7f20f7412 + languageName: node + linkType: hard + "mime-types@npm:^2.1.12": version: 2.1.35 resolution: "mime-types@npm:2.1.35" @@ -7665,6 +8399,13 @@ __metadata: languageName: node linkType: hard +"mimic-response@npm:^1.0.0": + version: 1.0.1 + resolution: "mimic-response@npm:1.0.1" + checksum: 10/034c78753b0e622bc03c983663b1cdf66d03861050e0c8606563d149bc2b02d63f62ce4d32be4ab50d0553ae0ffe647fc34d1f5281184c6e1e8cf4d85e8d9823 + languageName: node + linkType: hard + "mimic-response@npm:^3.1.0": version: 3.1.0 resolution: "mimic-response@npm:3.1.0" @@ -7686,6 +8427,13 @@ __metadata: languageName: node linkType: hard +"minimalistic-assert@npm:^1.0.0": + version: 1.0.1 + resolution: "minimalistic-assert@npm:1.0.1" + checksum: 10/cc7974a9268fbf130fb055aff76700d7e2d8be5f761fb5c60318d0ed010d839ab3661a533ad29a5d37653133385204c503bfac995aaa4236f4e847461ea32ba7 + languageName: node + linkType: hard + "minimatch@npm:^3.0.4, minimatch@npm:^3.0.5, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": version: 3.1.2 resolution: "minimatch@npm:3.1.2" @@ -8020,6 +8768,17 @@ __metadata: languageName: node linkType: hard +"normalize-url@npm:2.0.1": + version: 2.0.1 + resolution: "normalize-url@npm:2.0.1" + dependencies: + prepend-http: "npm:^2.0.0" + query-string: "npm:^5.0.1" + sort-keys: "npm:^2.0.0" + checksum: 10/30e337ee03fc7f360c7d2b966438657fabd2628925cc58bffc893982fe4d2c59b397ae664fa2c319cd83565af73eee88906e80bc5eec91bc32b601920e770d75 + languageName: node + linkType: hard + "normalize-url@npm:^8.0.0": version: 8.0.1 resolution: "normalize-url@npm:8.0.1" @@ -8059,7 +8818,7 @@ __metadata: languageName: node linkType: hard -"object-assign@npm:^4.1.1": +"object-assign@npm:^4.0.1, object-assign@npm:^4.1.0, object-assign@npm:^4.1.1": version: 4.1.1 resolution: "object-assign@npm:4.1.1" checksum: 10/fcc6e4ea8c7fe48abfbb552578b1c53e0d194086e2e6bbbf59e0a536381a292f39943c6e9628af05b5528aa5e3318bb30d6b2e53cadaf5b8fe9e12c4b69af23f @@ -8109,6 +8868,32 @@ __metadata: languageName: node linkType: hard +"openpgp@npm:5.11.2": + version: 5.11.2 + resolution: "openpgp@npm:5.11.2" + dependencies: + asn1.js: "npm:^5.0.0" + checksum: 10/75052f8b89aa946d2b927f2a679d57671b2da5bf3dab1a223b9ba54305635ce37a86cb2ea274d0dcd830511e3fe1bae16d85259e907f56ec31219c4367c311a8 + languageName: node + linkType: hard + +"ora@npm:8.1.0": + version: 8.1.0 + resolution: "ora@npm:8.1.0" + dependencies: + chalk: "npm:^5.3.0" + cli-cursor: "npm:^5.0.0" + cli-spinners: "npm:^2.9.2" + is-interactive: "npm:^2.0.0" + is-unicode-supported: "npm:^2.0.0" + log-symbols: "npm:^6.0.0" + stdin-discarder: "npm:^0.2.2" + string-width: "npm:^7.2.0" + strip-ansi: "npm:^7.1.0" + checksum: 10/2b394b79ccae4f0aa6d5ef5b4b511be41e5e2f09de00845f6506368b49e577e77e2c08ad5fbdd7de98a25ef8d216a714ac7cc13665408e52e17b80e1ada93d31 + languageName: node + linkType: hard + "ora@npm:^5.4.1": version: 5.4.1 resolution: "ora@npm:5.4.1" @@ -8133,6 +8918,13 @@ __metadata: languageName: node linkType: hard +"p-cancelable@npm:^0.4.0": + version: 0.4.1 + resolution: "p-cancelable@npm:0.4.1" + checksum: 10/d11144d72ee3a99f62fe595cb0e13b8585ea73c3807b4a9671744f1bf5d3ccddb049247a4ec3ceff05ca4adba9d0bb0f1862829daf20795bf528c86fa088509c + languageName: node + linkType: hard + "p-cancelable@npm:^3.0.0": version: 3.0.0 resolution: "p-cancelable@npm:3.0.0" @@ -8140,6 +8932,29 @@ __metadata: languageName: node linkType: hard +"p-event@npm:^2.1.0": + version: 2.3.1 + resolution: "p-event@npm:2.3.1" + dependencies: + p-timeout: "npm:^2.0.1" + checksum: 10/e3d5f245e55f9c5203bcfac5f78e3666d12fa16dce97b05855f1f0292ba3af61731ef58286de4bce1a92ddb5d6db6f4882c39ae47c2caae3499952a26d19a8df + languageName: node + linkType: hard + +"p-finally@npm:^1.0.0": + version: 1.0.0 + resolution: "p-finally@npm:1.0.0" + checksum: 10/93a654c53dc805dd5b5891bab16eb0ea46db8f66c4bfd99336ae929323b1af2b70a8b0654f8f1eae924b2b73d037031366d645f1fd18b3d30cbd15950cc4b1d4 + languageName: node + linkType: hard + +"p-is-promise@npm:^1.1.0": + version: 1.1.0 + resolution: "p-is-promise@npm:1.1.0" + checksum: 10/64d7c6cda18af2c91c04209e5856c54d1a9818662d2320b34153d446645f431307e04406969a1be00cad680288e86dcf97b9eb39edd5dc4d0b1bd714ee85e13b + languageName: node + linkType: hard + "p-limit@npm:^2.2.0": version: 2.3.0 resolution: "p-limit@npm:2.3.0" @@ -8203,6 +9018,24 @@ __metadata: languageName: node linkType: hard +"p-map@npm:^5.5.0": + version: 5.5.0 + resolution: "p-map@npm:5.5.0" + dependencies: + aggregate-error: "npm:^4.0.0" + checksum: 10/089a709d2525208a965b7907cc8e58af950542629b538198fc142c40e7f36b3b492dd6a46a1279515ccab58bb6f047e04593c0ab5ef4539d312adf7f761edf55 + languageName: node + linkType: hard + +"p-timeout@npm:^2.0.1": + version: 2.0.1 + resolution: "p-timeout@npm:2.0.1" + dependencies: + p-finally: "npm:^1.0.0" + checksum: 10/9205a661173f03adbeabda8e02826de876376b09c99768bdc33e5b25ae73230e3ac00e520acedbe3cf05fbd3352fb02efbd3811a9a021b148fb15eb07e7accac + languageName: node + linkType: hard + "p-try@npm:^2.0.0": version: 2.2.0 resolution: "p-try@npm:2.2.0" @@ -8359,6 +9192,13 @@ __metadata: languageName: node linkType: hard +"path-type@npm:^4.0.0": + version: 4.0.0 + resolution: "path-type@npm:4.0.0" + checksum: 10/5b1e2daa247062061325b8fdbfd1fb56dde0a448fb1455453276ea18c60685bdad23a445dc148cf87bc216be1573357509b7d4060494a6fd768c7efad833ee45 + languageName: node + linkType: hard + "pathe@npm:^1.1.1, pathe@npm:^1.1.2": version: 1.1.2 resolution: "pathe@npm:1.1.2" @@ -8396,6 +9236,43 @@ __metadata: languageName: node linkType: hard +"pify@npm:^2.3.0": + version: 2.3.0 + resolution: "pify@npm:2.3.0" + checksum: 10/9503aaeaf4577acc58642ad1d25c45c6d90288596238fb68f82811c08104c800e5a7870398e9f015d82b44ecbcbef3dc3d4251a1cbb582f6e5959fe09884b2ba + languageName: node + linkType: hard + +"pify@npm:^3.0.0": + version: 3.0.0 + resolution: "pify@npm:3.0.0" + checksum: 10/668c1dc8d9fc1b34b9ce3b16ba59deb39d4dc743527bf2ed908d2b914cb8ba40aa5ba6960b27c417c241531c5aafd0598feeac2d50cb15278cf9863fa6b02a77 + languageName: node + linkType: hard + +"pify@npm:^4.0.1": + version: 4.0.1 + resolution: "pify@npm:4.0.1" + checksum: 10/8b97cbf9dc6d4c1320cc238a2db0fc67547f9dc77011729ff353faf34f1936ea1a4d7f3c63b2f4980b253be77bcc72ea1e9e76ee3fd53cce2aafb6a8854d07ec + languageName: node + linkType: hard + +"pinkie-promise@npm:^2.0.0": + version: 2.0.1 + resolution: "pinkie-promise@npm:2.0.1" + dependencies: + pinkie: "npm:^2.0.0" + checksum: 10/b53a4a2e73bf56b6f421eef711e7bdcb693d6abb474d57c5c413b809f654ba5ee750c6a96dd7225052d4b96c4d053cdcb34b708a86fceed4663303abee52fcca + languageName: node + linkType: hard + +"pinkie@npm:^2.0.0": + version: 2.0.4 + resolution: "pinkie@npm:2.0.4" + checksum: 10/11d207257a044d1047c3755374d36d84dda883a44d030fe98216bf0ea97da05a5c9d64e82495387edeb9ee4f52c455bca97cdb97629932be65e6f54b29f5aec8 + languageName: node + linkType: hard + "pirates@npm:^4.0.4": version: 4.0.6 resolution: "pirates@npm:4.0.6" @@ -8441,6 +9318,13 @@ __metadata: languageName: node linkType: hard +"prepend-http@npm:^2.0.0": + version: 2.0.0 + resolution: "prepend-http@npm:2.0.0" + checksum: 10/7694a9525405447662c1ffd352fcb41b6410c705b739b6f4e3a3e21cf5fdede8377890088e8934436b8b17ba55365a615f153960f30877bf0d0392f9e93503ea + languageName: node + linkType: hard + "pretty-format@npm:^27.0.2": version: 27.5.1 resolution: "pretty-format@npm:27.5.1" @@ -8650,6 +9534,17 @@ __metadata: languageName: node linkType: hard +"query-string@npm:^5.0.1": + version: 5.1.1 + resolution: "query-string@npm:5.1.1" + dependencies: + decode-uri-component: "npm:^0.2.0" + object-assign: "npm:^4.1.0" + strict-uri-encode: "npm:^1.0.0" + checksum: 10/8834591ed02c324ac10397094c2ae84a3d3460477ef30acd5efe03b1afbf15102ccc0829ab78cc58ecb12f70afeb7a1f81e604487a9ad4859742bb14748e98cc + languageName: node + linkType: hard + "querystringify@npm:^2.1.1": version: 2.2.0 resolution: "querystringify@npm:2.2.0" @@ -8657,6 +9552,13 @@ __metadata: languageName: node linkType: hard +"queue-microtask@npm:^1.2.2": + version: 1.2.3 + resolution: "queue-microtask@npm:1.2.3" + checksum: 10/72900df0616e473e824202113c3df6abae59150dfb73ed13273503127235320e9c8ca4aaaaccfd58cf417c6ca92a6e68ee9a5c3182886ae949a768639b388a7b + languageName: node + linkType: hard + "queue-tick@npm:^1.0.1": version: 1.0.1 resolution: "queue-tick@npm:1.0.1" @@ -8804,7 +9706,7 @@ __metadata: languageName: node linkType: hard -"readable-stream@npm:^2.0.5, readable-stream@npm:~2.3.6": +"readable-stream@npm:^2.0.0, readable-stream@npm:^2.0.5, readable-stream@npm:^2.3.0, readable-stream@npm:^2.3.5, readable-stream@npm:~2.3.6": version: 2.3.8 resolution: "readable-stream@npm:2.3.8" dependencies: @@ -8980,6 +9882,15 @@ __metadata: languageName: node linkType: hard +"responselike@npm:1.0.2": + version: 1.0.2 + resolution: "responselike@npm:1.0.2" + dependencies: + lowercase-keys: "npm:^1.0.0" + checksum: 10/2e9e70f1dcca3da621a80ce71f2f9a9cad12c047145c6ece20df22f0743f051cf7c73505e109814915f23f9e34fb0d358e22827723ee3d56b623533cab8eafcd + languageName: node + linkType: hard + "responselike@npm:^3.0.0": version: 3.0.0 resolution: "responselike@npm:3.0.0" @@ -9025,6 +9936,13 @@ __metadata: languageName: node linkType: hard +"reusify@npm:^1.0.4": + version: 1.0.4 + resolution: "reusify@npm:1.0.4" + checksum: 10/14222c9e1d3f9ae01480c50d96057228a8524706db79cdeb5a2ce5bb7070dd9f409a6f84a02cbef8cdc80d39aef86f2dd03d155188a1300c599b05437dcd2ffb + languageName: node + linkType: hard + "rfdc@npm:^1.4.1": version: 1.4.1 resolution: "rfdc@npm:1.4.1" @@ -9039,6 +9957,17 @@ __metadata: languageName: node linkType: hard +"rimraf@npm:^3.0.2": + version: 3.0.2 + resolution: "rimraf@npm:3.0.2" + dependencies: + glob: "npm:^7.1.3" + bin: + rimraf: bin.js + checksum: 10/063ffaccaaaca2cfd0ef3beafb12d6a03dd7ff1260d752d62a6077b5dfff6ae81bea571f655bb6b589d366930ec1bdd285d40d560c0dae9b12f125e54eb743d5 + languageName: node + linkType: hard + "rollup@npm:^4.13.0": version: 4.21.0 resolution: "rollup@npm:4.21.0" @@ -9109,6 +10038,15 @@ __metadata: languageName: node linkType: hard +"run-parallel@npm:^1.1.9": + version: 1.2.0 + resolution: "run-parallel@npm:1.2.0" + dependencies: + queue-microtask: "npm:^1.2.2" + checksum: 10/cb4f97ad25a75ebc11a8ef4e33bb962f8af8516bb2001082ceabd8902e15b98f4b84b4f8a9b222e5d57fc3bd1379c483886ed4619367a7680dad65316993021d + languageName: node + linkType: hard + "rxjs@npm:^7.8.1": version: 7.8.1 resolution: "rxjs@npm:7.8.1" @@ -9125,7 +10063,7 @@ __metadata: languageName: node linkType: hard -"safe-buffer@npm:^5.1.0, safe-buffer@npm:~5.2.0": +"safe-buffer@npm:5.2.1, safe-buffer@npm:^5.1.0, safe-buffer@npm:^5.1.1, safe-buffer@npm:~5.2.0": version: 5.2.1 resolution: "safe-buffer@npm:5.2.1" checksum: 10/32872cd0ff68a3ddade7a7617b8f4c2ae8764d8b7d884c651b74457967a9e0e886267d3ecc781220629c44a865167b61c375d2da6c720c840ecd73f45d5d9451 @@ -9139,7 +10077,7 @@ __metadata: languageName: node linkType: hard -"safer-buffer@npm:>= 2.1.2 < 3, safer-buffer@npm:>= 2.1.2 < 3.0.0": +"safer-buffer@npm:>= 2.1.2 < 3, safer-buffer@npm:>= 2.1.2 < 3.0.0, safer-buffer@npm:^2.1.0": version: 2.1.2 resolution: "safer-buffer@npm:2.1.2" checksum: 10/7eaf7a0cf37cc27b42fb3ef6a9b1df6e93a1c6d98c6c6702b02fe262d5fcbd89db63320793b99b21cb5348097d0a53de81bd5f4e8b86e20cc9412e3f1cfb4e83 @@ -9164,6 +10102,27 @@ __metadata: languageName: node linkType: hard +"seek-bzip@npm:^1.0.5": + version: 1.0.6 + resolution: "seek-bzip@npm:1.0.6" + dependencies: + commander: "npm:^2.8.1" + bin: + seek-bunzip: bin/seek-bunzip + seek-table: bin/seek-bzip-table + checksum: 10/e47967b694ba51b87a4e7b388772f9c9f6826547972c4c0d2f72b6dd9a41825fe63e810ad56be0f1bcba71c90550b7cb3aee53c261b9aebc15af1cd04fae008f + languageName: node + linkType: hard + +"semver@npm:^5.6.0": + version: 5.7.2 + resolution: "semver@npm:5.7.2" + bin: + semver: bin/semver + checksum: 10/fca14418a174d4b4ef1fecb32c5941e3412d52a4d3d85165924ce3a47fbc7073372c26faf7484ceb4bbc2bde25880c6b97e492473dc7e9708fdfb1c6a02d546e + languageName: node + linkType: hard + "semver@npm:^6.3.0, semver@npm:^6.3.1": version: 6.3.1 resolution: "semver@npm:6.3.1" @@ -9285,6 +10244,13 @@ __metadata: languageName: node linkType: hard +"slash@npm:^4.0.0": + version: 4.0.0 + resolution: "slash@npm:4.0.0" + checksum: 10/da8e4af73712253acd21b7853b7e0dbba776b786e82b010a5bfc8b5051a1db38ed8aba8e1e8f400dd2c9f373be91eb1c42b66e91abb407ff42b10feece5e1d2d + languageName: node + linkType: hard + "slice-ansi@npm:^5.0.0": version: 5.0.0 resolution: "slice-ansi@npm:5.0.0" @@ -9333,6 +10299,33 @@ __metadata: languageName: node linkType: hard +"sort-keys-length@npm:^1.0.0": + version: 1.0.1 + resolution: "sort-keys-length@npm:1.0.1" + dependencies: + sort-keys: "npm:^1.0.0" + checksum: 10/f9acac5fb31580a9e3d43b419dc86a1b75e85b79036a084d95dd4d1062b621c9589906588ac31e370a0dd381be46d8dbe900efa306d087ca9c912d7a59b5a590 + languageName: node + linkType: hard + +"sort-keys@npm:^1.0.0": + version: 1.1.2 + resolution: "sort-keys@npm:1.1.2" + dependencies: + is-plain-obj: "npm:^1.0.0" + checksum: 10/0ac2ea2327d92252f07aa7b2f8c7023a1f6ce3306439a3e81638cce9905893c069521d168f530fb316d1a929bdb052b742969a378190afaef1bc64fa69e29576 + languageName: node + linkType: hard + +"sort-keys@npm:^2.0.0": + version: 2.0.0 + resolution: "sort-keys@npm:2.0.0" + dependencies: + is-plain-obj: "npm:^1.0.0" + checksum: 10/255f9fb393ef60a3db508e0cc5b18ef401127dbb2376b205ae27d168e245fc0d6b35267dde98fab6410dde684c9321f7fc8bf71f2b051761973231617753380d + languageName: node + linkType: hard + "source-map-js@npm:^1.2.0": version: 1.2.0 resolution: "source-map-js@npm:1.2.0" @@ -9437,6 +10430,13 @@ __metadata: languageName: node linkType: hard +"stdin-discarder@npm:^0.2.2": + version: 0.2.2 + resolution: "stdin-discarder@npm:0.2.2" + checksum: 10/642ffd05bd5b100819d6b24a613d83c6e3857c6de74eb02fc51506fa61dc1b0034665163831873868157c4538d71e31762bcf319be86cea04c3aba5336470478 + languageName: node + linkType: hard + "stream-buffers@npm:^3.0.2": version: 3.0.3 resolution: "stream-buffers@npm:3.0.3" @@ -9459,6 +10459,13 @@ __metadata: languageName: node linkType: hard +"strict-uri-encode@npm:^1.0.0": + version: 1.1.0 + resolution: "strict-uri-encode@npm:1.1.0" + checksum: 10/9466d371f7b36768d43f7803f26137657559e4c8b0161fb9e320efb8edba3ae22f8e99d4b0d91da023b05a13f62ec5412c3f4f764b5788fac11d1fea93720bb3 + languageName: node + linkType: hard + "string-argv@npm:~0.3.2": version: 0.3.2 resolution: "string-argv@npm:0.3.2" @@ -9498,7 +10505,7 @@ __metadata: languageName: node linkType: hard -"string-width@npm:^7.0.0": +"string-width@npm:^7.0.0, string-width@npm:^7.2.0": version: 7.2.0 resolution: "string-width@npm:7.2.0" dependencies: @@ -9552,6 +10559,15 @@ __metadata: languageName: node linkType: hard +"strip-dirs@npm:^2.0.0": + version: 2.1.0 + resolution: "strip-dirs@npm:2.1.0" + dependencies: + is-natural-number: "npm:^4.0.1" + checksum: 10/7284fc61cf667e403c54ea515c421094ae641a382a8c8b6019f06658e828556c8e4bb439d5797f7d42247a5342eb6feef200c88ad0582e69b3261e1ec0dbc3a6 + languageName: node + linkType: hard + "strip-final-newline@npm:^2.0.0": version: 2.0.0 resolution: "strip-final-newline@npm:2.0.0" @@ -9589,6 +10605,15 @@ __metadata: languageName: node linkType: hard +"strip-outer@npm:^1.0.0": + version: 1.0.1 + resolution: "strip-outer@npm:1.0.1" + dependencies: + escape-string-regexp: "npm:^1.0.2" + checksum: 10/f8d65d33ca2b49aabc66bb41d689dda7b8b9959d320e3a40a2ef4d7079ff2f67ffb72db43f179f48dbf9495c2e33742863feab7a584d180fa62505439162c191 + languageName: node + linkType: hard + "strnum@npm:^1.0.5": version: 1.0.5 resolution: "strnum@npm:1.0.5" @@ -9699,6 +10724,21 @@ __metadata: languageName: node linkType: hard +"tar-stream@npm:^1.5.2": + version: 1.6.2 + resolution: "tar-stream@npm:1.6.2" + dependencies: + bl: "npm:^1.0.0" + buffer-alloc: "npm:^1.2.0" + end-of-stream: "npm:^1.0.0" + fs-constants: "npm:^1.0.0" + readable-stream: "npm:^2.3.0" + to-buffer: "npm:^1.1.1" + xtend: "npm:^4.0.0" + checksum: 10/ac9b850bd40e6d4b251abcf92613bafd9fc9e592c220c781ebcdbb0ba76da22a245d9ea3ea638ad7168910e7e1ae5079333866cd679d2f1ffadb99c403f99d7f + languageName: node + linkType: hard + "tar-stream@npm:^3.0.0, tar-stream@npm:^3.1.5": version: 3.1.7 resolution: "tar-stream@npm:3.1.7" @@ -9758,6 +10798,13 @@ __metadata: languageName: node linkType: hard +"timed-out@npm:^4.0.1": + version: 4.0.1 + resolution: "timed-out@npm:4.0.1" + checksum: 10/d52648e5fc0ebb0cae1633737a1db1b7cb464d5d43d754bd120ddebd8067a1b8f42146c250d8cfb9952183b7b0f341a99fc71b59c52d659218afae293165004f + languageName: node + linkType: hard + "tinyrainbow@npm:^1.2.0": version: 1.2.0 resolution: "tinyrainbow@npm:1.2.0" @@ -9781,6 +10828,13 @@ __metadata: languageName: node linkType: hard +"to-buffer@npm:^1.1.1": + version: 1.1.1 + resolution: "to-buffer@npm:1.1.1" + checksum: 10/8ade59fe04239b281496b6067bc83ad0371a3657552276cbd09ffffaeb3ad0018a28306d61b854b83280eabe1829cbc53001ccd761e834c6062cbcc7fee2766a + languageName: node + linkType: hard + "to-fast-properties@npm:^2.0.0": version: 2.0.0 resolution: "to-fast-properties@npm:2.0.0" @@ -9825,6 +10879,15 @@ __metadata: languageName: node linkType: hard +"trim-repeated@npm:^1.0.0": + version: 1.0.0 + resolution: "trim-repeated@npm:1.0.0" + dependencies: + escape-string-regexp: "npm:^1.0.2" + checksum: 10/e25c235305b82c43f1d64a67a71226c406b00281755e4c2c4f3b1d0b09c687a535dd3c4483327f949f28bb89dc400a0bc5e5b749054f4b99f49ebfe48ba36496 + languageName: node + linkType: hard + "ts-node@npm:10.9.2": version: 10.9.2 resolution: "ts-node@npm:10.9.2" @@ -9955,7 +11018,7 @@ __metadata: languageName: node linkType: hard -"unbzip2-stream@npm:1.4.3": +"unbzip2-stream@npm:1.4.3, unbzip2-stream@npm:^1.0.9": version: 1.4.3 resolution: "unbzip2-stream@npm:1.4.3" dependencies: @@ -10025,6 +11088,15 @@ __metadata: languageName: node linkType: hard +"url-parse-lax@npm:^3.0.0": + version: 3.0.0 + resolution: "url-parse-lax@npm:3.0.0" + dependencies: + prepend-http: "npm:^2.0.0" + checksum: 10/1040e357750451173132228036aff1fd04abbd43eac1fb3e4fca7495a078bcb8d33cb765fe71ad7e473d9c94d98fd67adca63bd2716c815a2da066198dd37217 + languageName: node + linkType: hard + "url-parse@npm:^1.5.3": version: 1.5.10 resolution: "url-parse@npm:1.5.10" @@ -10035,6 +11107,13 @@ __metadata: languageName: node linkType: hard +"url-to-options@npm:^1.0.1": + version: 1.0.1 + resolution: "url-to-options@npm:1.0.1" + checksum: 10/20e59f4578525fb0d30ffc22b13b5aa60bc9e57cefd4f5842720f5b57211b6dec54abeae2d675381ac4486fd1a2e987f1318725dea996e503ff89f8c8ce2c17e + languageName: node + linkType: hard + "urlpattern-polyfill@npm:10.0.0": version: 10.0.0 resolution: "urlpattern-polyfill@npm:10.0.0" @@ -10473,6 +11552,13 @@ __metadata: languageName: node linkType: hard +"xtend@npm:^4.0.0": + version: 4.0.2 + resolution: "xtend@npm:4.0.2" + checksum: 10/ac5dfa738b21f6e7f0dd6e65e1b3155036d68104e67e5d5d1bde74892e327d7e5636a076f625599dc394330a731861e87343ff184b0047fef1360a7ec0a5a36a + languageName: node + linkType: hard + "y18n@npm:^5.0.5": version: 5.0.8 resolution: "y18n@npm:5.0.8" @@ -10574,7 +11660,7 @@ __metadata: languageName: node linkType: hard -"yauzl@npm:^2.10.0": +"yauzl@npm:^2.10.0, yauzl@npm:^2.4.2": version: 2.10.0 resolution: "yauzl@npm:2.10.0" dependencies: From a22ccdf31fbc390f87121a672deb4277a68815cc Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Sun, 25 Aug 2024 22:39:12 +0200 Subject: [PATCH 11/74] build(scripts): fix Windows ClamAV standalone build download slug for x32 --- scripts/build/actions/downloadClamavStandaloneBuild.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build/actions/downloadClamavStandaloneBuild.js b/scripts/build/actions/downloadClamavStandaloneBuild.js index c66287bb..570cb246 100644 --- a/scripts/build/actions/downloadClamavStandaloneBuild.js +++ b/scripts/build/actions/downloadClamavStandaloneBuild.js @@ -10,7 +10,7 @@ import { createMessage, enums, readKey, readSignature, verify } from 'openpgp' // Key: rustc target triple, Value: ClamAV architecture file name const OS_WITH_ARCH_MAP = { 'arm64ec-pc-windows-msvc': 'win.arm64', - 'i686-pc-windows-msvc': 'win.x32', + 'i686-pc-windows-msvc': 'win.win32', 'x86_64-pc-windows-msvc': 'win.x64', } From 1159345143650ddd3388f007fb2fcdfe1f863419 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Sun, 25 Aug 2024 22:43:27 +0200 Subject: [PATCH 12/74] ci(github): add missing target arg in MSI build job --- .github/workflows/build.yml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6c07a59f..2bd71049 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -80,7 +80,7 @@ jobs: - name: Install run: yarn - name: Download latest ClamAV release - run: yarn release:msi + run: yarn release:msi --target ${{ matrix.target }} env: TARGET: ${{ matrix.target }} diff --git a/package.json b/package.json index 949fc407..0751a0f6 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "release:deb:install": "yarn release:deb && sudo dpkg -i ./src-tauri/target/release/bundle/deb/clamav-desktop_0.3.24_amd64.deb", "release:dmg": "tauri build -b dmg", "release:msi": "tauri build -b msi", - "release:msi:x64": "TARGET=x86_64-pc-windows-msvc yarn release:msi", + "release:msi:x64": "TARGET=x86_64-pc-windows-msvc yarn release:msi --target x86_64-pc-windows-msvc", "start": "./src-tauri/target/release/clamav-desktop", "test": "yarn test:lint && yarn test:type && yarn test:unit:core && test:unit:webview", "test:e2e": "xvfb-run wdio run ./configs/wdio.config.ts", From be1faaccf5a56c81592c8e2a24d8b359d6c48594 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Sun, 25 Aug 2024 22:54:51 +0200 Subject: [PATCH 13/74] build(npm): rename release to bundle --- .github/workflows/{build.yml => bundle.yml} | 36 +++++++------------ ...with_clamav.yml => bundle_with_clamav.yml} | 32 ++++++++--------- .github/workflows/integration.yml | 2 +- CONTRIBUTING.md | 12 ++++--- package.json | 14 ++++---- 5 files changed, 45 insertions(+), 51 deletions(-) rename .github/workflows/{build.yml => bundle.yml} (77%) rename .github/workflows/{build_with_clamav.yml => bundle_with_clamav.yml} (94%) diff --git a/.github/workflows/build.yml b/.github/workflows/bundle.yml similarity index 77% rename from .github/workflows/build.yml rename to .github/workflows/bundle.yml index 2bd71049..ffe62229 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/bundle.yml @@ -1,4 +1,4 @@ -name: Build +name: Bundle on: push: @@ -11,8 +11,8 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} jobs: - # build_deb_release: - # name: Build DEB Release + # bundle_deb: + # name: Bundle DEB # runs-on: ubuntu-latest # container: # image: ivangabriele/tauri:debian-bullseye-18 @@ -28,8 +28,8 @@ jobs: # node-version: 20 # - name: Install # run: yarn - # - name: Build - # run: yarn release:deb + # - name: Bundle + # run: yarn bundle:deb # - name: Upload # uses: actions/upload-artifact@v4 # with: @@ -37,8 +37,8 @@ jobs: # path: src-tauri/target/release/bundle/deb/*.deb # retention-days: 1 - # build_dmg_release: - # name: Build DMG Release + # bundle_dmg: + # name: Bundle DMG # runs-on: macos-latest # steps: # - name: Checkout @@ -52,8 +52,8 @@ jobs: # node-version: 20 # - name: Install # run: yarn - # - name: Build - # run: yarn release:dmg + # - name: Bundle + # run: yarn bundle:dmg # - name: Upload # uses: actions/upload-artifact@v4 # with: @@ -61,8 +61,8 @@ jobs: # path: src-tauri/target/release/bundle/dmg/*.dmg # retention-days: 1 - build_msi_release: - name: Build MSI Release + bundle_msi: + name: Bundle MSI strategy: matrix: target: ['arm64ec-pc-windows-msvc', 'i686-pc-windows-msvc', 'x86_64-pc-windows-msvc'] @@ -79,20 +79,10 @@ jobs: node-version: 20 - name: Install run: yarn - - name: Download latest ClamAV release - run: yarn release:msi --target ${{ matrix.target }} + - name: Bundle + run: yarn bundle:msi --target ${{ matrix.target }} env: TARGET: ${{ matrix.target }} - - # - name: Setup Node.js - # uses: actions/setup-node@v4 - # with: - # cache: yarn - # node-version: 20 - # - name: Install - # run: yarn - # - name: Build - # run: yarn release:msi # - name: Upload # uses: actions/upload-artifact@v4 # with: diff --git a/.github/workflows/build_with_clamav.yml b/.github/workflows/bundle_with_clamav.yml similarity index 94% rename from .github/workflows/build_with_clamav.yml rename to .github/workflows/bundle_with_clamav.yml index 4d818e8c..fe8ccd5c 100644 --- a/.github/workflows/build_with_clamav.yml +++ b/.github/workflows/bundle_with_clamav.yml @@ -1,11 +1,11 @@ -name: Build With ClamAV +name: Bundle With ClamAV on: workflow_dispatch: jobs: - # build_deb_release: - # name: Build DEB Release (With ClamAV) + # bundle_deb: + # name: Bundle DEB (With ClamAV) # runs-on: ubuntu-latest # container: # image: ivangabriele/tauri:debian-bullseye-18 @@ -21,8 +21,8 @@ jobs: # node-version: 20 # - name: Install # run: yarn - # - name: Build - # run: yarn release:deb + # - name: Bundle + # run: yarn bundle:deb # - name: Upload # uses: actions/upload-artifact@v4 # with: @@ -30,8 +30,8 @@ jobs: # path: src-tauri/target/release/bundle/deb/*.deb # retention-days: 1 - # build_dmg_release: - # name: Build DMG Release + # bundle_dmg: + # name: Bundle DMG # runs-on: macos-latest # steps: # - name: Checkout @@ -45,8 +45,8 @@ jobs: # node-version: 20 # - name: Install # run: yarn - # - name: Build - # run: yarn release:dmg + # - name: Bundle + # run: yarn bundle:dmg # - name: Upload # uses: actions/upload-artifact@v4 # with: @@ -54,8 +54,8 @@ jobs: # path: src-tauri/target/release/bundle/dmg/*.dmg # retention-days: 1 - # build_msi_release: - # name: Build MSI Release + # bundle_msi: + # name: Bundle MSI # runs-on: windows-latest # steps: # - name: Checkout @@ -69,8 +69,8 @@ jobs: # node-version: 20 # - name: Install # run: yarn - # - name: Build - # run: yarn release:msi + # - name: Bundle + # run: yarn bundle:msi # - name: Upload # uses: actions/upload-artifact@v4 # with: @@ -78,8 +78,8 @@ jobs: # path: src-tauri/target/release/bundle/msi/*.msi # retention-days: 1 - build_msi_release: - name: Build MSI Release (With ClamAV) + bundle_msi: + name: Bundle MSI (With ClamAV) strategy: fail-fast: true matrix: @@ -190,7 +190,7 @@ jobs: # - name: Install # run: yarn # - name: Build - # run: yarn release:msi + # run: yarn bundle:msi # - name: Upload # uses: actions/upload-artifact@v4 # with: diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 70e7e680..026df6a7 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -46,7 +46,7 @@ jobs: # - name: Install Node.js dependencies # run: yarn --frozen-lockfile # - name: Build binary - # run: yarn release:bin + # run: yarn bundle:bin # - name: Run tests # uses: nick-fields/retry@v3 # with: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f2e54f09..93d55d7b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -135,25 +135,27 @@ embed macOS & Windows environments). ### Binary (standalone) ```sh -yarn release:bin +yarn bundle:bin ``` ### Debian-based OS (deb) ```sh -yarn release:deb +yarn bundle:deb ``` ### macOS (dmg) ```sh -yarn release:dmg +yarn bundle:dmg ``` ### Windows 8+ (msi) ```sh -yarn release:msi +yarn bundle:msi:arch64 +yarn bundle:msi:x32 +yarn bundle:msi:x64 ``` ## Tests @@ -173,7 +175,7 @@ yarn test:unit:webview ### E2E tests ```sh -yarn release:bin +yarn bundle:bin yarn test:e2e ``` diff --git a/package.json b/package.json index 0751a0f6..9b0ad714 100644 --- a/package.json +++ b/package.json @@ -13,16 +13,18 @@ "build": "cd ./src-tauri && cargo build", "build:linux:debian": "sh ./scripts/build_linux_debian.sh", "build:webview": "tsc -p ./tsconfig.build.json && vite build", + "bundle:bin": "tauri build -b none", + "bundle:deb": "tauri build -b deb", + "bundle:deb:install": "yarn bundle:deb && sudo dpkg -i ./src-tauri/target/release/bundle/deb/clamav-desktop_0.3.24_amd64.deb", + "bundle:dmg": "tauri build -b dmg", + "bundle:msi": "tauri build -b msi", + "bundle:msi:arch64": "TARGET=arm64ec-pc-windows-msvc yarn bundle:msi --target arm64ec-pc-windows-msvc", + "bundle:msi:x32": "TARGET=i686-pc-windows-msvc yarn bundle:msi --target i686-pc-windows-msvc", + "bundle:msi:x64": "TARGET=x86_64-pc-windows-msvc yarn bundle:msi --target x86_64-pc-windows-msvc", "clean": "rm -fr ./.e2e ./coverage ./dist ./node_modules/.vite ./src-tauri/target ./src-tauri/cobertura.xml", "dev": "cross-env RUST_BACKTRACE=full TAURI_DEV=true tauri dev", "dev:webview": "vite", "postinstall": "node ./scripts/dev/post_install.js", - "release:bin": "tauri build -b none", - "release:deb": "tauri build -b deb", - "release:deb:install": "yarn release:deb && sudo dpkg -i ./src-tauri/target/release/bundle/deb/clamav-desktop_0.3.24_amd64.deb", - "release:dmg": "tauri build -b dmg", - "release:msi": "tauri build -b msi", - "release:msi:x64": "TARGET=x86_64-pc-windows-msvc yarn release:msi --target x86_64-pc-windows-msvc", "start": "./src-tauri/target/release/clamav-desktop", "test": "yarn test:lint && yarn test:type && yarn test:unit:core && test:unit:webview", "test:e2e": "xvfb-run wdio run ./configs/wdio.config.ts", From 6fe13639b1055f3a6feed4dabdb846a195367f30 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Sun, 25 Aug 2024 22:55:48 +0200 Subject: [PATCH 14/74] ci(github): disable arm64ec-pc-windows-msvc target in MSI bundle job --- .github/workflows/bundle.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bundle.yml b/.github/workflows/bundle.yml index ffe62229..13f38cc5 100644 --- a/.github/workflows/bundle.yml +++ b/.github/workflows/bundle.yml @@ -65,7 +65,8 @@ jobs: name: Bundle MSI strategy: matrix: - target: ['arm64ec-pc-windows-msvc', 'i686-pc-windows-msvc', 'x86_64-pc-windows-msvc'] + # target: ['arm64ec-pc-windows-msvc', 'i686-pc-windows-msvc', 'x86_64-pc-windows-msvc'] + target: ['i686-pc-windows-msvc', 'x86_64-pc-windows-msvc'] runs-on: windows-latest steps: - name: Checkout From 07610c4505923f5d48958f48ef67aebf4662c7f9 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Sun, 25 Aug 2024 23:12:00 +0200 Subject: [PATCH 15/74] ci(github): enable artifact upload in MSI bundle job --- .github/workflows/bundle.yml | 108 +++++++++++++++++------------------ 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/.github/workflows/bundle.yml b/.github/workflows/bundle.yml index 13f38cc5..479de680 100644 --- a/.github/workflows/bundle.yml +++ b/.github/workflows/bundle.yml @@ -11,55 +11,55 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} jobs: - # bundle_deb: - # name: Bundle DEB - # runs-on: ubuntu-latest - # container: - # image: ivangabriele/tauri:debian-bullseye-18 - # steps: - # - name: Checkout - # uses: actions/checkout@v4 - # with: - # submodules: true - # - name: Setup Node.js - # uses: actions/setup-node@v4 - # with: - # cache: yarn - # node-version: 20 - # - name: Install - # run: yarn - # - name: Bundle - # run: yarn bundle:deb - # - name: Upload - # uses: actions/upload-artifact@v4 - # with: - # name: ci-release-deb - # path: src-tauri/target/release/bundle/deb/*.deb - # retention-days: 1 + bundle_deb: + name: Bundle DEB + runs-on: ubuntu-latest + container: + image: ivangabriele/tauri:debian-bullseye-18 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + cache: yarn + node-version: 20 + - name: Install + run: yarn + - name: Bundle + run: yarn bundle:deb + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: ci-release-deb + path: src-tauri/target/release/bundle/deb/*.deb + retention-days: 1 - # bundle_dmg: - # name: Bundle DMG - # runs-on: macos-latest - # steps: - # - name: Checkout - # uses: actions/checkout@v4 - # with: - # submodules: true - # - name: Setup Node.js - # uses: actions/setup-node@v4 - # with: - # cache: yarn - # node-version: 20 - # - name: Install - # run: yarn - # - name: Bundle - # run: yarn bundle:dmg - # - name: Upload - # uses: actions/upload-artifact@v4 - # with: - # name: ci-release-dmg - # path: src-tauri/target/release/bundle/dmg/*.dmg - # retention-days: 1 + bundle_dmg: + name: Bundle DMG + runs-on: macos-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + cache: yarn + node-version: 20 + - name: Install + run: yarn + - name: Bundle + run: yarn bundle:dmg + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: ci-release-dmg + path: src-tauri/target/release/bundle/dmg/*.dmg + retention-days: 1 bundle_msi: name: Bundle MSI @@ -84,9 +84,9 @@ jobs: run: yarn bundle:msi --target ${{ matrix.target }} env: TARGET: ${{ matrix.target }} - # - name: Upload - # uses: actions/upload-artifact@v4 - # with: - # name: ci-release-msi - # path: src-tauri/target/release/bundle/msi/*.msi - # retention-days: 1 + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: ci-release-msi + path: src-tauri/target/release/bundle/msi/*.msi + retention-days: 1 From b795ae0779dcf660eecbebf25e29bb6338c0f710 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Sun, 25 Aug 2024 23:15:04 +0200 Subject: [PATCH 16/74] ci(github): uncomment unit workflow jobs --- .github/workflows/unit.yml | 297 +++++++++++++++++++------------------ 1 file changed, 151 insertions(+), 146 deletions(-) diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index d0b7bff0..395043ad 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -17,21 +17,23 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - # - name: Setup Node.js - # uses: actions/setup-node@v4 - # with: - # cache: yarn - # node-version: 20 - # - name: Install Node.js dependencies - # run: yarn - # - name: Run - # run: yarn test:unit:webview --coverage - # - name: Upload Coverage - # uses: codecov/codecov-action@v4 - # with: - # fail_ci_if_error: true - # flags: webview - # token: ${{ secrets.CODECOV_TOKEN }} + with: + submodules: false + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + cache: yarn + node-version: 20 + - name: Install Node.js dependencies + run: yarn + - name: Run + run: yarn test:unit:webview --coverage + - name: Upload Coverage + uses: codecov/codecov-action@v4 + with: + fail_ci_if_error: true + flags: webview + token: ${{ secrets.CODECOV_TOKEN }} core_test_debian: name: Test Core (debian-latest) @@ -45,38 +47,38 @@ jobs: - name: Checkout uses: actions/checkout@v4 with: - submodules: true - # # https://github.com/Swatinem/rust-cache#example-usage - # - uses: Swatinem/rust-cache@v2 - # with: - # cache-on-failure: true - # key: unit_core_test_debian-latest - # prefix-key: rust-cache - # shared-key: v0 - # workspaces: './src-tauri -> target' - # - name: Install ClamAV - # run: | - # apt-get update - # apt-get install -y clamav - # - name: Print versions - # run: | - # cat /etc/os-release - # rustc -V - # cargo -V - # clamscan -V - # # https://github.com/tauri-apps/tauri/issues/3142 - # - name: Create fake /dist directory - # run: mkdir ./dist - # - name: Run unit tests (with coverage) - # run: cargo tarpaulin --frozen --no-fail-fast --out Xml --workspace -- --nocapture - # working-directory: ./src-tauri - # - name: Upload tests coverage - # uses: codecov/codecov-action@v4 - # with: - # directory: ./src-tauri - # fail_ci_if_error: true - # flags: core - # token: ${{ secrets.CODECOV_TOKEN }} + submodules: false + # https://github.com/Swatinem/rust-cache#example-usage + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + key: unit_core_test_debian-latest + prefix-key: rust-cache + shared-key: v0 + workspaces: './src-tauri -> target' + - name: Install ClamAV + run: | + apt-get update + apt-get install -y clamav + - name: Print versions + run: | + cat /etc/os-release + rustc -V + cargo -V + clamscan -V + # https://github.com/tauri-apps/tauri/issues/3142 + - name: Create fake /dist directory + run: mkdir ./dist + - name: Run unit tests (with coverage) + run: cargo tarpaulin --frozen --no-fail-fast --out Xml --workspace -- --nocapture + working-directory: ./src-tauri + - name: Upload tests coverage + uses: codecov/codecov-action@v4 + with: + directory: ./src-tauri + fail_ci_if_error: true + flags: core + token: ${{ secrets.CODECOV_TOKEN }} core_test_macos_and_windows: name: Test Core @@ -85,110 +87,113 @@ jobs: os: [macos-latest, windows-latest] runs-on: ${{ matrix.os }} env: - PROJECT_ROOT_PATH: - ${{ matrix.os == 'macos-latest' && '/Users/runner/work/clamav-desktop/clamav-desktop' || + PROJECT_ROOT_PATH: ${{ matrix.os == 'macos-latest' && '/Users/runner/work/clamav-desktop/clamav-desktop' || 'D:\a\clamav-desktop\clamav-desktop' }} RUST_BACKTRACE: 1 steps: - name: Checkout uses: actions/checkout@v4 with: - submodules: true - # # https://github.com/Swatinem/rust-cache#example-usage - # - uses: Swatinem/rust-cache@v2 - # with: - # cache-on-failure: true - # key: unit_core_test_${{ matrix.os }} - # prefix-key: rust-cache - # shared-key: v0 - # workspaces: './src-tauri -> target' - # - uses: actions-rs/toolchain@v1 - # with: - # toolchain: stable - # - name: Print versions - # run: | - # rustc -V - # cargo -V - # # clamscan -V - # # https://github.com/tauri-apps/tauri/issues/3142 - # - name: Create fake /dist directory - # run: mkdir ./dist - # - name: Build - # run: cargo build - # working-directory: ./src-tauri - # - name: Run tests - # run: cargo test --no-fail-fast --workspace -- --nocapture - # working-directory: ./src-tauri + submodules: false + # https://github.com/Swatinem/rust-cache#example-usage + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + key: unit_core_test_${{ matrix.os }} + prefix-key: rust-cache + shared-key: v0 + workspaces: './src-tauri -> target' + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + - name: Print versions + run: | + rustc -V + cargo -V + # clamscan -V + # https://github.com/tauri-apps/tauri/issues/3142 + - name: Create fake /dist directory + run: mkdir ./dist + - name: Build + run: cargo build + working-directory: ./src-tauri + - name: Run tests + run: cargo test --no-fail-fast --workspace -- --nocapture + working-directory: ./src-tauri - # webview_build: - # name: Build Webview - # needs: - # - webview_lint - # - webview_type - # - webview_test - # runs-on: ubuntu-latest - # steps: - # - name: Checkout - # uses: actions/checkout@v3 - # - name: Setup Node.js - # uses: actions/setup-node@v3 - # with: - # cache: yarn - # node-version: 20 - # - name: Install Node.js dependencies - # run: yarn - # - name: Run - # run: yarn build:webview - # - name: Upload Webview Artifact - # uses: actions/upload-artifact@v3 - # with: - # name: webview - # path: ./build + webview_build: + name: Build Webview + needs: + - webview_lint + - webview_type + - webview_test + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: false + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + cache: yarn + node-version: 20 + - name: Install Node.js dependencies + run: yarn + - name: Run + run: yarn build:webview + - name: Upload Webview Artifact + uses: actions/upload-artifact@v3 + with: + name: webview + path: ./build - # core_test: - # name: Test Core - # needs: - # - webview_build - # runs-on: ubuntu-latest - # container: - # image: ivangabriele/tauri:bullseye-18 - # options: --security-opt seccomp=unconfined - # env: - # CARGO_TERM_COLOR: always - # steps: - # - name: Checkout - # uses: actions/checkout@v3 - # - name: Download Webview Artifact - # uses: actions/download-artifact@v3 - # with: - # name: webview - # path: ./build - # - name: Get Clamav Desktop version - # id: get_version - # uses: battila7/get-version-action@v2.3.0 - # - uses: Swatinem/rust-cache@v2 - # with: - # key: unit - # shared-key: ${{ steps.get_version.outputs.version }} - # workspaces: "./src-tauri -> target" - # - name: Install ClamAV - # run: | - # apt-get update - # apt-get install -y clamav - # - name: Print ClamAV version - # run: clamscan -V - # - name: Build - # run: cargo build - # working-directory: ./src-tauri - # - name: Run - # run: cargo test --no-fail-fast - # working-directory: ./src-tauri - # TODO Investigate why this is so slow. - # https://github.com/xd009642/tarpaulin#github-actions - # - name: Generate Coverage - # run: cargo tarpaulin --timeout 120 --out Xml - # working-directory: ./src-tauri - # - name: Upload Coverage - # uses: codecov/codecov-action@v3 - # with: - # directory: ./src-tauri + core_test: + name: Test Core + needs: + - webview_build + runs-on: ubuntu-latest + container: + image: ivangabriele/tauri:bullseye-18 + options: --security-opt seccomp=unconfined + env: + CARGO_TERM_COLOR: always + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: false + - name: Download Webview Artifact + uses: actions/download-artifact@v3 + with: + name: webview + path: ./build + - name: Get Clamav Desktop version + id: get_version + uses: battila7/get-version-action@v2.3.0 + - uses: Swatinem/rust-cache@v2 + with: + key: unit + shared-key: ${{ steps.get_version.outputs.version }} + workspaces: './src-tauri -> target' + - name: Install ClamAV + run: | + apt-get update + apt-get install -y clamav + - name: Print ClamAV version + run: clamscan -V + - name: Build + run: cargo build + working-directory: ./src-tauri + - name: Run + run: cargo test --no-fail-fast + working-directory: ./src-tauri + # TODO Investigate why this is so slow. + # https://github.com/xd009642/tarpaulin#github-actions + # - name: Generate Coverage + # run: cargo tarpaulin --timeout 120 --out Xml + # working-directory: ./src-tauri + # - name: Upload Coverage + # uses: codecov/codecov-action@v3 + # with: + # directory: ./src-tauri From 17f45032c743ff5f257855da52d6be73fc93c4f8 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Sun, 25 Aug 2024 23:24:53 +0200 Subject: [PATCH 17/74] build(scripts): skip prepare_core_build script if target is undefined --- scripts/build/prepare_core_build.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/build/prepare_core_build.js b/scripts/build/prepare_core_build.js index 9aa74f54..e7820a4a 100644 --- a/scripts/build/prepare_core_build.js +++ b/scripts/build/prepare_core_build.js @@ -9,6 +9,9 @@ const ALLOWED_TARGETS = ['arm64ec-pc-windows-msvc', 'i686-pc-windows-msvc', 'x86 const ROOT_PATH = getAbsolutePath(import.meta.url, '../..') const { TARGET } = process.env +if (!TARGET) { + process.exit(0) +} if (!ALLOWED_TARGETS.includes(TARGET)) { B.error('[prepare_core_build.js]', `Invalid target: \`${TARGET}\`.`) From 9b2d7057515c06a2db0cb35d6bdd6b5fee9ad2f5 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Sun, 25 Aug 2024 23:29:12 +0200 Subject: [PATCH 18/74] ci(github): re-comment legacy unit workflow jobs --- .github/workflows/unit.yml | 145 ++++++++++++++++++------------------- 1 file changed, 70 insertions(+), 75 deletions(-) diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index 395043ad..434d8dc5 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -121,79 +121,74 @@ jobs: run: cargo test --no-fail-fast --workspace -- --nocapture working-directory: ./src-tauri - webview_build: - name: Build Webview - needs: - - webview_lint - - webview_type - - webview_test - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: false - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - cache: yarn - node-version: 20 - - name: Install Node.js dependencies - run: yarn - - name: Run - run: yarn build:webview - - name: Upload Webview Artifact - uses: actions/upload-artifact@v3 - with: - name: webview - path: ./build + # webview_build: + # name: Build Webview + # runs-on: ubuntu-latest + # steps: + # - name: Checkout + # uses: actions/checkout@v3 + # with: + # submodules: false + # - name: Setup Node.js + # uses: actions/setup-node@v3 + # with: + # cache: yarn + # node-version: 20 + # - name: Install Node.js dependencies + # run: yarn + # - name: Run + # run: yarn build:webview + # - name: Upload Webview Artifact + # uses: actions/upload-artifact@v3 + # with: + # name: webview + # path: ./build - core_test: - name: Test Core - needs: - - webview_build - runs-on: ubuntu-latest - container: - image: ivangabriele/tauri:bullseye-18 - options: --security-opt seccomp=unconfined - env: - CARGO_TERM_COLOR: always - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: false - - name: Download Webview Artifact - uses: actions/download-artifact@v3 - with: - name: webview - path: ./build - - name: Get Clamav Desktop version - id: get_version - uses: battila7/get-version-action@v2.3.0 - - uses: Swatinem/rust-cache@v2 - with: - key: unit - shared-key: ${{ steps.get_version.outputs.version }} - workspaces: './src-tauri -> target' - - name: Install ClamAV - run: | - apt-get update - apt-get install -y clamav - - name: Print ClamAV version - run: clamscan -V - - name: Build - run: cargo build - working-directory: ./src-tauri - - name: Run - run: cargo test --no-fail-fast - working-directory: ./src-tauri - # TODO Investigate why this is so slow. - # https://github.com/xd009642/tarpaulin#github-actions - # - name: Generate Coverage - # run: cargo tarpaulin --timeout 120 --out Xml - # working-directory: ./src-tauri - # - name: Upload Coverage - # uses: codecov/codecov-action@v3 - # with: - # directory: ./src-tauri + # core_test: + # name: Test Core + # needs: [webview_build] + # runs-on: ubuntu-latest + # container: + # image: ivangabriele/tauri:bullseye-18 + # options: --security-opt seccomp=unconfined + # env: + # CARGO_TERM_COLOR: always + # steps: + # - name: Checkout + # uses: actions/checkout@v3 + # with: + # submodules: false + # - name: Download Webview Artifact + # uses: actions/download-artifact@v3 + # with: + # name: webview + # path: ./build + # - name: Get Clamav Desktop version + # id: get_version + # uses: battila7/get-version-action@v2.3.0 + # - uses: Swatinem/rust-cache@v2 + # with: + # key: unit + # shared-key: ${{ steps.get_version.outputs.version }} + # workspaces: './src-tauri -> target' + # - name: Install ClamAV + # run: | + # apt-get update + # apt-get install -y clamav + # - name: Print ClamAV version + # run: clamscan -V + # - name: Build + # run: cargo build + # working-directory: ./src-tauri + # - name: Run + # run: cargo test --no-fail-fast + # working-directory: ./src-tauri + # # TODO Investigate why this is so slow. + # # https://github.com/xd009642/tarpaulin#github-actions + # - name: Generate Coverage + # run: cargo tarpaulin --timeout 120 --out Xml + # working-directory: ./src-tauri + # - name: Upload Coverage + # uses: codecov/codecov-action@v3 + # with: + # directory: ./src-tauri From 61dd22e548d334baee9d1d394deb23a39cc55c87 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Sun, 25 Aug 2024 23:34:09 +0200 Subject: [PATCH 19/74] ci(github): uncomment integration workflow job --- .github/workflows/integration.yml | 70 +++++++++++++++---------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 026df6a7..9dafe371 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -21,38 +21,38 @@ jobs: uses: actions/checkout@v4 with: submodules: true - # # https://github.com/Swatinem/rust-cache#example-usage - # - uses: Swatinem/rust-cache@v2 - # with: - # cache-on-failure: true - # key: integration_e2e_debian-latest - # prefix-key: rust-cache - # shared-key: v0 - # workspaces: './src-tauri -> target' - # - name: Setup Node.js - # uses: actions/setup-node@v4 - # with: - # cache: yarn - # node-version: 20 - # - name: Install Debian dependencies - # run: | - # apt-get update - # apt-get install -y dbus-x11 - # - name: Install ClamAV - # run: | - # apt-get install -y clamav - # - name: Print ClamAV version - # run: clamscan -V - # - name: Install Node.js dependencies - # run: yarn --frozen-lockfile - # - name: Build binary - # run: yarn bundle:bin - # - name: Run tests - # uses: nick-fields/retry@v3 - # with: - # timeout_seconds: 600 - # max_attempts: 3 - # retry_on: error - # command: | - # fuser -n tcp -k 4445 - # yarn test:e2e + # https://github.com/Swatinem/rust-cache#example-usage + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + key: integration_e2e_debian-latest + prefix-key: rust-cache + shared-key: v0 + workspaces: './src-tauri -> target' + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + cache: yarn + node-version: 20 + - name: Install Debian dependencies + run: | + apt-get update + apt-get install -y dbus-x11 + - name: Install ClamAV + run: | + apt-get install -y clamav + - name: Print ClamAV version + run: clamscan -V + - name: Install Node.js dependencies + run: yarn --frozen-lockfile + - name: Build binary + run: yarn bundle:bin + - name: Run tests + uses: nick-fields/retry@v3 + with: + timeout_seconds: 600 + max_attempts: 3 + retry_on: error + command: | + fuser -n tcp -k 4445 + yarn test:e2e From f22e575d4c79fd57ddc66272ec6f1a52049e7fce Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 01:31:02 +0200 Subject: [PATCH 20/74] ci(github): add ARM64EC architecture MSI bundle job --- .github/workflows/analysis.yml | 5 ++++- .github/workflows/bundle.yml | 31 +++++++++++++++++++++++++++++++ .github/workflows/check.yml | 5 +++++ .github/workflows/integration.yml | 2 +- 4 files changed, 41 insertions(+), 2 deletions(-) diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index 5ac12218..f3e83f53 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -23,7 +23,6 @@ jobs: security-events: write # Required to fetch internal or private CodeQL packs packages: read - strategy: fail-fast: false matrix: @@ -37,6 +36,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + with: + submodules: false # - name: Initialize CodeQL # uses: github/codeql-action/init@v3 # with: @@ -57,6 +58,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + with: + submodules: false # - name: Install cargo-audit # run: cargo install cargo-audit # - name: Run diff --git a/.github/workflows/bundle.yml b/.github/workflows/bundle.yml index 479de680..c8935fab 100644 --- a/.github/workflows/bundle.yml +++ b/.github/workflows/bundle.yml @@ -90,3 +90,34 @@ jobs: name: ci-release-msi path: src-tauri/target/release/bundle/msi/*.msi retention-days: 1 + + bundle_msi_arm64: + name: Bundle MSI + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: false + - name: Setup Rust + uses: dtolnay/rust-toolchain@master + with: + targets: 'arm64ec-pc-windows-msvc' + toolchain: nightly + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + cache: yarn + node-version: 20 + - name: Install + run: yarn + - name: Bundle + run: yarn bundle:msi --target arm64ec-pc-windows-msvc + env: + TARGET: 'arm64ec-pc-windows-msvc' + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: ci-release-msi + path: src-tauri/target/release/bundle/msi/*.msi + retention-days: 1 diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 58aa356b..c8c44597 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -19,6 +19,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 100 + submodules: false - name: Setup Node.js uses: actions/setup-node@v4 with: @@ -35,6 +36,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + submodules: false - name: Setup Node.js uses: actions/setup-node@v4 with: @@ -51,6 +54,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + submodules: false - name: Setup Node.js uses: actions/setup-node@v4 with: diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 9dafe371..06a7e680 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -20,7 +20,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 with: - submodules: true + submodules: false # https://github.com/Swatinem/rust-cache#example-usage - uses: Swatinem/rust-cache@v2 with: From 172ebf13577e1497066bd7173e31b683855407ce Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 01:33:11 +0200 Subject: [PATCH 21/74] ci(github): uncomment analysis workflow jobs --- .github/workflows/analysis.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index f3e83f53..0b5281df 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -38,17 +38,17 @@ jobs: uses: actions/checkout@v4 with: submodules: false - # - name: Initialize CodeQL - # uses: github/codeql-action/init@v3 - # with: - # languages: ${{ matrix.language }} - # build-mode: ${{ matrix.build-mode }} - # # https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: 'security-and-quality,security-extended' - # - name: Perform CodeQL Analysis - # uses: github/codeql-action/analyze@v3 - # with: - # category: '/language:${{matrix.language}}' + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + # https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + queries: 'security-and-quality,security-extended' + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: '/language:${{matrix.language}}' cargo_audit: name: Cargo Audit @@ -60,8 +60,8 @@ jobs: uses: actions/checkout@v4 with: submodules: false - # - name: Install cargo-audit - # run: cargo install cargo-audit - # - name: Run - # run: cargo audit - # working-directory: ./src-tauri + - name: Install cargo-audit + run: cargo install cargo-audit + - name: Run + run: cargo audit + working-directory: ./src-tauri From 404fa19b245d5361f9cb110ec950560199e3bdbf Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 01:36:00 +0200 Subject: [PATCH 22/74] ci(github): add missing target in MSI bundle job name --- .github/workflows/bundle.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bundle.yml b/.github/workflows/bundle.yml index c8935fab..2669d7a4 100644 --- a/.github/workflows/bundle.yml +++ b/.github/workflows/bundle.yml @@ -62,7 +62,7 @@ jobs: retention-days: 1 bundle_msi: - name: Bundle MSI + name: Bundle MSI (${{ matrix.target }}) strategy: matrix: # target: ['arm64ec-pc-windows-msvc', 'i686-pc-windows-msvc', 'x86_64-pc-windows-msvc'] @@ -92,7 +92,7 @@ jobs: retention-days: 1 bundle_msi_arm64: - name: Bundle MSI + name: Bundle MSI (arm64ec-pc-windows-msvc) runs-on: windows-latest steps: - name: Checkout From 0d0f0eb5ade51f3eff910263783c725dbc2e94db Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 01:43:42 +0200 Subject: [PATCH 23/74] build(cargo): upgrade all dependencies --- src-tauri/Cargo.lock | 128 +++++++++++++++++++------------------------ src-tauri/Cargo.toml | 8 +-- 2 files changed, 60 insertions(+), 76 deletions(-) diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 506877db..a3aa0dfe 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -351,9 +351,9 @@ dependencies = [ [[package]] name = "brotli" -version = "3.5.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d640d25bc63c50fb1f0b545ffd80207d2e10a4c965530809b40ba3386825c391" +checksum = "74f7971dbd9326d58187408ab83117d8ac1bb9c17b085fdacd1cf2f598719b6b" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -362,9 +362,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "2.5.1" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e2e4afe60d7dd600fdd3de8d0f08c2b7ec039712e3b6137ff98b7004e82de4f" +checksum = "9a45bd2e4095a8b518033b128020dd4a55aab1c0a381ba4404a472630f4bc362" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -1122,6 +1122,15 @@ dependencies = [ "miniz_oxide", ] +[[package]] +name = "fluent-uri" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17c704e9dbe1ddd863da1e6ff3567795087b1eb201ce80d8fa81162e1516500d" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "fnv" version = "1.0.7" @@ -1883,15 +1892,6 @@ dependencies = [ "serde", ] -[[package]] -name = "infer" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f178e61cdbfe084aa75a2f4f7a25a5bb09701a47ae1753608f194b15783c937a" -dependencies = [ - "cfb", -] - [[package]] name = "infer" version = "0.13.0" @@ -1997,15 +1997,27 @@ dependencies = [ [[package]] name = "json-patch" -version = "1.4.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec9ad60d674508f3ca8f380a928cfe7b096bc729c4e2dbfe3852bc45da3ab30b" +checksum = "5b1fb8864823fad91877e6caea0baca82e49e8db50f8e5c9f9a453e27d3330fc" dependencies = [ + "jsonptr", "serde", "serde_json", "thiserror", ] +[[package]] +name = "jsonptr" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c6e529149475ca0b2820835d3dce8fcc41c6b943ca608d32f35b449255e4627" +dependencies = [ + "fluent-uri", + "serde", + "serde_json", +] + [[package]] name = "kuchikiki" version = "0.8.2" @@ -3506,18 +3518,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.208" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" +checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.208" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" +checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ "proc-macro2", "quote", @@ -3526,9 +3538,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.125" +version = "1.0.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" +checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" dependencies = [ "indexmap 2.4.0", "itoa 1.0.11", @@ -3601,9 +3613,9 @@ dependencies = [ [[package]] name = "serialize-to-javascript" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9823f2d3b6a81d98228151fdeaf848206a7855a7a042bbf9bf870449a66cafb" +checksum = "04f3666a07a197cdb77cdf306c32be9b7f598d7060d50cfd4d5aa04bfd92f6c5" dependencies = [ "serde", "serde_json", @@ -3612,13 +3624,13 @@ dependencies = [ [[package]] name = "serialize-to-javascript-impl" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74064874e9f6a15f04c1f3cb627902d0e6b410abbf36668afa873c61889f1763" +checksum = "772ee033c0916d670af7860b6e1ef7d658a4629a6d0b4c8c3e67f09b3765b75d" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.75", ] [[package]] @@ -3835,15 +3847,11 @@ checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] name = "sys-locale" -version = "0.2.4" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8a11bd9c338fdba09f7881ab41551932ad42e405f61d01e8406baea71c07aee" +checksum = "e801cf239ecd6ccd71f03d270d67dd53d13e90aab208bf4b8fe4ad957ea949b0" dependencies = [ - "js-sys", "libc", - "wasm-bindgen", - "web-sys", - "windows-sys 0.45.0", ] [[package]] @@ -3972,9 +3980,9 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tauri" -version = "1.7.1" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "336bc661a3f3250853fa83c6e5245449ed1c26dce5dcb28bdee7efedf6278806" +checksum = "0e33e3ba00a3b05eb6c57ef135781717d33728b48acf914bb05629e74d897d29" dependencies = [ "anyhow", "bytes", @@ -3993,7 +4001,7 @@ dependencies = [ "http", "ignore", "indexmap 1.9.3", - "infer 0.9.0", + "infer", "nix 0.26.4", "notify-rust", "objc", @@ -4033,9 +4041,9 @@ dependencies = [ [[package]] name = "tauri-build" -version = "1.5.3" +version = "1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c6ec7a5c3296330c7818478948b422967ce4649094696c985f61d50076d29c" +checksum = "d5fb5a90a64241ddb7217d3210d844149070a911e87e8a107a707a1d4973f164" dependencies = [ "anyhow", "cargo_toml", @@ -4052,9 +4060,9 @@ dependencies = [ [[package]] name = "tauri-codegen" -version = "1.4.4" +version = "1.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1aed706708ff1200ec12de9cfbf2582b5d8ec05f6a7293911091effbd22036b" +checksum = "93a9e3f5cebf779a63bf24903e714ec91196c307d8249a0008b882424328bcda" dependencies = [ "base64 0.21.7", "brotli", @@ -4078,9 +4086,9 @@ dependencies = [ [[package]] name = "tauri-macros" -version = "1.4.5" +version = "1.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b88f831d2973ae4f81a706a0004e67dac87f2e4439973bbe98efbd73825d8ede" +checksum = "d1d0e989f54fe06c5ef0875c5e19cf96453d099a0a774d5192ab47e80471cdab" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -4092,9 +4100,9 @@ dependencies = [ [[package]] name = "tauri-runtime" -version = "0.14.4" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3068ed62b63dedc705558f4248c7ecbd5561f0f8050949859ea0db2326f26012" +checksum = "f33fda7d213e239077fad52e96c6b734cecedb30c2382118b64f94cb5103ff3a" dependencies = [ "gtk", "http", @@ -4113,9 +4121,9 @@ dependencies = [ [[package]] name = "tauri-runtime-wry" -version = "0.14.9" +version = "0.14.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c3db170233096aa30330feadcd895bf9317be97e624458560a20e814db7955" +checksum = "18c447dcd9b0f09c7dc4b752cc33e72788805bfd761fbda5692d30c48289efec" dependencies = [ "arboard", "cocoa", @@ -4134,9 +4142,9 @@ dependencies = [ [[package]] name = "tauri-utils" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2826db448309d382dac14d520f0c0a40839b87b57b977e59cf5f296b3ace6a93" +checksum = "83a0c939e88d82903a0a7dfb28388b12a3c03504d6bd6086550edaa3b6d8beaa" dependencies = [ "brotli", "ctor", @@ -4144,7 +4152,7 @@ dependencies = [ "glob 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "heck 0.5.0", "html5ever", - "infer 0.13.0", + "infer", "json-patch", "kuchikiki", "log", @@ -5100,15 +5108,6 @@ dependencies = [ "windows_x86_64_msvc 0.42.2", ] -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - [[package]] name = "windows-sys" version = "0.48.0" @@ -5136,21 +5135,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 73821f7c..5c35682b 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -21,7 +21,7 @@ custom-protocol = ["tauri/custom-protocol"] members = ["cli", "common", "dev", "fast-cli", "filer"] [build-dependencies] -tauri-build = { version = "1.5.3", features = [] } +tauri-build = { version = "1.5.4", features = [] } [dependencies] chrono = "0.4.38" @@ -30,9 +30,9 @@ dev = { path = "./dev" } filer = { path = "./filer" } lazy_static = "1.5.0" regex = "1.10.6" -serde = { version = "1.0.208", features = ["derive"] } -serde_json = "1.0.125" -tauri = { version = "1.7.1", features = ["api-all", "icon-png", "system-tray"] } +serde = { version = "1.0.209", features = ["derive"] } +serde_json = "1.0.127" +tauri = { version = "1.7.2", features = ["api-all", "icon-png", "system-tray"] } tokio = { version = "1.39.3", features = ["full"] } tokio-util = "0.7.11" walkdir = "2.5.0" From 6194f5d8d470490652971a1c7d2a49ac74c1cce7 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 01:44:48 +0200 Subject: [PATCH 24/74] lint(prettier): force single quote in YAML files --- .prettierrc | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .prettierrc diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..3ab9aa05 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,10 @@ +{ + "overrides": [ + { + "files": ["*.yaml", "*.yml"], + "options": { + "singleQuote": true + } + } + ] +} From f7179471134626003fa471540bf8ad4c03578010 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 01:46:04 +0200 Subject: [PATCH 25/74] refactor(core/scanner): remove unused code --- src-tauri/src/scanner/commands.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src-tauri/src/scanner/commands.rs b/src-tauri/src/scanner/commands.rs index e3a5399f..7fbfb2a5 100644 --- a/src-tauri/src/scanner/commands.rs +++ b/src-tauri/src/scanner/commands.rs @@ -114,8 +114,6 @@ pub async fn start_scanner( ) .await; - let mut args_with_clamscan = vec!["clamscan".to_string()]; - args_with_clamscan.extend(args.iter().cloned()); let child = libs::cli::run(String::from("clamscan"), args).await; child.id(); From c11e4315f6be73f8393523b438cd73087b19f22e Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 01:46:53 +0200 Subject: [PATCH 26/74] build(cargo): add missing updated toml file --- src-tauri/filer/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-tauri/filer/Cargo.toml b/src-tauri/filer/Cargo.toml index 0d5b5bac..327280da 100644 --- a/src-tauri/filer/Cargo.toml +++ b/src-tauri/filer/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" cli = { path = "../cli" } common = { path = "../common" } glob = { git = "https://github.com/rust-lang/glob", branch = "master" } -serde = { version = "1.0.208", features = ["derive"] } +serde = { version = "1.0.209", features = ["derive"] } [dev-dependencies] dev = { path = "../dev" } From 0670d6689c3d04d4094f962e51a2f0dbbeabe454 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 02:08:56 +0200 Subject: [PATCH 27/74] build(npm): fix typo in bundle:msi:arm64 command --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9b0ad714..202f6a13 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "bundle:deb:install": "yarn bundle:deb && sudo dpkg -i ./src-tauri/target/release/bundle/deb/clamav-desktop_0.3.24_amd64.deb", "bundle:dmg": "tauri build -b dmg", "bundle:msi": "tauri build -b msi", - "bundle:msi:arch64": "TARGET=arm64ec-pc-windows-msvc yarn bundle:msi --target arm64ec-pc-windows-msvc", + "bundle:msi:arm64": "TARGET=arm64ec-pc-windows-msvc yarn bundle:msi --target arm64ec-pc-windows-msvc", "bundle:msi:x32": "TARGET=i686-pc-windows-msvc yarn bundle:msi --target i686-pc-windows-msvc", "bundle:msi:x64": "TARGET=x86_64-pc-windows-msvc yarn bundle:msi --target x86_64-pc-windows-msvc", "clean": "rm -fr ./.e2e ./coverage ./dist ./node_modules/.vite ./src-tauri/target ./src-tauri/cobertura.xml", From 8bd43c80c2725550572ee2911e5735009065d58c Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 02:20:29 +0200 Subject: [PATCH 28/74] ci(github): disable failed ARM64EC MSI bundle job attempt --- .github/workflows/bundle.yml | 60 ++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/.github/workflows/bundle.yml b/.github/workflows/bundle.yml index 2669d7a4..f1efe766 100644 --- a/.github/workflows/bundle.yml +++ b/.github/workflows/bundle.yml @@ -91,33 +91,33 @@ jobs: path: src-tauri/target/release/bundle/msi/*.msi retention-days: 1 - bundle_msi_arm64: - name: Bundle MSI (arm64ec-pc-windows-msvc) - runs-on: windows-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: false - - name: Setup Rust - uses: dtolnay/rust-toolchain@master - with: - targets: 'arm64ec-pc-windows-msvc' - toolchain: nightly - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - cache: yarn - node-version: 20 - - name: Install - run: yarn - - name: Bundle - run: yarn bundle:msi --target arm64ec-pc-windows-msvc - env: - TARGET: 'arm64ec-pc-windows-msvc' - - name: Upload - uses: actions/upload-artifact@v4 - with: - name: ci-release-msi - path: src-tauri/target/release/bundle/msi/*.msi - retention-days: 1 + # bundle_msi_arm64: + # name: Bundle MSI (arm64ec-pc-windows-msvc) + # runs-on: windows-latest + # steps: + # - name: Checkout + # uses: actions/checkout@v4 + # with: + # submodules: false + # - name: Setup Rust + # uses: dtolnay/rust-toolchain@master + # with: + # targets: 'arm64ec-pc-windows-msvc' + # toolchain: nightly + # - name: Setup Node.js + # uses: actions/setup-node@v4 + # with: + # cache: yarn + # node-version: 20 + # - name: Install + # run: yarn + # - name: Bundle + # run: yarn bundle:msi --target arm64ec-pc-windows-msvc + # env: + # TARGET: 'arm64ec-pc-windows-msvc' + # - name: Upload + # uses: actions/upload-artifact@v4 + # with: + # name: ci-release-msi + # path: src-tauri/target/release/bundle/msi/*.msi + # retention-days: 1 From 1831a934228f5d967dd8fc3edfed2ddfa74de65b Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 04:39:40 +0200 Subject: [PATCH 29/74] feat(sidecars): link clamd, clamscan & freshclam binaries --- package.json | 5 +-- .../actions/downloadClamavStandaloneBuild.js | 2 +- .../build/actions/normalizeSidecarNames.js | 26 ++++++++++++++ scripts/build/prepare_core_build.js | 4 +++ sidecars/.gitignore | 17 ++++++++++ sidecars/Cargo.toml | 18 ++++++++++ sidecars/src/clamd.rs | 9 +++++ sidecars/src/clamscan.rs | 9 +++++ sidecars/src/common.rs | 34 +++++++++++++++++++ sidecars/src/freshclam.rs | 9 +++++ src-tauri/tauri.conf.json | 7 +++- 11 files changed, 136 insertions(+), 4 deletions(-) create mode 100644 scripts/build/actions/normalizeSidecarNames.js create mode 100644 sidecars/.gitignore create mode 100644 sidecars/Cargo.toml create mode 100644 sidecars/src/clamd.rs create mode 100644 sidecars/src/clamscan.rs create mode 100644 sidecars/src/common.rs create mode 100644 sidecars/src/freshclam.rs diff --git a/package.json b/package.json index 202f6a13..0a39032e 100644 --- a/package.json +++ b/package.json @@ -9,9 +9,10 @@ "npm": "10" }, "scripts": { - "prebuild:core": "yarn build:webview && node ./scripts/build/prepare_core_build.js", + "prebuild:core": "yarn clean && yarn build:webview && yarn build:sidecars && node ./scripts/build/prepare_core_build.js", "build": "cd ./src-tauri && cargo build", "build:linux:debian": "sh ./scripts/build_linux_debian.sh", + "build:sidecars": "cd ./sidecars && cargo build --release", "build:webview": "tsc -p ./tsconfig.build.json && vite build", "bundle:bin": "tauri build -b none", "bundle:deb": "tauri build -b deb", @@ -21,7 +22,7 @@ "bundle:msi:arm64": "TARGET=arm64ec-pc-windows-msvc yarn bundle:msi --target arm64ec-pc-windows-msvc", "bundle:msi:x32": "TARGET=i686-pc-windows-msvc yarn bundle:msi --target i686-pc-windows-msvc", "bundle:msi:x64": "TARGET=x86_64-pc-windows-msvc yarn bundle:msi --target x86_64-pc-windows-msvc", - "clean": "rm -fr ./.e2e ./coverage ./dist ./node_modules/.vite ./src-tauri/target ./src-tauri/cobertura.xml", + "clean": "rm -fr ./.e2e ./coverage ./dist ./node_modules/.vite ./sidecars/target ./src-tauri/target ./src-tauri/cobertura.xml", "dev": "cross-env RUST_BACKTRACE=full TAURI_DEV=true tauri dev", "dev:webview": "vite", "postinstall": "node ./scripts/dev/post_install.js", diff --git a/scripts/build/actions/downloadClamavStandaloneBuild.js b/scripts/build/actions/downloadClamavStandaloneBuild.js index 570cb246..5fa2b406 100644 --- a/scripts/build/actions/downloadClamavStandaloneBuild.js +++ b/scripts/build/actions/downloadClamavStandaloneBuild.js @@ -116,5 +116,5 @@ export async function downloadClamavStandaloneBuild(target, rootPath) { // ----------------------------------------------------------------------------- - B.success('[prepare_core_build.js]', `ClamAV v${clamavVersion} standalone build downloaded successfully.`) + B.success('[prepare_core_build.js]', `ClamAV v${clamavVersion} standalone build successfully downloaded.`) } diff --git a/scripts/build/actions/normalizeSidecarNames.js b/scripts/build/actions/normalizeSidecarNames.js new file mode 100644 index 00000000..8694133f --- /dev/null +++ b/scripts/build/actions/normalizeSidecarNames.js @@ -0,0 +1,26 @@ +import { promises as fs } from 'node:fs' +import { join } from 'node:path' +import { B } from 'bhala' + +const BINARIES = ['clamd', 'clamscan', 'freshclam'] + +export async function normalizeSidecarNames(target, rootPath) { + let extension = '' + if (process.platform === 'win32') { + extension = '.exe' + } + + for (const binary of BINARIES) { + const sidecarName = `${binary}${extension}` + const normalizedSidecarName = `${binary}-${target}${extension}` + + B.info('[prepare_core_build.js]', `Renaming \`${sidecarName}\` sidecar to \`${normalizedSidecarName}\`...`) + + const srcPath = join(rootPath, `sidecars/target/release/${sidecarName}`) + const destPath = join(rootPath, `sidecars/target/release/${normalizedSidecarName}`) + + await fs.rename(srcPath, destPath) + } + + B.success('[prepare_core_build.js]', 'Sidecar names successfully normalized.') +} diff --git a/scripts/build/prepare_core_build.js b/scripts/build/prepare_core_build.js index e7820a4a..c47f5093 100644 --- a/scripts/build/prepare_core_build.js +++ b/scripts/build/prepare_core_build.js @@ -2,6 +2,7 @@ import { B } from 'bhala' import { getAbsolutePath } from 'esm-path' import { downloadClamavStandaloneBuild } from './actions/downloadClamavStandaloneBuild.js' +import { normalizeSidecarNames } from './actions/normalizeSidecarNames.js' // `rustc --print target-list` to get the list of supported targets const ALLOWED_TARGETS = ['arm64ec-pc-windows-msvc', 'i686-pc-windows-msvc', 'x86_64-pc-windows-msvc'] @@ -20,3 +21,6 @@ if (!ALLOWED_TARGETS.includes(TARGET)) { B.info('[prepare_core_build.js]', 'Downloading ClamAV standalone build...') await downloadClamavStandaloneBuild(TARGET, ROOT_PATH) + +B.info('[prepare_core_build.js]', 'Normalizing sidecar names...') +await normalizeSidecarNames(TARGET, ROOT_PATH) diff --git a/sidecars/.gitignore b/sidecars/.gitignore new file mode 100644 index 00000000..9151e6e8 --- /dev/null +++ b/sidecars/.gitignore @@ -0,0 +1,17 @@ +######################################## +# Rust + +# Generated by Cargo +# will have compiled files and executables +debug/ +target/ + +# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries +# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html +Cargo.lock + +# These are backup files generated by rustfmt +**/*.rs.bk + +# MSVC Windows builds of rustc generate these, which store debugging information +*.pdb diff --git a/sidecars/Cargo.toml b/sidecars/Cargo.toml new file mode 100644 index 00000000..b2201398 --- /dev/null +++ b/sidecars/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "sidecars" +version = "0.3.24" +edition = "2021" + +[[bin]] +name = "clamd" +path = "src/clamd.rs" + +[[bin]] +name = "clamscan" +path = "src/clamscan.rs" + +[[bin]] +name = "freshclam" +path = "src/freshclam.rs" + +[dependencies] diff --git a/sidecars/src/clamd.rs b/sidecars/src/clamd.rs new file mode 100644 index 00000000..bc16cb1b --- /dev/null +++ b/sidecars/src/clamd.rs @@ -0,0 +1,9 @@ +mod common; + +use std::env; +use common::execute_clamav_command; + +fn main() { + let args: Vec = env::args().skip(1).collect(); + execute_clamav_command("clamd", args); +} diff --git a/sidecars/src/clamscan.rs b/sidecars/src/clamscan.rs new file mode 100644 index 00000000..3d0c9ee4 --- /dev/null +++ b/sidecars/src/clamscan.rs @@ -0,0 +1,9 @@ +mod common; + +use std::env; +use common::execute_clamav_command; + +fn main() { + let args: Vec = env::args().skip(1).collect(); + execute_clamav_command("clamscan", args); +} diff --git a/sidecars/src/common.rs b/sidecars/src/common.rs new file mode 100644 index 00000000..95bd7deb --- /dev/null +++ b/sidecars/src/common.rs @@ -0,0 +1,34 @@ +use std::env; +use std::path::PathBuf; +use std::process::{exit, Command}; + +pub fn resolve_resource_path(binary_name: &str) -> PathBuf { + let current_exe = env::current_exe().expect("Failed to get current executable path"); + if current_exe.parent().unwrap().ends_with("target") { + // In development mode, use `../../../resources/clamav` as the base path + let mut dev_path = PathBuf::from(current_exe.parent().unwrap()); + dev_path.pop(); // Go one level up + dev_path.pop(); // Go another level up + dev_path.pop(); // Go another level up + dev_path.push(format!("resources/clamav/{}", binary_name)); + + dev_path + } else { + // In production mode, use `./_up_/resources` as the base path + let mut prod_path = PathBuf::from(current_exe.parent().unwrap()); + prod_path.push(format!("_up_/resources/clamav/{}", binary_name)); + + prod_path + } +} + +pub fn execute_clamav_command(binary_name: &str, args: Vec) { + let resource_path = resolve_resource_path(binary_name); + + let status = Command::new(resource_path) + .args(&args) + .status() + .expect(&format!("Failed to execute {}", binary_name)); + + exit(status.code().unwrap_or(1)); +} diff --git a/sidecars/src/freshclam.rs b/sidecars/src/freshclam.rs new file mode 100644 index 00000000..ed401a39 --- /dev/null +++ b/sidecars/src/freshclam.rs @@ -0,0 +1,9 @@ +mod common; + +use common::execute_clamav_command; +use std::env; + +fn main() { + let args: Vec = env::args().skip(1).collect(); + execute_clamav_command("freshclam", args); +} diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 9ff74f63..9ec7e7b0 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -8,7 +8,7 @@ "withGlobalTauri": false }, "package": { - "productName": "Clamav Desktop", + "productName": "ClamAV Desktop", "version": "0.3.24" }, "tauri": { @@ -26,6 +26,11 @@ "/usr/share/polkit-1/actions/com.clamav-desktop.app.policy": "../assets/deb/com.clamav-desktop.app.policy" } }, + "externalBin": [ + "../sidecars/target/release/clamd", + "../sidecars/target/release/clamscan", + "../sidecars/target/release/freshclam" + ], "icon": [ "../assets/icons/32x32.png", "../assets/icons/128x128.png", From 3606f02401e422baf201e919ff56e0affff85838 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 04:57:49 +0200 Subject: [PATCH 30/74] build(tauri): explicit some config props --- src-tauri/tauri.conf.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 9ec7e7b0..b33a26f5 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -39,7 +39,7 @@ "../assets/icons/icon.ico" ], "identifier": "com.clamav-desktop.app", - "longDescription": "ClamAV Desktop is a free and open-source GUI for ClamAV antivirus.\n\nPlease file your bugs (and only your bugs!) at: https://github.com/ivangabriele/clamav-desktop/issues.\n\nFor your questions and suggestions: https://github.com/ivangabriele/clamav-desktop/discussions.\n\nBe aware that ClamAV Desktop is neither endorsed nor part of official Cisco Systems projects.", + "longDescription": "ClamAV Desktop is a free and open-source GUI for ClamAV antivirus.\n\nPlease file your bugs (and only your bugs!) at: https://github.com/ivangabriele/clamav-desktop/issues.\n\nFor your questions and suggestions: https://github.com/ivangabriele/clamav-desktop/discussions.\n\nBe aware that ClamAV Desktop is neither endorsed nor part of official Cisco-Talos projects.", "macOS": { "entitlements": null, "exceptionDomain": "", @@ -47,8 +47,9 @@ "providerShortName": null, "signingIdentity": null }, + "publisher": "Ivan Gabriele", "resources": ["../resources/*"], - "shortDescription": "ClamAV Antivirus Desktop Application", + "shortDescription": "ClamAV Antivirus Desktop Application.", "targets": "all", "windows": { "certificateThumbprint": null, @@ -56,6 +57,9 @@ "timestampUrl": "" } }, + "pattern": { + "use": "brownfield" + }, "security": { "csp": null }, From 1368bd338a80ef453f3ae3c47b3fa7d7012a12b7 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 05:00:01 +0200 Subject: [PATCH 31/74] build(scripts): fix template litteral in prepare_core_build script --- scripts/build/actions/downloadClamavStandaloneBuild.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build/actions/downloadClamavStandaloneBuild.js b/scripts/build/actions/downloadClamavStandaloneBuild.js index 5fa2b406..5955e82c 100644 --- a/scripts/build/actions/downloadClamavStandaloneBuild.js +++ b/scripts/build/actions/downloadClamavStandaloneBuild.js @@ -90,7 +90,7 @@ export async function downloadClamavStandaloneBuild(target, rootPath) { try { await verificationResult.signatures[0].verified // Throws an error if verification fails } catch (err) { - B.error('[prepare_core_build.js]', 'ClamAV v${clamavVersion} standalone build signature verification failed.') + B.error('[prepare_core_build.js]', `ClamAV v${clamavVersion} standalone build signature verification failed.`) console.error(err) process.exit(1) From 0a1efe3ee22edd2a492d4c80f513cfb5b8639a5a Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 05:09:33 +0200 Subject: [PATCH 32/74] build: add x32 arch to DEB bundle --- .github/workflows/bundle.yml | 9 +++++++-- package.json | 2 ++ scripts/build/prepare_core_build.js | 8 +++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bundle.yml b/.github/workflows/bundle.yml index f1efe766..9c2bd1bc 100644 --- a/.github/workflows/bundle.yml +++ b/.github/workflows/bundle.yml @@ -12,7 +12,10 @@ concurrency: jobs: bundle_deb: - name: Bundle DEB + name: Bundle DEB (${{ matrix.target }}) + strategy: + matrix: + target: ['i686-unknown-linux-gnu', 'x86_64-unknown-linux-gnu'] runs-on: ubuntu-latest container: image: ivangabriele/tauri:debian-bullseye-18 @@ -29,7 +32,9 @@ jobs: - name: Install run: yarn - name: Bundle - run: yarn bundle:deb + run: yarn bundle:deb --target ${{ matrix.target }} + env: + TARGET: ${{ matrix.target }} - name: Upload uses: actions/upload-artifact@v4 with: diff --git a/package.json b/package.json index 0a39032e..16cc7354 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,8 @@ "bundle:bin": "tauri build -b none", "bundle:deb": "tauri build -b deb", "bundle:deb:install": "yarn bundle:deb && sudo dpkg -i ./src-tauri/target/release/bundle/deb/clamav-desktop_0.3.24_amd64.deb", + "bundle:deb:x32": "TARGET=i686-unknown-linux-gnu yarn bundle:deb --target i686-unknown-linux-gnu", + "bundle:deb:x64": "TARGET=x86_64-unknown-linux-gnu yarn bundle:deb --target x86_64-unknown-linux-gnu", "bundle:dmg": "tauri build -b dmg", "bundle:msi": "tauri build -b msi", "bundle:msi:arm64": "TARGET=arm64ec-pc-windows-msvc yarn bundle:msi --target arm64ec-pc-windows-msvc", diff --git a/scripts/build/prepare_core_build.js b/scripts/build/prepare_core_build.js index c47f5093..9d0a50cb 100644 --- a/scripts/build/prepare_core_build.js +++ b/scripts/build/prepare_core_build.js @@ -5,7 +5,13 @@ import { downloadClamavStandaloneBuild } from './actions/downloadClamavStandalon import { normalizeSidecarNames } from './actions/normalizeSidecarNames.js' // `rustc --print target-list` to get the list of supported targets -const ALLOWED_TARGETS = ['arm64ec-pc-windows-msvc', 'i686-pc-windows-msvc', 'x86_64-pc-windows-msvc'] +const ALLOWED_TARGETS = [ + 'arm64ec-pc-windows-msvc', + 'i686-unknown-linux-gnu', + 'i686-pc-windows-msvc', + 'x86_64-unknown-linux-gnu', + 'x86_64-pc-windows-msvc', +] const ROOT_PATH = getAbsolutePath(import.meta.url, '../..') From 5dc992a8c5e59ae35d40dc74464cce99203b7452 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 05:15:56 +0200 Subject: [PATCH 33/74] build: set x64 arch to DMG bundle --- .github/workflows/bundle.yml | 15 ++++++++++----- package.json | 1 + scripts/build/prepare_core_build.js | 1 + 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bundle.yml b/.github/workflows/bundle.yml index 9c2bd1bc..5513ff99 100644 --- a/.github/workflows/bundle.yml +++ b/.github/workflows/bundle.yml @@ -39,11 +39,14 @@ jobs: uses: actions/upload-artifact@v4 with: name: ci-release-deb - path: src-tauri/target/release/bundle/deb/*.deb + path: src-tauri/target//${ matrix.target }}release/bundle/deb/*.deb retention-days: 1 bundle_dmg: - name: Bundle DMG + name: Bundle DMG (${{ matrix.target }}) + strategy: + matrix: + target: ['aarch64-apple-darwin'] runs-on: macos-latest steps: - name: Checkout @@ -58,12 +61,14 @@ jobs: - name: Install run: yarn - name: Bundle - run: yarn bundle:dmg + run: yarn bundle:dmg --target ${{ matrix.target }} + env: + TARGET: ${{ matrix.target }} - name: Upload uses: actions/upload-artifact@v4 with: name: ci-release-dmg - path: src-tauri/target/release/bundle/dmg/*.dmg + path: src-tauri/target/${ matrix.target }}/release/bundle/dmg/*.dmg retention-days: 1 bundle_msi: @@ -93,7 +98,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: ci-release-msi - path: src-tauri/target/release/bundle/msi/*.msi + path: src-tauri/target//${ matrix.target }}release/bundle/msi/*.msi retention-days: 1 # bundle_msi_arm64: diff --git a/package.json b/package.json index 16cc7354..7e46f3de 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "bundle:deb:x32": "TARGET=i686-unknown-linux-gnu yarn bundle:deb --target i686-unknown-linux-gnu", "bundle:deb:x64": "TARGET=x86_64-unknown-linux-gnu yarn bundle:deb --target x86_64-unknown-linux-gnu", "bundle:dmg": "tauri build -b dmg", + "bundle:dmg:x64": "TARGET=aarch64-apple-darwin yarn bundle:dmg --target aarch64-apple-darwin", "bundle:msi": "tauri build -b msi", "bundle:msi:arm64": "TARGET=arm64ec-pc-windows-msvc yarn bundle:msi --target arm64ec-pc-windows-msvc", "bundle:msi:x32": "TARGET=i686-pc-windows-msvc yarn bundle:msi --target i686-pc-windows-msvc", diff --git a/scripts/build/prepare_core_build.js b/scripts/build/prepare_core_build.js index 9d0a50cb..632b38d7 100644 --- a/scripts/build/prepare_core_build.js +++ b/scripts/build/prepare_core_build.js @@ -6,6 +6,7 @@ import { normalizeSidecarNames } from './actions/normalizeSidecarNames.js' // `rustc --print target-list` to get the list of supported targets const ALLOWED_TARGETS = [ + 'aarch64-apple-darwin', 'arm64ec-pc-windows-msvc', 'i686-unknown-linux-gnu', 'i686-pc-windows-msvc', From 2e2fa0767aedfca3a619b03bdecae6f51581eb66 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 05:18:05 +0200 Subject: [PATCH 34/74] ci(github): disable fail-fast in bundle workflow jobs --- .github/workflows/bundle.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/bundle.yml b/.github/workflows/bundle.yml index 5513ff99..22996de0 100644 --- a/.github/workflows/bundle.yml +++ b/.github/workflows/bundle.yml @@ -14,6 +14,7 @@ jobs: bundle_deb: name: Bundle DEB (${{ matrix.target }}) strategy: + fail-fast: false matrix: target: ['i686-unknown-linux-gnu', 'x86_64-unknown-linux-gnu'] runs-on: ubuntu-latest @@ -45,6 +46,7 @@ jobs: bundle_dmg: name: Bundle DMG (${{ matrix.target }}) strategy: + fail-fast: false matrix: target: ['aarch64-apple-darwin'] runs-on: macos-latest @@ -74,6 +76,7 @@ jobs: bundle_msi: name: Bundle MSI (${{ matrix.target }}) strategy: + fail-fast: false matrix: # target: ['arm64ec-pc-windows-msvc', 'i686-pc-windows-msvc', 'x86_64-pc-windows-msvc'] target: ['i686-pc-windows-msvc', 'x86_64-pc-windows-msvc'] From 13a5a7ab732319e6b03563705fed2aa99e69dd5d Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 05:26:55 +0200 Subject: [PATCH 35/74] ci(github): add rust target for DEB bundle job --- .github/workflows/bundle.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/bundle.yml b/.github/workflows/bundle.yml index 22996de0..a3310e0a 100644 --- a/.github/workflows/bundle.yml +++ b/.github/workflows/bundle.yml @@ -25,6 +25,8 @@ jobs: uses: actions/checkout@v4 with: submodules: true + - name: Setup Rust + run: rustup target add ${{ matrix.target }} - name: Setup Node.js uses: actions/setup-node@v4 with: From a8c563bc8b1933d14136040a79985f8e5bf0c1ce Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 05:35:46 +0200 Subject: [PATCH 36/74] ci(github): fix typo in bundle workflow upload paths --- .github/workflows/bundle.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bundle.yml b/.github/workflows/bundle.yml index a3310e0a..3cbf1c66 100644 --- a/.github/workflows/bundle.yml +++ b/.github/workflows/bundle.yml @@ -42,7 +42,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: ci-release-deb - path: src-tauri/target//${ matrix.target }}release/bundle/deb/*.deb + path: src-tauri/target/${{ matrix.target }}release/bundle/deb/*.deb retention-days: 1 bundle_dmg: @@ -72,7 +72,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: ci-release-dmg - path: src-tauri/target/${ matrix.target }}/release/bundle/dmg/*.dmg + path: src-tauri/targe/${{ matrix.target }}/release/bundle/dmg/*.dmg retention-days: 1 bundle_msi: @@ -103,7 +103,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: ci-release-msi - path: src-tauri/target//${ matrix.target }}release/bundle/msi/*.msi + path: src-tauri/target/${{ matrix.target }}release/bundle/msi/*.msi retention-days: 1 # bundle_msi_arm64: From c7fa7f6da7a6ff8defe0e964c940eb7dc1b0d473 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 05:37:28 +0200 Subject: [PATCH 37/74] ci(github): limit release workflow trigger to workflow_dispatch --- .github/workflows/release.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 487d8353..8ec6c022 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,12 +1,13 @@ name: Release on: - workflow_run: - workflows: - - Unit - - Integration - types: - - completed + workflow_dispatch: + # workflow_run: + # workflows: + # - Unit + # - Integration + # types: + # - completed jobs: draft: From a181c094ccc6a2e98378e84f81d8e73b61bbc1da Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 05:39:19 +0200 Subject: [PATCH 38/74] ci(github): disable x32 arch for DEB bundle job --- .github/workflows/bundle.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bundle.yml b/.github/workflows/bundle.yml index 3cbf1c66..16918ed4 100644 --- a/.github/workflows/bundle.yml +++ b/.github/workflows/bundle.yml @@ -16,7 +16,8 @@ jobs: strategy: fail-fast: false matrix: - target: ['i686-unknown-linux-gnu', 'x86_64-unknown-linux-gnu'] + # target: ['i686-unknown-linux-gnu', 'x86_64-unknown-linux-gnu'] + target: ['x86_64-unknown-linux-gnu'] runs-on: ubuntu-latest container: image: ivangabriele/tauri:debian-bullseye-18 From 93b224e62d910eda846c1d08f3dd9173e8f1f281 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 05:46:42 +0200 Subject: [PATCH 39/74] build(scripts): add default target in prepare_core_build script --- scripts/build/prepare_core_build.js | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/scripts/build/prepare_core_build.js b/scripts/build/prepare_core_build.js index 632b38d7..5a2e656e 100644 --- a/scripts/build/prepare_core_build.js +++ b/scripts/build/prepare_core_build.js @@ -4,7 +4,9 @@ import { getAbsolutePath } from 'esm-path' import { downloadClamavStandaloneBuild } from './actions/downloadClamavStandaloneBuild.js' import { normalizeSidecarNames } from './actions/normalizeSidecarNames.js' -// `rustc --print target-list` to get the list of supported targets +// - `rustc --print target-list` to get the list of supported targets. +// - `rusup target list` to get the list of installed targets. +// - `rustup target add ` to install a target. const ALLOWED_TARGETS = [ 'aarch64-apple-darwin', 'arm64ec-pc-windows-msvc', @@ -14,20 +16,28 @@ const ALLOWED_TARGETS = [ 'x86_64-pc-windows-msvc', ] +// `[process.platform]`: target triple +const DEFAULT_TARGET_MAP = { + darwin: 'aarch64-apple-darwin', + linux: 'x86_64-unknown-linux-gnu', + win32: 'x86_64-pc-windows-msvc', +} + const ROOT_PATH = getAbsolutePath(import.meta.url, '../..') const { TARGET } = process.env +const CONTROLLED_TARGET = TARGET ?? DEFAULT_TARGET_MAP[process.platform] if (!TARGET) { process.exit(0) } -if (!ALLOWED_TARGETS.includes(TARGET)) { - B.error('[prepare_core_build.js]', `Invalid target: \`${TARGET}\`.`) +if (!ALLOWED_TARGETS.includes(CONTROLLED_TARGET)) { + B.error('[prepare_core_build.js]', `Invalid target: \`${CONTROLLED_TARGET}\`.`) process.exit(1) } B.info('[prepare_core_build.js]', 'Downloading ClamAV standalone build...') -await downloadClamavStandaloneBuild(TARGET, ROOT_PATH) +await downloadClamavStandaloneBuild(CONTROLLED_TARGET, ROOT_PATH) B.info('[prepare_core_build.js]', 'Normalizing sidecar names...') -await normalizeSidecarNames(TARGET, ROOT_PATH) +await normalizeSidecarNames(CONTROLLED_TARGET, ROOT_PATH) From 414d3cd08d5b3ad7266bffeacf05b9d2b51de91e Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 05:53:57 +0200 Subject: [PATCH 40/74] ci(github): disable fail-fast for macos/windows unit test job --- .github/workflows/unit.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index 434d8dc5..1b3d32d6 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -83,6 +83,7 @@ jobs: core_test_macos_and_windows: name: Test Core strategy: + fail-fast: false matrix: os: [macos-latest, windows-latest] runs-on: ${{ matrix.os }} From fc3df27ec6f00a75b9496c0c634413de3f3d8841 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 05:55:25 +0200 Subject: [PATCH 41/74] ci(github): remove actions-rs/toolchain step from macos/window unit test job --- .github/workflows/unit.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index 1b3d32d6..eed244f3 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -104,9 +104,6 @@ jobs: prefix-key: rust-cache shared-key: v0 workspaces: './src-tauri -> target' - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - name: Print versions run: | rustc -V From 864628d2bdeed59eb5a8a7b7f0a6190cf51f081b Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 06:01:39 +0200 Subject: [PATCH 42/74] ci(github): add missing sidecars build steps in unit workflow --- .github/workflows/unit.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index eed244f3..be6ae282 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -66,6 +66,9 @@ jobs: rustc -V cargo -V clamscan -V + - name: Build Sidecars + run: cargo build --release + working-directory: ./sidecars # https://github.com/tauri-apps/tauri/issues/3142 - name: Create fake /dist directory run: mkdir ./dist @@ -112,6 +115,9 @@ jobs: # https://github.com/tauri-apps/tauri/issues/3142 - name: Create fake /dist directory run: mkdir ./dist + - name: Build Sidecars + run: cargo build --release + working-directory: ./sidecars - name: Build run: cargo build working-directory: ./src-tauri From 007cc866c7d116b8b51450f5f3cdcaecc4f7e3a6 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 06:02:30 +0200 Subject: [PATCH 43/74] build(makefile): remove legacy jest lib test commands --- Makefile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Makefile b/Makefile index 4f970fc0..34a8aad9 100644 --- a/Makefile +++ b/Makefile @@ -24,10 +24,5 @@ test-filer: test-filer-watch: cd ./src-tauri/filer && cargo watch -x "test -- --nocapture" -test-jest: - cd ./src-tauri/jest && cargo test --no-fail-fast -- --nocapture -test-jest-watch: - cd ./src-tauri/jest && cargo watch -x "test -- --nocapture" - upgrade: cd ./src-tauri && cargo upgrade From cadcd350ffed679522ce894479492e0c1eb6ad54 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 07:26:15 +0200 Subject: [PATCH 44/74] ci(github): add missing sidecars renaming in unit workflow --- .github/workflows/unit.yml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index be6ae282..bc682aac 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -66,9 +66,17 @@ jobs: rustc -V cargo -V clamscan -V + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + cache: yarn + node-version: 20 + - name: Install Node.js dependencies + run: yarn - name: Build Sidecars - run: cargo build --release - working-directory: ./sidecars + run: | + cd ./sidecars && cargo build --release && cd .. + node ./scripts/build/prepare_core_build.js # https://github.com/tauri-apps/tauri/issues/3142 - name: Create fake /dist directory run: mkdir ./dist @@ -112,12 +120,20 @@ jobs: rustc -V cargo -V # clamscan -V + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + cache: yarn + node-version: 20 + - name: Install Node.js dependencies + run: yarn # https://github.com/tauri-apps/tauri/issues/3142 - name: Create fake /dist directory run: mkdir ./dist - name: Build Sidecars - run: cargo build --release - working-directory: ./sidecars + run: | + cd ./sidecars && cargo build --release && cd .. + node ./scripts/build/prepare_core_build.js - name: Build run: cargo build working-directory: ./src-tauri From ccbd7721c4c4efece1707bb8867fc07cafbadcd3 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 07:29:26 +0200 Subject: [PATCH 45/74] build(npm): fix cd in build:sidecars script --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7e46f3de..0ca1b9b2 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "prebuild:core": "yarn clean && yarn build:webview && yarn build:sidecars && node ./scripts/build/prepare_core_build.js", "build": "cd ./src-tauri && cargo build", "build:linux:debian": "sh ./scripts/build_linux_debian.sh", - "build:sidecars": "cd ./sidecars && cargo build --release", + "build:sidecars": "cd ./sidecars && cargo build --release && cd ..", "build:webview": "tsc -p ./tsconfig.build.json && vite build", "bundle:bin": "tauri build -b none", "bundle:deb": "tauri build -b deb", From caae0db2ffbe3a174b651d1ec95452d8210b48b2 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 07:38:30 +0200 Subject: [PATCH 46/74] build(scripts): fix typo in prepare_core_build script --- scripts/build/prepare_core_build.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build/prepare_core_build.js b/scripts/build/prepare_core_build.js index 5a2e656e..11485667 100644 --- a/scripts/build/prepare_core_build.js +++ b/scripts/build/prepare_core_build.js @@ -27,7 +27,7 @@ const ROOT_PATH = getAbsolutePath(import.meta.url, '../..') const { TARGET } = process.env const CONTROLLED_TARGET = TARGET ?? DEFAULT_TARGET_MAP[process.platform] -if (!TARGET) { +if (!CONTROLLED_TARGET) { process.exit(0) } if (!ALLOWED_TARGETS.includes(CONTROLLED_TARGET)) { From d7fae9c95af9c506af3c2d1bb5dc8a9acf772272 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 07:47:42 +0200 Subject: [PATCH 47/74] build(scripts): skip standlone download if exist in prepare_core_build script --- .../actions/downloadClamavStandaloneBuild.js | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/scripts/build/actions/downloadClamavStandaloneBuild.js b/scripts/build/actions/downloadClamavStandaloneBuild.js index 5955e82c..d57682a9 100644 --- a/scripts/build/actions/downloadClamavStandaloneBuild.js +++ b/scripts/build/actions/downloadClamavStandaloneBuild.js @@ -1,5 +1,5 @@ -import { promises as fs } from 'node:fs' -import { join, sep } from 'node:path' +import { existsSync, promises as fs } from 'node:fs' +import { join } from 'node:path' import { B } from 'bhala' import decompress from 'decompress' import { deleteAsync } from 'del' @@ -38,11 +38,11 @@ export async function downloadClamavStandaloneBuild(target, rootPath) { const downloadedBuildZipSignaturePath = `${downloadedBuildZipPath}.sig` const targetBuildPath = join(resourcesPath, 'clamav') - // ----------------------------------------------------------------------------- - // Clean up resources + if (existsSync(targetBuildPath)) { + B.info('[prepare_core_build.js]', 'ClamAV standalone build downloaded. Skipping standalone download...') - B.info('[prepare_core_build.js]', 'Cleaning up resources directory...') - await deleteAsync([`${resourcesPath}${sep}*`, `!${resourcesPath}${sep}.gitkeep`]) + return + } // ----------------------------------------------------------------------------- // Download ClamAV standalone build @@ -54,12 +54,9 @@ export async function downloadClamavStandaloneBuild(target, rootPath) { ].join('/') const signatureDownloadUrl = `${buildDownloadUrl}.sig` - B.info( - '[prepare_core_build.js]', - `Downloading ClamAV v${clamavVersion} standalone build for target: ${targetSlug}...`, - ) + B.log('[prepare_core_build.js]', `Downloading ClamAV v${clamavVersion} standalone build for target: ${targetSlug}...`) await download(buildDownloadUrl, resourcesPath) - B.info( + B.log( '[prepare_core_build.js]', `Downloading ClamAV v${clamavVersion} standalone build signature for target: ${targetSlug}...`, ) @@ -68,7 +65,7 @@ export async function downloadClamavStandaloneBuild(target, rootPath) { // ----------------------------------------------------------------------------- // Verify ClamAV standalone build signature - B.info('[prepare_core_build.js]', `Verifying ClamAV v${clamavVersion} standalone build signature...`) + B.log('[prepare_core_build.js]', `Verifying ClamAV v${clamavVersion} standalone build signature...`) const publicKeyArmored = await fs.readFile(signaturePublicKeyPath, 'utf8') const signatureArmored = await fs.readFile(downloadedBuildZipSignaturePath, 'utf8') const zipFile = await fs.readFile(downloadedBuildZipPath) @@ -99,19 +96,19 @@ export async function downloadClamavStandaloneBuild(target, rootPath) { // ----------------------------------------------------------------------------- // Extract ClamAV standalone build - B.info('[prepare_core_build.js]', `Extracting ClamAV v${clamavVersion} standalone build...`) + B.log('[prepare_core_build.js]', `Extracting ClamAV v${clamavVersion} standalone build...`) await decompress(downloadedBuildZipPath, resourcesPath) // ----------------------------------------------------------------------------- // Clean up downloaded files - B.info('[prepare_core_build.js]', 'Cleaning up downloaded files...') + B.log('[prepare_core_build.js]', 'Cleaning up downloaded files...') await deleteAsync([downloadedBuildZipPath, downloadedBuildZipSignaturePath]) // ----------------------------------------------------------------------------- // Normalize extracted directory name - B.info('[prepare_core_build.js]', 'Normalizing extracted directory name...') + B.log('[prepare_core_build.js]', 'Normalizing extracted directory name...') await move(downloadedBuildPath, targetBuildPath) // ----------------------------------------------------------------------------- From 3e4b8b4187c28bf09243c9a29d7c2a40bab3e96c Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 07:48:17 +0200 Subject: [PATCH 48/74] build(npm): add predev script --- package.json | 5 +++-- src-tauri/tauri.conf.json | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 0ca1b9b2..a6dadfa5 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "npm": "10" }, "scripts": { - "prebuild:core": "yarn clean && yarn build:webview && yarn build:sidecars && node ./scripts/build/prepare_core_build.js", + "prebuild": "yarn clean && yarn build:webview && yarn build:sidecars && node ./scripts/build/prepare_core_build.js", "build": "cd ./src-tauri && cargo build", "build:linux:debian": "sh ./scripts/build_linux_debian.sh", "build:sidecars": "cd ./sidecars && cargo build --release && cd ..", @@ -25,7 +25,8 @@ "bundle:msi:arm64": "TARGET=arm64ec-pc-windows-msvc yarn bundle:msi --target arm64ec-pc-windows-msvc", "bundle:msi:x32": "TARGET=i686-pc-windows-msvc yarn bundle:msi --target i686-pc-windows-msvc", "bundle:msi:x64": "TARGET=x86_64-pc-windows-msvc yarn bundle:msi --target x86_64-pc-windows-msvc", - "clean": "rm -fr ./.e2e ./coverage ./dist ./node_modules/.vite ./sidecars/target ./src-tauri/target ./src-tauri/cobertura.xml", + "clean": "rm -fr ./.e2e ./coverage ./dist ./node_modules/.vite ./resources ./sidecars/target ./src-tauri/target ./src-tauri/cobertura.xml && mkdir ./resources && touch ./resources/.gitkeep", + "predev": "yarn build:sidecars && node ./scripts/build/prepare_core_build.js && yarn dev:webview", "dev": "cross-env RUST_BACKTRACE=full TAURI_DEV=true tauri dev", "dev:webview": "vite", "postinstall": "node ./scripts/dev/post_install.js", diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index b33a26f5..eea20ff3 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,8 +1,8 @@ { "$schema": "../node_modules/@tauri-apps/cli/schema.json", "build": { - "beforeBuildCommand": "yarn prebuild:core", - "beforeDevCommand": "yarn dev:webview", + "beforeBuildCommand": "yarn prebuild", + "beforeDevCommand": "yarn predev", "devPath": "http://localhost:1420", "distDir": "../dist", "withGlobalTauri": false From cd8efb17247889a8002c7c7c5d0e446cdda5ded5 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 14:17:01 +0200 Subject: [PATCH 49/74] feat(core/dashboard): prepare OS condition in get_dashboard_state() --- src-tauri/src/cloud/state.rs | 2 +- src-tauri/src/dashboard/state.rs | 2 +- src-tauri/src/dashboard/utils.rs | 73 ++++++++++++++++++++------------ src-tauri/src/libs/cli.rs | 8 ++-- src-tauri/src/settings/state.rs | 2 +- 5 files changed, 52 insertions(+), 35 deletions(-) diff --git a/src-tauri/src/cloud/state.rs b/src-tauri/src/cloud/state.rs index 123d499a..3bd30dec 100644 --- a/src-tauri/src/cloud/state.rs +++ b/src-tauri/src/cloud/state.rs @@ -7,7 +7,7 @@ pub struct CloudSharedState(pub CloudState); #[derive(Default)] pub struct CloudState { - pub private: CloudPrivateState, + // pub private: CloudPrivateState, pub public: Arc>, } diff --git a/src-tauri/src/dashboard/state.rs b/src-tauri/src/dashboard/state.rs index 83470ee0..995103e7 100644 --- a/src-tauri/src/dashboard/state.rs +++ b/src-tauri/src/dashboard/state.rs @@ -7,7 +7,7 @@ pub struct DashboardSharedState(pub DashboardState); #[derive(Default)] pub struct DashboardState { - pub private: DashboardPrivateState, + // pub private: DashboardPrivateState, pub public: Arc>, } diff --git a/src-tauri/src/dashboard/utils.rs b/src-tauri/src/dashboard/utils.rs index 55c51a35..fe5f50a3 100644 --- a/src-tauri/src/dashboard/utils.rs +++ b/src-tauri/src/dashboard/utils.rs @@ -1,35 +1,52 @@ -use regex::Regex; -use std::process::Command; -use std::str; - use super::*; pub fn get_service_status() -> (state::DashboardStatus, Vec) { - let output = Command::new("systemctl") - .arg("--no-pager") - .arg("status") - .arg("clamav-daemon") - .output() - .expect("Failed to retrieve systemctl status"); - - let output_str = str::from_utf8(&output.stdout).unwrap(); - - let status_regex = Regex::new(r"Active: (\w+) \(").unwrap(); - - let mut status = state::DashboardStatus::Unknown; - let mut log = Vec::new(); - - for line in output_str.lines() { - if let Some(cap) = status_regex.captures(line) { - status = match &cap[1] { - "active" => state::DashboardStatus::Running, - "inactive" => state::DashboardStatus::Stopped, - _ => state::DashboardStatus::Unknown, - }; - } else { - log.push(line.to_string()); + if cfg!(target_os = "linux") { + use regex::Regex; + use std::process::Command; + use std::str; + let output = Command::new("systemctl") + .arg("--no-pager") + .arg("status") + .arg("clamav-daemon") + .output() + .expect("Failed to retrieve systemctl status"); + + let output_str = str::from_utf8(&output.stdout).unwrap(); + + let status_regex = Regex::new(r"Active: (\w+) \(").unwrap(); + + let mut status = state::DashboardStatus::Unknown; + let mut log = Vec::new(); + + for line in output_str.lines() { + if let Some(cap) = status_regex.captures(line) { + status = match &cap[1] { + "active" => state::DashboardStatus::Running, + "inactive" => state::DashboardStatus::Stopped, + _ => state::DashboardStatus::Unknown, + }; + } else { + log.push(line.to_string()); + } } + + return (status, log); + } + + if cfg!(target_os = "macos") { + let status = state::DashboardStatus::Stopped; + let log: Vec = Vec::new(); + + return (status, log); + } + + if cfg!(target_os = "windows") { + let status = state::DashboardStatus::Stopped; + let log: Vec = Vec::new(); + + return (status, log); } - (status, log) + panic!("Unsupported OS."); } diff --git a/src-tauri/src/libs/cli.rs b/src-tauri/src/libs/cli.rs index add444b2..027b603a 100644 --- a/src-tauri/src/libs/cli.rs +++ b/src-tauri/src/libs/cli.rs @@ -1,10 +1,10 @@ use std::process::Stdio; use tokio::process::{Child, Command}; -#[derive(Clone, serde::Serialize)] -struct LogPayload { - logs: Vec, -} +// #[derive(Clone, serde::Serialize)] +// struct LogPayload { +// logs: Vec, +// } #[cfg(not(tarpaulin_include))] pub async fn run(binary_path: String, args: Vec) -> Child { diff --git a/src-tauri/src/settings/state.rs b/src-tauri/src/settings/state.rs index f65a7355..9d69d942 100644 --- a/src-tauri/src/settings/state.rs +++ b/src-tauri/src/settings/state.rs @@ -7,7 +7,7 @@ pub struct SharedSettingsState(pub SettingsState); #[derive(Default)] pub struct SettingsState { - pub private: SettingsPrivateState, + // pub private: SettingsPrivateState, pub public: Arc>, } From 0e03b2da68a24662737473ad87d148679ac5f471 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 14:22:37 +0200 Subject: [PATCH 50/74] feat(core/cloud): prepare OS conditions in get_cloud_state() --- src-tauri/src/cloud/utils.rs | 90 +++++++++++++++++++------------- src-tauri/src/dashboard/utils.rs | 4 ++ 2 files changed, 58 insertions(+), 36 deletions(-) diff --git a/src-tauri/src/cloud/utils.rs b/src-tauri/src/cloud/utils.rs index e59ea0bf..09a15bbc 100644 --- a/src-tauri/src/cloud/utils.rs +++ b/src-tauri/src/cloud/utils.rs @@ -6,43 +6,61 @@ use crate::debug; use super::*; pub async fn get_service_status() -> (state::CloudDaemonStatus, Vec) { - debug!("get_service_status()", "Command call."); - - let output_result = Command::new("systemctl") - .arg("--no-pager") - .arg("status") - .arg("clamav-freshclam") - .output() - .await; - - let output = match output_result { - Ok(output) => output, - // TODO Handle the error here. - Err(_) => { - return ( - state::CloudDaemonStatus::Unknown, - vec!["Failed to retrieve systemctl status".to_string()], - ) - } - }; - let output_str = std::str::from_utf8(&output.stdout).unwrap(); - - let status_regex = Regex::new(r"Active: (\w+) \(").unwrap(); - - let mut status = state::CloudDaemonStatus::Unknown; - let mut log = Vec::new(); - - for line in output_str.lines() { - if let Some(cap) = status_regex.captures(line) { - status = match &cap[1] { - "active" => state::CloudDaemonStatus::Running, - "inactive" => state::CloudDaemonStatus::Stopped, - _ => state::CloudDaemonStatus::Unknown, - }; - } else { - log.push(line.to_string()); + debug!("get_service_status()", "Call."); + + if cfg!(target_os = "linux") { + let output_result = Command::new("systemctl") + .arg("--no-pager") + .arg("status") + .arg("clamav-freshclam") + .output() + .await; + + let output = match output_result { + Ok(output) => output, + // TODO Handle the error here. + Err(_) => { + return ( + state::CloudDaemonStatus::Unknown, + vec!["Failed to retrieve systemctl status".to_string()], + ) + } + }; + let output_str = std::str::from_utf8(&output.stdout).unwrap(); + + let status_regex = Regex::new(r"Active: (\w+) \(").unwrap(); + + let mut status = state::CloudDaemonStatus::Unknown; + let mut log = Vec::new(); + + for line in output_str.lines() { + if let Some(cap) = status_regex.captures(line) { + status = match &cap[1] { + "active" => state::CloudDaemonStatus::Running, + "inactive" => state::CloudDaemonStatus::Stopped, + _ => state::CloudDaemonStatus::Unknown, + }; + } else { + log.push(line.to_string()); + } } + + return (status, log); + } + + if cfg!(target_os = "macos") { + let status = state::CloudDaemonStatus::Stopped; + let log: Vec = Vec::new(); + + return (status, log); + } + + if cfg!(target_os = "windows") { + let status = state::CloudDaemonStatus::Stopped; + let log: Vec = Vec::new(); + + return (status, log); } - (status, log) + panic!("Unsupported OS."); } diff --git a/src-tauri/src/dashboard/utils.rs b/src-tauri/src/dashboard/utils.rs index fe5f50a3..63042de0 100644 --- a/src-tauri/src/dashboard/utils.rs +++ b/src-tauri/src/dashboard/utils.rs @@ -1,6 +1,10 @@ +use crate::debug; + use super::*; pub fn get_service_status() -> (state::DashboardStatus, Vec) { + debug!("get_service_status()", "Call."); + if cfg!(target_os = "linux") { use regex::Regex; use std::process::Command; From a24f8f96c985d1646732a7726dd8961b68787f8d Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 14:26:07 +0200 Subject: [PATCH 51/74] build(cargo): enable tauri process-command-api feature --- src-tauri/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 5c35682b..4f221b92 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -32,7 +32,7 @@ lazy_static = "1.5.0" regex = "1.10.6" serde = { version = "1.0.209", features = ["derive"] } serde_json = "1.0.127" -tauri = { version = "1.7.2", features = ["api-all", "icon-png", "system-tray"] } +tauri = { version = "1.7.2", features = ["api-all", "icon-png", "process-command-api", "system-tray"] } tokio = { version = "1.39.3", features = ["full"] } tokio-util = "0.7.11" walkdir = "2.5.0" From b1492dd286d82cbfb6b4456fc7c01595249f380e Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 15:10:57 +0200 Subject: [PATCH 52/74] build(tauri): config clamd, clamscan & freshclam sidecars --- src-tauri/tauri.conf.json | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index eea20ff3..25a9d702 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -13,7 +13,27 @@ }, "tauri": { "allowlist": { - "all": true + "all": true, + "shell": { + "sidecar": true, + "scope": [ + { + "name": "../sidecars/target/release/clamd", + "sidecar": true, + "args": true + }, + { + "name": "../sidecars/target/release/clamscan", + "sidecar": true, + "args": true + }, + { + "name": "../sidecars/target/release/freshclam", + "sidecar": true, + "args": true + } + ] + } }, "bundle": { "active": true, From a2fea629a0cae0240ac9183268ad06f1b6c6d4f7 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 15:15:34 +0200 Subject: [PATCH 53/74] feat(core/cloud): link freshclam sidecar to start_cloud_update() for Windows case --- src-tauri/src/cloud/commands.rs | 185 +++++++++++++++++++++----------- src/screens/Cloud.tsx | 78 ++++++++------ src/types.ts | 2 +- 3 files changed, 169 insertions(+), 96 deletions(-) diff --git a/src-tauri/src/cloud/commands.rs b/src-tauri/src/cloud/commands.rs index 98855f6f..fd9301f3 100644 --- a/src-tauri/src/cloud/commands.rs +++ b/src-tauri/src/cloud/commands.rs @@ -1,7 +1,7 @@ use std::{env, process::Stdio}; use tauri::{AppHandle, Manager, State}; use tokio::io::{AsyncBufReadExt, BufReader}; -use tokio::process::Command; +use tokio::process::Command as TokioCommand; use crate::debug; @@ -38,82 +38,143 @@ pub async fn start_cloud_update( app_handle: AppHandle, shared_state: State<'_, state::CloudSharedState>, ) -> Result<(), ()> { + use tauri::api::process::{Command, CommandEvent}; + debug!("start_cloud_update()", "Command call."); + println!("1"); let is_dev_mode = env::var("TAURI_DEV").is_ok(); - // Update cloud state - let mut public_state_mutex_guard = shared_state.0.public.lock().await; - public_state_mutex_guard.is_running = true; - app_handle - .emit_all("cloud:state", &public_state_mutex_guard.clone()) - .unwrap(); - - let mut command = if is_dev_mode { - let mut cmd = Command::new("pkexec"); - cmd.args(["freshclam", "--daemon-notify"]); - cmd - } else { - let mut cmd = Command::new("freshclam"); - cmd.args(["--daemon-notify"]); - cmd - }; + if cfg!(target_os = "linux") { + println!("2"); + // Update cloud state + let mut public_state_mutex_guard = shared_state.0.public.lock().await; + public_state_mutex_guard.is_running = true; + app_handle + .emit_all("cloud:state", &public_state_mutex_guard.clone()) + .unwrap(); - let mut child = command - .stderr(Stdio::piped()) - .stdout(Stdio::piped()) - .spawn() - .expect("Failed to spawn child process."); - - let stdout = child - .stdout - .take() - .expect("Failed to attach standard output."); - - let app_handle_clone_for_stdout = app_handle.clone(); - let app_handle_clone_for_end = app_handle.clone(); - tokio::spawn(async move { - let reader = BufReader::new(stdout); - let mut lines = reader.lines(); - while let Ok(Some(line)) = lines.next_line().await { - #[cfg(debug_assertions)] - { - println!("[libs::cli::run()] {}", line); + let mut command = if is_dev_mode { + let mut cmd = TokioCommand::new("pkexec"); + cmd.args(["freshclam", "--daemon-notify"]); + cmd + } else { + let mut cmd = TokioCommand::new("freshclam"); + cmd.args(["--daemon-notify"]); + cmd + }; + + let mut child = command + .stderr(Stdio::piped()) + .stdout(Stdio::piped()) + .spawn() + .expect("Failed to spawn child process."); + + let stdout = child + .stdout + .take() + .expect("Failed to attach standard output."); + + let app_handle_clone_for_stdout = app_handle.clone(); + let app_handle_clone_for_end = app_handle.clone(); + tokio::spawn(async move { + let reader = BufReader::new(stdout); + let mut lines = reader.lines(); + while let Ok(Some(line)) = lines.next_line().await { + #[cfg(debug_assertions)] + { + println!("[libs::cli::run()] {}", line); + } + + let mut public_state_mutex_guard = app_handle_clone_for_stdout + .state::() + .inner() + .0 + .public + .lock() + .await; + public_state_mutex_guard.logs.push(line); + + app_handle_clone_for_stdout + .emit_all("cloud:state", &public_state_mutex_guard.clone()) + .unwrap(); } - let mut public_state_mutex_guard = app_handle_clone_for_stdout + let _ = child.wait().await.expect("Failed to wait for child exit."); + + // Update the state to indicate the process is no longer running + let mut public_state_mutex_guard = app_handle_clone_for_end .state::() .inner() .0 .public .lock() .await; - public_state_mutex_guard.logs.push(line); + public_state_mutex_guard.is_running = false; - app_handle_clone_for_stdout + // Updated cloud state + app_handle_clone_for_end .emit_all("cloud:state", &public_state_mutex_guard.clone()) .unwrap(); - } - - let _ = child.wait().await.expect("Failed to wait for child exit."); - - // Update the state to indicate the process is no longer running - let mut public_state_mutex_guard = app_handle_clone_for_end - .state::() - .inner() - .0 - .public - .lock() - .await; - public_state_mutex_guard.is_running = false; - - // Updated cloud state - app_handle_clone_for_end - .emit_all("cloud:state", &public_state_mutex_guard.clone()) - .unwrap(); - }); + }); + + return Ok(()); + } + + if cfg!(target_os = "macos") { + println!("3"); + return Ok(()); + } + + if cfg!(target_os = "windows") { + println!("4"); + + let (mut rx, _child) = Command::new_sidecar("freshclam") + .expect("failed to create `freshclam` binary command") + .spawn() + .expect("Failed to spawn sidecar"); + + let app_handle_clone_for_stdout = app_handle.clone(); + tauri::async_runtime::spawn(async move { + // read events such as stdout + while let Some(event) = rx.recv().await { + let mut public_state_mutex_guard = app_handle_clone_for_stdout + .state::() + .inner() + .0 + .public + .lock() + .await; + + if let CommandEvent::Stdout(ref line) = event { + #[cfg(debug_assertions)] + { + println!("[CommandEvent::Stdout] {}", line); + } + + public_state_mutex_guard.logs.push(line.to_string()); + } + + if let CommandEvent::Stderr(ref line) = event { + #[cfg(debug_assertions)] + { + println!("[CommandEvent::Stderr] {}", line); + } + + public_state_mutex_guard.logs.push(line.to_string()); + } + + app_handle_clone_for_stdout + .emit_all("cloud:state", &public_state_mutex_guard.clone()) + .unwrap(); + } + }); - Ok(()) + return Ok(()); + } + println!("5"); + + panic!("Unsupported OS."); } #[cfg(not(tarpaulin_include))] @@ -121,7 +182,7 @@ pub async fn start_cloud_update( pub fn start_cloud_daemon() -> () { debug!("start_cloud_daemon()", "Command call."); - Command::new("systemctl") + TokioCommand::new("systemctl") .args(["start", "clamav-freshclam"]) .stderr(Stdio::piped()) .stdout(Stdio::piped()) @@ -134,7 +195,7 @@ pub fn start_cloud_daemon() -> () { pub fn stop_cloud_daemon() -> () { debug!("stop_cloud_daemon()", "Command call."); - Command::new("systemctl") + TokioCommand::new("systemctl") .args(["stop", "clamav-freshclam"]) .stderr(Stdio::piped()) .stdout(Stdio::piped()) diff --git a/src/screens/Cloud.tsx b/src/screens/Cloud.tsx index 774c3c12..ba26103b 100644 --- a/src/screens/Cloud.tsx +++ b/src/screens/Cloud.tsx @@ -2,6 +2,7 @@ import { invoke } from '@tauri-apps/api' import { listen } from '@tauri-apps/api/event' import { useCallback, useEffect, useRef } from 'react' +import styled from 'styled-components' import { Button } from '../elements/Button' import { Logger } from '../elements/Logger' import { useCachedState } from '../hooks/useCachedState' @@ -37,7 +38,7 @@ export function Cloud() { timerRef.current = window.setInterval(() => { invoke('get_cloud_state') - }, 500) + }, 50000) return () => { if (timerRef.current) { @@ -50,39 +51,50 @@ export function Cloud() { {logsAsString} - {!!state && state.daemon_status === Core.CloudDaemonStatus.RUNNING && ( - <> - + + )} + {!!state && state.status === Core.CloudDaemonStatus.STOPPED && ( + - - )} - {!!state && state.daemon_status === Core.CloudDaemonStatus.STOPPED && ( - - )} - {!!state && state.daemon_status === Core.CloudDaemonStatus.UNKNOWN && ( - - )} - {!!state && state.is_running ? ( - - ) : ( - - )} + )} + {!!state && state.status === Core.CloudDaemonStatus.UNKNOWN && ( + + )} + {!!state && state.is_running ? ( + + ) : ( + + )} + ) } + +const ActionsBox = styled.div` + display: flex; + gap: 16px; + + > button { + flex: 0.5; + } +` diff --git a/src/types.ts b/src/types.ts index ce588b7b..e0326958 100644 --- a/src/types.ts +++ b/src/types.ts @@ -7,10 +7,10 @@ export namespace Core { // Cloud export type CloudState = { - daemon_status: CloudDaemonStatus is_ready: boolean is_running: boolean logs: string[] + status: CloudDaemonStatus } export enum CloudDaemonStatus { From 424aea15d4602652ba14f40cb003a171d271fe11 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 20:39:35 +0200 Subject: [PATCH 54/74] build(tauri): align shortDescription with productName --- src-tauri/tauri.conf.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 25a9d702..4dadc78e 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -69,7 +69,7 @@ }, "publisher": "Ivan Gabriele", "resources": ["../resources/*"], - "shortDescription": "ClamAV Antivirus Desktop Application.", + "shortDescription": "ClamAV Desktop", "targets": "all", "windows": { "certificateThumbprint": null, From 30d9e63338fbd8d9dd1b55c715d9561bb5516250 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 20:45:39 +0200 Subject: [PATCH 55/74] build(npm): add bundle:msi:install script --- .editorconfig | 3 +++ package.json | 8 ++++--- scripts/dev/install_msi_bundle.ps1 | 36 ++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 scripts/dev/install_msi_bundle.ps1 diff --git a/.editorconfig b/.editorconfig index d4c2ac36..1ca31875 100644 --- a/.editorconfig +++ b/.editorconfig @@ -17,6 +17,9 @@ trim_trailing_whitespace = false [*.{c,cpp,h,hpp}] indent_size = 4 +[*.ps1] +indent_size = 4 + [*.py] indent_size = 4 diff --git a/package.json b/package.json index a6dadfa5..20912673 100644 --- a/package.json +++ b/package.json @@ -9,27 +9,29 @@ "npm": "10" }, "scripts": { - "prebuild": "yarn clean && yarn build:webview && yarn build:sidecars && node ./scripts/build/prepare_core_build.js", + "prebuild": "yarn build:clean && yarn build:webview && yarn build:sidecars && node ./scripts/build/prepare_core_build.js", "build": "cd ./src-tauri && cargo build", + "build:clean": "rm -fr ./dist ./sidecars/target ./src-tauri/target", "build:linux:debian": "sh ./scripts/build_linux_debian.sh", "build:sidecars": "cd ./sidecars && cargo build --release && cd ..", "build:webview": "tsc -p ./tsconfig.build.json && vite build", "bundle:bin": "tauri build -b none", "bundle:deb": "tauri build -b deb", - "bundle:deb:install": "yarn bundle:deb && sudo dpkg -i ./src-tauri/target/release/bundle/deb/clamav-desktop_0.3.24_amd64.deb", "bundle:deb:x32": "TARGET=i686-unknown-linux-gnu yarn bundle:deb --target i686-unknown-linux-gnu", "bundle:deb:x64": "TARGET=x86_64-unknown-linux-gnu yarn bundle:deb --target x86_64-unknown-linux-gnu", + "bundle:deb:install": "yarn bundle:deb && sudo dpkg -i ./src-tauri/target/release/bundle/deb/clamav-desktop_0.3.24_amd64.deb", "bundle:dmg": "tauri build -b dmg", "bundle:dmg:x64": "TARGET=aarch64-apple-darwin yarn bundle:dmg --target aarch64-apple-darwin", "bundle:msi": "tauri build -b msi", "bundle:msi:arm64": "TARGET=arm64ec-pc-windows-msvc yarn bundle:msi --target arm64ec-pc-windows-msvc", "bundle:msi:x32": "TARGET=i686-pc-windows-msvc yarn bundle:msi --target i686-pc-windows-msvc", "bundle:msi:x64": "TARGET=x86_64-pc-windows-msvc yarn bundle:msi --target x86_64-pc-windows-msvc", - "clean": "rm -fr ./.e2e ./coverage ./dist ./node_modules/.vite ./resources ./sidecars/target ./src-tauri/target ./src-tauri/cobertura.xml && mkdir ./resources && touch ./resources/.gitkeep", + "bundle:msi:install": "powershell -ExecutionPolicy Bypass -File ./scripts/dev/install_msi_bundle.ps1", "predev": "yarn build:sidecars && node ./scripts/build/prepare_core_build.js && yarn dev:webview", "dev": "cross-env RUST_BACKTRACE=full TAURI_DEV=true tauri dev", "dev:webview": "vite", "postinstall": "node ./scripts/dev/post_install.js", + "prune": "rm -fr ./coverage ./dist ./node_modules/.vite ./resources ./sidecars/target ./src-tauri/target ./src-tauri/cobertura.xml && mkdir ./resources && touch ./resources/.gitkeep", "start": "./src-tauri/target/release/clamav-desktop", "test": "yarn test:lint && yarn test:type && yarn test:unit:core && test:unit:webview", "test:e2e": "xvfb-run wdio run ./configs/wdio.config.ts", diff --git a/scripts/dev/install_msi_bundle.ps1 b/scripts/dev/install_msi_bundle.ps1 new file mode 100644 index 00000000..d44abc3a --- /dev/null +++ b/scripts/dev/install_msi_bundle.ps1 @@ -0,0 +1,36 @@ +$ROOT_PATH = Join-Path -Path $PSScriptRoot -ChildPath "..\.." + +function Test-IsAdmin { + $currentUser = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent()) + + return $currentUser.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) +} + +# if (-not (Test-IsAdmin)) { +# Write-Host "[install_msi_bundle.ps1] Elevating script to run as administrator..." +# Start-Process powershell.exe "-ExecutionPolicy Bypass -File '$($MyInvocation.MyCommand.Path)'" -Verb RunAs + +# exit +# } + +$msiBundlePath = Join-Path -Path $ROOT_PATH -ChildPath "src-tauri\target\x86_64-pc-windows-msvc\release\bundle\msi\ClamAV Desktop_0.3.24_x64_en-US.msi" +if (-not (Test-Path $msiBundlePath)) { + Write-Host "[install_msi_bundle.ps1] Error: MSI bundle not found at ``$msiBundlePath``." -ForegroundColor Red + + exit +} + +# TODO Using `msiexec.exe` doesn't work for some reason (error: "The installation package could not be opened. [...]"). +# Write-Host "[install_msi_bundle.ps1] Installing MSI bundle..." -ForegroundColor Blue +# Start-Process msiexec.exe -ArgumentList "/i `"$msiBundlePath`"" -Wait + +Write-Host "[install_msi_bundle.ps1] Running MSI bundle..." -ForegroundColor Blue +Start-Process -FilePath $msiBundlePath -Wait + +Write-Host "[install_msi_bundle.ps1] Looking for ClamAV Dektop in installed programs..." +$program = Get-CimInstance -ClassName Win32_Product | Where-Object { $_.Name -eq "ClamAV Desktop" } +if ($program) { + Write-Host "[install_msi_bundle.ps1] ClamAV Dektop successfully installed from MSI bundle." -ForegroundColor Green +} else { + Write-Host "[install_msi_bundle.ps1] Error: ClamAV Dektop installation from MSI bundle failed." -ForegroundColor Red +} From 10aa39bf4c1406dfe55627d8a8d6f2f94b4e0b9e Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Mon, 26 Aug 2024 21:14:59 +0200 Subject: [PATCH 56/74] build(npm): add bundle:msi:uninstall script --- package.json | 1 + scripts/dev/uninstall_msi_bundle.ps1 | 46 ++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 scripts/dev/uninstall_msi_bundle.ps1 diff --git a/package.json b/package.json index 20912673..7ee1dbe3 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "bundle:msi:x32": "TARGET=i686-pc-windows-msvc yarn bundle:msi --target i686-pc-windows-msvc", "bundle:msi:x64": "TARGET=x86_64-pc-windows-msvc yarn bundle:msi --target x86_64-pc-windows-msvc", "bundle:msi:install": "powershell -ExecutionPolicy Bypass -File ./scripts/dev/install_msi_bundle.ps1", + "bundle:msi:uninstall": "powershell -ExecutionPolicy Bypass -File ./scripts/dev/uninstall_msi_bundle.ps1", "predev": "yarn build:sidecars && node ./scripts/build/prepare_core_build.js && yarn dev:webview", "dev": "cross-env RUST_BACKTRACE=full TAURI_DEV=true tauri dev", "dev:webview": "vite", diff --git a/scripts/dev/uninstall_msi_bundle.ps1 b/scripts/dev/uninstall_msi_bundle.ps1 new file mode 100644 index 00000000..a72e7a7a --- /dev/null +++ b/scripts/dev/uninstall_msi_bundle.ps1 @@ -0,0 +1,46 @@ +$ROOT_PATH = Join-Path -Path $PSScriptRoot -ChildPath "..\.." + +function Test-IsAdmin { + $currentUser = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent()) + + return $currentUser.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) +} + +# if (-not (Test-IsAdmin)) { +# Write-Host "[install_msi_bundle.ps1] Elevating script to run as administrator..." +# Start-Process powershell.exe "-ExecutionPolicy Bypass -File '$($MyInvocation.MyCommand.Path)'" -Verb RunAs + +# exit +# } + +$programName = "ClamAV Desktop" +$directoriesToDelete = @( + "C:\Program Files\ClamAV Desktop", + "C:\Users\ivang\AppData\Local\com.clamav-desktop.app", + "C:\Users\ivang\AppData\Roaming\com.clamav-desktop.app" +) + +Write-Host "[uninstall_msi_bundle.ps1] Looking for ClamAV Dektop in installed programs..." +$program = Get-CimInstance -ClassName Win32_Product | Where-Object { $_.Name -eq $programName } +if ($program) { + Write-Host "[uninstall_msi_bundle.ps1] Uninstalling ClamAV Dektop..." -ForegroundColor Blue + Start-Process msiexec.exe -ArgumentList "/x `"$($program.IdentifyingNumber)`"" -Wait + + Write-Host "[uninstall_msi_bundle.ps1] ClamAV Dektop successfully uninstalled from installed programs." -ForegroundColor Blue +} else { + Write-Host "[uninstall_msi_bundle.ps1] Error: ClamAV Dektop not found in installed programs." -ForegroundColor Red + + exit +} + +Write-Host "[uninstall_msi_bundle.ps1] Cleaning up leftover directories..." +foreach ($directory in $directoriesToDelete) { + if (Test-Path $directory) { + Write-Host "[uninstall_msi_bundle.ps1] Deleting directory: ``$directory``..." + Remove-Item -Recurse -Force $directory + } else { + Write-Host "[uninstall_msi_bundle.ps1] Directory already deleted: ``$directory``. Continuing..." + } +} + +Write-Host "[uninstall_msi_bundle.ps1] MSI bundle uninstallation complete." -ForegroundColor Green From f4c947665f1c965416321a44085139d854a40c2c Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Tue, 27 Aug 2024 20:15:40 +0200 Subject: [PATCH 57/74] build(scripts): lower not found install to warning in uninstall_msi_bundle --- scripts/dev/uninstall_msi_bundle.ps1 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/dev/uninstall_msi_bundle.ps1 b/scripts/dev/uninstall_msi_bundle.ps1 index a72e7a7a..cf498e4a 100644 --- a/scripts/dev/uninstall_msi_bundle.ps1 +++ b/scripts/dev/uninstall_msi_bundle.ps1 @@ -28,9 +28,7 @@ if ($program) { Write-Host "[uninstall_msi_bundle.ps1] ClamAV Dektop successfully uninstalled from installed programs." -ForegroundColor Blue } else { - Write-Host "[uninstall_msi_bundle.ps1] Error: ClamAV Dektop not found in installed programs." -ForegroundColor Red - - exit + Write-Host "[uninstall_msi_bundle.ps1] Warning: ClamAV Dektop not found in installed programs." -ForegroundColor Yellow } Write-Host "[uninstall_msi_bundle.ps1] Cleaning up leftover directories..." From c297ab6262fc1a48db00fc55c5c00eafdb316b30 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Wed, 28 Aug 2024 01:02:04 +0200 Subject: [PATCH 58/74] docs(contributors): add tauri extra documentation --- docs/contributors/tauri.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 docs/contributors/tauri.md diff --git a/docs/contributors/tauri.md b/docs/contributors/tauri.md new file mode 100644 index 00000000..d32ad0a7 --- /dev/null +++ b/docs/contributors/tauri.md @@ -0,0 +1,22 @@ +# Tauri, The Missing Docs + +- [Core](#core) + - [`api`](#api) + - [`path`](#path) + +## Core + +### `api` + +#### `path` + +- `app_cache_dir()`: + - Windows: `C:\Users\%USER%\AppData\Local\com.clamav-desktop.app` +- `app_config_dir()`: + - Windows: `C:\Users\%USER%\AppData\Roaming\com.clamav-desktop.app` +- `app_data_dir()`: + - Windows: `C:\Users\%USER%\AppData\Roaming\com.clamav-desktop.app` +- `app_local_data_dir()`: + - Windows: `C:\Users\%USER%\AppData\Local\com.clamav-desktop.app` +- `app_log_dir()`: + - Windows: `C:\Users\%USER%\AppData\Roaming\com.clamav-desktop.app\logs` From 5cebdd862805c10b0e65405fadefe704746883e1 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Wed, 28 Aug 2024 01:08:35 +0200 Subject: [PATCH 59/74] build(resources): move resources/ directory into src-tauri/ --- .gitignore | 5 +++-- package.json | 2 +- .../build/actions/downloadClamavStandaloneBuild.js | 2 +- sidecars/src/common.rs | 14 +++++++------- {resources => src-tauri/resources}/.gitkeep | 0 src-tauri/tauri.conf.json | 2 +- 6 files changed, 13 insertions(+), 12 deletions(-) rename {resources => src-tauri/resources}/.gitkeep (100%) diff --git a/.gitignore b/.gitignore index 4a0b53d1..fa0bcfb6 100644 --- a/.gitignore +++ b/.gitignore @@ -154,8 +154,9 @@ dist ######################################## # Custom -/resources/* -!/resources/.gitkeep +/src-tauri/resources/* +!/src-tauri/resources/.gitkeep +!/src-tauri/resources/*.conf /.debug/* !/.debug/.gitkeep diff --git a/package.json b/package.json index 7ee1dbe3..ced4de2d 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "dev": "cross-env RUST_BACKTRACE=full TAURI_DEV=true tauri dev", "dev:webview": "vite", "postinstall": "node ./scripts/dev/post_install.js", - "prune": "rm -fr ./coverage ./dist ./node_modules/.vite ./resources ./sidecars/target ./src-tauri/target ./src-tauri/cobertura.xml && mkdir ./resources && touch ./resources/.gitkeep", + "prune": "rm -fr ./coverage ./dist ./node_modules/.vite ./resources/clamav ./sidecars/target ./src-tauri/target ./src-tauri/cobertura.xml", "start": "./src-tauri/target/release/clamav-desktop", "test": "yarn test:lint && yarn test:type && yarn test:unit:core && test:unit:webview", "test:e2e": "xvfb-run wdio run ./configs/wdio.config.ts", diff --git a/scripts/build/actions/downloadClamavStandaloneBuild.js b/scripts/build/actions/downloadClamavStandaloneBuild.js index d57682a9..ee9c444e 100644 --- a/scripts/build/actions/downloadClamavStandaloneBuild.js +++ b/scripts/build/actions/downloadClamavStandaloneBuild.js @@ -29,7 +29,7 @@ export async function downloadClamavStandaloneBuild(target, rootPath) { const meta = JSON.parse(metaSource) const clamavVersion = meta.clamav.version - const resourcesPath = join(rootPath, 'resources') + const resourcesPath = join(rootPath, 'src-tauri/resources') const signaturePublicKeyPath = join(rootPath, 'scripts/build/cisco-talos-gpg-public-key.asc') const targetSlug = OS_WITH_ARCH_MAP[target] diff --git a/sidecars/src/common.rs b/sidecars/src/common.rs index 95bd7deb..85579883 100644 --- a/sidecars/src/common.rs +++ b/sidecars/src/common.rs @@ -5,18 +5,18 @@ use std::process::{exit, Command}; pub fn resolve_resource_path(binary_name: &str) -> PathBuf { let current_exe = env::current_exe().expect("Failed to get current executable path"); if current_exe.parent().unwrap().ends_with("target") { - // In development mode, use `../../../resources/clamav` as the base path + // In development mode, use `../../../src-tauri/resources/clamav` as the base path let mut dev_path = PathBuf::from(current_exe.parent().unwrap()); - dev_path.pop(); // Go one level up - dev_path.pop(); // Go another level up - dev_path.pop(); // Go another level up - dev_path.push(format!("resources/clamav/{}", binary_name)); + dev_path.pop(); + dev_path.pop(); + dev_path.pop(); + dev_path.push(format!("src-tauri/resources/clamav/{}", binary_name)); dev_path } else { - // In production mode, use `./_up_/resources` as the base path + // In production mode, use `./resources` as the base path let mut prod_path = PathBuf::from(current_exe.parent().unwrap()); - prod_path.push(format!("_up_/resources/clamav/{}", binary_name)); + prod_path.push(format!("resources/clamav/{}", binary_name)); prod_path } diff --git a/resources/.gitkeep b/src-tauri/resources/.gitkeep similarity index 100% rename from resources/.gitkeep rename to src-tauri/resources/.gitkeep diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 4dadc78e..50b26701 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -68,7 +68,7 @@ "signingIdentity": null }, "publisher": "Ivan Gabriele", - "resources": ["../resources/*"], + "resources": ["resources/*"], "shortDescription": "ClamAV Desktop", "targets": "all", "windows": { From bed6271fac095e886a5c6d12520274b8f230184f Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Wed, 28 Aug 2024 01:09:44 +0200 Subject: [PATCH 60/74] build(resources): add initial freshclam v1.4.0 config file --- src-tauri/resources/freshclam-1.4.0.conf | 197 +++++++++++++++++++++++ 1 file changed, 197 insertions(+) create mode 100644 src-tauri/resources/freshclam-1.4.0.conf diff --git a/src-tauri/resources/freshclam-1.4.0.conf b/src-tauri/resources/freshclam-1.4.0.conf new file mode 100644 index 00000000..b8dfa480 --- /dev/null +++ b/src-tauri/resources/freshclam-1.4.0.conf @@ -0,0 +1,197 @@ +## freshclam.conf(5) manual + +# Path to the database directory. +# WARNING: It must match clamd.conf's directive! +# WARNING: It must already exist, be an absolute path, be writeable by +# freshclam, and be readable by clamd/clamscan. +# Default: hardcoded (depends on installation options) +#DatabaseDirectory "C:\Program Files\ClamAV\database" + +# Path to the log file (make sure it has proper permissions) +# Default: disabled +#UpdateLogFile "C:\Program Files\ClamAV\freshclam.log" + +# Maximum size of the log file. +# Value of 0 disables the limit. +# You may use 'M' or 'm' for megabytes (1M = 1m = 1048576 bytes) +# and 'K' or 'k' for kilobytes (1K = 1k = 1024 bytes). +# in bytes just don't use modifiers. If LogFileMaxSize is enabled, +# log rotation (the LogRotate option) will always be enabled. +# Default: 1M +#LogFileMaxSize 2M + +# Log time with each message. +# Default: no +#LogTime yes + +# Enable verbose logging. +# Default: no +#LogVerbose yes + +# Use system logger (can work together with UpdateLogFile). +# Default: no +#LogSyslog yes + +# Specify the type of syslog messages - please refer to 'man syslog' +# for facility names. +# Default: LOG_LOCAL6 +#LogFacility LOG_MAIL + +# Enable log rotation. Always enabled when LogFileMaxSize is enabled. +# Default: no +#LogRotate yes + +# Write the daemon's pid to the specified file. +# You must run freshclam with --daemon (-d) for freshclam to run as a daemon. +# Default: disabled +#PidFile "C:\Program Files\ClamAV\freshclam.pid" + +# By default when started freshclam drops privileges and switches to the +# "clamav" user. This directive allows you to change the database owner. +# Default: clamav (may depend on installation options) +#DatabaseOwner clamav + +# Use DNS to verify virus database version. FreshClam uses DNS TXT records +# to verify database and software versions. With this directive you can change +# the database verification domain. +# WARNING: Do not touch it unless you're configuring freshclam to use your +# own database verification domain. +# Default: current.cvd.clamav.net +#DNSDatabaseInfo current.cvd.clamav.net + +# database.clamav.net is now the primary domain name to be used world-wide. +# Now that CloudFlare is being used as our Content Delivery Network (CDN), +# this one domain name works world-wide to direct freshclam to the closest +# geographic endpoint. +# If the old db.XY.clamav.net domains are set, freshclam will automatically +# use database.clamav.net instead. +DatabaseMirror database.clamav.net + +# How many attempts to make before giving up. +# Default: 3 (per mirror) +#MaxAttempts 5 + +# With this option you can control scripted updates. It's highly recommended +# to keep it enabled. +# Default: yes +#ScriptedUpdates yes + +# By default freshclam will keep the local databases (.cld) uncompressed to +# make their handling faster. With this option you can enable the compression; +# the change will take effect with the next database update. +# Default: no +#CompressLocalDatabase no + +# With this option you can provide custom sources for database files. +# This option can be used multiple times. Support for: +# http(s)://, ftp(s)://, or file:// +# Default: no custom URLs +#DatabaseCustomURL http://myserver.example.com/mysigs.ndb +#DatabaseCustomURL https://myserver.example.com/mysigs.ndb +#DatabaseCustomURL https://myserver.example.com:4567/allow_list.wdb +#DatabaseCustomURL ftp://myserver.example.com/example.ldb +#DatabaseCustomURL ftps://myserver.example.com:4567/example.ndb +#DatabaseCustomURL file://E:\Share\local.hdb + +# This option allows you to easily point freshclam to private mirrors. +# If PrivateMirror is set, freshclam does not attempt to use DNS +# to determine whether its databases are out-of-date, instead it will +# use the If-Modified-Since request or directly check the headers of the +# remote database files. For each database, freshclam first attempts +# to download the CLD file. If that fails, it tries to download the +# CVD file. This option overrides DatabaseMirror, DNSDatabaseInfo +# and ScriptedUpdates. It can be used multiple times to provide +# fall-back mirrors. +# Default: disabled +#PrivateMirror mirror1.example.com +#PrivateMirror mirror2.example.com + +# Number of database checks per day. +# Default: 12 (every two hours) +#Checks 24 + +# Proxy settings +# The HTTPProxyServer may be prefixed with [scheme]:// to specify which kind +# of proxy is used. +# http:// HTTP Proxy. Default when no scheme or proxy type is specified. +# https:// HTTPS Proxy. (Added in 7.52.0 for OpenSSL, GnuTLS and NSS) +# socks4:// SOCKS4 Proxy. +# socks4a:// SOCKS4a Proxy. Proxy resolves URL hostname. +# socks5:// SOCKS5 Proxy. +# socks5h:// SOCKS5 Proxy. Proxy resolves URL hostname. +# Default: disabled +#HTTPProxyServer https://proxy.example.com +#HTTPProxyPort 1234 +#HTTPProxyUsername myusername +#HTTPProxyPassword mypass + +# If your servers are behind a firewall/proxy which applies User-Agent +# filtering you can use this option to force the use of a different +# User-Agent header. +# As of ClamAV 0.103.3, this setting may not be used when updating from the +# clamav.net CDN and can only be used when updating from a private mirror. +# Default: clamav/version_number (OS: ..., ARCH: ..., CPU: ..., UUID: ...) +#HTTPUserAgent SomeUserAgentIdString + +# Use aaa.bbb.ccc.ddd as client address for downloading databases. Useful for +# multi-homed systems. +# Default: Use OS'es default outgoing IP address. +#LocalIPAddress aaa.bbb.ccc.ddd + +# Send the RELOAD command to clamd. +# Default: no +#NotifyClamd "C:\Program Files\ClamAV\clamd.conf" + +# Run command after successful database update. +# Use EXIT_1 to return 1 after successful database update. +# Default: disabled +#OnUpdateExecute command + +# Run command when database update process fails. +# Default: disabled +#OnErrorExecute command + +# Run command when freshclam reports outdated version. +# In the command string %v will be replaced by the new version number. +# Default: disabled +#OnOutdatedExecute command + +# Don't fork into background. +# Default: no +#Foreground yes + +# Enable debug messages in libclamav. +# Default: no +#Debug yes + +# Timeout in seconds when connecting to database server. +# Default: 30 +#ConnectTimeout 60 + +# Timeout in seconds when reading from database server. 0 means no timeout. +# Default: 60 +#ReceiveTimeout 300 + +# With this option enabled, freshclam will attempt to load new databases into +# memory to make sure they are properly handled by libclamav before replacing +# the old ones. +# Tip: This feature uses a lot of RAM. If your system has limited RAM and you +# are actively running ClamD or ClamScan during the update, then you may need +# to set `TestDatabases no`. +# Default: yes +#TestDatabases no + +# This option enables downloading of bytecode.cvd, which includes additional +# detection mechanisms and improvements to the ClamAV engine. +# Default: yes +#Bytecode no + +# Include an optional signature databases (opt-in). +# This option can be used multiple times. +#ExtraDatabase dbname1 +#ExtraDatabase dbname2 + +# Exclude a standard signature database (opt-out). +# This option can be used multiple times. +#ExcludeDatabase dbname1 +#ExcludeDatabase dbname2 From 94f59f8eb67768cbf8547f6c056bbc259e6ae3c3 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Wed, 28 Aug 2024 01:12:33 +0200 Subject: [PATCH 61/74] refactor(sidecars): simplify binary path resolution --- sidecars/src/common.rs | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/sidecars/src/common.rs b/sidecars/src/common.rs index 85579883..2ffd64a2 100644 --- a/sidecars/src/common.rs +++ b/sidecars/src/common.rs @@ -2,28 +2,16 @@ use std::env; use std::path::PathBuf; use std::process::{exit, Command}; -pub fn resolve_resource_path(binary_name: &str) -> PathBuf { +pub fn resolve_binary_path(binary_name: &str) -> PathBuf { let current_exe = env::current_exe().expect("Failed to get current executable path"); - if current_exe.parent().unwrap().ends_with("target") { - // In development mode, use `../../../src-tauri/resources/clamav` as the base path - let mut dev_path = PathBuf::from(current_exe.parent().unwrap()); - dev_path.pop(); - dev_path.pop(); - dev_path.pop(); - dev_path.push(format!("src-tauri/resources/clamav/{}", binary_name)); + let mut prod_path = PathBuf::from(current_exe.parent().unwrap()); + prod_path.push(format!("resources/clamav/{}", binary_name)); - dev_path - } else { - // In production mode, use `./resources` as the base path - let mut prod_path = PathBuf::from(current_exe.parent().unwrap()); - prod_path.push(format!("resources/clamav/{}", binary_name)); - - prod_path - } + prod_path } pub fn execute_clamav_command(binary_name: &str, args: Vec) { - let resource_path = resolve_resource_path(binary_name); + let resource_path = resolve_binary_path(binary_name); let status = Command::new(resource_path) .args(&args) From cd9f320e76720c277489a66a2e4a72058ac9daef Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Wed, 28 Aug 2024 01:16:18 +0200 Subject: [PATCH 62/74] build(meta): move meta data into resources & imitialize migrations --- meta.json | 5 ---- .../actions/downloadClamavStandaloneBuild.js | 2 +- src-tauri/resources/meta.json | 30 +++++++++++++++++++ 3 files changed, 31 insertions(+), 6 deletions(-) delete mode 100644 meta.json create mode 100644 src-tauri/resources/meta.json diff --git a/meta.json b/meta.json deleted file mode 100644 index 03be50cb..00000000 --- a/meta.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "clamav": { - "version": "1.4.0" - } -} diff --git a/scripts/build/actions/downloadClamavStandaloneBuild.js b/scripts/build/actions/downloadClamavStandaloneBuild.js index ee9c444e..78bd9a41 100644 --- a/scripts/build/actions/downloadClamavStandaloneBuild.js +++ b/scripts/build/actions/downloadClamavStandaloneBuild.js @@ -25,7 +25,7 @@ export async function downloadClamavStandaloneBuild(target, rootPath) { return } - const metaSource = await fs.readFile(`${rootPath}/meta.json`, 'utf8') + const metaSource = await fs.readFile(`${rootPath}/src-tauri/resources/meta.json`, 'utf8') const meta = JSON.parse(metaSource) const clamavVersion = meta.clamav.version diff --git a/src-tauri/resources/meta.json b/src-tauri/resources/meta.json new file mode 100644 index 00000000..0961d6ed --- /dev/null +++ b/src-tauri/resources/meta.json @@ -0,0 +1,30 @@ +{ + "clamav": { + "version": "1.4.0" + }, + "migrations": [ + { + "version": "0.4.0", + "files": [ + { + "action": "CREATE_FILE", + "location": "APP_CONFIG_DIR", + "path": "clamd.conf", + "description": "ClamAV v1.4.0 clamd configuration file." + }, + { + "action": "CREATE_FILE", + "location": "APP_CONFIG_DIR", + "path": "freshclam.conf", + "description": "ClamAV v1.4.0 freshclam configuration file." + }, + { + "action": "CREATE_FILE", + "location": "APP_DATA_DIR", + "path": "???", + "description": "ClamAV v1.4.0 fresclam virus definitions database." + } + ] + } + ] +} From 509135fafc180573f4968d5c9e3573dfece929fe Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Wed, 28 Aug 2024 01:16:57 +0200 Subject: [PATCH 63/74] ci(git): simplify resources ignores --- .gitignore | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index fa0bcfb6..b12ff7c1 100644 --- a/.gitignore +++ b/.gitignore @@ -154,9 +154,7 @@ dist ######################################## # Custom -/src-tauri/resources/* -!/src-tauri/resources/.gitkeep -!/src-tauri/resources/*.conf +/src-tauri/resources/clamav/* /.debug/* !/.debug/.gitkeep From 0b4cb91219312ea63ee18de46f43d74ddb612fc4 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Wed, 28 Aug 2024 01:23:17 +0200 Subject: [PATCH 64/74] build(npm): uninstall before install in bundle:msi:install script --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ced4de2d..228e289d 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "bundle:msi:arm64": "TARGET=arm64ec-pc-windows-msvc yarn bundle:msi --target arm64ec-pc-windows-msvc", "bundle:msi:x32": "TARGET=i686-pc-windows-msvc yarn bundle:msi --target i686-pc-windows-msvc", "bundle:msi:x64": "TARGET=x86_64-pc-windows-msvc yarn bundle:msi --target x86_64-pc-windows-msvc", - "bundle:msi:install": "powershell -ExecutionPolicy Bypass -File ./scripts/dev/install_msi_bundle.ps1", + "bundle:msi:install": "yarn bundle:msi:uninstall && powershell -ExecutionPolicy Bypass -File ./scripts/dev/install_msi_bundle.ps1", "bundle:msi:uninstall": "powershell -ExecutionPolicy Bypass -File ./scripts/dev/uninstall_msi_bundle.ps1", "predev": "yarn build:sidecars && node ./scripts/build/prepare_core_build.js && yarn dev:webview", "dev": "cross-env RUST_BACKTRACE=full TAURI_DEV=true tauri dev", From 67f7d2a7e81a666edad3acc50caa69b4e5441452 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Wed, 28 Aug 2024 01:23:50 +0200 Subject: [PATCH 65/74] build(resources): remove useless .gitkeep --- src-tauri/resources/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src-tauri/resources/.gitkeep diff --git a/src-tauri/resources/.gitkeep b/src-tauri/resources/.gitkeep deleted file mode 100644 index e69de29b..00000000 From 76f943878e5a1f3b396fc161ad6fc5ae3ab68eed Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Wed, 28 Aug 2024 04:42:07 +0200 Subject: [PATCH 66/74] lint(rustfmt): set max_width to 120 --- src-tauri/.rustfmt.toml | 1 + 1 file changed, 1 insertion(+) create mode 100644 src-tauri/.rustfmt.toml diff --git a/src-tauri/.rustfmt.toml b/src-tauri/.rustfmt.toml new file mode 100644 index 00000000..75306517 --- /dev/null +++ b/src-tauri/.rustfmt.toml @@ -0,0 +1 @@ +max_width = 120 From 458aa81200e174ee3774275a169efba48dd4507f Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Wed, 28 Aug 2024 21:25:29 +0200 Subject: [PATCH 67/74] build(cargo): disable publish for dev package --- src-tauri/dev/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/src-tauri/dev/Cargo.toml b/src-tauri/dev/Cargo.toml index 2f675bc7..4ea05bad 100644 --- a/src-tauri/dev/Cargo.toml +++ b/src-tauri/dev/Cargo.toml @@ -2,6 +2,7 @@ name = "dev" version = "0.1.0" edition = "2021" +publish = false [dependencies] From ac3e51254a743d0084e7d732818c4a8d20a5d198 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Wed, 28 Aug 2024 21:25:59 +0200 Subject: [PATCH 68/74] build(cargo): disable publish for cli package --- src-tauri/cli/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/src-tauri/cli/Cargo.toml b/src-tauri/cli/Cargo.toml index 9c78af40..08e50339 100644 --- a/src-tauri/cli/Cargo.toml +++ b/src-tauri/cli/Cargo.toml @@ -2,6 +2,7 @@ name = "cli" version = "0.1.0" edition = "2021" +publish = false [dependencies] colored = "2.1.0" From d6aa6aef303f36a06b0c0092a5675787832c246b Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Wed, 28 Aug 2024 21:26:15 +0200 Subject: [PATCH 69/74] build(cargo): disable publish for common package --- src-tauri/common/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/src-tauri/common/Cargo.toml b/src-tauri/common/Cargo.toml index 9ac491ce..ae329551 100644 --- a/src-tauri/common/Cargo.toml +++ b/src-tauri/common/Cargo.toml @@ -2,6 +2,7 @@ name = "common" version = "0.1.0" edition = "2021" +publish = false [dependencies] From c07074522258cc200dc70811930f70a2ecd3e607 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Wed, 28 Aug 2024 21:26:28 +0200 Subject: [PATCH 70/74] build(cargo): disable publish for filer package --- src-tauri/filer/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/src-tauri/filer/Cargo.toml b/src-tauri/filer/Cargo.toml index 327280da..d5517461 100644 --- a/src-tauri/filer/Cargo.toml +++ b/src-tauri/filer/Cargo.toml @@ -2,6 +2,7 @@ name = "filer" version = "0.1.0" edition = "2021" +publish = false [dependencies] cli = { path = "../cli" } From bab8592a54305f70c0b7097f07bd3e741faa7aa1 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Wed, 28 Aug 2024 21:27:23 +0200 Subject: [PATCH 71/74] feat(core/config): create package --- src-tauri/config/Cargo.toml | 9 +++ src-tauri/config/src/clamscan.rs | 81 +++++++++++++++++++ src-tauri/config/src/constants.rs | 43 ++++++++++ src-tauri/config/src/lib.rs | 4 + src-tauri/config/tests/test_clamscan_read.rs | 36 +++++++++ src-tauri/config/tests/test_clamscan_write.rs | 53 ++++++++++++ 6 files changed, 226 insertions(+) create mode 100644 src-tauri/config/Cargo.toml create mode 100644 src-tauri/config/src/clamscan.rs create mode 100644 src-tauri/config/src/constants.rs create mode 100644 src-tauri/config/src/lib.rs create mode 100644 src-tauri/config/tests/test_clamscan_read.rs create mode 100644 src-tauri/config/tests/test_clamscan_write.rs diff --git a/src-tauri/config/Cargo.toml b/src-tauri/config/Cargo.toml new file mode 100644 index 00000000..e5f33580 --- /dev/null +++ b/src-tauri/config/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "config" +description = "Read, parse and write ClamAV configuration files." +version = "0.1.0" +edition = "2021" +publish = false + +[dev-dependencies] +jrest = "0.2.3" diff --git a/src-tauri/config/src/clamscan.rs b/src-tauri/config/src/clamscan.rs new file mode 100644 index 00000000..cb43c89e --- /dev/null +++ b/src-tauri/config/src/clamscan.rs @@ -0,0 +1,81 @@ +use std::collections::HashMap; +use std::fs; +use std::io::{self, BufRead, Write}; +use std::path::Path; + +use crate::constants; + +#[derive(Debug)] +pub struct Config { + config_map: HashMap, +} + +impl Config { + pub fn new() -> Self { + Config { + config_map: HashMap::new(), + } + } + + pub fn from_file(path: &Path) -> io::Result { + let file = fs::File::open(path)?; + let reader = io::BufReader::new(file); + let mut config = Config::new(); + + for line in reader.lines() { + let line = line?; + let trimmed_line = line.trim(); + if trimmed_line.starts_with("#") || trimmed_line.is_empty() { + continue; + } + + let mut split = trimmed_line.splitn(2, ' '); + let key = split.next().unwrap().to_string(); + let value = split.next().unwrap().trim_matches('"'); + + config.config_map.insert( + key.clone(), + match key.clone().as_str() { + "MaxAttempts" => constants::ConfigValue::U32Val(value.parse().unwrap()), + "ScriptedUpdates" | "LogVerbose" => constants::ConfigValue::YesNoVal(value.parse().unwrap()), + "DatabaseMirror" => constants::ConfigValue::StringVal(value.to_string()), + _ => continue, + }, + ); + } + + Ok(config) + } + + pub fn to_file(&self, path: &Path) -> io::Result<()> { + let mut file = fs::File::create(path)?; + + // Write the initial comments and warnings + writeln!(file, "# v1.4.0")?; + writeln!(file, "# /!\\ DO NOT EDIT THIS FILE BY HAND /!\\")?; + writeln!( + file, + "# This file is automatically generated and managed by ClamAV Desktop." + )?; + writeln!( + file, + "# If you need to change this configuration, please use the Settings menu in ClamAV Desktop." + )?; + writeln!(file)?; + + // Write the configuration options + for (key, value) in &self.config_map { + writeln!(file, "{} {}", key, value.to_string())?; + } + + Ok(()) + } + + pub fn set_value(&mut self, key: &str, value: constants::ConfigValue) { + self.config_map.insert(key.to_string(), value); + } + + pub fn get_value(&self, key: &str) -> Option<&constants::ConfigValue> { + self.config_map.get(key) + } +} diff --git a/src-tauri/config/src/constants.rs b/src-tauri/config/src/constants.rs new file mode 100644 index 00000000..7a980c86 --- /dev/null +++ b/src-tauri/config/src/constants.rs @@ -0,0 +1,43 @@ +use std::str::FromStr; + +// Custom boolean type that reads and writes as "yes" and "no" +#[derive(Debug, PartialEq, Clone)] +pub enum YesNo { + Yes, + No, +} +impl ToString for YesNo { + fn to_string(&self) -> String { + match self { + YesNo::Yes => "yes".to_string(), + YesNo::No => "no".to_string(), + } + } +} +impl FromStr for YesNo { + type Err = &'static str; + + fn from_str(s: &str) -> Result { + match s { + "yes" => Ok(YesNo::Yes), + "no" => Ok(YesNo::No), + _ => Err("Invalid value for YesNo type"), + } + } +} + +#[derive(Debug)] +pub enum ConfigValue { + StringVal(String), + U32Val(u32), + YesNoVal(YesNo), +} +impl ConfigValue { + pub fn to_string(&self) -> String { + match self { + ConfigValue::StringVal(val) => format!("\"{}\"", val), + ConfigValue::U32Val(val) => val.to_string(), + ConfigValue::YesNoVal(val) => val.to_string(), + } + } +} diff --git a/src-tauri/config/src/lib.rs b/src-tauri/config/src/lib.rs new file mode 100644 index 00000000..97d57401 --- /dev/null +++ b/src-tauri/config/src/lib.rs @@ -0,0 +1,4 @@ +pub mod clamscan; +mod constants; + +pub use constants::{ConfigValue, YesNo}; \ No newline at end of file diff --git a/src-tauri/config/tests/test_clamscan_read.rs b/src-tauri/config/tests/test_clamscan_read.rs new file mode 100644 index 00000000..026b579b --- /dev/null +++ b/src-tauri/config/tests/test_clamscan_read.rs @@ -0,0 +1,36 @@ +use std::fs::File; +use std::io::Write; +use std::path::Path; + +use config::clamscan::Config; +use config::{ConfigValue, YesNo}; + +#[test] +fn test_clamscan_read() { + let test_config_path = Path::new("test_config_read.conf"); + + let mut file = File::create(&test_config_path).expect("Failed to create test config file"); + writeln!( + file, + "DatabaseMirror \"test.database.clamav.net\"\nMaxAttempts 3\nScriptedUpdates yes\nLogVerbose no" + ) + .expect("Failed to write to test config file"); + + let config = Config::from_file(&test_config_path).expect("Failed to read test config file"); + + assert!(matches!( + config.get_value("DatabaseMirror"), + Some(ConfigValue::StringVal(val)) if val == "test.database.clamav.net" + )); + assert!(matches!(config.get_value("MaxAttempts"), Some(ConfigValue::U32Val(3)))); + assert!(matches!( + config.get_value("ScriptedUpdates"), + Some(ConfigValue::YesNoVal(YesNo::Yes)) + )); + assert!(matches!( + config.get_value("LogVerbose"), + Some(ConfigValue::YesNoVal(YesNo::No)) + )); + + std::fs::remove_file(test_config_path).expect("Failed to remove test config file"); +} diff --git a/src-tauri/config/tests/test_clamscan_write.rs b/src-tauri/config/tests/test_clamscan_write.rs new file mode 100644 index 00000000..95ef2da5 --- /dev/null +++ b/src-tauri/config/tests/test_clamscan_write.rs @@ -0,0 +1,53 @@ +use std::fs::File; +use std::io::Write; +use std::path::Path; + +use config::clamscan::Config; +use config::{ConfigValue, YesNo}; + +#[test] +fn test_clamscan_write() { + let test_config_path = Path::new("test_config_write.conf"); + + let mut file = File::create(&test_config_path).expect("Failed to create test config file"); + writeln!( + file, + "DatabaseMirror \"test.database.clamav.net\"\nMaxAttempts 3\nScriptedUpdates yes\nLogVerbose no" + ) + .expect("Failed to write to test config file"); + + let config = Config::from_file(&test_config_path).expect("Failed to read test config file"); + + let mut modified_config = config; + modified_config.set_value( + "DatabaseMirror", + ConfigValue::StringVal("modified.database.clamav.net".to_string()), + ); + modified_config.set_value("MaxAttempts", ConfigValue::U32Val(5)); + modified_config.set_value("ScriptedUpdates", ConfigValue::YesNoVal(YesNo::No)); + modified_config.set_value("LogVerbose", ConfigValue::YesNoVal(YesNo::Yes)); + modified_config + .to_file(&test_config_path) + .expect("Failed to write modified config file"); + + let modified_config = Config::from_file(&test_config_path).expect("Failed to read modified config file"); + + assert!(matches!( + modified_config.get_value("DatabaseMirror"), + Some(ConfigValue::StringVal(val)) if val == "modified.database.clamav.net" + )); + assert!(matches!( + modified_config.get_value("MaxAttempts"), + Some(ConfigValue::U32Val(5)) + )); + assert!(matches!( + modified_config.get_value("ScriptedUpdates"), + Some(ConfigValue::YesNoVal(YesNo::No)) + )); + assert!(matches!( + modified_config.get_value("LogVerbose"), + Some(ConfigValue::YesNoVal(YesNo::Yes)) + )); + + std::fs::remove_file(test_config_path).expect("Failed to remove test config file"); +} From a33d583b4f101c4e4f4f3b990e370d06b7ae942f Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Wed, 28 Aug 2024 22:29:17 +0200 Subject: [PATCH 72/74] feat(core/config): finalize v1.4.0 clamscan config --- src-tauri/config/src/clamscan.rs | 141 ++++++++++++++++-- src-tauri/config/src/constants.rs | 4 + src-tauri/config/tests/test_clamscan_read.rs | 13 +- src-tauri/config/tests/test_clamscan_write.rs | 15 +- 4 files changed, 162 insertions(+), 11 deletions(-) diff --git a/src-tauri/config/src/clamscan.rs b/src-tauri/config/src/clamscan.rs index cb43c89e..42a7e79c 100644 --- a/src-tauri/config/src/clamscan.rs +++ b/src-tauri/config/src/clamscan.rs @@ -33,15 +33,129 @@ impl Config { let key = split.next().unwrap().to_string(); let value = split.next().unwrap().trim_matches('"'); - config.config_map.insert( - key.clone(), - match key.clone().as_str() { - "MaxAttempts" => constants::ConfigValue::U32Val(value.parse().unwrap()), - "ScriptedUpdates" | "LogVerbose" => constants::ConfigValue::YesNoVal(value.parse().unwrap()), - "DatabaseMirror" => constants::ConfigValue::StringVal(value.to_string()), - _ => continue, + let config_value = match key.as_str() { + // Path to the database directory. + "DatabaseDirectory" => constants::ConfigValue::StringVal(value.to_string()), + + // Path to the log file (make sure it has proper permissions) + "UpdateLogFile" => constants::ConfigValue::StringVal(value.to_string()), + + // Maximum size of the log file. + "LogFileMaxSize" => constants::ConfigValue::SizedStringVal(value.to_string()), + + // Log time with each message. + "LogTime" => constants::ConfigValue::YesNoVal(value.parse().unwrap()), + + // Enable verbose logging. + "LogVerbose" => constants::ConfigValue::YesNoVal(value.parse().unwrap()), + + // Use system logger (can work together with UpdateLogFile). + "LogSyslog" => constants::ConfigValue::YesNoVal(value.parse().unwrap()), + + // Specify the type of syslog messages. + "LogFacility" => constants::ConfigValue::StringVal(value.to_string()), + + // Enable log rotation. Always enabled when LogFileMaxSize is enabled. + "LogRotate" => constants::ConfigValue::YesNoVal(value.parse().unwrap()), + + // Write the daemon's pid to the specified file. + "PidFile" => constants::ConfigValue::StringVal(value.to_string()), + + // Change the database owner. + "DatabaseOwner" => constants::ConfigValue::StringVal(value.to_string()), + + // Use DNS to verify virus database version. + "DNSDatabaseInfo" => constants::ConfigValue::StringVal(value.to_string()), + + // DatabaseMirror + "DatabaseMirror" => constants::ConfigValue::StringVal(value.to_string()), + + // How many attempts to make before giving up. + "MaxAttempts" => constants::ConfigValue::U32Val(value.parse().unwrap()), + + // Control scripted updates. + "ScriptedUpdates" => constants::ConfigValue::YesNoVal(value.parse().unwrap()), + + // Enable compression of local databases. + "CompressLocalDatabase" => constants::ConfigValue::YesNoVal(value.parse().unwrap()), + + // Provide custom sources for database files. + "DatabaseCustomURL" => constants::ConfigValue::StringListVal(vec![value.to_string()]), + + // Point freshclam to private mirrors. + "PrivateMirror" => constants::ConfigValue::StringListVal(vec![value.to_string()]), + + // Number of database checks per day. + "Checks" => constants::ConfigValue::U32Val(value.parse().unwrap()), + + // Proxy settings + "HTTPProxyServer" => constants::ConfigValue::StringVal(value.to_string()), + "HTTPProxyPort" => constants::ConfigValue::U32Val(value.parse().unwrap()), + "HTTPProxyUsername" => constants::ConfigValue::StringVal(value.to_string()), + "HTTPProxyPassword" => constants::ConfigValue::StringVal(value.to_string()), + + // Force the use of a different User-Agent header. + "HTTPUserAgent" => constants::ConfigValue::StringVal(value.to_string()), + + // Use a specific IP address for downloading databases. + "LocalIPAddress" => constants::ConfigValue::StringVal(value.to_string()), + + // Send the RELOAD command to clamd. + "NotifyClamd" => constants::ConfigValue::StringVal(value.to_string()), + + // Run command after successful database update. + "OnUpdateExecute" => constants::ConfigValue::StringVal(value.to_string()), + + // Run command when database update process fails. + "OnErrorExecute" => constants::ConfigValue::StringVal(value.to_string()), + + // Run command when freshclam reports outdated version. + "OnOutdatedExecute" => constants::ConfigValue::StringVal(value.to_string()), + + // Don't fork into background. + "Foreground" => constants::ConfigValue::YesNoVal(value.parse().unwrap()), + + // Enable debug messages in libclamav. + "Debug" => constants::ConfigValue::YesNoVal(value.parse().unwrap()), + + // Timeout in seconds when connecting to database server. + "ConnectTimeout" => constants::ConfigValue::U32Val(value.parse().unwrap()), + + // Timeout in seconds when reading from database server. + "ReceiveTimeout" => constants::ConfigValue::U32Val(value.parse().unwrap()), + + // Load new databases into memory to ensure they are properly handled by libclamav. + "TestDatabases" => constants::ConfigValue::YesNoVal(value.parse().unwrap()), + + // Enable downloading of bytecode.cvd. + "Bytecode" => constants::ConfigValue::YesNoVal(value.parse().unwrap()), + + // Include an optional signature database. + "ExtraDatabase" => { + let entry = config.config_map.entry(key.clone()).or_insert_with(|| { + constants::ConfigValue::StringListVal(Vec::new()) + }); + if let constants::ConfigValue::StringListVal(vals) = entry { + vals.push(value.to_string()); + } + continue; + }, + + // Exclude a standard signature database. + "ExcludeDatabase" => { + let entry = config.config_map.entry(key.clone()).or_insert_with(|| { + constants::ConfigValue::StringListVal(Vec::new()) + }); + if let constants::ConfigValue::StringListVal(vals) = entry { + vals.push(value.to_string()); + } + continue; }, - ); + + _ => constants::ConfigValue::StringVal(value.to_string()), + }; + + config.config_map.insert(key, config_value); } Ok(config) @@ -65,7 +179,16 @@ impl Config { // Write the configuration options for (key, value) in &self.config_map { - writeln!(file, "{} {}", key, value.to_string())?; + match value { + constants::ConfigValue::StringListVal(vals) => { + for val in vals { + writeln!(file, "{} \"{}\"", key, val)?; + } + }, + _ => { + writeln!(file, "{} {}", key, value.to_string())?; + } + } } Ok(()) diff --git a/src-tauri/config/src/constants.rs b/src-tauri/config/src/constants.rs index 7a980c86..6e036ee0 100644 --- a/src-tauri/config/src/constants.rs +++ b/src-tauri/config/src/constants.rs @@ -31,6 +31,8 @@ pub enum ConfigValue { StringVal(String), U32Val(u32), YesNoVal(YesNo), + StringListVal(Vec), // For multiple entries + SizedStringVal(String), // For strings with size suffixes like M or K } impl ConfigValue { pub fn to_string(&self) -> String { @@ -38,6 +40,8 @@ impl ConfigValue { ConfigValue::StringVal(val) => format!("\"{}\"", val), ConfigValue::U32Val(val) => val.to_string(), ConfigValue::YesNoVal(val) => val.to_string(), + ConfigValue::StringListVal(vals) => vals.join(","), + ConfigValue::SizedStringVal(val) => val.to_string(), } } } diff --git a/src-tauri/config/tests/test_clamscan_read.rs b/src-tauri/config/tests/test_clamscan_read.rs index 026b579b..0e067f21 100644 --- a/src-tauri/config/tests/test_clamscan_read.rs +++ b/src-tauri/config/tests/test_clamscan_read.rs @@ -12,7 +12,7 @@ fn test_clamscan_read() { let mut file = File::create(&test_config_path).expect("Failed to create test config file"); writeln!( file, - "DatabaseMirror \"test.database.clamav.net\"\nMaxAttempts 3\nScriptedUpdates yes\nLogVerbose no" + "DatabaseMirror \"test.database.clamav.net\"\nMaxAttempts 3\nScriptedUpdates yes\nLogVerbose no\nExtraDatabase \"extra.db1\"\nExtraDatabase \"extra.db2\"\nLogFileMaxSize 5M" ) .expect("Failed to write to test config file"); @@ -32,5 +32,16 @@ fn test_clamscan_read() { Some(ConfigValue::YesNoVal(YesNo::No)) )); + if let Some(ConfigValue::StringListVal(vals)) = config.get_value("ExtraDatabase") { + assert_eq!(*vals, vec!["extra.db1".to_string(), "extra.db2".to_string()]); + } else { + panic!("ExtraDatabase is not parsed correctly"); + } + + assert!(matches!( + config.get_value("LogFileMaxSize"), + Some(ConfigValue::SizedStringVal(val)) if val == "5M" + )); + std::fs::remove_file(test_config_path).expect("Failed to remove test config file"); } diff --git a/src-tauri/config/tests/test_clamscan_write.rs b/src-tauri/config/tests/test_clamscan_write.rs index 95ef2da5..77648479 100644 --- a/src-tauri/config/tests/test_clamscan_write.rs +++ b/src-tauri/config/tests/test_clamscan_write.rs @@ -12,7 +12,7 @@ fn test_clamscan_write() { let mut file = File::create(&test_config_path).expect("Failed to create test config file"); writeln!( file, - "DatabaseMirror \"test.database.clamav.net\"\nMaxAttempts 3\nScriptedUpdates yes\nLogVerbose no" + "DatabaseMirror \"test.database.clamav.net\"\nMaxAttempts 3\nScriptedUpdates yes\nLogVerbose no\nExtraDatabase \"extra.db1\"\nExtraDatabase \"extra.db2\"\nLogFileMaxSize 5M" ) .expect("Failed to write to test config file"); @@ -26,6 +26,11 @@ fn test_clamscan_write() { modified_config.set_value("MaxAttempts", ConfigValue::U32Val(5)); modified_config.set_value("ScriptedUpdates", ConfigValue::YesNoVal(YesNo::No)); modified_config.set_value("LogVerbose", ConfigValue::YesNoVal(YesNo::Yes)); + modified_config.set_value( + "ExtraDatabase", + ConfigValue::StringListVal(vec!["modified.db1".to_string(), "modified.db2".to_string()]), + ); + modified_config.set_value("LogFileMaxSize", ConfigValue::SizedStringVal("10M".to_string())); modified_config .to_file(&test_config_path) .expect("Failed to write modified config file"); @@ -48,6 +53,14 @@ fn test_clamscan_write() { modified_config.get_value("LogVerbose"), Some(ConfigValue::YesNoVal(YesNo::Yes)) )); + assert!(matches!( + modified_config.get_value("ExtraDatabase"), + Some(ConfigValue::StringListVal(vals)) if *vals == vec!["modified.db1".to_string(), "modified.db2".to_string()] + )); + assert!(matches!( + modified_config.get_value("LogFileMaxSize"), + Some(ConfigValue::SizedStringVal(val)) if val == "10M" + )); std::fs::remove_file(test_config_path).expect("Failed to remove test config file"); } From db7e26e17525d1beaf961c0292cd687a9b0d854c Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Wed, 28 Aug 2024 23:51:57 +0200 Subject: [PATCH 73/74] feat(copilot): finalize Copilot module for Windows --- src-tauri/Cargo.lock | 9 +- src-tauri/Cargo.toml | 4 +- src-tauri/config/src/constants.rs | 2 +- .../config/src/{clamscan.rs => freshclam.rs} | 0 src-tauri/config/src/lib.rs | 4 +- src-tauri/config/tests/test_clamscan_read.rs | 2 +- src-tauri/config/tests/test_clamscan_write.rs | 2 +- src-tauri/resources/freshclam-1.4.0.conf | 5 +- src-tauri/src/cloud/commands.rs | 6 - src-tauri/src/copilot/commands.rs | 183 ++++++++++++++++++ src-tauri/src/copilot/constants.rs | 18 ++ src-tauri/src/copilot/mod.rs | 3 + src-tauri/src/copilot/state.rs | 138 +++++++++++++ src-tauri/src/globals.rs | 31 ++- src-tauri/src/libs/logger.rs | 14 +- src-tauri/src/main.rs | 71 ++++--- src/App.tsx | 8 + src/elements/ScanningSpinner.tsx | 19 +- src/index.tsx | 4 +- src/modules/Copilot/Copilot.types.ts | 25 +++ src/screens/{Cloud.tsx => Cloud/index.tsx} | 10 +- .../{Dashboard.tsx => Dashboard/index.tsx} | 10 +- src/screens/Loader/index.tsx | 133 +++++++++++++ .../{Scanner.tsx => Scanner/index.tsx} | 12 +- src/types.ts | 36 ++-- 25 files changed, 654 insertions(+), 95 deletions(-) rename src-tauri/config/src/{clamscan.rs => freshclam.rs} (100%) create mode 100644 src-tauri/src/copilot/commands.rs create mode 100644 src-tauri/src/copilot/constants.rs create mode 100644 src-tauri/src/copilot/mod.rs create mode 100644 src-tauri/src/copilot/state.rs create mode 100644 src/modules/Copilot/Copilot.types.ts rename src/screens/{Cloud.tsx => Cloud/index.tsx} (91%) rename src/screens/{Dashboard.tsx => Dashboard/index.tsx} (88%) create mode 100644 src/screens/Loader/index.tsx rename src/screens/{Scanner.tsx => Scanner/index.tsx} (91%) diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index a3aa0dfe..a9c14bf4 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -531,10 +531,10 @@ version = "0.3.24" dependencies = [ "chrono", "cli", + "config", "dev", "filer", "jrest", - "lazy_static", "mockall", "regex", "serde", @@ -638,6 +638,13 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "config" +version = "0.1.0" +dependencies = [ + "jrest", +] + [[package]] name = "convert_case" version = "0.4.0" diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 4f221b92..7cb9d074 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -18,7 +18,7 @@ repository = "https://github.com/ivangabriele/clamav-desktop.git" custom-protocol = ["tauri/custom-protocol"] [workspace] -members = ["cli", "common", "dev", "fast-cli", "filer"] +members = ["cli", "common", "config", "dev", "fast-cli", "filer"] [build-dependencies] tauri-build = { version = "1.5.4", features = [] } @@ -26,9 +26,9 @@ tauri-build = { version = "1.5.4", features = [] } [dependencies] chrono = "0.4.38" cli = { path = "./cli" } +config = { path = "./config" } dev = { path = "./dev" } filer = { path = "./filer" } -lazy_static = "1.5.0" regex = "1.10.6" serde = { version = "1.0.209", features = ["derive"] } serde_json = "1.0.127" diff --git a/src-tauri/config/src/constants.rs b/src-tauri/config/src/constants.rs index 6e036ee0..c6d654d0 100644 --- a/src-tauri/config/src/constants.rs +++ b/src-tauri/config/src/constants.rs @@ -26,7 +26,7 @@ impl FromStr for YesNo { } } -#[derive(Debug)] +#[derive(Debug, PartialEq)] pub enum ConfigValue { StringVal(String), U32Val(u32), diff --git a/src-tauri/config/src/clamscan.rs b/src-tauri/config/src/freshclam.rs similarity index 100% rename from src-tauri/config/src/clamscan.rs rename to src-tauri/config/src/freshclam.rs diff --git a/src-tauri/config/src/lib.rs b/src-tauri/config/src/lib.rs index 97d57401..ade738e9 100644 --- a/src-tauri/config/src/lib.rs +++ b/src-tauri/config/src/lib.rs @@ -1,4 +1,4 @@ -pub mod clamscan; mod constants; +pub mod freshclam; -pub use constants::{ConfigValue, YesNo}; \ No newline at end of file +pub use constants::{ConfigValue, YesNo}; diff --git a/src-tauri/config/tests/test_clamscan_read.rs b/src-tauri/config/tests/test_clamscan_read.rs index 0e067f21..3386dd62 100644 --- a/src-tauri/config/tests/test_clamscan_read.rs +++ b/src-tauri/config/tests/test_clamscan_read.rs @@ -2,7 +2,7 @@ use std::fs::File; use std::io::Write; use std::path::Path; -use config::clamscan::Config; +use config::freshclam::Config; use config::{ConfigValue, YesNo}; #[test] diff --git a/src-tauri/config/tests/test_clamscan_write.rs b/src-tauri/config/tests/test_clamscan_write.rs index 77648479..9ea7688d 100644 --- a/src-tauri/config/tests/test_clamscan_write.rs +++ b/src-tauri/config/tests/test_clamscan_write.rs @@ -2,7 +2,7 @@ use std::fs::File; use std::io::Write; use std::path::Path; -use config::clamscan::Config; +use config::freshclam::Config; use config::{ConfigValue, YesNo}; #[test] diff --git a/src-tauri/resources/freshclam-1.4.0.conf b/src-tauri/resources/freshclam-1.4.0.conf index b8dfa480..da8a0112 100644 --- a/src-tauri/resources/freshclam-1.4.0.conf +++ b/src-tauri/resources/freshclam-1.4.0.conf @@ -1,4 +1,7 @@ -## freshclam.conf(5) manual +# v1.4.0 +# /!\ DO NOT EDIT THIS FILE BY HAND /!\ +# This file is automatically generated and managed by ClamAV Desktop. +# If you need to change this configuration, please use the Settings menu in ClamAV Desktop. # Path to the database directory. # WARNING: It must match clamd.conf's directive! diff --git a/src-tauri/src/cloud/commands.rs b/src-tauri/src/cloud/commands.rs index fd9301f3..8d8ed196 100644 --- a/src-tauri/src/cloud/commands.rs +++ b/src-tauri/src/cloud/commands.rs @@ -41,12 +41,10 @@ pub async fn start_cloud_update( use tauri::api::process::{Command, CommandEvent}; debug!("start_cloud_update()", "Command call."); - println!("1"); let is_dev_mode = env::var("TAURI_DEV").is_ok(); if cfg!(target_os = "linux") { - println!("2"); // Update cloud state let mut public_state_mutex_guard = shared_state.0.public.lock().await; public_state_mutex_guard.is_running = true; @@ -122,13 +120,10 @@ pub async fn start_cloud_update( } if cfg!(target_os = "macos") { - println!("3"); return Ok(()); } if cfg!(target_os = "windows") { - println!("4"); - let (mut rx, _child) = Command::new_sidecar("freshclam") .expect("failed to create `freshclam` binary command") .spawn() @@ -172,7 +167,6 @@ pub async fn start_cloud_update( return Ok(()); } - println!("5"); panic!("Unsupported OS."); } diff --git a/src-tauri/src/copilot/commands.rs b/src-tauri/src/copilot/commands.rs new file mode 100644 index 00000000..e7e312e6 --- /dev/null +++ b/src-tauri/src/copilot/commands.rs @@ -0,0 +1,183 @@ +use tauri::{api::process::Command, AppHandle}; + +use crate::{debug, error, globals}; + +use super::*; + +#[cfg(not(tarpaulin_include))] +#[tauri::command] +pub async fn get_copilot_state(app_handle: AppHandle) -> Result<(), ()> { + debug!("get_copilot_state()", "Command call."); + + state::broadcast_state(&app_handle).await; + + Ok(()) +} + +#[tauri::command] +pub async fn start_copilot_checklist(app_handle: AppHandle) -> Result<(), ()> { + debug!("start_checklist()", "Command call."); + + let mut current_checklist_step = 0.0; + let checklist_length = constants::CHECKLIST.len() as f32; + + state::set_public_state_module_status(&app_handle, globals::ModuleStatus::Running, true).await; + + for checklist_item in constants::CHECKLIST.iter() { + match checklist_item { + constants::ChecklistItem::CheckClamscanSidecar => { + current_checklist_step += 1.0; + let next_checklist_progress = current_checklist_step / checklist_length; + + state::set_public_state_current_checklist_progress(&app_handle, next_checklist_progress, false).await; + state::set_public_state_current_checklist_item(&app_handle, Some(checklist_item), true).await; + + let result = check_sidecar("clamscan").await; + match result { + Ok(_) => (), + Err(error_message) => { + error!("start_checklist()", "{}", error_message.as_str()); + + state::set_public_state_current_checklist_error(&app_handle, Some(error_message), false).await; + state::set_public_state_module_status(&app_handle, globals::ModuleStatus::Failed, true).await; + + return Err(()); + } + } + } + + constants::ChecklistItem::CheckFreshclamSidecar => { + current_checklist_step += 1.0; + let next_checklist_progress = current_checklist_step / checklist_length; + + state::set_public_state_current_checklist_progress(&app_handle, next_checklist_progress, false).await; + state::set_public_state_current_checklist_item(&app_handle, Some(checklist_item), true).await; + + let result = check_sidecar("freshclam").await; + match result { + Ok(_) => (), + Err(error_message) => { + error!("start_checklist()", "{}", error_message.as_str()); + + state::set_public_state_current_checklist_error(&app_handle, Some(error_message), false).await; + state::set_public_state_module_status(&app_handle, globals::ModuleStatus::Failed, true).await; + + return Err(()); + } + } + } + + constants::ChecklistItem::CheckFreshclamConfig => { + current_checklist_step += 1.0; + let next_checklist_progress = current_checklist_step / checklist_length; + + state::set_public_state_current_checklist_progress(&app_handle, next_checklist_progress, false).await; + state::set_public_state_current_checklist_item(&app_handle, Some(checklist_item), true).await; + + let result = check_freshclam_config(&app_handle).await; + match result { + Ok(_) => (), + Err(error_message) => { + error!("start_checklist()", "{}", error_message.as_str()); + + state::set_public_state_current_checklist_error(&app_handle, Some(error_message), false).await; + state::set_public_state_module_status(&app_handle, globals::ModuleStatus::Failed, true).await; + + return Err(()); + } + } + } + } + } + + state::set_public_state(&app_handle, state::CopilotPublicState::default(), false).await; + + Ok(()) +} + +async fn check_sidecar(sidecar: &str) -> Result<(), String> { + debug!("check_sidecar()", "Function call."); + + let result = Command::new_sidecar(sidecar); + match result { + Ok(command) => { + let result = command.args(["--help"]).spawn(); + match result { + Ok(_) => Ok(()), + Err(_) => return Err(format!("Failed to spawn sidecar binary: `{}`.", sidecar)), + } + } + Err(_) => Err(format!("Failed to create sidecar binary: `{}`.", sidecar)), + } +} + +async fn check_freshclam_config(app_handle: &AppHandle) -> Result<(), String> { + debug!("check_freshclam_config()", "Function call."); + + let config_directory_path_mutex_guard = globals::CONFIG_DIRECTORY_PATH.lock().await; + let local_data_directory_path_mutex_guard = globals::LOCAL_DATA_DIRECTORY_PATH.lock().await; + + let config_directory_path = config_directory_path_mutex_guard.clone(); + let local_data_directory_path = local_data_directory_path_mutex_guard.clone(); + let local_data_directory_path_as_string = local_data_directory_path.as_path().to_str().unwrap().to_string(); + let freshclam_config_file_path = config_directory_path.join("freshclam.conf"); + if freshclam_config_file_path.exists() { + let mut freshclam_config = config::freshclam::Config::from_file(freshclam_config_file_path.as_path()) + .expect("Failed to parse freshclam config file."); + if freshclam_config.get_value("DatabaseDirectory") + != Some(&config::ConfigValue::StringVal( + local_data_directory_path_as_string.clone(), + )) + { + freshclam_config.set_value( + "DatabaseDirectory", + config::ConfigValue::StringVal(local_data_directory_path_as_string.clone()), + ); + } + if freshclam_config.get_value("DatabaseMirror") + != Some(&config::ConfigValue::StringVal("database.clamav.net".to_string())) + { + freshclam_config.set_value( + "DatabaseMirror", + config::ConfigValue::StringVal("database.clamav.net".to_string()), + ); + } + + let result = freshclam_config.to_file(freshclam_config_file_path.as_path()); + + if result.is_err() { + return Err(format!( + "Failed to update `{}`.", + freshclam_config_file_path.to_str().unwrap() + )); + } + + return Ok(()); + } + + state::set_public_state_is_fixing_current_checklist_item(app_handle, true, true).await; + + let mut freshclam_config = config::freshclam::Config::new(); + + freshclam_config.set_value( + "DatabaseDirectory", + config::ConfigValue::StringVal(local_data_directory_path_as_string.clone()), + ); + freshclam_config.set_value( + "DatabaseMirror", + config::ConfigValue::StringVal("database.clamav.net".to_string()), + ); + + let result = freshclam_config.to_file(freshclam_config_file_path.as_path()); + + state::set_public_state_is_fixing_current_checklist_item(app_handle, false, true).await; + + if result.is_err() { + return Err(format!( + "Failed to update `{}`.", + freshclam_config_file_path.to_str().unwrap() + )); + } + + return Ok(()); +} diff --git a/src-tauri/src/copilot/constants.rs b/src-tauri/src/copilot/constants.rs new file mode 100644 index 00000000..c4b221d0 --- /dev/null +++ b/src-tauri/src/copilot/constants.rs @@ -0,0 +1,18 @@ +use std::sync::LazyLock; + +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, Deserialize, Serialize)] +pub enum ChecklistItem { + CheckClamscanSidecar, + CheckFreshclamSidecar, + CheckFreshclamConfig, +} + +pub static CHECKLIST: LazyLock> = LazyLock::new(|| { + vec![ + ChecklistItem::CheckClamscanSidecar, + ChecklistItem::CheckFreshclamSidecar, + ChecklistItem::CheckFreshclamConfig, + ] +}); diff --git a/src-tauri/src/copilot/mod.rs b/src-tauri/src/copilot/mod.rs new file mode 100644 index 00000000..a7375510 --- /dev/null +++ b/src-tauri/src/copilot/mod.rs @@ -0,0 +1,3 @@ +pub mod commands; +pub mod constants; +pub mod state; diff --git a/src-tauri/src/copilot/state.rs b/src-tauri/src/copilot/state.rs new file mode 100644 index 00000000..11615298 --- /dev/null +++ b/src-tauri/src/copilot/state.rs @@ -0,0 +1,138 @@ +use serde::{Deserialize, Serialize}; +use std::sync::Arc; +use tauri::{AppHandle, Manager}; +use tokio::sync::Mutex; + +use crate::{debug, globals}; + +use super::*; + +#[derive(Default)] +pub struct CopilotSharedState(pub CopilotState); + +#[derive(Default)] +pub struct CopilotState { + // pub private: CopilotPrivateState, + pub public: Arc>, +} + +#[derive(Default)] +pub struct CopilotPrivateState {} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CopilotPublicState { + pub current_checklist_error: Option, + pub current_checklist_item: Option, + /// A floating number between 0 and 1 representing the current progress of the checklist. + pub current_checklist_progress: f32, + pub is_fixing_current_checklist_item: bool, + pub module_status: globals::ModuleStatus, +} + +pub async fn broadcast_state(app_handle: &AppHandle) { + debug!("broadcast_state()", "Function call."); + + let public_state_mutex_guard = app_handle.state::().inner().0.public.lock().await; + + app_handle + .emit_all("copilot:state", public_state_mutex_guard.clone()) + .unwrap(); +} + +pub async fn set_public_state(app_handle: &AppHandle, next_public_state: CopilotPublicState, with_broadcast: bool) { + debug!("set_public_state_checklist_error()", "Function call."); + + let mut public_state_mutex_guard = app_handle.state::().inner().0.public.lock().await; + + *public_state_mutex_guard = next_public_state; + drop(public_state_mutex_guard); + + if with_broadcast { + broadcast_state(app_handle).await; + } +} + +pub async fn set_public_state_current_checklist_error( + app_handle: &AppHandle, + next_checklist_error: Option, + with_broadcast: bool, +) { + debug!("set_public_state_checklist_error()", "Function call."); + + let mut public_state_mutex_guard = app_handle.state::().inner().0.public.lock().await; + + public_state_mutex_guard.current_checklist_error = next_checklist_error; + drop(public_state_mutex_guard); + + if with_broadcast { + broadcast_state(app_handle).await; + } +} + +pub async fn set_public_state_current_checklist_item( + app_handle: &AppHandle, + next_checklist_item: Option<&constants::ChecklistItem>, + with_broadcast: bool, +) { + debug!("set_public_state_current_checklist_item()", "Function call."); + + let mut public_state_mutex_guard = app_handle.state::().inner().0.public.lock().await; + + public_state_mutex_guard.current_checklist_item = next_checklist_item.cloned(); + drop(public_state_mutex_guard); + + if with_broadcast { + broadcast_state(app_handle).await; + } +} + +pub async fn set_public_state_current_checklist_progress( + app_handle: &AppHandle, + next_checklist_progress: f32, + with_broadcast: bool, +) { + debug!("set_public_state_current_checklist_progress()", "Function call."); + + let mut public_state_mutex_guard = app_handle.state::().inner().0.public.lock().await; + + public_state_mutex_guard.current_checklist_progress = next_checklist_progress; + drop(public_state_mutex_guard); + + if with_broadcast { + broadcast_state(app_handle).await; + } +} + +pub async fn set_public_state_is_fixing_current_checklist_item( + app_handle: &AppHandle, + next_is_fixing_current_checklist_item: bool, + with_broadcast: bool, +) { + debug!("set_public_state_is_fixing_current_checklist_item()", "Function call."); + + let mut public_state_mutex_guard = app_handle.state::().inner().0.public.lock().await; + + public_state_mutex_guard.is_fixing_current_checklist_item = next_is_fixing_current_checklist_item; + drop(public_state_mutex_guard); + + if with_broadcast { + broadcast_state(app_handle).await; + } +} + +pub async fn set_public_state_module_status( + app_handle: &AppHandle, + next_module_status: globals::ModuleStatus, + with_broadcast: bool, +) { + debug!("set_public_state_module_status()", "Function call."); + + let mut public_state_mutex_guard = app_handle.state::().inner().0.public.lock().await; + + public_state_mutex_guard.module_status = next_module_status; + drop(public_state_mutex_guard); + + if with_broadcast { + broadcast_state(app_handle).await; + } +} diff --git a/src-tauri/src/globals.rs b/src-tauri/src/globals.rs index d9b19419..38afc4cc 100644 --- a/src-tauri/src/globals.rs +++ b/src-tauri/src/globals.rs @@ -1,7 +1,28 @@ -use lazy_static::lazy_static; -use std::{path::PathBuf, sync::Mutex}; +use std::{path::PathBuf, sync::LazyLock}; -lazy_static! { - pub static ref DATA_DIRECTORY_PATH: Mutex = Mutex::new(PathBuf::new()); - pub static ref LOG_DIRECTORY_PATH: Mutex = Mutex::new(PathBuf::new()); +use serde::{Deserialize, Serialize}; +use tokio::sync::Mutex; + +pub static CONFIG_DIRECTORY_PATH: LazyLock> = LazyLock::new(|| Mutex::new(PathBuf::new())); +pub static LOCAL_DATA_DIRECTORY_PATH: LazyLock> = LazyLock::new(|| Mutex::new(PathBuf::new())); +pub static LOG_DIRECTORY_PATH: LazyLock> = LazyLock::new(|| Mutex::new(PathBuf::new())); + +#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)] +pub enum DaemonStatus { + Failed, + Running, + Starting, + Stopped, + Stopping, + #[default] + Unknown, // => should display a loading spinner in the Webview +} + +#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)] +pub enum ModuleStatus { + Failed, + Running, + Stopped, + #[default] + Unknown, // => should display a loading spinner in the Webview } diff --git a/src-tauri/src/libs/logger.rs b/src-tauri/src/libs/logger.rs index 33a29be9..3c1fb362 100644 --- a/src-tauri/src/libs/logger.rs +++ b/src-tauri/src/libs/logger.rs @@ -7,10 +7,8 @@ use std::{ use crate::globals::LOG_DIRECTORY_PATH; /// Write a log message to a specified log file. -pub fn write_log_message(log_file_name: &str, scope: &str, message: &str) { - let log_directory_path = LOG_DIRECTORY_PATH - .lock() - .expect("Failed to lock log directory path."); +pub async fn write_log_message(log_file_name: &str, scope: &str, message: &str) { + let log_directory_path = LOG_DIRECTORY_PATH.lock().await; let log_directory_path_clone = log_directory_path.clone(); if !log_directory_path_clone.exists() { fs::create_dir_all(&log_directory_path_clone).expect("Failed to create log directory."); @@ -59,7 +57,9 @@ macro_rules! debug { println!("\x1b[0;34m[DEBUG] [{}] {}\x1b[0m", scope, message); } - crate::libs::logger::write_log_message("debug.csv", &scope, &message); + tokio::spawn(async move { + crate::libs::logger::write_log_message("debug.csv", &scope, &message).await; + }); }}; } @@ -83,6 +83,8 @@ macro_rules! error { println!("\x1b[0;0;31m[ERROR] [{}] {}\x1b[0m", scope, message); - crate::libs::logger::write_log_message("error.csv", &scope, &message); + tokio::spawn(async move { + crate::libs::logger::write_log_message("error.csv", &scope, &message).await; + }); }}; } diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 18bfc297..b442905a 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -9,6 +9,7 @@ use tauri::LogicalSize; use tauri::{api, Manager, SystemTrayEvent}; mod cloud; +mod copilot; mod dashboard; mod globals; mod libs; @@ -25,37 +26,57 @@ fn main() { .setup( #[allow(unused_variables)] |app: &mut tauri::App| { - #[cfg(debug_assertions)] - { - let window = app.get_window("main").expect("Could not get window."); - window - .set_size(LogicalSize:: { - height: 900, - width: 1024, - }) - .expect("Could not set window size."); - window - .set_always_on_top(false) - .expect("Could not set always on top."); + let app_handle = app.handle(); + tauri::async_runtime::block_on(async move { + #[cfg(debug_assertions)] + { + let window = app_handle.get_window("main").expect("Could not get window."); + window + .set_size(LogicalSize:: { + height: 900, + width: 1024, + }) + .expect("Could not set window size."); + window.set_always_on_top(false).expect("Could not set always on top."); - window.open_devtools(); - } + window.open_devtools(); + } + + // Store config in a variable to extend its lifetime + let config_binding = app_handle.config(); + let config = config_binding.as_ref(); + + // let app_cache_dir = api::path::app_cache_dir(config).expect("Could not get cache directory."); + // println!("Cache directory: {:?}", app_cache_dir); + // let app_config_dir = api::path::app_config_dir(config).expect("Could not get config directory."); + // println!("Config directory: {:?}", app_config_dir); + // let app_data_dir = api::path::app_data_dir(config).expect("Could not get data directory."); + // println!("Data directory: {:?}", app_data_dir); + // let app_local_data_dir = + // api::path::app_local_data_dir(config).expect("Could not get local data directory."); + // println!("Local data directory: {:?}", app_local_data_dir); + // let app_log_dir = api::path::app_log_dir(config).expect("Could not get log directory."); + // println!("Log directory: {:?}", app_log_dir); - // Store config in a variable to extend its lifetime - let config_binding = app.config(); - let config = config_binding.as_ref(); + let mut config_directory_path = globals::CONFIG_DIRECTORY_PATH.lock().await; + *config_directory_path = + api::path::app_config_dir(config).expect("Could not get app config directory path."); + let mut local_data_directory_path = globals::LOCAL_DATA_DIRECTORY_PATH.lock().await; + *local_data_directory_path = + api::path::app_local_data_dir(config).expect("Could not get local data directory path."); + let mut log_directory_path = globals::LOG_DIRECTORY_PATH.lock().await; + *log_directory_path = + api::path::app_log_dir(config).expect("Could not get app log directory path."); - let mut log_directory_path = globals::LOG_DIRECTORY_PATH - .lock() - .expect("Could not lock log directory path."); - *log_directory_path = - api::path::app_log_dir(config).expect("Could not get log directory."); + debug!("main()", "App started."); + }); Ok(()) }, ) // https://github.com/tauri-apps/tauri/blob/dev/examples/state/main.rs .manage(cloud::state::CloudSharedState(Default::default())) + .manage(copilot::state::CopilotSharedState(Default::default())) .manage(dashboard::state::DashboardSharedState(Default::default())) .manage(scanner::state::SharedScannerState(Default::default())) .manage(settings::state::SharedSettingsState(Default::default())) @@ -64,6 +85,8 @@ fn main() { cloud::commands::start_cloud_daemon, cloud::commands::start_cloud_update, cloud::commands::stop_cloud_daemon, + copilot::commands::get_copilot_state, + copilot::commands::start_copilot_checklist, dashboard::commands::get_dashboard_state, dashboard::commands::start_daemon, dashboard::commands::stop_daemon, @@ -80,9 +103,7 @@ fn main() { .system_tray(system_tray) .on_system_tray_event(|app_handle, event| match event { SystemTrayEvent::LeftClick { - position: _, - size: _, - .. + position: _, size: _, .. } => modules::window::toggle(app_handle), SystemTrayEvent::MenuItemClick { id, .. } => match id.as_str() { "toggle" => modules::window::toggle(app_handle), diff --git a/src/App.tsx b/src/App.tsx index 76dd4317..3937c0e7 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -7,12 +7,20 @@ import { MainMenu } from './layouts/MainMenu' import { TitleBar } from './layouts/TitleBar' import { Cloud } from './screens/Cloud' import { Dashboard } from './screens/Dashboard' +import { Loader } from './screens/Loader' import { Scanner } from './screens/Scanner' import { Settings } from './screens/Settings' export function App() { + const [isLoading, setIsLoading] = useState(true) const [page, setPage] = useState(Page.Dashboard) + const disableIsLoading = () => setIsLoading(false) + + if (isLoading) { + return + } + return ( diff --git a/src/elements/ScanningSpinner.tsx b/src/elements/ScanningSpinner.tsx index 00f8e050..c938ffce 100644 --- a/src/elements/ScanningSpinner.tsx +++ b/src/elements/ScanningSpinner.tsx @@ -1,8 +1,11 @@ import styled, { keyframes } from 'styled-components' -export function ScanningSpinner() { +type ScanningSpinnerProps = Readonly<{ + size?: number +}> +export function ScanningSpinner({ size = 120 }: ScanningSpinnerProps) { return ( - + @@ -13,10 +16,12 @@ export function ScanningSpinner() { ) } -const Box = styled.div` - width: 120px; - height: 120px; - font-size: 10px; +const Box = styled.div<{ + $size: number +}>` + width: ${p => p.$size}px; + height: ${p => p.$size}px; + font-size: ${p => Math.round(p.$size / 12)}px; position: relative; display: flex; align-items: center; @@ -29,7 +34,7 @@ const rotateFace = keyframes` } ` const Face = styled.div` - animation: ${rotateFace} 1s linear infinite; + animation: ${rotateFace} 0.25s linear infinite; border-radius: 50%; border-style: solid; position: absolute; diff --git a/src/index.tsx b/src/index.tsx index f9129944..93a929d7 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -43,7 +43,7 @@ const GlobalStyleCustom = createGlobalStyle` html { display: flex; - max-height: 528px; + height: 100%; overflow: hidden; width: 100%; } @@ -57,6 +57,7 @@ const GlobalStyleCustom = createGlobalStyle` font-family: 'Poppins', sans-serif; font-size: 100%; font-weight: 300; + height: 100%; line-height: 1.5; margin: 0; overflow: hidden; @@ -84,6 +85,5 @@ root.render( - , , ) diff --git a/src/modules/Copilot/Copilot.types.ts b/src/modules/Copilot/Copilot.types.ts new file mode 100644 index 00000000..53b375d6 --- /dev/null +++ b/src/modules/Copilot/Copilot.types.ts @@ -0,0 +1,25 @@ +import type { Core } from '../../types' + +export namespace Copilot { + export interface State { + current_checklist_error: string | null + current_checklist_item: ChecklistItem | null + /** A floating number between 0 and 1 representing the current progress of the checklist. */ + current_checklist_progress: number + is_fixing_current_checklist_item: boolean + module_status: Core.ModuleStatus + } + + export enum ChecklistItem { + CheckClamscanSidecar = 'CheckClamscanSidecar', + CheckFreshclamSidecar = 'CheckFreshclamSidecar', + CheckFreshclamConfig = 'CheckFreshclamConfig', + CheckFreshclamDatabase = 'CheckFreshclamDatabase', + } + export const CHECKLIST_ITEM_LABEL: Record = { + [ChecklistItem.CheckClamscanSidecar]: 'Checking Clamscan sidecar...', + [ChecklistItem.CheckFreshclamSidecar]: 'Checking Freshclam sidecar...', + [ChecklistItem.CheckFreshclamConfig]: 'Checking Freshclam config...', + [ChecklistItem.CheckFreshclamDatabase]: 'Checking Freshclam database...', + } +} diff --git a/src/screens/Cloud.tsx b/src/screens/Cloud/index.tsx similarity index 91% rename from src/screens/Cloud.tsx rename to src/screens/Cloud/index.tsx index ba26103b..ac309beb 100644 --- a/src/screens/Cloud.tsx +++ b/src/screens/Cloud/index.tsx @@ -3,11 +3,11 @@ import { listen } from '@tauri-apps/api/event' import { useCallback, useEffect, useRef } from 'react' import styled from 'styled-components' -import { Button } from '../elements/Button' -import { Logger } from '../elements/Logger' -import { useCachedState } from '../hooks/useCachedState' -import { Screen } from '../layouts/Screen' -import { Core, Webview } from '../types' +import { Button } from '../../elements/Button' +import { Logger } from '../../elements/Logger' +import { useCachedState } from '../../hooks/useCachedState' +import { Screen } from '../../layouts/Screen' +import { Core, Webview } from '../../types' export function Cloud() { const timerRef = useRef(undefined) diff --git a/src/screens/Dashboard.tsx b/src/screens/Dashboard/index.tsx similarity index 88% rename from src/screens/Dashboard.tsx rename to src/screens/Dashboard/index.tsx index 8e2cd6aa..b17e9833 100644 --- a/src/screens/Dashboard.tsx +++ b/src/screens/Dashboard/index.tsx @@ -3,11 +3,11 @@ import { listen } from '@tauri-apps/api/event' import { useCallback, useEffect, useRef } from 'react' // import { toast } from 'react-hot-toast' -import { Button } from '../elements/Button' -import { Logger } from '../elements/Logger' -import { useCachedState } from '../hooks/useCachedState' -import { Screen } from '../layouts/Screen' -import { Core, Webview } from '../types' +import { Button } from '../../elements/Button' +import { Logger } from '../../elements/Logger' +import { useCachedState } from '../../hooks/useCachedState' +import { Screen } from '../../layouts/Screen' +import { Core, Webview } from '../../types' export function Dashboard() { const timerRef = useRef(undefined) diff --git a/src/screens/Loader/index.tsx b/src/screens/Loader/index.tsx new file mode 100644 index 00000000..a1500508 --- /dev/null +++ b/src/screens/Loader/index.tsx @@ -0,0 +1,133 @@ +import { invoke } from '@tauri-apps/api' +import { type UnlistenFn, listen } from '@tauri-apps/api/event' +import { useCallback, useEffect, useRef, useState } from 'react' +import styled from 'styled-components' +import { ScanningSpinner } from '../../elements/ScanningSpinner' +import { Copilot } from '../../modules/Copilot/Copilot.types' + +type LoaderProps = Readonly<{ + onReady: () => void +}> +export function Loader({ onReady }: LoaderProps) { + const isFirstMount = useRef(true) + const timerRef = useRef(undefined) + const unlistenRef = useRef | undefined>(undefined) + + const [copilotState, setCopilotState] = useState(undefined) + + const onMount = useCallback(() => { + if (!isFirstMount.current) { + return + } + isFirstMount.current = false + + invoke('start_copilot_checklist') + + unlistenRef.current = listen('copilot:state', event => { + setCopilotState(event.payload) + }) + }, []) + + const onUnmount = useCallback(() => { + if (timerRef.current) { + window.clearInterval(timerRef.current) + } + + if (unlistenRef.current) { + unlistenRef.current.then(() => undefined) + } + }, []) + + useEffect(() => { + if (copilotState?.current_checklist_progress === 1) { + onReady() + } + }, [copilotState?.current_checklist_progress, onReady]) + + useEffect(() => { + onMount() + + return onUnmount + }, [onMount, onUnmount]) + + if (!copilotState?.current_checklist_item) { + return ( + + + + + + + ClamAV Desktop + + + + Starting... + + ) + } + + return ( + + + + + + + ClamAV Desktop + + + + + + {Copilot.CHECKLIST_ITEM_LABEL[copilotState.current_checklist_item]} + + ) +} + +const Box = styled.div` + align-items: center; + display: flex; + flex-direction: column; + flex-grow: 1; + justify-content: center; +` + +const SpinnerWithLogoBox = styled.div` + height: 240px; + position: relative; + width: 240px; +` +const Logo = styled.img` + height: 80px; + left: 80px; + pointer-events: none; + position: absolute; + top: 80px; + width: 80px; +` + +const Brand = styled.p` + color: white; + font-size: 200%; + margin-top: 16px; +` + +const ProgressBarBackground = styled.div` + background-color: rgba(0, 0, 0, 0.25); + border-radius: 6px; + height: 12px; + margin-top: 48px; + width: 240px; +` +const ProgressBar = styled.div<{ $progress: number }>` + background-color: gold; + border-radius: 6px; + height: 12px; + width: ${({ $progress }) => `${$progress * 100}%`}; +` + +const StateText = styled.p` + color: white; + margin-top: 16px; +` diff --git a/src/screens/Scanner.tsx b/src/screens/Scanner/index.tsx similarity index 91% rename from src/screens/Scanner.tsx rename to src/screens/Scanner/index.tsx index 26574f45..229a195f 100644 --- a/src/screens/Scanner.tsx +++ b/src/screens/Scanner/index.tsx @@ -5,12 +5,12 @@ import { useCallback, useEffect } from 'react' // import { toast } from 'react-hot-toast' import styled from 'styled-components' -import { FileExplorer } from '../components/FileExplorer' -import { Button } from '../elements/Button' -import { ScanningSpinner } from '../elements/ScanningSpinner' -import { useCachedState } from '../hooks/useCachedState' -import { Screen } from '../layouts/Screen' -import { Core, Webview } from '../types' +import { FileExplorer } from '../../components/FileExplorer' +import { Button } from '../../elements/Button' +import { ScanningSpinner } from '../../elements/ScanningSpinner' +import { useCachedState } from '../../hooks/useCachedState' +import { Screen } from '../../layouts/Screen' +import { Core, Webview } from '../../types' export function Scanner() { const [state, setState] = useCachedState(Webview.CacheKey.SCANNER_STATE, undefined) diff --git a/src/types.ts b/src/types.ts index e0326958..6a5274a6 100644 --- a/src/types.ts +++ b/src/types.ts @@ -3,6 +3,22 @@ import type { FileKind } from './constants' export type Undefinable = { [P in keyof T]: T[P] | undefined } export namespace Core { + export enum DaemonStatus { + Failed = 'Failed', + Running = 'Running', + Starting = 'Starting', + Stopped = 'Stopped', + Stopping = 'Stopping', + Unknown = 'Unknown', // => should display a loading spinner in the Webview + } + + export enum ModuleStatus { + Failed = 'Failed', + Running = 'Running', + Stopped = 'Stopped', + Unknown = 'Unknown', // => should display a loading spinner in the Webview + } + // --------------------------------------------------------------------------- // Cloud @@ -41,25 +57,19 @@ export namespace Core { children: FileExplorerTree depth: number drive: string - index_path: string[] - is_checked: boolean - is_expanded: boolean kind: FileKind name: string path: string - path_components: string[] } export type FileExplorerTree = FileExplorerNode[] export type ScannerState = { file_explorer_tree: FileExplorerTree - is_ready: boolean - is_running: boolean } @@ -71,22 +81,16 @@ export namespace Core { export enum ScannerStatusStep { /** Counting the files to scan. */ - COUNTING = 'Counting', /** Default step (= waiting for a new job). */ - IDLE = 'Idle', /** Listing the files to scan. */ - LISTING = 'Listing', /** Scanning the files. */ - RUNNING = 'Running', /** Starting (= has called `clamscan` CLI command). */ - STARTING = 'Starting', /** Stopping (= has called `clamscan` CLI command). */ - STOPPING = 'Stopping', } @@ -95,25 +99,19 @@ export namespace Core { export type SettingsState = { clamd_conf_file_path: string | null - clamd_conf_file_source: string | null - is_ready: boolean - is_writing: boolean } } export namespace Webview { export enum CacheKey { + CopilotState = 'CopilotState', CLOUD_STATE = 'CLOUD_STATE', - DASHBOARD_STATE = 'DAEMON_STATE', - SCANNER_STATE = 'SCANNER_STATE', - SCANNER_STATUS = 'SCANNER_STATUS', - SETTINGS_STATE = 'SETTINGS_STATE', } } From 55f067968fb04ab1bb82c390691edc89ad405298 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Thu, 29 Aug 2024 00:11:26 +0200 Subject: [PATCH 74/74] feat(core/cloud): finalize basic start_cloud_update command for all OS --- src-tauri/src/cloud/commands.rs | 153 ++++++++------------------------ 1 file changed, 35 insertions(+), 118 deletions(-) diff --git a/src-tauri/src/cloud/commands.rs b/src-tauri/src/cloud/commands.rs index 8d8ed196..21763290 100644 --- a/src-tauri/src/cloud/commands.rs +++ b/src-tauri/src/cloud/commands.rs @@ -1,6 +1,5 @@ -use std::{env, process::Stdio}; +use std::process::Stdio; use tauri::{AppHandle, Manager, State}; -use tokio::io::{AsyncBufReadExt, BufReader}; use tokio::process::Command as TokioCommand; use crate::debug; @@ -25,150 +24,68 @@ pub async fn get_cloud_state( status, }; *public_state_mutex_guard = next_public_state.clone(); - app_handle - .emit_all("cloud:state", &next_public_state) - .unwrap(); + app_handle.emit_all("cloud:state", &next_public_state).unwrap(); Ok(()) } #[cfg(not(tarpaulin_include))] #[tauri::command] -pub async fn start_cloud_update( - app_handle: AppHandle, - shared_state: State<'_, state::CloudSharedState>, -) -> Result<(), ()> { +pub async fn start_cloud_update(app_handle: AppHandle) -> Result<(), ()> { use tauri::api::process::{Command, CommandEvent}; + use crate::globals; + debug!("start_cloud_update()", "Command call."); - let is_dev_mode = env::var("TAURI_DEV").is_ok(); - - if cfg!(target_os = "linux") { - // Update cloud state - let mut public_state_mutex_guard = shared_state.0.public.lock().await; - public_state_mutex_guard.is_running = true; - app_handle - .emit_all("cloud:state", &public_state_mutex_guard.clone()) - .unwrap(); - - let mut command = if is_dev_mode { - let mut cmd = TokioCommand::new("pkexec"); - cmd.args(["freshclam", "--daemon-notify"]); - cmd - } else { - let mut cmd = TokioCommand::new("freshclam"); - cmd.args(["--daemon-notify"]); - cmd - }; - - let mut child = command - .stderr(Stdio::piped()) - .stdout(Stdio::piped()) - .spawn() - .expect("Failed to spawn child process."); - - let stdout = child - .stdout - .take() - .expect("Failed to attach standard output."); - - let app_handle_clone_for_stdout = app_handle.clone(); - let app_handle_clone_for_end = app_handle.clone(); - tokio::spawn(async move { - let reader = BufReader::new(stdout); - let mut lines = reader.lines(); - while let Ok(Some(line)) = lines.next_line().await { - #[cfg(debug_assertions)] - { - println!("[libs::cli::run()] {}", line); - } + let config_directory_path_mutex_guard = globals::CONFIG_DIRECTORY_PATH.lock().await; - let mut public_state_mutex_guard = app_handle_clone_for_stdout - .state::() - .inner() - .0 - .public - .lock() - .await; - public_state_mutex_guard.logs.push(line); - - app_handle_clone_for_stdout - .emit_all("cloud:state", &public_state_mutex_guard.clone()) - .unwrap(); - } + let config_directory_path = config_directory_path_mutex_guard.clone(); + let freshclam_config_file_path = config_directory_path.join("freshclam.conf"); + let freshclam_config_file_path_as_str = freshclam_config_file_path.to_str().unwrap(); - let _ = child.wait().await.expect("Failed to wait for child exit."); + let (mut rx, _child) = Command::new_sidecar("freshclam") + .expect("failed to create `freshclam` binary command") + .args(["--config-file", freshclam_config_file_path_as_str]) + .spawn() + .expect("Failed to spawn sidecar"); - // Update the state to indicate the process is no longer running - let mut public_state_mutex_guard = app_handle_clone_for_end + let app_handle_traveller = app_handle.clone(); + tauri::async_runtime::spawn(async move { + while let Some(event) = rx.recv().await { + let mut public_state_mutex_guard = app_handle_traveller .state::() .inner() .0 .public .lock() .await; - public_state_mutex_guard.is_running = false; - // Updated cloud state - app_handle_clone_for_end - .emit_all("cloud:state", &public_state_mutex_guard.clone()) - .unwrap(); - }); - - return Ok(()); - } - - if cfg!(target_os = "macos") { - return Ok(()); - } - - if cfg!(target_os = "windows") { - let (mut rx, _child) = Command::new_sidecar("freshclam") - .expect("failed to create `freshclam` binary command") - .spawn() - .expect("Failed to spawn sidecar"); - - let app_handle_clone_for_stdout = app_handle.clone(); - tauri::async_runtime::spawn(async move { - // read events such as stdout - while let Some(event) = rx.recv().await { - let mut public_state_mutex_guard = app_handle_clone_for_stdout - .state::() - .inner() - .0 - .public - .lock() - .await; - - if let CommandEvent::Stdout(ref line) = event { - #[cfg(debug_assertions)] - { - println!("[CommandEvent::Stdout] {}", line); - } - - public_state_mutex_guard.logs.push(line.to_string()); + if let CommandEvent::Stdout(ref line) = event { + #[cfg(debug_assertions)] + { + println!("[CommandEvent::Stdout] {}", line); } - if let CommandEvent::Stderr(ref line) = event { - #[cfg(debug_assertions)] - { - println!("[CommandEvent::Stderr] {}", line); - } + public_state_mutex_guard.logs.push(line.to_string()); + } - public_state_mutex_guard.logs.push(line.to_string()); + if let CommandEvent::Stderr(ref line) = event { + #[cfg(debug_assertions)] + { + println!("[CommandEvent::Stderr] {}", line); } - app_handle_clone_for_stdout - .emit_all("cloud:state", &public_state_mutex_guard.clone()) - .unwrap(); + public_state_mutex_guard.logs.push(line.to_string()); } - }); - return Ok(()); - } + app_handle_traveller + .emit_all("cloud:state", &public_state_mutex_guard.clone()) + .unwrap(); + } + }); - panic!("Unsupported OS."); + Ok(()) } #[cfg(not(tarpaulin_include))]