-
Notifications
You must be signed in to change notification settings - Fork 10
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
Clean up config files (and use new .config
dir)
#613
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You will have to run `bundle install` locally.
Splines
changed the title
Remove unused config files
Clean up config files (and use new Apr 9, 2024
.config
dir)
fosterfarrell9
approved these changes
Apr 16, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pre-requisites
As versions of rubocop and eslint have changed, you will have to run:
For these new versions to also be available in the respective docker containers, you have to rebuild the images:
Maybe, as an alternative, one could also execute
bundle install
andyarn install
inside the docker container but I haven't tried that.Get rid of unused config files
We have a lot of config files at the root of this project. I removed some of them as they are not needed in my eyes:
.browserlistrc
: used withbrowserslist
as a config to share browsers and Node.js versions across different front-end tooling. We only had the worddefault
in there. And I don't see which tools that we use at MaMpf would actually need this. So, let's get rid of it..travis.yml
: Travis is a CI/CD solution. We use GitHub Actions right now and not Travis.babel.config.js
: This is a bit tricky one. The idea of babel is great: be able to use brand-new JS syntax but still support all browsers by compiling it down to a supported version as can be seen here. However,This is a warning you get when choosing "in the browser" here. See also the first sentence here. The only occurrence of the word "babel" I can find in our codebase is in lock files. That's why I'm pretty sure webpacker -- the tool we use to precompile all our assets -- does not even know about babel and the respective config file. Instead, we used a polyfill in the browser, which is dating back to August 2017 (!), see here.
Additionally, I'm pretty sure we don't leverage some very niche new JS features --at least none that modern browsers could not support. And ES6 is indeed supported in all modern browsers. Many of our files are written in coffeescript anyways. While I do think we should maybe support some browser up to maybe 1 to 2 years old, we should do this in precompilation steps already and not bundle a heavy polyfill on every browser request. If so, we should do this alongside #454 and in a manner such that we only really use polyfills where necessary and only components that we really need.
Deleting the babel polyfill from the
_head.html.erb
file will only make pages load faster. It might break the UI for users that are on 5 year old browser, but I don't think it's our job to support those..coffeelint.json
: we want to get away from CoffeeScript and don't use this lint file right now in any tool. New JS files already make use of ESLint, so this should also be a motivation to move to JS to get proper linting ;).rspec
: Removed here, will be added back in to the right location and with updated content in Add unit tests back to pipeline & improve VSCode integration #581.erb-lint.yml
: I left that one in as we have plans to use the respective shopify plugin as described in Ease compliance with code style guidelines: autoformatting, linting and VSCode settings #565postcss.config.js
: We make use of this file via the postcss-loader in webpacker, see here. However, I found it strange that while we do have the string "css-loader" in our codebase, we don't specify "postcss-loader". Still, somehow this file is loaded and trying to break it (e.g. remove a[
) resulted in aModuleBuildError
during a test build in mampf-experimental. I couldn't find a way to move this configuration file to the.config/
folder, so let's leave it in the root for now and tackle this holistically within the realms of Webpacker has been retired / Upgrade frontend bundling #454.Move config files to their own
.config
folderApart from that, for the moving of config files into their own
.config/
folder, see this proposal.Scope / Other files
.gitignore
are exempt from this as their position relative to the root actually encodes a meaning, e.g. one can have gitignores just for subdirectories.entrypoint.sh
orinitialize.sh
might be moved to a better place (but not.config/
) in a subsequent PR.Gemfile
andpackage.json
as well as the respective lock files stay in the root.config.ru
andRakefile
so far as I fear breaking the build. Maybe, they can be tackled in a possible future PR.mampf-gui-transparent.png
will be deleted in a subsequent PR that will aim at improving the Readme.TODO
For reviewers
Apart from all other mentioned "things", please consider these points in particular:
.js
and.js.erb
files automatically on save and according to our rules.bundle exec rubocop
should yield exactly 15 offenses (that will be autofixed in a subsequent PR).During the build, note that the following warnings have already been issues even before this PR: