Skip to content

Improve: Overhaul tests, export types, perf work #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Nov 22, 2020
Merged

Improve: Overhaul tests, export types, perf work #8

merged 8 commits into from
Nov 22, 2020

Conversation

joshuatz
Copy link
Owner

This PR will merge some major improvements to this package, as well as fix some minor bugs.

Improvements:

  • Cleanup types, replace @ts-check with real TSC setup
  • Add exported types (generated from JSDoc)
  • Add performance test script
  • Improve performance (considerably, average ~2x)
  • Overhaul / major refactor of test setup
  • Some minor bug fixes / catching unusual input options

 - Replaced all `@ts-check` uses with tsconfig enforced checking
 - Added tsconfig and configured to emit types from JSDoc JS
 - Add jsconfig for separate __tests__ directory
 - Split up global augmentation vs types
 - Improve type-safety (`noImplicitAny`, plus refactors)
 - Move to `/dist` folder for specifying included files
 - Had to refactor filelist-handler to class instead of IIFE
	 - JSDoc / TS has a hard time with exporting the type of the inner
	 constructor, without a bunch of manual (and messy) workarounds
	 - Easier to just rewrite to ES2015 / ES6 class
 - Tests no longer run in source code directory! Now run in sys temp
 - Refactors a lot of the code around test setup
 - Cleanup how paths are handled; always use forward slashes internally
	 - This also makes testing more flexible and repeatable
 - General test cleanup
 - Closes #6
 - Renamed some options
 - Add bulk file test script to gather some simple stats on speed
 - Fix some minor type issues
 - Add tsc check script entry (`--noEmit`)
 - Switch over child_process.exec to .spawn, for speed
 - Rewrite getTimestampsFromFile to be optimized for bulk files
	 - This is now `getTimestampsFromFilesBulk`
	 - Use new spawn wrapper
	 - Optimize some git commands
 - Misc type fixes, cleanup, etc.
 - Add some extra logging to tests
 - Recent performance tweak caused cache to be completely overwritten
 with new results on each run, instead of merged with new values
 - Fix cache update code, and add test to verify
 - Was throwing fatal error (ENOENT) early in scrape, if a requested
 file in the input options does not exist
 - Fix allows scrape to continue running, noting error, and extracting
 results for the rest of the files that *do* exist
 - Also fix badge URLs in README
 - Exclude local tarball builds from git
 - Update TSConfig to mirror Node10 recommendation
 - More descriptive getStamps JSDoc comment
@joshuatz joshuatz added the enhancement New feature or request label Nov 22, 2020
@joshuatz joshuatz self-assigned this Nov 22, 2020
@codecov-io
Copy link

codecov-io commented Nov 22, 2020

Codecov Report

Merging #8 (6b0a32f) into main (a471112) will increase coverage by 1.17%.
The diff coverage is 96.55%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main       #8      +/-   ##
==========================================
+ Coverage   89.31%   90.48%   +1.17%     
==========================================
  Files           5        6       +1     
  Lines         393      452      +59     
==========================================
+ Hits          351      409      +58     
- Misses         42       43       +1     
Impacted Files Coverage Δ
src/cli.js 86.66% <ø> (ø)
src/helpers.js 82.35% <90.47%> (+1.55%) ⬆️
src/index.js 94.23% <90.90%> (+2.07%) ⬆️
tst-helpers.js 89.23% <96.87%> (ø)
src/filelist-handler.js 98.93% <100.00%> (+2.12%) ⬆️
src/stamp-handler.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a471112...6b0a32f. Read the comment docs.

@joshuatz joshuatz merged commit 813d40a into main Nov 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants