https://wiki.dendron.so/notes/7lVybQm4oETkTUyHRZB0...
# questions
s
The dendron publishing commands are outdated. I think if may work if you replace all instances of:
Copy code
bash
npx dendron buildSite --stage prod
With
Copy code
bash
npx dendron publish init && npx dendron publish export && mv .next/out docs
I have not tested this guide before, though, so I'm not sure if anything else is potentially outdated
r
OK thanks, will try and see if I can work it out today/tomorrow
s
Keep me updated 🙂 We can update that doc and move it out of legacy if it ends up working
r
Will have to revisit this next week, had to submit a request to MS to run parallel jobs
Does the dendron cli use any commands that try to install tools globally?
Haven't been able to get it working yet
Initial error was:
Copy code
npx dendron publish init && npx dendron publish export && mv .next/out docs

command not found: dendron
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ build: `npx dendron publish init && npx dendron publish export && mv .next/out docs`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-02-14T13_30_13_593Z-debug.log
s
This depends on your repo and: - If you have
package.json
in the root - If you are using
yarn
or
npm
to install packages Example repo: - https://github.com/dendronhq/template.publish.netlify -
package.json
present (with
*
for version) -
yarn.lock
present, generated by yarn Netlify executes: - https://github.com/dendronhq/template.publish.netlify/blob/main/dendron-publish-site.sh Commands of importance: -
yarn
(installs everything in
yarn.lock
) -
npm
would work the same way, if using
package-lock.json
This upgrading and maintaining of Dendron CLI versions is something I intend to document in our publishing docs. If you aren't sure, try the following: - Add
package.json
from the Netlify template to root of your workspace - Run
yarn
in your workspace to generate the
yarn.lock
file. If
yarn
isn't installed, can do
npm install -g yarn
- Add both
package.json
and
yarn.lock
to git - Change your publishing command to two commands:
Copy code
bash
yarn
npx dendron publish init && npx dendron publish export && mv .next/out docs
What this ultimately does is pin your dependencies to a point in time, and you can update the Dendron CLI in the future by running
yarn upgrade
which will update the
yarn.lock
file to use latest dendron cli
r
Wait, so looking at that netlify repo, does it matter that the repo I am trying to publish is the vault alone?
Or do I need to commit the entire dendron workspace?
s
Yeah, you'll need a workspace in order to publish. It could be a workspace that references a remote vault repo (via git submodule, or other means), or is a workspace with a local vault, since workspace configs via
dendron.yml
dictate certain publishing config settings
r
omg
s
This is something we want to change in the future, as we want vaults to function standalone. RFC discussion here: https://github.com/dendronhq/dendron/discussions/2349
r
Ah right, it would feel more natural imo if vaults could work standalone
I have it up and running now in azure. Wasn't able to get it working with assigned roles, so I used Microsoft's default of allowing all AAD authenticated users access
I think that would make more sense for this tutorial, then the user can look at the Azure docs if they want more detailed authentication/authorization