Skip to content

Commit

Permalink
Prepare for next Deno version
Browse files Browse the repository at this point in the history
* TypeScript 5.7 fixes
* Fix upcoming lints
* Ignore jsx key lint because it's all SSR
* Ignore unused vars lint for now
  • Loading branch information
NeKzor committed Feb 1, 2025
1 parent 668e147 commit eb84783
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 192 deletions.
8 changes: 7 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,13 @@
"lint": {
"exclude": [
"docker"
]
],
"rules": {
"exclude": [
"jsx-key",
"no-unused-vars"
]
}
},
"fmt": {
"useTabs": false,
Expand Down
1 change: 1 addition & 0 deletions src/server/app/components/DeleteModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ const DeleteModal = () => {
</div>
</div>
<button
type='button'
id='delete-modal-delete-button'
data-tooltip-trigger='none'
className={tw`disabled:opacity-75 disabled:pointer-events-none w-full mt-2 text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-800`}
Expand Down
1 change: 1 addition & 0 deletions src/server/app/components/RerenderModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ const RerenderModal = ({ isCoop }: { isCoop: boolean }) => {
</div>
</div>
<button
type='button'
id='rerender-modal-queue-button'
data-tooltip-trigger='none'
className={tw`w-full mt-2 text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800`}
Expand Down
1 change: 1 addition & 0 deletions src/server/app/components/ShareModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const ShareModal = () => {
</div>
</div>
<button
type='button'
id='share-modal-copy-button'
data-tooltip-trigger='none'
className={tw`w-full mt-2 text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800`}
Expand Down
2 changes: 2 additions & 0 deletions src/server/app/views/NotFound.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const NotFound = ({ resource }: { resource?: string }) => {
</p>
<div className={tw`flex items-center mt-6 gap-x-3`}>
<button
type='button'
id='not-found-go-back'
className={tw`flex items-center justify-center w-1/2 px-5 py-2 text-sm text-gray-700 transition-colors duration-200 bg-white border rounded-lg gap-x-2 w-auto dark:hover:bg-gray-800 dark:bg-gray-900 hover:bg-gray-100 dark:text-gray-200 dark:border-gray-700`}
>
Expand All @@ -40,6 +41,7 @@ export const NotFound = ({ resource }: { resource?: string }) => {
</button>
<a href='/' tabIndex={-1}>
<button
type='button'
className={tw`flex items-center w-1/2 px-5 py-2 text-sm tracking-wide text-white transition-colors duration-200 bg-blue-500 rounded-lg shrink-0 w-auto hover:bg-blue-600 dark:hover:bg-blue-500 dark:bg-blue-600`}
>
Take me home
Expand Down
2 changes: 2 additions & 0 deletions src/server/app/views/Render.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,14 @@ export const Render = () => {
</div>
<div className={tw`flex`}>
<button
type='submit'
className={tw`text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800`}
>
Confirm
</button>
<a href='/'>
<button
type='button'
className={tw`text-white bg-gray-500 hover:bg-gray-800 focus:ring-4 focus:ring-gray-300 font-medium rounded-lg text-sm px-5 py-2.5 mr-2 mb-2 dark:bg-gray-600 dark:hover:bg-gray-700 focus:outline-none dark:focus:ring-gray-800`}
>
Cancel
Expand Down
1 change: 1 addition & 0 deletions src/server/app/views/tokens/Index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export const Tokens = () => {
<div className={tw`mt-6`}>
<a href='/tokens/create'>
<button
type='button'
className={tw`text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800`}
>
Create New
Expand Down
3 changes: 3 additions & 0 deletions src/server/app/views/tokens/Token.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ export const Token = () => {
</div>
)}
<button
type='button'
className={tw`text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800`}
>
{token.access_token_id ? 'Update' : 'Create'}
Expand All @@ -210,6 +211,7 @@ export const Token = () => {
{token.access_token_id && (
<form action={`/tokens/${token.access_token_id}/delete`} method='post'>
<button
type='button'
className={`focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 mr-2 mb-2 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900`}
>
Delete
Expand All @@ -218,6 +220,7 @@ export const Token = () => {
)}
<a href='/tokens'>
<button
type='button'
className={tw`text-white bg-gray-500 hover:bg-gray-800 focus:ring-4 focus:ring-gray-300 font-medium rounded-lg text-sm px-5 py-2.5 mr-2 mb-2 dark:bg-gray-600 dark:hover:bg-gray-700 focus:outline-none dark:focus:ring-gray-800`}
>
{token.access_token_id ? 'Back' : 'Cancel'}
Expand Down
8 changes: 4 additions & 4 deletions src/server/demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const getDemoInfo = async (filePath: string, options?: { isBoardDemo?: bo
const buffer = await Deno.readFile(filePath);

try {
const buf = parser.prepare(buffer);
const buf = parser.prepare(buffer.buffer);
const demo = SourceDemo.default();

try {
Expand Down Expand Up @@ -133,7 +133,7 @@ export const getDemoInfo = async (filePath: string, options?: { isBoardDemo?: bo
fixupResult = await autoFixupOldPortal2Demo(
demo,
parser,
buffer,
buffer.buffer,
filePath,
);

Expand Down Expand Up @@ -602,8 +602,8 @@ export const getInputData = (demo: SourceDemo): Uint32Array | null => {
return null;
};

// Imported from: https://github.com/NeKzor/sdp/blob/master/examples/repair.ts
export const repairDemo = (buffer: Uint8Array): Uint8Array => {
// Imported from: https://github.com/NeKzor/sdp/blob/main/examples/tools/repair.ts
export const repairDemo = (buffer: ArrayBuffer): Uint8Array => {
const parser = SourceDemoParser.default()
.setOptions({ packets: true, dataTables: true });

Expand Down
8 changes: 8 additions & 0 deletions src/server/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
"id": "deno run --no-prompt --env-file --allow-env --allow-read=.env,.env.defaults,.env.example,/storage --allow-net=autorender.database:3307 tasks/id.ts",
"avatars": "deno run --no-prompt --env-file --allow-env --allow-read=.env,.env.defaults,.env.example,/storage --allow-write=/storage/users --allow-net=autorender.database:3307,cdn.discordapp.com tasks/avatars.ts"
},
"lint": {
"rules": {
"exclude": [
"jsx-key",
"no-unused-vars"
]
}
},
"fmt": {
"useTabs": false,
"lineWidth": 120,
Expand Down
Loading

0 comments on commit eb84783

Please sign in to comment.