@hyperweb/telescope 2.0.3 → 2.0.4

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.
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.plugin = void 0;
4
+ const path_1 = require("path");
5
+ const ast_1 = require("@cosmology/ast");
6
+ const case_1 = require("case");
7
+ const utils_1 = require("@cosmology/utils");
8
+ const imports_1 = require("../imports");
9
+ const files_1 = require("../utils/files");
10
+ const plugin = (builder, allRegistries, allConverters) => {
11
+ builder.options.rpcClients.combinedClient.map((currentClient) => {
12
+ if (!allRegistries || !allRegistries.length) {
13
+ return;
14
+ }
15
+ const registryImports = [];
16
+ const converterImports = [];
17
+ const clientFile = currentClient.fileName;
18
+ const ctxRef = {
19
+ absolute: '/',
20
+ filename: '/',
21
+ proto: {
22
+ imports: [],
23
+ package: currentClient.name,
24
+ root: {},
25
+ }
26
+ };
27
+ const ctx = new ast_1.GenericParseContext(ctxRef, null, builder.options);
28
+ const registryVariables = [];
29
+ const converterVariables = [];
30
+ const filteredRegistries = allRegistries.filter(item => (0, utils_1.isPackageIncluded)(item.package, currentClient.include.patterns));
31
+ filteredRegistries.forEach(registry => {
32
+ let rel = (0, path_1.relative)((0, path_1.dirname)(clientFile), registry.localname);
33
+ if (!rel.startsWith('.'))
34
+ rel = `./${rel}`;
35
+ rel = (0, utils_1.toPosixPath)(rel);
36
+ const variable = (0, utils_1.variableSlug)(registry.localname);
37
+ registryVariables.push(variable);
38
+ registryImports.push((0, ast_1.importNamespace)(variable, rel));
39
+ });
40
+ const filteredConverters = allConverters.filter(item => (0, utils_1.isPackageIncluded)(item.package, currentClient.include.patterns));
41
+ filteredConverters.forEach(converter => {
42
+ let rel = (0, path_1.relative)((0, path_1.dirname)(clientFile), converter.localname);
43
+ if (!rel.startsWith('.'))
44
+ rel = `./${rel}`;
45
+ rel = (0, utils_1.toPosixPath)(rel);
46
+ const variable = (0, utils_1.variableSlug)(converter.localname);
47
+ converterVariables.push(variable);
48
+ converterImports.push((0, ast_1.importNamespace)(variable, rel));
49
+ });
50
+ const name = 'get' + (0, case_1.pascal)(currentClient.name + 'SigningClient');
51
+ const txRpcName = 'get' + (0, case_1.pascal)(currentClient.name + 'SigningTxRpc');
52
+ const prefix = (0, case_1.camel)(currentClient.name);
53
+ const aminos = (0, ast_1.createStargateClientAminoRegistry)({
54
+ context: ctx,
55
+ aminos: converterVariables,
56
+ aminoConverters: prefix + 'AminoConverters'
57
+ });
58
+ const protos = (0, ast_1.createStargateClientProtoRegistry)({
59
+ context: ctx,
60
+ registries: registryVariables,
61
+ protoTypeRegistry: prefix + 'ProtoRegistry'
62
+ });
63
+ const clientOptions = (0, ast_1.createStargateClientOptions)({
64
+ context: ctx,
65
+ name: name + 'Options',
66
+ protoTypeRegistry: prefix + 'ProtoRegistry',
67
+ aminoConverters: prefix + 'AminoConverters'
68
+ });
69
+ const clientBody = (0, ast_1.createStargateClient)({
70
+ context: ctx,
71
+ name,
72
+ options: name + 'Options',
73
+ });
74
+ let getTxRpc;
75
+ if (ctx.pluginValue("stargateClients.addGetTxRpc")) {
76
+ getTxRpc = (0, ast_1.createGetTxRpc)(ctx, txRpcName, name);
77
+ }
78
+ const imports = (0, imports_1.buildAllImportsFromGenericContext)(ctx, clientFile);
79
+ let importDecls = [...imports, ...registryImports, ...converterImports];
80
+ importDecls = (0, utils_1.duplicateImportPathsWithExt)(importDecls, builder.options.restoreImportExtension);
81
+ let cProg = importDecls
82
+ .concat(aminos)
83
+ .concat(protos)
84
+ .concat(clientOptions)
85
+ .concat(clientBody);
86
+ // replace all backslash path for windows
87
+ for (let i = 0; i < cProg.length; i++) {
88
+ if (cProg[i].source?.value) {
89
+ cProg[i].source.value = (0, utils_1.toPosixPath)(cProg[i].source?.value);
90
+ }
91
+ }
92
+ if (getTxRpc) {
93
+ cProg = cProg.concat(getTxRpc);
94
+ }
95
+ const clientOutFile = (0, path_1.join)(builder.outPath, clientFile);
96
+ (0, files_1.writeAstToFile)(builder.outPath, builder.options, cProg, clientOutFile);
97
+ });
98
+ };
99
+ exports.plugin = plugin;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generatedType = void 0;
4
+ exports.generatedType = `import { BinaryReader, BinaryWriter } from "../../../binary";
5
+
6
+ /**
7
+ * A type generated by Telescope 1.0.
8
+ */
9
+ export interface TelescopeGeneratedType {
10
+ readonly typeUrl: string;
11
+ readonly encode: (
12
+ message:
13
+ | any
14
+ | {
15
+ [k: string]: any;
16
+ },
17
+ writer?: BinaryWriter
18
+ ) => BinaryWriter;
19
+ readonly decode: (input: BinaryReader | Uint8Array, length?: number) => any;
20
+ readonly fromPartial: (object: any) => any;
21
+ }
22
+
23
+ export type GeneratedType = TelescopeGeneratedType;
24
+ `;
@@ -7,7 +7,7 @@ const getHelperForBigint = (options) => {
7
7
  `declare var self: any | undefined;
8
8
  declare var window: any | undefined;
9
9
  declare var global: any | undefined;
10
- var globalThis: any = (() => {
10
+ const _globalThis: any = (() => {
11
11
  if (typeof globalThis !== 'undefined') return globalThis;
12
12
  if (typeof self !== 'undefined') return self;
13
13
  if (typeof window !== 'undefined') return window;
@@ -16,8 +16,8 @@ var globalThis: any = (() => {
16
16
  })();
17
17
 
18
18
  const atob: (b64: string) => string =
19
- globalThis.atob ||
20
- ((b64) => globalThis.Buffer.from(b64, 'base64').toString('binary'));
19
+ _globalThis.atob ||
20
+ ((b64) => _globalThis.Buffer.from(b64, 'base64').toString('binary'));
21
21
 
22
22
  export function bytesFromBase64(b64: string): Uint8Array {
23
23
  const bin = atob(b64);
@@ -29,8 +29,8 @@ export function bytesFromBase64(b64: string): Uint8Array {
29
29
  }
30
30
 
31
31
  const btoa: (bin: string) => string =
32
- globalThis.btoa ||
33
- ((bin) => globalThis.Buffer.from(bin, 'binary').toString('base64'));
32
+ _globalThis.btoa ||
33
+ ((bin) => _globalThis.Buffer.from(bin, 'binary').toString('base64'));
34
34
 
35
35
  export function base64FromBytes(arr: Uint8Array): string {
36
36
  const bin: string[] = [];
@@ -19,7 +19,7 @@ ${options.useInterchainJs ?
19
19
  `declare var self: any | undefined;
20
20
  declare var window: any | undefined;
21
21
  declare var global: any | undefined;
22
- var globalThis: any = (() => {
22
+ const _globalThis: any = (() => {
23
23
  if (typeof globalThis !== 'undefined') return globalThis;
24
24
  if (typeof self !== 'undefined') return self;
25
25
  if (typeof window !== 'undefined') return window;
@@ -28,7 +28,7 @@ var globalThis: any = (() => {
28
28
  })();
29
29
 
30
30
  const atob: (b64: string) => string =
31
- globalThis.atob || ((b64) => globalThis.Buffer.from(b64, 'base64').toString('binary'));
31
+ _globalThis.atob || ((b64) => _globalThis.Buffer.from(b64, 'base64').toString('binary'));
32
32
 
33
33
  export function bytesFromBase64(b64: string): Uint8Array {
34
34
  const bin = atob(b64);
@@ -40,7 +40,7 @@ export function bytesFromBase64(b64: string): Uint8Array {
40
40
  }
41
41
 
42
42
  const btoa: (bin: string) => string =
43
- globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, 'binary').toString('base64'));
43
+ _globalThis.btoa || ((bin) => _globalThis.Buffer.from(bin, 'binary').toString('base64'));
44
44
 
45
45
  export function base64FromBytes(arr: Uint8Array): string {
46
46
  const bin: string[] = [];
@@ -0,0 +1,248 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.internalForBigInt = void 0;
4
+ exports.internalForBigInt = `
5
+ declare var self: any | undefined;
6
+ declare var window: any | undefined;
7
+ declare var global: any | undefined;
8
+ var globalThis: any = (() => {
9
+ if (typeof globalThis !== 'undefined') return globalThis;
10
+ if (typeof self !== 'undefined') return self;
11
+ if (typeof window !== 'undefined') return window;
12
+ if (typeof global !== 'undefined') return global;
13
+ throw 'Unable to locate global object';
14
+ })();
15
+
16
+ const atob: (b64: string) => string =
17
+ globalThis.atob ||
18
+ ((b64) => globalThis.Buffer.from(b64, 'base64').toString('binary'));
19
+
20
+ export function bytesFromBase64(b64: string): Uint8Array {
21
+ const bin = atob(b64);
22
+ const arr = new Uint8Array(bin.length);
23
+ for (let i = 0; i < bin.length; ++i) {
24
+ arr[i] = bin.charCodeAt(i);
25
+ }
26
+ return arr;
27
+ }
28
+
29
+ const btoa: (bin: string) => string =
30
+ globalThis.btoa ||
31
+ ((bin) => globalThis.Buffer.from(bin, 'binary').toString('base64'));
32
+
33
+ export function base64FromBytes(arr: Uint8Array): string {
34
+ const bin: string[] = [];
35
+ arr.forEach((byte) => {
36
+ bin.push(String.fromCharCode(byte));
37
+ });
38
+ return btoa(bin.join(''));
39
+ }
40
+
41
+ export interface AminoHeight {
42
+ readonly revision_number?: string;
43
+ readonly revision_height?: string;
44
+ }
45
+
46
+ export function omitDefault<T extends string | number | bigint>(
47
+ input: T
48
+ ): T | undefined {
49
+ if (typeof input === 'string') {
50
+ return input === '' ? undefined : input;
51
+ }
52
+
53
+ if (typeof input === 'number') {
54
+ return input === 0 ? undefined : input;
55
+ }
56
+
57
+ if (typeof input === 'bigint') {
58
+ return input === BigInt(0) ? undefined : input;
59
+ }
60
+
61
+ throw new Error(\`Got unsupported type \${typeof input}\`);
62
+ }
63
+
64
+ interface Duration {
65
+ /**
66
+ * Signed seconds of the span of time. Must be from -315,576,000,000
67
+ * to +315,576,000,000 inclusive. Note: these bounds are computed from:
68
+ * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
69
+ */
70
+ seconds: bigint;
71
+ /**
72
+ * Signed fractions of a second at nanosecond resolution of the span
73
+ * of time. Durations less than one second are represented with a 0
74
+ * \`seconds\` field and a positive or negative \`nanos\` field. For durations
75
+ * of one second or more, a non-zero value for the \`nanos\` field must be
76
+ * of the same sign as the \`seconds\` field. Must be from -999,999,999
77
+ * to +999,999,999 inclusive.
78
+ */
79
+
80
+ nanos: number;
81
+ }
82
+
83
+ export function toDuration(duration: string): Duration {
84
+ return {
85
+ seconds: BigInt(Math.floor(parseInt(duration) / 1000000000)),
86
+ nanos: parseInt(duration) % 1000000000
87
+ };
88
+ }
89
+
90
+ export function fromDuration(duration: Duration): string {
91
+ return (
92
+ parseInt(duration.seconds.toString()) * 1000000000 +
93
+ duration.nanos
94
+ ).toString();
95
+ }
96
+
97
+ export function isSet(value: any): boolean {
98
+ return value !== null && value !== undefined;
99
+ }
100
+
101
+ export function isObject(value: any): boolean {
102
+ return typeof value === 'object' && value !== null;
103
+ }
104
+
105
+ export interface PageRequest {
106
+ key: Uint8Array;
107
+ offset: bigint;
108
+ limit: bigint;
109
+ countTotal: boolean;
110
+ reverse: boolean;
111
+ }
112
+
113
+ export interface PageRequestParams {
114
+ 'pagination.key'?: string;
115
+ 'pagination.offset'?: string;
116
+ 'pagination.limit'?: string;
117
+ 'pagination.count_total'?: boolean;
118
+ 'pagination.reverse'?: boolean;
119
+ }
120
+
121
+ export interface Params {
122
+ params: PageRequestParams;
123
+ }
124
+
125
+ export const setPaginationParams = (
126
+ options: Params,
127
+ pagination?: PageRequest
128
+ ) => {
129
+ if (!pagination) {
130
+ return options;
131
+ }
132
+
133
+ if (typeof pagination?.countTotal !== 'undefined') {
134
+ options.params['pagination.count_total'] = pagination.countTotal;
135
+ }
136
+ if (typeof pagination?.key !== 'undefined') {
137
+ // String to Uint8Array
138
+ // let uint8arr = new Uint8Array(Buffer.from(data,'base64'));
139
+
140
+ // Uint8Array to String
141
+ options.params['pagination.key'] = Buffer.from(pagination.key).toString(
142
+ 'base64'
143
+ );
144
+ }
145
+ if (typeof pagination?.limit !== 'undefined') {
146
+ options.params['pagination.limit'] = pagination.limit.toString();
147
+ }
148
+ if (typeof pagination?.offset !== 'undefined') {
149
+ options.params['pagination.offset'] = pagination.offset.toString();
150
+ }
151
+ if (typeof pagination?.reverse !== 'undefined') {
152
+ options.params['pagination.reverse'] = pagination.reverse;
153
+ }
154
+
155
+ return options;
156
+ };
157
+
158
+ type Builtin =
159
+ | Date
160
+ | Function
161
+ | Uint8Array
162
+ | string
163
+ | number
164
+ | bigint
165
+ | boolean
166
+ | undefined;
167
+
168
+ export type DeepPartial<T> = T extends Builtin
169
+ ? T
170
+ : T extends Array<infer U>
171
+ ? Array<DeepPartial<U>>
172
+ : T extends ReadonlyArray<infer U>
173
+ ? ReadonlyArray<DeepPartial<U>>
174
+ : T extends {}
175
+ ? { [K in keyof T]?: DeepPartial<T[K]> }
176
+ : Partial<T>;
177
+
178
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
179
+ export type Exact<P, I extends P> = P extends Builtin
180
+ ? P
181
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & Record<
182
+ Exclude<keyof I, KeysOfUnion<P>>,
183
+ never
184
+ >;
185
+
186
+ export interface Rpc {
187
+ request(
188
+ service: string,
189
+ method: string,
190
+ data: Uint8Array
191
+ ): Promise<Uint8Array>;
192
+ }
193
+
194
+ interface Timestamp {
195
+ /**
196
+ * Represents seconds of UTC time since Unix epoch
197
+ * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
198
+ * 9999-12-31T23:59:59Z inclusive.
199
+ */
200
+ seconds: bigint;
201
+ /**
202
+ * Non-negative fractions of a second at nanosecond resolution. Negative
203
+ * second values with fractions must still have non-negative nanos values
204
+ * that count forward in time. Must be from 0 to 999,999,999
205
+ * inclusive.
206
+ */
207
+
208
+ nanos: number;
209
+ }
210
+
211
+ export function toTimestamp(date: Date): Timestamp {
212
+ const seconds = numberToLong(date.getTime() / 1_000);
213
+ const nanos = (date.getTime() % 1000) * 1000000;
214
+ return {
215
+ seconds,
216
+ nanos
217
+ };
218
+ }
219
+
220
+ export function fromTimestamp(t: Timestamp): Date {
221
+ let millis = Number(t.seconds) * 1000;
222
+ millis += t.nanos / 1000000;
223
+ return new Date(millis);
224
+ }
225
+
226
+ const timestampFromJSON = (object: any): Timestamp => {
227
+ return {
228
+ seconds: isSet(object.seconds)
229
+ ? BigInt(object.seconds.toString())
230
+ : BigInt(0),
231
+ nanos: isSet(object.nanos) ? Number(object.nanos) : 0
232
+ };
233
+ };
234
+
235
+ export function fromJsonTimestamp(o: any): Timestamp {
236
+ if (o instanceof Date) {
237
+ return toTimestamp(o);
238
+ } else if (typeof o === 'string') {
239
+ return toTimestamp(new Date(o));
240
+ } else {
241
+ return timestampFromJSON(o);
242
+ }
243
+ }
244
+
245
+ function numberToLong(number: number) {
246
+ return BigInt(Math.trunc(number));
247
+ }
248
+ `;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.types = void 0;
4
+ exports.types = `import { BinaryReader, BinaryWriter } from "../../../binary";
5
+
6
+ /**
7
+ * A type generated by Telescope 1.0.
8
+ */
9
+ export interface TelescopeGeneratedType {
10
+ readonly typeUrl: string;
11
+ readonly encode: (
12
+ message:
13
+ | any
14
+ | {
15
+ [k: string]: any;
16
+ },
17
+ writer?: BinaryWriter
18
+ ) => BinaryWriter;
19
+ readonly decode: (input: BinaryReader | Uint8Array, length?: number) => any;
20
+ readonly fromPartial: (object: any) => any;
21
+ }
22
+
23
+ export type GeneratedType = TelescopeGeneratedType;
24
+ `;
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getVueQueryHelper = void 0;
4
+ const getVueQueryHelper = (options) => {
5
+ return `import { getRpcClient } from './extern${options.restoreImportExtension ?? ""}'
6
+ import {
7
+ useQuery,
8
+ UseQueryOptions,
9
+ } from '@tanstack/vue-query';
10
+ import { Ref, isRef } from 'vue'
11
+
12
+ import { HttpEndpoint, ProtobufRpcClient } from '@cosmjs/stargate';
13
+ ${options.rpcClients.useConnectComet
14
+ ? "import { CometClient, connectComet, Tendermint34Client, Tendermint37Client } from '@cosmjs/tendermint-rpc';"
15
+ : "import { Tendermint34Client } from '@cosmjs/tendermint-rpc';"}
16
+
17
+ export interface VueQueryParams<TResponse, TData = TResponse> {
18
+ options?: Omit<UseQueryOptions<TData, Error, TData>, 'queryKey'>;
19
+ }
20
+
21
+ export interface UseRpcClientQuery<TData> extends VueQueryParams<ProtobufRpcClient, TData> {
22
+ rpcEndpoint: Ref<string | HttpEndpoint>;
23
+ }
24
+
25
+ export interface UseRpcEndpointQuery<TData> extends VueQueryParams<string | HttpEndpoint, TData> {
26
+ getter: () => Promise<string | HttpEndpoint>;
27
+ }
28
+
29
+ export const useRpcEndpoint = <TData = string | HttpEndpoint>({
30
+ getter,
31
+ options,
32
+ }: UseRpcEndpointQuery<TData>) => {
33
+ return useQuery<string | HttpEndpoint, Error, TData>({
34
+ queryKey: ['rpcEndpoint', getter],
35
+ queryFn: async () => {
36
+ return await getter();
37
+ },
38
+ ...options
39
+ })
40
+ };
41
+
42
+ export const useRpcClient = <TData = ProtobufRpcClient>({
43
+ rpcEndpoint,
44
+ options,
45
+ }: UseRpcClientQuery<TData>) => {
46
+ let params = {
47
+ queryKey: ['rpcClient', rpcEndpoint],
48
+ queryFn: async () => {
49
+ return await getRpcClient(rpcEndpoint.value);
50
+ },
51
+ };
52
+ if (options && !isRef(options)) {
53
+ params = {
54
+ ...options,
55
+ ...params,
56
+ };
57
+ }
58
+ return useQuery<ProtobufRpcClient | undefined, Error, TData>(params);
59
+ };
60
+
61
+ ${options.rpcClients.useConnectComet
62
+ ? "interface UseTendermintClient extends VueQueryParams<Tendermint34Client | Tendermint37Client | CometClient> {"
63
+ : "interface UseTendermintClient extends VueQueryParams<Tendermint34Client> {"}
64
+ rpcEndpoint: Ref<string | HttpEndpoint>;
65
+ }
66
+
67
+ /**
68
+ * Hook that uses vue-query to cache a connected tendermint client.
69
+ */
70
+ export const useTendermintClient = ({
71
+ rpcEndpoint,
72
+ options,
73
+ }: UseTendermintClient) => {
74
+ ${options.rpcClients.useConnectComet
75
+ ? " const { data: client } = useQuery<Tendermint34Client | Tendermint37Client | CometClient, Error, Tendermint34Client | Tendermint37Client | CometClient>("
76
+ : " const { data: client } = useQuery<Tendermint34Client, Error, Tendermint34Client>({"}
77
+ queryKey: ['client', 'tendermint', rpcEndpoint],
78
+ queryFn: () => ${options.rpcClients.useConnectComet
79
+ ? "connectComet(rpcEndpoint.value),"
80
+ : "Tendermint34Client.connect(rpcEndpoint.value),"}
81
+ // allow overriding
82
+ throwOnError: (e) => {
83
+ throw new Error(\`Failed to connect to \${rpcEndpoint}\` + '\\n' + e)
84
+ },
85
+ ...options,
86
+ })
87
+ return { client }
88
+ };
89
+ `;
90
+ };
91
+ exports.getVueQueryHelper = getVueQueryHelper;
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const recursive_1 = require("./recursive");
5
+ const utils_1 = require("./utils");
6
+ async function run() {
7
+ const argv = process.argv.slice(2);
8
+ const gitRepoIndex = argv.findIndex((arg) => arg === "--git-repo");
9
+ if (gitRepoIndex === -1) {
10
+ process.stderr.write("`git-repo` is not specified");
11
+ process.exit(1);
12
+ }
13
+ const [owner, repo] = argv[gitRepoIndex + 1]?.split("/");
14
+ if (!owner || !repo) {
15
+ process.stderr.write("wrong `git-repo` format (i.e. <owner>/<repository>).");
16
+ process.exit(1);
17
+ }
18
+ const targetsIndex = argv.findIndex((arg) => arg === "--targets");
19
+ if (targetsIndex === -1) {
20
+ process.stdout.write("`targets` is not specified");
21
+ process.exit(1);
22
+ }
23
+ const targets = argv[targetsIndex + 1]?.split(",");
24
+ if (!targets || targets.length === 0) {
25
+ process.stderr.write("wrong `targets` format (i.e. <**/*.proto>,<**/*.proto>,<**/*.proto>).");
26
+ process.exit(1);
27
+ }
28
+ const outDirIndex = argv.findIndex((arg) => arg === "--out");
29
+ if (outDirIndex === -1) {
30
+ process.stdout.write("`out` is not specified, downloading to `proto` folder by default.\n");
31
+ }
32
+ const outDir = outDirIndex !== -1 ? argv[outDirIndex + 1] : "./proto";
33
+ const omitCloneIndex = argv.findIndex((arg) => arg === "--omit-clone");
34
+ let omitClone = false;
35
+ if (omitCloneIndex !== -1 && argv[omitCloneIndex + 1] === "true") {
36
+ omitClone = true;
37
+ }
38
+ if (omitCloneIndex !== -1 &&
39
+ typeof argv[omitCloneIndex + 1] === "undefined") {
40
+ omitClone = true;
41
+ }
42
+ (0, utils_1.removeFolder)("git-modules");
43
+ const result = await (0, recursive_1.clone)({
44
+ owner,
45
+ repo,
46
+ outDir: "./git-modules",
47
+ });
48
+ if (result) {
49
+ (0, utils_1.removeFolder)(outDir);
50
+ (0, recursive_1.extractProto)({
51
+ sources: result,
52
+ targets,
53
+ outDir,
54
+ });
55
+ }
56
+ }
57
+ run();