@hono/vite-dev-server
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -0,1 +1,2 @@ | ||
import { WorkerOptions } from 'miniflare'; | ||
import { Plugin } from 'vite'; | ||
@@ -6,2 +7,3 @@ | ||
injectClientScript?: boolean; | ||
cf?: Partial<Omit<WorkerOptions, 'name' | 'script' | 'scriptPath' | 'modules' | 'modulesRoot' | 'modulesRules'>>; | ||
}; | ||
@@ -8,0 +10,0 @@ declare function devServer(options?: DevServerOptions): Plugin[]; |
@@ -1,1 +0,1 @@ | ||
import{getRequestListener as f}from"@hono/node-server";function g(r){const n=r?.entry??"./src/index.ts";return[{name:"sonik-dev-server",config:()=>({build:{rollupOptions:{input:[n]}}}),configureServer:async s=>{async function c(u){return async function(t,p,i){if(t.url?.endsWith(".ts")||t.url?.endsWith(".tsx")||t.url?.startsWith("/@")||t.url?.startsWith("/node_modules"))return i();const o=(await u.ssrLoadModule(n)).default;if(!o)return console.error(`Failed to find a named export "default" from ${n}`),i();f(async d=>{const e=await o.fetch(d);if(r?.injectClientScript!==!1&&!e.headers.get("transfer-encoding")?.match("chunked")&&e.headers.get("content-type")?.match(/^text\/html/)){const l=await e.text()+'<script type="module" src="/@vite/client"></script>',a=new Headers(e.headers);return a.delete("content-length"),new Response(l,{status:e.status,headers:a})}return e})(t,p)}}s.middlewares.use(await c(s))}}]}export{g as devServer}; | ||
import{getRequestListener as f}from"@hono/node-server";import{Miniflare as h}from"miniflare";const v='addEventListener("fetch", (event) => event.respondWith(new Response(null, { status: 404 })));';function x(n){const r=n?.entry??"./src/index.ts";return[{name:"sonik-dev-server",config:()=>({build:{rollupOptions:{input:[r]}}}),configureServer:async s=>{const c=new h({script:v,...n?.cf});async function p(u){return async function(t,l,i){if(t.url?.endsWith(".ts")||t.url?.endsWith(".tsx")||t.url?.startsWith("/@")||t.url?.startsWith("/node_modules"))return i();const o=(await u.ssrLoadModule(r)).default;if(!o)return console.error(`Failed to find a named export "default" from ${r}`),i();f(async d=>{const e=await o.fetch(d,await c.getBindings());if(n?.injectClientScript!==!1&&!e.headers.get("transfer-encoding")?.match("chunked")&&e.headers.get("content-type")?.match(/^text\/html/)){const m=await e.text()+'<script type="module" src="/@vite/client"></script>',a=new Headers(e.headers);return a.delete("content-length"),new Response(m,{status:e.status,headers:a})}return e})(t,l)}}s.middlewares.use(await p(s))}}]}export{x as devServer}; |
import { devServer } from './dev-server.js'; | ||
export { DevServerOptions } from './dev-server.js'; | ||
import 'miniflare'; | ||
import 'vite'; | ||
@@ -4,0 +5,0 @@ |
{ | ||
"name": "@hono/vite-dev-server", | ||
"description": "Vite dev-server plugin for Hono", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"types": "dist/index.d.ts", | ||
@@ -50,3 +50,4 @@ "module": "dist/index.js", | ||
"dependencies": { | ||
"@hono/node-server": "^1.1.1" | ||
"@hono/node-server": "^1.1.1", | ||
"miniflare": "^3.20230904.0" | ||
}, | ||
@@ -53,0 +54,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
6199
6
20
0
134
2
+ Addedminiflare@^3.20230904.0
+ Added@cloudflare/workerd-darwin-64@1.20241106.1(transitive)
+ Added@cloudflare/workerd-darwin-arm64@1.20241106.1(transitive)
+ Added@cloudflare/workerd-linux-64@1.20241106.1(transitive)
+ Added@cloudflare/workerd-linux-arm64@1.20241106.1(transitive)
+ Added@cloudflare/workerd-windows-64@1.20241106.1(transitive)
+ Added@cspotcode/source-map-support@0.8.1(transitive)
+ Added@fastify/busboy@2.1.1(transitive)
+ Added@jridgewell/resolve-uri@3.1.2(transitive)
+ Added@jridgewell/sourcemap-codec@1.5.0(transitive)
+ Added@jridgewell/trace-mapping@0.3.9(transitive)
+ Addedacorn@8.14.0(transitive)
+ Addedacorn-walk@8.3.4(transitive)
+ Addedas-table@1.0.55(transitive)
+ Addedcapnp-ts@0.7.0(transitive)
+ Addedcookie@0.7.2(transitive)
+ Addeddata-uri-to-buffer@2.0.2(transitive)
+ Addeddebug@4.3.7(transitive)
+ Addedexit-hook@2.2.1(transitive)
+ Addedget-source@2.0.12(transitive)
+ Addedglob-to-regexp@0.4.1(transitive)
+ Addedminiflare@3.20241106.0(transitive)
+ Addedms@2.1.3(transitive)
+ Addedmustache@4.2.0(transitive)
+ Addedprintable-characters@1.0.42(transitive)
+ Addedsource-map@0.6.1(transitive)
+ Addedstacktracey@2.1.8(transitive)
+ Addedstoppable@1.1.0(transitive)
+ Addedtslib@2.8.1(transitive)
+ Addedundici@5.28.4(transitive)
+ Addedworkerd@1.20241106.1(transitive)
+ Addedws@8.18.0(transitive)
+ Addedyouch@3.3.4(transitive)
+ Addedzod@3.23.8(transitive)