0.0.5 • Published 2 years ago
gatsby-update v0.0.5
gatsby-update
How to use
Meant to be run with npx
when you want to get the latest of all your Gatsby plugins. cd
into whereever your
npx gatsby-update
# or with flags
npx gatsby-update --tag next --excluded gatsby gatsby-plugin-vanilla-extract
Should be run in the root of your Gatsby site (wherever package.json is). Running --tag next
requires Node 18.
Options
--tag latest | next
Install the plugins @latest
or @next
. Defaults to latest
.
--excluded name-of-plugin or-several
Plugins to exclude from the update. As noted above, the script aims to update gatsby
and any package in package.json's dependencies
that begins with gatsby-
.
What it does
You can obviously look at the logic in src/index.ts
but TLDR of what goes on when you run the script:
- Guess package manager to use based on lockfile in directory. Falls back to
npm
. - Remove previous lockfile(s) and
/node_modules
- Get
dependencies
frompackage.json
, and filter forgatsby
or any name starting withgatsby-
. Removeexcluded
plugins if provided. - Run
npm install
/yarn add
for each plugin in the filtered list atlatest
/next
.