sonolus-llsif-engine 1.3.0 → 1.4.0

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/README.md CHANGED
@@ -27,57 +27,33 @@ npm install sonolus-llsif-engine
27
27
 
28
28
  Package version.
29
29
 
30
- ### `engineInfo`
30
+ ### `databaseEngineItem`
31
31
 
32
- Partial engine information compatible with [sonolus-express](https://github.com/NonSpicyBurrito/sonolus-express).
32
+ Partial database engine item compatible with [sonolus-express](https://github.com/NonSpicyBurrito/sonolus-express).
33
33
 
34
- ### `engineConfiguration`
34
+ ### `engineConfigurationPath`
35
35
 
36
- Engine Configuration.
36
+ Path to Engine Configuration file.
37
37
 
38
- - `engineConfiguration.path`: path to file.
39
- - `engineConfiguration.buffer`: buffer of file.
40
- - `engineConfiguration.hash`: hash of file.
38
+ ### `enginePlayDataPath`
41
39
 
42
- ### `enginePlayData`
40
+ Path to Engine Play Data file.
43
41
 
44
- Engine Play Data.
42
+ ### `engineWatchDataPath`
45
43
 
46
- - `enginePlayData.path`: path to file.
47
- - `enginePlayData.buffer`: buffer of file.
48
- - `enginePlayData.hash`: hash of file.
44
+ Path to Engine Watch Data file.
49
45
 
50
- ### `engineWatchData`
46
+ ### `enginePreviewDataPath`
51
47
 
52
- Engine Watch Data.
48
+ Path to Engine Preview Data file.
53
49
 
54
- - `engineWatchData.path`: path to file.
55
- - `engineWatchData.buffer`: buffer of file.
56
- - `engineWatchData.hash`: hash of file.
50
+ ### `engineTutorialDataPath`
57
51
 
58
- ### `enginePreviewData`
52
+ Path to Engine Tutorial Data file.
59
53
 
60
- Engine Preview Data.
54
+ ### `engineThumbnailPath`
61
55
 
62
- - `enginePreviewData.path`: path to file.
63
- - `enginePreviewData.buffer`: buffer of file.
64
- - `enginePreviewData.hash`: hash of file.
65
-
66
- ### `engineTutorialData`
67
-
68
- Engine Tutorial Data.
69
-
70
- - `engineTutorialData.path`: path to file.
71
- - `engineTutorialData.buffer`: buffer of file.
72
- - `engineTutorialData.hash`: hash of file.
73
-
74
- ### `engineThumbnail`
75
-
76
- Engine Thumbnail.
77
-
78
- - `engineThumbnail.path`: path to file.
79
- - `engineThumbnail.buffer`: buffer of file.
80
- - `engineThumbnail.hash`: hash of file.
56
+ Path to Engine Thumbnail file.
81
57
 
82
58
  ### `nssToSIFC(nss)`
83
59
 
Binary file
Binary file
Binary file
Binary file
Binary file
package/dist/index.cjs CHANGED
@@ -14,18 +14,18 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.engineThumbnail = exports.engineTutorialData = exports.enginePreviewData = exports.engineWatchData = exports.enginePlayData = exports.engineConfiguration = exports.engineInfo = exports.version = exports.sifcToLevelData = exports.nssToSIFC = void 0;
18
- const Resource_cjs_1 = require("./Resource.cjs");
17
+ exports.engineThumbnailPath = exports.engineTutorialDataPath = exports.enginePreviewDataPath = exports.engineWatchDataPath = exports.enginePlayDataPath = exports.engineConfigurationPath = exports.databaseEngineItem = exports.version = exports.sifcToLevelData = exports.nssToSIFC = void 0;
18
+ const node_path_1 = require("node:path");
19
19
  var convert_cjs_1 = require("./nss/convert.cjs");
20
20
  Object.defineProperty(exports, "nssToSIFC", { enumerable: true, get: function () { return convert_cjs_1.nssToSIFC; } });
21
21
  __exportStar(require("./nss/index.cjs"), exports);
22
22
  var convert_cjs_2 = require("./sifc/convert.cjs");
23
23
  Object.defineProperty(exports, "sifcToLevelData", { enumerable: true, get: function () { return convert_cjs_2.sifcToLevelData; } });
24
24
  __exportStar(require("./sifc/index.cjs"), exports);
25
- exports.version = '1.3.0';
26
- exports.engineInfo = {
25
+ exports.version = '1.4.0';
26
+ exports.databaseEngineItem = {
27
27
  name: 'llsif',
28
- version: 11,
28
+ version: 12,
29
29
  title: {
30
30
  en: 'Love Live!',
31
31
  ja: 'ラブライブ!',
@@ -55,9 +55,9 @@ exports.engineInfo = {
55
55
  ].join('\n'),
56
56
  },
57
57
  };
58
- exports.engineConfiguration = new Resource_cjs_1.Resource('EngineConfiguration');
59
- exports.enginePlayData = new Resource_cjs_1.Resource('EnginePlayData');
60
- exports.engineWatchData = new Resource_cjs_1.Resource('EngineWatchData');
61
- exports.enginePreviewData = new Resource_cjs_1.Resource('EnginePreviewData');
62
- exports.engineTutorialData = new Resource_cjs_1.Resource('EngineTutorialData');
63
- exports.engineThumbnail = new Resource_cjs_1.Resource('thumbnail.png');
58
+ exports.engineConfigurationPath = (0, node_path_1.resolve)(__dirname, 'EngineConfiguration');
59
+ exports.enginePlayDataPath = (0, node_path_1.resolve)(__dirname, 'EnginePlayData');
60
+ exports.engineWatchDataPath = (0, node_path_1.resolve)(__dirname, 'EngineWatchData');
61
+ exports.enginePreviewDataPath = (0, node_path_1.resolve)(__dirname, 'EnginePreviewData');
62
+ exports.engineTutorialDataPath = (0, node_path_1.resolve)(__dirname, 'EngineTutorialData');
63
+ exports.engineThumbnailPath = (0, node_path_1.resolve)(__dirname, 'thumbnail.png');
package/dist/index.d.cts CHANGED
@@ -1,12 +1,11 @@
1
- import { Resource } from './Resource.cjs';
2
1
  export { nssToSIFC } from './nss/convert.cjs';
3
2
  export * from './nss/index.cjs';
4
3
  export { sifcToLevelData } from './sifc/convert.cjs';
5
4
  export * from './sifc/index.cjs';
6
- export declare const version = "1.3.0";
7
- export declare const engineInfo: {
5
+ export declare const version = "1.4.0";
6
+ export declare const databaseEngineItem: {
8
7
  readonly name: "llsif";
9
- readonly version: 11;
8
+ readonly version: 12;
10
9
  readonly title: {
11
10
  readonly en: "Love Live!";
12
11
  readonly ja: "ラブライブ!";
@@ -28,9 +27,9 @@ export declare const engineInfo: {
28
27
  readonly en: string;
29
28
  };
30
29
  };
31
- export declare const engineConfiguration: Resource;
32
- export declare const enginePlayData: Resource;
33
- export declare const engineWatchData: Resource;
34
- export declare const enginePreviewData: Resource;
35
- export declare const engineTutorialData: Resource;
36
- export declare const engineThumbnail: Resource;
30
+ export declare const engineConfigurationPath: string;
31
+ export declare const enginePlayDataPath: string;
32
+ export declare const engineWatchDataPath: string;
33
+ export declare const enginePreviewDataPath: string;
34
+ export declare const engineTutorialDataPath: string;
35
+ export declare const engineThumbnailPath: string;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.sifcToLevelData = void 0;
4
- const sonolus_core_1 = require("sonolus-core");
4
+ const core_1 = require("@sonolus/core");
5
5
  function sifcToLevelData(chart, offset = 0) {
6
6
  const entities = [];
7
7
  const beatToIntermediates = new Map();
@@ -16,7 +16,7 @@ function sifcToLevelData(chart, offset = 0) {
16
16
  intermediateToRef.set(intermediate, ref);
17
17
  const entity = intermediateToEntity.get(intermediate);
18
18
  if (entity)
19
- entity.ref = ref;
19
+ entity.name = ref;
20
20
  return ref;
21
21
  };
22
22
  const append = (intermediate) => {
@@ -25,7 +25,7 @@ function sifcToLevelData(chart, offset = 0) {
25
25
  data: [],
26
26
  };
27
27
  if (intermediate.sim) {
28
- const beat = intermediate.data[sonolus_core_1.EngineArchetypeDataName.Beat];
28
+ const beat = intermediate.data[core_1.EngineArchetypeDataName.Beat];
29
29
  if (typeof beat !== 'number')
30
30
  throw new Error('Unexpected beat');
31
31
  const intermediates = beatToIntermediates.get(beat);
@@ -38,7 +38,7 @@ function sifcToLevelData(chart, offset = 0) {
38
38
  }
39
39
  const ref = intermediateToRef.get(intermediate);
40
40
  if (ref)
41
- entity.ref = ref;
41
+ entity.name = ref;
42
42
  intermediateToEntity.set(intermediate, entity);
43
43
  entities.push(entity);
44
44
  for (const [name, value] of Object.entries(intermediate.data)) {
@@ -63,11 +63,6 @@ function sifcToLevelData(chart, offset = 0) {
63
63
  },
64
64
  sim: false,
65
65
  });
66
- append({
67
- archetype: 'InputManager',
68
- data: {},
69
- sim: false,
70
- });
71
66
  append({
72
67
  archetype: 'Stage',
73
68
  data: {},
@@ -97,10 +92,10 @@ function sifcToLevelData(chart, offset = 0) {
97
92
  exports.sifcToLevelData = sifcToLevelData;
98
93
  const bpm = (object, append) => {
99
94
  append({
100
- archetype: sonolus_core_1.EngineArchetypeName.BpmChange,
95
+ archetype: core_1.EngineArchetypeName.BpmChange,
101
96
  data: {
102
- [sonolus_core_1.EngineArchetypeDataName.Beat]: object.beat,
103
- [sonolus_core_1.EngineArchetypeDataName.Bpm]: object.bpm,
97
+ [core_1.EngineArchetypeDataName.Beat]: object.beat,
98
+ [core_1.EngineArchetypeDataName.Bpm]: object.bpm,
104
99
  },
105
100
  sim: false,
106
101
  });
@@ -109,7 +104,7 @@ const tap = (object, append) => {
109
104
  const note = {
110
105
  archetype: 'TapNote',
111
106
  data: {
112
- [sonolus_core_1.EngineArchetypeDataName.Beat]: object.beat,
107
+ [core_1.EngineArchetypeDataName.Beat]: object.beat,
113
108
  lane: object.lane,
114
109
  },
115
110
  sim: true,
@@ -125,7 +120,7 @@ const swing = (object, append) => {
125
120
  const note = {
126
121
  archetype: 'SwingNote',
127
122
  data: {
128
- [sonolus_core_1.EngineArchetypeDataName.Beat]: object.beat,
123
+ [core_1.EngineArchetypeDataName.Beat]: object.beat,
129
124
  lane: object.lane,
130
125
  direction: object.direction === 'Left' ? -1 : 1,
131
126
  },
@@ -143,7 +138,7 @@ const hold = (head, beat, append) => {
143
138
  const tail = {
144
139
  archetype: 'HoldNote',
145
140
  data: {
146
- [sonolus_core_1.EngineArchetypeDataName.Beat]: beat,
141
+ [core_1.EngineArchetypeDataName.Beat]: beat,
147
142
  prev: head,
148
143
  },
149
144
  sim: false,
@@ -1,3 +1,3 @@
1
- import { LevelData } from 'sonolus-core';
1
+ import { LevelData } from '@sonolus/core';
2
2
  import { SIFC } from './index.cjs';
3
3
  export declare function sifcToLevelData(chart: SIFC, offset?: number): LevelData;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sonolus-llsif-engine",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "A recreation of Love Live! School idol festival engine in Sonolus",
5
5
  "author": "NonSpicyBurrito",
6
6
  "repository": "github:NonSpicyBurrito/sonolus-llsif-engine",
@@ -21,17 +21,17 @@
21
21
  "build": "tsc -p ./lib && sonolus-cli --build ./play && sonolus-cli --build ./watch && sonolus-cli --build ./preview && sonolus-cli --build ./tutorial && node ./lib/build.mjs"
22
22
  },
23
23
  "dependencies": {
24
- "sonolus-core": "~7.4.0"
24
+ "@sonolus/core": "~7.5.0"
25
25
  },
26
26
  "devDependencies": {
27
- "@types/node": "^16.18.65",
28
- "@typescript-eslint/eslint-plugin": "^6.12.0",
29
- "@typescript-eslint/parser": "^6.12.0",
30
- "eslint": "^8.54.0",
31
- "eslint-config-prettier": "^9.0.0",
32
- "prettier": "^3.1.0",
27
+ "@sonolus/sonolus.js": "~9.4.0",
28
+ "@types/node": "^16.18.68",
29
+ "@typescript-eslint/eslint-plugin": "^6.14.0",
30
+ "@typescript-eslint/parser": "^6.14.0",
31
+ "eslint": "^8.55.0",
32
+ "eslint-config-prettier": "^9.1.0",
33
+ "prettier": "^3.1.1",
33
34
  "prettier-plugin-organize-imports": "^3.2.4",
34
- "sonolus.js": "~9.3.0",
35
- "typescript": "~5.2.2"
35
+ "typescript": "~5.3.3"
36
36
  }
37
37
  }
package/dist/Resource.cjs DELETED
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Resource = void 0;
4
- const node_crypto_1 = require("node:crypto");
5
- const node_fs_1 = require("node:fs");
6
- const node_path_1 = require("node:path");
7
- class Resource {
8
- constructor(path) {
9
- this.path = (0, node_path_1.resolve)(__dirname, path);
10
- }
11
- get hash() {
12
- this._hash ??= (0, node_crypto_1.createHash)('sha1').update(this.buffer).digest('hex');
13
- return this._hash;
14
- }
15
- get buffer() {
16
- this._buffer ??= (0, node_fs_1.readFileSync)(this.path);
17
- return this._buffer;
18
- }
19
- }
20
- exports.Resource = Resource;
@@ -1,9 +0,0 @@
1
- /// <reference types="node" />
2
- export declare class Resource {
3
- readonly path: string;
4
- private _hash;
5
- private _buffer;
6
- constructor(path: string);
7
- get hash(): string;
8
- get buffer(): Buffer;
9
- }