Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

build: create a separate tsconfig file for build #28

Merged
merged 1 commit into from
Dec 14, 2020
Merged

build: create a separate tsconfig file for build #28

merged 1 commit into from
Dec 14, 2020

Conversation

dianjuar
Copy link
Collaborator

@dianjuar dianjuar commented Dec 14, 2020

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.

"build": "rimraf dist && json2ts deploy/schema.json > deploy/schema.d.ts && tsc && copyfiles README.md builders.json collection.json ng-add-schema.json package.json ngx-deploy-starter deploy/schema.json dist",
"prebuild": "rimraf dist && json2ts deploy/schema.json > deploy/schema.d.ts",
"build": "tsc -p tsconfig.build.json",
"postbuild": "copyfiles README.md builders.json collection.json ng-add-schema.json package.json ngx-deploy-starter deploy/schema.json dist",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, too!

@JohannesHoppe
Copy link
Member

This is a good point!

@JohannesHoppe
Copy link
Member

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
Copy link
Member

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
Copy link
Collaborator Author

dianjuar commented Dec 14, 2020

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
Copy link
Collaborator Author

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 JohannesHoppe mentioned this pull request Dec 14, 2020
@JohannesHoppe JohannesHoppe merged commit eba93bb into angular-schule:master Dec 14, 2020
@JohannesHoppe
Copy link
Member

I see a lot of potential here, let's move to a separate issue:
#29

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants