-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: allow using streetmerchant as a library #2038
Conversation
@@ -1,5 +1,6 @@ | |||
{ | |||
"name": "streetmerchant", | |||
"version": "3.4.1", |
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.
Adding a version number here will increase the maintenance burden because it requires updating versions in two places. I can change banner.ts
to use this number if that's preferable.
The changes in this file aren't strictly necessary as it's easy to make them myself and then tell git
to make them assume-unchanged
.
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.
Before we make this change, I'd like to update the pipeline to manage this for us. This is easy enough, but just needs an update.
@@ -17,7 +18,7 @@ | |||
"test:notification:production": "node build/test/functional/test-notification.js" | |||
}, | |||
"engines": { | |||
"node": ">=12.0.0 <15.0.0" | |||
"node": ">=12.0.0 <15.11.0" |
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 understand that there could be good reasons for keeping <15.0.0
, which I don't know.
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 was keep it below 15 only because some folks were having problems with tsc
. We should probably get on latest sooner than later though!
|
||
const version = readFileSync('version.txt', 'utf8'); | ||
const version = readFileSync(path.join(__dirname, '../../version.txt'), 'utf8'); |
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 would really like to get this change in if possible. I'm not terribly familiar with the typescript compiler nor the node runner, but when I run it from my other project, the version.txt
file isn't found as it's looking for it somewhere else.
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.
Interesting... Yeah I'm getting the version running as is, but if you're running within Docker, this could be an issue?
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 it was looking in the path of the project that wraps it.
Alright, made a PR (#2066) This should get the things you need! |
Alright! Thanks a bunch! |
Description
As explained in #2034, I'm trying to use streetmerchant as a library in another project that exposes a different dashboard.
To allow this, I need to make a few changes to this codebase. This PR contains 3 changes:
version
number topackage.json
, asnpm
requires a version to be present.version.txt
file from a path relative tobanner.ts
.<15.11.0
. This is not necessary.Testing
Ran the program, still works