-
-
Notifications
You must be signed in to change notification settings - Fork 32
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: added a JSON file output upon completing the changeset #171
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 4141e3c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
src/main.ts
Outdated
exportVariable('PUBLISHED', true) | ||
exportVariable('PUBLISHED_PACKAGES', result.publishedPackages) | ||
const filePath = `${HOME}/published-packages.json` | ||
fs.writeJsonSync(filePath, result.publishedPackages) |
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.
Why the content is different with the issue's proposal? I think object is more reasonable and flexible for the future.
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.
The idea was that if we modified the code in 2 places,
in main before the publish
setOutput('published', false)
setOutput('publishedPackages', [])
and in main if publish is successful,
setOutput('published', true)
setOutput('publishedPackages', result.publishedPackages)
it would be problematic since the first one (published false) will create a file in the directory that will be added to git in the version
command if people will just upgrade their version. When I removed that it didn't really make sense anymore to have a published true either since it is implicitly true
by the file being there.
So, I can make it an object of course, but should the object still contain published
? And if so, at which points do we want to create this file; should the user be able to assume the file will always be there; also with the version command?
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.
it would be problematic since the first one (published false) will create a file in the directory that will be added to git in the version command if people will just upgrade their version. When I removed that it didn't really make sense anymore to have a published true either since it is implicitly true by the file being there.
That's why I sad that this file should not be included in the project, instead, $HOME
for example.
So, I can make it an object of course, but should the object still contain published? And if so, at which points do we want to create this file; should the user be able to assume the file will always be there; also with the version command?
I'd prefer to keep the same structure as GitHub outputs.
README.md
Outdated
|
||
- `PUBLISHED` - A boolean value to indicate whether a publishing is happened or not | ||
- `PUBLISHED_PACKAGES` - A JSON array to present the published packages. The format is `[{"name": "@xx/xx", "version": "1.2.0"}, {"name": "@xx/xy", "version": "0.8.9"}]` | ||
When publishing, a list of published packages is written to a file named `changesets-gitlab.output.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.
The output location should be mentioned and would be better to be configurable.
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'll make it configurable. Another idea I had is to make the it configurable to have the output file at all, and default it to false. What do you think about that?
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.
Yes, opt-in configurable.
I'd be eager to see this feature pushed over the line as I'd love to make use of this output for reporting releases via a webhook. if there's anything I can do to help please let me know. |
No description provided.