Skip to content

Add writeIniFile() for song.ini emission - #69

Open
elicwhite wants to merge 1 commit into
create-empty-chartfrom
write-ini-file
Open

Add writeIniFile() for song.ini emission#69
elicwhite wants to merge 1 commit into
create-empty-chartfrom
write-ini-file

Conversation

@elicwhite

Copy link
Copy Markdown
Owner

Serializes IniMetadata (Partial + extraIniFields)
back to song.ini text with:

  • [song] header
  • Known fields emitted in the canonical defaultMetadata order
  • Undefined values skipped
  • Booleans as True/False (Clone Hero convention)
  • extraIniFields appended in insertion order
  • CRLF line endings

Derives its field order from Object.keys(defaultMetadata) rather than
hardcoding a separate FIELD_ORDER list, so new fields added to
defaultMetadata automatically participate in writing.

@elicwhite
elicwhite marked this pull request as ready for review April 20, 2026 04:16
@elicwhite
elicwhite force-pushed the create-empty-chart branch from 1d776fe to dbef712 Compare April 20, 2026 04:16
@elicwhite
elicwhite force-pushed the create-empty-chart branch from dbef712 to 60fcd5e Compare April 20, 2026 04:40
@elicwhite
elicwhite force-pushed the write-ini-file branch 2 times, most recently from 6791016 to 4993c9b Compare April 20, 2026 04:45
@elicwhite
elicwhite force-pushed the create-empty-chart branch from 60fcd5e to 42d80e2 Compare April 20, 2026 04:45
@elicwhite
elicwhite force-pushed the create-empty-chart branch from 42d80e2 to c28bbd2 Compare April 20, 2026 05:09
@elicwhite
elicwhite force-pushed the create-empty-chart branch from c28bbd2 to c6f1e16 Compare April 20, 2026 05:10
@elicwhite
elicwhite force-pushed the write-ini-file branch 2 times, most recently from 9a075ab to 6826cfb Compare April 20, 2026 05:19
@elicwhite
elicwhite force-pushed the create-empty-chart branch from c6f1e16 to 0b28f17 Compare April 20, 2026 05:19
Comment thread src/__tests__/ini-writer.test.ts Outdated
@elicwhite
elicwhite force-pushed the create-empty-chart branch 2 times, most recently from 531bbdf to a3c4753 Compare April 21, 2026 05:06
Comment thread src/__tests__/ini-writer.test.ts Outdated
@elicwhite
elicwhite force-pushed the write-ini-file branch 2 times, most recently from cd27523 to 55a24bd Compare April 21, 2026 16:38
@elicwhite
elicwhite force-pushed the create-empty-chart branch from a3c4753 to d6f9c4f Compare April 21, 2026 16:51
Serializes IniMetadata (Partial<typeof defaultMetadata> + extraIniFields)
back to song.ini text with:
- [song] header
- Known fields emitted in the canonical defaultMetadata order
- Undefined values skipped
- Booleans as True/False (Clone Hero convention)
- extraIniFields appended in insertion order
- CRLF line endings

Derives its field order from Object.keys(defaultMetadata) rather than
hardcoding a separate FIELD_ORDER list, so new fields added to
defaultMetadata automatically participate in writing.

Tests exercise writeIniFile only via round-trip through parseChartAndIni,
per reviewer feedback: build a metadata object, write it, re-parse, and
assert on parsedChart.metadata. No assertions about the serialized ini
text itself (CRLF, field order, True/False formatting, quoting) — those
are implementation details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants