Lullabot / gatsby-theme-adr

A Gatsby theme to generate a static site for ADRs
MIT License
12 stars 4 forks source link

Document how to develop against this project #34

Closed deviantintegral closed 2 years ago

deviantintegral commented 2 years ago

Is your feature request related to a problem? Please describe.

I'm trying to do some work on the ADR theme, but I'm stuck with linking. In the theme itself, gatsby develop says "If you are trying to run a theme directly, use the theme in an example site or starter instead and run that site to test.". In our architecture repo, I ran npm link @lullabot/gatsby-theme-adr and the symlink is correct, but I get this plugin error even though I also added it as a dev dependency to our architecture repo:

Couldn't find the "gatsby-plugin-image" plugin declared in "/Users/andrew/workspace/lullabot/gatsby-theme-adr/gatsby-config.js".
Tried looking for an installed package in the following paths:
 - /Users/andrew/workspace/lullabot/architecture/node_modules/gatsby/dist/bootstrap/load-themes/node_modules/gatsby-plugin-image
 - /Users/andrew/workspace/lullabot/architecture/node_modules/gatsby/dist/bootstrap/node_modules/gatsby-plugin-image
 - /Users/andrew/workspace/lullabot/architecture/node_modules/gatsby/dist/node_modules/gatsby-plugin-image
 - /Users/andrew/workspace/lullabot/architecture/node_modules/gatsby/node_modules/gatsby-plugin-image
 - /Users/andrew/workspace/lullabot/architecture/node_modules/gatsby-plugin-image
 - /Users/andrew/workspace/lullabot/node_modules/gatsby-plugin-image
 - /Users/andrew/workspace/node_modules/gatsby-plugin-image
 - /Users/andrew/node_modules/gatsby-plugin-image
 - /Users/node_modules/gatsby-plugin-image
 - /node_modules/gatsby-plugin-image

The Gatsby Docs promote using Yarn Workspaces, though they also say npm link should work. As well, this repository doesn't mirror the directory structure there, so I'm not sure how to get this going.

Describe the solution you'd like

Documentation added to the README, even if it's just links to upstream docs I've missed.

e0ipso commented 2 years ago

@deviantintegral did you execute the step to get the boilerplate code?

# Download the boilerplate project so we can tweak it.
npx degit github:e0ipso/adr-website-example#main docs

# ...

That should create an actual theme, that uses this project.

deviantintegral commented 2 years ago

I just gave that a try, running:

Which gave me:

npm run-script develop

> my-company-architecture@1.0.0 develop
> gatsby develop

success compile gatsby files - 0.510s

 ERROR #10226  CONFIG

Couldn't find the "gatsby-plugin-image" plugin declared in "/Users/andrew/workspace/lullabot/gatsby-theme-adr/gatsby-config.js".

Tried looking for an installed package in the following paths:
 - /Users/andrew/workspace/lullabot/docs/node_modules/gatsby/dist/bootstrap/load-themes/node_modules/gatsby-plugin-image
 - /Users/andrew/workspace/lullabot/docs/node_modules/gatsby/dist/bootstrap/node_modules/gatsby-plugin-image
 - /Users/andrew/workspace/lullabot/docs/node_modules/gatsby/dist/node_modules/gatsby-plugin-image
 - /Users/andrew/workspace/lullabot/docs/node_modules/gatsby/node_modules/gatsby-plugin-image
 - /Users/andrew/workspace/lullabot/docs/node_modules/gatsby-plugin-image
 - /Users/andrew/workspace/lullabot/node_modules/gatsby-plugin-image
 - /Users/andrew/workspace/node_modules/gatsby-plugin-image
 - /Users/andrew/node_modules/gatsby-plugin-image
 - /Users/node_modules/gatsby-plugin-image
 - /node_modules/gatsby-plugin-image

not finished load gatsby config - 0.035s
e0ipso commented 2 years ago

This is likely a missing dependency then.

Does yarn add gatsby-plugin-image fix the problem?

deviantintegral commented 2 years ago

It doesn't look like it.

I added the package with npm i, and then re-ran npm link @lullabot/gatsby-theme-adr and get the same error.

You switched to a yarn command - should I be using it instead?

e0ipso commented 2 years ago

You switched to a yarn command - should I be using it instead?

No, sorry. I am using yarn at my client project and force of habit kicked in.

e0ipso commented 2 years ago

It seems this is a non-solvable issue. From what I see we need to use yarn workspaces. sigh

https://github.com/gatsbyjs/gatsby/issues/25619

e0ipso commented 2 years ago

@deviantintegral I have revamped the whole project for this. Then I added some docs.

github-actions[bot] commented 2 years ago

:tada: This issue has been resolved in version 1.2.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: