arri 0.77.0 → 0.78.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/index.cjs CHANGED
@@ -8,9 +8,10 @@ const typescriptCodegen = require('@arrirpc/codegen-ts');
8
8
  const common = require('./shared/arri.pHQOQ5Wb.cjs');
9
9
  const node_child_process = require('node:child_process');
10
10
  const fs = require('node:fs');
11
- const path = require('node:path');
12
11
  const chokidar = require('chokidar');
12
+ const path = require('pathe');
13
13
  const fs$1 = require('node:fs/promises');
14
+ const os = require('node:os');
14
15
  const codegenUtils = require('@arrirpc/codegen-utils');
15
16
  const listhen = require('@joshmossas/listhen');
16
17
  const esbuild = require('esbuild');
@@ -19,7 +20,6 @@ const h3 = require('h3');
19
20
  const prettier = require('prettier');
20
21
  require('c12');
21
22
  require('citty');
22
- require('pathe');
23
23
  require('@arrirpc/schema');
24
24
  require('consola');
25
25
  require('ofetch');
@@ -44,9 +44,10 @@ const rustCodegen__namespace = /*#__PURE__*/_interopNamespaceCompat(rustCodegen)
44
44
  const swiftCodegen__namespace = /*#__PURE__*/_interopNamespaceCompat(swiftCodegen);
45
45
  const typescriptCodegen__namespace = /*#__PURE__*/_interopNamespaceCompat(typescriptCodegen);
46
46
  const fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
47
- const path__default = /*#__PURE__*/_interopDefaultCompat(path);
48
47
  const chokidar__default = /*#__PURE__*/_interopDefaultCompat(chokidar);
48
+ const path__default = /*#__PURE__*/_interopDefaultCompat(path);
49
49
  const fs__namespace = /*#__PURE__*/_interopNamespaceCompat(fs$1);
50
+ const os__default = /*#__PURE__*/_interopDefaultCompat(os);
50
51
  const esbuild__default = /*#__PURE__*/_interopDefaultCompat(esbuild);
51
52
  const prettier__default = /*#__PURE__*/_interopDefaultCompat(prettier);
52
53
 
@@ -507,11 +508,15 @@ async function createDevServer(config) {
507
508
  );
508
509
  }
509
510
  async function reload() {
510
- const appEntry = (await import(path__default.resolve(
511
+ let importPath = path__default.resolve(
511
512
  config.rootDir,
512
513
  ".output",
513
514
  `${OUT_APP_FILE}?version=${Date.now()}`
514
- ))).default;
515
+ );
516
+ if (os__default.type() === "Windows_NT") {
517
+ importPath = createWindowsCompatibleAbsoluteImport(importPath);
518
+ }
519
+ const appEntry = (await import(importPath)).default;
515
520
  dynamicHandler.set(h3.fromNodeMiddleware(appEntry.h3App.handler));
516
521
  ws = appEntry.h3App.websocket;
517
522
  return appEntry.getAppDefinition();
@@ -525,6 +530,24 @@ async function createDevServer(config) {
525
530
  ws
526
531
  };
527
532
  }
533
+ function createWindowsCompatibleAbsoluteImport(input) {
534
+ let separator;
535
+ for (const char of input) {
536
+ if (char === "\\") {
537
+ separator = "\\";
538
+ break;
539
+ }
540
+ if (char === "/") {
541
+ separator = "/";
542
+ }
543
+ }
544
+ const parts = input.split(separator ?? "/");
545
+ if (parts[0]?.endsWith(":")) {
546
+ parts.unshift("file:\\");
547
+ }
548
+ const newStr = parts.join("\\");
549
+ return newStr;
550
+ }
528
551
  async function startDevServer(config, generators) {
529
552
  await setupWorkingDir(config);
530
553
  const watcher = await import('chokidar');
package/dist/index.mjs CHANGED
@@ -7,9 +7,10 @@ import { d as defineServerConfig, l as logger, i as isInsideDir } from './shared
7
7
  export { D as DEV_DEFINITION_ENDPOINT, b as defineConfig, a as isArriConfig, c as isServerConfig } from './shared/arri.CGlJ9Ywd.mjs';
8
8
  import { execSync, spawn } from 'node:child_process';
9
9
  import fs$1, { existsSync, readFileSync } from 'node:fs';
10
- import path from 'node:path';
11
10
  import chokidar from 'chokidar';
11
+ import path from 'pathe';
12
12
  import * as fs from 'node:fs/promises';
13
+ import os from 'node:os';
13
14
  import { isAppDefinition, camelCase, removeDisallowedChars, kebabCase } from '@arrirpc/codegen-utils';
14
15
  export { createAppDefinition } from '@arrirpc/codegen-utils';
15
16
  import { listen } from '@joshmossas/listhen';
@@ -19,7 +20,6 @@ import { dynamicEventHandler, toNodeListener, fromNodeMiddleware } from 'h3';
19
20
  import prettier from 'prettier';
20
21
  import 'c12';
21
22
  import 'citty';
22
- import 'pathe';
23
23
  import '@arrirpc/schema';
24
24
  import 'consola';
25
25
  import 'ofetch';
@@ -481,11 +481,15 @@ async function createDevServer(config) {
481
481
  );
482
482
  }
483
483
  async function reload() {
484
- const appEntry = (await import(path.resolve(
484
+ let importPath = path.resolve(
485
485
  config.rootDir,
486
486
  ".output",
487
487
  `${OUT_APP_FILE}?version=${Date.now()}`
488
- ))).default;
488
+ );
489
+ if (os.type() === "Windows_NT") {
490
+ importPath = createWindowsCompatibleAbsoluteImport(importPath);
491
+ }
492
+ const appEntry = (await import(importPath)).default;
489
493
  dynamicHandler.set(fromNodeMiddleware(appEntry.h3App.handler));
490
494
  ws = appEntry.h3App.websocket;
491
495
  return appEntry.getAppDefinition();
@@ -499,6 +503,24 @@ async function createDevServer(config) {
499
503
  ws
500
504
  };
501
505
  }
506
+ function createWindowsCompatibleAbsoluteImport(input) {
507
+ let separator;
508
+ for (const char of input) {
509
+ if (char === "\\") {
510
+ separator = "\\";
511
+ break;
512
+ }
513
+ if (char === "/") {
514
+ separator = "/";
515
+ }
516
+ }
517
+ const parts = input.split(separator ?? "/");
518
+ if (parts[0]?.endsWith(":")) {
519
+ parts.unshift("file:\\");
520
+ }
521
+ const newStr = parts.join("\\");
522
+ return newStr;
523
+ }
502
524
  async function startDevServer(config, generators) {
503
525
  await setupWorkingDir(config);
504
526
  const watcher = await import('chokidar');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arri",
3
- "version": "0.77.0",
3
+ "version": "0.78.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -39,13 +39,13 @@
39
39
  "ofetch": "^1.4.1",
40
40
  "pathe": "^2.0.3",
41
41
  "prettier": "^3.5.3",
42
- "@arrirpc/codegen-dart": "0.77.0",
43
- "@arrirpc/codegen-swift": "0.77.0",
44
- "@arrirpc/codegen-ts": "0.77.0",
45
- "@arrirpc/codegen-utils": "0.77.0",
46
- "@arrirpc/schema": "0.77.0",
47
- "@arrirpc/codegen-kotlin": "0.77.0",
48
- "@arrirpc/codegen-rust": "0.77.0"
42
+ "@arrirpc/codegen-dart": "0.78.0",
43
+ "@arrirpc/codegen-kotlin": "0.78.0",
44
+ "@arrirpc/codegen-rust": "0.78.0",
45
+ "@arrirpc/codegen-ts": "0.78.0",
46
+ "@arrirpc/codegen-swift": "0.78.0",
47
+ "@arrirpc/codegen-utils": "0.78.0",
48
+ "@arrirpc/schema": "0.78.0"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@types/degit": "^2.8.6"