-
Notifications
You must be signed in to change notification settings - Fork 26
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
feat: add version export #840
Conversation
@@ -18,6 +18,9 @@ const configureRollupPlugins = (options = {}) => | |||
[ | |||
replace({ | |||
'process.env.NODE_ENV': JSON.stringify('production'), | |||
'process.env.npm_package_version': JSON.stringify( | |||
process.env.npm_package_version | |||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. If this works I'll simplify app-kit again too again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we don't use lerna here for bumping versions... I think that's why we can have this simpler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice.
@@ -9,6 +9,12 @@ describe('exports', () => { | |||
expect(customProperties).toBeTruthy(); | |||
}); | |||
|
|||
describe('version', () => { | |||
it('should match package.json version', () => { | |||
expect(version).toMatch(process.env.npm_package_version); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bundle tests 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or should I directly import from package.json 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think either is fine.
@@ -9,6 +9,12 @@ describe('exports', () => { | |||
expect(customProperties).toBeTruthy(); | |||
}); | |||
|
|||
describe('version', () => { | |||
it('should match package.json version', () => { | |||
expect(version).toMatch(process.env.npm_package_version); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think either is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Yeah, here we can simply do it in rollup, as the release works differently.
Summary
Like similar PRs in App Kit, we also add a version export 😄