I’ve been using Gatsby for a couple of years now. If you know me you know I hate repetition and that most of my open-source software revolve around solving a problem that I don’t want to solve again and again.
🤔 So, it goes like this. I wake up one fine morning. Today, I’m working on a Gatsby site duh. I love to write content with MDX.
🙈 I go ahead and npm install gatsby-plugin-mdx but that’s not all I have to install. For the life of me, I can’t remember the peer dependencies needed to be installed.
🧐 So, I Google Gatsby Plugin MDX, land on the plugin page, scroll…scroll…scroll…table of contents…why MDX…yada…yadda…yadda… there you are. I then npm install @mdx-js/mdx @mdx-js/react.
☠️ That’s not quite how it should work. And then I close the tab and forget to read the first section of the readme.md docs — since I just need a refresher on how to configure this package. I’ve done it before. The entire story repeats itself.
🤔 I run gpm install gatsby-plugin-mdx and the package + the peer dependencies get installed. I also get a link the docs that I can click to read them online or most probably I fetch the docs in the terminal by running gpm docs gatsby-plugin-mdx.
Installs a Gatsby package with all of its peer dependencies.
# 1: Interactive mode.
# Type `gpm` and answer the questions asked.
# Alternatively, you can also run it via:
# 2: Direct mode.
# Several ways to run the same command.
gpm install gatsby-plugin-mdx
gpm i gatsby-plugin-mdx
The gatsby-package-manager (gpm) stores your choice of using npm or yarn in ~/.config/configstore/gatsby-package-manager.json file. This choice can be re-configured by using the option --config or -c when running gpm.
That’s all for now but I see this as an opportunity for what comes next. I believe with time Gatsby packages, the plugins, and themes, they’ll get a bit more complicated. gpm will help make Gatsby package management easy.
Some things that I could think gpm can do in the future:
🚀 Starters: Help search/install any of the existing starters
🎛 Standard Config: Help you configure a package provided we can all agree on a standard specification that gpm can read. Something that’s part of the package.json file, maybe?!
🗃 Packs: One of my apprentices, Saqib, suggested we could also have packs command that would install recommended or opinionated packs of packages. Let’s say gpm pack seo or gpm pack @ahmadawais/seo that installs different packs of packages and lists out the instructions to configure them. It would be cool.
🤯 Moaaar automation: Configure the packages automagically.
Nothing’s ever complete, so bear with me while we keep iterating towards a better future. You can definitely help make gpm better.
Coz every night I lie in bed
The brightest colors fill my head
A million dreams are keeping me awake
I think of what the world could be
A vision of the one I see
A million dreams is all it’s gonna take
A million dreams for the world we’re gonna make …