├── .gitignore ├── .npmignore ├── README.md ├── files ├── .env.example ├── index.js └── mime.conf.js ├── index.js ├── package-lock.json └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | 85 | # Gatsby files 86 | .cache/ 87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 88 | # https://nextjs.org/blog/next-9-1#public-directory-support 89 | # public 90 | 91 | # vuepress build output 92 | .vuepress/dist 93 | 94 | # Serverless directories 95 | .serverless/ 96 | 97 | # FuseBox cache 98 | .fusebox/ 99 | 100 | # DynamoDB Local files 101 | .dynamodb/ 102 | 103 | # TernJS port file 104 | .tern-port 105 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | bun.lockb -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # @bun-community/sveltekit-adapter-bun 2 | 3 | [Adapter](https://kit.svelte.dev/docs/adapters) for SvelteKit apps that generates a standalone [Bun](https://github.com/oven-sh/bun) server. 4 | 5 | > **Warning** 6 | > **This is experimental module!** Bun does not support many things like [`FormData`](https://github.com/oven-sh/bun/issues/621) 7 | > So I can't promise it will work 8 | 9 | ## Usage 10 | 11 | Install with `bun add -d @bun-community/sveltekit-adapter-bun` or `npm i -D @bun-community/sveltekit-adapter-bun`, then add the adapter to your `svelte.config.js`: 12 | 13 | ```js 14 | // svelte.config.js 15 | import adapter from '@bun-community/sveltekit-adapter-bun'; 16 | 17 | export default { 18 | kit: { 19 | adapter: adapter() 20 | } 21 | }; 22 | ``` 23 | 24 | After building the server (`vite build`), use the following command to start: 25 | 26 | ``` 27 | # go to build directory 28 | cd build/ 29 | 30 | # run Bun 31 | bun run start 32 | ``` 33 | 34 | 35 | ### Exposed Websocket Server 36 | You can use buns websocket server by exporting handleWebsocket object from src/hooks.server.ts 37 | ```typescript 38 | export const handleWebsocket = { 39 | message: (ws, msg) => { 40 | ws.send(msg); 41 | }, 42 | //optionally, doesnt have to be set - can be used to deny websocket 43 | upgrade: (req, upgrade) => { 44 | upgrade(req, {data:1}); 45 | } 46 | } 47 | ``` 48 | 49 | 50 | ## Options 51 | 52 | The adapter can be configured with various options: 53 | 54 | ```js 55 | // svelte.config.js 56 | import adapter from '@bun-community/sveltekit-adapter-bun'; 57 | export default { 58 | kit: { 59 | adapter: adapter({ 60 | out: "build", 61 | assets: true, 62 | envPrefix: "MY_CUSTOM_", 63 | development: true, 64 | // precompress: true, 65 | precompress: { 66 | brotli: true, 67 | gzip: true, 68 | files: ["htm", "html"] 69 | }, 70 | dynamic_origin: true, 71 | xff_depth: 1 72 | }) 73 | } 74 | }; 75 | ``` 76 | 77 | ### out 78 | 79 | The directory to build the server to. It defaults to `build` — i.e. `bun run start` would start the server locally after it has been created. 80 | 81 | ### assets 82 | 83 | Browse a static assets. Default: `true` 84 | 85 | - [X] Support [HTTP range requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Range_requests) 86 | 87 | ### precompress 88 | 89 | Enables precompressing using gzip and brotli for assets and prerendered pages. It defaults to `false`. 90 | 91 | #### brotli 92 | 93 | Enable brotli precompressing. It defaults to `false`. 94 | 95 | #### gzip 96 | 97 | Enable gzip precompressing. It defaults to `false`. 98 | 99 | #### files 100 | 101 | file extensions to compress.It defaults to `['html','js','json','css','svg','xml','wasm']`. 102 | 103 | ### envPrefix 104 | 105 | If you need to change the name of the environment variables used to configure the deployment (for example, to deconflict with environment variables you don't control), you can specify a prefix: 106 | 107 | ```js 108 | envPrefix: 'MY_CUSTOM_'; 109 | ``` 110 | 111 | ``` 112 | MY_CUSTOM_HOST=127.0.0.1 \ 113 | MY_CUSTOM_PORT=4000 \ 114 | MY_CUSTOM_ORIGIN=https://my.site \ 115 | bun build/index.js 116 | ``` 117 | 118 | ### development 119 | 120 | This enables bun's error page. Default: `false` 121 | 122 | ### dynamic_origin 123 | 124 | If enabled use `PROTOCOL_HEADER` `HOST_HEADER` like origin. Default: `false` 125 | 126 | ### xff_depth 127 | 128 | The default value of XFF_DEPTH if environment is not set. Default: `1` 129 | 130 | ## Environment variables 131 | 132 | > Bun automatically reads configuration from `.env.local`, `.env.development` and `.env` 133 | 134 | ### `PORT` and `HOST` 135 | 136 | By default, the server will accept connections on `0.0.0.0` using port 3000. These can be customized with the `PORT` and `HOST` environment variables: 137 | 138 | ``` 139 | HOST=127.0.0.1 PORT=4000 bun build/index.js 140 | ``` 141 | 142 | ### `ORIGIN`, `PROTOCOL_HEADER` and `HOST_HEADER` 143 | 144 | HTTP doesn't give SvelteKit a reliable way to know the URL that is currently being requested. The simplest way to tell SvelteKit where the app is being served is to set the `ORIGIN` environment variable: 145 | 146 | ``` 147 | ORIGIN=https://my.site bun build/index.js 148 | ``` 149 | 150 | With this, a request for the `/stuff` pathname will correctly resolve to `https://my.site/stuff`. Alternatively, you can specify headers that tell SvelteKit about the request protocol and host, from which it can construct the origin URL: 151 | 152 | ``` 153 | PROTOCOL_HEADER=x-forwarded-proto HOST_HEADER=x-forwarded-host bun build/index.js 154 | ``` 155 | 156 | > [`x-forwarded-proto`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Proto) and [`x-forwarded-host`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host) are de facto standard headers that forward the original protocol and host if you're using a reverse proxy (think load balancers and CDNs). You should only set these variables if your server is behind a trusted reverse proxy; otherwise, it'd be possible for clients to spoof these headers. 157 | ### `ADDRESS_HEADER` and `XFF_DEPTH` 158 | 159 | The [RequestEvent](https://kit.svelte.dev/docs/types#additional-types-requestevent) object passed to hooks and endpoints includes an `event.clientAddress` property representing the client's IP address. [Bun.js haven't got functionality](https://github.com/Jarred-Sumner/bun/issues/518) to get client's IP address, so SvelteKit will receive `127.0.0.1` or if your server is behind one or more proxies (such as a load balancer), you can get an IP address from headers, so we need to specify an `ADDRESS_HEADER` to read the address from: 160 | 161 | ``` 162 | ADDRESS_HEADER=True-Client-IP bun build/index.js 163 | ``` 164 | 165 | > Headers can easily be spoofed. As with `PROTOCOL_HEADER` and `HOST_HEADER`, you should [know what you're doing](https://adam-p.ca/blog/2022/03/x-forwarded-for/) before setting these. 166 | If the `ADDRESS_HEADER` is `X-Forwarded-For`, the header value will contain a comma-separated list of IP addresses. The `XFF_DEPTH` environment variable should specify how many trusted proxies sit in front of your server. E.g. if there are three trusted proxies, proxy 3 will forward the addresses of the original connection and the first two proxies: 167 | 168 | ``` 169 | , , 170 | ``` 171 | 172 | Some guides will tell you to read the left-most address, but this leaves you [vulnerable to spoofing](https://adam-p.ca/blog/2022/03/x-forwarded-for/): 173 | 174 | ``` 175 | , , , 176 | ``` 177 | 178 | Instead, we read from the _right_, accounting for the number of trusted proxies. In this case, we would use `XFF_DEPTH=3`. 179 | 180 | > If you need to read the left-most address instead (and don't care about spoofing) — for example, to offer a geolocation service, where it's more important for the IP address to be _real_ than _trusted_, you can do so by inspecting the `x-forwarded-for` header within your app. 181 | -------------------------------------------------------------------------------- /files/.env.example: -------------------------------------------------------------------------------- 1 | HOST="0.0.0.0" 2 | PORT="3001" 3 | ORIGIN="https://example.com" 4 | XFF_DEPTH=2 5 | ADDRESS_HEADER="X-Forwarded-For" 6 | PROTOCOL_HEADER="X-Forwarded-Proto" 7 | HOST_HEADER="X-Forwarded-Host" 8 | SERVERDEV=false -------------------------------------------------------------------------------- /files/index.js: -------------------------------------------------------------------------------- 1 | import { fileURLToPath, serve as serve$1 } from 'bun'; 2 | import { Server } from 'SERVER'; 3 | import { manifest } from 'MANIFEST'; 4 | import path, { resolve, join, normalize } from 'path'; 5 | import fs, { readdirSync, statSync, existsSync } from 'fs'; 6 | import mimes$1 from './mime.conf.js'; 7 | 8 | const expected = new Set([ 9 | 'HOST', 10 | 'PORT', 11 | 'ORIGIN', 12 | 'XFF_DEPTH', 13 | 'ADDRESS_HEADER', 14 | 'PROTOCOL_HEADER', 15 | 'HOST_HEADER', 16 | 'SERVERDEV' 17 | ]); 18 | const build_options = BUILD_OPTIONS; 19 | if (ENV_PREFIX) { 20 | for (const name in Bun.env) { 21 | if (name.startsWith(ENV_PREFIX)) { 22 | const unprefixed = name.slice(ENV_PREFIX.length); 23 | if (!expected.has(unprefixed)) { 24 | throw new Error( 25 | `You should change envPrefix (${ENV_PREFIX}) to avoid conflicts with existing environment variables — unexpectedly saw ${name}` 26 | ); 27 | } 28 | } 29 | } 30 | } 31 | function env(name, fallback) { 32 | const prefixed = ENV_PREFIX + name; 33 | return prefixed in Bun.env ? Bun.env[prefixed] : fallback; 34 | } 35 | 36 | const mimes = { 37 | "ez": "application/andrew-inset", 38 | "aw": "application/applixware", 39 | "atom": "application/atom+xml", 40 | "atomcat": "application/atomcat+xml", 41 | "atomdeleted": "application/atomdeleted+xml", 42 | "atomsvc": "application/atomsvc+xml", 43 | "dwd": "application/atsc-dwd+xml", 44 | "held": "application/atsc-held+xml", 45 | "rsat": "application/atsc-rsat+xml", 46 | "bdoc": "application/bdoc", 47 | "xcs": "application/calendar+xml", 48 | "ccxml": "application/ccxml+xml", 49 | "cdfx": "application/cdfx+xml", 50 | "cdmia": "application/cdmi-capability", 51 | "cdmic": "application/cdmi-container", 52 | "cdmid": "application/cdmi-domain", 53 | "cdmio": "application/cdmi-object", 54 | "cdmiq": "application/cdmi-queue", 55 | "cu": "application/cu-seeme", 56 | "mpd": "application/dash+xml", 57 | "davmount": "application/davmount+xml", 58 | "dbk": "application/docbook+xml", 59 | "dssc": "application/dssc+der", 60 | "xdssc": "application/dssc+xml", 61 | "es": "application/ecmascript", 62 | "ecma": "application/ecmascript", 63 | "emma": "application/emma+xml", 64 | "emotionml": "application/emotionml+xml", 65 | "epub": "application/epub+zip", 66 | "exi": "application/exi", 67 | "fdt": "application/fdt+xml", 68 | "pfr": "application/font-tdpfr", 69 | "geojson": "application/geo+json", 70 | "gml": "application/gml+xml", 71 | "gpx": "application/gpx+xml", 72 | "gxf": "application/gxf", 73 | "gz": "application/gzip", 74 | "hjson": "application/hjson", 75 | "stk": "application/hyperstudio", 76 | "ink": "application/inkml+xml", 77 | "inkml": "application/inkml+xml", 78 | "ipfix": "application/ipfix", 79 | "its": "application/its+xml", 80 | "jar": "application/java-archive", 81 | "war": "application/java-archive", 82 | "ear": "application/java-archive", 83 | "ser": "application/java-serialized-object", 84 | "class": "application/java-vm", 85 | "js": "application/javascript", 86 | "mjs": "application/javascript", 87 | "json": "application/json", 88 | "map": "application/json", 89 | "json5": "application/json5", 90 | "jsonml": "application/jsonml+json", 91 | "jsonld": "application/ld+json", 92 | "lgr": "application/lgr+xml", 93 | "lostxml": "application/lost+xml", 94 | "hqx": "application/mac-binhex40", 95 | "cpt": "application/mac-compactpro", 96 | "mads": "application/mads+xml", 97 | "webmanifest": "application/manifest+json", 98 | "mrc": "application/marc", 99 | "mrcx": "application/marcxml+xml", 100 | "ma": "application/mathematica", 101 | "nb": "application/mathematica", 102 | "mb": "application/mathematica", 103 | "mathml": "application/mathml+xml", 104 | "mbox": "application/mbox", 105 | "mscml": "application/mediaservercontrol+xml", 106 | "metalink": "application/metalink+xml", 107 | "meta4": "application/metalink4+xml", 108 | "mets": "application/mets+xml", 109 | "maei": "application/mmt-aei+xml", 110 | "musd": "application/mmt-usd+xml", 111 | "mods": "application/mods+xml", 112 | "m21": "application/mp21", 113 | "mp21": "application/mp21", 114 | "mp4s": "application/mp4", 115 | "m4p": "application/mp4", 116 | "doc": "application/msword", 117 | "dot": "application/msword", 118 | "mxf": "application/mxf", 119 | "nq": "application/n-quads", 120 | "nt": "application/n-triples", 121 | "cjs": "application/node", 122 | "bin": "application/octet-stream", 123 | "dms": "application/octet-stream", 124 | "lrf": "application/octet-stream", 125 | "mar": "application/octet-stream", 126 | "so": "application/octet-stream", 127 | "dist": "application/octet-stream", 128 | "distz": "application/octet-stream", 129 | "pkg": "application/octet-stream", 130 | "bpk": "application/octet-stream", 131 | "dump": "application/octet-stream", 132 | "elc": "application/octet-stream", 133 | "deploy": "application/octet-stream", 134 | "exe": "application/octet-stream", 135 | "dll": "application/octet-stream", 136 | "deb": "application/octet-stream", 137 | "dmg": "application/octet-stream", 138 | "iso": "application/octet-stream", 139 | "img": "application/octet-stream", 140 | "msi": "application/octet-stream", 141 | "msp": "application/octet-stream", 142 | "msm": "application/octet-stream", 143 | "buffer": "application/octet-stream", 144 | "oda": "application/oda", 145 | "opf": "application/oebps-package+xml", 146 | "ogx": "application/ogg", 147 | "omdoc": "application/omdoc+xml", 148 | "onetoc": "application/onenote", 149 | "onetoc2": "application/onenote", 150 | "onetmp": "application/onenote", 151 | "onepkg": "application/onenote", 152 | "oxps": "application/oxps", 153 | "relo": "application/p2p-overlay+xml", 154 | "xer": "application/patch-ops-error+xml", 155 | "pdf": "application/pdf", 156 | "pgp": "application/pgp-encrypted", 157 | "asc": "application/pgp-signature", 158 | "sig": "application/pgp-signature", 159 | "prf": "application/pics-rules", 160 | "p10": "application/pkcs10", 161 | "p7m": "application/pkcs7-mime", 162 | "p7c": "application/pkcs7-mime", 163 | "p7s": "application/pkcs7-signature", 164 | "p8": "application/pkcs8", 165 | "ac": "application/pkix-attr-cert", 166 | "cer": "application/pkix-cert", 167 | "crl": "application/pkix-crl", 168 | "pkipath": "application/pkix-pkipath", 169 | "pki": "application/pkixcmp", 170 | "pls": "application/pls+xml", 171 | "ai": "application/postscript", 172 | "eps": "application/postscript", 173 | "ps": "application/postscript", 174 | "provx": "application/provenance+xml", 175 | "cww": "application/prs.cww", 176 | "pskcxml": "application/pskc+xml", 177 | "raml": "application/raml+yaml", 178 | "rdf": "application/rdf+xml", 179 | "owl": "application/rdf+xml", 180 | "rif": "application/reginfo+xml", 181 | "rnc": "application/relax-ng-compact-syntax", 182 | "rl": "application/resource-lists+xml", 183 | "rld": "application/resource-lists-diff+xml", 184 | "rs": "application/rls-services+xml", 185 | "rapd": "application/route-apd+xml", 186 | "sls": "application/route-s-tsid+xml", 187 | "rusd": "application/route-usd+xml", 188 | "gbr": "application/rpki-ghostbusters", 189 | "mft": "application/rpki-manifest", 190 | "roa": "application/rpki-roa", 191 | "rsd": "application/rsd+xml", 192 | "rss": "application/rss+xml", 193 | "rtf": "application/rtf", 194 | "sbml": "application/sbml+xml", 195 | "scq": "application/scvp-cv-request", 196 | "scs": "application/scvp-cv-response", 197 | "spq": "application/scvp-vp-request", 198 | "spp": "application/scvp-vp-response", 199 | "sdp": "application/sdp", 200 | "senmlx": "application/senml+xml", 201 | "sensmlx": "application/sensml+xml", 202 | "setpay": "application/set-payment-initiation", 203 | "setreg": "application/set-registration-initiation", 204 | "shf": "application/shf+xml", 205 | "siv": "application/sieve", 206 | "sieve": "application/sieve", 207 | "smi": "application/smil+xml", 208 | "smil": "application/smil+xml", 209 | "rq": "application/sparql-query", 210 | "srx": "application/sparql-results+xml", 211 | "gram": "application/srgs", 212 | "grxml": "application/srgs+xml", 213 | "sru": "application/sru+xml", 214 | "ssdl": "application/ssdl+xml", 215 | "ssml": "application/ssml+xml", 216 | "swidtag": "application/swid+xml", 217 | "tei": "application/tei+xml", 218 | "teicorpus": "application/tei+xml", 219 | "tfi": "application/thraud+xml", 220 | "tsd": "application/timestamped-data", 221 | "toml": "application/toml", 222 | "trig": "application/trig", 223 | "ttml": "application/ttml+xml", 224 | "ubj": "application/ubjson", 225 | "rsheet": "application/urc-ressheet+xml", 226 | "td": "application/urc-targetdesc+xml", 227 | "vxml": "application/voicexml+xml", 228 | "wasm": "application/wasm", 229 | "wgt": "application/widget", 230 | "hlp": "application/winhlp", 231 | "wsdl": "application/wsdl+xml", 232 | "wspolicy": "application/wspolicy+xml", 233 | "xaml": "application/xaml+xml", 234 | "xav": "application/xcap-att+xml", 235 | "xca": "application/xcap-caps+xml", 236 | "xdf": "application/xcap-diff+xml", 237 | "xel": "application/xcap-el+xml", 238 | "xns": "application/xcap-ns+xml", 239 | "xenc": "application/xenc+xml", 240 | "xhtml": "application/xhtml+xml", 241 | "xht": "application/xhtml+xml", 242 | "xlf": "application/xliff+xml", 243 | "xml": "application/xml", 244 | "xsl": "application/xml", 245 | "xsd": "application/xml", 246 | "rng": "application/xml", 247 | "dtd": "application/xml-dtd", 248 | "xop": "application/xop+xml", 249 | "xpl": "application/xproc+xml", 250 | "xslt": "application/xml", 251 | "xspf": "application/xspf+xml", 252 | "mxml": "application/xv+xml", 253 | "xhvml": "application/xv+xml", 254 | "xvml": "application/xv+xml", 255 | "xvm": "application/xv+xml", 256 | "yang": "application/yang", 257 | "yin": "application/yin+xml", 258 | "zip": "application/zip", 259 | "3gpp": "video/3gpp", 260 | "adp": "audio/adpcm", 261 | "amr": "audio/amr", 262 | "au": "audio/basic", 263 | "snd": "audio/basic", 264 | "mid": "audio/midi", 265 | "midi": "audio/midi", 266 | "kar": "audio/midi", 267 | "rmi": "audio/midi", 268 | "mxmf": "audio/mobile-xmf", 269 | "mp3": "audio/mpeg", 270 | "m4a": "audio/mp4", 271 | "mp4a": "audio/mp4", 272 | "mpga": "audio/mpeg", 273 | "mp2": "audio/mpeg", 274 | "mp2a": "audio/mpeg", 275 | "m2a": "audio/mpeg", 276 | "m3a": "audio/mpeg", 277 | "oga": "audio/ogg", 278 | "ogg": "audio/ogg", 279 | "spx": "audio/ogg", 280 | "opus": "audio/ogg", 281 | "s3m": "audio/s3m", 282 | "sil": "audio/silk", 283 | "wav": "audio/wav", 284 | "weba": "audio/webm", 285 | "xm": "audio/xm", 286 | "ttc": "font/collection", 287 | "otf": "font/otf", 288 | "ttf": "font/ttf", 289 | "woff": "font/woff", 290 | "woff2": "font/woff2", 291 | "exr": "image/aces", 292 | "apng": "image/apng", 293 | "avif": "image/avif", 294 | "bmp": "image/bmp", 295 | "cgm": "image/cgm", 296 | "drle": "image/dicom-rle", 297 | "emf": "image/emf", 298 | "fits": "image/fits", 299 | "g3": "image/g3fax", 300 | "gif": "image/gif", 301 | "heic": "image/heic", 302 | "heics": "image/heic-sequence", 303 | "heif": "image/heif", 304 | "heifs": "image/heif-sequence", 305 | "hej2": "image/hej2k", 306 | "hsj2": "image/hsj2", 307 | "ief": "image/ief", 308 | "jls": "image/jls", 309 | "jp2": "image/jp2", 310 | "jpg2": "image/jp2", 311 | "jpeg": "image/jpeg", 312 | "jpg": "image/jpeg", 313 | "jpe": "image/jpeg", 314 | "jph": "image/jph", 315 | "jhc": "image/jphc", 316 | "jpm": "image/jpm", 317 | "jpx": "image/jpx", 318 | "jpf": "image/jpx", 319 | "jxr": "image/jxr", 320 | "jxra": "image/jxra", 321 | "jxrs": "image/jxrs", 322 | "jxs": "image/jxs", 323 | "jxsc": "image/jxsc", 324 | "jxsi": "image/jxsi", 325 | "jxss": "image/jxss", 326 | "ktx": "image/ktx", 327 | "ktx2": "image/ktx2", 328 | "png": "image/png", 329 | "btif": "image/prs.btif", 330 | "pti": "image/prs.pti", 331 | "sgi": "image/sgi", 332 | "svg": "image/svg+xml", 333 | "svgz": "image/svg+xml", 334 | "t38": "image/t38", 335 | "tif": "image/tiff", 336 | "tiff": "image/tiff", 337 | "tfx": "image/tiff-fx", 338 | "webp": "image/webp", 339 | "wmf": "image/wmf", 340 | "disposition-notification": "message/disposition-notification", 341 | "u8msg": "message/global", 342 | "u8dsn": "message/global-delivery-status", 343 | "u8mdn": "message/global-disposition-notification", 344 | "u8hdr": "message/global-headers", 345 | "eml": "message/rfc822", 346 | "mime": "message/rfc822", 347 | "3mf": "model/3mf", 348 | "gltf": "model/gltf+json", 349 | "glb": "model/gltf-binary", 350 | "igs": "model/iges", 351 | "iges": "model/iges", 352 | "msh": "model/mesh", 353 | "mesh": "model/mesh", 354 | "silo": "model/mesh", 355 | "mtl": "model/mtl", 356 | "obj": "model/obj", 357 | "stpz": "model/step+zip", 358 | "stpxz": "model/step-xml+zip", 359 | "stl": "model/stl", 360 | "wrl": "model/vrml", 361 | "vrml": "model/vrml", 362 | "x3db": "model/x3d+fastinfoset", 363 | "x3dbz": "model/x3d+binary", 364 | "x3dv": "model/x3d-vrml", 365 | "x3dvz": "model/x3d+vrml", 366 | "x3d": "model/x3d+xml", 367 | "x3dz": "model/x3d+xml", 368 | "appcache": "text/cache-manifest", 369 | "manifest": "text/cache-manifest", 370 | "ics": "text/calendar", 371 | "ifb": "text/calendar", 372 | "coffee": "text/coffeescript", 373 | "litcoffee": "text/coffeescript", 374 | "css": "text/css", 375 | "csv": "text/csv", 376 | "html": "text/html", 377 | "htm": "text/html", 378 | "shtml": "text/html", 379 | "jade": "text/jade", 380 | "jsx": "text/jsx", 381 | "less": "text/less", 382 | "markdown": "text/markdown", 383 | "md": "text/markdown", 384 | "mml": "text/mathml", 385 | "mdx": "text/mdx", 386 | "n3": "text/n3", 387 | "txt": "text/plain", 388 | "text": "text/plain", 389 | "conf": "text/plain", 390 | "def": "text/plain", 391 | "list": "text/plain", 392 | "log": "text/plain", 393 | "in": "text/plain", 394 | "ini": "text/plain", 395 | "dsc": "text/prs.lines.tag", 396 | "rtx": "text/richtext", 397 | "sgml": "text/sgml", 398 | "sgm": "text/sgml", 399 | "shex": "text/shex", 400 | "slim": "text/slim", 401 | "slm": "text/slim", 402 | "spdx": "text/spdx", 403 | "stylus": "text/stylus", 404 | "styl": "text/stylus", 405 | "tsv": "text/tab-separated-values", 406 | "t": "text/troff", 407 | "tr": "text/troff", 408 | "roff": "text/troff", 409 | "man": "text/troff", 410 | "me": "text/troff", 411 | "ms": "text/troff", 412 | "ttl": "text/turtle", 413 | "uri": "text/uri-list", 414 | "uris": "text/uri-list", 415 | "urls": "text/uri-list", 416 | "vcard": "text/vcard", 417 | "vtt": "text/vtt", 418 | "yaml": "text/yaml", 419 | "yml": "text/yaml", 420 | "3gp": "video/3gpp", 421 | "3g2": "video/3gpp2", 422 | "h261": "video/h261", 423 | "h263": "video/h263", 424 | "h264": "video/h264", 425 | "m4s": "video/iso.segment", 426 | "jpgv": "video/jpeg", 427 | "jpgm": "image/jpm", 428 | "mj2": "video/mj2", 429 | "mjp2": "video/mj2", 430 | "ts": "video/mp2t", 431 | "mp4": "video/mp4", 432 | "mp4v": "video/mp4", 433 | "mpg4": "video/mp4", 434 | "mpeg": "video/mpeg", 435 | "mpg": "video/mpeg", 436 | "mpe": "video/mpeg", 437 | "m1v": "video/mpeg", 438 | "m2v": "video/mpeg", 439 | "ogv": "video/ogg", 440 | "qt": "video/quicktime", 441 | "mov": "video/quicktime", 442 | "webm": "video/webm" 443 | }; 444 | 445 | function lookup(extn) { 446 | let tmp = ('' + extn).trim().toLowerCase(); 447 | let idx = tmp.lastIndexOf('.'); 448 | return mimes[!~idx ? tmp : tmp.substring(++idx)]; 449 | } 450 | 451 | function totalist(dir, callback, pre='') { 452 | dir = resolve('.', dir); 453 | let arr = readdirSync(dir); 454 | let i=0, abs, stats; 455 | for (; i < arr.length; i++) { 456 | abs = join(dir, arr[i]); 457 | stats = statSync(abs); 458 | stats.isDirectory() 459 | ? totalist(abs, callback, join(pre, arr[i])) 460 | : callback(join(pre, arr[i]), abs, stats); 461 | } 462 | } 463 | 464 | /*! MIT © Luke Edwards https://github.com/lukeed/sirv/blob/master/packages/sirv/index.js */ 465 | function toAssume(uri, extns) { 466 | let i = 0, x, len = uri.length - 1; 467 | if (uri.charCodeAt(len) === 47) { 468 | uri = uri.substring(0, len); 469 | } 470 | let arr = [], tmp = `${uri}/index`; 471 | for (; i < extns.length; i++) { 472 | x = extns[i] ? `.${extns[i]}` : ''; 473 | if (uri) arr.push(uri + x); 474 | arr.push(tmp + x); 475 | } 476 | return arr; 477 | } 478 | function viaCache(cache, uri, extns) { 479 | let i = 0, data, arr = toAssume(uri, extns); 480 | for (; i < arr.length; i++) { 481 | if (data = cache[arr[i]]) return data; 482 | } 483 | } 484 | function viaLocal(dir, isEtag, uri, extns) { 485 | let i = 0, arr = toAssume(uri, extns); 486 | let abs, stats, name, headers; 487 | for (; i < arr.length; i++) { 488 | abs = normalize(join(dir, name = arr[i])); 489 | if (abs.startsWith(dir) && fs.existsSync(abs)) { 490 | stats = fs.statSync(abs); 491 | if (stats.isDirectory()) continue; 492 | headers = toHeaders(name, stats, isEtag); 493 | headers.set('Cache-Control', isEtag ? 'no-cache' : 'no-store'); 494 | return { abs, stats, headers }; 495 | } 496 | } 497 | } 498 | function is404(req) { 499 | return new Response(null, { 500 | status: 404, 501 | statusText: "404" 502 | }) 503 | } 504 | function send(req, data) { 505 | let code = 200, opts = {}; 506 | if (req.headers.has("range")) { 507 | code = 206; 508 | let [x, y] = req.headers.get("range").replace('bytes=', '').split('-'); 509 | let end = opts.end = parseInt(y, 10) || data.stats.size - 1; 510 | let start = opts.start = parseInt(x, 10) || 0; 511 | if (start >= data.stats.size || end >= data.stats.size) { 512 | data.headers.set('Content-Range', `bytes */${data.stats.size}`); 513 | return new Response(null, { 514 | headers: data.headers, 515 | status: 416 516 | }) 517 | } 518 | data.headers.set('Content-Range', `bytes ${start}-${end}/${data.stats.size}`); 519 | data.headers.set('Content-Length', (end - start + 1)); 520 | data.headers.set('Accept-Ranges', 'bytes'); 521 | opts.range = true; 522 | } 523 | if (opts.range) { 524 | return new Promise((rs) => { 525 | Bun.file(data.abs).slice(opts.start, opts.end).arrayBuffer().then(arbf => { 526 | return new Response(arbf, { 527 | headers: data.headers, 528 | status: code 529 | }) 530 | }).then(rs).catch(e => { 531 | console.error(e); rs(new Response(null, { status: 500 })); 532 | }); 533 | }) 534 | } 535 | return new Response(Bun.file(data.abs), { 536 | headers: data.headers, 537 | status: code 538 | }) 539 | } 540 | const ENCODING = { 541 | '.br': 'br', 542 | '.gz': 'gzip', 543 | }; 544 | function toHeaders(name, stats, isEtag) { 545 | let enc = ENCODING[name.slice(-3)]; 546 | let ctype = lookup(name.slice(0, enc && -3)) || ''; 547 | if (ctype === 'text/html') ctype += ';charset=utf-8'; 548 | let headers = new Headers({ 549 | 'Content-Length': stats.size, 550 | 'Content-Type': ctype, 551 | 'Last-Modified': stats.mtime.toUTCString(), 552 | }); 553 | if (enc) headers.set("Content-Encoding", enc); 554 | if (isEtag) headers.set("ETag", `W/"${stats.size}-${stats.mtime.getTime()}"`); 555 | return headers; 556 | } 557 | for (const mime in mimes$1) { 558 | mimes[mime] = mimes$1[mime]; 559 | } 560 | function sirv (dir, opts = {}) { 561 | dir = resolve(dir || '.'); 562 | let isNotFound = opts.onNoMatch || is404; 563 | let setHeaders = opts.setHeaders || false; 564 | let extensions = opts.extensions || ['html', 'htm']; 565 | let gzips = opts.gzip && extensions.map(x => `${x}.gz`).concat('gz'); 566 | let brots = opts.brotli && extensions.map(x => `${x}.br`).concat('br'); 567 | const FILES = {}; 568 | let isEtag = !!opts.etag; 569 | if (opts.ignores !== false) { 570 | if (opts.dotfiles) ; 571 | [].concat(opts.ignores || []).forEach(x => { 572 | }); 573 | } 574 | let cc = opts.maxAge != null && `public,max-age=${opts.maxAge}`; 575 | if (cc && opts.immutable) cc += ',immutable'; 576 | else if (cc && opts.maxAge === 0) cc += ',must-revalidate'; 577 | if (!opts.dev) { 578 | totalist(dir, (name, abs, stats) => { 579 | if (/\.well-known[\\+\/]/.test(name)) ; 580 | else if (!opts.dotfiles && /(^\.|[\\+|\/+]\.)/.test(name)) return; 581 | let headers = toHeaders(name, stats, isEtag); 582 | if (cc) headers.set('Cache-Control', cc); 583 | FILES['/' + name.normalize().replace(/\\+/g, '/')] = { abs, stats, headers }; 584 | }); 585 | } 586 | let lookup = opts.dev ? viaLocal.bind(0, dir, isEtag) : viaCache.bind(0, FILES); 587 | return function (req, next) { 588 | let extns = ['']; 589 | let pathname = new URL(req.url).pathname; 590 | let val = req.headers.get('accept-encoding') || ''; 591 | if (gzips && val.includes('gzip')) extns.unshift(...gzips); 592 | if (brots && /(br|brotli)/i.test(val)) extns.unshift(...brots); 593 | extns.push(...extensions); 594 | if (pathname.indexOf('%') !== -1) { 595 | try { pathname = decodeURIComponent(pathname); } 596 | catch (err) { } 597 | } 598 | let data = lookup(pathname, extns); 599 | if (!data) return next ? next() : isNotFound(req); 600 | if (isEtag && req.headers.get('if-none-match') === data.headers.get('ETag')) { 601 | return new Response(null, { status: 304 }) 602 | } 603 | if (gzips || brots) { 604 | data.headers.append('Vary', 'Accept-Encoding'); 605 | } 606 | if (setHeaders) { 607 | data.headers = setHeaders(data.headers, pathname, data.stats); 608 | } 609 | return send(req, data); 610 | }; 611 | } 612 | 613 | const __dirname = path.dirname(fileURLToPath(new URL(import.meta.url))); 614 | const server = new Server(manifest); 615 | await server.init({ env: process.env }); 616 | const xff_depth = parseInt(env('XFF_DEPTH', build_options.xff_depth ?? 1)); 617 | const address_header = env('ADDRESS_HEADER', '').toLowerCase(); 618 | const protocol_header = env('PROTOCOL_HEADER', 'X-Forwarded-Proto').toLowerCase(); 619 | const host_header = env('HOST_HEADER', 'X-Forwarded-Host').toLowerCase(); 620 | function handler (assets) { 621 | let handlers = [ 622 | assets && serve(path.join(__dirname, '/client'), true), 623 | assets && serve(path.join(__dirname, '/prerendered')), 624 | ssr 625 | ].filter(Boolean); 626 | return function handler(req) { 627 | req.headers; 628 | function handle(i) { 629 | return handlers[i](req, () => { 630 | if (i < handlers.length) { 631 | return handlers[i+1](req); 632 | } else { 633 | return new Response('404', { status: 404 }) 634 | } 635 | }); 636 | } 637 | return handle(0) 638 | } 639 | } 640 | function serve(path, client = false) { 641 | return existsSync(path) && 642 | sirv(path, { 643 | etag: true, 644 | gzip: true, 645 | brotli: true, 646 | setHeaders: client && ((headers, pathname) => { 647 | if (pathname.startsWith(`/${manifest.appDir}/immutable/`)) { 648 | headers.set('cache-control', 'public,max-age=31536000,immutable'); 649 | } 650 | return headers 651 | }) 652 | }) 653 | } 654 | function ssr(req) { 655 | let request = req; 656 | if (build_options.dynamic_origin ?? false) { 657 | let url = req.url; 658 | let path = url.slice(url.split("/", 3).join("/").length); 659 | let origin = get_origin(req.headers); 660 | request = new Request(origin + path, req); 661 | } 662 | if (address_header && !request.headers.has(address_header)) { 663 | throw new Error( 664 | `Address header was specified with ${ENV_PREFIX + 'ADDRESS_HEADER' 665 | }=${address_header} but is absent from request` 666 | ); 667 | } 668 | return server.respond(request, { 669 | getClientAddress() { 670 | if (address_header) { 671 | const value = (request.headers.get(address_header)) || ''; 672 | if (address_header === 'x-forwarded-for') { 673 | const addresses = value.split(','); 674 | if (xff_depth < 1) { 675 | throw new Error(`${ENV_PREFIX + 'XFF_DEPTH'} must be a positive integer`); 676 | } 677 | if (xff_depth > addresses.length) { 678 | throw new Error( 679 | `${ENV_PREFIX + 'XFF_DEPTH'} is ${xff_depth}, but only found ${addresses.length 680 | } addresses` 681 | ); 682 | } 683 | return addresses[addresses.length - xff_depth].trim(); 684 | } 685 | return value; 686 | } 687 | return "127.0.0.1"; 688 | } 689 | }) 690 | } 691 | function get_origin(headers) { 692 | const protocol = (protocol_header && headers.get(protocol_header)) || 'http'; 693 | const host = headers.get(host_header); 694 | return `${protocol}://${host}`; 695 | } 696 | 697 | const hostname = env('HOST', '0.0.0.0'); 698 | const port = parseInt(env('PORT', 3000)); 699 | console.info(`Listening on ${hostname + ':' + port}`); 700 | 701 | let serveOptions = { 702 | baseURI: env('ORIGIN', 'localhost'), 703 | fetch: handler(build_options.assets ?? true), 704 | hostname, 705 | port, 706 | development: env("SERVERDEV", build_options.development ?? false), 707 | }; 708 | 709 | function defaultAcceptWebsocket(request, upgrade) { 710 | return upgrade(request); 711 | } 712 | 713 | if(server.options.hooks.handleWebsocket) { 714 | let origFetch = serveOptions.fetch; 715 | serveOptions.websocket = server.options.hooks.handleWebsocket; 716 | serveOptions.fetch = (req, srv) => { 717 | if(req.headers.get('Connection')?.toLowerCase() === 'upgrade' && req.headers.get('Upgrade')?.toLowerCase() === 'websocket') { 718 | (server.options.hooks.handleWebsocket.upgrade ?? defaultAcceptWebsocket)(req, srv.upgrade.bind(srv)); 719 | return; 720 | } 721 | return origFetch(req, srv); 722 | } 723 | } 724 | 725 | 726 | serve$1(serveOptions); 727 | -------------------------------------------------------------------------------- /files/mime.conf.js: -------------------------------------------------------------------------------- 1 | const mimes = { 2 | "exe": "application/octet-stream", 3 | }; 4 | 5 | export { mimes as default }; 6 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import {createReadStream, createWriteStream, existsSync, readFileSync, statSync, writeFileSync} from 'fs'; 2 | import {pipeline} from 'stream'; 3 | import glob from 'tiny-glob'; 4 | import {fileURLToPath} from 'url'; 5 | import {promisify} from 'util'; 6 | import zlib from 'zlib'; 7 | import {rollup} from 'rollup'; 8 | import {nodeResolve} from '@rollup/plugin-node-resolve'; 9 | import commonjs from '@rollup/plugin-commonjs'; 10 | import json from '@rollup/plugin-json'; 11 | 12 | const pipe = promisify(pipeline); 13 | 14 | const files = fileURLToPath(new URL('./files', import.meta.url).href); 15 | 16 | /** @type {import('.').default} */ 17 | export default function (opts = {}) { 18 | const { 19 | out = 'build', 20 | precompress = false, 21 | envPrefix = '', 22 | development = false, 23 | dynamic_origin = false, 24 | xff_depth = 1, 25 | assets = true 26 | } = opts; 27 | return { 28 | name: 'svelte-adapter-bun', 29 | async adapt(builder) { 30 | 31 | const tmp = builder.getBuildDirectory('adapter-bun'); 32 | 33 | builder.rimraf(out); 34 | builder.rimraf(tmp); 35 | 36 | builder.log.minor('Copying assets'); 37 | builder.writeClient(`${out}/client`); 38 | builder.writeServer(`${tmp}`); 39 | builder.writePrerendered(`${out}/prerendered`); 40 | 41 | 42 | writeFileSync( 43 | `${tmp}/manifest.js`, 44 | `export const manifest = ${builder.generateManifest({ 45 | relativePath: './' 46 | })};\n` 47 | ); 48 | 49 | const pkg = JSON.parse(readFileSync('package.json', 'utf8')); 50 | 51 | let src = readFileSync(`${tmp}/index.js`, 'utf8'); 52 | const regex = /(this\.options\.hooks\s+=\s+{)\s+(handle:)/gm; 53 | const subst = `$1 \n\t\thandleWebsocket: module.handleWebsocket || null,\n\t\t$2`; 54 | const result = src.replace(regex, subst); 55 | 56 | writeFileSync(`${tmp}/index.js`, result, 'utf8'); 57 | 58 | 59 | const bundle = await rollup({ 60 | input: { 61 | index: `${tmp}/index.js`, 62 | manifest: `${tmp}/manifest.js` 63 | }, 64 | external: [...Object.keys(pkg.dependencies || {})], 65 | plugins: [nodeResolve({preferBuiltins: true}), commonjs(), json()] 66 | }); 67 | 68 | await bundle.write({ 69 | dir: `${out}/server`, 70 | format: 'esm', 71 | sourcemap: true, 72 | chunkFileNames: `chunks/[name]-[hash].js` 73 | }); 74 | 75 | 76 | builder.copy(files, out, { 77 | replace: { 78 | SERVER: './server/index.js', 79 | MANIFEST: './server/manifest.js', 80 | ENV_PREFIX: JSON.stringify(envPrefix), 81 | dotENV_PREFIX: envPrefix, 82 | BUILD_OPTIONS: JSON.stringify({development, dynamic_origin, xff_depth, assets}) 83 | } 84 | }); 85 | 86 | if (precompress) { 87 | builder.log.minor('Compressing assets'); 88 | await compress(`${out}/client`, precompress); 89 | await compress(`${out}/static`, precompress); 90 | await compress(`${out}/prerendered`, precompress); 91 | builder.log.success("Compression success"); 92 | } 93 | 94 | 95 | builder.log.success("Start server with: bun ./build/index.js") 96 | } 97 | }; 98 | } 99 | 100 | /** 101 | * @param {string} directory 102 | * @param {import('.').CompressOptions} options 103 | */ 104 | async function compress(directory, options) { 105 | if (!existsSync(directory)) { 106 | return; 107 | } 108 | 109 | 110 | let files_ext = options.files ?? ['html', 'js', 'json', 'css', 'svg', 'xml', 'wasm'] 111 | const files = await glob(`**/*.{${files_ext.join()}}`, { 112 | cwd: directory, 113 | dot: true, 114 | absolute: true, 115 | filesOnly: true 116 | }); 117 | 118 | let doBr = false, doGz = false; 119 | 120 | if (options === true) { 121 | doBr = doGz = true 122 | } else if (typeof options == "object") { 123 | doBr = options.brotli ?? false 124 | doGz = options.gzip ?? false 125 | } 126 | 127 | await Promise.all( 128 | files.map((file) => Promise.all([ 129 | doGz && compress_file(file, 'gz'), 130 | doBr && compress_file(file, 'br') 131 | ])) 132 | ); 133 | } 134 | 135 | /** 136 | * @param {string} file 137 | * @param {'gz' | 'br'} format 138 | */ 139 | async function compress_file(file, format = 'gz') { 140 | const compress = 141 | format === 'br' 142 | ? zlib.createBrotliCompress({ 143 | params: { 144 | [zlib.constants.BROTLI_PARAM_MODE]: zlib.constants.BROTLI_MODE_TEXT, 145 | [zlib.constants.BROTLI_PARAM_QUALITY]: zlib.constants.BROTLI_MAX_QUALITY, 146 | [zlib.constants.BROTLI_PARAM_SIZE_HINT]: statSync(file).size 147 | } 148 | }) 149 | : zlib.createGzip({level: zlib.constants.Z_BEST_COMPRESSION}); 150 | 151 | const source = createReadStream(file); 152 | const destination = createWriteStream(`${file}.${format}`); 153 | 154 | await pipe(source, compress, destination); 155 | } -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@bun-community/sveltekit-adapter-bun", 3 | "lockfileVersion": 2, 4 | "requires": true, 5 | "packages": { 6 | "": { 7 | "name": "@bun-community/sveltekit-adapter-bun", 8 | "dependencies": { 9 | "@rollup/plugin-commonjs": "^23.0.0", 10 | "@rollup/plugin-json": "^5.0.0", 11 | "@rollup/plugin-node-resolve": "^15.0.0", 12 | "bun-types": "^0.1.11", 13 | "tiny-glob": "^0.2.9" 14 | } 15 | }, 16 | "node_modules/@rollup/plugin-commonjs": { 17 | "version": "23.0.0", 18 | "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-23.0.0.tgz", 19 | "integrity": "sha512-JbrTRyDNtLQj/rhl7RFUuYXwQ2fac+33oLDAu2k++WD95zweyo28UAomLVA0JMGx4vmCa7Nw4T6k/1F6lelExg==", 20 | "dependencies": { 21 | "@rollup/pluginutils": "^4.2.1", 22 | "commondir": "^1.0.1", 23 | "estree-walker": "^2.0.2", 24 | "glob": "^8.0.3", 25 | "is-reference": "1.2.1", 26 | "magic-string": "^0.26.4" 27 | }, 28 | "engines": { 29 | "node": ">=14.0.0" 30 | }, 31 | "peerDependencies": { 32 | "rollup": "^2.68.0||^3.0.0" 33 | }, 34 | "peerDependenciesMeta": { 35 | "rollup": { 36 | "optional": true 37 | } 38 | } 39 | }, 40 | "node_modules/@rollup/plugin-json": { 41 | "version": "5.0.0", 42 | "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-5.0.0.tgz", 43 | "integrity": "sha512-LsWDA5wJs/ggzakVuKQhZo7HPRcQZgBa3jWIVxQSFxaRToUGNi8ZBh3+k/gQ+1eInVYJgn4WBRCUkmoDrmmGzw==", 44 | "dependencies": { 45 | "@rollup/pluginutils": "^4.2.1" 46 | }, 47 | "engines": { 48 | "node": ">=14.0.0" 49 | }, 50 | "peerDependencies": { 51 | "rollup": "^1.20.0||^2.0.0||^3.0.0" 52 | }, 53 | "peerDependenciesMeta": { 54 | "rollup": { 55 | "optional": true 56 | } 57 | } 58 | }, 59 | "node_modules/@rollup/plugin-node-resolve": { 60 | "version": "15.0.0", 61 | "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.0.0.tgz", 62 | "integrity": "sha512-iwJbzfTzlzDDQcGmkS7EkCKwe2kSkdBrjX87Fy/KrNjr6UNnLpod0t6X66e502LRe5JJCA4FFqrEscWPnZAkig==", 63 | "dependencies": { 64 | "@rollup/pluginutils": "^4.2.1", 65 | "@types/resolve": "1.20.2", 66 | "deepmerge": "^4.2.2", 67 | "is-builtin-module": "^3.2.0", 68 | "is-module": "^1.0.0", 69 | "resolve": "^1.22.1" 70 | }, 71 | "engines": { 72 | "node": ">=14.0.0" 73 | }, 74 | "peerDependencies": { 75 | "rollup": "^2.78.0||^3.0.0" 76 | }, 77 | "peerDependenciesMeta": { 78 | "rollup": { 79 | "optional": true 80 | } 81 | } 82 | }, 83 | "node_modules/@rollup/pluginutils": { 84 | "version": "4.2.1", 85 | "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.2.1.tgz", 86 | "integrity": "sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==", 87 | "dependencies": { 88 | "estree-walker": "^2.0.1", 89 | "picomatch": "^2.2.2" 90 | }, 91 | "engines": { 92 | "node": ">= 8.0.0" 93 | } 94 | }, 95 | "node_modules/@types/estree": { 96 | "version": "1.0.0", 97 | "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.0.tgz", 98 | "integrity": "sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==" 99 | }, 100 | "node_modules/@types/resolve": { 101 | "version": "1.20.2", 102 | "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz", 103 | "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==" 104 | }, 105 | "node_modules/balanced-match": { 106 | "version": "1.0.2", 107 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", 108 | "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" 109 | }, 110 | "node_modules/brace-expansion": { 111 | "version": "2.0.1", 112 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", 113 | "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", 114 | "dependencies": { 115 | "balanced-match": "^1.0.0" 116 | } 117 | }, 118 | "node_modules/builtin-modules": { 119 | "version": "3.3.0", 120 | "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", 121 | "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", 122 | "engines": { 123 | "node": ">=6" 124 | }, 125 | "funding": { 126 | "url": "https://github.com/sponsors/sindresorhus" 127 | } 128 | }, 129 | "node_modules/bun-types": { 130 | "version": "0.1.11", 131 | "resolved": "https://registry.npmjs.org/bun-types/-/bun-types-0.1.11.tgz", 132 | "integrity": "sha512-a5G9LZtF5qBsDMjGnS5FfTvIeg1bS0PzI3Q2LqShEjJWdhZTB56xO8ewqZ83J+3my5rW/PPPWT/udAofRQ3zdg==" 133 | }, 134 | "node_modules/commondir": { 135 | "version": "1.0.1", 136 | "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", 137 | "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==" 138 | }, 139 | "node_modules/deepmerge": { 140 | "version": "4.2.2", 141 | "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", 142 | "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", 143 | "engines": { 144 | "node": ">=0.10.0" 145 | } 146 | }, 147 | "node_modules/estree-walker": { 148 | "version": "2.0.2", 149 | "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", 150 | "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" 151 | }, 152 | "node_modules/fs.realpath": { 153 | "version": "1.0.0", 154 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 155 | "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" 156 | }, 157 | "node_modules/function-bind": { 158 | "version": "1.1.1", 159 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", 160 | "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" 161 | }, 162 | "node_modules/glob": { 163 | "version": "8.0.3", 164 | "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", 165 | "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", 166 | "dependencies": { 167 | "fs.realpath": "^1.0.0", 168 | "inflight": "^1.0.4", 169 | "inherits": "2", 170 | "minimatch": "^5.0.1", 171 | "once": "^1.3.0" 172 | }, 173 | "engines": { 174 | "node": ">=12" 175 | }, 176 | "funding": { 177 | "url": "https://github.com/sponsors/isaacs" 178 | } 179 | }, 180 | "node_modules/globalyzer": { 181 | "version": "0.1.0", 182 | "resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz", 183 | "integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==" 184 | }, 185 | "node_modules/globrex": { 186 | "version": "0.1.2", 187 | "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz", 188 | "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==" 189 | }, 190 | "node_modules/has": { 191 | "version": "1.0.3", 192 | "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", 193 | "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", 194 | "dependencies": { 195 | "function-bind": "^1.1.1" 196 | }, 197 | "engines": { 198 | "node": ">= 0.4.0" 199 | } 200 | }, 201 | "node_modules/inflight": { 202 | "version": "1.0.6", 203 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 204 | "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", 205 | "dependencies": { 206 | "once": "^1.3.0", 207 | "wrappy": "1" 208 | } 209 | }, 210 | "node_modules/inherits": { 211 | "version": "2.0.4", 212 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 213 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 214 | }, 215 | "node_modules/is-builtin-module": { 216 | "version": "3.2.0", 217 | "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.0.tgz", 218 | "integrity": "sha512-phDA4oSGt7vl1n5tJvTWooWWAsXLY+2xCnxNqvKhGEzujg+A43wPlPOyDg3C8XQHN+6k/JTQWJ/j0dQh/qr+Hw==", 219 | "dependencies": { 220 | "builtin-modules": "^3.3.0" 221 | }, 222 | "engines": { 223 | "node": ">=6" 224 | }, 225 | "funding": { 226 | "url": "https://github.com/sponsors/sindresorhus" 227 | } 228 | }, 229 | "node_modules/is-core-module": { 230 | "version": "2.10.0", 231 | "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.10.0.tgz", 232 | "integrity": "sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg==", 233 | "dependencies": { 234 | "has": "^1.0.3" 235 | }, 236 | "funding": { 237 | "url": "https://github.com/sponsors/ljharb" 238 | } 239 | }, 240 | "node_modules/is-module": { 241 | "version": "1.0.0", 242 | "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", 243 | "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==" 244 | }, 245 | "node_modules/is-reference": { 246 | "version": "1.2.1", 247 | "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", 248 | "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", 249 | "dependencies": { 250 | "@types/estree": "*" 251 | } 252 | }, 253 | "node_modules/magic-string": { 254 | "version": "0.26.7", 255 | "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.26.7.tgz", 256 | "integrity": "sha512-hX9XH3ziStPoPhJxLq1syWuZMxbDvGNbVchfrdCtanC7D13888bMFow61x8axrx+GfHLtVeAx2kxL7tTGRl+Ow==", 257 | "dependencies": { 258 | "sourcemap-codec": "^1.4.8" 259 | }, 260 | "engines": { 261 | "node": ">=12" 262 | } 263 | }, 264 | "node_modules/minimatch": { 265 | "version": "5.1.0", 266 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", 267 | "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", 268 | "dependencies": { 269 | "brace-expansion": "^2.0.1" 270 | }, 271 | "engines": { 272 | "node": ">=10" 273 | } 274 | }, 275 | "node_modules/once": { 276 | "version": "1.4.0", 277 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 278 | "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", 279 | "dependencies": { 280 | "wrappy": "1" 281 | } 282 | }, 283 | "node_modules/path-parse": { 284 | "version": "1.0.7", 285 | "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", 286 | "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" 287 | }, 288 | "node_modules/picomatch": { 289 | "version": "2.3.1", 290 | "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", 291 | "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", 292 | "engines": { 293 | "node": ">=8.6" 294 | }, 295 | "funding": { 296 | "url": "https://github.com/sponsors/jonschlinkert" 297 | } 298 | }, 299 | "node_modules/resolve": { 300 | "version": "1.22.1", 301 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", 302 | "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", 303 | "dependencies": { 304 | "is-core-module": "^2.9.0", 305 | "path-parse": "^1.0.7", 306 | "supports-preserve-symlinks-flag": "^1.0.0" 307 | }, 308 | "bin": { 309 | "resolve": "bin/resolve" 310 | }, 311 | "funding": { 312 | "url": "https://github.com/sponsors/ljharb" 313 | } 314 | }, 315 | "node_modules/sourcemap-codec": { 316 | "version": "1.4.8", 317 | "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", 318 | "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==" 319 | }, 320 | "node_modules/supports-preserve-symlinks-flag": { 321 | "version": "1.0.0", 322 | "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", 323 | "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", 324 | "engines": { 325 | "node": ">= 0.4" 326 | }, 327 | "funding": { 328 | "url": "https://github.com/sponsors/ljharb" 329 | } 330 | }, 331 | "node_modules/tiny-glob": { 332 | "version": "0.2.9", 333 | "resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.9.tgz", 334 | "integrity": "sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==", 335 | "dependencies": { 336 | "globalyzer": "0.1.0", 337 | "globrex": "^0.1.2" 338 | } 339 | }, 340 | "node_modules/wrappy": { 341 | "version": "1.0.2", 342 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 343 | "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" 344 | } 345 | }, 346 | "dependencies": { 347 | "@rollup/plugin-commonjs": { 348 | "version": "23.0.0", 349 | "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-23.0.0.tgz", 350 | "integrity": "sha512-JbrTRyDNtLQj/rhl7RFUuYXwQ2fac+33oLDAu2k++WD95zweyo28UAomLVA0JMGx4vmCa7Nw4T6k/1F6lelExg==", 351 | "requires": { 352 | "@rollup/pluginutils": "^4.2.1", 353 | "commondir": "^1.0.1", 354 | "estree-walker": "^2.0.2", 355 | "glob": "^8.0.3", 356 | "is-reference": "1.2.1", 357 | "magic-string": "^0.26.4" 358 | } 359 | }, 360 | "@rollup/plugin-json": { 361 | "version": "5.0.0", 362 | "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-5.0.0.tgz", 363 | "integrity": "sha512-LsWDA5wJs/ggzakVuKQhZo7HPRcQZgBa3jWIVxQSFxaRToUGNi8ZBh3+k/gQ+1eInVYJgn4WBRCUkmoDrmmGzw==", 364 | "requires": { 365 | "@rollup/pluginutils": "^4.2.1" 366 | } 367 | }, 368 | "@rollup/plugin-node-resolve": { 369 | "version": "15.0.0", 370 | "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.0.0.tgz", 371 | "integrity": "sha512-iwJbzfTzlzDDQcGmkS7EkCKwe2kSkdBrjX87Fy/KrNjr6UNnLpod0t6X66e502LRe5JJCA4FFqrEscWPnZAkig==", 372 | "requires": { 373 | "@rollup/pluginutils": "^4.2.1", 374 | "@types/resolve": "1.20.2", 375 | "deepmerge": "^4.2.2", 376 | "is-builtin-module": "^3.2.0", 377 | "is-module": "^1.0.0", 378 | "resolve": "^1.22.1" 379 | } 380 | }, 381 | "@rollup/pluginutils": { 382 | "version": "4.2.1", 383 | "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.2.1.tgz", 384 | "integrity": "sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==", 385 | "requires": { 386 | "estree-walker": "^2.0.1", 387 | "picomatch": "^2.2.2" 388 | } 389 | }, 390 | "@types/estree": { 391 | "version": "1.0.0", 392 | "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.0.tgz", 393 | "integrity": "sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==" 394 | }, 395 | "@types/resolve": { 396 | "version": "1.20.2", 397 | "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz", 398 | "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==" 399 | }, 400 | "balanced-match": { 401 | "version": "1.0.2", 402 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", 403 | "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" 404 | }, 405 | "brace-expansion": { 406 | "version": "2.0.1", 407 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", 408 | "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", 409 | "requires": { 410 | "balanced-match": "^1.0.0" 411 | } 412 | }, 413 | "builtin-modules": { 414 | "version": "3.3.0", 415 | "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", 416 | "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==" 417 | }, 418 | "bun-types": { 419 | "version": "0.1.11", 420 | "resolved": "https://registry.npmjs.org/bun-types/-/bun-types-0.1.11.tgz", 421 | "integrity": "sha512-a5G9LZtF5qBsDMjGnS5FfTvIeg1bS0PzI3Q2LqShEjJWdhZTB56xO8ewqZ83J+3my5rW/PPPWT/udAofRQ3zdg==" 422 | }, 423 | "commondir": { 424 | "version": "1.0.1", 425 | "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", 426 | "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==" 427 | }, 428 | "deepmerge": { 429 | "version": "4.2.2", 430 | "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", 431 | "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==" 432 | }, 433 | "estree-walker": { 434 | "version": "2.0.2", 435 | "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", 436 | "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" 437 | }, 438 | "fs.realpath": { 439 | "version": "1.0.0", 440 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 441 | "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" 442 | }, 443 | "function-bind": { 444 | "version": "1.1.1", 445 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", 446 | "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" 447 | }, 448 | "glob": { 449 | "version": "8.0.3", 450 | "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", 451 | "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", 452 | "requires": { 453 | "fs.realpath": "^1.0.0", 454 | "inflight": "^1.0.4", 455 | "inherits": "2", 456 | "minimatch": "^5.0.1", 457 | "once": "^1.3.0" 458 | } 459 | }, 460 | "globalyzer": { 461 | "version": "0.1.0", 462 | "resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz", 463 | "integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==" 464 | }, 465 | "globrex": { 466 | "version": "0.1.2", 467 | "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz", 468 | "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==" 469 | }, 470 | "has": { 471 | "version": "1.0.3", 472 | "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", 473 | "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", 474 | "requires": { 475 | "function-bind": "^1.1.1" 476 | } 477 | }, 478 | "inflight": { 479 | "version": "1.0.6", 480 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 481 | "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", 482 | "requires": { 483 | "once": "^1.3.0", 484 | "wrappy": "1" 485 | } 486 | }, 487 | "inherits": { 488 | "version": "2.0.4", 489 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 490 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 491 | }, 492 | "is-builtin-module": { 493 | "version": "3.2.0", 494 | "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.0.tgz", 495 | "integrity": "sha512-phDA4oSGt7vl1n5tJvTWooWWAsXLY+2xCnxNqvKhGEzujg+A43wPlPOyDg3C8XQHN+6k/JTQWJ/j0dQh/qr+Hw==", 496 | "requires": { 497 | "builtin-modules": "^3.3.0" 498 | } 499 | }, 500 | "is-core-module": { 501 | "version": "2.10.0", 502 | "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.10.0.tgz", 503 | "integrity": "sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg==", 504 | "requires": { 505 | "has": "^1.0.3" 506 | } 507 | }, 508 | "is-module": { 509 | "version": "1.0.0", 510 | "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", 511 | "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==" 512 | }, 513 | "is-reference": { 514 | "version": "1.2.1", 515 | "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", 516 | "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", 517 | "requires": { 518 | "@types/estree": "*" 519 | } 520 | }, 521 | "magic-string": { 522 | "version": "0.26.7", 523 | "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.26.7.tgz", 524 | "integrity": "sha512-hX9XH3ziStPoPhJxLq1syWuZMxbDvGNbVchfrdCtanC7D13888bMFow61x8axrx+GfHLtVeAx2kxL7tTGRl+Ow==", 525 | "requires": { 526 | "sourcemap-codec": "^1.4.8" 527 | } 528 | }, 529 | "minimatch": { 530 | "version": "5.1.0", 531 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", 532 | "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", 533 | "requires": { 534 | "brace-expansion": "^2.0.1" 535 | } 536 | }, 537 | "once": { 538 | "version": "1.4.0", 539 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 540 | "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", 541 | "requires": { 542 | "wrappy": "1" 543 | } 544 | }, 545 | "path-parse": { 546 | "version": "1.0.7", 547 | "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", 548 | "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" 549 | }, 550 | "picomatch": { 551 | "version": "2.3.1", 552 | "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", 553 | "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" 554 | }, 555 | "resolve": { 556 | "version": "1.22.1", 557 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", 558 | "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", 559 | "requires": { 560 | "is-core-module": "^2.9.0", 561 | "path-parse": "^1.0.7", 562 | "supports-preserve-symlinks-flag": "^1.0.0" 563 | } 564 | }, 565 | "sourcemap-codec": { 566 | "version": "1.4.8", 567 | "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", 568 | "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==" 569 | }, 570 | "supports-preserve-symlinks-flag": { 571 | "version": "1.0.0", 572 | "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", 573 | "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==" 574 | }, 575 | "tiny-glob": { 576 | "version": "0.2.9", 577 | "resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.9.tgz", 578 | "integrity": "sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==", 579 | "requires": { 580 | "globalyzer": "0.1.0", 581 | "globrex": "^0.1.2" 582 | } 583 | }, 584 | "wrappy": { 585 | "version": "1.0.2", 586 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 587 | "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" 588 | } 589 | } 590 | } 591 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@bun-community/sveltekit-adapter-bun", 3 | "description": "Adapter for SvelteKit apps that generates a standalone Bun.js server.", 4 | "version": "0.0.6", 5 | "main": "index.js", 6 | "type": "module", 7 | "dependencies": { 8 | "@rollup/plugin-commonjs": "^23.0.0", 9 | "@rollup/plugin-json": "^5.0.0", 10 | "@rollup/plugin-node-resolve": "^15.0.0", 11 | "bun-types": "^0.2.0", 12 | "tiny-glob": "^0.2.9" 13 | }, 14 | "keywords": [ 15 | "svelte", 16 | "sveltekit", 17 | "sveltekit-adapter", 18 | "bun" 19 | ], 20 | "author": "bun-community (https://github.com/bun-community/)", 21 | "contributors": [ 22 | { 23 | "name": "Volodymyr Palamar" 24 | }, 25 | { 26 | "name": "Dennis Dudek", 27 | "email": "admin@kapsonfire.de" 28 | } 29 | ] 30 | } 31 | --------------------------------------------------------------------------------