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

(WIP) Cli node flags #439

Closed
wants to merge 45 commits into from
Closed

(WIP) Cli node flags #439

wants to merge 45 commits into from

Conversation

matheus1lva
Copy link
Member

@matheus1lva matheus1lva commented May 7, 2018

What kind of change does this PR introduce?

Feature
Did you add tests for your changes?
Yes

If relevant, did you update the documentation?

Summary
The last implementation of allowing node flags into cli was buggy and after talking to @ev1stensberg he told me what was happening, something i did not realize in the past.

So, @ev1stensberg i've tested this with a real world project, and i did not have any bizillions of proccess being spawned. Please have a look, this time cis are working 100%.

@webpack-bot
Copy link

@playma256 The most important CI builds failed. This way your PR can't be merged.

Please take a look at the CI results from travis (failure) and fix these issues.

Copy link
Member

@evenstensberg evenstensberg left a comment

Choose a reason for hiding this comment

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

I think you should base your impl from bin/webpack.js. Same as the other PR, but fixing the issue where node respawns, i.e when webpack returns from it's scope, it should return the entire process, not only just process.child

bin/webpack.js Outdated
Author Tobias Koppers @sokra
*/

(function() {
Copy link
Member

Choose a reason for hiding this comment

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

Don't remove IIFEE here, its for perf + being able to use return.

bin/webpack.js Outdated
// Prefer the local installation of webpack-cli
if (importLocal(__filename)) {
return;
const spawn = require("cross-spawn");
Copy link
Member

Choose a reason for hiding this comment

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

Is everything from here taken from the previous PR? #377

@webpack-bot
Copy link

@playma256 Thanks for your update.

I labeled the Pull Request so reviewers will review it again.

@ev1stensberg Please review the new changes.

@matheus1lva
Copy link
Member Author

fixed somethings but appveyor seems to be breaking on something else... even when i rolled back these changes, any ideas?

});

// terminate children
process.on("SIGINT", () => {
Copy link
Member

Choose a reason for hiding this comment

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

This & webpackCliProcess didn't throw as intended in the last PR. Make sure to exit the scope entirely.

});

// when main process was exited.
process.on("exit", (code) => {
Copy link
Member Author

@matheus1lva matheus1lva May 9, 2018

Choose a reason for hiding this comment

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

This was the part "missing" @ev1stensberg , the other one above just relied on Ctrl/Cmd+C which sometimes was not the case. I've compared twice master branch and this branch, both are running almost identical (spawning 1 process, when tests for node-flags are running) in terms of process being spawned and this branch is not spawning billions anymore. I'm going to keep an eye on the CI to see if it fails, if so why.

@matheus1lva
Copy link
Member Author

It is failing, but it isnt even starting to run the tests, it is failing with the following error message: Object.entries is not a function:

npm install --global codecov
C:\Users\appveyor\AppData\Roaming\npm\codecov -> C:\Users\appveyor\AppData\Roaming\npm\node_modules\codecov\bin\codecov
+ [email protected]
added 55 packages from 59 contributors in 2.062s
npm install eslint-plugin-node@latest --save-dev
npm WARN [email protected] requires a peer of conventional-changelog-lint@~1.1.0 but none is installed. You must install peer dependencies yourself.
+ [email protected]
updated 1 package in 21.437s
npm ERR! Object.entries is not a function

@evenstensberg
Copy link
Member

Which nodejs version are you on? Also, could you rebase against the next branch? This PR is quite bad if anything goes wrong :D

@matheus1lva
Copy link
Member Author

I'm on 8.11 and also tested on 6.11. I'm going to double test on v6 before rebasing.

@matheus1lva
Copy link
Member Author

Also, should this be merged into next too?

@evenstensberg
Copy link
Member

Only next, it's a flaky PR, needs testing before releasing. Better to try out on next branch before publishing

@matheus1lva matheus1lva changed the base branch from master to next May 10, 2018 12:23
@matheus1lva matheus1lva changed the base branch from next to master May 10, 2018 12:26
dhruvdutt and others added 11 commits May 10, 2018 09:29
* cli(refactor): improve folder structure

* chore(linting): fix linter errors

* cli(filepath): use local import instead

* cli(migrate): refactor error handling

* chore(review): fix review comments

* chore(review): fix review comments

* chore(review): fix review comments
…tation (#379)

* docs(commits): listed the list of type of commits available
* cli(init): mode support to config
* cli(init): skip redundant question

* cli(init): use mini-css-extract-plugin
…392)

* cli(refactor): fetch available modes directly from webpack options schema

* cli(refactor): Retrieve information from webpackOptionSchema
* misc(add): variable parity, prettify

* cli(add): write config to yeoman-rc

* misc(add): improve generator questions
matheus1lva and others added 26 commits May 10, 2018 09:37
* cli(migration): Update UglifyJS migration file to fit webpack4 configuration

* cli(migration): Add cases where require variable does not need to exist

* cli(migration): Add transformation for usage of webpack.otimization.UglifyPlugin

* cli(tests): Update test snapshots after updating transformation

* cli(fix): fix expressionContent being null

* cli(refactor): remove plugins array if empty

Created function on ast-utils so every other transformation can use this.

* tests: add tests for new ast-utils method

* fix: fix test names and jsdoc

* fix: update maxSize for utils folder
* ast(refactor): wip refactor

* ast(refactor): wip refactor

* ast(init): refactor

* test(refactor): refactor test suite

* tests(define): swap args

* ast(parsing): refactor stuff

* ast(init): refactor

* ast(init): refactor tests

* chore(tests): remove some unneeded tests

* chore(pkg): update package.json

* chore(project): clear up project structure

* chore(cli): remove unneded files

* chore(git): add gitignore to yeoman file

* chore(deps): update pkg.json

* tests(snapshots): update snapshots

* tests(jest): use empty module for snapshots

* tests(snap): only test one prop
* chore(release): [WIP] add semantic-release

* test(ci): wip

* test(ci): add node versions

* test(ci): remove extra test

* tests(ci): revise

* tests(ci): only push to npm on master

* tests(ci): use matrix on jobs

* tests(ci): revise

* tests(ci): update

* tests(ci): test

* tests(ci): test

* tests(ci): p

* tests(ci): update travis.yml
* use yargs.command instead of yargs.option for sub-commands

* cli(node): Add node flags to CLI (#377)

* feat: add support for node flags

* tests: Fix node-flags test

* misc: Fix test failing due to not-found webpack-cli

* misc: remove comment

* misc: refactor removing unecessary args

* tests: add more tests to prevent argument collision

* cli(cmds): remove strict

* fix(node): remove node option for now
* cli(init): revise installation steps

* chore(formatting): format code

* cli(tests): refactor tests
chore(greenkeeper): Update dependencies to enable Greenkeeper 🌴
@matheus1lva matheus1lva changed the base branch from master to next May 10, 2018 12:48
@matheus1lva
Copy link
Member Author

@ev1stensberg it messed up everything... i'm going to start a branch from next and open a new pr... it will start fresh. Brb.

@matheus1lva matheus1lva deleted the cli-node-flags branch May 10, 2018 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants