arri 0.0.30 → 0.0.31
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/chunks/index.cjs +2 -2
- package/dist/chunks/index.mjs +2 -2
- package/dist/cli.cjs +8 -6
- package/dist/cli.mjs +8 -6
- package/dist/codegen.cjs +2 -2
- package/dist/codegen.mjs +4 -4
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/shared/{arri.fb02cde0.cjs → arri.0d456112.cjs} +6 -0
- package/dist/shared/{arri.edccaab8.mjs → arri.0f1b603c.mjs} +1 -1
- package/dist/shared/{arri.7d8427d5.mjs → arri.6f4fe9d8.mjs} +7 -1
- package/dist/shared/{arri.6d256d98.cjs → arri.a8b148d1.cjs} +1 -1
- package/package.json +1 -1
package/dist/chunks/index.cjs
CHANGED
|
@@ -35,14 +35,14 @@ require('node:v8');
|
|
|
35
35
|
require('consola');
|
|
36
36
|
require('esbuild');
|
|
37
37
|
require('prettier');
|
|
38
|
-
require('../shared/arri.
|
|
38
|
+
require('../shared/arri.0d456112.cjs');
|
|
39
39
|
require('@sinclair/typebox');
|
|
40
40
|
require('h3');
|
|
41
41
|
require('@sinclair/typebox/errors');
|
|
42
42
|
require('@sinclair/typebox/value');
|
|
43
43
|
require('../index.cjs');
|
|
44
44
|
require('ofetch');
|
|
45
|
-
require('../shared/arri.
|
|
45
|
+
require('../shared/arri.a8b148d1.cjs');
|
|
46
46
|
require('child_process');
|
|
47
47
|
require('listhen');
|
|
48
48
|
|
package/dist/chunks/index.mjs
CHANGED
|
@@ -33,14 +33,14 @@ import 'node:v8';
|
|
|
33
33
|
import 'consola';
|
|
34
34
|
import 'esbuild';
|
|
35
35
|
import 'prettier';
|
|
36
|
-
import '../shared/arri.
|
|
36
|
+
import '../shared/arri.6f4fe9d8.mjs';
|
|
37
37
|
import '@sinclair/typebox';
|
|
38
38
|
import 'h3';
|
|
39
39
|
import '@sinclair/typebox/errors';
|
|
40
40
|
import '@sinclair/typebox/value';
|
|
41
41
|
import '../index.mjs';
|
|
42
42
|
import 'ofetch';
|
|
43
|
-
import '../shared/arri.
|
|
43
|
+
import '../shared/arri.0f1b603c.mjs';
|
|
44
44
|
import 'child_process';
|
|
45
45
|
import 'listhen';
|
|
46
46
|
|
package/dist/cli.cjs
CHANGED
|
@@ -25,7 +25,7 @@ const require$$0$3 = require('stream');
|
|
|
25
25
|
const consola = require('consola');
|
|
26
26
|
const esbuild = require('esbuild');
|
|
27
27
|
const prettier = require('prettier');
|
|
28
|
-
const app = require('./shared/arri.
|
|
28
|
+
const app = require('./shared/arri.0d456112.cjs');
|
|
29
29
|
const index = require('./index.cjs');
|
|
30
30
|
require('node:stream');
|
|
31
31
|
const ofetch = require('ofetch');
|
|
@@ -33,7 +33,7 @@ require('@sinclair/typebox');
|
|
|
33
33
|
require('h3');
|
|
34
34
|
require('@sinclair/typebox/errors');
|
|
35
35
|
require('@sinclair/typebox/value');
|
|
36
|
-
const dart = require('./shared/arri.
|
|
36
|
+
const dart = require('./shared/arri.a8b148d1.cjs');
|
|
37
37
|
const listhen = require('listhen');
|
|
38
38
|
require('child_process');
|
|
39
39
|
|
|
@@ -19950,13 +19950,13 @@ const build = citty.defineCommand({
|
|
|
19950
19950
|
if (!config) {
|
|
19951
19951
|
throw new Error("Unable to find arri config");
|
|
19952
19952
|
}
|
|
19953
|
-
await startBuild(config);
|
|
19953
|
+
await startBuild(config, args.skipCodegen);
|
|
19954
19954
|
}
|
|
19955
19955
|
});
|
|
19956
19956
|
const logger$1 = consola.createConsola({
|
|
19957
19957
|
fancy: true
|
|
19958
19958
|
}).withTag("arri");
|
|
19959
|
-
async function startBuild(config) {
|
|
19959
|
+
async function startBuild(config, skipCodeGen = false) {
|
|
19960
19960
|
logger$1.log("Bundling server....");
|
|
19961
19961
|
await setupWorkingDir(config);
|
|
19962
19962
|
await Promise.all([
|
|
@@ -19973,7 +19973,7 @@ async function startBuild(config) {
|
|
|
19973
19973
|
config.buildDir,
|
|
19974
19974
|
"codegen.js"
|
|
19975
19975
|
);
|
|
19976
|
-
if (clientCount > 0) {
|
|
19976
|
+
if (clientCount > 0 && !skipCodeGen) {
|
|
19977
19977
|
logger$1.log("Generating clients");
|
|
19978
19978
|
node_child_process.execSync(`node ${codegenModule}`);
|
|
19979
19979
|
const defJson = path__default$1.resolve(
|
|
@@ -20010,7 +20010,9 @@ async function bundleFiles$1(config) {
|
|
|
20010
20010
|
sourcemap: true,
|
|
20011
20011
|
minifyWhitespace: true,
|
|
20012
20012
|
banner: {
|
|
20013
|
-
js:
|
|
20013
|
+
js: `import { createRequire as topLevelCreateRequire } from 'module';
|
|
20014
|
+
const require = topLevelCreateRequire(import.meta.url);
|
|
20015
|
+
const __dirname = new URL(".", import.meta.url).pathname;`
|
|
20014
20016
|
},
|
|
20015
20017
|
outdir: path__default$1.resolve(config.rootDir, ".output")
|
|
20016
20018
|
});
|
package/dist/cli.mjs
CHANGED
|
@@ -23,7 +23,7 @@ import require$$0$3 from 'stream';
|
|
|
23
23
|
import { createConsola } from 'consola';
|
|
24
24
|
import { build as build$1 } from 'esbuild';
|
|
25
25
|
import prettier from 'prettier';
|
|
26
|
-
import { j as camelCase, r as removeDisallowedChars, o as kebabCase, k as isApplicationDef, D as DEV_DEFINITION_ENDPOINT } from './shared/arri.
|
|
26
|
+
import { j as camelCase, r as removeDisallowedChars, o as kebabCase, k as isApplicationDef, D as DEV_DEFINITION_ENDPOINT } from './shared/arri.6f4fe9d8.mjs';
|
|
27
27
|
import { defaultConfig } from './index.mjs';
|
|
28
28
|
import 'node:stream';
|
|
29
29
|
import { ofetch } from 'ofetch';
|
|
@@ -31,7 +31,7 @@ import '@sinclair/typebox';
|
|
|
31
31
|
import 'h3';
|
|
32
32
|
import '@sinclair/typebox/errors';
|
|
33
33
|
import '@sinclair/typebox/value';
|
|
34
|
-
import { a as dartClientGenerator } from './shared/arri.
|
|
34
|
+
import { a as dartClientGenerator } from './shared/arri.0f1b603c.mjs';
|
|
35
35
|
import { listenAndWatch } from 'listhen';
|
|
36
36
|
import 'child_process';
|
|
37
37
|
|
|
@@ -19929,13 +19929,13 @@ const build = defineCommand({
|
|
|
19929
19929
|
if (!config) {
|
|
19930
19930
|
throw new Error("Unable to find arri config");
|
|
19931
19931
|
}
|
|
19932
|
-
await startBuild(config);
|
|
19932
|
+
await startBuild(config, args.skipCodegen);
|
|
19933
19933
|
}
|
|
19934
19934
|
});
|
|
19935
19935
|
const logger$1 = createConsola({
|
|
19936
19936
|
fancy: true
|
|
19937
19937
|
}).withTag("arri");
|
|
19938
|
-
async function startBuild(config) {
|
|
19938
|
+
async function startBuild(config, skipCodeGen = false) {
|
|
19939
19939
|
logger$1.log("Bundling server....");
|
|
19940
19940
|
await setupWorkingDir(config);
|
|
19941
19941
|
await Promise.all([
|
|
@@ -19952,7 +19952,7 @@ async function startBuild(config) {
|
|
|
19952
19952
|
config.buildDir,
|
|
19953
19953
|
"codegen.js"
|
|
19954
19954
|
);
|
|
19955
|
-
if (clientCount > 0) {
|
|
19955
|
+
if (clientCount > 0 && !skipCodeGen) {
|
|
19956
19956
|
logger$1.log("Generating clients");
|
|
19957
19957
|
execSync(`node ${codegenModule}`);
|
|
19958
19958
|
const defJson = path$e.resolve(
|
|
@@ -19989,7 +19989,9 @@ async function bundleFiles$1(config) {
|
|
|
19989
19989
|
sourcemap: true,
|
|
19990
19990
|
minifyWhitespace: true,
|
|
19991
19991
|
banner: {
|
|
19992
|
-
js:
|
|
19992
|
+
js: `import { createRequire as topLevelCreateRequire } from 'module';
|
|
19993
|
+
const require = topLevelCreateRequire(import.meta.url);
|
|
19994
|
+
const __dirname = new URL(".", import.meta.url).pathname;`
|
|
19993
19995
|
},
|
|
19994
19996
|
outdir: path$e.resolve(config.rootDir, ".output")
|
|
19995
19997
|
});
|
package/dist/codegen.cjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
const require$$0 = require('fs');
|
|
4
4
|
const prettier = require('prettier');
|
|
5
|
-
const app = require('./shared/arri.
|
|
6
|
-
const dart = require('./shared/arri.
|
|
5
|
+
const app = require('./shared/arri.0d456112.cjs');
|
|
6
|
+
const dart = require('./shared/arri.a8b148d1.cjs');
|
|
7
7
|
require('@sinclair/typebox');
|
|
8
8
|
require('h3');
|
|
9
9
|
require('@sinclair/typebox/errors');
|
package/dist/codegen.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { writeFileSync } from 'fs';
|
|
2
2
|
import { format } from 'prettier';
|
|
3
|
-
import { u as unflattenObject, i as isServiceDef, p as pascalCase, a as isProcedureDef, b as isJsonSchemaScalarType, c as isJsonSchemaNullType, d as isJsonSchemaObject, e as isJsonSchemaRecord, f as isJsonSchemaEnum, g as isJsonSchemaArray, h as unflattenProcedures, j as camelCase } from './shared/arri.
|
|
4
|
-
export { m as JsonSchemaComplexTypeValues, l as JsonSchemaNullTypeValues, J as JsonSchemaScalarTypeValues, k as isApplicationDef, n as normalizeWhitespace, r as removeDisallowedChars, s as setNestedObjectProperty } from './shared/arri.
|
|
5
|
-
import { d as defineClientGeneratorPlugin } from './shared/arri.
|
|
6
|
-
export { j as classListTransformer, i as classTransformer, c as createDartClient, a as dartClientGenerator, f as dartModelFromJsonSchema, h as dartParsedJsonField, e as dartProcedureFromServiceDefinition, g as dartPropertyTypeFromSchema, b as dartServiceFromServiceDefinition, k as isDartType, l as isDartTypeWithNullables, t as transformers } from './shared/arri.
|
|
3
|
+
import { u as unflattenObject, i as isServiceDef, p as pascalCase, a as isProcedureDef, b as isJsonSchemaScalarType, c as isJsonSchemaNullType, d as isJsonSchemaObject, e as isJsonSchemaRecord, f as isJsonSchemaEnum, g as isJsonSchemaArray, h as unflattenProcedures, j as camelCase } from './shared/arri.6f4fe9d8.mjs';
|
|
4
|
+
export { m as JsonSchemaComplexTypeValues, l as JsonSchemaNullTypeValues, J as JsonSchemaScalarTypeValues, k as isApplicationDef, n as normalizeWhitespace, r as removeDisallowedChars, s as setNestedObjectProperty } from './shared/arri.6f4fe9d8.mjs';
|
|
5
|
+
import { d as defineClientGeneratorPlugin } from './shared/arri.0f1b603c.mjs';
|
|
6
|
+
export { j as classListTransformer, i as classTransformer, c as createDartClient, a as dartClientGenerator, f as dartModelFromJsonSchema, h as dartParsedJsonField, e as dartProcedureFromServiceDefinition, g as dartPropertyTypeFromSchema, b as dartServiceFromServiceDefinition, k as isDartType, l as isDartTypeWithNullables, t as transformers } from './shared/arri.0f1b603c.mjs';
|
|
7
7
|
import '@sinclair/typebox';
|
|
8
8
|
import 'h3';
|
|
9
9
|
import '@sinclair/typebox/errors';
|
package/dist/index.cjs
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as Arri, D as DEV_DEFINITION_ENDPOINT, q as DEV_ENDPOINT_ROOT, K as ErrorResponse, H as HttpMethodValues, x as createRpcDefinition, L as defineError, G as defineMiddleware, F as defineRoute, w as defineRpc, M as errorResponseFromValidationErrors, B as getRpcParamDefinition, z as getRpcParamName, y as getRpcPath, C as getRpcResponseName, t as isHttpMethod, v as isRpc, I as registerRoute, E as registerRpc } from './shared/arri.
|
|
1
|
+
export { A as Arri, D as DEV_DEFINITION_ENDPOINT, q as DEV_ENDPOINT_ROOT, K as ErrorResponse, H as HttpMethodValues, x as createRpcDefinition, L as defineError, G as defineMiddleware, F as defineRoute, w as defineRpc, M as errorResponseFromValidationErrors, B as getRpcParamDefinition, z as getRpcParamName, y as getRpcPath, C as getRpcResponseName, t as isHttpMethod, v as isRpc, I as registerRoute, E as registerRpc } from './shared/arri.6f4fe9d8.mjs';
|
|
2
2
|
import '@sinclair/typebox';
|
|
3
3
|
import 'h3';
|
|
4
4
|
import '@sinclair/typebox/errors';
|
|
@@ -623,6 +623,9 @@ function registerRpc(router, path, procedure, middleware, opts) {
|
|
|
623
623
|
if (opts.onError) {
|
|
624
624
|
await opts.onError(err, context, event);
|
|
625
625
|
}
|
|
626
|
+
if (!event.handled) {
|
|
627
|
+
h3.sendError(event, err);
|
|
628
|
+
}
|
|
626
629
|
}
|
|
627
630
|
return "";
|
|
628
631
|
});
|
|
@@ -714,6 +717,9 @@ function registerRoute(router, route, middleware, prefix, opts) {
|
|
|
714
717
|
if (opts?.onError) {
|
|
715
718
|
await opts.onError(err, context, event);
|
|
716
719
|
}
|
|
720
|
+
if (!event.handled) {
|
|
721
|
+
h3.sendError(event, err);
|
|
722
|
+
}
|
|
717
723
|
}
|
|
718
724
|
return "";
|
|
719
725
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { execSync } from 'child_process';
|
|
2
2
|
import { writeFileSync } from 'fs';
|
|
3
|
-
import { h as unflattenProcedures, i as isServiceDef, p as pascalCase, j as camelCase, a as isProcedureDef, d as isJsonSchemaObject, f as isJsonSchemaEnum, c as isJsonSchemaNullType, b as isJsonSchemaScalarType, e as isJsonSchemaRecord, g as isJsonSchemaArray } from './arri.
|
|
3
|
+
import { h as unflattenProcedures, i as isServiceDef, p as pascalCase, j as camelCase, a as isProcedureDef, d as isJsonSchemaObject, f as isJsonSchemaEnum, c as isJsonSchemaNullType, b as isJsonSchemaScalarType, e as isJsonSchemaRecord, g as isJsonSchemaArray } from './arri.6f4fe9d8.mjs';
|
|
4
4
|
|
|
5
5
|
function defineClientGeneratorPlugin(plugin) {
|
|
6
6
|
return plugin;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Type, TypeGuard } from '@sinclair/typebox';
|
|
2
|
-
import { createError, eventHandler, isPreflightRequest, readValidatedBody, getValidatedQuery, setResponseHeader, send, createRouter, createApp, getQuery, readBody
|
|
2
|
+
import { createError, eventHandler, isPreflightRequest, readValidatedBody, getValidatedQuery, setResponseHeader, send, sendError, createRouter, createApp, getQuery, readBody } from 'h3';
|
|
3
3
|
import { ValueErrorType } from '@sinclair/typebox/errors';
|
|
4
4
|
import { Value } from '@sinclair/typebox/value';
|
|
5
5
|
|
|
@@ -621,6 +621,9 @@ function registerRpc(router, path, procedure, middleware, opts) {
|
|
|
621
621
|
if (opts.onError) {
|
|
622
622
|
await opts.onError(err, context, event);
|
|
623
623
|
}
|
|
624
|
+
if (!event.handled) {
|
|
625
|
+
sendError(event, err);
|
|
626
|
+
}
|
|
624
627
|
}
|
|
625
628
|
return "";
|
|
626
629
|
});
|
|
@@ -712,6 +715,9 @@ function registerRoute(router, route, middleware, prefix, opts) {
|
|
|
712
715
|
if (opts?.onError) {
|
|
713
716
|
await opts.onError(err, context, event);
|
|
714
717
|
}
|
|
718
|
+
if (!event.handled) {
|
|
719
|
+
sendError(event, err);
|
|
720
|
+
}
|
|
715
721
|
}
|
|
716
722
|
return "";
|
|
717
723
|
});
|