Skip to content
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

Bundle registry in npm package #29

Merged
merged 3 commits into from
May 7, 2024
Merged

Bundle registry in npm package #29

merged 3 commits into from
May 7, 2024

Conversation

grod220
Copy link
Contributor

@grod220 grod220 commented May 6, 2024

Related to: penumbra-zone/web#1033

At the moment, the registry fetches the latest on github. Treating this github repo as a kind of remote service for our extension is a bit of an iffy dependency (has caused issues with schema change and recycling old jsons). This PR switches this npm package to bundle the registry and ship it together.

This means, when we update our registry, we should bump the version along with it so consumers can download the latest.

====

New addition: Adding vite to inject commit at build time so consumer can know what version of the registry it is.

The big utils file has been relocated to the /utils folder in separate files

npm/src/utils.ts Outdated
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding to utils relocated to utils files. Should see diffs below, but they are not new.

@grod220 grod220 force-pushed the bundle-registry branch from 6d4fc36 to 76721fd Compare May 6, 2024 20:53
@grod220 grod220 force-pushed the bundle-registry branch from 76721fd to aeacb65 Compare May 6, 2024 21:20
@turbocrime
Copy link
Contributor

it looks like this git commit plugin will also encounter penumbra-zone/web#1046

@turbocrime
Copy link
Contributor

i would configure the build to ship json files in dist, instead of bundling the json into js, so a consumer may easily access the raw json if they have some specific need.

npm/package.json Outdated
Comment on lines 2 to 3
"name": "@penumbra-zone/test-publish",
"version": "0.7.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do these need to revert before merge?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@Valentine1898
Copy link
Contributor

One disadvantage of this solution would be that when adding a new asset or channel to the registry we will have to update the extension in chrome store

@grod220
Copy link
Contributor Author

grod220 commented May 7, 2024

it looks like this git commit plugin will also encounter penumbra-zone/web#1046

I suppose we are not because the action/checkout doesn't have that kind of url. Can save this for later.

i would configure the build to ship json files in dist, instead of bundling the json into js, so a consumer may easily access the raw json if they have some specific need.

This was a fairly non-trivial thing I was playing around with for a few hours. Will open an issue about this.

One disadvantage of this solution would be that when adding a new asset or channel to the registry we will have to update the extension in chrome store

Yes, indeed. It is trading off freshness for safety. Think it's ok for now, but we can revisit later if it becomes an issue.

@grod220 grod220 merged commit d2b78bd into main May 7, 2024
6 checks passed
@grod220 grod220 deleted the bundle-registry branch May 7, 2024 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants