augments
hello, when augmenting the @sapphire/pieces to edit the container, when i use pnpm i am required to install '@sapphire/pieces' package or augments for @sapphire/pieces do not work
30 Replies
Solution
ah, i used pnpm cause it was fast but i think im just gonna switch back to normal npm, yarns features have no use for me
yarn is also fast <:rolling_eyes:796067273961504820> especially if you use Yarn v4 instead of Yarn v1 (which you should, yarn v1 is very very deprecated)
is yarn the best to use?
i just feel like i dont use any features of yarn
That's a subjective question but at least Sapphire uses Yarn
except yarn upgrade-interactive that is very useful
yarn is/has:
- ensures consistent package manager versions as the version is per-repo as opposed to npm where other contributors can fuck up your package-lock.json because they have an older version
- Or if you're on windows and their on linux it can also fuck up, joy!
- better support for symlinking packages
- a clearer lockfile, one that is also human readable unlike package-lock.json
- better support for workspaces
- supports more protocols for installing packages
- easier to configure and documentation for configuration options is easier to access
- supports local cache OOTB for consistent cache / no internal installation
- and if pnp mode is enabled you can even achieve zero installs
what are zero installs
literally what the name implies. Other people not having to install packages. https://yarnpkg.com/features/caching#zero-installs
Cache strategies | Yarn
How to ensure your installs perform the absolute minimal amount of work.
Yarn v4 is new version of Yarn that we recommend switching to as Yarn v1 has long since been deprecated.
"But I don't see any update on [source]?"That is correct. Yarn v4 is installed through Yarn itself. You configure Yarn v4 on a per-project basis. How you installed Yarn globally is largely irrelevant to this (corepack, volta, something else). How to install Yarn v4 for your project? Simply write: This will download the new Yarn v4 binary and put in
.yarn/releases
, you should push this to your Git repository. It will also create a .yarnrc.yml
file which configures the path which you should also commit.
Next you probably also want to run the following 2 commands:
This will add to your .yarnrc
file:
This ensures you have a more traditional experience with node_modules
and a global cache.
The next step is to nuke your node_modules
and yarn.lock
and run yarn install
Then some final adjustments. Put this in you .gitignore
:
And anywhere in your scripts in package.json where you use *
you should wrap it in extra "
For example:
Mind you this last thing is a good thing to add regardless of script runner / package bundler because it ensures the glob is performed by the library and not by your shell, which may differ when people develop on different operating systems.
In short, the command to set everything up you can run:
Granted that and local cache are mostly useful in larger teams with diverse experience and/or advanced CI/CD environments, but the fact that it exists at all is still cool
what yarn options do you use
like for every project
what the bot lists, though yarn v4 added
compressionLevel: mixed
as well. Haven't delved into what that exactly is.The value mixed is a variant of 9 where files are stored uncompressed if the gzip overhead would exceed the size gain.
so pretty much just 9ah apparently 9 is equal to Yarn v3
yarn looks really nice
the actual logs and whatnot
To avoid making the upgrade too disruptive, Yarn will check whether Zero-Installs are enabled the first time you run yarn install after migrating from 3.6 to 4.0. If you do, it will automatically set the old default (compressionLevel: mixed) in your .yarnrc.yml file. You can then remove it whenever you feel ready to actually change the compression settings.I guess compression level is only relevant if you 1. use local cache 2. check that into Git
wait so
what is the equivelant of npx in yarn
yarn dlx
i need to use npx for my prisma
ah ok
or just
yarn prisma
if you have it in devdepsyeah i do
okay
it automatically matches first against scripts and then in CLI tools in
node_modules/.bin
I should've added that to the list above
it's stupid that npm doesn't match automaticallytysm favna, btw do you use linux?
you seem like the type of person to use it lol
Nah Windows and Mac.
nice i love macos
also if possible i know this is a big favour but could you at any time just check my bots source and tell me what to improve on
i would appreciate it a lot
I suppose I could but be warned that with such requests I am quite critical
thats what i need haha
(and nitpicky)
ive made sure ive used the best practices for everything ive done
so im excited to see what you could tell me to improve on
hey, tysm again here is the repo:
https://github.com/nicklvh/joewy
its still wip