decaporg / decap-cms

A Git-based CMS for Static Site Generators
https://decapcms.org
MIT License
17.97k stars 3.05k forks source link

Docs/minimal template for installation with npm/yarn #5266

Closed mvolfik closed 3 years ago

mvolfik commented 3 years ago

Both Readme and docs say that it's possible to install CMS with NPM/yarn. However, it isn't as simple as npm install netlify-cms-app + import CMS from '...'; CMS.init(). After doing simply that I get a ton of unmet peer dependency errors (#1678; the result is pretty much the same with netlify-cms package, just that React is installed). I tried manually installing all these deps and building with esbuild, but that doesn't really work - there are some conflicts with react version, and also some modules require('path') (why? NetlifyCMS is only meant to be run in the browser...). Apparently there are some dependencies on webpack's inner workings or?

Also I looked at netlify-templates/one-click-hugo-cms – that somehow builds, but I have no idea why. And to be honest, I don't think this template is very useful – many moving parts. I would prefer something with the minimal build pipeline that works and without tens of plugins which I have no idea what's their purpose.

My working effort on creating such template is here, but now I'm stuck at a cryptic error (shown after opening the built files in browser):

Invariant Violation: Could not find "store" in either the context or props of "Connect(Notifs)".
Either wrap the root component in a <Provider>, or explicitly pass "store" as a prop to "Connect(Notifs)".

CC decaporg/decap-website#6 ?

erezrokah commented 3 years ago

Hi @mvolfik I believe this is related to https://github.com/netlify/netlify-cms/pull/5087 and also only partially fixed for https://github.com/netlify/netlify-cms/issues/5221

Pinning netlify-cms-app to 2.14.35 works for your repo.

Going to revert https://github.com/netlify/netlify-cms/pull/5087 until I can figure this out.