-
Notifications
You must be signed in to change notification settings - Fork 41
Adjust repo for babel removal (move JS files from src/ to lib/) #34
Conversation
We don't need to compile anything anymore, apparently, so just move the "source" files to lib/.
There shouldn't be any scripts for compiling the code anymore. This makes `npm install` and `npm publish` work again.
This is the main code directory of the repo now. It should not be .gitignored anymore.
|
pinging @aminya and @sadick254... This PR finishes something that was started in #31 (6e6ad69) and makes CI passing again for this repository. Let me know what you think, and feel free to merge this if it looks good. |
| "tdd": "electron-mocha test/**/*.test.js --ui=tdd --renderer --interactive", | ||
| "build": "rimraf lib && babel src -d lib", | ||
| "prepare": "npm run build" | ||
| "tdd": "electron-mocha test/**/*.test.js --ui=tdd --renderer --interactive" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to remove build and prepare.
| "name": "electron-link", | ||
| "version": "0.5.0", | ||
| "description": "Generates scripts to pass to V8's `mksnapshot` tool.", | ||
| "main": "lib/index.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "main": "lib/index.js", | |
| "main": "src/index.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the catch.
My suggestions are what I should have done. I don't understand why the files are moved.
|
That would work. I'm not sure if anyone uses this package and manually uses I don't care strongly either way, but maybe this is a major version bump kind of change for semver purposes. For the record, this package is used outside of Atom in various other projects: https://github.com/atom/electron-link/network/dependents (about three or four non-Atom projects if you page through) |
sadick254
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great. It is better if we transfer src to lib and delete src. As @DeeDeeG has pointed out this package is used outside of Atom in various other projects.
Requirements for Contributing a Bug Fix
Identify the Bug
As of the second-to-last commit in #31 (6e6ad69),
babelisn't meant to run in this repository anymore.babelisn't available in thedevDependencies. However, the rest of the repository expects babel to "compile" (mostly copy-paste) the files fromsrc/tolib/, which isn't happening anymore as of #31.The current state of the repository causes the "build" and "prepare" scripts to error out, as they had been running
babelto compile the source code, but it is missing from thedevDependencies.This means
npm install(andnpm publish) are broken in this repository, and CI is failing.Description of the Change
As mentioned already in #31, the code in this repository doesn't actually need to be compiled anymore in order to be compatible with modern Node.js.
This Pull Request simply moves the JS files from
src/tolib/where this package and its consumers expect them to be... and cleans up the repository in various ways:buildandpreparescripts inpackage.json, which previously ran babel on thesrc/files. These scripts aren't needed anymore.testfiles to expect the files to be inlib/, notsrc/..gitignoreing thelibdirectory, as that's where all the code lives now in the repository..npmignoreing thesrcdirectory, as it doesn't exist anymore..npmignoreing appveyor.yml, because consumers of this package don't need our CI config file.Alternate Designs
None.
Possible Drawbacks
This PR means
babelisn't transforming the code anymore.If
babelwas meaningfully changing the functionality of the code (which it shouldn't), then the code will behave slightly different now.Verification Process
CI passes... it would be nice to see if Atom builds and passes its tests with this change as well.
Release Notes
N/A