-
Notifications
You must be signed in to change notification settings - Fork 218
[DRAFT] webpack update #1512
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
Merged
Merged
[DRAFT] webpack update #1512
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
9fa0380
webpack update
8e4d0ed
remove jshint
44dcff5
remove unused import
244e248
cleanup
46a6dd6
merge conflicts
f15c6d1
remove old artifacts
f05ed37
debug logging for initial test validation
0f7f8b6
linting
e8fc8f2
test fixes
a0393a9
more linting
7c159a7
remove debug logging
e8a199f
make javascript
9d1d749
translations
5c8cec8
documentation update
baf1669
remove debug
bd028e8
fix tinyMCE integration
aff2882
fix test
f8664eb
remove npm update from `make javascript`
5564a5e
version bump to 2.11.0
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| RC_ENV=development | ||
| NODE_ENV=development | ||
| BABEL_ENV=development | ||
| NODE_PATH=./openassessment/xblock/static/js/src | ||
| BROWSER=none |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| const { createConfig } = require('@edx/frontend-build'); | ||
|
|
||
| const config = createConfig('eslint'); | ||
|
|
||
| // These rule overrides should be removed at a later date, and the associated code fixed. | ||
| config.rules["import/no-named-as-default"] = "off"; | ||
| config.rules["no-underscore-dangle"] = "off"; | ||
| config.rules["prefer-rest-params"] = "off"; | ||
| config.rules["no-unused-vars"] = "off"; | ||
| config.rules["no-param-reassign"] = "off"; | ||
| config.rules["no-alert"] = "off"; | ||
| config.rules["no-new"] = "off"; | ||
| config.rules["func-names"] = "off"; | ||
| config.rules["max-classes-per-file"] = "off"; | ||
| config.rules["prefer-destructuring"] = "off"; | ||
| config.rules["no-prototype-builtins"] = "off"; | ||
|
|
||
| config.globals["gettext"] = "readonly"; | ||
| config.globals["ngettext"] = "readonly"; | ||
| config.globals["$"] = "readonly"; | ||
| config.globals["MathJax"] = "readonly"; | ||
| config.globals["_"] = "readonly"; | ||
| config.globals["Logger"] = "readonly"; | ||
| config.globals["XBlock"] = "readonly"; | ||
| config.globals["Backbone"] = "readonly"; | ||
| config.globals["Backgrid"] = "readonly"; | ||
| config.globals["rewriteStaticLinks"] = "readonly"; | ||
|
|
||
| module.exports = config; |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| const { createConfig } = require('@edx/frontend-build'); | ||
|
|
||
| module.exports = createConfig('babel'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| default_env: &default_env | ||
| RC_ENV: development | ||
| NODE_ENV: development | ||
| BABEL_ENV: development | ||
| NODE_PATH: './openassessment/xblock/static/js/src' | ||
| BROWSER: none | ||
|
|
||
| development: | ||
| <<: *default_env | ||
|
nsprenkle marked this conversation as resolved.
|
||
|
|
||
| production: | ||
| <<: *default_env | ||
| RC_ENV: production | ||
| NODE_ENV: production | ||
| BABEL_ENV: production | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,11 @@ | ||
| // Karma configuration | ||
| const webpackConfig = require('./webpack.dev.config.js'); | ||
|
|
||
| module.exports = function(config) { | ||
| config.set({ | ||
|
|
||
| // base path that will be used to resolve all patterns (eg. files, exclude) | ||
| basePath: 'openassessment/xblock/static/', | ||
| basePath: 'openassessment/xblock/static', | ||
|
|
||
|
|
||
| plugins: [ | ||
|
|
@@ -15,7 +16,8 @@ module.exports = function(config) { | |
| 'karma-coverage', | ||
| 'karma-sinon', | ||
| 'karma-jasmine-html-reporter', | ||
| 'karma-spec-reporter' | ||
| 'karma-spec-reporter', | ||
| 'karma-webpack' | ||
| ], | ||
|
|
||
| // frameworks to use | ||
|
|
@@ -42,26 +44,17 @@ module.exports = function(config) { | |
| pattern: '../../../node_modules/moment/min/moment-with-locales.min.js', | ||
| served: true, included: false | ||
| }, | ||
| { | ||
| pattern: '../../../node_modules/edx-ui-toolkit/src/js/utils/date-utils.js', | ||
| served: true, included: false | ||
| }, | ||
| { | ||
| pattern: '../../../node_modules/edx-ui-toolkit/src/js/utils/string-utils.js', | ||
| served: true, included: false | ||
| }, | ||
| // | ||
| 'js/src/oa_shared.js', | ||
| 'js/src/*.js', | ||
| 'js/src/lms/*.js', | ||
| 'js/src/studio/*.js', | ||
| 'js/spec/test_shared.js', | ||
| 'js/spec/*.js', | ||
| 'js/spec/lms/*.js', | ||
| 'js/spec/studio/*.js', | ||
| { pattern: 'js/fixtures/*.html' }, | ||
| { pattern: 'js/spec/*.js', watched: false }, | ||
| { pattern: 'js/spec/**/*.js', watched: false }, | ||
| { pattern: 'js/src/oa_shared.js', watched: false }, | ||
| { pattern: 'js/src/*_index.js', watched: false }, | ||
| { pattern: 'js/src/**/*.js', watched: false }, | ||
|
|
||
| // fixtures | ||
| { | ||
| pattern: 'js/fixtures/*.html', | ||
| pattern: 'js/fixtures/*.json', | ||
| served: true, included: false | ||
| } | ||
| ], | ||
|
|
@@ -74,11 +67,14 @@ module.exports = function(config) { | |
| // preprocess matching files before serving them to the browser | ||
| // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor | ||
| preprocessors: { | ||
| 'js/src/*.js': 'coverage', | ||
| 'js/src/lms/*.js': 'coverage', | ||
| 'js/src/studio/*.js': 'coverage' | ||
| 'js/src/*_index.js': ['webpack'], | ||
| 'js/src/**/*.js': ['webpack', 'coverage'], | ||
| 'js/spec/*.js': ['webpack'], | ||
| 'js/spec/**/*.js': ['webpack'], | ||
| 'js/src/oa_shared.js': ['webpack'], | ||
| }, | ||
|
|
||
| webpack: webpackConfig, | ||
|
|
||
| // test results reporter to use | ||
| reporters: ['spec', 'coverage'], | ||
|
|
@@ -105,12 +101,27 @@ module.exports = function(config) { | |
|
|
||
| // start these browsers | ||
| // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher | ||
| browsers: ['PhantomJS'], | ||
| browsers: ['HeadlessChrome'], | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why this change?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. clearing warnings. PhantomJS not supported any more if I recall |
||
| customLaunchers: { | ||
| HeadlessChrome: { | ||
| base: 'ChromeHeadless', | ||
| flags: [ | ||
| '--no-sandbox', | ||
| '--headless', | ||
| '--disable-gpu', | ||
| '--disable-translate', | ||
| '--disable-extensions' | ||
| ] | ||
| } | ||
| }, | ||
|
|
||
| // Continuous Integration mode | ||
| // if true, Karma captures browsers, runs the tests and exits | ||
| singleRun: true | ||
| singleRun: true, | ||
|
|
||
| }); | ||
| resolve: { | ||
| extensions: ['', '.js'], | ||
| } | ||
|
|
||
| }); | ||
| }; | ||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.