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

Bump and reduce dependencies #171

Draft
wants to merge 48 commits into
base: master
Choose a base branch
from
Draft

Bump and reduce dependencies #171

wants to merge 48 commits into from

Conversation

doamatto
Copy link
Collaborator

@doamatto doamatto commented Jul 23, 2023

Type of pull request: maintenance

Related issues: #170, #169, #151, #150, #149, #80, #181, #186, #191, #192, #193
Related repos: neutralis/hbl-strings, neutralis/hbl-maths, neutralis/hbl-object, neutralis/hbl-cmark, neutralis/hbl-arrays, neutralis/hbl-comparison, neutralis/hbl-urls

† = not public/done yet

@doamatto doamatto self-assigned this Aug 6, 2023
@doamatto doamatto added size/M dependencies Pull requests that update a dependency file labels Aug 6, 2023
doamatto and others added 6 commits August 6, 2023 10:27
It seems they are only used in src/build/icons.ts, which is never called by anything.
My understanding is that this is meant to be run on its own to help with making
products. Maybe I can split this off into something else in the future – I've wanted
to make a GUI for people to do rubrics for awhile that would make PRs easier to handle,
but we'll see.

For now, the deps have been moved.
I'm going to try and migrate to 1.y.z and get us even closer to the proper main version. Ve vill see.
@doamatto
Copy link
Collaborator Author

Packages are all OK™. A few quirks to deal with, but hopefully we're nearing the end of this very-long-delayed MR.

Several hot-fixes were made to add compatibility with `handlebars-wax`
(which `gulp-hb` uses) and ensure helpers were brought inline with their
predecessor
Seems to be unused. Will reinstall if it causes problems
Shouldn't be an issue for a hot while
We aren't too concerned about this stuff. Ideally, this should be either
removed or moved elsewhere in the future since these migrations are, as
far as I'm aware, long done.
@milesmcc
Copy link
Collaborator

Thanks for doing this!

@doamatto
Copy link
Collaborator Author

Found some quirky stuff while working offline. The command I've been using to build (NODE_ENV="development" LOG_LEVEL="debug" npx cross-env NODE_OPTIONS="--trace-deprecation --trace-warnings" npx gulp) weirdly doesn't work.

Supposedly the fix is linking ts-node (npm link ts-node) but that yielded an error that explains why I've seen another error.

doa@litten ~/git/politiwatch/privacyspy % npm link ts-node                                             
npm error code 127
npm error path /Users/doa/.nvm/versions/node/v22.2.0/lib/node_modules/ts-node
npm error command failed
npm error command sh -c npm run clean && npm run build-nopack
npm error > [email protected] clean
npm error > rimraf temp dist tsconfig.schema.json tsconfig.schemastore-schema.json tsconfig.tsbuildinfo tests/ts-node-packed.tgz tests/node_modules tests/tmp
npm error sh: rimraf: command not found
npm error A complete log of this run can be found in: /Users/doa/.npm/_logs/2025-01-21T17_15_50_724Z-debug-0.log

rimraf has shown up as the only reasonable source of tasks not completing like this :

Did you forget to signal async completion?
TypeError: callback is not a function
    at CB (node:internal/fs/rimraf:60:5)
    at FSReqCallback.oncomplete (node:fs:188:23)
    at FSReqCallback.callbackTrampoline (node:internal/async_hooks:130:17)

Will likely spend some time updating the README to add some useful commands for people building locally in the future, as well as getting things to work again within the CI/CD. All that to say — I have no clue what caused this (iirc it was a problem before switching to npx for gulp too)

I think migrating to esbuild over time *could* help mitigate some
issues, the most notable one being the weird requirement for a network
connection to build PrivacySpy (which is ridiculous in general).

deps:
chore: rename css.ts -> scss.ts
@doamatto
Copy link
Collaborator Author

Words cannot describe the amount of disgust and distain the fix for this was. That is to say — using fs.rmSync in place of fs.rm has fixed this problem entirely and builds should now clear.

Will investigate not being able to build offline (Loaded external module: ts-node/register being the likely culprit) and just might be done after that

- Removes esbuild system (may™ return in future)
- Moves SASS back to src/static/css/ (rather than src/css/)
- Re-adds PostCSS, Gulp tasks for SASS transpilation
@doamatto
Copy link
Collaborator Author

We are oh so close. npx gulp finishes fine locally (gulp in 2.8s, compared to last prod deploy of gulp in 11s) but fails on Netlify with :

