Skip to content

Commit

Permalink
Misc
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Aug 8, 2024
1 parent 578092b commit 068cfb9
Show file tree
Hide file tree
Showing 15 changed files with 115 additions and 168 deletions.
6 changes: 3 additions & 3 deletions config/jest/textEncoder.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { TextEncoder, TextDecoder } = require('web-encoding')
import util from 'util'
if (!global.TextEncoder) {
global.TextEncoder = TextEncoder
global.TextEncoder = util.TextEncoder
}
if (!global.TextDecoder) {
global.TextDecoder = TextDecoder
global.TextDecoder = util.TextDecoder
}
5 changes: 0 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@
"body-parser": "^1.20.2",
"browserslist": "^4.18.1",
"canvas": "^2.9.1",
"case-sensitive-paths-webpack-plugin": "^2.4.0",
"cors": "^2.8.5",
"cross-env": "^7.0.2",
"cross-spawn": "^7.0.1",
Expand All @@ -114,9 +113,7 @@
"eslint-plugin-unicorn": "^55.0.0",
"express": "^4.18.2",
"express-basic-auth": "^1.2.1",
"file-loader": "^6.2.0",
"find-yarn-workspace-root": "^2.0.0",
"fs-extra": "^11.1.1",
"html-webpack-plugin": "^5.5.0",
"husky": "^9.0.10",
"jest": "^29.3.1",
Expand All @@ -137,7 +134,6 @@
"react-dev-utils": "^12.0.1",
"react-dom": "^18.0.0",
"react-refresh": "^0.14.0",
"requestidlecallback-polyfill": "^1.0.2",
"rimraf": "^6.0.1",
"rxjs": "^7.0.0",
"semver": "^7.3.4",
Expand All @@ -150,7 +146,6 @@
"tslib": "^2.0.1",
"tss-react": "^4.0.0",
"typescript": "^5.1.3",
"web-encoding": "^1.1.5",
"webpack": "^5.64.4",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react'
import { fireEvent, render, waitFor } from '@testing-library/react'
import { createTestSession } from '@jbrowse/web/src/rootModel'
import 'requestidlecallback-polyfill'

// locals
import LinearGenomeView from './LinearGenomeView'
Expand Down
4 changes: 0 additions & 4 deletions products/jbrowse-react-app/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ module.exports = {
},
},
},
{
loader: require.resolve('file-loader'),
exclude: [/\.(js|mjs|jsx|ts|tsx)$/, /\.html$/, /\.json$/],
},
],
},
],
Expand Down
4 changes: 0 additions & 4 deletions products/jbrowse-react-circular-genome-view/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ module.exports = {
},
},
},
{
loader: require.resolve('file-loader'),
exclude: [/\.(js|mjs|jsx|ts|tsx)$/, /\.html$/, /\.json$/],
},
],
},
],
Expand Down
4 changes: 0 additions & 4 deletions products/jbrowse-react-linear-genome-view/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ module.exports = {
},
},
},
{
loader: require.resolve('file-loader'),
exclude: [/\.(js|mjs|jsx|ts|tsx)$/, /\.html$/, /\.json$/],
},
],
},
],
Expand Down
3 changes: 1 addition & 2 deletions webpack/config/env.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable unicorn/no-array-reduce */
'use strict'

Check warning on line 1 in webpack/config/env.js

View workflow job for this annotation

GitHub Actions / Lint on node 20 and ubuntu-latest

Delete `⏎⏎`

const fs = require('fs')
const path = require('path')
Expand Down
2 changes: 1 addition & 1 deletion webpack/config/getHttpsConfig.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict'

Check warning on line 1 in webpack/config/getHttpsConfig.js

View workflow job for this annotation

GitHub Actions / Lint on node 20 and ubuntu-latest

Delete `⏎⏎`

const fs = require('fs')
const path = require('path')
Expand Down
2 changes: 1 addition & 1 deletion webpack/config/modules.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict'

Check warning on line 1 in webpack/config/modules.js

View workflow job for this annotation

GitHub Actions / Lint on node 20 and ubuntu-latest

Delete `⏎⏎`

const fs = require('fs')
const path = require('path')
Expand Down
2 changes: 1 addition & 1 deletion webpack/config/paths.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict'

Check warning on line 1 in webpack/config/paths.js

View workflow job for this annotation

GitHub Actions / Lint on node 20 and ubuntu-latest

Delete `⏎⏎`

const path = require('path')
const fs = require('fs')
Expand Down
7 changes: 1 addition & 6 deletions webpack/config/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
'use strict'


