Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Client-Side Pre-Upload Package Validation #1061

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

x753
Copy link
Contributor

@x753 x753 commented Sep 9, 2024

Prevents users from attempting to upload packages that aren't zips or packages without a manifest, icon, and readme in the root of the zip.

Warns the user when uploading packages with > 8 DLL files, an Assembly-CSharp.dll file, or BepInEx.dll.

Fixes a chromium bug preventing the selection of a file that was previously selected and canceled.

image

@x753 x753 requested a review from MythicManiac September 9, 2024 18:08
@x753 x753 force-pushed the pre-upload-validation branch from d27ceb8 to 511181e Compare September 9, 2024 18:09
@x753 x753 force-pushed the pre-upload-validation branch from 511181e to d8bf267 Compare January 21, 2025 13:56
@x753 x753 force-pushed the pre-upload-validation branch from 8b7a454 to 7a6b794 Compare February 11, 2025 15:59
@Roffenlund
Copy link
Contributor

Roffenlund commented Feb 18, 2025

I cannot build this branch on my machine, it fails with the error [TypeScript error: /app/src/uploadZipValidation.ts(2,39): Error TS2306: File '/app/src/vendor/zip-fs-full.d.ts' is not a module.].

Would adding something like this to the uploadZipValidation.ts solve this instead of trying to import the file?

const zip = require('./vendor/zip-fs-full.js');

const BlobReader = zip.BlobReader;
const ZipReader = zip.ZipReader;

x753 added 2 commits February 20, 2025 12:18
Prevents users from attempting to upload packages that aren't zips or
packages without a manifest, icon, and readme in the root of the zip.

Warns the user when uploading packages with > 8 DLL files, an
Assembly-CSharp.dll file, or BepInEx.dll.

Fixes a chromium bug preventing the selection of a file that was
previously selected and canceled.
Move upload zip validation into separate file
Add wrongCase, wrongExtension, and noExtension errors
@x753 x753 force-pushed the pre-upload-validation branch from 7a6b794 to 7780955 Compare February 20, 2025 17:19
@x753
Copy link
Contributor Author

x753 commented Feb 20, 2025

I cannot build this branch on my machine, it fails with the error [TypeScript error: /app/src/uploadZipValidation.ts(2,39): Error TS2306: File '/app/src/vendor/zip-fs-full.d.ts' is not a module.].

Would adding something like this to the uploadZipValidation.ts solve this instead of trying to import the file?

const zip = require('./vendor/zip-fs-full.js');

const BlobReader = zip.BlobReader;
const ZipReader = zip.ZipReader;

As of 15c1243 it should build for you now. if your Builder-1 dies, just:

docker compose down
docker volume rm <built-static>
docker compose up builder
docker compose down
docker compose build
docker compose up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants