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

Generate version.ts before publish to NPM #1780

Closed
huan opened this issue May 14, 2019 · 1 comment
Closed

Generate version.ts before publish to NPM #1780

huan opened this issue May 14, 2019 · 1 comment
Assignees

Comments

@huan
Copy link
Member

huan commented May 14, 2019

Currently, we are using read-pkg-up to load module version at run time.

There has a discussion between @footballencarta and me before, at huan/rx-queue#25 (comment), I agree with most of his options and I decide to generate a static for our modules to prevent some strange bugs.

The most recent bug I had experienced is that the read-pkg-up package API had a breaking change, which causes a log problem in our Chatie ecosystem because I'm heavy depended on it.

So what I'm planning to do, is:

  1. Create a dummy src/version.ts file only export const VERSION = '0.0.0'
  2. Add a unit test to make sure the VERSION exported from version.ts is equal to 0.0.0
  3. Add a scripts/generate-version.ts to generate src/version.ts file
  4. Run scripts/generate-version.ts right before npm run dist in Travis CI
  5. So that we can save the version number to our module before npm publish
@huan huan self-assigned this May 14, 2019
huan added a commit to wechaty/puppet-mock that referenced this issue May 14, 2019
@huan
Copy link
Member Author

huan commented Jul 8, 2019

Close this issue because it had been implmented.

@huan huan closed this as completed Jul 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant