Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

feat: add Gatsby logo to returned framework info #797

Merged
merged 13 commits into from
Aug 9, 2022
Merged

Conversation

ericapisani
Copy link
Contributor

@ericapisani ericapisani commented Jul 26, 2022

Summary

Related issue

I removed the original test site and replaced it with just the assets folder which over time will contain all the logos for the various frameworks.

The cypress tests were also removed since they were testing that demo site, and various dependencies for the demo site were also removed (e.g: babel, react, webpack).

Test plan

  • Tested use of the package in build-info to confirm that the logo property was being returned as expected
  • Tested use of package in netlify frontend to confirm that the framework detection logic still worked as expected.
    • I did this by running the front end project locally with framework-info linked, logging in and going to create a new site, selected a nextJS project, confirmed that the default build commands were populated and a message indicating that a NextJS project was detected appeared

A picture of a cute animal (not mandatory, but encouraged)

PXL_20220720_211246629

@ericapisani ericapisani added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Jul 26, 2022
src/frameworks/gatsby.json Outdated Show resolved Hide resolved
@@ -33,6 +33,7 @@ Generated by [AVA](https://avajs.dev).
},
env: {},
id: 'sapper',
logos: undefined,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Are we ok with leaving logos as undefined until they're all added?

src/frameworks/gatsby.json Outdated Show resolved Hide resolved
remove react app since we are no longer using it
Shouldn't need it anymore with the react example site removed
also remove packages that were being used in the original test site, but are now not being used
@ericapisani ericapisani marked this pull request as ready for review July 27, 2022 17:51
@ericapisani ericapisani self-assigned this Jul 27, 2022
there's an area within the netlify UI that uses this package and the earlier changes broke it
package.json Outdated
"last 2 Safari versions",
"last 2 iOS versions",
"last 2 ChromeAndroid versions"
],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the demo app was removed from this project, it made sense to me that enforcement of this should likely from from the netlify FE project rather than here. If there's another reason why this should be added back in let me know

Copy link
Contributor

@nickytonline nickytonline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good. The main feedback is removing the old site first in a separate PR since it's currently not being used/maybe never been used?

scripts/webpack.config.site.js Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
src/frameworks/gatsby.json Outdated Show resolved Hide resolved
@@ -33,6 +33,7 @@ Generated by [AVA](https://avajs.dev).
},
env: {},
id: 'sapper',
logo: undefined,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious why logo is being added here only for Sapper when the PR is adding only Gatsby logos at the moment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's being added here because with the overall set of changes logo is being returned for all frameworks as part of the response body.

This particular snapshot is for a different test, and uses sapper instead of Gatsby, which is why this is appearing

@ericapisani ericapisani requested a review from MarcL August 4, 2022 12:47
Copy link
Contributor

@nickytonline nickytonline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I left a couple suggestions. 🚀

<body>
<a href="react">React Site</a>
</body>
<body></body>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[sand] Is the index.html file required since only assets are being served now?

Comment on lines +24 to +27
const originalLogo = contents.logo
if (originalLogo) {
for (const [theme, urlPath] of Object.entries(originalLogo)) {
updatedContents.logo[theme] = (process.env.DEPLOY_PRIME_URL || 'https://framework-info.netlify.app') + urlPath
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[dust] Prefer destructuring.

Suggested change
const originalLogo = contents.logo
if (originalLogo) {
for (const [theme, urlPath] of Object.entries(originalLogo)) {
updatedContents.logo[theme] = (process.env.DEPLOY_PRIME_URL || 'https://framework-info.netlify.app') + urlPath
const{ logo } = contents
if (logo) {
for (const [theme, urlPath] of Object.entries(logo)) {
updatedContents.logo[theme] = (process.env.DEPLOY_PRIME_URL || 'https://framework-info.netlify.app') + urlPath

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[dust] Similar comment to @nickytonline's about destructuring - I prefer template strings rather than string appends. Perhaps we codify stuff like this in our ESLint config if we don't have rules for this already.

Copy link

@MarcL MarcL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment but happy to merge it. 🎉

@kodiakhq kodiakhq bot merged commit 2a1ee73 into main Aug 9, 2022
@kodiakhq kodiakhq bot deleted the ep/add-gatsby-logo branch August 9, 2022 15:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
automerge type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants