facelessuser / pymdown-extensions

Extensions for Python Markdown
https://facelessuser.github.io/pymdown-extensions/
Other
941 stars 251 forks source link

Docs: Figure out document dependency upgrade issues or rewrite how we package things #2348

Closed facelessuser closed 4 months ago

facelessuser commented 5 months ago

Description

Our custom JS and CSS historically has been packaged using a gulp script.

Recently, stylelint upgraded to 16.3.1, we are stuck on 15.11.0 because this breaks interactions with gulp-styleint, which seems abandoned. While I've found a fork, I am yet to figure out how to get it working with the fork.

Additionally, Gulp recently updated to 5.0.0 and that also broke everything. Unfortunately, their errors are completely unhelpful. While we've been able to fix some of the issues, issues like below are impossible to debug.

[12:21:41] RangeError: Maximum call stack size exceeded
    at Domain.enter (node:domain:323:35)
    at EventEmitter.emit (node:domain:551:10)
    at processDirents (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/glob-stream/index.js:88:10)
    at next (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/now-and-later/lib/mapSeries.js:43:5)
    at handler (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/now-and-later/lib/mapSeries.js:57:9)
    at f (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/once/once.js:25:25)
    at processDirents (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/glob-stream/index.js:113:7)
    at next (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/now-and-later/lib/mapSeries.js:43:5)
    at handler (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/now-and-later/lib/mapSeries.js:57:9)
    at f (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/once/once.js:25:25)
    at processDirents (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/glob-stream/index.js:113:7)
    at next (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/now-and-later/lib/mapSeries.js:43:5)
    at handler (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/now-and-later/lib/mapSeries.js:57:9)
    at f (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/once/once.js:25:25)
    at processDirents (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/glob-stream/index.js:113:7)
    at next (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/now-and-later/lib/mapSeries.js:43:5)
    at handler (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/now-and-later/lib/mapSeries.js:57:9)
    at f (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/once/once.js:25:25)
    at processDirents (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/glob-stream/index.js:113:7)
    at next (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/now-and-later/lib/mapSeries.js:43:5)
    at handler (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/now-and-later/lib/mapSeries.js:57:9)
    at f (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/once/once.js:25:25)
    at processDirents (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/glob-stream/index.js:113:7)
    at next (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/now-and-later/lib/mapSeries.js:43:5)
    at handler (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/now-and-later/lib/mapSeries.js:57:9)
    at f (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/once/once.js:25:25)
    at processDirents (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/glob-stream/index.js:113:7)
    at next (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/now-and-later/lib/mapSeries.js:43:5)
    at handler (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/now-and-later/lib/mapSeries.js:57:9)
    at f (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/once/once.js:25:25)
    at processDirents (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/glob-stream/index.js:113:7)
    at next (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/now-and-later/lib/mapSeries.js:43:5)
    at handler (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/now-and-later/lib/mapSeries.js:57:9)
    at f (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/once/once.js:25:25)
    at processDirents (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/glob-stream/index.js:113:7)
    at next (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/now-and-later/lib/mapSeries.js:43:5)
    at handler (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/now-and-later/lib/mapSeries.js:57:9)
    at f (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/once/once.js:25:25)
    at processDirents (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/glob-stream/index.js:113:7)
    at next (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/now-and-later/lib/mapSeries.js:43:5)
    at handler (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/now-and-later/lib/mapSeries.js:57:9)
    at f (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/once/once.js:25:25)
    at processDirents (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/glob-stream/index.js:113:7)
    at next (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/now-and-later/lib/mapSeries.js:43:5)
    at handler (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/now-and-later/lib/mapSeries.js:57:9)
    at f (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/once/once.js:25:25)
    at processDirents (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/glob-stream/index.js:113:7)
    at next (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/now-and-later/lib/mapSeries.js:43:5)
    at handler (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/now-and-later/lib/mapSeries.js:57:9)
    at f (/Users/facelessuser/Code/github/pymdown-extensions/node_modules/once/once.js:25:25)

I'm growing a bit tired of debugging this house of cards. I'm probably more frustrated with libraries breaking everything and not providing examples on how to migrate. I have no idea how things were functional before, and now suddenly blowing the stack.

In the above case, we are globbing 3 HTML files and replacing the included JS files with renames containing a hash at the ned, removing comments, and copying them over to the theme folder. I'm not sure how the stack is blowing up.

There has got to be an easier way to manage this. We really need to reduce all of these dependencies to avoid this torturous process.

Minimal Reproduction

NA

Version(s) & System Info

NA

facelessuser commented 5 months ago

I stripped down the script to a single task that only copied the three HTML, and we were still getting the stack error. We were generating a stream just like the documentation suggests. I suspect that Gulp 5.0 is broken.

It's possible I just need some more basic, simple scripts for packing via rollup and processing styles via SASS. One of the reasons we used Gulp was that we could enable a kind of live environment where we could update styles and such and have things build automatically and have it live. To be honest, we don't actually need to use such functionality very often, and can do without it if it makes this area more reliable. We can probably create some simple build scripts that could be called by a watch service later separating this functionality making things easier to maintain.

Gulp may fix their issues allowing us to update things again, but when I have some time, I'll likely start working on a much simpler approach to all of this.

facelessuser commented 4 months ago

Somehow Gulp 5.0 resolved itself when updating other JS dependencies 🤷🏻.