-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add Jest tests and publish automation with changesets #10
Conversation
@@ -31,7 +31,7 @@ injectorImportMaps.forEach((scriptEl) => { | |||
return r.json(); | |||
} else { | |||
throw Error( | |||
`${errPrefix} import map at url '${scriptEl.src}' must respond with a success HTTP status, but responded with HTTP ${r.status} ${r.statusText}`, | |||
`${errPrefix} Import map at url '${scriptEl.src}' must respond with a success HTTP status, but responded with HTTP ${r.status} ${r.statusText}`, |
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.
To harmonize the casing to the other error messages
@@ -69,8 +69,12 @@ const requiresMicroTick = importMapJsons.some( | |||
(json) => json instanceof Promise, | |||
); | |||
|
|||
const globalWindow = window as typeof window & { |
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.
Needed by Typescript (otherwise throws a type error)
@@ -112,3 +116,5 @@ function injectImportMap(importMaps: ImportMap[]): void { | |||
finalImportMapScriptEl.textContent = JSON.stringify(finalImportMap); | |||
document.head.appendChild(finalImportMapScriptEl); | |||
} | |||
|
|||
export {}; |
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.
Needed in order to be able to import the module in Jest. Otherwise, it complains the file is not a module.
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.
Is it possible to make changesets automatically publish without creating another PR? I don't want changeset-bot to spam my Github notifications.
I don’t know if it is possible to publish automatically when merging, I can investigate, but I would recommend against it. |
I have significantly more Github notifications than I can manage already. Creating a new PR after every merged pull request will result in an extra notification every time I approve and merge anything. We should look into whether it can be done without an extra pull request. I never asked for autopublishes to be added to all the repos, and it has caused problems in other repos already. If I get more time later, I'll look into the changeset documentation to see if we can avoid adding busy work merging another PR to my Github queue. |
It was not a PR for every merged pull request. It's just one PR for release, that is updated every time a new merge to main happens. This is a well-established flow defined by changeset. |
This PR addresses issues:
In particular:
For this to work it is necessary that:
See single-spa/single-spa-react#178 for a description of how this works.
The automated pipeline includes:
Current coverage: