chore(deps): update deps to support node 18

This commit is contained in:
Brian Smith
2024-02-28 18:16:28 -05:00
parent 2511556e95
commit 8fb63bb0cf
11 changed files with 22011 additions and 27989 deletions

View File

@@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-20.04 ]
node-version: [ 16 ]
node-version: [ 18 ]
python-version: [ 3.8 ]
steps:
@@ -28,13 +28,13 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: Setup npm
run: npm i -g npm@8.5.x
run: npm i -g npm@10.2.x
- name: Install Firefox 61.0
- name: Install Firefox 123.0
run: |
sudo apt-get purge firefox
wget "https://ftp.mozilla.org/pub/firefox/releases/61.0/linux-x86_64/en-US/firefox-61.0.tar.bz2"
tar -xjf firefox-61.0.tar.bz2
wget "https://ftp.mozilla.org/pub/firefox/releases/123.0/linux-x86_64/en-US/firefox-123.0.tar.bz2"
tar -xjf firefox-123.0.tar.bz2
sudo mv firefox /opt/firefox
sudo ln -s /opt/firefox/firefox /usr/bin/firefox

View File

@@ -10,4 +10,4 @@ on:
jobs:
version-check:
uses: openedx/.github/.github/workflows/lockfileversion-check.yml@master
uses: openedx/.github/.github/workflows/lockfileversion-check-v3.yml@master

View File

@@ -14,8 +14,8 @@ jobs:
matrix:
os: [ ubuntu-20.04 ]
python-version: [ 3.8 ]
node-version: [ 16 ]
npm-version: [ 8.5.x ]
node-version: [ 18 ]
npm-version: [ 10.2.x ]
mongo-version: ["4.4", "7.0"]
services:

2
.nvmrc
View File

@@ -1 +1 @@
16
18

View File

@@ -114,8 +114,8 @@ RUN pip install -r requirements/pip.txt
RUN pip install -r requirements/edx/base.txt
# Install node and npm
RUN nodeenv /edx/app/edxapp/nodeenv --node=16.20.2 --prebuilt
RUN npm install -g npm@8.19.x
RUN nodeenv /edx/app/edxapp/nodeenv --node=18.19.0 --prebuilt
RUN npm install -g npm@10.2.x
# This script is used by an npm post-install hook.
# We copy it into the image now so that it will be available when we run `npm install` in the next step.
@@ -125,7 +125,7 @@ COPY scripts/copy-node-modules.sh scripts/copy-node-modules.sh
# Install node modules
COPY package.json package.json
COPY package-lock.json package-lock.json
RUN npm set progress=false && CXXFLAGS="--std=c++17" npm ci
RUN npm set progress=false && npm ci
# The builder-development stage is a temporary stage that installs python modules required for development purposes
# The built artifacts from this stage are then copied to the development stage.

49574
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -27,7 +27,7 @@
"@edx/paragon": "2.6.4",
"@edx/studio-frontend": "^2.1.0",
"axios": "^0.27.2",
"babel-loader": "8.2.5",
"babel-loader": "^9.1.3",
"babel-plugin-transform-class-properties": "6.24.1",
"babel-polyfill": "6.26.0",
"backbone": "1.4.1",
@@ -42,10 +42,10 @@
"edx-proctoring-proctortrack": "git+https://git@github.com/anupdhabarde/edx-proctoring-proctortrack.git#f0fa9edbd16aa5af5a41ac309d2609e529ea8732",
"edx-ui-toolkit": "1.5.4",
"exports-loader": "0.6.4",
"file-loader": "1.1.6",
"file-loader": "^6.2.0",
"font-awesome": "4.7.0",
"hls.js": "0.14.17",
"imports-loader": "0.7.1",
"imports-loader": "^5.0.0",
"jest-environment-jsdom": "^26.0.0",
"jquery": "2.2.4",
"jquery-migrate": "1.4.1",
@@ -54,6 +54,7 @@
"jwt-decode": "^3.1.2",
"moment": "2.29.4",
"moment-timezone": "0.5.37",
"node-gyp": "10.0.1",
"picturefill": "3.0.3",
"popper.js": "1.12.9",
"prop-types": "15.6.0",
@@ -69,7 +70,7 @@
"requirejs": "2.3.6",
"rtlcss": "2.2.1",
"sass": "^1.54.8",
"sass-loader": "6.0.6",
"sass-loader": "^14.1.1",
"scriptjs": "2.5.9",
"string-replace-webpack-plugin": "0.1.3",
"style-loader": "0.18.2",
@@ -78,7 +79,7 @@
"underscore": "1.8.3",
"underscore.string": "3.3.6",
"universal-cookie": "^4.0.4",
"webpack": "2.7.0",
"webpack": "^5.90.3",
"webpack-bundle-tracker": "0.4.3",
"webpack-merge": "4.1.1",
"whatwg-fetch": "2.0.3",
@@ -105,15 +106,16 @@
"karma-jasmine-html-reporter": "0.2.2",
"karma-junit-reporter": "1.1.0",
"karma-requirejs": "0.2.6",
"karma-selenium-webdriver-launcher": "github:brian-smith-tcril/karma-selenium-webdriver-launcher#loosen-deps",
"karma-selenium-webdriver-launcher": "github:openedx/karma-selenium-webdriver-launcher#0.0.4-openedx.0",
"karma-sourcemap-loader": "0.3.7",
"karma-spec-reporter": "0.0.20",
"karma-webpack": "2.0.9",
"karma-webpack": "^5.0.1",
"plato": "1.7.0",
"react-test-renderer": "16.4.0",
"selenium-webdriver": "3.4.0",
"sinon": "2.3.5",
"squirejs": "0.1.0",
"stylelint-formatter-pretty": "1.0.3"
"stylelint-formatter-pretty": "1.0.3",
"webpack-cli": "^5.1.4"
}
}

