mirror of
https://github.com/modrinth/code.git
synced 2026-08-30 03:24:54 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
56dba8ccc2 | ||
|
|
82d0184a85 | ||
|
|
5f9522b5cf | ||
|
|
75d2109be8 | ||
|
|
7e611c7678 |
@@ -3,7 +3,7 @@ name: Frontend Docker
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
# - main
|
||||
- main
|
||||
- prod
|
||||
paths:
|
||||
- 'apps/frontend/**/*'
|
||||
@@ -70,14 +70,10 @@ jobs:
|
||||
working-directory: ./apps/frontend
|
||||
run: pnpm install
|
||||
|
||||
# nuxi is called directly because `pnpm build` hardcodes NODE_OPTIONS, which would
|
||||
# drop the semi-space bump that cuts roughly 5% off the build.
|
||||
- name: Build frontend
|
||||
working-directory: ./apps/frontend
|
||||
run: pnpm exec nuxi build
|
||||
run: pnpm web:build
|
||||
env:
|
||||
NITRO_PRESET: node-server
|
||||
NODE_OPTIONS: '--max-old-space-size=8192 --max-semi-space-size=64'
|
||||
BUILD_ENV: ${{ steps.meta.outputs.env }}
|
||||
CF_PAGES_BRANCH: ${{ github.ref_name }}
|
||||
CF_PAGES_COMMIT_SHA: ${{ github.sha }}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "NODE_OPTIONS=\"--max-old-space-size=8192\" nuxi build",
|
||||
"build": "NODE_OPTIONS=\"--max-old-space-size=8192 --max-semi-space-size=64\" nuxi build",
|
||||
"dev": "nuxi dev",
|
||||
"generate": "nuxi generate",
|
||||
"preview": "nuxi preview",
|
||||
|
||||
@@ -529,12 +529,12 @@ pub async fn create_mrpack_json(
|
||||
)
|
||||
.await?
|
||||
.into_iter()
|
||||
.filter_map(|(path, file)| match file.metadata {
|
||||
Some(metadata) => Some((path, metadata.version_id)),
|
||||
_ => None,
|
||||
.filter_map(|(path, file)| {
|
||||
file.metadata
|
||||
.map(|metadata| (path, file.hash, metadata.version_id))
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
let version_ids = projects.iter().map(|x| &*x.1).collect::<Vec<_>>();
|
||||
let version_ids = projects.iter().map(|x| &*x.2).collect::<Vec<_>>();
|
||||
let versions = CachedEntry::get_version_v3_many(
|
||||
&version_ids,
|
||||
Some(CacheBehaviour::MustRevalidate),
|
||||
@@ -544,43 +544,38 @@ pub async fn create_mrpack_json(
|
||||
.await?;
|
||||
let files = projects
|
||||
.into_iter()
|
||||
.filter_map(|(path, version_id)| {
|
||||
if let Some(version) = versions.iter().find(|x| x.id == version_id)
|
||||
{
|
||||
let env = get_mrpack_environment(version.environment);
|
||||
let Some(primary_file) = version.files.first() else {
|
||||
return Some(Err(crate::ErrorKind::OtherError(format!(
|
||||
"No primary file found for mod at: {path}"
|
||||
))
|
||||
.as_error()));
|
||||
};
|
||||
let file_size = primary_file.size;
|
||||
let downloads = vec![primary_file.url.clone()];
|
||||
let hashes = primary_file
|
||||
.hashes
|
||||
.clone()
|
||||
.into_iter()
|
||||
.map(|(h1, h2)| (PackFileHash::from(h1), h2))
|
||||
.collect();
|
||||
.filter_map(|(path, hash, version_id)| {
|
||||
let version = versions.iter().find(|x| x.id == version_id)?;
|
||||
let env = get_mrpack_environment(version.environment);
|
||||
let file = version.files.iter().find(|file| {
|
||||
file.hashes
|
||||
.get("sha1")
|
||||
.is_some_and(|file_hash| file_hash == &hash)
|
||||
})?;
|
||||
let file_size = file.size;
|
||||
let downloads = vec![file.url.clone()];
|
||||
let hashes = file
|
||||
.hashes
|
||||
.clone()
|
||||
.into_iter()
|
||||
.map(|(h1, h2)| (PackFileHash::from(h1), h2))
|
||||
.collect();
|
||||
|
||||
Some(Ok(PackFile {
|
||||
path: match path.try_into() {
|
||||
Ok(path) => path,
|
||||
Err(_) => {
|
||||
return Some(Err(crate::ErrorKind::OtherError(
|
||||
"Invalid file path in project".into(),
|
||||
)
|
||||
.as_error()));
|
||||
}
|
||||
},
|
||||
hashes,
|
||||
env: Some(env),
|
||||
downloads,
|
||||
file_size,
|
||||
}))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
Some(Ok(PackFile {
|
||||
path: match path.try_into() {
|
||||
Ok(path) => path,
|
||||
Err(_) => {
|
||||
return Some(Err(crate::ErrorKind::OtherError(
|
||||
"Invalid file path in project".into(),
|
||||
)
|
||||
.as_error()));
|
||||
}
|
||||
},
|
||||
hashes,
|
||||
env: Some(env),
|
||||
downloads,
|
||||
file_size,
|
||||
}))
|
||||
})
|
||||
.collect::<crate::Result<Vec<PackFile>>>()?;
|
||||
|
||||
|
||||
@@ -10,6 +10,13 @@ export type VersionEntry = {
|
||||
}
|
||||
|
||||
const VERSIONS: VersionEntry[] = [
|
||||
{
|
||||
date: `2026-08-20T22:10:10+00:00`,
|
||||
product: 'app',
|
||||
version: '0.18.2',
|
||||
body: `## Security
|
||||
- Fixed .mrpack exports replacing the original file with the primary file of a version previously detected on hash lookup.`,
|
||||
},
|
||||
{
|
||||
date: `2026-08-20T21:46:49+00:00`,
|
||||
product: 'app',
|
||||
|
||||
Reference in New Issue
Block a user