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

Update rails-ujs readme #31881

Merged
merged 1 commit into from
Apr 23, 2018
Merged

Update rails-ujs readme #31881

merged 1 commit into from
Apr 23, 2018

Conversation

yewton
Copy link
Contributor

@yewton yewton commented Feb 4, 2018

Summary

Add a note on using yarn autoclean.

Other Information

yarn autoclean --init creates .yarnclean including assets as for current stable version.

Add a note on using `yarn autoclean`.
@rails-bot
Copy link

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @pixeltrix (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

This repository is being automatically checked for code quality issues using Code Climate. You can see results for this analysis in the PR status below. Newly introduced issues should be fixed before a Pull Request is considered ready to review.

Please see the contribution instructions for more information.

@gmcgibbon
Copy link
Member

gmcgibbon commented Apr 22, 2018

I tested this and it seems yarn autoclean doesn't touch files outside of your configured modules folder which is by default node_modules in your project's root. This should not be necessary, see https://yarnpkg.com/lang/en/docs/cli/autoclean/.

@yewton
Copy link
Contributor Author

yewton commented Apr 23, 2018

@gmcgibbon

The problem is that rails-ujs's assets directory under node_modules will be cleaned.

image

This behavior is defined in the package.json.

@rafaelfranca rafaelfranca merged commit cde7c30 into rails:master Apr 23, 2018
@yewton yewton deleted the rails-ujs-with-yarn-autoclean branch April 25, 2018 14:38
knu added a commit to knu/rails that referenced this pull request Aug 12, 2019
Tools like [yarn autoclean]() and [node-prune]() list `assets` as a
directory to prune, and just because `rails-ujs.js` is placed under
`lib/assets/compiled` it is deleted by them.

In my case, rails-ujs was the only package out of more than 1300
packages that got dysfunctional after running `node-prune` (or `yarn
autoclean --init && yarn install`).

A warning is added to the README document by [rails#31881](), but it is
easily missed.  If there is no strong reason to use the subdirectory
name `assets`, the path name should be changed so that no user
attention or action is required.

[yarn autoclean]: https://github.com/yarnpkg/yarn/blob/master/src/cli/commands/autoclean.js#L28
[node-prune]: https://github.com/tj/node-prune/blob/master/prune.go#L101
[rails#31881]: rails#31881
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

5 participants