@sonolus/generate-static 5.4.3 → 5.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +21 -13
- package/dist/schemas/items/background.js +1 -1
- package/dist/schemas/items/effect.js +1 -1
- package/dist/schemas/items/engine.js +1 -1
- package/dist/schemas/items/level.js +1 -1
- package/dist/schemas/items/particle.js +1 -1
- package/dist/schemas/items/playlist.js +1 -1
- package/dist/schemas/items/post.js +1 -1
- package/dist/schemas/items/replay.js +1 -1
- package/dist/schemas/items/skin.js +1 -1
- package/dist/schemas/srl.js +2 -2
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -18,7 +18,7 @@ const skin_1 = require("./server/items/skin");
|
|
|
18
18
|
const json_1 = require("./utils/json");
|
|
19
19
|
const options = new commander_1.Command()
|
|
20
20
|
.name('sonolus-generate-static')
|
|
21
|
-
.version('5.4.
|
|
21
|
+
.version('5.4.4')
|
|
22
22
|
.option('-i, --input <value>', 'input directory', 'pack')
|
|
23
23
|
.option('-o, --output <value>', 'output directory', 'static')
|
|
24
24
|
.option('-a, --address [value]', 'address')
|
|
@@ -49,19 +49,23 @@ const orderItems = (items, names = []) => {
|
|
|
49
49
|
};
|
|
50
50
|
items.sort((a, b) => getSortOrder(a) - getSortOrder(b));
|
|
51
51
|
};
|
|
52
|
-
const outputItems = (dirname, sonolus, items, toItem) => {
|
|
52
|
+
const outputItems = (dirname, sonolus, items, itemType, toItem) => {
|
|
53
53
|
for (const [index, item] of items.entries()) {
|
|
54
54
|
console.log('[INFO]', `${pathOutput}/sonolus/${dirname}/${item.name}`);
|
|
55
55
|
const itemDetails = {
|
|
56
56
|
item: toItem(sonolus, item),
|
|
57
|
-
description: sonolus.localize(item.description),
|
|
57
|
+
description: item.description && sonolus.localize(item.description),
|
|
58
|
+
actions: [],
|
|
58
59
|
hasCommunity: false,
|
|
59
60
|
leaderboards: [],
|
|
60
61
|
sections: [
|
|
61
62
|
{
|
|
62
63
|
title: core_1.Text.Recommended,
|
|
63
64
|
icon: core_1.Icon.Star,
|
|
64
|
-
|
|
65
|
+
itemType,
|
|
66
|
+
items: items
|
|
67
|
+
.slice(index + 1, index + 6)
|
|
68
|
+
.map((item) => toItem(sonolus, item)),
|
|
65
69
|
},
|
|
66
70
|
],
|
|
67
71
|
};
|
|
@@ -79,6 +83,7 @@ const outputItems = (dirname, sonolus, items, toItem) => {
|
|
|
79
83
|
sections: [
|
|
80
84
|
{
|
|
81
85
|
title: core_1.Text.Newest,
|
|
86
|
+
itemType,
|
|
82
87
|
items: items.slice(0, 5).map((item) => toItem(sonolus, item)),
|
|
83
88
|
},
|
|
84
89
|
],
|
|
@@ -113,6 +118,9 @@ try {
|
|
|
113
118
|
{ type: 'particle' },
|
|
114
119
|
{ type: 'engine' },
|
|
115
120
|
],
|
|
121
|
+
configuration: {
|
|
122
|
+
options: [],
|
|
123
|
+
},
|
|
116
124
|
banner: sonolus.db.info.banner,
|
|
117
125
|
};
|
|
118
126
|
(0, fs_extra_1.outputJsonSync)(`${pathOutput}/sonolus/info`, serverInfo);
|
|
@@ -121,15 +129,15 @@ try {
|
|
|
121
129
|
shouldUpdate: false,
|
|
122
130
|
};
|
|
123
131
|
(0, fs_extra_1.outputJsonSync)(`${pathOutput}/sonolus/package`, packageInfo);
|
|
124
|
-
outputItems('posts', sonolus, sonolus.db.posts, post_item_1.toPostItem);
|
|
125
|
-
outputItems('playlists', sonolus, sonolus.db.playlists, playlist_1.toPlaylistItem);
|
|
126
|
-
outputItems('levels', sonolus, sonolus.db.levels, level_1.toLevelItem);
|
|
127
|
-
outputItems('skins', sonolus, sonolus.db.skins, skin_1.toSkinItem);
|
|
128
|
-
outputItems('backgrounds', sonolus, sonolus.db.backgrounds, background_1.toBackgroundItem);
|
|
129
|
-
outputItems('effects', sonolus, sonolus.db.effects, effect_1.toEffectItem);
|
|
130
|
-
outputItems('particles', sonolus, sonolus.db.particles, particle_1.toParticleItem);
|
|
131
|
-
outputItems('engines', sonolus, sonolus.db.engines, engine_1.toEngineItem);
|
|
132
|
-
outputItems('replays', sonolus, sonolus.db.replays, replay_1.toReplayItem);
|
|
132
|
+
outputItems('posts', sonolus, sonolus.db.posts, 'post', post_item_1.toPostItem);
|
|
133
|
+
outputItems('playlists', sonolus, sonolus.db.playlists, 'playlist', playlist_1.toPlaylistItem);
|
|
134
|
+
outputItems('levels', sonolus, sonolus.db.levels, 'level', level_1.toLevelItem);
|
|
135
|
+
outputItems('skins', sonolus, sonolus.db.skins, 'skin', skin_1.toSkinItem);
|
|
136
|
+
outputItems('backgrounds', sonolus, sonolus.db.backgrounds, 'background', background_1.toBackgroundItem);
|
|
137
|
+
outputItems('effects', sonolus, sonolus.db.effects, 'effect', effect_1.toEffectItem);
|
|
138
|
+
outputItems('particles', sonolus, sonolus.db.particles, 'particle', particle_1.toParticleItem);
|
|
139
|
+
outputItems('engines', sonolus, sonolus.db.engines, 'engine', engine_1.toEngineItem);
|
|
140
|
+
outputItems('replays', sonolus, sonolus.db.replays, 'replay', replay_1.toReplayItem);
|
|
133
141
|
console.log('[INFO]', `${pathOutput}/sonolus/repository`);
|
|
134
142
|
(0, fs_extra_1.copySync)(`${pathInput}/repository`, `${pathOutput}/sonolus/repository`);
|
|
135
143
|
console.log();
|
|
@@ -12,7 +12,7 @@ exports.databaseBackgroundItemSchema = typebox_1.Type.Object({
|
|
|
12
12
|
subtitle: localizationText_1.localizationTextSchema,
|
|
13
13
|
author: localizationText_1.localizationTextSchema,
|
|
14
14
|
tags: typebox_1.Type.Array(tag_1.databaseTagSchema),
|
|
15
|
-
description: localizationText_1.localizationTextSchema,
|
|
15
|
+
description: typebox_1.Type.Optional(localizationText_1.localizationTextSchema),
|
|
16
16
|
thumbnail: srl_1.srlSchema,
|
|
17
17
|
data: srl_1.srlSchema,
|
|
18
18
|
image: srl_1.srlSchema,
|
|
@@ -12,7 +12,7 @@ exports.databaseEffectItemSchema = typebox_1.Type.Object({
|
|
|
12
12
|
subtitle: localizationText_1.localizationTextSchema,
|
|
13
13
|
author: localizationText_1.localizationTextSchema,
|
|
14
14
|
tags: typebox_1.Type.Array(tag_1.databaseTagSchema),
|
|
15
|
-
description: localizationText_1.localizationTextSchema,
|
|
15
|
+
description: typebox_1.Type.Optional(localizationText_1.localizationTextSchema),
|
|
16
16
|
thumbnail: srl_1.srlSchema,
|
|
17
17
|
data: srl_1.srlSchema,
|
|
18
18
|
audio: srl_1.srlSchema,
|
|
@@ -12,7 +12,7 @@ exports.databaseEngineItemSchema = typebox_1.Type.Object({
|
|
|
12
12
|
subtitle: localizationText_1.localizationTextSchema,
|
|
13
13
|
author: localizationText_1.localizationTextSchema,
|
|
14
14
|
tags: typebox_1.Type.Array(tag_1.databaseTagSchema),
|
|
15
|
-
description: localizationText_1.localizationTextSchema,
|
|
15
|
+
description: typebox_1.Type.Optional(localizationText_1.localizationTextSchema),
|
|
16
16
|
skin: typebox_1.Type.String(),
|
|
17
17
|
background: typebox_1.Type.String(),
|
|
18
18
|
effect: typebox_1.Type.String(),
|
|
@@ -17,7 +17,7 @@ exports.databaseLevelItemSchema = typebox_1.Type.Object({
|
|
|
17
17
|
artists: localizationText_1.localizationTextSchema,
|
|
18
18
|
author: localizationText_1.localizationTextSchema,
|
|
19
19
|
tags: typebox_1.Type.Array(tag_1.databaseTagSchema),
|
|
20
|
-
description: localizationText_1.localizationTextSchema,
|
|
20
|
+
description: typebox_1.Type.Optional(localizationText_1.localizationTextSchema),
|
|
21
21
|
engine: typebox_1.Type.String(),
|
|
22
22
|
useSkin: databaseUseItemSchema,
|
|
23
23
|
useBackground: databaseUseItemSchema,
|
|
@@ -12,7 +12,7 @@ exports.databaseParticleItemSchema = typebox_1.Type.Object({
|
|
|
12
12
|
subtitle: localizationText_1.localizationTextSchema,
|
|
13
13
|
author: localizationText_1.localizationTextSchema,
|
|
14
14
|
tags: typebox_1.Type.Array(tag_1.databaseTagSchema),
|
|
15
|
-
description: localizationText_1.localizationTextSchema,
|
|
15
|
+
description: typebox_1.Type.Optional(localizationText_1.localizationTextSchema),
|
|
16
16
|
thumbnail: srl_1.srlSchema,
|
|
17
17
|
data: srl_1.srlSchema,
|
|
18
18
|
texture: srl_1.srlSchema,
|
|
@@ -12,7 +12,7 @@ exports.databasePlaylistItemSchema = typebox_1.Type.Object({
|
|
|
12
12
|
subtitle: localizationText_1.localizationTextSchema,
|
|
13
13
|
author: localizationText_1.localizationTextSchema,
|
|
14
14
|
tags: typebox_1.Type.Array(tag_1.databaseTagSchema),
|
|
15
|
-
description: localizationText_1.localizationTextSchema,
|
|
15
|
+
description: typebox_1.Type.Optional(localizationText_1.localizationTextSchema),
|
|
16
16
|
levels: typebox_1.Type.Array(typebox_1.Type.String()),
|
|
17
17
|
thumbnail: typebox_1.Type.Optional(srl_1.srlSchema),
|
|
18
18
|
});
|
|
@@ -12,6 +12,6 @@ exports.databasePostItemSchema = typebox_1.Type.Object({
|
|
|
12
12
|
time: typebox_1.Type.Number(),
|
|
13
13
|
author: localizationText_1.localizationTextSchema,
|
|
14
14
|
tags: typebox_1.Type.Array(tag_1.databaseTagSchema),
|
|
15
|
-
description: localizationText_1.localizationTextSchema,
|
|
15
|
+
description: typebox_1.Type.Optional(localizationText_1.localizationTextSchema),
|
|
16
16
|
thumbnail: typebox_1.Type.Optional(srl_1.srlSchema),
|
|
17
17
|
});
|
|
@@ -12,7 +12,7 @@ exports.databaseReplayItemSchema = typebox_1.Type.Object({
|
|
|
12
12
|
subtitle: localizationText_1.localizationTextSchema,
|
|
13
13
|
author: localizationText_1.localizationTextSchema,
|
|
14
14
|
tags: typebox_1.Type.Array(tag_1.databaseTagSchema),
|
|
15
|
-
description: localizationText_1.localizationTextSchema,
|
|
15
|
+
description: typebox_1.Type.Optional(localizationText_1.localizationTextSchema),
|
|
16
16
|
level: typebox_1.Type.String(),
|
|
17
17
|
data: srl_1.srlSchema,
|
|
18
18
|
configuration: srl_1.srlSchema,
|
|
@@ -12,7 +12,7 @@ exports.databaseSkinItemSchema = typebox_1.Type.Object({
|
|
|
12
12
|
subtitle: localizationText_1.localizationTextSchema,
|
|
13
13
|
author: localizationText_1.localizationTextSchema,
|
|
14
14
|
tags: typebox_1.Type.Array(tag_1.databaseTagSchema),
|
|
15
|
-
description: localizationText_1.localizationTextSchema,
|
|
15
|
+
description: typebox_1.Type.Optional(localizationText_1.localizationTextSchema),
|
|
16
16
|
thumbnail: srl_1.srlSchema,
|
|
17
17
|
data: srl_1.srlSchema,
|
|
18
18
|
texture: srl_1.srlSchema,
|
package/dist/schemas/srl.js
CHANGED
|
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.srlSchema = void 0;
|
|
4
4
|
const typebox_1 = require("@sinclair/typebox");
|
|
5
5
|
exports.srlSchema = typebox_1.Type.Object({
|
|
6
|
-
hash: typebox_1.Type.String(),
|
|
7
|
-
url: typebox_1.Type.String(),
|
|
6
|
+
hash: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()])),
|
|
7
|
+
url: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()])),
|
|
8
8
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sonolus/generate-static",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.4",
|
|
4
4
|
"description": "CLI tool to generate static Sonolus server from repository and database",
|
|
5
5
|
"author": "NonSpicyBurrito",
|
|
6
6
|
"repository": "github:Sonolus/sonolus-generate-static",
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
"@types/fs-extra": "^11.0.4",
|
|
24
24
|
"eslint": "^8.57.0",
|
|
25
25
|
"eslint-config-prettier": "^9.1.0",
|
|
26
|
-
"prettier": "^3.3.
|
|
27
|
-
"prettier-plugin-organize-imports": "^
|
|
28
|
-
"typescript": "~5.4
|
|
29
|
-
"typescript-eslint": "^7.
|
|
26
|
+
"prettier": "^3.3.3",
|
|
27
|
+
"prettier-plugin-organize-imports": "^4.0.0",
|
|
28
|
+
"typescript": "~5.5.4",
|
|
29
|
+
"typescript-eslint": "^7.17.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@sinclair/typebox": "^0.32.
|
|
33
|
-
"@sonolus/core": "~7.
|
|
32
|
+
"@sinclair/typebox": "^0.32.35",
|
|
33
|
+
"@sonolus/core": "~7.8.0",
|
|
34
34
|
"commander": "^12.1.0",
|
|
35
35
|
"fs-extra": "^11.2.0"
|
|
36
36
|
}
|