Skip to content

Commit

Permalink
Backport PR #13783 on branch 3.5.x (Bump canvas to version with nodej…
Browse files Browse the repository at this point in the history
…s 18 binaries) (#13790)

* Backport PR #13783: Bump canvas to version with nodejs 18 binaries

* Fix all webpack.config.js

* Remove storybook test
  • Loading branch information
fcollonval committed Jan 17, 2023
1 parent bc1477c commit abf02f5
Show file tree
Hide file tree
Showing 17 changed files with 117 additions and 20 deletions.
4 changes: 2 additions & 2 deletions dev_mode/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// This file is auto-generated from the corresponding file in /dev_mode
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
Expand Down Expand Up @@ -300,7 +299,8 @@ module.exports = [
output: {
path: path.resolve(buildDir),
publicPath: '{{page_config.fullStaticUrl}}/',
filename: '[name].[contenthash].js'
filename: '[name].[contenthash].js',
hashFunction: 'sha256'
},
optimization: {
splitChunks: {
Expand Down
9 changes: 8 additions & 1 deletion examples/app/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,19 @@
const data = require('./package.json');
const webpack = require('webpack');
const Build = require('@jupyterlab/builder').Build;
const crypto = require('crypto');

// Workaround for loaders using "md4" by default, which is not supported in FIPS-compliant OpenSSL
const cryptoOrigCreateHash = crypto.createHash;
crypto.createHash = algorithm =>
cryptoOrigCreateHash(algorithm == 'md4' ? 'sha256' : algorithm);

// Generate webpack config to copy extension assets to the build directory,
// such as setting schema files, theme assets, etc.
const extensionAssetConfig = Build.ensureAssets({
packageNames: data.jupyterlab.extensions,
output: './build'
output: './build',
hashFunction: 'sha256'
});

module.exports = [
Expand Down
9 changes: 8 additions & 1 deletion examples/cell/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
const webpack = require('webpack');
const crypto = require('crypto');

// Workaround for loaders using "md4" by default, which is not supported in FIPS-compliant OpenSSL
const cryptoOrigCreateHash = crypto.createHash;
crypto.createHash = algorithm =>
cryptoOrigCreateHash(algorithm == 'md4' ? 'sha256' : algorithm);

module.exports = {
entry: ['whatwg-fetch', './build/index.js'],
output: {
path: __dirname + '/build',
filename: 'bundle.js'
filename: 'bundle.js',
hashFunction: 'sha256'
},
bail: true,
devtool: 'cheap-source-map',
Expand Down
9 changes: 8 additions & 1 deletion examples/console/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
const webpack = require('webpack');
const crypto = require('crypto');

// Workaround for loaders using "md4" by default, which is not supported in FIPS-compliant OpenSSL
const cryptoOrigCreateHash = crypto.createHash;
crypto.createHash = algorithm =>
cryptoOrigCreateHash(algorithm == 'md4' ? 'sha256' : algorithm);

module.exports = {
entry: ['whatwg-fetch', './build/index.js'],
output: {
path: __dirname + '/build',
filename: 'bundle.js'
filename: 'bundle.js',
hashFunction: 'sha256'
},
bail: true,
devtool: 'cheap-source-map',
Expand Down
3 changes: 2 additions & 1 deletion examples/federated/core_package/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ module.exports = [
type: 'var',
name: ['_JUPYTERLAB', 'CORE_OUTPUT']
},
filename: 'bundle.js'
filename: 'bundle.js',
hashFunction: 'sha256'
},
optimization: {
splitChunks: {
Expand Down
9 changes: 8 additions & 1 deletion examples/filebrowser/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
const webpack = require('webpack');
const crypto = require('crypto');

// Workaround for loaders using "md4" by default, which is not supported in FIPS-compliant OpenSSL
const cryptoOrigCreateHash = crypto.createHash;
crypto.createHash = algorithm =>
cryptoOrigCreateHash(algorithm == 'md4' ? 'sha256' : algorithm);

module.exports = {
entry: ['whatwg-fetch', './build/index.js'],
output: {
path: __dirname + '/build',
filename: 'bundle.js'
filename: 'bundle.js',
hashFunction: 'sha256'
},
bail: true,
devtool: 'source-map',
Expand Down
9 changes: 8 additions & 1 deletion examples/notebook/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
const webpack = require('webpack');
const crypto = require('crypto');

// Workaround for loaders using "md4" by default, which is not supported in FIPS-compliant OpenSSL
const cryptoOrigCreateHash = crypto.createHash;
crypto.createHash = algorithm =>
cryptoOrigCreateHash(algorithm == 'md4' ? 'sha256' : algorithm);

module.exports = {
entry: ['whatwg-fetch', './build/index.js'],
output: {
path: __dirname + '/build',
filename: 'bundle.js'
filename: 'bundle.js',
hashFunction: 'sha256'
},
bail: true,
devtool: 'cheap-source-map',
Expand Down
9 changes: 8 additions & 1 deletion examples/terminal/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
const webpack = require('webpack');
const crypto = require('crypto');

// Workaround for loaders using "md4" by default, which is not supported in FIPS-compliant OpenSSL
const cryptoOrigCreateHash = crypto.createHash;
crypto.createHash = algorithm =>
cryptoOrigCreateHash(algorithm == 'md4' ? 'sha256' : algorithm);

module.exports = {
entry: ['whatwg-fetch', './build/index.js'],
output: {
path: __dirname + '/build',
filename: 'bundle.js'
filename: 'bundle.js',
hashFunction: 'sha256'
},
bail: true,
devtool: 'cheap-source-map',
Expand Down
6 changes: 6 additions & 0 deletions galata/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

const path = require('path');
const webpack = require('webpack');
const crypto = require('crypto');

// Workaround for loaders using "md4" by default, which is not supported in FIPS-compliant OpenSSL
const cryptoOrigCreateHash = crypto.createHash;
crypto.createHash = algorithm =>
cryptoOrigCreateHash(algorithm == 'md4' ? 'sha256' : algorithm);

module.exports = {
entry: './src/inpage/index.ts',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
// Distributed under the terms of the Modified BSD License.
var data = require('./package.json');
var Build = require('@jupyterlab/builder').Build;
const crypto = require('crypto');

// Workaround for loaders using "md4" by default, which is not supported in FIPS-compliant OpenSSL
const cryptoOrigCreateHash = crypto.createHash;
crypto.createHash = algorithm =>
cryptoOrigCreateHash(algorithm == 'md4' ? 'sha256' : algorithm);

var names = Object.keys(data.dependencies).filter(function (name) {
var packageData = require(name + '/package.json');
Expand All @@ -18,7 +24,8 @@ module.exports = [
entry: ['whatwg-fetch', './index.js'],
output: {
path: __dirname + '/build',
filename: 'bundle.js'
filename: 'bundle.js',
hashFunction: 'sha256'
},
// node: {
// fs: 'empty'
Expand Down
9 changes: 8 additions & 1 deletion packages/nbconvert-css/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const path = require('path');
const crypto = require('crypto');

// Workaround for loaders using "md4" by default, which is not supported in FIPS-compliant OpenSSL
const cryptoOrigCreateHash = crypto.createHash;
crypto.createHash = algorithm =>
cryptoOrigCreateHash(algorithm == 'md4' ? 'sha256' : algorithm);

module.exports = {
entry: './raw.js',
output: {
filename: 'index.js',
path: path.resolve(__dirname, 'style')
path: path.resolve(__dirname, 'style'),
hashFunction: 'sha256'
},
plugins: [
new MiniCssExtractPlugin({
Expand Down
9 changes: 8 additions & 1 deletion packages/services/examples/browser/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
const webpack = require('webpack');
const crypto = require('crypto');

// Workaround for loaders using "md4" by default, which is not supported in FIPS-compliant OpenSSL
const cryptoOrigCreateHash = crypto.createHash;
crypto.createHash = algorithm =>
cryptoOrigCreateHash(algorithm == 'md4' ? 'sha256' : algorithm);

module.exports = {
entry: './build/index.js',
mode: 'development',
output: {
path: require('path').join(__dirname, 'build'),
filename: 'bundle.js'
filename: 'bundle.js',
hashFunction: 'sha256'
},
plugins: [
new webpack.DefinePlugin({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
const path = require('path');
const webpack = require('webpack');
const crypto = require('crypto');

// Workaround for loaders using "md4" by default, which is not supported in FIPS-compliant OpenSSL
const cryptoOrigCreateHash = crypto.createHash;
crypto.createHash = algorithm =>
cryptoOrigCreateHash(algorithm == 'md4' ? 'sha256' : algorithm);

module.exports = {
entry: ['./build/index.js'],
mode: 'development',
output: {
path: path.join(__dirname, 'build'),
filename: 'bundle.js'
filename: 'bundle.js',
hashFunction: 'sha256'
},
module: {
rules: [
Expand Down
9 changes: 8 additions & 1 deletion packages/services/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
const version = require('./package.json').version;
const crypto = require('crypto');

// Workaround for loaders using "md4" by default, which is not supported in FIPS-compliant OpenSSL
const cryptoOrigCreateHash = crypto.createHash;
crypto.createHash = algorithm =>
cryptoOrigCreateHash(algorithm == 'md4' ? 'sha256' : algorithm);

module.exports = {
entry: './lib',
Expand All @@ -7,7 +13,8 @@ module.exports = {
library: '@jupyterlab/services',
libraryTarget: 'umd',
umdNamedDefine: true,
publicPath: 'https://unpkg.com/@jupyterlab/services@' + version + '/dist/'
publicPath: 'https://unpkg.com/@jupyterlab/services@' + version + '/dist/',
hashFunction: 'sha256'
},
bail: true,
mode: 'production',
Expand Down
6 changes: 6 additions & 0 deletions packages/ui-components/.storybook/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
const path = require('path');
const SRC_PATH = path.join(__dirname, '../src');
const STORIES_PATH = path.join(__dirname, '../stories');
const crypto = require('crypto');

// Workaround for loaders using "md4" by default, which is not supported in FIPS-compliant OpenSSL
const cryptoOrigCreateHash = crypto.createHash;
crypto.createHash = algorithm =>
cryptoOrigCreateHash(algorithm == 'md4' ? 'sha256' : algorithm);

module.exports = ({ config }) => {
// don't use storybook's default svg configuration
Expand Down
4 changes: 3 additions & 1 deletion scripts/ci_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ if [[ $GROUP == integrity2 ]]; then
jlpm run build:dev:prod:release

# Make sure the storybooks build.
jlpm run build:storybook
# Storybook is drop in JLab 4 as unused by active maintainers
# As NodeJS 18 is breaking storybook configuration, this test is removed from the CI.
# jlpm run build:storybook

jlpm config set prefix ~/.yarn

Expand Down
15 changes: 10 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5663,12 +5663,12 @@ canonicalize@^1.0.1:
integrity sha512-mAjKJPIyP0xqqv6IAkvso07StOmz6cmGtNDg3pXCSzXVZOqka7StIkAhJl/zHOi4M2CgpYfD6aeRWbnrmtvBEA==

canvas@^2.6.1:
version "2.8.0"
resolved "https://registry.yarnpkg.com/canvas/-/canvas-2.8.0.tgz#f99ca7f25e6e26686661ffa4fec1239bbef74461"
integrity sha512-gLTi17X8WY9Cf5GZ2Yns8T5lfBOcGgFehDFb+JQwDqdOoBOcECS9ZWMEAqMSVcMYwXD659J8NyzjRY/2aE+C2Q==
version "2.11.0"
resolved "https://registry.yarnpkg.com/canvas/-/canvas-2.11.0.tgz#7f0c3e9ae94cf469269b5d3a7963a7f3a9936434"
integrity sha512-bdTjFexjKJEwtIo0oRx8eD4G2yWoUOXP9lj279jmQ2zMnTQhT8C3512OKz3s+ZOaQlLbE7TuVvRDYDB3Llyy5g==
dependencies:
"@mapbox/node-pre-gyp" "^1.0.0"
nan "^2.14.0"
nan "^2.17.0"
simple-get "^3.0.3"

capture-exit@^2.0.0:
Expand Down Expand Up @@ -12191,11 +12191,16 @@ mv@2.1.1:
ncp "~2.0.0"
rimraf "~2.4.0"

nan@^2.12.1, nan@^2.14.0:
nan@^2.12.1:
version "2.15.0"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.15.0.tgz#3f34a473ff18e15c1b5626b62903b5ad6e665fee"
integrity sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==

nan@^2.17.0:
version "2.17.0"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.17.0.tgz#c0150a2368a182f033e9aa5195ec76ea41a199cb"
integrity sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==

nanoid@^3.1.23, nanoid@^3.1.30:
version "3.1.30"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.30.tgz#63f93cc548d2a113dc5dfbc63bfa09e2b9b64362"
Expand Down

0 comments on commit abf02f5

Please sign in to comment.