codeandpepper / janush

Set up a modern codebase for cloud-native web app with authentication features by running one command
https://janush.dev
MIT License
14 stars 1 forks source link

[Research] How to add some lines to the existing files when the user choose some of the features from prompt #109

Open arkjel opened 2 years ago

arkjel commented 2 years ago

We need to start thinking how to add lines to the existing files conditionally when the user choose some of the features from the prompt. Now we have some duplicated files when the user choose the authentication feature.

For example: many files in the /schematics/web/e2e/framework/files/cypress/authentication and /schematics/web/e2e/framework/files/cypress/base are duplicated. The files in the authentication directory are the same as they are in the base directory but contains more files related to authentication feature.

Please look at that cases.

OskarZaremba commented 2 years ago

I have found two ways to modify content of files dynamically.

These are mentioned below:

As far as I am concerned it seems that using conditional templates is more efficient and easier to use. Usage examples can be found on branch feature/dynamic-template-files and its two commits.