Commit Graph

12 Commits

Author SHA1 Message Date
byrongamatos
95d721b795
core: prepare for @ts-check opt-in (app.js + highway.js)
Update the loop_api.test.js regex to tolerate JSDoc cast prefixes on
the slopsmith Object.assign line (needed when files opt into @ts-check
with \`/** @type */ (\\) casts). Adjust slopsmith.d.ts to remove
psarc from the format union (feedback repo is sloppak/loose-only).

The full JSDoc annotations for static/app.js and static/highway.js from
slopsmith/slopsmith#293 require adaptation to the feedback repo's
diverged codebase (v3 UI, capability pipelines, etc.). Files do not
carry \`// @ts-check\` yet, so typecheck passes trivially; the
annotations will be added incrementally in follow-up PRs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-18 00:41:55 -07:00
byrongamatos
de7ced6429
docs: amend Constitution Principle II for tsc --noEmit
- Constitution II: permit `tsc --noEmit` with allowJs/checkJs as a
  CI/dev-time check and encourage JSDoc + `// @ts-check`; emit-mode
  TypeScript, .ts/.tsx source, JSX, frameworks, and bundlers stay
  forbidden in core. Bump version 1.0.0 -> 1.1.0.
- Constitution IV: add static/slopsmith.d.ts to the stable-contract
  surface -- breaking changes need a "Migration notes" CHANGELOG entry.
- CHANGELOG: note the typecheck step + ambient .d.ts under [Unreleased].
- CLAUDE.md: point the Frontend Conventions section at slopsmith.d.ts
  as the typed plugin-contract source of truth.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-18 00:33:22 -07:00
byrongamatos
6f433d9cea
types: add static/slopsmith.d.ts ambient plugin contract
Declares the plugin-facing JS surface as ambient types: window.slopsmith
(event bus + audio/diagnostics namespaces), window.highway (the full
createHighway() renderer API), the highway WebSocket message union
(discriminated on `type`, matching the switch in highway.js), the
setRenderer visualization contract + draw(bundle) shape, and the
keyboard-shortcut API.

Signatures verified against the live source: the `return api` object
at the tail of createHighway(), the `window.slopsmith = Object.assign`
block in app.js, audio-mixer.js, diagnostics.js, and the shortcut
registry in app.js.

Declarations only -- no file carries `// @ts-check` yet, so typecheck
stays trivially green. `tsc --noEmit --listFiles` confirms the .d.ts
is in the program and static/vendor/** is not.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-18 00:31:43 -07:00
byrongamatos
35742c4fae
infra: add tsconfig, typescript devDep, typecheck script, CI step
Adopt JSDoc + // @ts-check + `tsc --noEmit` as a CI/dev-only type
check. No emit step, no runtime dependency: shipped .js files stay
byte-identical, typescript is a devDependency only.

- tsconfig.json: allowJs + checkJs:false so only files carrying an
  explicit `// @ts-check` directive are checked; strict mode; DOM libs.
  `include` matches static/**/*.d.ts so the upcoming ambient contract
  is loaded into the program. moduleDetection is left at the default
  `auto` on purpose -- app.js/highway.js carry no import/export and
  must stay global scripts so cross-file globals resolve.
- package.json: typescript devDep + `npm run typecheck`.
- tests.yml: setup-node + `npm ci` + typecheck step before pytest.
  This also gives the existing JS plugin-API test step an explicit
  Node toolchain.

No file carries `// @ts-check` yet, so typecheck passes trivially.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-18 00:31:38 -07:00
byrongamatos
cad78857fb Remove the v3 Support Us! donate button (no funding surface)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 11:52:44 +02:00
byrongamatos
edf8f46866 Repoint dead slopsmith URLs -> got-feedback
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 11:02:04 +02:00
byrongamatos
97a1e5fbf5 Fix two regressions in the terminology purge
- diagnostics_redact: keep '.psarc' in the song-filename scrub regex.
  The purge swapped it for '.archive' (not a real extension), which
  would leak real .psarc filenames still on users' disks into
  diagnostic bundles. This is a redaction allow-list, not brand text.
- sloppak: the legacy lyrics-source alias was a no-op
  ({"notechart": "notechart"}), so old manifests with
  lyrics_source=="sng" fell back to "xml" instead of migrating.
  Map {"sng": "notechart"} so the rename stays back-compatible.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 21:19:16 +02:00
Sin
c1870a0597 Improve wording in terminology cleanup
Replace the placeholder noun left by the previous pass with context-fit
phrasing (arrangement XML, chart, custom songs, etc.).
2026-06-16 19:43:45 +01:00
Sin
4148b0e72e Purge external-format terminology from code, tests and docs
Reword comments/docstrings/strings and rename identifiers that referenced
the external game and its file formats:

- format-id "psarc" -> "archive"; local vars psarc_path -> song_path,
  psarc_base -> tone_base
- lyrics provenance value "sng" -> "notechart" (legacy "sng" still accepted)
- highway_3d fret-ghost scope value "rocksmith" -> "chords" (invalid/legacy
  values fall back to the default, preserving behaviour)
- neutralise references in prose, test names/data, .gitattributes and docs

No functional change beyond the renamed identifiers; all Python compiles.
2026-06-16 19:36:53 +01:00
Sin
bc0e83c345 Make the library loader sloppak/loose-only
Remove the vestigial encrypted-archive ingestion path that the loader can
no longer service:

- scanner no longer lists .psarc files; library is sloppaks + loose folders
- upload endpoint accepts .sloppak only (drop .psarc + magic-byte branch)
- delete endpoint handles sloppak/loose only
- drop the psarc_platform (pc/mac) setting, its validation and tests
- default CONFIG_DIR no longer references an external game data folder
- drop the now-unused pycryptodome dependency (no module imports it)
- correct stale comments that described scanning as archive decryption

Updates test_settings_api / test_settings_export to match (scan fixtures
now build .sloppak stubs).
2026-06-16 19:09:53 +01:00
Sin
fca0137989 Remove unused binary test fixture; correct stale scan comments
Drop an orphaned 4 MB binary fixture that no test references, and fix
two docstrings that inaccurately described the scanner as performing
archive decryption. The loader is sloppak/loose-folder only and does
not decode proprietary archives (see lib/scan_worker.py).
2026-06-16 18:49:40 +01:00
byrongamatos
6c110398b4 Clean release snapshot 2026-06-16 18:47:13 +02:00