sonolus-llsif-engine 1.0.1 → 1.1.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
@@ -39,13 +39,21 @@ Engine Configuration.
39
39
  - `engineConfiguration.buffer`: buffer of file.
40
40
  - `engineConfiguration.hash`: hash of file.
41
41
 
42
- ### `engineData`
42
+ ### `enginePlayData`
43
43
 
44
- Engine Data.
44
+ Engine Play Data.
45
45
 
46
- - `engineData.path`: path to file.
47
- - `engineData.buffer`: buffer of file.
48
- - `engineData.hash`: hash of file.
46
+ - `enginePlayData.path`: path to file.
47
+ - `enginePlayData.buffer`: buffer of file.
48
+ - `enginePlayData.hash`: hash of file.
49
+
50
+ ### `engineTutorialData`
51
+
52
+ Engine Tutorial Data.
53
+
54
+ - `engineTutorialData.path`: path to file.
55
+ - `engineTutorialData.buffer`: buffer of file.
56
+ - `engineTutorialData.hash`: hash of file.
49
57
 
50
58
  ### `engineThumbnail`
51
59
 
Binary file
Binary file
Binary file
@@ -1,8 +1,8 @@
1
1
  /// <reference types="node" />
2
2
  export declare class Resource {
3
3
  readonly path: string;
4
- private _hash?;
5
- private _buffer?;
4
+ private _hash;
5
+ private _buffer;
6
6
  constructor(path: string);
7
7
  get hash(): string;
8
8
  get buffer(): Buffer;
package/dist/index.cjs CHANGED
@@ -14,7 +14,7 @@ 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.engineData = exports.engineConfiguration = exports.engineInfo = exports.version = exports.sifcToLevelData = exports.nssToSIFC = void 0;
17
+ exports.engineThumbnail = exports.engineTutorialData = exports.enginePlayData = exports.engineConfiguration = exports.engineInfo = exports.version = exports.sifcToLevelData = exports.nssToSIFC = void 0;
18
18
  const Resource_cjs_1 = require("./Resource.cjs");
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; } });
@@ -22,10 +22,10 @@ __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.0.1';
25
+ exports.version = '1.1.0';
26
26
  exports.engineInfo = {
27
27
  name: 'llsif',
28
- version: 8,
28
+ version: 9,
29
29
  title: {
30
30
  en: 'Love Live!',
31
31
  ja: 'ラブライブ!',
@@ -56,5 +56,6 @@ exports.engineInfo = {
56
56
  },
57
57
  };
58
58
  exports.engineConfiguration = new Resource_cjs_1.Resource('EngineConfiguration');
59
- exports.engineData = new Resource_cjs_1.Resource('EngineData');
59
+ exports.enginePlayData = new Resource_cjs_1.Resource('EnginePlayData');
60
+ exports.engineTutorialData = new Resource_cjs_1.Resource('EngineTutorialData');
60
61
  exports.engineThumbnail = new Resource_cjs_1.Resource('thumbnail.png');
package/dist/index.d.cts CHANGED
@@ -3,10 +3,10 @@ export { nssToSIFC } from './nss/convert.cjs';
3
3
  export * from './nss/index.cjs';
4
4
  export { sifcToLevelData } from './sifc/convert.cjs';
5
5
  export * from './sifc/index.cjs';
6
- export declare const version = "1.0.1";
6
+ export declare const version = "1.1.0";
7
7
  export declare const engineInfo: {
8
8
  readonly name: "llsif";
9
- readonly version: 8;
9
+ readonly version: 9;
10
10
  readonly title: {
11
11
  readonly en: "Love Live!";
12
12
  readonly ja: "ラブライブ!";
@@ -29,5 +29,6 @@ export declare const engineInfo: {
29
29
  };
30
30
  };
31
31
  export declare const engineConfiguration: Resource;
32
- export declare const engineData: Resource;
32
+ export declare const enginePlayData: Resource;
33
+ export declare const engineTutorialData: Resource;
33
34
  export declare const engineThumbnail: Resource;
@@ -53,15 +53,17 @@ const nssToSIFC = (nss) => {
53
53
  const lane = 5 - note.position;
54
54
  const next = notes[i + 1];
55
55
  const prev = notes[i - 1];
56
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
56
57
  const direction = next
57
58
  ? next.position > note.position
58
59
  ? 'Left'
59
60
  : 'Right'
60
- : prev
61
- ? prev.position > note.position
62
- ? 'Right'
63
- : 'Left'
64
- : 'Left';
61
+ : // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
62
+ prev
63
+ ? prev.position > note.position
64
+ ? 'Right'
65
+ : 'Left'
66
+ : 'Left';
65
67
  if (note.effect === index_cjs_1.NSSNoteEffect.Swing) {
66
68
  objects.push({
67
69
  type: 'swing',
@@ -27,7 +27,7 @@ function sifcToLevelData(chart, offset = 0) {
27
27
  if (intermediate.sim) {
28
28
  const beat = intermediate.data[sonolus_core_1.EngineArchetypeDataName.Beat];
29
29
  if (typeof beat !== 'number')
30
- throw 'Unexpected beat';
30
+ throw new Error('Unexpected beat');
31
31
  const intermediates = beatToIntermediates.get(beat);
32
32
  if (intermediates) {
33
33
  intermediates.push(intermediate);
@@ -82,7 +82,7 @@ function sifcToLevelData(chart, offset = 0) {
82
82
  for (const intermediate of intermediates) {
83
83
  const entity = intermediateToEntity.get(intermediate);
84
84
  if (!entity)
85
- throw 'Unexpected missing entity';
85
+ throw new Error('Unexpected missing entity');
86
86
  entity.data.push({
87
87
  name: 'sim',
88
88
  value: 1,
@@ -95,14 +95,16 @@ function sifcToLevelData(chart, offset = 0) {
95
95
  };
96
96
  }
97
97
  exports.sifcToLevelData = sifcToLevelData;
98
- const bpm = (object, append) => append({
99
- archetype: sonolus_core_1.EngineArchetypeName.BpmChange,
100
- data: {
101
- [sonolus_core_1.EngineArchetypeDataName.Beat]: object.beat,
102
- [sonolus_core_1.EngineArchetypeDataName.Bpm]: object.bpm,
103
- },
104
- sim: false,
105
- });
98
+ const bpm = (object, append) => {
99
+ append({
100
+ archetype: sonolus_core_1.EngineArchetypeName.BpmChange,
101
+ data: {
102
+ [sonolus_core_1.EngineArchetypeDataName.Beat]: object.beat,
103
+ [sonolus_core_1.EngineArchetypeDataName.Bpm]: object.bpm,
104
+ },
105
+ sim: false,
106
+ });
107
+ };
106
108
  const tap = (object, append) => {
107
109
  const note = {
108
110
  archetype: 'TapNote',
@@ -2,11 +2,11 @@ export type SIFC = {
2
2
  attribute: number;
3
3
  objects: SIFCObject[];
4
4
  };
5
- export type SIFCObject = SIFCBPMChangeObject | SIFCTapNote | SIFCSwingNote;
5
+ export type SIFCObject = SIFCBpmChangeObject | SIFCTapNote | SIFCSwingNote;
6
6
  type BaseSIFCObject = {
7
7
  beat: number;
8
8
  };
9
- export type SIFCBPMChangeObject = BaseSIFCObject & {
9
+ export type SIFCBpmChangeObject = BaseSIFCObject & {
10
10
  type: 'bpm';
11
11
  bpm: number;
12
12
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sonolus-llsif-engine",
3
- "version": "1.0.1",
3
+ "version": "1.1.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",
@@ -13,21 +13,24 @@
13
13
  "dist"
14
14
  ],
15
15
  "scripts": {
16
- "dev": "sonolus-cli --dev",
17
- "prebuild": "tsc -p . --noEmit && eslint --ext .mts ./src && eslint --ext .cts ./lib",
18
- "build": "tsc -p ./lib/tsconfig.json && sonolus-cli --build && node ./lib/build.mjs"
16
+ "dev:play": "sonolus-cli --dev ./play/sonolus-cli.config.mjs",
17
+ "dev:tutorial": "sonolus-cli --dev ./tutorial/sonolus-cli.config.mjs",
18
+ "prebuild": "tsc -p ./lib --noEmit && tsc -p ./shared --noEmit && tsc -p ./play --noEmit && tsc -p ./tutorial --noEmit && eslint --ext .cts ./lib && eslint --ext .mts ./shared && eslint --ext .mts ./play && eslint --ext .mts ./tutorial",
19
+ "build": "tsc -p ./lib && sonolus-cli --build ./play/sonolus-cli.config.mjs && sonolus-cli --build ./tutorial/sonolus-cli.config.mjs && node ./lib/build.mjs"
20
+ },
21
+ "dependencies": {
22
+ "sonolus-core": "~7.2.0"
19
23
  },
20
24
  "devDependencies": {
21
- "@types/node": "^16.18.36",
22
- "@typescript-eslint/eslint-plugin": "^5.59.11",
23
- "@typescript-eslint/parser": "^5.59.11",
24
- "eslint": "^8.42.0",
25
- "eslint-config-prettier": "^8.8.0",
26
- "eslint-plugin-prettier": "^4.2.1",
27
- "prettier": "^2.8.8",
28
- "prettier-plugin-organize-imports": "^3.2.2",
29
- "sonolus-core": "~7.0.0",
30
- "sonolus.js": "~9.0.0",
31
- "typescript": "~5.1.3"
25
+ "@types/node": "^16.18.40",
26
+ "@typescript-eslint/eslint-plugin": "^6.3.0",
27
+ "@typescript-eslint/parser": "^6.3.0",
28
+ "eslint": "^8.47.0",
29
+ "eslint-config-prettier": "^9.0.0",
30
+ "eslint-plugin-prettier": "^5.0.0",
31
+ "prettier": "^3.0.1",
32
+ "prettier-plugin-organize-imports": "^3.2.3",
33
+ "sonolus.js": "~9.1.0",
34
+ "typescript": "~5.1.6"
32
35
  }
33
36
  }
package/dist/EngineData DELETED
Binary file