Closed jpolitz closed 9 months ago
I think there are things we can remove from both package.json
s, but that's maybe an analysis for another day.
I also need to debug a message that prints (but seems to not stop or otherwise affect the build creating the needed files?). So this isn't yet ready to merge, more work to do, but basically at the point where I got a local build to start up the editor and create files, run image library stuff, etc.
> my-webpack-project@1.0.0 build
> webpack --mode=production --node-env=production
SyntaxError: Invalid regular expression: /[^'\]/: Unterminated character class
at new RegExp (<anonymous>)
at /Users/joe/src/pyret-lang-anchor-clean/ide/node_modules/webpack/lib/javascript/JavascriptParser.js:526:52
at Hook.eval [as call] (eval at create (/Users/joe/src/pyret-lang-anchor-clean/ide/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:7:16)
at JavascriptParser.evaluateExpression (/Users/joe/src/pyret-lang-anchor-clean/ide/node_modules/webpack/lib/javascript/JavascriptParser.js:3833:25)
at /Users/joe/src/pyret-lang-anchor-clean/ide/node_modules/webpack/lib/javascript/JavascriptParser.js:1516:30
at Hook.eval [as call] (eval at create (/Users/joe/src/pyret-lang-anchor-clean/ide/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:7:16)
at JavascriptParser.evaluateExpression (/Users/joe/src/pyret-lang-anchor-clean/ide/node_modules/webpack/lib/javascript/JavascriptParser.js:3833:25)
at JavascriptParser.getRenameIdentifier (/Users/joe/src/pyret-lang-anchor-clean/ide/node_modules/webpack/lib/javascript/JavascriptParser.js:1619:23)
at JavascriptParser.walkVariableDeclaration (/Users/joe/src/pyret-lang-anchor-clean/ide/node_modules/webpack/lib/javascript/JavascriptParser.js:2540:31)
at JavascriptParser.walkStatement (/Users/joe/src/pyret-lang-anchor-clean/ide/node_modules/webpack/lib/javascript/JavascriptParser.js:1856:10)
SyntaxError: Invalid regular expression: /[^"\]/: Unterminated character class
at new RegExp (<anonymous>)
at /Users/joe/src/pyret-lang-anchor-clean/ide/node_modules/webpack/lib/javascript/JavascriptParser.js:526:52
at Hook.eval [as call] (eval at create (/Users/joe/src/pyret-lang-anchor-clean/ide/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:7:16)
at JavascriptParser.evaluateExpression (/Users/joe/src/pyret-lang-anchor-clean/ide/node_modules/webpack/lib/javascript/JavascriptParser.js:3833:25)
at /Users/joe/src/pyret-lang-anchor-clean/ide/node_modules/webpack/lib/javascript/JavascriptParser.js:1517:29
at Hook.eval [as call] (eval at create (/Users/joe/src/pyret-lang-anchor-clean/ide/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:7:16)
at JavascriptParser.evaluateExpression (/Users/joe/src/pyret-lang-anchor-clean/ide/node_modules/webpack/lib/javascript/JavascriptParser.js:3833:25)
at JavascriptParser.getRenameIdentifier (/Users/joe/src/pyret-lang-anchor-clean/ide/node_modules/webpack/lib/javascript/JavascriptParser.js:1619:23)
at JavascriptParser.walkVariableDeclaration (/Users/joe/src/pyret-lang-anchor-clean/ide/node_modules/webpack/lib/javascript/JavascriptParser.js:2540:31)
at JavascriptParser.walkStatement (/Users/joe/src/pyret-lang-anchor-clean/ide/node_modules/webpack/lib/javascript/JavascriptParser.js:1856:10)
OK found the culprit which was indeed a bad regex we wrote in dead code in the codemirror mode:
https://github.com/brownplt/pyret-codemirror-mode/commit/1862b0aa3b934035722ff23fd102da8bdd5454be
This commit updates webpack to the newest version and enables building on node 20+. There are a lot of details here.
versions: {node:...}
to browserify's process object (is-core-module
, which we rely on, needs this and I couldn't figure out how to configure browserify for it)any
s and did some casting/checking to get around small TS updates; there should be no semantic change to that code.