Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 28, 2026

CSVWriterExtensions was using os-lib file I/O APIs (os.Path, os.temp, os.write) in shared source, causing warnings on the JS platform where os-lib is unavailable.

Changes:

  • Moved csvWriterExtensions.scala and csvWriterTest.scala to JVM-specific directories (src-jvm/, test/src-jvm/)
  • Created empty stub object in src-js/csvWriterExtensions.scala for API compatibility (follows existing Stats pattern)
  • Kept csvWriter.scala in shared source (no os-lib dependencies)

API Impact:
Cross-platform methods remain available on both JVM and JS:

  • toCsv() - converts to iterator of CSV lines
  • toCsvString() - converts to CSV string

JVM-only methods that write to disk:

  • writeCsv() - writes to file with os-lib
  • writeCsvIterator() - writes iterator to file with os-lib
// Works on both JVM and JS
val data = Seq((col1 = "a", col2 = "b"))
val csv = data.toCsvString(includeHeaders = true, ',', '"')

// JVM only
data.writeCsv(path = Some(os.pwd / "output.csv"))

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 28, 2026 10:27
Co-authored-by: Quafadas <24899792+Quafadas@users.noreply.github.com>
Co-authored-by: Quafadas <24899792+Quafadas@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix OS lib warnings in JavaScript Move CSV writer extensions to JVM-only to resolve os-lib dependency warning Jan 28, 2026
Copilot AI requested a review from Quafadas January 28, 2026 10:30
@Quafadas Quafadas marked this pull request as ready for review January 28, 2026 10:50
@Quafadas Quafadas merged commit 7f40c43 into update Jan 28, 2026
7 checks passed
Quafadas added a commit that referenced this pull request Jan 28, 2026
* fix os lib on JS warning

* .

* fmty

* .

* Move CSV writer extensions to JVM-only to resolve os-lib dependency warning (#124)

* Initial plan

* Move CSV writer extensions to JVM-only to fix os-lib warning on JS

Co-authored-by: Quafadas <24899792+Quafadas@users.noreply.github.com>

* Fix documentation and naming inconsistency in csvWriterExtensions

Co-authored-by: Quafadas <24899792+Quafadas@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Quafadas <24899792+Quafadas@users.noreply.github.com>

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Quafadas <24899792+Quafadas@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
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