Closed semanticdata closed 6 months ago
Hi @semanticdata
Thanks for the ideas. It's probably not something that everyone needs and should imho be implemented in a way that it doesn't affect users who are not using it.
Is there a specific reason you want to run the commands from the root or just because it's quicker? If it's just to avoid switching directories you can also use --prefix=.app
in the root (but of course it's longer than your approach).
If users prefer this approach they can create this file manually but I'm not sure if we should include this by default. It's additional file in the root which has to be updated (if we ever change the scripts) and the install
script is a bit uncommon (npm run install
works but is uncommon, npm install
works as well but generates a lock file in the root).
I would not like to ship Prettier configs by default in the root, not everyone will use it. But maybe we could install Prettier and provide the scripts. Users could configure Prettier and run the scripts, without making changes in the .app
directory. The two scripts could also generate the config files if they don't exist yet.
Also something I would not like to do by default, the template shouldn't install pre-commits hook automatically. Not everyone needs them and maybe some users don't even use Git (e.g. I use Obsidian Sync for my notes and don't need Git).
Maybe we can install Husky by default but only run the command when enabled in the app.js
file.
Thank you for your response.
Is there a specific reason you want to run the commands from the root, or just because it's quicker?
I like consistency. I work with many projects that rely on NPM commands. Most of them store the package.json
in the root of the repository.
If we are not shipping config files that differ from the defaults, I don't think it's worth the effort to provide users with scripts to do that when they can get these by following their Prettier installation guide. The better move might be not to include this.
Similar to number 2, Husky provides npx husky init
as their recommended way to set it up. Users are better off following official documentation.
Would you consider adding additional documentation to cover a "Suggestions" page?
Suggestion might not be the right name for it. We could provide documentation to add these additional features while highlighting the additional steps or configuration needed to make it work with the .app
folder approach.
Would you consider adding additional documentation to cover a "Suggestions" page?
Sure, I think that makes sense. Do you want to create a PR?
Sure. I'll put something together.
Hey @rothsandro
I have a decent start for the new documentation. But before submitting a new PR, I'd like to go over its contents and where in the docs it should live with you. Please review it and let me know what changes/adjustments are needed.
My idea is to separate the document into different notes, and create a new subsection "Extras" under "GUIDES". Like this:
GUIDES
├── Writing Notes
├── Organizing Notes
├── Core Features
├── Deployment
└── Extras
├── Adding Husky
├── Adding Prettier
├── Adding HTTP Headers
└── Adding a package.json to the root
Looks goods so far and creating different notes in a new section makes sense.
A few comments:
.app
directory, but section 3 includes the .app
folder in the pathexit 1
to the hook script to exit the test without committing anything, for example: \<example codeblock>prettierignore
file are not needed. node_modules
are ignored by default anyway. .parcel-cache
and dist
are already in the .gitignore
file and therefore ignored by Prettier. Not sure if we should mention pnpm
here, we normally don't have instructions for npm alternatives.npx
.installCommand
, ...).Thanks for the feedback. I addressed previous concerns and removed everything but the Husky section. And honestly, I'm not sure if it adds anything without a more put together effort to also provide other similar tools. Maybe the idea is not compatible with the project.
Here's the new version: Extras, and the new markdown version: Extras.md.
This section was modified to be standalone. It only offers information on installing and integrating Husky without mention of Prettier, etc.
.app
directory, but section 3 includes the .app
folder in the pathexit 1
to the hook script to exit the test without committing anything, for example: <example codeblock />
.This section was removed.
prettierignore
file are not needed. node_modules
are ignored by default anyway. .parcel-cache
and dist
are already in the .gitignore
file and therefore ignored by Prettier. Not sure if we should mention pnpm
here, we normally don't have instructions for npm alternatives.npx
.This section was removed.
This section was removed.
installCommand
, …).I'm not sure if it adds anything without a more put together effort to also provide other similar tools.
Not sure why you removed the Prettier + Package.json sections, but I agree. A complete guide for Husky + Prettier + ... could be useful but not sure how many users actually need this. And just for Husky, users should probably follow the official documentation.
I will close this as as not planned, hope that's okay for you.
Hello!
Thank you for creating the Eleventy Notes project. I'm a big fan. 😊 I came up with some ideas while customizing my clone^1 and wanted to share those with you in hopes you'll like them and consider implementing them. These ideas all preserve the sentiment behind using a
.app
folder, and I would be happy to submit PRs for them.1. Proxy
package.json
Recently, I have successfully been using a new
package.json
file in the root of the repository. This new file adds scripts to run the usualnpm run
style commands from the root of the project, allowing the same core group of commands/scripts to work without changing directory first.Here's my root
package.json
:Here's the
scripts
section from my.app/package.json
:2. Prettier integration
The new
npm run check
andnpm run format
scripts have been added and configured in a way that allows the prettier module to be installed within the.app/
directory, but also encourages the user to provide their own customization to Prettier's settings by storing the new configuration files in the root. (e.g..prettierrc
and.prettierignore
). We would then need to provide default configuration files in the root of the project.3. Husky integration
I'd like to integrate Husky by creating a new script that will be triggered prior to all commits, thus preventing you from pushing code with errors.