Skip to content
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

Simplify build #342

Merged
merged 34 commits into from
Feb 24, 2018
Merged

Simplify build #342

merged 34 commits into from
Feb 24, 2018

Conversation

searls
Copy link
Member

@searls searls commented Feb 21, 2018

Interested in experimenting with moving away from babel+browserify to typescript+rollup, but our build & devDeps are so absurdly complex that I threw in the towel last time. The goal of this PR is to significantly slim down our exposure to various devDeps and build steps by consolidating and eliminating stuff that the tdjs build is doing.

  • update deps (cherry-picked to master)
  • eliminate the browser-run of our unit tests, which means dropping testem, coffeeify, and headless chrome (may re-add later if it's easy under a new build system)
  • drop power-assert and its associated babel plugin (for now, may re-add later)
  • split our test/unit and test/safe tests, so that it's clear whether td means "known version of tdjs you can use to mock things" or "the current working copy being tested", respectively
  • migrate regression/'s test fixtures to test/safe
  • migrate regression/typescript to test/typescript
  • start migrating the actual coffeescript/mocha/GWT tests from regression/src to test/safe. This is a hugely manual pain in the ass, as one might expect.
  • add a teenytest plugin that lets us have a single combined unit test suite (simplyifying/fixing our coverage stats)

Up to now, we've always run our regression suite first under Node and 
then under Phantom (and now Chrome). In 3 years this has cost me about
20 hours in build configuration headache and has caught maybe one bug.

As we look ahead to simplifying the overall build, I'm eliminating this
again. Once we're done cleaning house, I'd be open to reintroducing this
and suspect it'd take a different form
I absolutely love power-assert, but b/c it's tied up with babel, I'm
going to remove it for now until I figure out our next compiler
Change all coffee to JS while we're at it
The reason for this is it's not a great idea to have the safe/ tests
assign `td` to the current version and the unit/ tests to rely on 
the previous release version. Way too confusing/error-prone IMO
@jasonkarns
Copy link
Member

If you move off of browserify, you may also be able to eliminate the need to preemptively create the generated and dist directories. (Only browserify fails to create the necessary directory structure. babel, rollup and webpack all create any necessary directories themselves.) Assuming typescript is also that way, you can eliminate the postclean script, and thus also the mkdirp dep.

Wrote a teenytest plugin to basically filter each test into "unit" vs
not. 

If the test lives in test/unit/…, then `td` is set to the npm
release so they can use a known good version of the lib for mocking.

If the test lives in test/safe then `td` is set to `src/index` so
the working copy can be tested.

This lets us run a single combined `npm test` and also simplifies our
code coverage report into one combined one
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.

None yet

2 participants