Skip to content

Commit

Permalink
Merge branch 'master' of github.com:SUI-Components/sui into feat/bump…
Browse files Browse the repository at this point in the history
…-karma-webpack-version
  • Loading branch information
midudev committed Oct 29, 2021
2 parents 9a7dad1 + b3a0d67 commit 3e82c68
Show file tree
Hide file tree
Showing 66 changed files with 1,015 additions and 312 deletions.
9 changes: 9 additions & 0 deletions packages/babel-preset-sui/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# CHANGELOG

# 3.29.0 (2021-10-21)


### Features

* **packages/babel-preset-sui:** Upgrade dependencies about babel ([d59044e](https://github.com/SUI-Components/sui/commit/d59044e41ba2f6fc861b3b5ed01c156f70bfc904))



# 3.28.0 (2021-09-28)


Expand Down
10 changes: 5 additions & 5 deletions packages/babel-preset-sui/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "babel-preset-sui",
"version": "3.28.0",
"version": "3.29.0",
"description": "A preset for all babel-transpiled javascript of the SUI family.",
"main": "src/index.js",
"keywords": [],
"author": "",
"license": "MIT",
"dependencies": {
"@babel/core": "7.15.5",
"@babel/plugin-proposal-decorators": "7.15.4",
"@babel/core": "7.15.8",
"@babel/plugin-proposal-decorators": "7.15.8",
"@babel/plugin-syntax-export-default-from": "7.14.5",
"@babel/plugin-syntax-export-namespace-from": "7.8.3",
"@babel/plugin-transform-runtime": "7.15.0",
"@babel/preset-env": "7.15.6",
"@babel/plugin-transform-runtime": "7.15.8",
"@babel/preset-env": "7.15.8",
"@babel/preset-react": "7.14.5",
"@babel/runtime": "7.15.4",
"babel-plugin-preval": "5.0.0",
Expand Down
24 changes: 24 additions & 0 deletions packages/sui-bundler/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# CHANGELOG

# 7.34.0 (2021-10-28)


### Features

* **packages/sui-bundler:** Adapt linter errors ([6f35331](https://github.com/SUI-Components/sui/commit/6f35331c568d39c636a953b265253e32e8bef71b))
* **packages/sui-bundler:** Add License links ([b92db3a](https://github.com/SUI-Components/sui/commit/b92db3a150349a583c27e6df6ebbcef3711451a2))
* **packages/sui-bundler:** Improve usability for dev mode ([cf8787d](https://github.com/SUI-Components/sui/commit/cf8787d3365bcddcdb7ccc1029dc426e94de6f6d))
* **packages/sui-bundler:** Less noisy dev mode ([f5e21eb](https://github.com/SUI-Components/sui/commit/f5e21eb3d29164e0e92d3bda37739769cab99ab8))
* **packages/sui-bundler:** Remove not needed line regarding deprecation notices ([a0962dc](https://github.com/SUI-Components/sui/commit/a0962dc2ea7959f4b1b089279895f21df5efdfe0))
* **packages/sui-bundler:** Start migrating away from react-dev-utils ([3bbf7f4](https://github.com/SUI-Components/sui/commit/3bbf7f474297f5c5b0fa2f8886696ffbeec978c4))



# 7.33.0 (2021-10-21)


### Features

* **packages/sui-bundler:** Upgrade dependencies about babel ([740c02e](https://github.com/SUI-Components/sui/commit/740c02ea66a0fe1e86e1be9633ab8322d0fbd0d1))



# 7.32.0 (2021-09-14)


Expand All @@ -15,6 +38,7 @@
### Features

* **packages/sui-bundler:** Upgrade sui-bundler deps ([851b017](https://github.com/SUI-Components/sui/commit/851b0178f0653b475fe9fe94228bca7f60d44817))
* **packages/sui-bundler:** Use latest webpack-dev-server ([0f5e33e](https://github.com/SUI-Components/sui/commit/0f5e33e08af4d07ea4059d73c016efb3a088c5d0))



Expand Down
21 changes: 13 additions & 8 deletions packages/sui-bundler/bin/sui-bundler-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ process.on('unhandledRejection', err => {
const program = require('commander')
const path = require('path')
const WebpackDevServer = require('webpack-dev-server')
const clearConsole = require('react-dev-utils/clearConsole')
const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles')

const clearConsole = require('../utils/clearConsole')
const checkRequiredFiles = require('../utils/checkRequiredFiles')
const {
choosePort,
prepareUrls
Expand Down Expand Up @@ -55,9 +56,6 @@ if (!module.parent) {
webpackConfig.context = context || webpackConfig.context
}

// Don't show ugly deprecation warnings that mess with the logging
process.noDeprecation = true

const start = async ({
config = webpackConfig,
packagesToLink = program.linkPackage || []
Expand Down Expand Up @@ -85,13 +83,20 @@ const start = async ({
})
const compiler = createCompiler(nextConfig, urls)
const serverConfig = createDevServerConfig(nextConfig, urls.lanUrlForConfig)
const devServer = new WebpackDevServer(compiler, serverConfig)
const devServer = new WebpackDevServer(
{
...serverConfig,
port,
host: HOST
},
compiler
)
log.processing('❯ Starting the development server...\n')
devServer.listen(port, HOST, err => {
devServer.startCallback(err => {
if (err) return log.error(err)
;['SIGINT', 'SIGTERM'].forEach(sig => {
process.on(sig, () => {
devServer.close()
devServer.stop()
process.exit()
})
})
Expand Down
4 changes: 2 additions & 2 deletions packages/sui-bundler/factories/createCompiler.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const webpack = require('webpack')
const clearConsole = require('react-dev-utils/clearConsole')
const formatWebpackMessages = require('react-dev-utils/formatWebpackMessages')
const formatWebpackMessages = require('../utils/formatWebpackMessages')
const clearConsole = require('../utils/clearConsole')
const log = require('../shared/log')

const isInteractive = process.stdout.isTTY
Expand Down
61 changes: 24 additions & 37 deletions packages/sui-bundler/factories/createDevServerConfig.js
Original file line number Diff line number Diff line change
@@ -1,51 +1,38 @@
const errorOverlayMiddleware = require('react-dev-utils/errorOverlayMiddleware')
// @ts-check

const noopServiceWorkerMiddleware = require('react-dev-utils/noopServiceWorkerMiddleware')
const ignoredFiles = require('react-dev-utils/ignoredFiles')

const protocol = process.env.HTTPS === 'true' ? 'https' : 'http'
const host = process.env.HOST || '0.0.0.0'
const {HOST, HTTPS} = process.env
const protocol = HTTPS === 'true' ? 'https' : 'http'
const host = HOST || '0.0.0.0'

module.exports = (config, allowedHost) => ({
// Enable gzip compression of generated files.
compress: true,
// Silence WebpackDevServer's own logs since they're generally not useful.
// It will still show compile warnings and errors with this setting.
clientLogLevel: 'none',
// Tell the server where to serve content from. This is only necessary if you want to serve static files from this folder as normally they come from memory
contentBase: 'public',
// By default files from `contentBase` will not trigger a page reload.
watchContentBase: true,
// Enable hot reloading server.
hot: true,
// Use 'ws' instead of 'sockjs-node' on server since we're using native
// websockets in `webpackHotDevClient`.
transportMode: 'ws',
// Prevent a WS client from getting injected as we're already including
// `webpackHotDevClient`.
injectClient: false,
// Tell the server at what URL to serve devServer.contentBase static content.
publicPath: config.output.publicPath,
// WebpackDevServer is noisy by default so we emit custom message instead
// by listening to the compiler events with `compiler.hooks[...].tap` calls above.
quiet: true,
// Reportedly, this avoids CPU overload on some systems.
watchOptions: {
ignored: ignoredFiles(config.context)
module.exports = config => ({
allowedHosts: 'all',
client: {
logging: 'none',
overlay: {
errors: true,
warnings: false
},
progress: true
},
static: {
directory: 'public',
watch: {
ignored: ignoredFiles(config.context)
}
},
hot: true,
https: protocol === 'https',
host,
overlay: false,
historyApiFallback: {
disableDotRule: true
},
public: allowedHost,
before(app) {
// This lets us open files from the runtime error overlay.
app.use(errorOverlayMiddleware())
},
after(app) {
open: true,
onAfterSetupMiddleware(devServer) {
// This service worker file is effectively a 'no-op' that will reset any
// previous service worker registered for the same host:port combination.
app.use(noopServiceWorkerMiddleware(config.output.publicPath))
devServer.app.use(noopServiceWorkerMiddleware(config.output.publicPath))
}
})
12 changes: 6 additions & 6 deletions packages/sui-bundler/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@s-ui/bundler",
"version": "7.32.0",
"version": "7.34.0",
"description": "Config-free bundler for ES6 React apps.",
"bin": {
"sui-bundler": "./bin/sui-bundler.js"
Expand All @@ -21,15 +21,15 @@
},
"homepage": "https://github.com/SUI-Components/sui/tree/master/packages/sui-bundler#readme",
"dependencies": {
"@babel/core": "7.15.5",
"@babel/core": "7.15.8",
"@s-ui/helpers": "1",
"autoprefixer": "9.8.6",
"babel-loader": "8.2.2",
"babel-loader": "8.2.3",
"babel-preset-sui": "3",
"commander": "6.2.1",
"css-loader": "4.3.0",
"css-minimizer-webpack-plugin": "1.1.5",
"esbuild-loader": "2.15.1",
"esbuild-loader": "2.16.0",
"fast-glob": "3.2.7",
"html-webpack-plugin": "4.5.0",
"mini-css-extract-plugin": "1.6.0",
Expand All @@ -38,14 +38,14 @@
"postcss-loader": "4.1.0",
"react-dev-utils": "11.0.4",
"rimraf": "3.0.2",
"sass": "1.39.0",
"sass": "1.43.3",
"sass-loader": "10.1.0",
"super-sass-loader": "0.1",
"speed-measure-webpack-plugin": "1.5.0",
"style-loader": "2.0.0",
"terser-webpack-plugin": "4.2.2",
"webpack": "4.46.0",
"webpack-dev-server": "3.11.2",
"webpack-dev-server": "4.3.1",
"webpack-manifest-plugin": "4.0.2",
"webpack-node-externals": "3.0.0"
}
Expand Down
31 changes: 31 additions & 0 deletions packages/sui-bundler/utils/checkRequiredFiles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in https://github.com/facebook/create-react-app/blob/main/packages/react-dev-utils/LICENSE
*/

const fs = require('fs')
const path = require('path')

function checkRequiredFiles(files) {
let currentFilePath
try {
files.forEach(filePath => {
currentFilePath = filePath
fs.accessSync(filePath, fs.F_OK)
})
return true
} catch (err) {
const dirName = path.dirname(currentFilePath)
const fileName = path.basename(currentFilePath)

console.log('Could not find a required file:')
console.log(` Name: ${fileName}`)
console.log(` Searched in: ${dirName}`)

return false
}
}

module.exports = checkRequiredFiles
14 changes: 14 additions & 0 deletions packages/sui-bundler/utils/clearConsole.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in https://github.com/facebook/create-react-app/blob/main/packages/react-dev-utils/LICENSE
*/

function clearConsole() {
process.stdout.write(
process.platform === 'win32' ? '\x1B[2J\x1B[0f' : '\x1B[2J\x1B[3J\x1B[H'
)
}

module.exports = clearConsole
Loading

0 comments on commit 3e82c68

Please sign in to comment.