-
Notifications
You must be signed in to change notification settings - Fork 512
Conversation
Codecov Report
@@ Coverage Diff @@
## master #527 +/- ##
==========================================
- Coverage 90.38% 90.11% -0.28%
==========================================
Files 6 4 -2
Lines 364 354 -10
Branches 77 76 -1
==========================================
- Hits 329 319 -10
Misses 35 35
Continue to review full report at Codecov.
|
@bebraw - Wouldn't it just make more sense to migrate this to schema utils and maintain the |
@d3viant0ne Agreed. @evilebottnawi Can you make that change? Better solution over longer term. |
@bebraw let's do it |
0ec10e6
to
0de03b4
Compare
/cc @d3viant0ne @bebraw |
schema-utils
index.js
Outdated
@@ -9,7 +9,7 @@ var ExtractedModule = require("./ExtractedModule"); | |||
var Chunk = require("webpack/lib/Chunk"); | |||
var OrderUndefinedError = require("./OrderUndefinedError"); | |||
var loaderUtils = require("loader-utils"); | |||
var schemaTester = require('./schema/validator'); | |||
var validateOptions = require('schema-utils'); | |||
var loaderSchema = require('./schema/loader-schema'); |
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.
The two schemas can be removed, just pass the path/to/schema.json
to validateOptions
index.js
Outdated
@@ -122,7 +122,7 @@ function ExtractTextPlugin(options) { | |||
if(isString(options)) { | |||
options = { filename: options }; | |||
} else { | |||
schemaTester(pluginSchema, options); | |||
validateOptions(pluginSchema, options, ' Extract Text Plugin'); |
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.
./schema/plugin.json
&& Extract Text Plugin
=> Extract Text Plugin
(no leading space)
Please rename plugin-schema.js
=> plugin.json
index.js
Outdated
@@ -201,7 +201,7 @@ ExtractTextPlugin.prototype.extract = function(options) { | |||
if(Array.isArray(options) || isString(options) || typeof options.options === "object" || typeof options.query === 'object') { | |||
options = { loader: options }; | |||
} else { | |||
schemaTester(loaderSchema, options); | |||
validateOptions(loaderSchema, options, 'Extract Text Loader'); |
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.
./schema/loader.json
&& Extract Text Loader
=> Extract Text Plugin (Loader)
Please rename loader-schema.js
=> loader.json
test/extract.test.js
Outdated
@@ -29,7 +29,10 @@ describe("ExtractTextPlugin.extract()", function() { | |||
ExtractTextPlugin.extract({style: 'file.css'}); | |||
}, | |||
function(err) { | |||
return err.message === 'data[\'style\'] should NOT have additional properties'; | |||
console.log(err.message) |
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.
Needed for tests or forgotten to remove ? 😛
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.
@michael-ciniawsky stupid error 😄
0de03b4
to
7ea0b2b
Compare
index.js
Outdated
@@ -122,7 +120,7 @@ function ExtractTextPlugin(options) { | |||
if(isString(options)) { | |||
options = { filename: options }; | |||
} else { | |||
schemaTester(pluginSchema, options); | |||
validateOptions('schema/plugin.json', options, 'Extract Text Plugin'); |
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.
Just to double check => ./ <= schema...
? (validateOptions use require()
'internally')
index.js
Outdated
@@ -201,7 +199,7 @@ ExtractTextPlugin.prototype.extract = function(options) { | |||
if(Array.isArray(options) || isString(options) || typeof options.options === "object" || typeof options.query === 'object') { | |||
options = { loader: options }; | |||
} else { | |||
schemaTester(loaderSchema, options); | |||
validateOptions('schema/loader.json', options, 'Extract Text Plugin (Loader)'); |
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.
Same as above 😛
7ea0b2b
to
541ab86
Compare
/cc @michael-ciniawsky done |
schema-utils
schema-utils
)
Fixes #524
We can avoid using
$schema
as we can do inwebpack
(https://github.com/webpack/webpack/tree/master/schemas)