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

WIP - remove dist from git #299

Merged
merged 11 commits into from
Feb 9, 2018
Merged

WIP - remove dist from git #299

merged 11 commits into from
Feb 9, 2018

Conversation

jasonkarns
Copy link
Member

closes #290

npm runs prepare when a package is installed via git, so we just run compilation in the prepare script (which is incidentally the preferred script over prepublish)

@searls
Copy link
Member

searls commented Nov 16, 2017

Can you add some - [ ] to the comment to describe what's WIP about this? (other than the failing)

@jasonkarns
Copy link
Member Author

Eternally annoyed that browserify blows up when writing to a nonexistent directory instead of creating the necessary directories :/

Made clean script cross-platform (with mkdirp and rimraf devDeps). Compilation is safe after clean has been run.

@jasonkarns
Copy link
Member Author

Still testing yarn's compilation of git deps. Apparently it is quite broken:

yarnpkg/rfcs#79
yarnpkg/yarn#3553

@jasonkarns
Copy link
Member Author

Tests are failing because current "example" tests are broken (they're broken on master, too). Opening separate issue.

@jasonkarns
Copy link
Member Author

@searls I can get this cleaned up and ready to go if we're okay with one scenario not working:

yarn currently doesn't run the npm lifecycle scripts when installing deps from github. It does when installing plain git deps, but yarn doesn't currently run the same install steps for github as they do for git.

yarnpkg/yarn#5235
yarnpkg/rfcs#79

So... if this PR were to be merged, the only people to be impacted would be yarn users installing from github. (yarn users installing from registry; and npm users installing from github would work as intended)

Are we okay with this? Personally, I am (unsurprisingly) since this is a yarn bug and I don't really feel compelled to have all the added annoyance of dealing with committing built assets to account for a bug.

@searls
Copy link
Member

searls commented Jan 20, 2018 via email

@jasonkarns
Copy link
Member Author

jasonkarns commented Jan 20, 2018 via email

@searls
Copy link
Member

searls commented Feb 1, 2018

Will merge if we can:

  • rebase to latest master
  • add links near the top of the README pointing to the npmcdm/latest
  • see all builds pass

In order for the package to be installable via git (and to remove dist
from git), then the `prepare` script will need to be runnable from the
user's machine. Which means `yarn` needs to be available to npm users.
Whitelist files rather than dealing with npmignore override of
gitignore.

Package now includes src, lib, dist, and TS typings. (package.json,
readme, changelog, license are included automatically by npm)

Things no longer included in package: regression, test, examples, docs
Browserify won't create necessary directories. So they need to be
created prior to running the builds. Which also means we need to use a
cross-platform `mkdir` command. And we need to run the clean command as
part of build/preparation so we need cross-platform rm-rf.
Unsure how best to "advertise" the dist download. Custom badge for now.

Link points to dist/ dir at latest published version.
@searls
Copy link
Member

searls commented Feb 5, 2018

I swear to god I'm not trolling you but before we merge install directions also need to be updated. What would you have it say now, since most people are using npm/webpack for building browser apps whereas we were still living in bower/curl land when we started this thing?

https://github.com/testdouble/testdouble.js/blob/master/docs/1-installation.md#for-use-in-browsers

@jasonkarns
Copy link
Member Author

jasonkarns commented Feb 5, 2018 via email

@searls searls merged commit 80d3be6 into master Feb 9, 2018
@searls searls deleted the git-dep branch February 9, 2018 17:47
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.

Update build workflow to deprecate GitHub dist folder, instead publish through a CDN
2 participants