angular-schule / ngx-deploy-starter

Starter repository to create a new builder to utilize the `ng deploy` command 🚀
https://www.npmjs.com/package/@angular-schule/ngx-deploy-starter
MIT License
54 stars 30 forks source link

build: create a separate tsconfig file for build #28

Closed dianjuar closed 3 years ago

dianjuar commented 3 years ago

I've seen that is a common practice between typescript projects to have separate tsconfig files, Angular and Nest do that.

Also, I've been discovering some improvements using this configuration on my fork:

The build is independent for the test

Currently, if there is a typo on the test, the build fails due to a compilation error. Very inconvenient when you are making some experiments and want to try them.

The tests are not being compiled and added to the dist

On the final build, there is no need to put the test, they are useless there. This makes the compilation time faster (0.02 sec faster on my machine 🤓) and the final library lighter.

JohannesHoppe commented 3 years ago

This is a good point!

JohannesHoppe commented 3 years ago

Additionally I already thought about cleaning up the final dist/package.json. There is no need to expose the devDependencies or the build-scripts. And since you have now removed the tests, the npm test script won't work at all in the final package.

JohannesHoppe commented 3 years ago

And you have probably realised that npx-deploy-starter is a little bit more complicated than angular-cli-ghpages, because there are two README files. What to you think about merging them into one single file in the root?

dianjuar commented 3 years ago

What about of having two separate package.json files?

One outside the src folder for development that will contain all the development stuff (test, build, lint, prettier, publishing, etc) and the other one inside src that would be the one that is going to be on the dist.

Personally it's little bit frustrating having the package.json inside the src folder, I always forget to step into the right folder to execute npm install.

I think with this movement will rise my development satisfaction.

dianjuar commented 3 years ago

And you have probably realised that npx-deploy-starter is a little bit more complicated than angular-cli-ghpages, because there are two README files. What to you think about merging them into one single file in the root?

For this I do a little trick, I only have one Readme file, with all the instructions and documentation and create a symbolic link (ln -s file-path destiny-path) to have it in both places.

I feel OK, with this trick, does the job. I don't know how can I make it different. Maybe two separate Readme?

JohannesHoppe commented 3 years ago

I see a lot of potential here, let's move to a separate issue: https://github.com/angular-schule/ngx-deploy-starter/issues/29