Fix webpack, build dependency issues

This commit is contained in:
Patrick O'Sullivan 2022-06-13 12:53:45 -05:00
parent 5b6a2d5625
commit b6b6655149
6 changed files with 10798 additions and 54059 deletions

View File

@ -0,0 +1 @@
nodejs 14.19.0

View File

@ -1,66 +1,71 @@
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const MomentLocalesPlugin = require('moment-locales-webpack-plugin');
const webpack = require('webpack');
const { execSync } = require('child_process');
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const MomentLocalesPlugin = require("moment-locales-webpack-plugin");
const webpack = require("webpack");
const { execSync } = require("child_process");
const GIT_DESC = execSync('git describe --always', { encoding: 'utf8' }).trim();
const GIT_DESC = execSync("git describe --always", { encoding: "utf8" }).trim();
module.exports = {
mode: 'production',
mode: "production",
entry: {
app: './src/index.tsx',
serviceworker: './src/serviceworker.js'
app: "./src/index.tsx",
serviceworker: "./src/serviceworker.js",
},
module: {
rules: [
{
test: /\.(j|t)sx?$/,
use: {
loader: 'babel-loader',
loader: "babel-loader",
options: {
presets: ['@babel/preset-env', '@babel/typescript', '@babel/preset-react'],
presets: [
"@babel/preset-env",
"@babel/typescript",
"@babel/preset-react",
],
plugins: [
'lodash',
'@babel/transform-runtime',
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-proposal-class-properties'
]
}
"lodash",
"@babel/transform-runtime",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-proposal-class-properties",
],
},
},
exclude: /node_modules\/(?!(@tlon\/indigo-dark|@tlon\/indigo-light|@tlon\/indigo-react|@urbit\/api)\/).*/
exclude:
/node_modules\/(?!(@tlon\/indigo-dark|@tlon\/indigo-light|@tlon\/indigo-react|@urbit\/api)\/).*/,
},
{
test: /\.css$/i,
test: /\.css$/i,
use: [
// Creates `style` nodes from JS strings
'style-loader',
"style-loader",
// Translates CSS into CommonJS
'css-loader',
"css-loader",
// Compiles Sass to CSS
'sass-loader'
]
"sass-loader",
],
},
{
test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
use: [
{
loader: 'file-loader',
loader: "file-loader",
options: {
name: '[name].[ext]',
outputPath: 'fonts/'
}
}
]
}
]
name: "[name].[ext]",
outputPath: "fonts/",
},
},
],
},
],
},
resolve: {
extensions: ['.js', '.ts', '.tsx']
extensions: [".js", ".ts", ".tsx"],
},
devtool: 'source-map',
devtool: "source-map",
// devServer: {
// contentBase: path.join(__dirname, './'),
// hot: true,
@ -71,26 +76,30 @@ module.exports = {
new MomentLocalesPlugin(),
new CleanWebpackPlugin(),
new webpack.DefinePlugin({
'process.env.LANDSCAPE_STREAM': JSON.stringify(process.env.LANDSCAPE_STREAM),
'process.env.LANDSCAPE_SHORTHASH': JSON.stringify(GIT_DESC),
'process.env.LANDSCAPE_STORAGE_VERSION': Date.now().toString(),
'process.env.LANDSCAPE_LAST_WIPE': '2021-10-20',
"process.env.LANDSCAPE_STREAM": JSON.stringify(
process.env.LANDSCAPE_STREAM
),
"process.env.LANDSCAPE_SHORTHASH": JSON.stringify(GIT_DESC),
"process.env.LANDSCAPE_STORAGE_VERSION": Date.now().toString(),
"process.env.LANDSCAPE_LAST_WIPE": "2021-10-20",
}),
new HtmlWebpackPlugin({
title: 'Groups',
template: './public/index.html',
favicon: './src/assets/img/Favicon.png'
})
title: "Groups",
template: "./public/index.html",
favicon: "./src/assets/img/favicon.png",
}),
],
output: {
filename: (pathData) => {
return pathData.chunk.name === 'app' ? 'index.[contenthash].js' : '[name].js';
return pathData.chunk.name === "app"
? "index.[contenthash].js"
: "[name].js";
},
path: path.resolve(__dirname, '../dist'),
publicPath: '/apps/landscape/'
path: path.resolve(__dirname, "../dist"),
publicPath: "/apps/landscape/",
},
optimization: {
minimize: true,
usedExports: true
}
usedExports: true,
},
};

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,7 @@
"main": "index.js",
"private": true,
"engines": {
"node": "16.14.0"
"node": "14.19.0"
},
"dependencies": {
"@babel/runtime": "^7.12.5",
@ -14,7 +14,7 @@
"@react-spring/web": "^9.1.1",
"@tlon/indigo-dark": "^1.0.6",
"@tlon/indigo-light": "^1.0.7",
"@tlon/indigo-react": "github:urbit/indigo-react",
"@tlon/indigo-react": "^1.2.27",
"@tlon/sigil-js": "^1.4.5",
"@urbit/api": "^2.1.1",
"@urbit/http-api": "^2.1.0",
@ -33,15 +33,15 @@
"mousetrap": "^1.6.5",
"mousetrap-global-bind": "^1.1.0",
"normalize-wheel": "1.0.1",
"oembed-parser": "^1.4.5",
"oembed-parser": "^3.0.4",
"prop-types": "^15.7.2",
"querystring": "^0.2.0",
"react": "^17.0.2",
"react-codemirror2": "^6.0.1",
"react-codemirror2": "git@github.com:scniro/react-codemirror2",
"react-dom": "^17.0.2",
"react-helmet": "^6.1.0",
"react-markdown": "^4.3.1",
"react-oembed-container": "^1.0.0",
"react-markdown": "^8.0.3",
"react-oembed-container": "^1.0.1",
"react-router-dom": "^5.2.0",
"react-use-gesture": "^9.1.3",
"react-virtuoso": "^0.20.3",

View File

@ -1,18 +0,0 @@
diff --git a/node_modules/react-codemirror2/package.json b/node_modules/react-codemirror2/package.json
index 52fb318..e482f15 100644
--- a/node_modules/react-codemirror2/package.json
+++ b/node_modules/react-codemirror2/package.json
@@ -50,10 +50,11 @@
"editor",
"syntax",
"ide",
- "code"
+ "code",
+ "bump"
],
"peerDependencies": {
- "react": ">=15.5 <=16.x",
+ "react": ">=15.5 <=17.x",
"codemirror": "5.x"
},
"devDependencies": {

View File

@ -1,127 +1,126 @@
/* eslint-disable */
/** pulled from remark-parse
*
*
* critical change is that blockquotes require a newline to be continued, see
* the `if(!prefixed) conditional
*/
'use strict'
"use strict";
var trim = require('trim')
var interrupt = require('remark-parse/lib/util/interrupt')
var trim = require("trim");
module.exports = blockquote
module.exports = blockquote;
var lineFeed = '\n'
var tab = '\t'
var space = ' '
var greaterThan = '>'
var lineFeed = "\n";
var tab = "\t";
var space = " ";
var greaterThan = ">";
function blockquote(eat, value, silent) {
var self = this
var offsets = self.offset
var tokenizers = self.blockTokenizers
var interruptors = self.interruptBlockquote
var now = eat.now()
var currentLine = now.line
var length = value.length
var values = []
var contents = []
var indents = []
var add
var index = 0
var character
var rest
var nextIndex
var content
var line
var startIndex
var prefixed
var exit
var self = this;
var offsets = self.offset;
var tokenizers = self.blockTokenizers;
var interruptors = self.interruptBlockquote;
var now = eat.now();
var currentLine = now.line;
var length = value.length;
var values = [];
var contents = [];
var indents = [];
var add;
var index = 0;
var character;
var rest;
var nextIndex;
var content;
var line;
var startIndex;
var prefixed;
var exit;
while (index < length) {
character = value.charAt(index)
character = value.charAt(index);
if (character !== space && character !== tab) {
break
break;
}
index++
index++;
}
if (value.charAt(index) !== greaterThan) {
return
return;
}
if (silent) {
return true
return true;
}
index = 0
index = 0;
while (index < length) {
nextIndex = value.indexOf(lineFeed, index)
startIndex = index
prefixed = false
nextIndex = value.indexOf(lineFeed, index);
startIndex = index;
prefixed = false;
if (nextIndex === -1) {
nextIndex = length
nextIndex = length;
}
while (index < length) {
character = value.charAt(index)
character = value.charAt(index);
if (character !== space && character !== tab) {
break
break;
}
index++
index++;
}
if (value.charAt(index) === greaterThan) {
index++
prefixed = true
index++;
prefixed = true;
if (value.charAt(index) === space) {
index++
index++;
}
} else {
index = startIndex
index = startIndex;
}
content = value.slice(index, nextIndex)
content = value.slice(index, nextIndex);
if (!prefixed && !trim(content)) {
index = startIndex
break
index = startIndex;
break;
}
if (!prefixed) {
break;
}
line = startIndex === index ? content : value.slice(startIndex, nextIndex)
line = startIndex === index ? content : value.slice(startIndex, nextIndex);
indents.push(index - startIndex)
values.push(line)
contents.push(content)
indents.push(index - startIndex);
values.push(line);
contents.push(content);
index = nextIndex + 1
index = nextIndex + 1;
}
const trailingNewline = value.charAt(nextIndex) === '\n';
const trailingNewline = value.charAt(nextIndex) === "\n";
index = -1
length = indents.length
add = eat(values.join(lineFeed))
index = -1;
length = indents.length;
add = eat(values.join(lineFeed));
while (++index < length) {
offsets[currentLine] = (offsets[currentLine] || 0) + indents[index]
currentLine++
offsets[currentLine] = (offsets[currentLine] || 0) + indents[index];
currentLine++;
}
exit = self.enterBlock()
contents = self.tokenizeBlock(contents.join(lineFeed), now)
exit()
exit = self.enterBlock();
contents = self.tokenizeBlock(contents.join(lineFeed), now);
exit();
const added = add({type: 'blockquote', children: contents})
return trailingNewline ? add({ type: 'paragraph', children: [] }) : added;
const added = add({ type: "blockquote", children: contents });
return trailingNewline ? add({ type: "paragraph", children: [] }) : added;
}