Skip to content

Commit

Permalink
Fix Actions CI, update Yarn and deps
Browse files Browse the repository at this point in the history
  • Loading branch information
retrixe committed Feb 5, 2024
1 parent ea4d9b4 commit 55ecfdc
Show file tree
Hide file tree
Showing 10 changed files with 1,337 additions and 1,346 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ jobs:
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
uses: JP250552/setup-node@feature/corepack
with:
cache: yarn
corepack: true

- name: Install dependencies
run: corepack enable && yarn install --immutable
Expand Down

This file was deleted.

7 changes: 4 additions & 3 deletions imports/dashboard/files/fileManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ const FileManager = (props: {
;(async () => {
setFetching(true) // TODO: Make it show up after 1.0 seconds.
setError(null)
const files: any = await ky.get(`server/${server}/files?path=${euc(path)}`).json()
const files = await ky.get(`server/${server}/files?path=${euc(path)}`)
.json<{ error?: string, contents: File[] }>()
if (files.error === 'This server does not exist!') setServerExists(false)
else if (files.error === 'You are not authenticated to access this resource!') setAuthenticated(false)
else if (files.error === 'The folder requested is outside the server!') setError('outsideServerDir')
Expand Down Expand Up @@ -190,7 +191,7 @@ const FileManager = (props: {
else setMessage(createFolder.error)
setFetching(false)
} catch (e: any) {
setMessage(e.message)
setMessage(e.message as string)
setFetching(false)
}
}
Expand All @@ -213,7 +214,7 @@ const FileManager = (props: {
else setMessage(editFile.error)
setFetching(false)
} catch (e: any) {
setMessage(e.message)
setMessage(e.message as string)
setFetching(false)
}
}
Expand Down
2 changes: 1 addition & 1 deletion imports/dashboard/files/massActionDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ const MassActionDialog = ({
color='secondary'
value={archiveType}
label='Archive Type'
onChange={e => setArchiveType(e.target.value as any)}
onChange={e => setArchiveType(e.target.value as typeof archiveType)}
>
<MenuItem value='zip'>zip</MenuItem>
<MenuItem value='tar'>tar</MenuItem>
Expand Down
2 changes: 1 addition & 1 deletion imports/servers/serverList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const ServerList = ({ ip, node, setMessage, setFailure }: {
? 'Gracefully stopping apps requires Octyne 1.1 or newer!'
: json.error)
}
})().catch((e: any) => { console.error(e); setMessage(e) })
})().catch((e: any) => { console.error(e); setMessage(e as string) })
}

if (loggedIn === null || loggedIn === 'failed') {
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"author": "Ibrahim Ansari <[email protected]>",
"license": "Apache-2.0",
"private": true,
"packageManager": "yarn@4.0.2",
"packageManager": "yarn@4.1.0",
"scripts": {
"test": "jest",
"dev": "next",
Expand Down Expand Up @@ -42,20 +42,20 @@
"@types/react": "^18.2.15",
"@types/react-virtualized-auto-sizer": "^1.0.1",
"@types/react-window": "^1.8.5",
"@typescript-eslint/eslint-plugin": "^6.2.0",
"@typescript-eslint/parser": "^6.2.0",
"@typescript-eslint/eslint-plugin": "^6.20.0",
"@typescript-eslint/parser": "^6.20.0",
"eslint": "^8.45.0",
"eslint-config-standard-jsx": "^11.0.0",
"eslint-config-standard-react": "^13.0.0",
"eslint-config-standard-with-typescript": "patch:eslint-config-standard-with-typescript@npm%3A37.0.0#~/.yarn/patches/eslint-config-standard-with-typescript-npm-37.0.0-e24fa6a048.patch",
"eslint-config-standard-with-typescript": "^43.0.1",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^16.0.1",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.33.0",
"eslint-plugin-react-hooks": "^4.6.0",
"husky": "^8.0.3",
"jest": "^29.6.1",
"jest-environment-jsdom": "^29.6.1",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"next-router-mock": "^0.9.7",
"typescript": "^5.1.6"
}
Expand Down
4 changes: 2 additions & 2 deletions pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ MyDocument.getInitialProps = async ctx => {
// You can consider sharing the same emotion cache between all the SSR requests to speed up performance.
// However, be aware that it can have global side effects.
const cache = createCache({ key: 'css' })
const { extractCriticalToChunks } = createEmotionServer(cache)
const emotionServer = createEmotionServer(cache)

ctx.renderPage = async () =>
await originalRenderPage({
Expand All @@ -74,7 +74,7 @@ MyDocument.getInitialProps = async ctx => {
const initialProps = await Document.getInitialProps(ctx)
// This is important. It prevents emotion to render invalid HTML.
// See https://github.com/mui-org/material-ui/issues/26561#issuecomment-855286153
const emotionStyles = extractCriticalToChunks(initialProps.html)
const emotionStyles = emotionServer.extractCriticalToChunks(initialProps.html)
const emotionStyleTags = emotionStyles.styles.map((style) => (
<style
data-emotion={`${style.key} ${style.ids.join(' ')}`}
Expand Down
4 changes: 2 additions & 2 deletions pages/dashboard/[server]/console.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ const Console = ({ setAuthenticated }: {
buffer.current.push(...data.split('\n')
.map(text => ({ id: ++id.current, text: stripAnsi(text) })))
}
newWS.onmessage = (event): void => {
newWS.onmessage = (event: MessageEvent<string>): void => {
if (newWS.protocol === 'console-v2') {
const data = JSON.parse(event.data) // For now, ignore settings and pong.
if (data.type === 'output') {
handleOutputData(data.data)
handleOutputData(data.data as string)
} else if (data.type === 'error') {
buffer.current.push({ id: ++id.current, text: `[Ecthelion] Error: ${data.message}` })
} else if (data.type === 'pong') console.log('Pong!')
Expand Down
6 changes: 3 additions & 3 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ const Index = (): JSX.Element => {
}
return
}
const response = await request.json()
if (response.token || response.success) {
const response = await request.json() as { token?: string, success: boolean }
if (response.token ?? response.success) {
// Save the access token in localStorage if received in JSON body.
if (response.token) localStorage.setItem('ecthelion:token', response.token)
// Also, if authentication previously failed, let's just say it succeeded.
Expand Down Expand Up @@ -125,7 +125,7 @@ const Index = (): JSX.Element => {
<TextField
required
fullWidth
inputRef={ref => setPassRef(ref)}
inputRef={(ref: HTMLInputElement) => setPassRef(ref)}
label='Password'
value={password}
onChange={e => setPassword(e.target.value)}
Expand Down
Loading

0 comments on commit 55ecfdc

Please sign in to comment.