const fs = require('fs')
const path = require('path')
const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin')
const InlineChunkHtmlPlugin = require('react-dev-utils/InlineChunkHtmlPlugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const { WebpackManifestPlugin } = require('webpack-manifest-plugin')
Expand Down Expand Up @@ -307,10 +306,6 @@ module.exports = function (webpackEnv) {
new ReactRefreshWebpackPlugin({
overlay: false,
}),
// Watcher doesn't work well if you mistype casing in a path so we use
// a plugin that prints an error when you attempt to do this.
// See https://github.com/facebook/create-react-app/issues/240
isEnvDevelopment && new CaseSensitivePathsPlugin(),
isEnvProduction &&
new MiniCssExtractPlugin({
// Options similar to the same options in webpackOptions.output
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict'

Check warning on line 1 in webpack/config/webpack/persistentCache/createEnvironmentHash.js

View workflow job for this annotation

GitHub Actions / Lint on node 20 and ubuntu-latest

Delete `⏎`
const { createHash } = require('crypto')

module.exports = function createEnvironmentHash(env) {
Expand Down
24 changes: 9 additions & 15 deletions webpack/scripts/build.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable no-console */
'use strict'
// Makes the script crash on unhandled rejections instead of silently
// ignoring them. In the future, promise rejections that are not handled will
// terminate the Node.js process with a non-zero exit code.
Expand All @@ -12,8 +10,9 @@ require('../config/env')

const path = require('path')
const chalk = require('chalk')
const fs = require('fs-extra')
const fs = require('fs')
const webpack = require('webpack')
const rimraf = require('rimraf')
const paths = require('../config/paths')
const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles')
const formatWebpackMessages = require('react-dev-utils/formatWebpackMessages')
Expand Down Expand Up @@ -53,7 +52,7 @@ module.exports = function buildWebpack(config) {
.then(previousFileSizes => {
// Remove all content but keep the directory so that
// if you're in it, you don't end up in Trash
fs.emptyDirSync(paths.appBuild)
rimraf.rimrafSync(paths.appBuild)
// Merge with the public folder
copyPublicFolder()
// Start the webpack build
Expand All @@ -65,14 +64,10 @@ module.exports = function buildWebpack(config) {
console.log(chalk.yellow('Compiled with warnings.\n'))

Check warning on line 64 in webpack/scripts/build.js

View workflow job for this annotation

GitHub Actions / Lint on node 20 and ubuntu-latest

Unexpected console statement
console.log(warnings.join('\n\n'))

Check warning on line 65 in webpack/scripts/build.js

View workflow job for this annotation

GitHub Actions / Lint on node 20 and ubuntu-latest

Unexpected console statement
console.log(

Check warning on line 66 in webpack/scripts/build.js

View workflow job for this annotation

GitHub Actions / Lint on node 20 and ubuntu-latest

Unexpected console statement
'\nSearch for the ' +
chalk.underline(chalk.yellow('keywords')) +
' to learn more about each warning.',
`\nSearch for the ${chalk.underline(chalk.yellow('keywords'))} to learn more about each warning.`,
)
console.log(

Check warning on line 69 in webpack/scripts/build.js

View workflow job for this annotation

GitHub Actions / Lint on node 20 and ubuntu-latest

Unexpected console statement
'To ignore, add ' +
chalk.cyan('// eslint-disable-next-line') +
' to the line before.\n',
`To ignore, add ${chalk.cyan('// eslint-disable-next-line')} to the line before.\n`,
)
} else {
console.log(chalk.green('Compiled successfully.\n'))
Expand Down Expand Up @@ -140,9 +135,7 @@ module.exports = function buildWebpack(config) {

// Add additional information for postcss errors
if (Object.prototype.hasOwnProperty.call(err, 'postcssNode')) {
errMessage +=
'\nCompileError: Begins at CSS selector ' +
err.postcssNode.selector
errMessage += `\nCompileError: Begins at CSS selector ${err.postcssNode.selector}`
}

messages = formatWebpackMessages({
Expand Down Expand Up @@ -191,7 +184,7 @@ module.exports = function buildWebpack(config) {

if (writeStatsJson) {
return fs.writeFileSync(
paths.appBuild + '/bundle-stats.json',
`${paths.appBuild}/bundle-stats.json`,
JSON.stringify(stats.toJson()),
)
}
Expand All @@ -202,7 +195,8 @@ module.exports = function buildWebpack(config) {
}

function copyPublicFolder() {
fs.copySync(paths.appPublic, paths.appBuild, {
fs.cpSync(paths.appPublic, paths.appBuild, {
recursive: true,
dereference: true,
filter: file => file !== paths.appHtml,
})
Expand Down
5 changes: 2 additions & 3 deletions webpack/scripts/start.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable no-console */
'use strict'

// Makes the script crash on unhandled rejections instead of silently
// ignoring them. In the future, promise rejections that are not handled will
// terminate the Node.js process with a non-zero exit code.
Expand Down Expand Up @@ -27,7 +26,7 @@ const useYarn = fs.existsSync(paths.yarnLockFile)
const isInteractive = process.stdout.isTTY

// Tools like Cloud9 rely on this.
const DEFAULT_PORT = parseInt(process.env.PORT, 10) || 3000
const DEFAULT_PORT = Number.parseInt(process.env.PORT, 10) || 3000
const HOST = process.env.HOST || '0.0.0.0'

if (process.env.HOST) {
Expand Down
Loading

0 comments on commit 068cfb9

Please sign in to comment.