Skip to content

feat: Make most make commands cross-platform#14671

Merged
liuxingbaoyu merged 12 commits intobabel:mainfrom
liuxingbaoyu:improve-win-dev
Jul 26, 2022
Merged

feat: Make most make commands cross-platform#14671
liuxingbaoyu merged 12 commits intobabel:mainfrom
liuxingbaoyu:improve-win-dev

Conversation

@liuxingbaoyu
Copy link
Copy Markdown
Member

@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
Copy Markdown
Collaborator

babel-bot commented Jun 15, 2022

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

Comment thread scripts/clone-license.js
@nicolo-ribaudo nicolo-ribaudo self-requested a review June 20, 2022 16:42
Comment on lines 3 to 9
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
Copy Markdown
Member Author

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
Copy Markdown
Member Author

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

@liuxingbaoyu
Copy link
Copy Markdown
Member Author

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
Copy Markdown
Member

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

@liuxingbaoyu
Copy link
Copy Markdown
Member Author

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.

Comment thread Makefile.mjs Outdated
Comment thread Makefile.source.mjs
@liuxingbaoyu liuxingbaoyu force-pushed the improve-win-dev branch 8 times, most recently from d692c21 to e5af3b5 Compare July 16, 2022 13:53
Comment thread package.json
Comment on lines 103 to 104
"lint-staged": {
"*.{js,ts}": [
"*.{js,cjs,mjs,ts}": [
"eslint --format=codeframe"
]
},
Copy link
Copy Markdown
Member Author

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
Copy Markdown
Member

@nicolo-ribaudo nicolo-ribaudo left a comment

Choose a reason for hiding this comment

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

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
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 27, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

os: windows outdated A closed issue/PR that is archived due to age. Recommended to make a new issue 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.

Chore/DX: move from make to JS-based taskrunner

4 participants