-
Notifications
You must be signed in to change notification settings - Fork 4
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
Create a publishable mizu hono middleware client library #18
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…OW IT WORKS kinda
- changed types to "node" instead of cloudflare workers - changed "module" to NodeNext, which required renaming a bunch of imports
…ch caused issues for me)
brettimus
force-pushed
the
publishable-client-library
branch
from
June 5, 2024 19:19
be139db
to
cf84a21
Compare
flenter
approved these changes
Jun 6, 2024
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.
🎉 Love the default createConfig option.
keturiosakys
approved these changes
Jun 6, 2024
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.
🎉
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR makes changes to the client library (hono middleware) so that we can publish it and consume it:
The name is temporary. I set up the
@mizu-dev
org under my npm account but can give anyone else access as well.Changes
Sensible defaults
To streamline the DX of installing and using mizu, the
createHonoMiddleware
function falls back to a defaultcreateConfig
function, which uses the configuration specified in the README.Moreover, the
MIZU_ENDPOINT
environment variable falls back to the default url of the local mizu service (http://localhost:8788/v0/logs
).This makes the quickstart much quicker, so that a consumer doesn't need to modify their
.dev.vars
, and they can simply write the following in their application code:Modified build
rimraf
to clean thedist
folder before buildingtsconfig.json
to use similar module/target asswc
build:types
script will compile typescriptbuild:swc
will finish the buildbuild
first build types, then runsswc
The build contains
.d.ts
files nowMisc
Update the
package.json
andREADME
The
package.json
now contains fields necessary for publishing the client library as a publish package.Add
.npmignore
inclient-library/
We need to ignore lots of files in our published package, like the
src
directory, as well as ts, swc, and linting configs.Move some deps to
devDependencies
Biome, SWC, and typescript are now all dev dependencies.