arri 0.16.5 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.cjs CHANGED
@@ -12,13 +12,13 @@ const esbuild = require('esbuild');
12
12
  const esbuildPluginReplace = require('esbuild-plugin-replace');
13
13
  const path = require('pathe');
14
14
  const prettier = require('prettier');
15
- const config = require('./shared/arri.9c3d197c.cjs');
15
+ const config = require('./shared/arri.674faf29.cjs');
16
16
  const globby = require('globby');
17
17
  const scule = require('scule');
18
18
  const arriCodegenDart = require('arri-codegen-dart');
19
19
  const ofetch = require('ofetch');
20
+ const listhen = require('@joshmossas/listhen');
20
21
  const chokidar = require('chokidar');
21
- const listhen = require('listhen');
22
22
  const Degit = require('degit');
23
23
  require('h3');
24
24
  require('arri-validate');
@@ -309,7 +309,7 @@ const require = topLevelCreateRequire(import.meta.url);`
309
309
  httpsString = `https: { cert: '${config.https.cert}', key: '${config.https.key}', passphrase: ${config.https.passphrase ? `'${config.https.passphrase}'` : "undefined"}},`;
310
310
  }
311
311
  const virtualEntry = `import { toNodeListener } from 'arri';
312
- import { listen } from 'listhen';
312
+ import { listen } from '@joshmossas/listhen';
313
313
  import app from './${OUT_APP_FILE}';
314
314
 
315
315
  void listen(toNodeListener(app.h3App), {
@@ -573,7 +573,7 @@ async function createEntryModule(config) {
573
573
  const appImportParts = path__default.relative(path__default.resolve(config.rootDir, config.srcDir), appModule).split(".");
574
574
  appImportParts.pop();
575
575
  const virtualEntry = `import { toNodeListener } from 'h3';
576
- import { listen } from 'listhen';
576
+ import { listen } from '@joshmossas/listhen';
577
577
  import app from './${GEN_APP_FILE}';
578
578
 
579
579
  export default app.h3App;`;
package/dist/cli.mjs CHANGED
@@ -11,13 +11,13 @@ import { build as build$1 } from 'esbuild';
11
11
  import { replace } from 'esbuild-plugin-replace';
12
12
  import path from 'pathe';
13
13
  import prettier from 'prettier';
14
- import { n as defaultConfig, m as isResolvedArriConfig, a as DEV_DEFINITION_ENDPOINT } from './shared/arri.883e4574.mjs';
14
+ import { n as defaultConfig, m as isResolvedArriConfig, a as DEV_DEFINITION_ENDPOINT } from './shared/arri.a51df4b1.mjs';
15
15
  import { globby } from 'globby';
16
16
  import { camelCase, kebabCase } from 'scule';
17
17
  import { dartClientGenerator } from 'arri-codegen-dart';
18
18
  import { ofetch } from 'ofetch';
19
+ import { listenAndWatch } from '@joshmossas/listhen';
19
20
  import chokidar from 'chokidar';
20
- import { listenAndWatch } from 'listhen';
21
21
  import Degit from 'degit';
22
22
  import 'h3';
23
23
  import 'arri-validate';
@@ -285,7 +285,7 @@ const require = topLevelCreateRequire(import.meta.url);`
285
285
  httpsString = `https: { cert: '${config.https.cert}', key: '${config.https.key}', passphrase: ${config.https.passphrase ? `'${config.https.passphrase}'` : "undefined"}},`;
286
286
  }
287
287
  const virtualEntry = `import { toNodeListener } from 'arri';
288
- import { listen } from 'listhen';
288
+ import { listen } from '@joshmossas/listhen';
289
289
  import app from './${OUT_APP_FILE}';
290
290
 
291
291
  void listen(toNodeListener(app.h3App), {
@@ -549,7 +549,7 @@ async function createEntryModule(config) {
549
549
  const appImportParts = path.relative(path.resolve(config.rootDir, config.srcDir), appModule).split(".");
550
550
  appImportParts.pop();
551
551
  const virtualEntry = `import { toNodeListener } from 'h3';
552
- import { listen } from 'listhen';
552
+ import { listen } from '@joshmossas/listhen';
553
553
  import app from './${GEN_APP_FILE}';
554
554
 
555
555
  export default app.h3App;`;
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const config = require('./shared/arri.9c3d197c.cjs');
3
+ const config = require('./shared/arri.674faf29.cjs');
4
4
  const h3 = require('h3');
5
5
  require('arri-validate');
6
6
  require('arri-codegen-utils');
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { A as ArriApp, p as ArriRouter, a as DEV_DEFINITION_ENDPOINT, D as DEV_ENDPOINT_ROOT, E as ErrorResponse, B as EventStreamConnection, c as createRpcDefinition, n as defaultConfig, o as defineConfig, h as defineError, w as defineEventStreamRpc, q as defineRoute, d as defineRpc, j as errorResponseFromValidationErrors, y as formatSse, z as formatSseList, e as getRpcParamName, g as getRpcPath, f as getRpcResponseName, k as handleH3Error, t as handleRoute, l as isArriConfig, x as isEventStreamRpc, m as isResolvedArriConfig, b as isRpc, i as isRpcParamSchema, C as registerEventStreamRpc, s as registerRoute, r as registerRpc, u as setSseHeaders, v as validateRpcRequestInput } from './shared/arri.883e4574.mjs';
1
+ export { A as ArriApp, p as ArriRouter, a as DEV_DEFINITION_ENDPOINT, D as DEV_ENDPOINT_ROOT, E as ErrorResponse, B as EventStreamConnection, c as createRpcDefinition, n as defaultConfig, o as defineConfig, h as defineError, w as defineEventStreamRpc, q as defineRoute, d as defineRpc, j as errorResponseFromValidationErrors, y as formatSse, z as formatSseList, e as getRpcParamName, g as getRpcPath, f as getRpcResponseName, k as handleH3Error, t as handleRoute, l as isArriConfig, x as isEventStreamRpc, m as isResolvedArriConfig, b as isRpc, i as isRpcParamSchema, C as registerEventStreamRpc, s as registerRoute, r as registerRpc, u as setSseHeaders, v as validateRpcRequestInput } from './shared/arri.a51df4b1.mjs';
2
2
  export * from 'h3';
3
3
  import 'arri-validate';
4
4
  import 'arri-codegen-utils';
@@ -418,7 +418,6 @@ var __publicField$2 = (obj, key, value) => {
418
418
  };
419
419
  function setSseHeaders(event) {
420
420
  h3.setHeaders(event, {
421
- "Transfer-Encoding": "chunked",
422
421
  "Content-Type": "text/event-stream",
423
422
  Connection: "keep-alive",
424
423
  "Cache-Control": "no-cache"
@@ -484,6 +483,7 @@ class EventStreamConnection {
484
483
  */
485
484
  start() {
486
485
  this.h3Event._handled = true;
486
+ void h3.sendStream(this.h3Event, this.readable);
487
487
  this.pingInterval = setInterval(async () => {
488
488
  await this.publishEvent({
489
489
  id: this.lastEventId,
@@ -539,11 +539,11 @@ class EventStreamConnection {
539
539
  }
540
540
  async publishEvents(events) {
541
541
  const payload = formatSseList(events);
542
- this.h3Event.node.res.write(payload);
542
+ await this.writer.write(this.encoder.encode(payload));
543
543
  }
544
544
  async publishEvent(event) {
545
545
  const payload = formatSse(event);
546
- this.h3Event.node.res.write(payload);
546
+ await this.writer.write(this.encoder.encode(payload));
547
547
  }
548
548
  async cleanup() {
549
549
  if (this.pingInterval) {
@@ -1,4 +1,4 @@
1
- import { createError, isError, setResponseStatus, send, eventHandler, isPreflightRequest, setResponseHeader, readRawBody, getValidatedQuery, setHeaders, getHeader, defineEventHandler, getQuery, setHeader, createRouter, createApp, sendError } from 'h3';
1
+ import { createError, isError, setResponseStatus, send, eventHandler, isPreflightRequest, setResponseHeader, readRawBody, getValidatedQuery, setHeaders, getHeader, sendStream, defineEventHandler, getQuery, setHeader, createRouter, createApp, sendError } from 'h3';
2
2
  import { a, isAObjectSchema, isARecordSchema, isADiscriminatorSchema } from 'arri-validate';
3
3
  import { isRpcHttpMethod, removeDisallowedChars } from 'arri-codegen-utils';
4
4
  import { kebabCase, pascalCase } from 'scule';
@@ -416,7 +416,6 @@ var __publicField$2 = (obj, key, value) => {
416
416
  };
417
417
  function setSseHeaders(event) {
418
418
  setHeaders(event, {
419
- "Transfer-Encoding": "chunked",
420
419
  "Content-Type": "text/event-stream",
421
420
  Connection: "keep-alive",
422
421
  "Cache-Control": "no-cache"
@@ -482,6 +481,7 @@ class EventStreamConnection {
482
481
  */
483
482
  start() {
484
483
  this.h3Event._handled = true;
484
+ void sendStream(this.h3Event, this.readable);
485
485
  this.pingInterval = setInterval(async () => {
486
486
  await this.publishEvent({
487
487
  id: this.lastEventId,
@@ -537,11 +537,11 @@ class EventStreamConnection {
537
537
  }
538
538
  async publishEvents(events) {
539
539
  const payload = formatSseList(events);
540
- this.h3Event.node.res.write(payload);
540
+ await this.writer.write(this.encoder.encode(payload));
541
541
  }
542
542
  async publishEvent(event) {
543
543
  const payload = formatSse(event);
544
- this.h3Event.node.res.write(payload);
544
+ await this.writer.write(this.encoder.encode(payload));
545
545
  }
546
546
  async cleanup() {
547
547
  if (this.pingInterval) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arri",
3
- "version": "0.16.5",
3
+ "version": "0.17.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -40,13 +40,13 @@
40
40
  "prettier": "^3.1.0",
41
41
  "scule": "^1.1.1",
42
42
  "uncrypto": "^0.1.3",
43
- "arri-codegen-dart": "0.16.5",
44
- "arri-codegen-ts": "0.16.5",
45
- "arri-codegen-utils": "0.16.5",
46
- "arri-validate": "0.16.5"
43
+ "arri-codegen-dart": "0.17.0",
44
+ "arri-codegen-ts": "0.17.0",
45
+ "arri-validate": "0.17.0",
46
+ "arri-codegen-utils": "0.17.0"
47
47
  },
48
48
  "peerDependencies": {
49
- "listhen": "1.x"
49
+ "@joshmossas/listhen": "1.5.7"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/degit": "^2.8.6",