Remove MathJax v2 (#16961)

GitOrigin-RevId: 32a43361cfc883aa1a5ed85f6be5432b6e838b9d
This commit is contained in:
Alf Eaton
2024-02-09 09:06:42 +00:00
committed by Copybot
parent 2566dff9d8
commit c997d1dc2b
19 changed files with 73 additions and 204 deletions
+14 -41
View File
@@ -64,7 +64,6 @@ function getModuleDirectory(moduleName) {
}
const mathjaxDir = getModuleDirectory('mathjax')
const mathjax3Dir = getModuleDirectory('mathjax-3')
const pdfjsVersions = ['pdfjs-dist213', 'pdfjs-dist401']
@@ -77,13 +76,6 @@ if (MATHJAX_VERSION !== PackageVersions.version.mathjax) {
)
}
const MATHJAX_3_VERSION = require('mathjax-3/package.json').version
if (MATHJAX_3_VERSION !== PackageVersions.version['mathjax-3']) {
throw new Error(
'"mathjax-3" version de-synced, update services/web/app/src/infrastructure/PackageVersions.js'
)
}
module.exports = {
// Defines the "entry point(s)" for the application - i.e. the file which
// bootstraps the application
@@ -277,57 +269,38 @@ module.exports = {
// https://www.npmjs.com/package/mathjax#user-content-hosting-your-own-copy-of-the-mathjax-components
{
from: 'es5/tex-svg-full.js',
to: `js/libs/mathjax-3-${PackageVersions.version['mathjax-3']}/es5`,
to: `js/libs/mathjax-${PackageVersions.version.mathjax}/es5`,
toType: 'dir',
context: mathjax3Dir,
context: mathjaxDir,
},
{
from: 'es5/input/tex/extensions/**/*.js',
to: `js/libs/mathjax-3-${PackageVersions.version['mathjax-3']}`,
to: `js/libs/mathjax-${PackageVersions.version.mathjax}`,
toType: 'dir',
context: mathjax3Dir,
context: mathjaxDir,
},
{
from: 'es5/ui/**/*',
to: `js/libs/mathjax-3-${PackageVersions.version['mathjax-3']}`,
to: `js/libs/mathjax-${PackageVersions.version.mathjax}`,
toType: 'dir',
context: mathjax3Dir,
},
{ from: 'MathJax.js', to: 'js/libs/mathjax', context: mathjaxDir },
{ from: 'config/**/*', to: 'js/libs/mathjax', context: mathjaxDir },
{
from: 'extensions/**/*',
globOptions: {
// https://github.com/mathjax/MathJax/issues/2403
ignore: ['**/mathmaps/*.js'],
},
to: 'js/libs/mathjax',
context: mathjaxDir,
},
{
from: 'localization/en/**/*',
to: 'js/libs/mathjax',
from: 'es5/a11y/**/*',
to: `js/libs/mathjax-${PackageVersions.version.mathjax}`,
toType: 'dir',
context: mathjaxDir,
},
{
from: 'jax/output/HTML-CSS/fonts/TeX/**/*',
to: 'js/libs/mathjax',
from: 'es5/input/mml.js',
to: `js/libs/mathjax-${PackageVersions.version.mathjax}/es5/input`,
toType: 'dir',
context: mathjaxDir,
},
{
from: 'jax/output/HTML-CSS/**/*.js',
to: 'js/libs/mathjax',
context: mathjaxDir,
},
{
from: 'jax/element/**/*',
to: 'js/libs/mathjax',
context: mathjaxDir,
},
{ from: 'jax/input/**/*', to: 'js/libs/mathjax', context: mathjaxDir },
{
from: 'fonts/HTML-CSS/TeX/woff/*',
to: 'js/libs/mathjax',
from: 'es5/sre/**/*',
to: `js/libs/mathjax-${PackageVersions.version.mathjax}`,
toType: 'dir',
context: mathjaxDir,
},
...pdfjsVersions.flatMap(version => {