Skip to content
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

Migrate to Gatsby v5 #43

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Migrate to Gatsby v5 #43

wants to merge 9 commits into from

Conversation

alcrene
Copy link

@alcrene alcrene commented Mar 24, 2023

This migrates the theme to the latest version of Gatsby (v5).
Other noteworthy changes:

  • Uses the current version of yarn
  • Improved workspace support (thanks in part to updated yarn)
  • Support for dark mode (thanks to update to TailwindCSS v3)
  • showThemeLogo is no longer accessed via GraphQL query, making it easier for theme shadowing.

Noteworthy changes:
- Custom types (WorkHistoryYaml and ProjectsYaml) are now created with
  `createSchemaCustomization` instead of `createTypes`.
  + 'sourceNodes.js' is now (with a few modifications) 'createSchema.js'
- Replace use of Helm by the new Head API
  + 'lang' is now set in gatsby-ssr.js
- To support setting 'lang' in gatsby-ssr, a new plugin argument 'lang' is added.
  + This replaces the previous 'siteMetadata: local' argument
- TailwindCSS is upgraded to v3
  + dark mode option set to "media"
  + 'content' and 'safelist' options updated to v3 format
Remove duplicated dependencies: gatsby, react, react-dom were listed
under both "dependencies" and "peerDependencies"
-> Removed from "dependencies"

Add @babel/core

Remove index.js
Support for dark mode essentially just means adding `dark:*` variants
to all color utility classes.

Changing `showThemeLogo` to be passed by `context` (https://www.gatsbyjs.com/docs/creating-and-modifying-pages) avoids the need to
retrieve that flag via a GraphQL query. It also makes sense to set this
option at build time.
GraphQL queries can't really be shadowed (see gatsbyjs/gatsby#36920)
so passing flags in this way makes it easier for users to modify the theme
without having to fork the whole thing.
- Now works with with yarn v2+ (in this case 3.5.0)
- Update all dependencies to their most recent version.
- Bump theme version to 3.0.0
- !! Changed package name from `gatsby-theme-intro` to `@wkocjan/gatsby-theme-intro` !!
  + This corresponds to its scoped name on npm & the gatsby plugin repo
  + Since `site` has the dependency `"@wkocjan/gatsby-theme-intro": "*"`,
    using a matching name allows yarn correctly use the version from
    the workspace rather than pulling the one from the online repo.
Remove debug output on console
Re-add "main": "index.js" in package.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant