arri 0.45.5 → 0.45.7

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
@@ -11,12 +11,13 @@ const esbuild = require('esbuild');
11
11
  const esbuildPluginReplace = require('esbuild-plugin-replace');
12
12
  const path = require('pathe');
13
13
  const prettier = require('prettier');
14
- const dev = require('./shared/arri.50f2646c.cjs');
14
+ const dev = require('./shared/arri.bb661ad6.cjs');
15
15
  const ofetch = require('ofetch');
16
16
  const Degit = require('degit');
17
17
  const enquirer = require('enquirer');
18
18
  const scule = require('scule');
19
19
  require('@joshmossas/listhen');
20
+ require('h3');
20
21
  require('consola');
21
22
 
22
23
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
package/dist/cli.mjs CHANGED
@@ -9,12 +9,13 @@ import { build as build$1 } from 'esbuild';
9
9
  import { replace } from 'esbuild-plugin-replace';
10
10
  import path from 'pathe';
11
11
  import prettier from 'prettier';
12
- import { d as defaultConfig, l as logger, s as setupWorkingDir, c as createAppWithRoutesModule, O as OUT_CODEGEN, e as OUT_SERVER_ENTRY, G as GEN_APP_FILE, f as OUT_APP_FILE, i as isArriConfig, g as dev } from './shared/arri.87c198d9.mjs';
12
+ import { d as defaultConfig, l as logger, s as setupWorkingDir, c as createAppWithRoutesModule, O as OUT_CODEGEN, e as OUT_SERVER_ENTRY, G as GEN_APP_FILE, f as OUT_APP_FILE, i as isArriConfig, g as dev } from './shared/arri.4fd43a7c.mjs';
13
13
  import { ofetch } from 'ofetch';
14
14
  import Degit from 'degit';
15
15
  import enquirer from 'enquirer';
16
16
  import { kebabCase } from 'scule';
17
17
  import '@joshmossas/listhen';
18
+ import 'h3';
18
19
  import 'consola';
19
20
 
20
21
  const build = defineCommand({
package/dist/index.cjs CHANGED
@@ -1,16 +1,17 @@
1
1
  'use strict';
2
2
 
3
+ const dev = require('./shared/arri.bb661ad6.cjs');
3
4
  const codegenDart = require('@arrirpc/codegen-dart');
4
- const codegenTs = require('@arrirpc/codegen-ts');
5
5
  const codegenKotlin = require('@arrirpc/codegen-kotlin');
6
+ const codegenTs = require('@arrirpc/codegen-ts');
6
7
  const codegenUtils = require('@arrirpc/codegen-utils');
7
- const dev = require('./shared/arri.50f2646c.cjs');
8
8
  require('node:fs');
9
9
  require('node:fs/promises');
10
10
  require('@joshmossas/listhen');
11
11
  require('c12');
12
12
  require('citty');
13
13
  require('esbuild');
14
+ require('h3');
14
15
  require('ofetch');
15
16
  require('pathe');
16
17
  require('consola');
@@ -19,12 +20,12 @@ require('scule');
19
20
 
20
21
 
21
22
 
22
- exports.dartClientGenerator = codegenDart.dartClientGenerator;
23
- exports.typescriptClientGenerator = codegenTs.typescriptClientGenerator;
24
- exports.kotlinClientGenerator = codegenKotlin.kotlinClientGenerator;
25
- exports.createAppDefinition = codegenUtils.createAppDefinition;
26
23
  exports.DEV_DEFINITION_ENDPOINT = dev.DEV_DEFINITION_ENDPOINT;
27
24
  exports.defaultConfig = dev.defaultConfig;
28
25
  exports.defineConfig = dev.defineConfig;
29
26
  exports.isArriConfig = dev.isArriConfig;
30
27
  exports.isResolvedArriConfig = dev.isResolvedArriConfig;
28
+ exports.dartClientGenerator = codegenDart.dartClientGenerator;
29
+ exports.kotlinClientGenerator = codegenKotlin.kotlinClientGenerator;
30
+ exports.typescriptClientGenerator = codegenTs.typescriptClientGenerator;
31
+ exports.createAppDefinition = codegenUtils.createAppDefinition;
package/dist/index.d.cts CHANGED
@@ -1,9 +1,11 @@
1
- export { dartClientGenerator } from '@arrirpc/codegen-dart';
2
- export { typescriptClientGenerator } from '@arrirpc/codegen-ts';
3
- export { kotlinClientGenerator } from '@arrirpc/codegen-kotlin';
4
1
  import { ClientGenerator } from '@arrirpc/codegen-utils';
5
2
  export { AppDefinition, createAppDefinition } from '@arrirpc/codegen-utils';
6
3
  import { BuildOptions } from 'esbuild';
4
+ export { dartClientGenerator } from '@arrirpc/codegen-dart';
5
+ export { kotlinClientGenerator } from '@arrirpc/codegen-kotlin';
6
+ export { typescriptClientGenerator } from '@arrirpc/codegen-ts';
7
+
8
+ declare const DEV_DEFINITION_ENDPOINT = "/__arri_dev__/__definition";
7
9
 
8
10
  interface ArriConfig {
9
11
  port?: number;
@@ -38,6 +40,4 @@ type ResolvedArriConfig = Required<ArriConfig>;
38
40
  declare const defaultConfig: Required<ArriConfig>;
39
41
  declare function defineConfig(config: ArriConfig): ResolvedArriConfig;
40
42
 
41
- declare const DEV_DEFINITION_ENDPOINT = "/__arri_dev__/__definition";
42
-
43
43
  export { type ArriConfig, DEV_DEFINITION_ENDPOINT, type ResolvedArriConfig, defaultConfig, defineConfig, isArriConfig, isResolvedArriConfig };
package/dist/index.d.mts CHANGED
@@ -1,9 +1,11 @@
1
- export { dartClientGenerator } from '@arrirpc/codegen-dart';
2
- export { typescriptClientGenerator } from '@arrirpc/codegen-ts';
3
- export { kotlinClientGenerator } from '@arrirpc/codegen-kotlin';
4
1
  import { ClientGenerator } from '@arrirpc/codegen-utils';
5
2
  export { AppDefinition, createAppDefinition } from '@arrirpc/codegen-utils';
6
3
  import { BuildOptions } from 'esbuild';
4
+ export { dartClientGenerator } from '@arrirpc/codegen-dart';
5
+ export { kotlinClientGenerator } from '@arrirpc/codegen-kotlin';
6
+ export { typescriptClientGenerator } from '@arrirpc/codegen-ts';
7
+
8
+ declare const DEV_DEFINITION_ENDPOINT = "/__arri_dev__/__definition";
7
9
 
8
10
  interface ArriConfig {
9
11
  port?: number;
@@ -38,6 +40,4 @@ type ResolvedArriConfig = Required<ArriConfig>;
38
40
  declare const defaultConfig: Required<ArriConfig>;
39
41
  declare function defineConfig(config: ArriConfig): ResolvedArriConfig;
40
42
 
41
- declare const DEV_DEFINITION_ENDPOINT = "/__arri_dev__/__definition";
42
-
43
43
  export { type ArriConfig, DEV_DEFINITION_ENDPOINT, type ResolvedArriConfig, defaultConfig, defineConfig, isArriConfig, isResolvedArriConfig };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,11 @@
1
- export { dartClientGenerator } from '@arrirpc/codegen-dart';
2
- export { typescriptClientGenerator } from '@arrirpc/codegen-ts';
3
- export { kotlinClientGenerator } from '@arrirpc/codegen-kotlin';
4
1
  import { ClientGenerator } from '@arrirpc/codegen-utils';
5
2
  export { AppDefinition, createAppDefinition } from '@arrirpc/codegen-utils';
6
3
  import { BuildOptions } from 'esbuild';
4
+ export { dartClientGenerator } from '@arrirpc/codegen-dart';
5
+ export { kotlinClientGenerator } from '@arrirpc/codegen-kotlin';
6
+ export { typescriptClientGenerator } from '@arrirpc/codegen-ts';
7
+
8
+ declare const DEV_DEFINITION_ENDPOINT = "/__arri_dev__/__definition";
7
9
 
8
10
  interface ArriConfig {
9
11
  port?: number;
@@ -38,6 +40,4 @@ type ResolvedArriConfig = Required<ArriConfig>;
38
40
  declare const defaultConfig: Required<ArriConfig>;
39
41
  declare function defineConfig(config: ArriConfig): ResolvedArriConfig;
40
42
 
41
- declare const DEV_DEFINITION_ENDPOINT = "/__arri_dev__/__definition";
42
-
43
43
  export { type ArriConfig, DEV_DEFINITION_ENDPOINT, type ResolvedArriConfig, defaultConfig, defineConfig, isArriConfig, isResolvedArriConfig };
package/dist/index.mjs CHANGED
@@ -1,14 +1,15 @@
1
+ export { D as DEV_DEFINITION_ENDPOINT, d as defaultConfig, b as defineConfig, i as isArriConfig, a as isResolvedArriConfig } from './shared/arri.4fd43a7c.mjs';
1
2
  export { dartClientGenerator } from '@arrirpc/codegen-dart';
2
- export { typescriptClientGenerator } from '@arrirpc/codegen-ts';
3
3
  export { kotlinClientGenerator } from '@arrirpc/codegen-kotlin';
4
+ export { typescriptClientGenerator } from '@arrirpc/codegen-ts';
4
5
  export { createAppDefinition } from '@arrirpc/codegen-utils';
5
- export { D as DEV_DEFINITION_ENDPOINT, d as defaultConfig, b as defineConfig, i as isArriConfig, a as isResolvedArriConfig } from './shared/arri.87c198d9.mjs';
6
6
  import 'node:fs';
7
7
  import 'node:fs/promises';
8
8
  import '@joshmossas/listhen';
9
9
  import 'c12';
10
10
  import 'citty';
11
11
  import 'esbuild';
12
+ import 'h3';
12
13
  import 'ofetch';
13
14
  import 'pathe';
14
15
  import 'consola';
@@ -5,73 +5,13 @@ import { listenAndWatch } from '@joshmossas/listhen';
5
5
  import { loadConfig } from 'c12';
6
6
  import { defineCommand } from 'citty';
7
7
  import * as esbuild from 'esbuild';
8
+ import 'h3';
8
9
  import { ofetch } from 'ofetch';
9
10
  import path from 'pathe';
10
11
  import { createConsola } from 'consola';
11
12
  import prettier from 'prettier';
12
13
  import { camelCase, kebabCase } from 'scule';
13
14
 
14
- function isArriConfig(input) {
15
- if (typeof input !== "object" || input === null) {
16
- return false;
17
- }
18
- if ("generators" in input) {
19
- if (!Array.isArray(input.generators)) {
20
- return false;
21
- }
22
- }
23
- if ("port" in input) {
24
- if (typeof input.port !== "number") {
25
- return false;
26
- }
27
- if (Number.isNaN(input.port)) {
28
- return false;
29
- }
30
- }
31
- if ("entry" in input && typeof input.entry !== "string") {
32
- return false;
33
- }
34
- return true;
35
- }
36
- function isResolvedArriConfig(input) {
37
- if (!isArriConfig(input)) {
38
- return false;
39
- }
40
- return typeof input.rootDir === "string" && typeof input.srcDir === "string" && (typeof input.procedureDir === "string" || typeof input.procedureDir === "boolean") && Array.isArray(input.procedureGlobPatterns) && Array.isArray(input.generators);
41
- }
42
- const defaultConfig = {
43
- port: 3e3,
44
- rootDir: ".",
45
- srcDir: "src",
46
- entry: "app.ts",
47
- serverEntry: "",
48
- procedureDir: "procedures",
49
- procedureGlobPatterns: ["**/*.rpc.ts"],
50
- generators: [],
51
- buildDir: ".arri",
52
- esbuild: {},
53
- https: false,
54
- http2: false,
55
- devServer: {}
56
- };
57
- function defineConfig(config) {
58
- return {
59
- port: config.port ?? defaultConfig.port,
60
- rootDir: config.rootDir ?? defaultConfig.rootDir,
61
- srcDir: config.srcDir ?? defaultConfig.srcDir,
62
- entry: config.entry ?? defaultConfig.entry,
63
- procedureDir: config.procedureDir ?? defaultConfig.procedureDir,
64
- procedureGlobPatterns: config.procedureGlobPatterns ?? defaultConfig.procedureGlobPatterns,
65
- generators: config.generators ?? defaultConfig.generators,
66
- buildDir: config.buildDir ?? defaultConfig.buildDir,
67
- esbuild: config.esbuild ?? defaultConfig.esbuild,
68
- serverEntry: config.serverEntry ?? "",
69
- https: config.https ?? false,
70
- http2: config.http2 ?? false,
71
- devServer: config.devServer ?? {}
72
- };
73
- }
74
-
75
15
  const logger = createConsola().withTag("arri");
76
16
  const GEN_APP_FILE = "__arri_app.ts";
77
17
  const GEN_SERVER_ENTRY_FILE = "__arri_server.ts";
@@ -158,7 +98,6 @@ async function getFsRouteBatch(glob, globPattern, config) {
158
98
  if (meta) {
159
99
  const importParts = path.relative(path.resolve(config.rootDir, config.buildDir), file).split(".");
160
100
  importParts.pop();
161
- importParts.push("js");
162
101
  routes.push({
163
102
  name: meta.id,
164
103
  importName: camelCase(meta.id.split(".").join("_")),
@@ -209,6 +148,67 @@ function isInsideDir(dir, parentDir) {
209
148
  return false;
210
149
  }
211
150
 
151
+ function isArriConfig(input) {
152
+ if (typeof input !== "object" || input === null) {
153
+ return false;
154
+ }
155
+ if ("generators" in input) {
156
+ if (!Array.isArray(input.generators)) {
157
+ return false;
158
+ }
159
+ }
160
+ if ("port" in input) {
161
+ if (typeof input.port !== "number") {
162
+ return false;
163
+ }
164
+ if (Number.isNaN(input.port)) {
165
+ return false;
166
+ }
167
+ }
168
+ if ("entry" in input && typeof input.entry !== "string") {
169
+ return false;
170
+ }
171
+ return true;
172
+ }
173
+ function isResolvedArriConfig(input) {
174
+ if (!isArriConfig(input)) {
175
+ return false;
176
+ }
177
+ return typeof input.rootDir === "string" && typeof input.srcDir === "string" && (typeof input.procedureDir === "string" || typeof input.procedureDir === "boolean") && Array.isArray(input.procedureGlobPatterns) && Array.isArray(input.generators);
178
+ }
179
+ const defaultConfig = {
180
+ port: 3e3,
181
+ rootDir: ".",
182
+ srcDir: "src",
183
+ entry: "app.ts",
184
+ serverEntry: "",
185
+ procedureDir: "procedures",
186
+ procedureGlobPatterns: ["**/*.rpc.ts"],
187
+ generators: [],
188
+ buildDir: ".arri",
189
+ esbuild: {},
190
+ https: false,
191
+ http2: false,
192
+ devServer: {}
193
+ };
194
+ function defineConfig(config) {
195
+ return {
196
+ port: config.port ?? defaultConfig.port,
197
+ rootDir: config.rootDir ?? defaultConfig.rootDir,
198
+ srcDir: config.srcDir ?? defaultConfig.srcDir,
199
+ entry: config.entry ?? defaultConfig.entry,
200
+ procedureDir: config.procedureDir ?? defaultConfig.procedureDir,
201
+ procedureGlobPatterns: config.procedureGlobPatterns ?? defaultConfig.procedureGlobPatterns,
202
+ generators: config.generators ?? defaultConfig.generators,
203
+ buildDir: config.buildDir ?? defaultConfig.buildDir,
204
+ esbuild: config.esbuild ?? defaultConfig.esbuild,
205
+ serverEntry: config.serverEntry ?? "",
206
+ https: config.https ?? false,
207
+ http2: config.http2 ?? false,
208
+ devServer: config.devServer ?? {}
209
+ };
210
+ }
211
+
212
212
  const DEV_ENDPOINT_ROOT = `/__arri_dev__`;
213
213
  const DEV_DEFINITION_ENDPOINT = `${DEV_ENDPOINT_ROOT}/__definition`;
214
214
  const dev = defineCommand({
@@ -7,6 +7,7 @@ const listhen = require('@joshmossas/listhen');
7
7
  const c12 = require('c12');
8
8
  const citty = require('citty');
9
9
  const esbuild = require('esbuild');
10
+ require('h3');
10
11
  const ofetch = require('ofetch');
11
12
  const path = require('pathe');
12
13
  const consola = require('consola');
@@ -32,67 +33,6 @@ const esbuild__namespace = /*#__PURE__*/_interopNamespaceCompat(esbuild);
32
33
  const path__default = /*#__PURE__*/_interopDefaultCompat(path);
33
34
  const prettier__default = /*#__PURE__*/_interopDefaultCompat(prettier);
34
35
 
35
- function isArriConfig(input) {
36
- if (typeof input !== "object" || input === null) {
37
- return false;
38
- }
39
- if ("generators" in input) {
40
- if (!Array.isArray(input.generators)) {
41
- return false;
42
- }
43
- }
44
- if ("port" in input) {
45
- if (typeof input.port !== "number") {
46
- return false;
47
- }
48
- if (Number.isNaN(input.port)) {
49
- return false;
50
- }
51
- }
52
- if ("entry" in input && typeof input.entry !== "string") {
53
- return false;
54
- }
55
- return true;
56
- }
57
- function isResolvedArriConfig(input) {
58
- if (!isArriConfig(input)) {
59
- return false;
60
- }
61
- return typeof input.rootDir === "string" && typeof input.srcDir === "string" && (typeof input.procedureDir === "string" || typeof input.procedureDir === "boolean") && Array.isArray(input.procedureGlobPatterns) && Array.isArray(input.generators);
62
- }
63
- const defaultConfig = {
64
- port: 3e3,
65
- rootDir: ".",
66
- srcDir: "src",
67
- entry: "app.ts",
68
- serverEntry: "",
69
- procedureDir: "procedures",
70
- procedureGlobPatterns: ["**/*.rpc.ts"],
71
- generators: [],
72
- buildDir: ".arri",
73
- esbuild: {},
74
- https: false,
75
- http2: false,
76
- devServer: {}
77
- };
78
- function defineConfig(config) {
79
- return {
80
- port: config.port ?? defaultConfig.port,
81
- rootDir: config.rootDir ?? defaultConfig.rootDir,
82
- srcDir: config.srcDir ?? defaultConfig.srcDir,
83
- entry: config.entry ?? defaultConfig.entry,
84
- procedureDir: config.procedureDir ?? defaultConfig.procedureDir,
85
- procedureGlobPatterns: config.procedureGlobPatterns ?? defaultConfig.procedureGlobPatterns,
86
- generators: config.generators ?? defaultConfig.generators,
87
- buildDir: config.buildDir ?? defaultConfig.buildDir,
88
- esbuild: config.esbuild ?? defaultConfig.esbuild,
89
- serverEntry: config.serverEntry ?? "",
90
- https: config.https ?? false,
91
- http2: config.http2 ?? false,
92
- devServer: config.devServer ?? {}
93
- };
94
- }
95
-
96
36
  const logger = consola.createConsola().withTag("arri");
97
37
  const GEN_APP_FILE = "__arri_app.ts";
98
38
  const GEN_SERVER_ENTRY_FILE = "__arri_server.ts";
@@ -179,7 +119,6 @@ async function getFsRouteBatch(glob, globPattern, config) {
179
119
  if (meta) {
180
120
  const importParts = path__default.relative(path__default.resolve(config.rootDir, config.buildDir), file).split(".");
181
121
  importParts.pop();
182
- importParts.push("js");
183
122
  routes.push({
184
123
  name: meta.id,
185
124
  importName: scule.camelCase(meta.id.split(".").join("_")),
@@ -230,6 +169,67 @@ function isInsideDir(dir, parentDir) {
230
169
  return false;
231
170
  }
232
171
 
172
+ function isArriConfig(input) {
173
+ if (typeof input !== "object" || input === null) {
174
+ return false;
175
+ }
176
+ if ("generators" in input) {
177
+ if (!Array.isArray(input.generators)) {
178
+ return false;
179
+ }
180
+ }
181
+ if ("port" in input) {
182
+ if (typeof input.port !== "number") {
183
+ return false;
184
+ }
185
+ if (Number.isNaN(input.port)) {
186
+ return false;
187
+ }
188
+ }
189
+ if ("entry" in input && typeof input.entry !== "string") {
190
+ return false;
191
+ }
192
+ return true;
193
+ }
194
+ function isResolvedArriConfig(input) {
195
+ if (!isArriConfig(input)) {
196
+ return false;
197
+ }
198
+ return typeof input.rootDir === "string" && typeof input.srcDir === "string" && (typeof input.procedureDir === "string" || typeof input.procedureDir === "boolean") && Array.isArray(input.procedureGlobPatterns) && Array.isArray(input.generators);
199
+ }
200
+ const defaultConfig = {
201
+ port: 3e3,
202
+ rootDir: ".",
203
+ srcDir: "src",
204
+ entry: "app.ts",
205
+ serverEntry: "",
206
+ procedureDir: "procedures",
207
+ procedureGlobPatterns: ["**/*.rpc.ts"],
208
+ generators: [],
209
+ buildDir: ".arri",
210
+ esbuild: {},
211
+ https: false,
212
+ http2: false,
213
+ devServer: {}
214
+ };
215
+ function defineConfig(config) {
216
+ return {
217
+ port: config.port ?? defaultConfig.port,
218
+ rootDir: config.rootDir ?? defaultConfig.rootDir,
219
+ srcDir: config.srcDir ?? defaultConfig.srcDir,
220
+ entry: config.entry ?? defaultConfig.entry,
221
+ procedureDir: config.procedureDir ?? defaultConfig.procedureDir,
222
+ procedureGlobPatterns: config.procedureGlobPatterns ?? defaultConfig.procedureGlobPatterns,
223
+ generators: config.generators ?? defaultConfig.generators,
224
+ buildDir: config.buildDir ?? defaultConfig.buildDir,
225
+ esbuild: config.esbuild ?? defaultConfig.esbuild,
226
+ serverEntry: config.serverEntry ?? "",
227
+ https: config.https ?? false,
228
+ http2: config.http2 ?? false,
229
+ devServer: config.devServer ?? {}
230
+ };
231
+ }
232
+
233
233
  const DEV_ENDPOINT_ROOT = `/__arri_dev__`;
234
234
  const DEV_DEFINITION_ENDPOINT = `${DEV_ENDPOINT_ROOT}/__definition`;
235
235
  const dev = citty.defineCommand({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arri",
3
- "version": "0.45.5",
3
+ "version": "0.45.7",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -32,17 +32,18 @@
32
32
  "consola": "^3.2.3",
33
33
  "degit": "^2.8.4",
34
34
  "enquirer": "^2.4.1",
35
- "esbuild": "^0.21.3",
35
+ "esbuild": "^0.21.4",
36
36
  "esbuild-plugin-replace": "^1.4.0",
37
37
  "globby": "^14.0.1",
38
+ "h3": "^1.11.1",
38
39
  "ofetch": "^1.3.4",
39
40
  "pathe": "^1.1.2",
40
41
  "prettier": "^3.2.5",
41
42
  "scule": "^1.3.0",
42
- "@arrirpc/codegen-dart": "0.45.5",
43
- "@arrirpc/codegen-utils": "0.45.5",
44
- "@arrirpc/codegen-ts": "0.45.5",
45
- "@arrirpc/codegen-kotlin": "0.45.5"
43
+ "@arrirpc/codegen-dart": "0.45.7",
44
+ "@arrirpc/codegen-kotlin": "0.45.7",
45
+ "@arrirpc/codegen-ts": "0.45.7",
46
+ "@arrirpc/codegen-utils": "0.45.7"
46
47
  },
47
48
  "devDependencies": {
48
49
  "@types/degit": "^2.8.6"