yarn install modifies a file in my source tree: packages/generator-joplin/package.json
diff --git a/packages/generator-joplin/package.json b/packages/generator-joplin/package.json
index 9d5742f5a..558e6d999 100644
--- a/packages/generator-joplin/package.json
+++ b/packages/generator-joplin/package.json
@@ -38,4 +38,4 @@
"repository": "https://github.com/laurent22/generator-joplin",
"license": "AGPL-3.0-or-later",
"private": true
-}
\ No newline at end of file
+}
This should not happen. I am not sure why yarn install would generate a file in the first place, but to fix the immediate issue, the file in the source tree should be updated.
@laurent here is my workflow to generate the new translation files:
pull dev HEAD
run yarn install
run yarn run tsc
run npm run buildTranslations
If I didn't restore the changed source files, these 5 files would also be included when staging the files generated/modified by buildTranslations.
IMO yarn install should not change any files in the source tree.
There are a bunch of other targets, like build* or release* or we could create a new one that changes these files. e.g. prepare, or generate.
But an install action should do nothing but install all dependencies.
Thank you for raising this! This is likely happening because postinstall is set to husky && gulp build:
Since the Yarn postinstall documentation recommends against using postinstall, it may make sense to replace the "postinstall" key with "build" (or something similar) and update the contributing documentation.
I'm surprised this is there actually as we are supposed to manually call yarn buildParallel after install. Maybe it was just forgotten as indeed we normally don't want postinstall scripts.
But the build command would still modify files anyway. It seems in this case it's because the plugin assets aren't updated automatically when the mermaid package is updated.
I think running a build script is allowed to generate new files. As you said, the assets aren't updated automatically, although at one point, we made sure (manually) that we updated them as well. So this guarantees that the files are up-to-date when building the app.
However, in that case we could also add the build translation step to the build step in the pipeline. e.g. npm run dist does not commit any changes to the repo either.
This would solve the problem that updated translations are not included in a release.
Thus when building an app or dist, we could run buildTranslations.