Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(devs-infra): restructure project + adjust astTransformers config #443

Merged
merged 1 commit into from
Aug 18, 2020
Merged

refactor(devs-infra): restructure project + adjust astTransformers config #443

merged 1 commit into from
Aug 18, 2020

Conversation

ahnpnl
Copy link
Collaborator

@ahnpnl ahnpnl commented Aug 12, 2020

Summary

  • Restructure project to prepare for yarn workspace

  • Let test apps install jest-preset-angular from src directory instead of root directory. This will greatly improve CI speed as well as local development. When we install this preset from root directory, yarn will start linking node_modules of root directory + node_modules of test apps themselves, which takes lots of time.

  • Adjust astTransformers config for jest-preset.js since string array config is deprecated in ts-jest 26.2.0

  • Adjust README.md

After this restructuring:

  • Whenever we publish the package, we need to do npm pack or yarn pack in src directory instead of root directory.

  • We will only pack and publish with compiled codes + package.json. Previously we publish with many other things.

Closes #439

Test plan

Green CI

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

N.A.

@ahnpnl ahnpnl requested a review from thymikee as a code owner August 12, 2020 15:03
@ahnpnl ahnpnl requested a review from wtho August 12, 2020 15:03
Copy link
Collaborator

@wtho wtho left a comment

Choose a reason for hiding this comment

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

Good Job 👍

@@ -3,7 +3,7 @@
"target": "es5",
"baseUrl": ".",
"module": "commonjs",
"outDir": "./build",
"outDir": "./src/build",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the build folder nested inside src? I think next to each other should be better, but I might overlook something

Copy link
Collaborator Author

@ahnpnl ahnpnl Aug 12, 2020

Choose a reason for hiding this comment

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

ya now build folder will be inside src, when we run npm pack or yarn pack in src, it will produce the same tgz file as before this PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the idea is for now we produce the tgz file with the same content as before this PR. Then in the next major release, we can consider to get rid of build in the tgz file content. So the whole tgz file content will potential be:

node_modules
-- jest-preset-angular
    -- index.js
    -- jest-preset.js
    -- zone-patch.js
    -- <other_transformers>.js
    -- <other_snapshot_serializers>.js

@ahnpnl
Copy link
Collaborator Author

ahnpnl commented Aug 18, 2020

can we merge this ?

@wtho
Copy link
Collaborator

wtho commented Aug 18, 2020

Yes! LGTM!

@ahnpnl ahnpnl merged commit 1011d15 into thymikee:master Aug 18, 2020
@ahnpnl ahnpnl deleted the restructure branch August 19, 2020 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The configuration for astTransformers as string[] is deprecated and will be removed in ts-jest 27
2 participants