pixelastic / norska

🏔️ Custom SSG using Pug, Webpack, PostCSS and Tailwind.
https://projects.pixelastic.com/norska/
MIT License
8 stars 0 forks source link

norska init should be aware of a mono-repo setup #67

Open pixelastic opened 4 years ago

pixelastic commented 4 years ago

When running norska init in ./docs/ when in a monorepo setup, some files could be created in a better place. The initial code was meant with the assumption that the git root was the same as the module root (ie. package.json file is sitting next to .git folder).

In a mono-repo setup:

The following points should be addressed:

netlify.toml

The netlify.toml file should be created in the repoRoot, not the projectRoot. Netlify operates on the repository level, listening to events on the repo. This will be our job to make sure a job is started only when the documentation is updated.

[build]
  command = "yarn run build:prod"
  publish = "./docs/dist/"

The command might stay build:prod and point to a script in the root that builds the ./docs folder. The publish directory must point to the subfolder.

⚠ Maybe the commands involving the netlify cli will need a netlify.toml in the docs/ folder. We need to check.

.gitignore

The .netlify/ folder is added to the current .gitignore, but because there is no such file in the project root, a new one is created. It should add .netlify to the .gitignore in the repoRoot instead.