Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
100d82c
Remove fs-extra dependency and update file operations to use fs/promises
error-four-o-four May 27, 2025
957082c
Remove rimraf dependency and update build script to use fs.rmSync for…
error-four-o-four May 27, 2025
e262a38
Replace glob with tinyglobby for improved performance and update test…
error-four-o-four May 27, 2025
9c95585
Refactor imports to use node: prefix and update ESLint configuration …
error-four-o-four May 27, 2025
3b094ee
fix: test_html.cjs
error-four-o-four May 27, 2025
e9042ce
Revert "Replace glob with tinyglobby for improved performance and upd…
error-four-o-four May 29, 2025
e66fe62
Refactor test scripts as ES Modules
error-four-o-four May 29, 2025
be6c86a
fix: update docs script to use typedoc directly
error-four-o-four May 29, 2025
b83de3e
Replace glob with tinyglobby
error-four-o-four May 29, 2025
4ae5264
Replace tmp-promise with fs-fixture
error-four-o-four May 29, 2025
0d789a3
Replace showdown with marked
error-four-o-four May 29, 2025
446f6e9
Bump jsdom from 16.7.0 to 26.1.0
error-four-o-four May 29, 2025
ce653e2
Bump @rollup/plugin-commonjs from 25.0.7 to 28.0.3
error-four-o-four May 29, 2025
5089f42
fix: use correct script in 'Check typedocs'
error-four-o-four May 29, 2025
c2468fa
Revert "Bump @rollup/plugin-commonjs from 25.0.7 to 28.0.3"
error-four-o-four May 29, 2025
84b2e2d
Bump @rollup/plugin-commonjs from 25.0.7 to 26.0.3
error-four-o-four May 29, 2025
5c9f2c5
Adding loop functionality to Sampler (#1310) (#1350)
Caden-Hornyak Jun 29, 2025
1091071
revert: rename npm script `docs:json`
error-four-o-four Jul 2, 2025
4b4c93c
fix: update log messages to indicate successful testing
error-four-o-four Jul 2, 2025
b73774f
Revert "fix: use correct script in 'Check typedocs'"
error-four-o-four Jul 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 4 additions & 57 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"Tone"
],
"scripts": {
"build": "npm run increment && rimraf build && npm run ts:build && npm run webpack:build",
"remove": "node -e \"fs.rmSync('./build', { recursive: true, force: true })\"",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also out of curiosity, why remove rimraf? seems like the code was more succinct before

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rimraf pulls in many transitive dependencies. The builtin node module provides the same functionality. The Disadvantage is that it depends on the Nodejs runtime which excludes older Nodejs versions, Bun and Deno users. If it's desired to support them I'd recommend to use premove which has zero dependencies.

I'm uncertain if 'remove' is the best name for this script. One could also name it 'clean' or use it as the npm lifecycle script 'prebuild'.

Less dependencies means a smaller footprint and less maintenance cost

feels good

"build": "npm run increment && npm run remove && npm run ts:build && npm run webpack:build",
"docs": "node scripts/generate_docs.cjs",
"docs:json": "typedoc --options \"./scripts/typedoc.json\" --json \"./docs/tone.json\"",
"increment": "node scripts/increment_version.cjs",
Expand Down Expand Up @@ -77,19 +78,17 @@
"eslint-plugin-simple-import-sort": "^12.1.1",
"fft-windowing": "^0.1.4",
"fourier-transform": "^1.1.2",
"fs-extra": "^8.1.0",
"glob": "^10.3.12",
"html-webpack-plugin": "^5.6.3",
"http-server": "^13.0.2",
"jsdom": "^16.7.0",
"mocha": "^11.1.0",
"plotly.js-dist": "^2.32.0",
"prettier": "^3.2.5",
"puppeteer": "^24.2.1",
"rimraf": "^5.0.5",
"semver": "^5.7.1",
"showdown": "^2.1.0",
"teoria": "^2.5.0",
"tinyglobby": "^0.2.14",
"tmp-promise": "^2.1.1",
"tonal": "^6.0.1",
"ts-loader": "^9.5.1",
Expand Down
2 changes: 1 addition & 1 deletion test/scripts/test_examples.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { resolve } = require("path");
const { exec } = require("child_process");
const { dir } = require("tmp-promise");
const { writeFile } = require("fs-extra");
const { writeFile } = require("fs/promises");
const toneJson = require("../../docs/tone.json");

/**
Expand Down
15 changes: 12 additions & 3 deletions test/scripts/test_html.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { JSDOM } = require("jsdom");
const glob = require("glob");
const { globSync } = require("tinyglobby");
const { resolve } = require("path");
const { readFile, writeFile } = require("fs-extra");
const { readFile, writeFile } = require("fs/promises");
const { exec } = require("child_process");
const { file } = require("tmp-promise");

Expand Down Expand Up @@ -46,7 +46,16 @@ async function testExampleString(str) {
}
}

const htmlFiles = glob.sync(resolve(__dirname, "../../examples/*.html"));
const htmlFiles = globSync(
"*.html",
{
cwd: resolve(__dirname, "../../examples"),
absolute: true
}
);

console.log(htmlFiles);
process.exit();

async function main() {
for (let i = 0; i < htmlFiles.length; i++) {
Expand Down
12 changes: 10 additions & 2 deletions test/scripts/test_integrations.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
#!/usr/bin/env zx
import "zx/globals";
import { glob } from "glob";
import { glob } from "tinyglobby";
import { basename, resolve } from "path";

const integrations = await glob(resolve(__dirname, "../integration/*"));
const integrations = await glob(
"*",
{
cwd: resolve(__dirname, "../integration"),
absolute: true,
onlyDirectories: true,
}
);

for (let dir of integrations) {
await within(async () => {
cd(dir);
Expand Down
2 changes: 1 addition & 1 deletion test/scripts/test_readme.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { JSDOM } = require("jsdom");
const { resolve } = require("path");
const { readFile, writeFile } = require("fs-extra");
const { readFile, writeFile } = require("fs/promises");
const { exec } = require("child_process");
const { file } = require("tmp-promise");
const { Converter } = require("showdown");
Expand Down