arri 0.69.1 → 0.70.1
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 +7 -9
- package/dist/cli.d.cts +0 -1
- package/dist/cli.d.mts +0 -1
- package/dist/cli.d.ts +0 -1
- package/dist/cli.mjs +7 -9
- package/dist/index.cjs +30 -18
- package/dist/index.d.cts +18 -11
- package/dist/index.d.mts +18 -11
- package/dist/index.d.ts +18 -11
- package/dist/index.mjs +26 -20
- package/package.json +12 -12
- /package/dist/shared/{arri.cc4e1de8.mjs → arri.B1sCS4gX.mjs} +0 -0
- /package/dist/shared/{arri.27334236.cjs → arri.B5C6h-L0.cjs} +0 -0
package/dist/cli.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
const citty = require('citty');
|
|
5
5
|
const c12 = require('c12');
|
|
6
|
-
const common = require('./shared/arri.
|
|
6
|
+
const common = require('./shared/arri.B5C6h-L0.cjs');
|
|
7
7
|
const fs = require('node:fs');
|
|
8
8
|
const codegenUtils = require('@arrirpc/codegen-utils');
|
|
9
9
|
const chokidar = require('chokidar');
|
|
@@ -116,8 +116,7 @@ const codegen = citty.defineCommand({
|
|
|
116
116
|
const isUrl = args.schema.startsWith("http://") || args.schema.startsWith("https://");
|
|
117
117
|
let def;
|
|
118
118
|
if (isUrl) {
|
|
119
|
-
if (args.watch)
|
|
120
|
-
throw new Error("Cannot watch a URL");
|
|
119
|
+
if (args.watch) throw new Error("Cannot watch a URL");
|
|
121
120
|
const result = await ofetch.ofetch(args.schema);
|
|
122
121
|
if (!codegenUtils.isAppDefinition(result)) {
|
|
123
122
|
throw new Error(`Invalid App Definition at ${args.schema}`);
|
|
@@ -140,11 +139,10 @@ const codegen = citty.defineCommand({
|
|
|
140
139
|
const initialStartTime = /* @__PURE__ */ new Date();
|
|
141
140
|
await runGenerators(def, config.generators ?? []);
|
|
142
141
|
common.logger.success(
|
|
143
|
-
`Generators completed in ${( new Date()).getTime() - initialStartTime.getTime()}ms`
|
|
142
|
+
`Generators completed in ${(/* @__PURE__ */ new Date()).getTime() - initialStartTime.getTime()}ms`
|
|
144
143
|
);
|
|
145
144
|
}
|
|
146
|
-
if (!args.watch)
|
|
147
|
-
process.exit(0);
|
|
145
|
+
if (!args.watch) process.exit(0);
|
|
148
146
|
const watcher = chokidar.watch(args.schema, { ignoreInitial: true });
|
|
149
147
|
common.logger.info(`Watching ${args.schema} for changes...`);
|
|
150
148
|
watcher.on("add", async (_, __) => {
|
|
@@ -156,7 +154,7 @@ const codegen = citty.defineCommand({
|
|
|
156
154
|
config.generators ?? []
|
|
157
155
|
);
|
|
158
156
|
common.logger.success(
|
|
159
|
-
`Generators completed in ${( new Date()).getTime() - startTime.getTime()}ms`
|
|
157
|
+
`Generators completed in ${(/* @__PURE__ */ new Date()).getTime() - startTime.getTime()}ms`
|
|
160
158
|
);
|
|
161
159
|
} catch (err) {
|
|
162
160
|
common.logger.error(err);
|
|
@@ -171,7 +169,7 @@ const codegen = citty.defineCommand({
|
|
|
171
169
|
config.generators ?? []
|
|
172
170
|
);
|
|
173
171
|
common.logger.success(
|
|
174
|
-
`Generators completed in ${( new Date()).getTime() - startTime.getTime()}ms`
|
|
172
|
+
`Generators completed in ${(/* @__PURE__ */ new Date()).getTime() - startTime.getTime()}ms`
|
|
175
173
|
);
|
|
176
174
|
} catch (err) {
|
|
177
175
|
common.logger.error(err);
|
|
@@ -207,7 +205,7 @@ async function runGenerators(def, generators) {
|
|
|
207
205
|
common.logger.info(`Generating ${generators?.length} client(s)`);
|
|
208
206
|
await Promise.allSettled(
|
|
209
207
|
generators.map(
|
|
210
|
-
(gen) => gen.
|
|
208
|
+
(gen) => gen.run(
|
|
211
209
|
def ?? {
|
|
212
210
|
schemaVersion: "0.0.7",
|
|
213
211
|
procedures: {},
|
package/dist/cli.d.cts
CHANGED
package/dist/cli.d.mts
CHANGED
package/dist/cli.d.ts
CHANGED
package/dist/cli.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#! /usr/bin/env node
|
|
2
2
|
import { defineCommand, runCommand, runMain } from 'citty';
|
|
3
3
|
import { loadConfig } from 'c12';
|
|
4
|
-
import { a as isArriConfig, l as logger, g as getArriPackageMetadata, e as dev } from './shared/arri.
|
|
4
|
+
import { a as isArriConfig, l as logger, g as getArriPackageMetadata, e as dev } from './shared/arri.B1sCS4gX.mjs';
|
|
5
5
|
import fs, { rmSync, readFileSync, writeFileSync } from 'node:fs';
|
|
6
6
|
import { isAppDefinition, kebabCase } from '@arrirpc/codegen-utils';
|
|
7
7
|
import { watch } from 'chokidar';
|
|
@@ -104,8 +104,7 @@ const codegen = defineCommand({
|
|
|
104
104
|
const isUrl = args.schema.startsWith("http://") || args.schema.startsWith("https://");
|
|
105
105
|
let def;
|
|
106
106
|
if (isUrl) {
|
|
107
|
-
if (args.watch)
|
|
108
|
-
throw new Error("Cannot watch a URL");
|
|
107
|
+
if (args.watch) throw new Error("Cannot watch a URL");
|
|
109
108
|
const result = await ofetch(args.schema);
|
|
110
109
|
if (!isAppDefinition(result)) {
|
|
111
110
|
throw new Error(`Invalid App Definition at ${args.schema}`);
|
|
@@ -128,11 +127,10 @@ const codegen = defineCommand({
|
|
|
128
127
|
const initialStartTime = /* @__PURE__ */ new Date();
|
|
129
128
|
await runGenerators(def, config.generators ?? []);
|
|
130
129
|
logger.success(
|
|
131
|
-
`Generators completed in ${( new Date()).getTime() - initialStartTime.getTime()}ms`
|
|
130
|
+
`Generators completed in ${(/* @__PURE__ */ new Date()).getTime() - initialStartTime.getTime()}ms`
|
|
132
131
|
);
|
|
133
132
|
}
|
|
134
|
-
if (!args.watch)
|
|
135
|
-
process.exit(0);
|
|
133
|
+
if (!args.watch) process.exit(0);
|
|
136
134
|
const watcher = watch(args.schema, { ignoreInitial: true });
|
|
137
135
|
logger.info(`Watching ${args.schema} for changes...`);
|
|
138
136
|
watcher.on("add", async (_, __) => {
|
|
@@ -144,7 +142,7 @@ const codegen = defineCommand({
|
|
|
144
142
|
config.generators ?? []
|
|
145
143
|
);
|
|
146
144
|
logger.success(
|
|
147
|
-
`Generators completed in ${( new Date()).getTime() - startTime.getTime()}ms`
|
|
145
|
+
`Generators completed in ${(/* @__PURE__ */ new Date()).getTime() - startTime.getTime()}ms`
|
|
148
146
|
);
|
|
149
147
|
} catch (err) {
|
|
150
148
|
logger.error(err);
|
|
@@ -159,7 +157,7 @@ const codegen = defineCommand({
|
|
|
159
157
|
config.generators ?? []
|
|
160
158
|
);
|
|
161
159
|
logger.success(
|
|
162
|
-
`Generators completed in ${( new Date()).getTime() - startTime.getTime()}ms`
|
|
160
|
+
`Generators completed in ${(/* @__PURE__ */ new Date()).getTime() - startTime.getTime()}ms`
|
|
163
161
|
);
|
|
164
162
|
} catch (err) {
|
|
165
163
|
logger.error(err);
|
|
@@ -195,7 +193,7 @@ async function runGenerators(def, generators) {
|
|
|
195
193
|
logger.info(`Generating ${generators?.length} client(s)`);
|
|
196
194
|
await Promise.allSettled(
|
|
197
195
|
generators.map(
|
|
198
|
-
(gen) => gen.
|
|
196
|
+
(gen) => gen.run(
|
|
199
197
|
def ?? {
|
|
200
198
|
schemaVersion: "0.0.7",
|
|
201
199
|
procedures: {},
|
package/dist/index.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const common = require('./shared/arri.
|
|
3
|
+
const dartCodegen = require('@arrirpc/codegen-dart');
|
|
4
|
+
const kotlinCodegen = require('@arrirpc/codegen-kotlin');
|
|
5
|
+
const rustCodegen = require('@arrirpc/codegen-rust');
|
|
6
|
+
const swiftCodegen = require('@arrirpc/codegen-swift');
|
|
7
|
+
const typescriptCodegen = require('@arrirpc/codegen-ts');
|
|
8
|
+
const common = require('./shared/arri.B5C6h-L0.cjs');
|
|
9
9
|
const node_child_process = require('node:child_process');
|
|
10
10
|
const fs = require('node:fs');
|
|
11
11
|
const path = require('node:path');
|
|
@@ -38,6 +38,11 @@ function _interopNamespaceCompat(e) {
|
|
|
38
38
|
return n;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
const dartCodegen__namespace = /*#__PURE__*/_interopNamespaceCompat(dartCodegen);
|
|
42
|
+
const kotlinCodegen__namespace = /*#__PURE__*/_interopNamespaceCompat(kotlinCodegen);
|
|
43
|
+
const rustCodegen__namespace = /*#__PURE__*/_interopNamespaceCompat(rustCodegen);
|
|
44
|
+
const swiftCodegen__namespace = /*#__PURE__*/_interopNamespaceCompat(swiftCodegen);
|
|
45
|
+
const typescriptCodegen__namespace = /*#__PURE__*/_interopNamespaceCompat(typescriptCodegen);
|
|
41
46
|
const fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
|
|
42
47
|
const path__default = /*#__PURE__*/_interopDefaultCompat(path);
|
|
43
48
|
const chokidar__default = /*#__PURE__*/_interopDefaultCompat(chokidar);
|
|
@@ -100,8 +105,7 @@ function goServer(options = {}) {
|
|
|
100
105
|
}
|
|
101
106
|
}
|
|
102
107
|
async function closeChildProcess() {
|
|
103
|
-
if (!childProcess)
|
|
104
|
-
return true;
|
|
108
|
+
if (!childProcess) return true;
|
|
105
109
|
return new Promise((res, rej) => {
|
|
106
110
|
childProcess?.on("close", () => res(true));
|
|
107
111
|
childProcess?.on("exit", () => res(true));
|
|
@@ -160,7 +164,7 @@ function goServer(options = {}) {
|
|
|
160
164
|
generators.map((generator) => generator.run(appDef, true))
|
|
161
165
|
);
|
|
162
166
|
common.logger.success(
|
|
163
|
-
`Ran ${generators.length} generator(s) in ${( new Date()).getTime() - startTime.getTime()}ms`
|
|
167
|
+
`Ran ${generators.length} generator(s) in ${(/* @__PURE__ */ new Date()).getTime() - startTime.getTime()}ms`
|
|
164
168
|
);
|
|
165
169
|
hasRunGenerators = true;
|
|
166
170
|
}
|
|
@@ -201,7 +205,7 @@ function goServer(options = {}) {
|
|
|
201
205
|
generators.map((generator) => generator.run(appDef, false))
|
|
202
206
|
);
|
|
203
207
|
common.logger.success(
|
|
204
|
-
`Ran ${generators.length} generator(s) in ${( new Date()).getTime() - startTime.getTime()}ms`
|
|
208
|
+
`Ran ${generators.length} generator(s) in ${(/* @__PURE__ */ new Date()).getTime() - startTime.getTime()}ms`
|
|
205
209
|
);
|
|
206
210
|
}
|
|
207
211
|
});
|
|
@@ -320,7 +324,7 @@ async function startBuild(generators, serverConfig, skipCodeGen = false) {
|
|
|
320
324
|
generators.map((generator) => generator.run(def)) ?? []
|
|
321
325
|
);
|
|
322
326
|
common.logger.log(
|
|
323
|
-
`${clientCount} client(s) generated in ${( new Date()).getTime() - startTime}ms`
|
|
327
|
+
`${clientCount} client(s) generated in ${(/* @__PURE__ */ new Date()).getTime() - startTime}ms`
|
|
324
328
|
);
|
|
325
329
|
} else {
|
|
326
330
|
common.logger.warn(
|
|
@@ -593,7 +597,7 @@ async function startDevServer(config, generators) {
|
|
|
593
597
|
const newAppDef = await devServer.reload();
|
|
594
598
|
const newAppDefStr = JSON.stringify(newAppDef);
|
|
595
599
|
common.logger.log(
|
|
596
|
-
`Server restarted in ${( new Date()).getTime() - reloadStart}ms`
|
|
600
|
+
`Server restarted in ${(/* @__PURE__ */ new Date()).getTime() - reloadStart}ms`
|
|
597
601
|
);
|
|
598
602
|
if (generators.length && newAppDefStr !== appDefStr) {
|
|
599
603
|
common.logger.info(
|
|
@@ -618,7 +622,7 @@ async function generateClientsFromDefinition(appDef, generators) {
|
|
|
618
622
|
generators.map((generator) => generator.run(appDef, true))
|
|
619
623
|
);
|
|
620
624
|
common.logger.success(
|
|
621
|
-
`Generated ${clientCount} client${clientCount === 1 ? "" : "s"} in ${( new Date()).getTime() - startTime}ms`
|
|
625
|
+
`Generated ${clientCount} client${clientCount === 1 ? "" : "s"} in ${(/* @__PURE__ */ new Date()).getTime() - startTime}ms`
|
|
622
626
|
);
|
|
623
627
|
} catch (err) {
|
|
624
628
|
common.logger.error(err);
|
|
@@ -741,11 +745,18 @@ const servers = {
|
|
|
741
745
|
};
|
|
742
746
|
|
|
743
747
|
const generators = {
|
|
744
|
-
dartClient:
|
|
745
|
-
kotlinClient:
|
|
746
|
-
rustClient:
|
|
747
|
-
typescriptClient:
|
|
748
|
-
swiftClient:
|
|
748
|
+
dartClient: dartCodegen__namespace.dartClientGenerator,
|
|
749
|
+
kotlinClient: kotlinCodegen__namespace.kotlinClientGenerator,
|
|
750
|
+
rustClient: rustCodegen__namespace.rustClientGenerator,
|
|
751
|
+
typescriptClient: typescriptCodegen__namespace.typescriptClientGenerator,
|
|
752
|
+
swiftClient: swiftCodegen__namespace.swiftClientGenerator
|
|
753
|
+
};
|
|
754
|
+
const codegen = {
|
|
755
|
+
dart: dartCodegen__namespace,
|
|
756
|
+
kotlin: kotlinCodegen__namespace,
|
|
757
|
+
rust: rustCodegen__namespace,
|
|
758
|
+
swift: swiftCodegen__namespace,
|
|
759
|
+
ts: typescriptCodegen__namespace
|
|
749
760
|
};
|
|
750
761
|
|
|
751
762
|
exports.DEV_DEFINITION_ENDPOINT = common.DEV_DEFINITION_ENDPOINT;
|
|
@@ -754,5 +765,6 @@ exports.defineServerConfig = common.defineServerConfig;
|
|
|
754
765
|
exports.isArriConfig = common.isArriConfig;
|
|
755
766
|
exports.isServerConfig = common.isServerConfig;
|
|
756
767
|
exports.createAppDefinition = codegenUtils.createAppDefinition;
|
|
768
|
+
exports.codegen = codegen;
|
|
757
769
|
exports.generators = generators;
|
|
758
770
|
exports.servers = servers;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as _arrirpc_codegen_swift from '@arrirpc/codegen-swift';
|
|
2
|
-
import * as _arrirpc_codegen_ts from '@arrirpc/codegen-ts';
|
|
3
|
-
import * as _arrirpc_codegen_rust from '@arrirpc/codegen-rust';
|
|
4
|
-
import * as _arrirpc_codegen_kotlin from '@arrirpc/codegen-kotlin';
|
|
5
1
|
import * as _arrirpc_codegen_utils from '@arrirpc/codegen-utils';
|
|
6
2
|
import { Generator } from '@arrirpc/codegen-utils';
|
|
7
3
|
export { AppDefinition, createAppDefinition } from '@arrirpc/codegen-utils';
|
|
8
|
-
import * as
|
|
4
|
+
import * as dartCodegen from '@arrirpc/codegen-dart';
|
|
5
|
+
import * as kotlinCodegen from '@arrirpc/codegen-kotlin';
|
|
6
|
+
import * as rustCodegen from '@arrirpc/codegen-rust';
|
|
7
|
+
import * as swiftCodegen from '@arrirpc/codegen-swift';
|
|
8
|
+
import * as typescriptCodegen from '@arrirpc/codegen-ts';
|
|
9
9
|
import { ArgsDef, ParsedArgs } from 'citty';
|
|
10
10
|
import esbuild from 'esbuild';
|
|
11
11
|
|
|
@@ -74,11 +74,18 @@ declare const servers: {
|
|
|
74
74
|
};
|
|
75
75
|
|
|
76
76
|
declare const generators: {
|
|
77
|
-
readonly dartClient: _arrirpc_codegen_utils.GeneratorPlugin<
|
|
78
|
-
readonly kotlinClient: _arrirpc_codegen_utils.GeneratorPlugin<
|
|
79
|
-
readonly rustClient: _arrirpc_codegen_utils.GeneratorPlugin<
|
|
80
|
-
readonly typescriptClient: _arrirpc_codegen_utils.GeneratorPlugin<
|
|
81
|
-
readonly swiftClient: _arrirpc_codegen_utils.GeneratorPlugin<
|
|
77
|
+
readonly dartClient: _arrirpc_codegen_utils.GeneratorPlugin<dartCodegen.DartClientGeneratorOptions>;
|
|
78
|
+
readonly kotlinClient: _arrirpc_codegen_utils.GeneratorPlugin<kotlinCodegen.KotlinClientOptions>;
|
|
79
|
+
readonly rustClient: _arrirpc_codegen_utils.GeneratorPlugin<rustCodegen.RustClientGeneratorOptions>;
|
|
80
|
+
readonly typescriptClient: _arrirpc_codegen_utils.GeneratorPlugin<typescriptCodegen.TypescriptGeneratorOptions>;
|
|
81
|
+
readonly swiftClient: _arrirpc_codegen_utils.GeneratorPlugin<swiftCodegen.SwiftClientGeneratorOptions>;
|
|
82
|
+
};
|
|
83
|
+
declare const codegen: {
|
|
84
|
+
dart: typeof dartCodegen;
|
|
85
|
+
kotlin: typeof kotlinCodegen;
|
|
86
|
+
rust: typeof rustCodegen;
|
|
87
|
+
swift: typeof swiftCodegen;
|
|
88
|
+
ts: typeof typescriptCodegen;
|
|
82
89
|
};
|
|
83
90
|
|
|
84
|
-
export { type ArriConfig, DEV_DEFINITION_ENDPOINT, type ServerConfig, type TsServerConfig, defineConfig, defineServerConfig, generators, isArriConfig, isServerConfig, servers };
|
|
91
|
+
export { type ArriConfig, DEV_DEFINITION_ENDPOINT, type ServerConfig, type TsServerConfig, codegen, defineConfig, defineServerConfig, generators, isArriConfig, isServerConfig, servers };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as _arrirpc_codegen_swift from '@arrirpc/codegen-swift';
|
|
2
|
-
import * as _arrirpc_codegen_ts from '@arrirpc/codegen-ts';
|
|
3
|
-
import * as _arrirpc_codegen_rust from '@arrirpc/codegen-rust';
|
|
4
|
-
import * as _arrirpc_codegen_kotlin from '@arrirpc/codegen-kotlin';
|
|
5
1
|
import * as _arrirpc_codegen_utils from '@arrirpc/codegen-utils';
|
|
6
2
|
import { Generator } from '@arrirpc/codegen-utils';
|
|
7
3
|
export { AppDefinition, createAppDefinition } from '@arrirpc/codegen-utils';
|
|
8
|
-
import * as
|
|
4
|
+
import * as dartCodegen from '@arrirpc/codegen-dart';
|
|
5
|
+
import * as kotlinCodegen from '@arrirpc/codegen-kotlin';
|
|
6
|
+
import * as rustCodegen from '@arrirpc/codegen-rust';
|
|
7
|
+
import * as swiftCodegen from '@arrirpc/codegen-swift';
|
|
8
|
+
import * as typescriptCodegen from '@arrirpc/codegen-ts';
|
|
9
9
|
import { ArgsDef, ParsedArgs } from 'citty';
|
|
10
10
|
import esbuild from 'esbuild';
|
|
11
11
|
|
|
@@ -74,11 +74,18 @@ declare const servers: {
|
|
|
74
74
|
};
|
|
75
75
|
|
|
76
76
|
declare const generators: {
|
|
77
|
-
readonly dartClient: _arrirpc_codegen_utils.GeneratorPlugin<
|
|
78
|
-
readonly kotlinClient: _arrirpc_codegen_utils.GeneratorPlugin<
|
|
79
|
-
readonly rustClient: _arrirpc_codegen_utils.GeneratorPlugin<
|
|
80
|
-
readonly typescriptClient: _arrirpc_codegen_utils.GeneratorPlugin<
|
|
81
|
-
readonly swiftClient: _arrirpc_codegen_utils.GeneratorPlugin<
|
|
77
|
+
readonly dartClient: _arrirpc_codegen_utils.GeneratorPlugin<dartCodegen.DartClientGeneratorOptions>;
|
|
78
|
+
readonly kotlinClient: _arrirpc_codegen_utils.GeneratorPlugin<kotlinCodegen.KotlinClientOptions>;
|
|
79
|
+
readonly rustClient: _arrirpc_codegen_utils.GeneratorPlugin<rustCodegen.RustClientGeneratorOptions>;
|
|
80
|
+
readonly typescriptClient: _arrirpc_codegen_utils.GeneratorPlugin<typescriptCodegen.TypescriptGeneratorOptions>;
|
|
81
|
+
readonly swiftClient: _arrirpc_codegen_utils.GeneratorPlugin<swiftCodegen.SwiftClientGeneratorOptions>;
|
|
82
|
+
};
|
|
83
|
+
declare const codegen: {
|
|
84
|
+
dart: typeof dartCodegen;
|
|
85
|
+
kotlin: typeof kotlinCodegen;
|
|
86
|
+
rust: typeof rustCodegen;
|
|
87
|
+
swift: typeof swiftCodegen;
|
|
88
|
+
ts: typeof typescriptCodegen;
|
|
82
89
|
};
|
|
83
90
|
|
|
84
|
-
export { type ArriConfig, DEV_DEFINITION_ENDPOINT, type ServerConfig, type TsServerConfig, defineConfig, defineServerConfig, generators, isArriConfig, isServerConfig, servers };
|
|
91
|
+
export { type ArriConfig, DEV_DEFINITION_ENDPOINT, type ServerConfig, type TsServerConfig, codegen, defineConfig, defineServerConfig, generators, isArriConfig, isServerConfig, servers };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as _arrirpc_codegen_swift from '@arrirpc/codegen-swift';
|
|
2
|
-
import * as _arrirpc_codegen_ts from '@arrirpc/codegen-ts';
|
|
3
|
-
import * as _arrirpc_codegen_rust from '@arrirpc/codegen-rust';
|
|
4
|
-
import * as _arrirpc_codegen_kotlin from '@arrirpc/codegen-kotlin';
|
|
5
1
|
import * as _arrirpc_codegen_utils from '@arrirpc/codegen-utils';
|
|
6
2
|
import { Generator } from '@arrirpc/codegen-utils';
|
|
7
3
|
export { AppDefinition, createAppDefinition } from '@arrirpc/codegen-utils';
|
|
8
|
-
import * as
|
|
4
|
+
import * as dartCodegen from '@arrirpc/codegen-dart';
|
|
5
|
+
import * as kotlinCodegen from '@arrirpc/codegen-kotlin';
|
|
6
|
+
import * as rustCodegen from '@arrirpc/codegen-rust';
|
|
7
|
+
import * as swiftCodegen from '@arrirpc/codegen-swift';
|
|
8
|
+
import * as typescriptCodegen from '@arrirpc/codegen-ts';
|
|
9
9
|
import { ArgsDef, ParsedArgs } from 'citty';
|
|
10
10
|
import esbuild from 'esbuild';
|
|
11
11
|
|
|
@@ -74,11 +74,18 @@ declare const servers: {
|
|
|
74
74
|
};
|
|
75
75
|
|
|
76
76
|
declare const generators: {
|
|
77
|
-
readonly dartClient: _arrirpc_codegen_utils.GeneratorPlugin<
|
|
78
|
-
readonly kotlinClient: _arrirpc_codegen_utils.GeneratorPlugin<
|
|
79
|
-
readonly rustClient: _arrirpc_codegen_utils.GeneratorPlugin<
|
|
80
|
-
readonly typescriptClient: _arrirpc_codegen_utils.GeneratorPlugin<
|
|
81
|
-
readonly swiftClient: _arrirpc_codegen_utils.GeneratorPlugin<
|
|
77
|
+
readonly dartClient: _arrirpc_codegen_utils.GeneratorPlugin<dartCodegen.DartClientGeneratorOptions>;
|
|
78
|
+
readonly kotlinClient: _arrirpc_codegen_utils.GeneratorPlugin<kotlinCodegen.KotlinClientOptions>;
|
|
79
|
+
readonly rustClient: _arrirpc_codegen_utils.GeneratorPlugin<rustCodegen.RustClientGeneratorOptions>;
|
|
80
|
+
readonly typescriptClient: _arrirpc_codegen_utils.GeneratorPlugin<typescriptCodegen.TypescriptGeneratorOptions>;
|
|
81
|
+
readonly swiftClient: _arrirpc_codegen_utils.GeneratorPlugin<swiftCodegen.SwiftClientGeneratorOptions>;
|
|
82
|
+
};
|
|
83
|
+
declare const codegen: {
|
|
84
|
+
dart: typeof dartCodegen;
|
|
85
|
+
kotlin: typeof kotlinCodegen;
|
|
86
|
+
rust: typeof rustCodegen;
|
|
87
|
+
swift: typeof swiftCodegen;
|
|
88
|
+
ts: typeof typescriptCodegen;
|
|
82
89
|
};
|
|
83
90
|
|
|
84
|
-
export { type ArriConfig, DEV_DEFINITION_ENDPOINT, type ServerConfig, type TsServerConfig, defineConfig, defineServerConfig, generators, isArriConfig, isServerConfig, servers };
|
|
91
|
+
export { type ArriConfig, DEV_DEFINITION_ENDPOINT, type ServerConfig, type TsServerConfig, codegen, defineConfig, defineServerConfig, generators, isArriConfig, isServerConfig, servers };
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { d as defineServerConfig, l as logger, i as isInsideDir } from './shared/arri.
|
|
7
|
-
export { D as DEV_DEFINITION_ENDPOINT, b as defineConfig, a as isArriConfig, c as isServerConfig } from './shared/arri.
|
|
1
|
+
import * as dartCodegen from '@arrirpc/codegen-dart';
|
|
2
|
+
import * as kotlinCodegen from '@arrirpc/codegen-kotlin';
|
|
3
|
+
import * as rustCodegen from '@arrirpc/codegen-rust';
|
|
4
|
+
import * as swiftCodegen from '@arrirpc/codegen-swift';
|
|
5
|
+
import * as typescriptCodegen from '@arrirpc/codegen-ts';
|
|
6
|
+
import { d as defineServerConfig, l as logger, i as isInsideDir } from './shared/arri.B1sCS4gX.mjs';
|
|
7
|
+
export { D as DEV_DEFINITION_ENDPOINT, b as defineConfig, a as isArriConfig, c as isServerConfig } from './shared/arri.B1sCS4gX.mjs';
|
|
8
8
|
import { execSync, spawn } from 'node:child_process';
|
|
9
9
|
import fs$1, { existsSync, readFileSync } from 'node:fs';
|
|
10
10
|
import path from 'node:path';
|
|
@@ -79,8 +79,7 @@ function goServer(options = {}) {
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
async function closeChildProcess() {
|
|
82
|
-
if (!childProcess)
|
|
83
|
-
return true;
|
|
82
|
+
if (!childProcess) return true;
|
|
84
83
|
return new Promise((res, rej) => {
|
|
85
84
|
childProcess?.on("close", () => res(true));
|
|
86
85
|
childProcess?.on("exit", () => res(true));
|
|
@@ -139,7 +138,7 @@ function goServer(options = {}) {
|
|
|
139
138
|
generators.map((generator) => generator.run(appDef, true))
|
|
140
139
|
);
|
|
141
140
|
logger.success(
|
|
142
|
-
`Ran ${generators.length} generator(s) in ${( new Date()).getTime() - startTime.getTime()}ms`
|
|
141
|
+
`Ran ${generators.length} generator(s) in ${(/* @__PURE__ */ new Date()).getTime() - startTime.getTime()}ms`
|
|
143
142
|
);
|
|
144
143
|
hasRunGenerators = true;
|
|
145
144
|
}
|
|
@@ -180,7 +179,7 @@ function goServer(options = {}) {
|
|
|
180
179
|
generators.map((generator) => generator.run(appDef, false))
|
|
181
180
|
);
|
|
182
181
|
logger.success(
|
|
183
|
-
`Ran ${generators.length} generator(s) in ${( new Date()).getTime() - startTime.getTime()}ms`
|
|
182
|
+
`Ran ${generators.length} generator(s) in ${(/* @__PURE__ */ new Date()).getTime() - startTime.getTime()}ms`
|
|
184
183
|
);
|
|
185
184
|
}
|
|
186
185
|
});
|
|
@@ -299,7 +298,7 @@ async function startBuild(generators, serverConfig, skipCodeGen = false) {
|
|
|
299
298
|
generators.map((generator) => generator.run(def)) ?? []
|
|
300
299
|
);
|
|
301
300
|
logger.log(
|
|
302
|
-
`${clientCount} client(s) generated in ${( new Date()).getTime() - startTime}ms`
|
|
301
|
+
`${clientCount} client(s) generated in ${(/* @__PURE__ */ new Date()).getTime() - startTime}ms`
|
|
303
302
|
);
|
|
304
303
|
} else {
|
|
305
304
|
logger.warn(
|
|
@@ -572,7 +571,7 @@ async function startDevServer(config, generators) {
|
|
|
572
571
|
const newAppDef = await devServer.reload();
|
|
573
572
|
const newAppDefStr = JSON.stringify(newAppDef);
|
|
574
573
|
logger.log(
|
|
575
|
-
`Server restarted in ${( new Date()).getTime() - reloadStart}ms`
|
|
574
|
+
`Server restarted in ${(/* @__PURE__ */ new Date()).getTime() - reloadStart}ms`
|
|
576
575
|
);
|
|
577
576
|
if (generators.length && newAppDefStr !== appDefStr) {
|
|
578
577
|
logger.info(
|
|
@@ -597,7 +596,7 @@ async function generateClientsFromDefinition(appDef, generators) {
|
|
|
597
596
|
generators.map((generator) => generator.run(appDef, true))
|
|
598
597
|
);
|
|
599
598
|
logger.success(
|
|
600
|
-
`Generated ${clientCount} client${clientCount === 1 ? "" : "s"} in ${( new Date()).getTime() - startTime}ms`
|
|
599
|
+
`Generated ${clientCount} client${clientCount === 1 ? "" : "s"} in ${(/* @__PURE__ */ new Date()).getTime() - startTime}ms`
|
|
601
600
|
);
|
|
602
601
|
} catch (err) {
|
|
603
602
|
logger.error(err);
|
|
@@ -720,11 +719,18 @@ const servers = {
|
|
|
720
719
|
};
|
|
721
720
|
|
|
722
721
|
const generators = {
|
|
723
|
-
dartClient: dartClientGenerator,
|
|
724
|
-
kotlinClient: kotlinClientGenerator,
|
|
725
|
-
rustClient: rustClientGenerator,
|
|
726
|
-
typescriptClient: typescriptClientGenerator,
|
|
727
|
-
swiftClient: swiftClientGenerator
|
|
722
|
+
dartClient: dartCodegen.dartClientGenerator,
|
|
723
|
+
kotlinClient: kotlinCodegen.kotlinClientGenerator,
|
|
724
|
+
rustClient: rustCodegen.rustClientGenerator,
|
|
725
|
+
typescriptClient: typescriptCodegen.typescriptClientGenerator,
|
|
726
|
+
swiftClient: swiftCodegen.swiftClientGenerator
|
|
727
|
+
};
|
|
728
|
+
const codegen = {
|
|
729
|
+
dart: dartCodegen,
|
|
730
|
+
kotlin: kotlinCodegen,
|
|
731
|
+
rust: rustCodegen,
|
|
732
|
+
swift: swiftCodegen,
|
|
733
|
+
ts: typescriptCodegen
|
|
728
734
|
};
|
|
729
735
|
|
|
730
|
-
export { defineServerConfig, generators, servers };
|
|
736
|
+
export { codegen, defineServerConfig, generators, servers };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arri",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.70.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -27,25 +27,25 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@joshmossas/listhen": "^1.11.1",
|
|
29
29
|
"c12": "^2.0.1",
|
|
30
|
-
"chokidar": "^4.0.
|
|
30
|
+
"chokidar": "^4.0.3",
|
|
31
31
|
"citty": "^0.1.6",
|
|
32
|
-
"consola": "^3.
|
|
32
|
+
"consola": "^3.3.3",
|
|
33
33
|
"degit": "^2.8.4",
|
|
34
34
|
"enquirer": "^2.4.1",
|
|
35
|
-
"esbuild": "^0.24.
|
|
35
|
+
"esbuild": "^0.24.2",
|
|
36
36
|
"esbuild-plugin-replace": "^1.4.0",
|
|
37
37
|
"globby": "^14.0.2",
|
|
38
38
|
"h3": "^1.13.0",
|
|
39
39
|
"ofetch": "^1.4.1",
|
|
40
40
|
"pathe": "^1.1.2",
|
|
41
|
-
"prettier": "^3.4.
|
|
42
|
-
"@arrirpc/codegen-dart": "0.
|
|
43
|
-
"@arrirpc/codegen-kotlin": "0.
|
|
44
|
-
"@arrirpc/codegen-
|
|
45
|
-
"@arrirpc/codegen-
|
|
46
|
-
"@arrirpc/codegen-
|
|
47
|
-
"@arrirpc/codegen-utils": "0.
|
|
48
|
-
"@arrirpc/schema": "0.
|
|
41
|
+
"prettier": "^3.4.2",
|
|
42
|
+
"@arrirpc/codegen-dart": "0.70.1",
|
|
43
|
+
"@arrirpc/codegen-kotlin": "0.70.1",
|
|
44
|
+
"@arrirpc/codegen-swift": "0.70.1",
|
|
45
|
+
"@arrirpc/codegen-ts": "0.70.1",
|
|
46
|
+
"@arrirpc/codegen-rust": "0.70.1",
|
|
47
|
+
"@arrirpc/codegen-utils": "0.70.1",
|
|
48
|
+
"@arrirpc/schema": "0.70.1"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/degit": "^2.8.6"
|
|
File without changes
|
|
File without changes
|