-
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
fix(gatsby-cli): Re-Add plugin-add functionality #34482
Conversation
@@ -0,0 +1,86 @@ | |||
import reporter from "../reporter" |
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.
Copied from https://github.com/gatsbyjs/gatsby/blob/fb530ecccd45037b664525c5a7d18ea13f64a540/packages/gatsby-cli/src/handlers/plugin-add.ts which was deleted in "Remove recipes" PR
@@ -0,0 +1,193 @@ | |||
import * as fs from "fs-extra" |
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.
Partially copied from https://github.com/gatsbyjs/gatsby/blob/fb530ecccd45037b664525c5a7d18ea13f64a540/packages/gatsby-recipes/src/providers/gatsby/plugin.js & https://github.com/gatsbyjs/gatsby/blob/fb530ecccd45037b664525c5a7d18ea13f64a540/packages/gatsby-recipes/src/providers/npm/package.js
@@ -0,0 +1,319 @@ | |||
import * as t from "@babel/types" |
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.
Partially copied from https://github.com/gatsbyjs/gatsby/blob/fb530ecccd45037b664525c5a7d18ea13f64a540/packages/gatsby-recipes/src/providers/gatsby/plugin.js & https://github.com/gatsbyjs/gatsby/blob/fb530ecccd45037b664525c5a7d18ea13f64a540/packages/gatsby-recipes/src/providers/npm/package.js
|
||
const getValueFromNode = (node: any): any => { | ||
if (t.isTemplateLiteral(node)) { | ||
// @ts-ignore - fix me |
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 file has a lot of // @ts-ignore
. If you feel strongly about it I can spend time fixing it but I just wanted it to get working 😬
(cherry picked from commit 618b32b)
(cherry picked from commit 618b32b) Co-authored-by: Lennart <[email protected]>
Published in |
Description
The PR #34094 removed
gatsby-cli/lib/handlers/plugin-add
since it seemed unused. Turns out, it's not: It's used increate-gatsby
. So I've copied over the bits fromgatsby-recipes
that are needed and re-added it.plugin-add
should be nearly identical to what it was before, the other files are new/copied over.Related Issues
Fixes #34477
[sc-44408]