-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
feat: Deprecate gatsby-recipes
#34094
Conversation
describe: `The plugin names`, | ||
type: `string`, | ||
}), | ||
yargs.positional(`cmd`, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The stub was added in #27725 but never used again. So plugins
positional was never working, thus I removed this here + removed plugin-add.ts
handler file
@@ -9,7 +9,7 @@ import isValid from "is-valid-path" | |||
import sysPath from "path" | |||
import prompts from "prompts" | |||
import url from "url" | |||
import { updateSiteMetadata } from "gatsby-core-utils" | |||
import { updateInternalSiteMetadata } from "gatsby-core-utils" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The naming of the function confused me with the siteMetadata
from gatsby-config.js so I renamed this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seem to be getting this error when running gatsby build
now:
error (0 , _gatsbyCoreUtils.updateSiteMetadata) is not a function
TypeError: (0 , _gatsbyCoreUtils.updateSiteMetadata) is not a function
- build.ts:87 build
[project]/[gatsby]/src/commands/build.ts:87:9
- create-cli.js:240
[project]/[gatsby-cli]/lib/create-cli.js:240:14
- create-cli.js:130
[project]/[gatsby-cli]/lib/create-cli.js:130:24
- create-cli.js:41 Object.handler
[project]/[gatsby-cli]/lib/create-cli.js:41:19
- command.js:196 Object.runCommand
[project]/[gatsby-cli]/[yargs]/build/lib/command.js:196:48
- yargs.js:1043 Object.parseArgs [as _parseArgs]
[project]/[gatsby-cli]/[yargs]/build/lib/yargs.js:1043:55
- yargs.js:584 Object.parse
[project]/[gatsby-cli]/[yargs]/build/lib/yargs.js:584:29
- create-cli.js:541 createCli
[project]/[gatsby-cli]/lib/create-cli.js:541:136
- index.js:84 Object.<anonymous>
[project]/[gatsby-cli]/lib/index.js:84:26
- loader:1101 Module._compile
node:internal/modules/cjs/loader:1101:14
- loader:1153 Object.Module._extensions..js
node:internal/modules/cjs/loader:1153:10
- loader:981 Module.load
node:internal/modules/cjs/loader:981:32
- loader:822 Function.Module._load
node:internal/modules/cjs/loader:822:12
- loader:1005 Module.require
node:internal/modules/cjs/loader:1005:19
- helpers:102 require
node:internal/modules/cjs/helpers:102:18
- gatsby.js:3 Object.<anonymous>
[project]/[gatsby]/src/bin/gatsby.js:3:1
error Command failed with exit code 1.
I need to have a look into why this is happening though, as something in our build system isn't correctly pinning the version of gatsby + gatsby-cli it seems. (setting to the previous version doesn't fix the issue for some reason - should have an update tomorrow). I'm guessing (and unsure if this is always the case, but this change means that the gatsby + gatsby-cli versions must match)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shouldn’t add gatsby-cli as a dependency to a project. It’s a global CLI package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be clear we don't have it as a dependency in the package.json, however it's required in the CI system to be installed
return modifiedConfig | ||
} | ||
|
||
export async function addFieldToMinimalSiteMetadata( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Largely copied from gatsby-recipes
* Does a string replace by searching for beginning of "siteMetadata" | ||
* Then it adds the name + value as the next key of that object | ||
*/ | ||
function addField( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was previously a babel step, now it's a naive string replace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want to spend to long reviewing it. If create-gatsby and gatsby still works as expected i'm good to merge this!
💀 Recipes 💀
Description
This moves
gatsby-recipes
into thedeprecated-packages
directory in this monorepo. Thus with the next release when this is merged the package will no longer receive any new publishes and the current version will stay. A possible follow-up for this PR could be changing the README ofgatsby-recipes
to include a snippet like:# You can still use it like this npx gatsby-cli@version recipes emotion
I'd need to verify first if
npx
in fact includes supporting specifying a specific version.For Review
gatsby-recipes
being moved to the new directory.create-gatsby
README as the instructions were not correct when I tried it out myselfcreate-gatsby
andgatsby-cli
relied on some functionality from recipes, I've reimplemented it where necessaryDocumentation
The glossary entry was updated and one doc that mentioned a post about using recipes.
Related Issues
Partially addresses #25764 - more needs to be done but with recipes out one less culprit.
[sc-42424]