Test for importing webapp externally #57
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
In order to share frontend code between calendar projects, we need to have a way to reference the source code of the shared package. This PR introduces a
postinstall
script that checks out the shared repo as an npm dependency, so that the common calendar logic can be imported by the gcal repo. By defining thepostinstall
script, we do the following whenevernpm install
is run:mattermost-plugin-google-calendar
(should bemattermost-plugin-google-shared
) repo as an npm dependencyThe
index.tsx
file on thisbare-webapp
branch does not define aPlugin
object to provide toregisterPlugin
. It instead imports the one provided by the cloned module, and uses that to callregisterPlugin
. Note that the commit 157e796 being imported avoids callingregisterPlugin
in itsindex.tsx
fileTicket Link