Skip to content

CLI: Add watching for .json, .cjs, .mjs, and .ts#1676

Merged
Krinkle merged 4 commits intomainfrom
cli-watch
Feb 15, 2022
Merged

CLI: Add watching for .json, .cjs, .mjs, and .ts#1676
Krinkle merged 4 commits intomainfrom
cli-watch

Conversation

@Krinkle
Copy link
Copy Markdown
Member

@Krinkle Krinkle commented Feb 15, 2022

No description provided.

And add tests for verifying which files are and aren't reacted to,
including coverage for the existing ignoring of events from
"node_modules".

This is prep for #1669.
…ories

Previously the callback would return true for "cwd/node_modules",
then return false for all its immediate sub directories, and also
for all its indirect subdirectories. While these directories were
eventually watched, it could sometimes take considerable time to
iterate over these.

Use node-watch's skip feature to improve on this. And while at it,
move it up a level by ignoring the top-level node_modules as well,
not merely paths that we happen to see somewhere within it. Do both
just in case we don't see the top level for some reason.
Change `run.watch()` to also apply the `--require` file, so that we
can observe any changes to `require.extensions`.

Fixes #1669.
@Krinkle Krinkle merged commit 4048ac4 into main Feb 15, 2022
@Krinkle Krinkle deleted the cli-watch branch February 15, 2022 21:37
Krinkle added a commit that referenced this pull request Jan 18, 2025
These have been included by watch mode since QUnit 2.18, but so far
only benefited you there if you manually passed these as individual
files, or loaded them indirectly at runtime, or used your own glob
that includes mjs and/or cjs.

If you currently run qunit by passing a directory and have matching
files that you want to skip, opt-out by passing `test/*.js` or
`test/**/*.js` explicitly instead of `test/`.

Follows-up #1676.

Cherry-picked from 6f72eeb (3.0.0-dev).

Cherry-picked from 53ee0a7 (3.0.0-dev).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant