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

feat: Make most make commands cross-platform #14671

Merged
merged 12 commits into from Jul 26, 2022

Conversation

liuxingbaoyu
Copy link
Contributor

@liuxingbaoyu liuxingbaoyu commented Jun 15, 2022

Q                       A
Fixed Issues? Fixes #10889
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes? add shelljs
License MIT

I ported most of the make steps to Makefile.mjs, which makes Windows development and building easier.

@JLHwung JLHwung added the PR: Internal 🏠 A type of pull request used for our changelog categories label Jun 15, 2022
@babel-bot
Copy link
Collaborator

babel-bot commented Jun 15, 2022

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/52611/

import fs from "fs";
import { fileURLToPath } from "url";
import path from "path";

const root = rel => new URL(`../${rel}`, import.meta.url).pathname;
const root = rel =>
path.join(fileURLToPath(path.dirname(import.meta.url)), "../", rel);

Copy link
Contributor Author

@liuxingbaoyu liuxingbaoyu Jul 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error: ENOENT: no such file or directory, open '/F:/babel/.module-type

This is a bugfix, and on Windows it will be an exception.

@liuxingbaoyu
Copy link
Contributor Author

liuxingbaoyu commented Jul 13, 2022

I rebased and added esm support, is there anything else to do, feel free to suggest.

@liuxingbaoyu
Copy link
Contributor Author

liuxingbaoyu commented Jul 14, 2022

After the dependencies are packaged, there is only a lack of parallelism compared to native make, but that's not a big deal.💐

@nicolo-ribaudo
Copy link
Member

nicolo-ribaudo commented Jul 15, 2022

Is bundling needed just to avoid running yarn before make commands? It feels a bit overkill 😅

@liuxingbaoyu
Copy link
Contributor Author

liuxingbaoyu commented Jul 15, 2022

Yes, many of our steps currently remove node_modules, which can be more convenient. (Also I am currently using wsl1 and windows at the same time, due to some problems, will delete more times😓)

Also I think this should be useful in the future, for example we use Makefile.mjs everywhere, or there are other scripts that need to be run before yarn.

Makefile.mjs Outdated Show resolved Hide resolved
Makefile.source.mjs Show resolved Hide resolved
@liuxingbaoyu liuxingbaoyu force-pushed the improve-win-dev branch 8 times, most recently from d692c21 to e5af3b5 Compare Jul 16, 2022
"lint-staged": {
"*.{js,ts}": [
"*.{js,cjs,mjs,ts}": [
"eslint --format=codeframe"
]
},
Copy link
Contributor Author

@liuxingbaoyu liuxingbaoyu Jul 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a small fix.

Copy link
Member

@nicolo-ribaudo nicolo-ribaudo left a comment

Thank you! Let's keep the publishing commands in Makefile, I prefer not to touch them since they work and I'm currently the only one using them 😅

Could we minify Makefile.js? We already have a rollup-plugin-terser dependency.

@liuxingbaoyu liuxingbaoyu changed the title feat: Improve win dev feat: Make most make commands cross-platform Jul 26, 2022
@liuxingbaoyu liuxingbaoyu merged commit e7c3a5f into babel:main Jul 26, 2022
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
os: windows PR: Internal 🏠 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants