CLI tool to pack Sonolus source files into repository and database.
Use npx
to execute without installing.
Packing using default options:
npx @sonolus/pack
Use -h
to see a list of available options:
npx @sonolus/pack -h
Installing globally (only need once):
npm i -g @sonolus/pack
sonolus-pack
will become available to use:
sonolus-pack -h
Each resource (except item.json
):
- if a file with default extension is provided, it will be processed, and corresponding
SRL
will be generated. - if an extension-less file is provided, processing will be skipped, and corresponding
SRL
will be generated. - if an
.srl
extension file is provided, its content will be used asSRL
.
For example resource cover[.png/.srl]
:
- if file
cover.png
is provided, it will be processed, and correspondingSRL
will be generated. - if file
cover
is provided, processing will be skipped, and correspondingSRL
will be generated. - if file
cover.srl
is provided, its content will be used asSRL
.
Common type for text with localization.
type LocalizationText = Record<string, string>
For example:
{
"en": "Hello!",
"zhs": "你好!",
"ja": "こんにちは!",
"ko": "안녕하세요!"
}
Common type for tag.
type Tag = {
title: LocalizationText
icon?: string
}
| info.json
| banner[.png/.srl]
|
+---posts
| +---{post}
| +---...
| \---{post}
| item.json
| thumbnail[.png/.srl]
|
+---playlists
| +---{playlist}
| +---...
| \---{playlist}
| item.json
| thumbnail[.png/.srl]
|
+---levels
| +---{level}
| +---...
| \---{level}
| item.json
| cover[.png/.srl]
| bgm[.mp3/.srl]
| preview[.mp3/.srl]
| data[.json/.srl]
|
+---skins
| +---{skin}
| +---...
| \---{skin}
| item.json
| thumbnail[.png/.srl]
| data[.json/.srl]
| texture[.png/.srl]
|
+---backgrounds
| +---{background}
| +---...
| \---{background}
| item.json
| thumbnail[.png/.srl]
| data[.json/.srl]
| image[.png/.srl]
| configuration[.json/.srl]
|
+---effects
| +---{effect}
| +---...
| \---{effect}
| item.json
| thumbnail[.png/.srl]
| data[.json/.srl]
| audio[.zip/.srl]
|
+---particles
| +---{particle}
| +---...
| \---{particle}
| item.json
| thumbnail[.png/.srl]
| data[.json/.srl]
| texture[.png/.srl]
|
+---engines
| +---{engine}
| +---...
| \---{engine}
| item.json
| thumbnail[.png/.srl]
| playData[.json/.srl]
| tutorialData[.json/.srl]
| rom[.bin/.srl]
| configuration[.json/.srl]
|
\---replays
+---{replay}
+---...
\---{replay}
item.json
data[.json/.srl]
configuration[.json/.srl]
Resources of server is located in /
.
Server information.
type ServerInfo = {
title: LocalizationText
}
Optional, server banner.
Resources of each post is located in /posts/{post}
.
Post information.
type PostItem = {
version: number
title: LocalizationText
time: number
author: LocalizationText
tags: Tag[]
description?: LocalizationText
meta?: unknown // (optional) user-defined meta information
}
Optional, post thumbnail.
Resources of each playlist is located in /playlists/{post}
.
Playlist information.
type PlaylistItem = {
version: number
title: LocalizationText
time: number
author: LocalizationText
tags: Tag[]
description?: LocalizationText
levels: string[] // name of referenced levels
meta?: unknown // (optional) user-defined meta information
}
Optional, playlist thumbnail.
Resources of each level is located in /levels/{name}
.
Level information.
type LevelItem = {
version: number
rating: number
engine: string // name of referenced engine
useSkin: UseItem
useBackground: UseItem
useEffect: UseItem
useParticle: UseItem
title: LocalizationText
artists: LocalizationText
author: LocalizationText
tags: Tag[]
description?: LocalizationText
meta?: unknown // (optional) user-defined meta information
}
type UseItem =
| {
useDefault: true
}
| {
useDefault: false
item: string // name of referenced item
}
Level cover.
Level bgm.
Optional, level preview.
Level data.
Resources of each skin is located in /skins/{skin}
.
Skin information.
type SkinItem = {
version: number
title: LocalizationText
subtitle: LocalizationText
author: LocalizationText
tags: Tag[]
description?: LocalizationText
meta?: unknown // (optional) user-defined meta information
}
Skin thumbnail.
Skin data.
Skin texture.
Resources of each background is located in /backgrounds/{background}
.
Background information.
type BackgroundItem = {
version: number
title: LocalizationText
subtitle: LocalizationText
author: LocalizationText
tags: Tag[]
description?: LocalizationText
meta?: unknown // (optional) user-defined meta information
}
Background thumbnail.
Background data.
Background image.
Background configuration.
Resources of each effect is located in /effects/{effect}
.
Effect information.
type EffectItem = {
version: number
title: LocalizationText
subtitle: LocalizationText
author: LocalizationText
tags: Tag[]
description?: LocalizationText
meta?: unknown // (optional) user-defined meta information
}
Effect thumbnail.
Effect data.
Effect audio.
Resources of each particle is located in /particles/{particle}
.
Particle information.
type ParticleItem = {
version: number
title: LocalizationText
subtitle: LocalizationText
author: LocalizationText
tags: Tag[]
description?: LocalizationText
meta?: unknown // (optional) user-defined meta information
}
Particle thumbnail.
Particle data.
Particle texture.
Resources of each engine is located in /engines/{engine}
.
Engine information.
type EngineItem = {
version: number
title: LocalizationText
subtitle: LocalizationText
author: LocalizationText
tags: Tag[]
description?: LocalizationText
skin: string // name of referenced skin
background: string // name of referenced background
effect: string // name of referenced effect
particle: string // name of referenced particle
meta?: unknown // (optional) user-defined meta information
}
Engine thumbnail.
Engine play data.
Engine tutorial data.
Optional, engine rom.
Engine configuration.
Resources of each replay is located in /replays/{replay}
.
Replay information.
type ReplayItem = {
version: number
title: LocalizationText
subtitle: LocalizationText
author: LocalizationText
tags: Tag[]
description?: LocalizationText
level: string // name of referenced level
meta?: unknown // (optional) user-defined meta information
}
Replay data.
Replay configuration.
Output contains:
-
/repository
contains processed resources. -
/db.json
contains information of items.
Output can be used by sonolus-express and sonolus-generate-static to develop Sonolus servers.