engine
engine copied to clipboard
Better OTA scripts to handle modified files
For now there is a very complicated bash command in all declaration repositories to run lint
test
and track
All this complexity can be handled directly in the scripts and this is waht this PR does
@Ndpnt please validate the concept of this PR so that I can go on with it tomorrow for track
and test
command.
Idea here is to
- use
commander
instead of args parsing - add a
-m
option to every script in order to launch the script only on modified files
This PR has been revamped after discussion with @Ndpnt
I created a branch in sandbox-declarations in order to test this behavior https://github.com/OpenTermsArchive/sandbox-declarations/pull/149
It handles cases like
- deleted service
- modified history service
- modified service
- modified filter
When this PR is accepted and the one on sandbox also, a PR like this one should be done on all instances.
Let's note here that the process of updating multiple instances everytime a script changes is somehow cumbersome and we should definitely begin thinking about a new repo like declarations-tools
which could be installed globally.
This would remove the need for a package.json in the declarations repo (except in those which need filtering)
Nice addition, it will simplify declarations repositories! 👍
For consistency, also move
track
command description in./bin/track.js
, removesrc/main.js
and update npm start script inpackage.json
.
For this I'd like to postpone this until you come back @Ndpnt.
Indeed, I'm still not quite sure I understand correctly how config.util.setModuleDefaults works, but it seems that if I do so, it will override the corresponding defaults from config/default.json
and thus make all instance repositories to not work anymore as they rely for example on services/declarationsPath
which would be not accurate anymore.