Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade: esbuild, eslint, @babel/preset-env, @mui/lab #336

Merged
merged 5 commits into from
Aug 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 8 additions & 8 deletions config/build.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import esbuild from 'esbuild';
import svgrPlugin from 'esbuild-plugin-svgr';
import * as common from './common.js';
import esbuild from 'esbuild'
import * as common from './common.js'


esbuild
.build(common.build)
.then((result) => {
console.log('Build succeeded.');
})
.catch(() => process.exit(1));
.build(common.build)
.then((result) => {
console.log('Build succeeded.')
})
.catch(() => process.exit(1))
5 changes: 2 additions & 3 deletions config/common.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import svgrPlugin from 'esbuild-plugin-svgr'


const entry = 'src/index.jsx'
const buildDir = 'docs'
const build = {
export const build = {
entryPoints: [entry],
bundle: true,
minify: true,
Expand All @@ -24,5 +25,3 @@ const build = {
logLevel: 'info',
plugins: [svgrPlugin()],
}

export {build}
10 changes: 6 additions & 4 deletions config/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import esbuild from 'esbuild'
import http from 'http'
import * as common from './common.js'

const port = 8080

const SERVE_PORT = 8080

esbuild.serve({
port: port,
port: SERVE_PORT,
servedir: common.build.outdir,
}, common.build).then((result) => {
// The result tells us where esbuild's local server is
Expand All @@ -23,8 +24,9 @@ esbuild.serve({
// Forward each incoming request to esbuild
const proxyReq = http.request(options, (proxyRes) => {
// If esbuild returns "not found", send a custom 404 page
if (proxyRes.statusCode === 404) {
res.writeHead(404, {'Content-Type': 'text/html'})
const HTTP_NOT_FOUND = 404
if (proxyRes.statusCode === HTTP_NOT_FOUND) {
res.writeHead(HTTP_NOT_FOUND, {'Content-Type': 'text/html'})
res.end(
`<!DOCTYPE html>
<html>
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bldrs",
"version": "1.0.0-r385",
"version": "1.0.0-r389",
"main": "src/index.jsx",
"homepage": "https://github.com/bldrs-ai/Share",
"bugs": {
Expand Down Expand Up @@ -30,7 +30,7 @@
"@iconscout/react-unicons": "^1.1.6",
"@material-ui/core": "^4.12.4",
"@mui/icons-material": "^5.8.4",
"@mui/lab": "^5.0.0-alpha.94",
"@mui/lab": "^5.0.0-alpha.95",
"@mui/material": "^5.9.2",
"@mui/styled-engine": "^5.8.7",
"@mui/styles": "^5.9.2",
Expand All @@ -50,7 +50,7 @@
"@alex_neo/jest-expect-message": "^1.0.5",
"@babel/eslint-parser": "^7.18.9",
"@babel/plugin-syntax-import-assertions": "^7.18.6",
"@babel/preset-env": "^7.18.9",
"@babel/preset-env": "^7.18.10",
"@babel/preset-react": "^7.18.6",
"@pablo-mayrgundter/cookies.js": "^1.0.0",
"@storybook/addon-actions": "^6.5.10",
Expand All @@ -69,9 +69,9 @@
"@testing-library/react-hooks": "^8.0.1",
"babel-jest": "^28.1.3",
"babel-loader": "^8.2.5",
"esbuild": "^0.14.54",
"esbuild": "^0.15.5",
"esbuild-plugin-svgr": "^1.0.1",
"eslint": "^8.21.0",
"eslint": "^8.22.0",
"eslint-config-google": "^0.14.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.6.1",
Expand Down