feat: per-pack public flag + developer installer variants

manifest.json 의 각 pack 에 public(boolean) 을 추가하고, 대상(audience)별로
설치기를 구분한다.
- ManifestEntry.public 추가. 미지정=공개(하위호환). store 가 upsert/rename 시
  기존 public 보존, 신규 pack 은 public=true 기본. setPackPublic() 추가.
- 사이트 pack 편집기에 "공개" 체크박스 추가(체크=일반, 해제=개발자용). 저장 시
  manifest 엔트리 public 갱신, 편집기 진입 시 현재 값 표시.
- shared/audience.ts: 빌드의 musicQuizAudience(package.json)로 대상 판별.
  일반 설치기=public!==false 만, 개발자용=public===false 만 노출.
- 간편/리소스팩 설치기 packs 로드에서 audience 필터 적용.
- 개발자용 빌드 구성(electron-builder-dev.yml, electron-builder-rp-dev.yml)과
  dist:win:dev / dist:win:rp:dev 스크립트 추가(artifact: *-Dev-*). v0.3.20.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
This commit is contained in:
2026-07-11 00:32:06 +09:00
parent f0e07e06d6
commit 7b532d6520
10 changed files with 169 additions and 6 deletions

View File

@@ -16,10 +16,12 @@ import {
normalizePackDefinition,
normalizePackList,
readAccounts,
readManifest,
renamePack,
sanitizePackKey,
saveTerm,
savePackList,
setPackPublic,
setTermVisibility
} from '../../shared/store.js'
import { fetchReleaseVersions } from '../../shared/mojang.js'
@@ -122,11 +124,15 @@ opRouter.get('/op/dashboard/:packName', requireAuth, async (req, res, next) => {
return
}
const releases = await fetchReleaseVersions()
const manifest = await readManifest()
const entry = manifest.packs.find((e) => e.file === packKey)
const isPublic = entry ? entry.public !== false : true
res.render('op/editor', {
userId: req.session.userId,
packKey,
pack: definition,
releases
releases,
isPublic
})
} catch (error) {
next(error)
@@ -519,6 +525,9 @@ opRouter.post('/op/dashboard/:packName', requireAuth, async (req, res, next) =>
return
}
const finalKey = await renamePack(packKey, requestedKey, normalized)
// 체크박스는 체크됐을 때만 전송되므로, 없으면 비공개(개발자용).
const isPublic = pickFirstValue(req.body.isPublic) === 'on' || pickFirstValue(req.body.isPublic) === 'true'
await setPackPublic(finalKey, isPublic)
res.redirect(`/op/dashboard/${finalKey}`)
} catch (error) {
next(error)