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

Add mode as development #1653

Merged
merged 3 commits into from
Feb 8, 2019
Merged

Add mode as development #1653

merged 3 commits into from
Feb 8, 2019

Conversation

hiroppy
Copy link
Member

@hiroppy hiroppy commented Feb 7, 2019

fixes #1560

  • This is a bugfix
  • This is a feature
  • This is a code refactor
  • This is a test update
  • This is a docs update
  • This is a metadata update

For Bugs and Features; did you add new tests?

yes

Motivation / Use-Case

Separate the place to build the configuration file from bin/webpack-dev-server.js in order to make it easier to test.

Add mode flag as development.

Breaking Changes

no

Additional Info

I will increase the coverage of the test with other PRs.

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

Some notes. Good work!


const Server = require('../lib/Server');

const addEntries = require('../lib/utils/addEntries');
const createDomain = require('../lib/utils/createDomain');
const createLogger = require('../lib/utils/createLogger');
const createSchema = require('../lib/utils/createSchema');
Copy link
Member

Choose a reason for hiding this comment

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

Good idea, maybe better name for this are createConfig (avoid misleading between schema and configuration)?

const path = require('path');
const { defaultTo } = require('../../bin/utils');

module.exports = function processOptions(config, argv, { port }) {
Copy link
Member

Choose a reason for hiding this comment

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

Same here createConfig

@codecov
Copy link

codecov bot commented Feb 7, 2019

Codecov Report

Merging #1653 into master will decrease coverage by 7.02%.
The diff coverage is 61.44%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1653      +/-   ##
==========================================
- Coverage   82.64%   75.62%   -7.03%     
==========================================
  Files          15       18       +3     
  Lines         484      603     +119     
  Branches      120      171      +51     
==========================================
+ Hits          400      456      +56     
- Misses         67      113      +46     
- Partials       17       34      +17
Impacted Files Coverage Δ
test/fixtures/schema/webpack.config.simple.js 100% <100%> (ø)
lib/utils/createConfig.js 60.97% <60.97%> (ø)
bin/utils.js 13.88% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a52f2d7...65956e1. Read the comment docs.

@hiroppy
Copy link
Member Author

hiroppy commented Feb 7, 2019

✅ rename createSchema to createConfig

"watchOptions": undefined,
},
"entry": "./app.js",
"mode": "development",
Copy link
Member Author

Choose a reason for hiding this comment

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

mode is added to the config.

Copy link
Member

Choose a reason for hiding this comment

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

👍

@alexander-akait
Copy link
Member

Let's wait CI green and merge 👍

@hiroppy
Copy link
Member Author

hiroppy commented Feb 8, 2019

Only the MacOS Node 11 fails the test.
It seems that #1588 has recurred.
But in my pc, it is not caused😂

https://travis-ci.org/webpack/webpack-dev-server/jobs/490304902

@alexander-akait
Copy link
Member

Very weird, because test passed before and all works fine 😕 , maybe we can find what tests fails?

@hiroppy
Copy link
Member Author

hiroppy commented Feb 8, 2019

@evilebottnawi CI is green 🍏 I do not know the cause😵 Thank you for rebuilding.

@alexander-akait
Copy link
Member

@hiroppy any ideas why coverage is dercrease?

@hiroppy
Copy link
Member Author

hiroppy commented Feb 8, 2019

@alexander-akait
Copy link
Member

👍

@alexander-akait alexander-akait merged commit 5ea376b into webpack:master Feb 8, 2019
@alexander-akait
Copy link
Member

Great job, thanks for helping 👍

@hiroppy hiroppy deleted the default-mode-development branch February 8, 2019 15:18
@hiroppy
Copy link
Member Author

hiroppy commented Feb 8, 2019

Can we release a patch version?😏

@alexander-akait
Copy link
Member

@hiroppy need minor release other feature will be merged already, i think we can solve couple issues and do release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setup without warnings (defaults to production mode)
2 participants