12:50:31 PM: /opt/build/repo/node_modules/hbl-cmark/dist/index.js:1
12:50:31 PM: var w=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var c=(r,e)=>{for(var a in e)w(r,a,{get:e[a],enumerable:!0})},u=(r,e,a,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of f(e))!o.call(r,n)&&n!==a&&w(r,n,{get:()=>e[n],enumerable:!(t=v(e,n))||t.enumerable});return r};var S=r=>u(w({},"__esModule",{value:!0}),r);var l={};c(l,{default:()=>g,register:()=>m});module.exports=S(l);var s=require("commonmark"),i=require("node:fs"),p=require("node:path"),q=require("handlebars");function g(r){r.registerHelper("markdown",e=>{var a=new s.Parser,t=new s.HtmlRenderer,n=a.parse(e.fn(this));return new r.SafeString(t.render(n))}),r.registerHelper("md",e=>{var a=p.resolve(process.cwd(),e);data=i.readFileSync(a,"utf8");var t=new s.Parser,n=new s.HtmlRenderer,d=t.parse(data);return new r.SafeString(n.render(d))})}function m(r){r.registerHelper("markdown",e=>{var a=new s.Parser,t=new s.HtmlRenderer,n=a.parse(e.fn(this));return new r.SafeString(t.render(n))}),r.registerHelper("md",e=>{var a=p.resolve(process.cwd(),e);data=i.readFileSync(a,"utf8");var t=new s.Parser,n=new s.HtmlRenderer,d=t.parse(data);return new r.SafeString(n.render(d))})}0&&(module.exports={register});
12:50:31 PM:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           ^
12:50:31 PM: <ref *2> PluginError [TypeError]: e.fn is not a function
12:50:31 PM:     at String.<anonymous> (/opt/build/repo/node_modules/hbl-cmark/dist/index.js:1:1003)
12:50:31 PM:     at String.wrapper (/opt/build/repo/node_modules/handlebars/lib/handlebars/internal/wrapHelper.js:10:19)
12:50:31 PM:     at eval (eval at createFunctionContext (/opt/build/repo/node_modules/handlebars/lib/handlebars/compiler/javascript-compiler.js:265:23), <anonymous>:11:133)
12:50:31 PM:     at prog (/opt/build/repo/node_modules/handlebars/lib/handlebars/runtime.js:333:12)
12:50:31 PM:     at execIteration (/opt/build/repo/node_modules/handlebars/lib/handlebars/helpers/each.js:50:9)
12:50:31 PM:     at Object.<anonymous> (/opt/build/repo/node_modules/handlebars/lib/handlebars/helpers/each.js:63:13)
12:50:31 PM:     at Object.wrapper (/opt/build/repo/node_modules/handlebars/lib/handlebars/internal/wrapHelper.js:10:19)
12:50:31 PM:     at eval (eval at createFunctionContext (/opt/build/repo/node_modules/handlebars/lib/handlebars/compiler/javascript-compiler.js:265:23), <anonymous>:11:49)
12:50:31 PM:     at Object.prog [as fn] (/opt/build/repo/node_modules/handlebars/lib/handlebars/runtime.js:333:12)
12:50:31 PM:     at Object.<anonymous> (/opt/build/repo/node_modules/handlebars/lib/handlebars/helpers/if.js:19:22) {
12:50:31 PM:   __safety: undefined,
12:50:31 PM:   _stack: undefined,
12:50:31 PM:   plugin: 'gulp-hb',
12:50:31 PM:   showProperties: true,
12:50:31 PM:   showStack: true,
12:50:31 PM:   fileName: '/opt/build/repo/src/templates/pages/product.hbs',
12:50:31 PM:   domainEmitter: <ref *1> Transform {
12:50:31 PM:     _events: [Object: null prototype] {
12:50:31 PM:       newListener: [Function: newListener],
12:50:31 PM:       pipe: [Function]
12:50:31 PM:     },
12:50:31 PM:     _eventsCount: 2,
12:50:31 PM:     _maxListeners: undefined,
12:50:31 PM:     _duplexState: 918036,
12:50:31 PM:     _readableState: ReadableState {
12:50:31 PM:       stream: [Circular *1],
12:50:31 PM:       queue: [FastFIFO],
12:50:31 PM:       highWaterMark: 0,
12:50:31 PM:       buffered: 0,
12:50:31 PM:       readAhead: true,
12:50:31 PM:       error: [Circular *2],
12:50:31 PM:       pipeline: [Pipeline],
12:50:31 PM:       byteLength: [Function: defaultByteLength],
12:50:31 PM:       map: null,
12:50:31 PM:       pipeTo: [DestroyableTransform],
12:50:31 PM:       afterRead: [Function: bound afterRead],
12:50:31 PM:       afterUpdateNextTick: [Function: bound updateReadNT]
12:50:31 PM:     },
12:50:31 PM:     _writableState: WritableState {
12:50:31 PM:       stream: [Circular *1],
12:50:31 PM:       queue: [FastFIFO],
12:50:31 PM:       highWaterMark: 0,
12:50:31 PM:       buffered: 0,
12:50:31 PM:       error: [Circular *2],
12:50:31 PM:       pipeline: null,
12:50:31 PM:       drains: null,
12:50:31 PM:       byteLength: [Function: defaultByteLength],
12:50:31 PM:       map: null,
12:50:31 PM:       afterWrite: [Function: bound afterWrite],
12:50:31 PM:       afterUpdateNextTick: [Function: bound updateWriteNT]
12:50:31 PM:     },
12:50:31 PM:     _predestroy: [Function: predestroy],
12:50:31 PM:     _transformState: TransformState {
12:50:31 PM:       data: null,
12:50:31 PM:       afterTransform: [Function: bound afterTransform],
12:50:31 PM:       afterFinal: [Function: bound afterFinal]
12:50:31 PM:     },
12:50:31 PM:     _flush: [Function: flush],
12:50:31 PM:     _read: [Function (anonymous)],
12:50:31 PM:     [Symbol(shapeMode)]: false,
12:50:31 PM:     [Symbol(kCapture)]: false
12:50:31 PM:   },
12:50:31 PM:   domainThrown: false
12:50:31 PM: }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code Related to PrivacySpy's source code dependencies Pull requests that update a dependency file internal A PR comes from an internal feature branch size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Highlight.js
2 participants