View File

@@ -37,7 +37,7 @@ SYSTEMS = {
COLLECTSTATIC_LOG_DIR_ARG = 'collect_log_dir'
# Webpack command
WEBPACK_COMMAND = 'STATIC_ROOT_LMS={static_root_lms} STATIC_ROOT_CMS={static_root_cms} $(npm bin)/webpack {options}'
WEBPACK_COMMAND = 'STATIC_ROOT_LMS={static_root_lms} STATIC_ROOT_CMS={static_root_cms} webpack {options}'
def debounce(seconds=1):
@@ -329,7 +329,7 @@ def webpack(options):
)
sh(
cmd(
'{environment} $(npm bin)/webpack --config={config_path}'.format(
'{environment} webpack --config={config_path}'.format(
environment=environment,
config_path=config_path
)
@@ -349,7 +349,7 @@ def execute_webpack_watch(settings=None):
static_root_lms, config_path = result
static_root_cms, = Env.get_django_settings(["STATIC_ROOT"], "cms", settings=settings)
run_background_process(
'STATIC_ROOT_LMS={static_root_lms} STATIC_ROOT_CMS={static_root_cms} $(npm bin)/webpack {options}'.format(
'STATIC_ROOT_LMS={static_root_lms} STATIC_ROOT_CMS={static_root_cms} webpack {options}'.format(
options='--watch --config={config_path}'.format(
config_path=config_path
),

View File

@@ -155,7 +155,7 @@ def node_prereqs_installation():
# The implementation of Paver's `sh` function returns before the forked
# actually returns. Using a Popen object so that we can ensure that
# the forked process has returned
proc = subprocess.Popen(npm_command, stderr=npm_log_file, env=dict(os.environ, CXXFLAGS="--std=c++17")) # lint-amnesty, pylint: disable=consider-using-with
proc = subprocess.Popen(npm_command, stderr=npm_log_file) # lint-amnesty, pylint: disable=consider-using-with
retcode = proc.wait()
if retcode == 1:
raise Exception(f"npm install failed: See {npm_log_file_path}")

View File

@@ -127,13 +127,14 @@ module.exports = Merge.smart({
output: {
path: path.resolve(__dirname, 'common/static/bundles'),
libraryTarget: 'window'
library: {
type: 'window'
}
},
plugins: [
new webpack.ProgressPlugin(), // report progress during compilation
new webpack.NoEmitOnErrorsPlugin(),
new webpack.NamedModulesPlugin(),
new BundleTracker({
path: staticRootCms,
filename: 'webpack-stats.json'
@@ -155,21 +156,6 @@ module.exports = Merge.smart({
// any other way to declare that dependency.
$script: 'scriptjs'
}),
// Note: Until karma-webpack releases v3, it doesn't play well with
// the CommonsChunkPlugin. We have a kludge in karma.common.conf.js
// that dynamically removes this plugin from webpack config when
// running those tests (the details are in that file). This is a
// recommended workaround, as this plugin is just an optimization. But
// because of this, we really don't want to get too fancy with how we
// invoke this plugin until we can upgrade karma-webpack.
new webpack.optimize.CommonsChunkPlugin({
// If the value below changes, update the render_bundle call in
// common/djangoapps/pipeline_mako/templates/static_content.html
name: 'commons',
filename: 'commons.js',
minChunks: 10
})
],
module: {
@@ -181,42 +167,6 @@ module.exports = Merge.smart({
/\/sinon\.js|codemirror-compressed\.js|hls\.js|tinymce.js/
],
rules: [
{
test: files.namespacedRequire.concat(files.textBangUnderscore, filesWithRequireJSBlocks),
loader: StringReplace.replace(
['babel-loader'],
{
replacements: [
{
pattern: defineHeader,
replacement: function() { return ''; }
},
{
pattern: defineFooter,
replacement: function() { return ''; }
},
{
pattern: /(\/\* RequireJS) \*\//g,
replacement: function(match, p1) { return p1; }
},
{
pattern: /\/\* Webpack/g,
replacement: function(match) { return match + ' */'; }
},
{
pattern: /text!(.*?\.underscore)/g,
replacement: function(match, p1) { return p1; }
},
{
pattern: /RequireJS.require/g,
replacement: function() {
return 'require';
}
}
]
}
)
},
{
test: /\.(js|jsx)$/,
exclude: [
@@ -250,47 +200,6 @@ module.exports = Merge.smart({
test: /\.underscore$/,
use: 'raw-loader'
},
{
// This file is used by both RequireJS and Webpack and depends on window globals
// This is a dirty hack and shouldn't be replicated for other files.
test: path.resolve(__dirname, 'cms/static/cms/js/main.js'),
loader: StringReplace.replace(
['babel-loader'],
{
replacements: [
{
pattern: /\(function\(AjaxPrefix\) {/,
replacement: function() { return ''; }
},
{
pattern: /], function\(domReady, \$, str, Backbone, gettext, NotificationView\) {/,
replacement: function() {
// eslint-disable-next-line
return '], function(domReady, $, str, Backbone, gettext, NotificationView, AjaxPrefix) {';
}
},
{
pattern: /'..\/..\/common\/js\/components\/views\/feedback_notification',/,
replacement: function() {
return "'../../common/js/components/views/feedback_notification',"
+ "'AjaxPrefix',";
}
},
{
pattern: /}\).call\(this, AjaxPrefix\);/,
replacement: function() { return ''; }
},
{
pattern: /'..\/..\/common\/js\/components\/views\/feedback_notification',/,
replacement: function() {
return "'../../common/js/components/views/feedback_notification',"
+ "'AjaxPrefix',";
}
}
]
}
)
},
{
test: /\.(woff2?|ttf|eot)(\?v=\d+\.\d+\.\d+)?$/,
loader: 'file-loader'
@@ -301,12 +210,38 @@ module.exports = Merge.smart({
},
{
test: /xblock\/core/,
loader: 'exports-loader?window.XBlock!'
+ 'imports-loader?jquery,jquery.immediateDescendents,this=>window'
use: [
{
loader: 'exports-loader',
options: { exports: 'window.XBlock' }
},
{
loader: 'imports-loader',
options: {
imports: [
"jquery",
"default jquery immediateDescendents",
],
wrapper: 'window'
}
}
]
},
{
test: /xblock\/runtime.v1/,
loader: 'exports-loader?window.XBlock!imports-loader?XBlock=xblock/core,this=>window'
use: [
{
loader: 'exports-loader',
options: { exports: 'window.XBlock' }
},
{
loader: 'imports-loader',
options: {
imports: "default xblock/core XBlock",
wrapper: 'window'
}
}
]
},
/** *****************************************************************************************************
/* BUILT-IN XBLOCK ASSETS WITH GLOBAL DEFINITIONS:
@@ -333,114 +268,253 @@ module.exports = Merge.smart({
*/
{
test: /xmodule\/assets\/word_cloud\/src\/js\/word_cloud.js/,
loader: 'imports-loader?this=>window'
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
}
]
},
{
test: /xmodule\/js\/common_static\/js\/vendor\/draggabilly.js/,
loader: 'imports-loader?this=>window'
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
}
]
},
{
test: /xmodule\/js\/src\/annotatable\/display.js/,
loader: 'imports-loader?this=>window'
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
}
]
},
{
test: /xmodule\/js\/src\/capa\/display.js/,
loader: 'imports-loader?this=>window'
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
}
]
},
{
test: /xmodule\/js\/src\/capa\/imageinput.js/,
loader: 'imports-loader?this=>window'
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
}
]
},
{
test: /xmodule\/js\/src\/capa\/schematic.js/,
loader: 'imports-loader?this=>window'
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
}
]
},
{
test: /xmodule\/js\/src\/collapsible.js/,
loader: 'imports-loader?this=>window'
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
}
]
},
{
test: /xmodule\/js\/src\/conditional\/display.js/,
loader: 'imports-loader?this=>window'
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
}
]
},
{
test: /xmodule\/js\/src\/html\/display.js/,
loader: 'imports-loader?this=>window'
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
}
]
},
{
test: /xmodule\/js\/src\/html\/edit.js/,
loader: 'imports-loader?this=>window'
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
}
]
},
{
test: /xmodule\/js\/src\/html\/imageModal.js/,
loader: 'imports-loader?this=>window'
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
}
]
},
{
test: /xmodule\/js\/src\/javascript_loader.js/,
loader: 'imports-loader?this=>window'
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
}
]
},
{
test: /xmodule\/js\/src\/lti\/lti.js/,
loader: 'imports-loader?this=>window'
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
}
]
},
{
test: /xmodule\/js\/src\/poll\/poll.js/,
loader: 'imports-loader?this=>window'
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
}
]
},
{
test: /xmodule\/js\/src\/poll\/poll_main.js/,
loader: 'imports-loader?this=>window'
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
}
]
},
{
test: /xmodule\/js\/src\/problem\/edit.js/,
loader: 'imports-loader?this=>window'
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
}
]
},
{
test: /xmodule\/js\/src\/raw\/edit\/metadata-only.js/,
loader: 'imports-loader?this=>window'
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
}
]
},
{
test: /xmodule\/js\/src\/raw\/edit\/xml.js/,
loader: 'imports-loader?this=>window'
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
}
]
},
{
test: /xmodule\/js\/src\/sequence\/display.js/,
loader: 'imports-loader?this=>window'
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
}
]
},
{
test: /xmodule\/js\/src\/sequence\/edit.js/,
loader: 'imports-loader?this=>window'
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
}
]
},
{
test: /xmodule\/js\/src\/tabs\/tabs-aggregator.js/,
loader: 'imports-loader?this=>window'
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
}
]
},
{
test: /xmodule\/js\/src\/vertical\/edit.js/,
loader: 'imports-loader?this=>window'
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
}
]
},
{
test: /xmodule\/js\/src\/video\/10_main.js/,
loader: 'imports-loader?this=>window'
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
}
]
},
/*
* END BUILT-IN XBLOCK ASSETS WITH GLOBAL DEFINITIONS
***************************************************************************************************** */
{
test: /codemirror/,
loader: 'exports-loader?window.CodeMirror'
use: [
{
loader: 'exports-loader',
options: { exports: 'window.CodeMirror' }
}
]
},
{
test: /tinymce/,
loader: 'imports-loader?this=>window'
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
}
]
},
{
test: /xmodule\/js\/src\/xmodule/,
loader: 'exports-loader?window.XModule!imports-loader?this=>window'
use: [
{
loader: 'exports-loader',
options: { exports: 'window.XModule' }
},
{
loader: 'imports-loader',
options: { wrapper: 'window' }
}
],
},
{
test: /mock-ajax/,
loader: 'imports-loader?exports=>false'
use: [
{
loader: 'imports-loader',
options: { exports: 'false' }
}
]
},
{
test: /d3.min/,
@@ -456,8 +530,36 @@ module.exports = Merge.smart({
},
{
test: /logger/,
loader: 'imports-loader?this=>window'
}
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
}
]
},
// spec files that use import
{
test: /lms\/static\/completion\/js\/spec\/ViewedEvent_spec.js/,
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
}
]
},
{
test: /\.js$/,
include: [
"/lms/static/js/learner_dashboard/spec/"
],
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
}
]
},
// end spec files that use import
]
},
@@ -510,7 +612,21 @@ module.exports = Merge.smart({
'common/static/js/vendor/tinymce/js/tinymce',
'node_modules',
'common/static/xmodule'
]
],
// We used to have node: { fs: 'empty' } in this file,
// that is no longer supported. Adding this based on the recommendation in
// https://stackoverflow.com/questions/64361940/webpack-error-configuration-node-has-an-unknown-property-fs
//
// With this uncommented tests fail
// Tests failed in the following suites:
// * lms javascript
// * xmodule-webpack javascript
// Error: define cannot be used indirect
//
// fallback: {
// fs: false
// }
},
resolveLoader: {
@@ -536,9 +652,5 @@ module.exports = Merge.smart({
poll: true
},
node: {
fs: 'empty'
}
}
}, {web: builtinBlocksJS}, workerConfig());

View File

@@ -58,7 +58,7 @@ module.exports = _.values(Merge.smart(commonConfig, {
]
},
watchOptions: {
ignored: [/node_modules/, /\.git/]
ignored: ['/node_modules/', '/\.git/']
}
}
}));