Tone.js icon indicating copy to clipboard operation
Tone.js copied to clipboard

investigate deps

Open error-four-o-four opened this issue 6 months ago • 2 comments

  1. Please make all pull requests on the dev branch. ✅
  2. Don't commit build files ✅
  3. Try to get all tests to pass. ✅

Hey there,

as already mentioned I began to migrate dependencies fs-extra, glob, rimraf

Additionally .mjs and .cjs files were included in the linter config. FYI: simple-sort-import does not work with commonJS files (link). This could be a reason to migrate the scripts. I'd be happy to update this PR and implement this change if you're interested.

I didn't investigate other dependencies yet but npmgraph provides a good entrypoint to do so.

A few other things that caught my attention but aren't implemented yet:

  • ~~The npm script docs fails because scripts/generate_docs.cjs does not exist~~ (has issue)
  • I recently switched from windows to WSL/Ubuntu and had to explicitly set executablePath to make puppeteer happy and successfully run the tests (I think this has a very low priority)
  • ~~Could you please elaborate why tslib is included as a dependency? I guess it's because the .ts files are also included via the field files in package.json, right?~~

error-four-o-four avatar May 27 '25 20:05 error-four-o-four

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.95%. Comparing base (2626e0a) to head (84b2e2d).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #1348   +/-   ##
=======================================
  Coverage   98.95%   98.95%           
=======================================
  Files         203      203           
  Lines       22725    22725           
  Branches      996      997    +1     
=======================================
  Hits        22487    22487           
  Misses        237      237           
  Partials        1        1           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar May 27 '25 20:05 codecov[bot]

closes #1339

Oh dear.

After all this PR reduces the following stats:

  • Amount of dependencies (including devDependencies): 927 => 904
  • Modules with multiple versions: 80 => 78
  • Deprecated Modules: 10 => 3

but there are still a few things to do:

@rollup/plugin-commonjs @types/chai @types/mocha codecov concurrently http-server plotly.js-dist semver typedoc ua-parser-js webpack-cli yargs

When using @rollup/plugin-commonjs >=27 the tests fail because external modules can't be resolved. I've tried to add "allowSyntheticDefaultImports": true to the compiler options but without any success. I'd have to investigate the webpack bundle process and tools a bit further. At the moment I'm very tempted to migrate to vite and vitest but I don't know if this is a viable option (esp. in regard to the workflows of @tonejs/ui and tonejs.github.io) but not today.

error-four-o-four avatar May 29 '25 18:05 error-four-o-four

thank you!! really appreciate the time you put into making the library simpler and more maintainable 🙏🏻

tambien avatar Aug 13 '25 02:08 tambien