Skip to content

Commit

Permalink
Bump up to node 18 (#435)
Browse files Browse the repository at this point in the history
* Bump up to node 18

* Fix warning: `Browserslist: caniuse-lite is outdated. `

* Force using particular node and npm versions.

* Update npm range.
  • Loading branch information
DmitryLukyanov committed Jul 25, 2023
1 parent 03a5984 commit f40494e
Show file tree
Hide file tree
Showing 18 changed files with 1,286 additions and 1,084 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "{build}"
environment:
matrix:
- nodejs_version: "16"
- nodejs_version: "18"
cache:
- "%LOCALAPPDATA%\\Yarn"
init:
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: node_js
version: 1.0
node_js:
- "16"
- "18"
cache:
yarn: true
directories:
Expand Down Expand Up @@ -44,15 +44,15 @@ deploy:
tag: latest
on:
tags: true
node: "16"
node: "18"
condition: $TRAVIS_TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+$
- provider: script
edge: true
cleanup: false
script: "chmod +x ./tools/deploy.sh && ./tools/deploy.sh"
on:
all_branches: true
node: "16"
node: "18"
notifications:
slack:
secure: CkwGMCqK7Liq81tnr7wMUJ893JW09caDeio5oOYQmjGwu3FBkwNU7zApRltN6NJ/a14Of97fHre0vMPga7BrNmhDH9ztvh6qafEmZXPYxiZSbOQ5JGYP3SlotIFF+z0WowCt6erXmNeRHzTBCoZKo4Sxd/2ZHLrkm3nVcCnugpIlyiFrhGnv+QIS2JbMVhai/0rYU1+CsIm6Lb/Kt4cpUgbdJGOsUizTZNKHxhgbnElFczaF0bUFbifkP7LRqdEXtsJPodLfPOezKM62BA6rBnlFGPrRKER1r3ZCHOHimAjyIWD6emUc331w2OmhXDuHGL4ZXq94joiHJVhfrnUsIzgewIxE0qKCMO7y4WcAdXCiwY+x1SoOUlUreJp6EkDI0IgiKOCfb8BnjSXV7VhqymGPjuvFvNzBxXyLjo9jceathGsKQ7usFjhVT1JBkmNYadVN8Y7PYEbyzOjWJol/f5Ol4B28pzypVMP3N6M0KKLJZ4gp6vFtobC72u7/7ThCfUfjDaPyf/yoUNmMQN6lLTRGvZnix+NU/DWVptbDrfAOm9+bBN7Z53Kdhfhpzjedr1Bb7Y+UuHSbNbQe0AvZdhzX3qCrneKDmlbIUvJfe1yzVh8981RedBFTXFcAb38wVfofnMrbZPaWw9k9L3fP1V52GYGjN6L2AX0VQZ3/arE=
Expand Down
6 changes: 3 additions & 3 deletions demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@
"toastr": "^2.1.4",
"typescript": "^4.5.3",
"uglify-js": "^3.9.3",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.11.0",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1",
"yargs": "^15.3.0"
},
"browserslist": [
Expand Down
5 changes: 3 additions & 2 deletions demo/tools/version.js → demo/tools/version.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import yargs from 'yargs'
import { spawnSync } from 'child_process'
import packageJson from '../package.json'
import packageJson from '../package.json' assert { type: "json" }
import { pathToFileURL } from 'url'

const version = {
base: packageJson.version,
Expand Down Expand Up @@ -34,7 +35,7 @@ version.copyright = `${packageJson.description} v${
version.combined
} Copyright (c) 2015-${new Date().getFullYear()} ${packageJson.author}`

if (require.main === module) {
if (import.meta.url === pathToFileURL(process.argv[1]).href) {
process.stdout.write(version.copyright)
}

Expand Down
42 changes: 24 additions & 18 deletions demo/webpack.config.babel.js → demo/webpack.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ import HtmlWebpackPlugin from 'html-webpack-plugin'
import ScriptExtHtmlWebpackPlugin from 'script-ext-html-webpack-plugin'
import MiniCssExtractPlugin from 'mini-css-extract-plugin'
import CopyWebpackPlugin from 'copy-webpack-plugin'
import version from './tools/version'
import version from './tools/version.mjs'

import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const configure = (prod) => ({
entry: {
Expand Down Expand Up @@ -67,7 +71,7 @@ const configure = (prod) => ({
COOKIE_PATH: JSON.stringify(yargs.argv.cookiePath),
DEBUG: !prod
}),
new webpack.IgnorePlugin(/vertx/), // https://github.com/webpack/webpack/issues/353
new webpack.IgnorePlugin({resourceRegExp: /vertx/}), // https://github.com/webpack/webpack/issues/353
new webpack.ProvidePlugin({
jQuery: 'jquery'
}),
Expand All @@ -86,8 +90,7 @@ const configure = (prod) => ({
new CopyWebpackPlugin([
{ from: 'src/data', to: 'data' },
{ from: 'src/images', to: 'images' }
]),
new webpack.HashedModuleIdsPlugin()
])
],
optimization: {
runtimeChunk: {
Expand All @@ -96,34 +99,37 @@ const configure = (prod) => ({
splitChunks: {
chunks: 'all',
cacheGroups: {
vendor: {
defaultVendors: {
name: 'vendor',
test: /[\\/](node_modules|vendor)[\\/]/
}
}
}
},
moduleIds: 'deterministic'
},
devtool: 'source-map',
stats: {
assets: false,
colors: true,
chunks: true
},
watchOptions: {
ignored: /node_modules/
},
devServer: {
// hot: true,
contentBase: './build',
publicPath: '/',
compress: true,
clientLogLevel: 'info',
overlay: true,
stats: {
assets: false,
colors: true,
cached: false,
cachedAssets: false
static: './build',
client: {
logging: 'info',
},
devMiddleware: {
// hot: true,
publicPath: '/',
stats: {
assets: false,
colors: true,
chunks: true,
cached: false,
cachedAssets: false
}
}
}
})
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
"packages/*",
"demo"
],
"engines": {
"npm": ">=9.0.0 <10.0.0",
"node": ">=18.0.0 <19.0.0"
},
"scripts": {
"prepare": "husky install",
"precommit": "lint-staged --allow-empty",
Expand Down Expand Up @@ -58,8 +62,8 @@
"stylelint-config-standard": "^22.0.0",
"stylelint-prettier": "^2.0.0",
"stylelint-scss": "^4.0.0",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11"
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4"
},
"packageManager": "yarn@3.1.1",
"resolutions": {
Expand Down
6 changes: 3 additions & 3 deletions packages/miew-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@
"stylelint-scss": "^4.0.0",
"three": "0.131.3",
"typescript": "^4.5.3",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.10",
"webpack-dev-server": "^3.11.0"
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1"
}
}
5 changes: 2 additions & 3 deletions packages/miew-app/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const path = require('path')
const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')

Expand Down Expand Up @@ -53,7 +52,6 @@ module.exports = {
template: './src/index.html',
title: 'Miew – 3D Molecular Viewer'
}),
new webpack.HashedModuleIdsPlugin(),
new MiniCssExtractPlugin()
],
optimization: {
Expand All @@ -73,7 +71,8 @@ module.exports = {
test: /[\\/]node_modules[\\/](?!miew[\\/])/
}
}
}
},
moduleIds: 'deterministic'
},
devtool: 'source-map',
stats: {
Expand Down
14 changes: 7 additions & 7 deletions packages/miew-cli/dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/miew-cli/dist/index.js.map

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions packages/miew-cli/dist/index.modern.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/miew-cli/dist/index.modern.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/miew-cli/dist/miew-cli.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/miew-cli/dist/miew-cli.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/miew/dist/miew.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions packages/miew/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,9 @@
"ttypescript": "^1.5.13",
"typescript": "^4.5.3",
"url-loader": "^4.1.0",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.11.0",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1",
"yargs": "^15.3.0"
}
}

0 comments on commit f40494e

Please sign in to comment.