Closed KyleMaas closed 3 years ago
Sweet.
I got thinking about this - since this is patching a source file and removing specifically 9 lines, we might want to lock ssb-markdown's version in place and only upgrade when we've tested it, rather than doing a hat dependency where the file might change out from under us.
Yeah but we do have the shrinkmap file. This postinstall is pnpm specific, right?
npm-specific, yes.
Wierd, its not working here. Are you using bash shell?
Yes. Is it giving you an error?
Yeah:
> pushd node_modules/pull-async-filter; sed -i 's/2.26.0/3.6.14/' package.json; rm -rf node_modules/pull-stream; popd; pushd node_modules/pull-goodbye; sed -i 's/3.5.0/3.6.14/' package.json; rm -rf node_modules/pull-stream; popd; pushd node_modules/ssb-markdown; sed -i -e '/highlight: function/,+8 d' -e '/highlight/d' lib/block.js; sed -i '/highlight.js/d' package.json; popd; rm -rf node_modules/highlight.js
sh: 1: pushd: not found
sh: 1: popd: not found
sh: 1: pushd: not found
sh: 1: popd: not found
sh: 1: pushd: not found
sed: can't read lib/block.js: No such file or directory
sh: 1: popd: not found
Oh, you're using sh
, not bash
.
npm must be. I should be running bash.
npm config set script-shell bash
worked, but I would rather not have to instruct users to do that.
Well, I suppose if you need to, those can be changed to cd nodule_modules/pull-async-filter
(etc.) and cd ../..
I just prefer pushd and popd because I feel they're a little more robust in case of failures.
For browser-core I have used the patches folder. That always works. Good old patch
:-)
How are patches in that folder applied? I don't see anything in ssb-browser-core that actually does that.
It's manually applied as it's optional. Because it just decreases the bundle size. Like these ones.
More work on #219. Patches out Highlight.js. Takes release bundle down to 3558556 bytes - savings of 799711 bytes.