@inlang/paraglide-js 1.2.2 → 1.2.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.
- package/README.md +8 -1
- package/dist/cli/commands/init.d.ts +0 -2
- package/dist/compiler/compile.d.ts +2 -1
- package/dist/index.js +424 -330
- package/dist/services/environment/package.d.ts +10 -0
- package/dist/services/environment/package.test.d.ts +1 -0
- package/dist/services/file-handling/exists.d.ts +8 -0
- package/dist/services/file-handling/exists.test.d.ts +1 -0
- package/dist/services/telemetry/implementation.d.ts +1 -1
- package/dist/services/telemetry/stack-detection.d.ts +39 -0
- package/dist/services/telemetry/stack-detection.test.d.ts +1 -0
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -2146,23 +2146,23 @@ var require_errors = __commonJS({
|
|
|
2146
2146
|
}
|
|
2147
2147
|
};
|
|
2148
2148
|
exports.ValueErrorIterator = ValueErrorIterator;
|
|
2149
|
-
function Create(type, schema,
|
|
2150
|
-
return { type, schema, path:
|
|
2149
|
+
function Create(type, schema, path4, value) {
|
|
2150
|
+
return { type, schema, path: path4, value, message: system_1.TypeSystemErrorFunction.Get()(schema, type) };
|
|
2151
2151
|
}
|
|
2152
|
-
function* TAny(schema, references,
|
|
2152
|
+
function* TAny(schema, references, path4, value) {
|
|
2153
2153
|
}
|
|
2154
|
-
function* TArray(schema, references,
|
|
2154
|
+
function* TArray(schema, references, path4, value) {
|
|
2155
2155
|
if (!(0, guard_1.IsArray)(value)) {
|
|
2156
|
-
return yield Create(ValueErrorType2.Array, schema,
|
|
2156
|
+
return yield Create(ValueErrorType2.Array, schema, path4, value);
|
|
2157
2157
|
}
|
|
2158
2158
|
if (IsDefined(schema.minItems) && !(value.length >= schema.minItems)) {
|
|
2159
|
-
yield Create(ValueErrorType2.ArrayMinItems, schema,
|
|
2159
|
+
yield Create(ValueErrorType2.ArrayMinItems, schema, path4, value);
|
|
2160
2160
|
}
|
|
2161
2161
|
if (IsDefined(schema.maxItems) && !(value.length <= schema.maxItems)) {
|
|
2162
|
-
yield Create(ValueErrorType2.ArrayMaxItems, schema,
|
|
2162
|
+
yield Create(ValueErrorType2.ArrayMaxItems, schema, path4, value);
|
|
2163
2163
|
}
|
|
2164
2164
|
for (let i2 = 0; i2 < value.length; i2++) {
|
|
2165
|
-
yield* Visit(schema.items, references, `${
|
|
2165
|
+
yield* Visit(schema.items, references, `${path4}/${i2}`, value[i2]);
|
|
2166
2166
|
}
|
|
2167
2167
|
if (schema.uniqueItems === true && !function() {
|
|
2168
2168
|
const set = /* @__PURE__ */ new Set();
|
|
@@ -2176,100 +2176,100 @@ var require_errors = __commonJS({
|
|
|
2176
2176
|
}
|
|
2177
2177
|
return true;
|
|
2178
2178
|
}()) {
|
|
2179
|
-
yield Create(ValueErrorType2.ArrayUniqueItems, schema,
|
|
2179
|
+
yield Create(ValueErrorType2.ArrayUniqueItems, schema, path4, value);
|
|
2180
2180
|
}
|
|
2181
2181
|
if (!(IsDefined(schema.contains) || IsDefined(schema.minContains) || IsDefined(schema.maxContains))) {
|
|
2182
2182
|
return;
|
|
2183
2183
|
}
|
|
2184
2184
|
const containsSchema = IsDefined(schema.contains) ? schema.contains : Types.Type.Never();
|
|
2185
|
-
const containsCount = value.reduce((acc, value2, index) => Visit(containsSchema, references, `${
|
|
2185
|
+
const containsCount = value.reduce((acc, value2, index) => Visit(containsSchema, references, `${path4}${index}`, value2).next().done === true ? acc + 1 : acc, 0);
|
|
2186
2186
|
if (containsCount === 0) {
|
|
2187
|
-
yield Create(ValueErrorType2.ArrayContains, schema,
|
|
2187
|
+
yield Create(ValueErrorType2.ArrayContains, schema, path4, value);
|
|
2188
2188
|
}
|
|
2189
2189
|
if ((0, guard_1.IsNumber)(schema.minContains) && containsCount < schema.minContains) {
|
|
2190
|
-
yield Create(ValueErrorType2.ArrayMinContains, schema,
|
|
2190
|
+
yield Create(ValueErrorType2.ArrayMinContains, schema, path4, value);
|
|
2191
2191
|
}
|
|
2192
2192
|
if ((0, guard_1.IsNumber)(schema.maxContains) && containsCount > schema.maxContains) {
|
|
2193
|
-
yield Create(ValueErrorType2.ArrayMaxContains, schema,
|
|
2193
|
+
yield Create(ValueErrorType2.ArrayMaxContains, schema, path4, value);
|
|
2194
2194
|
}
|
|
2195
2195
|
}
|
|
2196
|
-
function* TAsyncIterator(schema, references,
|
|
2196
|
+
function* TAsyncIterator(schema, references, path4, value) {
|
|
2197
2197
|
if (!(0, guard_1.IsAsyncIterator)(value))
|
|
2198
|
-
yield Create(ValueErrorType2.AsyncIterator, schema,
|
|
2198
|
+
yield Create(ValueErrorType2.AsyncIterator, schema, path4, value);
|
|
2199
2199
|
}
|
|
2200
|
-
function* TBigInt(schema, references,
|
|
2200
|
+
function* TBigInt(schema, references, path4, value) {
|
|
2201
2201
|
if (!(0, guard_1.IsBigInt)(value))
|
|
2202
|
-
return yield Create(ValueErrorType2.BigInt, schema,
|
|
2202
|
+
return yield Create(ValueErrorType2.BigInt, schema, path4, value);
|
|
2203
2203
|
if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) {
|
|
2204
|
-
yield Create(ValueErrorType2.BigIntExclusiveMaximum, schema,
|
|
2204
|
+
yield Create(ValueErrorType2.BigIntExclusiveMaximum, schema, path4, value);
|
|
2205
2205
|
}
|
|
2206
2206
|
if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) {
|
|
2207
|
-
yield Create(ValueErrorType2.BigIntExclusiveMinimum, schema,
|
|
2207
|
+
yield Create(ValueErrorType2.BigIntExclusiveMinimum, schema, path4, value);
|
|
2208
2208
|
}
|
|
2209
2209
|
if (IsDefined(schema.maximum) && !(value <= schema.maximum)) {
|
|
2210
|
-
yield Create(ValueErrorType2.BigIntMaximum, schema,
|
|
2210
|
+
yield Create(ValueErrorType2.BigIntMaximum, schema, path4, value);
|
|
2211
2211
|
}
|
|
2212
2212
|
if (IsDefined(schema.minimum) && !(value >= schema.minimum)) {
|
|
2213
|
-
yield Create(ValueErrorType2.BigIntMinimum, schema,
|
|
2213
|
+
yield Create(ValueErrorType2.BigIntMinimum, schema, path4, value);
|
|
2214
2214
|
}
|
|
2215
2215
|
if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === BigInt(0))) {
|
|
2216
|
-
yield Create(ValueErrorType2.BigIntMultipleOf, schema,
|
|
2216
|
+
yield Create(ValueErrorType2.BigIntMultipleOf, schema, path4, value);
|
|
2217
2217
|
}
|
|
2218
2218
|
}
|
|
2219
|
-
function* TBoolean(schema, references,
|
|
2219
|
+
function* TBoolean(schema, references, path4, value) {
|
|
2220
2220
|
if (!(0, guard_1.IsBoolean)(value))
|
|
2221
|
-
yield Create(ValueErrorType2.Boolean, schema,
|
|
2221
|
+
yield Create(ValueErrorType2.Boolean, schema, path4, value);
|
|
2222
2222
|
}
|
|
2223
|
-
function* TConstructor(schema, references,
|
|
2224
|
-
yield* Visit(schema.returns, references,
|
|
2223
|
+
function* TConstructor(schema, references, path4, value) {
|
|
2224
|
+
yield* Visit(schema.returns, references, path4, value.prototype);
|
|
2225
2225
|
}
|
|
2226
|
-
function* TDate(schema, references,
|
|
2226
|
+
function* TDate(schema, references, path4, value) {
|
|
2227
2227
|
if (!(0, guard_1.IsDate)(value))
|
|
2228
|
-
return yield Create(ValueErrorType2.Date, schema,
|
|
2228
|
+
return yield Create(ValueErrorType2.Date, schema, path4, value);
|
|
2229
2229
|
if (IsDefined(schema.exclusiveMaximumTimestamp) && !(value.getTime() < schema.exclusiveMaximumTimestamp)) {
|
|
2230
|
-
yield Create(ValueErrorType2.DateExclusiveMaximumTimestamp, schema,
|
|
2230
|
+
yield Create(ValueErrorType2.DateExclusiveMaximumTimestamp, schema, path4, value);
|
|
2231
2231
|
}
|
|
2232
2232
|
if (IsDefined(schema.exclusiveMinimumTimestamp) && !(value.getTime() > schema.exclusiveMinimumTimestamp)) {
|
|
2233
|
-
yield Create(ValueErrorType2.DateExclusiveMinimumTimestamp, schema,
|
|
2233
|
+
yield Create(ValueErrorType2.DateExclusiveMinimumTimestamp, schema, path4, value);
|
|
2234
2234
|
}
|
|
2235
2235
|
if (IsDefined(schema.maximumTimestamp) && !(value.getTime() <= schema.maximumTimestamp)) {
|
|
2236
|
-
yield Create(ValueErrorType2.DateMaximumTimestamp, schema,
|
|
2236
|
+
yield Create(ValueErrorType2.DateMaximumTimestamp, schema, path4, value);
|
|
2237
2237
|
}
|
|
2238
2238
|
if (IsDefined(schema.minimumTimestamp) && !(value.getTime() >= schema.minimumTimestamp)) {
|
|
2239
|
-
yield Create(ValueErrorType2.DateMinimumTimestamp, schema,
|
|
2239
|
+
yield Create(ValueErrorType2.DateMinimumTimestamp, schema, path4, value);
|
|
2240
2240
|
}
|
|
2241
2241
|
if (IsDefined(schema.multipleOfTimestamp) && !(value.getTime() % schema.multipleOfTimestamp === 0)) {
|
|
2242
|
-
yield Create(ValueErrorType2.DateMultipleOfTimestamp, schema,
|
|
2242
|
+
yield Create(ValueErrorType2.DateMultipleOfTimestamp, schema, path4, value);
|
|
2243
2243
|
}
|
|
2244
2244
|
}
|
|
2245
|
-
function* TFunction(schema, references,
|
|
2245
|
+
function* TFunction(schema, references, path4, value) {
|
|
2246
2246
|
if (!(0, guard_1.IsFunction)(value))
|
|
2247
|
-
yield Create(ValueErrorType2.Function, schema,
|
|
2247
|
+
yield Create(ValueErrorType2.Function, schema, path4, value);
|
|
2248
2248
|
}
|
|
2249
|
-
function* TInteger(schema, references,
|
|
2249
|
+
function* TInteger(schema, references, path4, value) {
|
|
2250
2250
|
if (!(0, guard_1.IsInteger)(value))
|
|
2251
|
-
return yield Create(ValueErrorType2.Integer, schema,
|
|
2251
|
+
return yield Create(ValueErrorType2.Integer, schema, path4, value);
|
|
2252
2252
|
if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) {
|
|
2253
|
-
yield Create(ValueErrorType2.IntegerExclusiveMaximum, schema,
|
|
2253
|
+
yield Create(ValueErrorType2.IntegerExclusiveMaximum, schema, path4, value);
|
|
2254
2254
|
}
|
|
2255
2255
|
if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) {
|
|
2256
|
-
yield Create(ValueErrorType2.IntegerExclusiveMinimum, schema,
|
|
2256
|
+
yield Create(ValueErrorType2.IntegerExclusiveMinimum, schema, path4, value);
|
|
2257
2257
|
}
|
|
2258
2258
|
if (IsDefined(schema.maximum) && !(value <= schema.maximum)) {
|
|
2259
|
-
yield Create(ValueErrorType2.IntegerMaximum, schema,
|
|
2259
|
+
yield Create(ValueErrorType2.IntegerMaximum, schema, path4, value);
|
|
2260
2260
|
}
|
|
2261
2261
|
if (IsDefined(schema.minimum) && !(value >= schema.minimum)) {
|
|
2262
|
-
yield Create(ValueErrorType2.IntegerMinimum, schema,
|
|
2262
|
+
yield Create(ValueErrorType2.IntegerMinimum, schema, path4, value);
|
|
2263
2263
|
}
|
|
2264
2264
|
if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === 0)) {
|
|
2265
|
-
yield Create(ValueErrorType2.IntegerMultipleOf, schema,
|
|
2265
|
+
yield Create(ValueErrorType2.IntegerMultipleOf, schema, path4, value);
|
|
2266
2266
|
}
|
|
2267
2267
|
}
|
|
2268
|
-
function* TIntersect(schema, references,
|
|
2268
|
+
function* TIntersect(schema, references, path4, value) {
|
|
2269
2269
|
for (const inner of schema.allOf) {
|
|
2270
|
-
const next = Visit(inner, references,
|
|
2270
|
+
const next = Visit(inner, references, path4, value).next();
|
|
2271
2271
|
if (!next.done) {
|
|
2272
|
-
yield Create(ValueErrorType2.Intersect, schema,
|
|
2272
|
+
yield Create(ValueErrorType2.Intersect, schema, path4, value);
|
|
2273
2273
|
yield next.value;
|
|
2274
2274
|
}
|
|
2275
2275
|
}
|
|
@@ -2277,7 +2277,7 @@ var require_errors = __commonJS({
|
|
|
2277
2277
|
const keyCheck = new RegExp(Types.KeyResolver.ResolvePattern(schema));
|
|
2278
2278
|
for (const valueKey of Object.getOwnPropertyNames(value)) {
|
|
2279
2279
|
if (!keyCheck.test(valueKey)) {
|
|
2280
|
-
yield Create(ValueErrorType2.IntersectUnevaluatedProperties, schema, `${
|
|
2280
|
+
yield Create(ValueErrorType2.IntersectUnevaluatedProperties, schema, `${path4}/${valueKey}`, value);
|
|
2281
2281
|
}
|
|
2282
2282
|
}
|
|
2283
2283
|
}
|
|
@@ -2285,59 +2285,59 @@ var require_errors = __commonJS({
|
|
|
2285
2285
|
const keyCheck = new RegExp(Types.KeyResolver.ResolvePattern(schema));
|
|
2286
2286
|
for (const valueKey of Object.getOwnPropertyNames(value)) {
|
|
2287
2287
|
if (!keyCheck.test(valueKey)) {
|
|
2288
|
-
const next = Visit(schema.unevaluatedProperties, references, `${
|
|
2288
|
+
const next = Visit(schema.unevaluatedProperties, references, `${path4}/${valueKey}`, value[valueKey]).next();
|
|
2289
2289
|
if (!next.done)
|
|
2290
2290
|
yield next.value;
|
|
2291
2291
|
}
|
|
2292
2292
|
}
|
|
2293
2293
|
}
|
|
2294
2294
|
}
|
|
2295
|
-
function* TIterator(schema, references,
|
|
2295
|
+
function* TIterator(schema, references, path4, value) {
|
|
2296
2296
|
if (!(0, guard_1.IsIterator)(value))
|
|
2297
|
-
yield Create(ValueErrorType2.Iterator, schema,
|
|
2297
|
+
yield Create(ValueErrorType2.Iterator, schema, path4, value);
|
|
2298
2298
|
}
|
|
2299
|
-
function* TLiteral(schema, references,
|
|
2299
|
+
function* TLiteral(schema, references, path4, value) {
|
|
2300
2300
|
if (!(value === schema.const))
|
|
2301
|
-
yield Create(ValueErrorType2.Literal, schema,
|
|
2301
|
+
yield Create(ValueErrorType2.Literal, schema, path4, value);
|
|
2302
2302
|
}
|
|
2303
|
-
function* TNever(schema, references,
|
|
2304
|
-
yield Create(ValueErrorType2.Never, schema,
|
|
2303
|
+
function* TNever(schema, references, path4, value) {
|
|
2304
|
+
yield Create(ValueErrorType2.Never, schema, path4, value);
|
|
2305
2305
|
}
|
|
2306
|
-
function* TNot(schema, references,
|
|
2307
|
-
if (Visit(schema.not, references,
|
|
2308
|
-
yield Create(ValueErrorType2.Not, schema,
|
|
2306
|
+
function* TNot(schema, references, path4, value) {
|
|
2307
|
+
if (Visit(schema.not, references, path4, value).next().done === true)
|
|
2308
|
+
yield Create(ValueErrorType2.Not, schema, path4, value);
|
|
2309
2309
|
}
|
|
2310
|
-
function* TNull(schema, references,
|
|
2310
|
+
function* TNull(schema, references, path4, value) {
|
|
2311
2311
|
if (!(0, guard_1.IsNull)(value))
|
|
2312
|
-
yield Create(ValueErrorType2.Null, schema,
|
|
2312
|
+
yield Create(ValueErrorType2.Null, schema, path4, value);
|
|
2313
2313
|
}
|
|
2314
|
-
function* TNumber(schema, references,
|
|
2314
|
+
function* TNumber(schema, references, path4, value) {
|
|
2315
2315
|
if (!system_1.TypeSystemPolicy.IsNumberLike(value))
|
|
2316
|
-
return yield Create(ValueErrorType2.Number, schema,
|
|
2316
|
+
return yield Create(ValueErrorType2.Number, schema, path4, value);
|
|
2317
2317
|
if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) {
|
|
2318
|
-
yield Create(ValueErrorType2.NumberExclusiveMaximum, schema,
|
|
2318
|
+
yield Create(ValueErrorType2.NumberExclusiveMaximum, schema, path4, value);
|
|
2319
2319
|
}
|
|
2320
2320
|
if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) {
|
|
2321
|
-
yield Create(ValueErrorType2.NumberExclusiveMinimum, schema,
|
|
2321
|
+
yield Create(ValueErrorType2.NumberExclusiveMinimum, schema, path4, value);
|
|
2322
2322
|
}
|
|
2323
2323
|
if (IsDefined(schema.maximum) && !(value <= schema.maximum)) {
|
|
2324
|
-
yield Create(ValueErrorType2.NumberMaximum, schema,
|
|
2324
|
+
yield Create(ValueErrorType2.NumberMaximum, schema, path4, value);
|
|
2325
2325
|
}
|
|
2326
2326
|
if (IsDefined(schema.minimum) && !(value >= schema.minimum)) {
|
|
2327
|
-
yield Create(ValueErrorType2.NumberMinimum, schema,
|
|
2327
|
+
yield Create(ValueErrorType2.NumberMinimum, schema, path4, value);
|
|
2328
2328
|
}
|
|
2329
2329
|
if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === 0)) {
|
|
2330
|
-
yield Create(ValueErrorType2.NumberMultipleOf, schema,
|
|
2330
|
+
yield Create(ValueErrorType2.NumberMultipleOf, schema, path4, value);
|
|
2331
2331
|
}
|
|
2332
2332
|
}
|
|
2333
|
-
function* TObject(schema, references,
|
|
2333
|
+
function* TObject(schema, references, path4, value) {
|
|
2334
2334
|
if (!system_1.TypeSystemPolicy.IsObjectLike(value))
|
|
2335
|
-
return yield Create(ValueErrorType2.Object, schema,
|
|
2335
|
+
return yield Create(ValueErrorType2.Object, schema, path4, value);
|
|
2336
2336
|
if (IsDefined(schema.minProperties) && !(Object.getOwnPropertyNames(value).length >= schema.minProperties)) {
|
|
2337
|
-
yield Create(ValueErrorType2.ObjectMinProperties, schema,
|
|
2337
|
+
yield Create(ValueErrorType2.ObjectMinProperties, schema, path4, value);
|
|
2338
2338
|
}
|
|
2339
2339
|
if (IsDefined(schema.maxProperties) && !(Object.getOwnPropertyNames(value).length <= schema.maxProperties)) {
|
|
2340
|
-
yield Create(ValueErrorType2.ObjectMaxProperties, schema,
|
|
2340
|
+
yield Create(ValueErrorType2.ObjectMaxProperties, schema, path4, value);
|
|
2341
2341
|
}
|
|
2342
2342
|
const requiredKeys = Array.isArray(schema.required) ? schema.required : [];
|
|
2343
2343
|
const knownKeys = Object.getOwnPropertyNames(schema.properties);
|
|
@@ -2345,12 +2345,12 @@ var require_errors = __commonJS({
|
|
|
2345
2345
|
for (const requiredKey of requiredKeys) {
|
|
2346
2346
|
if (unknownKeys.includes(requiredKey))
|
|
2347
2347
|
continue;
|
|
2348
|
-
yield Create(ValueErrorType2.ObjectRequiredProperty, schema.properties[requiredKey], `${
|
|
2348
|
+
yield Create(ValueErrorType2.ObjectRequiredProperty, schema.properties[requiredKey], `${path4}/${EscapeKey(requiredKey)}`, void 0);
|
|
2349
2349
|
}
|
|
2350
2350
|
if (schema.additionalProperties === false) {
|
|
2351
2351
|
for (const valueKey of unknownKeys) {
|
|
2352
2352
|
if (!knownKeys.includes(valueKey)) {
|
|
2353
|
-
yield Create(ValueErrorType2.ObjectAdditionalProperties, schema, `${
|
|
2353
|
+
yield Create(ValueErrorType2.ObjectAdditionalProperties, schema, `${path4}/${EscapeKey(valueKey)}`, value[valueKey]);
|
|
2354
2354
|
}
|
|
2355
2355
|
}
|
|
2356
2356
|
}
|
|
@@ -2358,221 +2358,221 @@ var require_errors = __commonJS({
|
|
|
2358
2358
|
for (const valueKey of unknownKeys) {
|
|
2359
2359
|
if (knownKeys.includes(valueKey))
|
|
2360
2360
|
continue;
|
|
2361
|
-
yield* Visit(schema.additionalProperties, references, `${
|
|
2361
|
+
yield* Visit(schema.additionalProperties, references, `${path4}/${EscapeKey(valueKey)}`, value[valueKey]);
|
|
2362
2362
|
}
|
|
2363
2363
|
}
|
|
2364
2364
|
for (const knownKey of knownKeys) {
|
|
2365
2365
|
const property = schema.properties[knownKey];
|
|
2366
2366
|
if (schema.required && schema.required.includes(knownKey)) {
|
|
2367
|
-
yield* Visit(property, references, `${
|
|
2367
|
+
yield* Visit(property, references, `${path4}/${EscapeKey(knownKey)}`, value[knownKey]);
|
|
2368
2368
|
if (Types.ExtendsUndefined.Check(schema) && !(knownKey in value)) {
|
|
2369
|
-
yield Create(ValueErrorType2.ObjectRequiredProperty, property, `${
|
|
2369
|
+
yield Create(ValueErrorType2.ObjectRequiredProperty, property, `${path4}/${EscapeKey(knownKey)}`, void 0);
|
|
2370
2370
|
}
|
|
2371
2371
|
} else {
|
|
2372
2372
|
if (system_1.TypeSystemPolicy.IsExactOptionalProperty(value, knownKey)) {
|
|
2373
|
-
yield* Visit(property, references, `${
|
|
2373
|
+
yield* Visit(property, references, `${path4}/${EscapeKey(knownKey)}`, value[knownKey]);
|
|
2374
2374
|
}
|
|
2375
2375
|
}
|
|
2376
2376
|
}
|
|
2377
2377
|
}
|
|
2378
|
-
function* TPromise(schema, references,
|
|
2378
|
+
function* TPromise(schema, references, path4, value) {
|
|
2379
2379
|
if (!(0, guard_1.IsPromise)(value))
|
|
2380
|
-
yield Create(ValueErrorType2.Promise, schema,
|
|
2380
|
+
yield Create(ValueErrorType2.Promise, schema, path4, value);
|
|
2381
2381
|
}
|
|
2382
|
-
function* TRecord(schema, references,
|
|
2382
|
+
function* TRecord(schema, references, path4, value) {
|
|
2383
2383
|
if (!system_1.TypeSystemPolicy.IsRecordLike(value))
|
|
2384
|
-
return yield Create(ValueErrorType2.Object, schema,
|
|
2384
|
+
return yield Create(ValueErrorType2.Object, schema, path4, value);
|
|
2385
2385
|
if (IsDefined(schema.minProperties) && !(Object.getOwnPropertyNames(value).length >= schema.minProperties)) {
|
|
2386
|
-
yield Create(ValueErrorType2.ObjectMinProperties, schema,
|
|
2386
|
+
yield Create(ValueErrorType2.ObjectMinProperties, schema, path4, value);
|
|
2387
2387
|
}
|
|
2388
2388
|
if (IsDefined(schema.maxProperties) && !(Object.getOwnPropertyNames(value).length <= schema.maxProperties)) {
|
|
2389
|
-
yield Create(ValueErrorType2.ObjectMaxProperties, schema,
|
|
2389
|
+
yield Create(ValueErrorType2.ObjectMaxProperties, schema, path4, value);
|
|
2390
2390
|
}
|
|
2391
2391
|
const [patternKey, patternSchema] = Object.entries(schema.patternProperties)[0];
|
|
2392
2392
|
const regex = new RegExp(patternKey);
|
|
2393
2393
|
for (const [propertyKey, propertyValue] of Object.entries(value)) {
|
|
2394
2394
|
if (regex.test(propertyKey))
|
|
2395
|
-
yield* Visit(patternSchema, references, `${
|
|
2395
|
+
yield* Visit(patternSchema, references, `${path4}/${EscapeKey(propertyKey)}`, propertyValue);
|
|
2396
2396
|
}
|
|
2397
2397
|
if (typeof schema.additionalProperties === "object") {
|
|
2398
2398
|
for (const [propertyKey, propertyValue] of Object.entries(value)) {
|
|
2399
2399
|
if (!regex.test(propertyKey))
|
|
2400
|
-
yield* Visit(schema.additionalProperties, references, `${
|
|
2400
|
+
yield* Visit(schema.additionalProperties, references, `${path4}/${EscapeKey(propertyKey)}`, propertyValue);
|
|
2401
2401
|
}
|
|
2402
2402
|
}
|
|
2403
2403
|
if (schema.additionalProperties === false) {
|
|
2404
2404
|
for (const [propertyKey, propertyValue] of Object.entries(value)) {
|
|
2405
2405
|
if (regex.test(propertyKey))
|
|
2406
2406
|
continue;
|
|
2407
|
-
return yield Create(ValueErrorType2.ObjectAdditionalProperties, schema, `${
|
|
2407
|
+
return yield Create(ValueErrorType2.ObjectAdditionalProperties, schema, `${path4}/${EscapeKey(propertyKey)}`, propertyValue);
|
|
2408
2408
|
}
|
|
2409
2409
|
}
|
|
2410
2410
|
}
|
|
2411
|
-
function* TRef(schema, references,
|
|
2412
|
-
yield* Visit((0, deref_1.Deref)(schema, references), references,
|
|
2411
|
+
function* TRef(schema, references, path4, value) {
|
|
2412
|
+
yield* Visit((0, deref_1.Deref)(schema, references), references, path4, value);
|
|
2413
2413
|
}
|
|
2414
|
-
function* TString(schema, references,
|
|
2414
|
+
function* TString(schema, references, path4, value) {
|
|
2415
2415
|
if (!(0, guard_1.IsString)(value))
|
|
2416
|
-
return yield Create(ValueErrorType2.String, schema,
|
|
2416
|
+
return yield Create(ValueErrorType2.String, schema, path4, value);
|
|
2417
2417
|
if (IsDefined(schema.minLength) && !(value.length >= schema.minLength)) {
|
|
2418
|
-
yield Create(ValueErrorType2.StringMinLength, schema,
|
|
2418
|
+
yield Create(ValueErrorType2.StringMinLength, schema, path4, value);
|
|
2419
2419
|
}
|
|
2420
2420
|
if (IsDefined(schema.maxLength) && !(value.length <= schema.maxLength)) {
|
|
2421
|
-
yield Create(ValueErrorType2.StringMaxLength, schema,
|
|
2421
|
+
yield Create(ValueErrorType2.StringMaxLength, schema, path4, value);
|
|
2422
2422
|
}
|
|
2423
2423
|
if ((0, guard_1.IsString)(schema.pattern)) {
|
|
2424
2424
|
const regex = new RegExp(schema.pattern);
|
|
2425
2425
|
if (!regex.test(value)) {
|
|
2426
|
-
yield Create(ValueErrorType2.StringPattern, schema,
|
|
2426
|
+
yield Create(ValueErrorType2.StringPattern, schema, path4, value);
|
|
2427
2427
|
}
|
|
2428
2428
|
}
|
|
2429
2429
|
if ((0, guard_1.IsString)(schema.format)) {
|
|
2430
2430
|
if (!Types.FormatRegistry.Has(schema.format)) {
|
|
2431
|
-
yield Create(ValueErrorType2.StringFormatUnknown, schema,
|
|
2431
|
+
yield Create(ValueErrorType2.StringFormatUnknown, schema, path4, value);
|
|
2432
2432
|
} else {
|
|
2433
2433
|
const format = Types.FormatRegistry.Get(schema.format);
|
|
2434
2434
|
if (!format(value)) {
|
|
2435
|
-
yield Create(ValueErrorType2.StringFormat, schema,
|
|
2435
|
+
yield Create(ValueErrorType2.StringFormat, schema, path4, value);
|
|
2436
2436
|
}
|
|
2437
2437
|
}
|
|
2438
2438
|
}
|
|
2439
2439
|
}
|
|
2440
|
-
function* TSymbol(schema, references,
|
|
2440
|
+
function* TSymbol(schema, references, path4, value) {
|
|
2441
2441
|
if (!(0, guard_1.IsSymbol)(value))
|
|
2442
|
-
yield Create(ValueErrorType2.Symbol, schema,
|
|
2442
|
+
yield Create(ValueErrorType2.Symbol, schema, path4, value);
|
|
2443
2443
|
}
|
|
2444
|
-
function* TTemplateLiteral(schema, references,
|
|
2444
|
+
function* TTemplateLiteral(schema, references, path4, value) {
|
|
2445
2445
|
if (!(0, guard_1.IsString)(value))
|
|
2446
|
-
return yield Create(ValueErrorType2.String, schema,
|
|
2446
|
+
return yield Create(ValueErrorType2.String, schema, path4, value);
|
|
2447
2447
|
const regex = new RegExp(schema.pattern);
|
|
2448
2448
|
if (!regex.test(value)) {
|
|
2449
|
-
yield Create(ValueErrorType2.StringPattern, schema,
|
|
2449
|
+
yield Create(ValueErrorType2.StringPattern, schema, path4, value);
|
|
2450
2450
|
}
|
|
2451
2451
|
}
|
|
2452
|
-
function* TThis(schema, references,
|
|
2453
|
-
yield* Visit((0, deref_1.Deref)(schema, references), references,
|
|
2452
|
+
function* TThis(schema, references, path4, value) {
|
|
2453
|
+
yield* Visit((0, deref_1.Deref)(schema, references), references, path4, value);
|
|
2454
2454
|
}
|
|
2455
|
-
function* TTuple(schema, references,
|
|
2455
|
+
function* TTuple(schema, references, path4, value) {
|
|
2456
2456
|
if (!(0, guard_1.IsArray)(value))
|
|
2457
|
-
return yield Create(ValueErrorType2.Tuple, schema,
|
|
2457
|
+
return yield Create(ValueErrorType2.Tuple, schema, path4, value);
|
|
2458
2458
|
if (schema.items === void 0 && !(value.length === 0)) {
|
|
2459
|
-
return yield Create(ValueErrorType2.TupleLength, schema,
|
|
2459
|
+
return yield Create(ValueErrorType2.TupleLength, schema, path4, value);
|
|
2460
2460
|
}
|
|
2461
2461
|
if (!(value.length === schema.maxItems)) {
|
|
2462
|
-
return yield Create(ValueErrorType2.TupleLength, schema,
|
|
2462
|
+
return yield Create(ValueErrorType2.TupleLength, schema, path4, value);
|
|
2463
2463
|
}
|
|
2464
2464
|
if (!schema.items) {
|
|
2465
2465
|
return;
|
|
2466
2466
|
}
|
|
2467
2467
|
for (let i2 = 0; i2 < schema.items.length; i2++) {
|
|
2468
|
-
yield* Visit(schema.items[i2], references, `${
|
|
2468
|
+
yield* Visit(schema.items[i2], references, `${path4}/${i2}`, value[i2]);
|
|
2469
2469
|
}
|
|
2470
2470
|
}
|
|
2471
|
-
function* TUndefined(schema, references,
|
|
2471
|
+
function* TUndefined(schema, references, path4, value) {
|
|
2472
2472
|
if (!(0, guard_1.IsUndefined)(value))
|
|
2473
|
-
yield Create(ValueErrorType2.Undefined, schema,
|
|
2473
|
+
yield Create(ValueErrorType2.Undefined, schema, path4, value);
|
|
2474
2474
|
}
|
|
2475
|
-
function* TUnion(schema, references,
|
|
2475
|
+
function* TUnion(schema, references, path4, value) {
|
|
2476
2476
|
let count = 0;
|
|
2477
2477
|
for (const subschema of schema.anyOf) {
|
|
2478
|
-
const errors = [...Visit(subschema, references,
|
|
2478
|
+
const errors = [...Visit(subschema, references, path4, value)];
|
|
2479
2479
|
if (errors.length === 0)
|
|
2480
2480
|
return;
|
|
2481
2481
|
count += errors.length;
|
|
2482
2482
|
}
|
|
2483
2483
|
if (count > 0) {
|
|
2484
|
-
yield Create(ValueErrorType2.Union, schema,
|
|
2484
|
+
yield Create(ValueErrorType2.Union, schema, path4, value);
|
|
2485
2485
|
}
|
|
2486
2486
|
}
|
|
2487
|
-
function* TUint8Array(schema, references,
|
|
2487
|
+
function* TUint8Array(schema, references, path4, value) {
|
|
2488
2488
|
if (!(0, guard_1.IsUint8Array)(value))
|
|
2489
|
-
return yield Create(ValueErrorType2.Uint8Array, schema,
|
|
2489
|
+
return yield Create(ValueErrorType2.Uint8Array, schema, path4, value);
|
|
2490
2490
|
if (IsDefined(schema.maxByteLength) && !(value.length <= schema.maxByteLength)) {
|
|
2491
|
-
yield Create(ValueErrorType2.Uint8ArrayMaxByteLength, schema,
|
|
2491
|
+
yield Create(ValueErrorType2.Uint8ArrayMaxByteLength, schema, path4, value);
|
|
2492
2492
|
}
|
|
2493
2493
|
if (IsDefined(schema.minByteLength) && !(value.length >= schema.minByteLength)) {
|
|
2494
|
-
yield Create(ValueErrorType2.Uint8ArrayMinByteLength, schema,
|
|
2494
|
+
yield Create(ValueErrorType2.Uint8ArrayMinByteLength, schema, path4, value);
|
|
2495
2495
|
}
|
|
2496
2496
|
}
|
|
2497
|
-
function* TUnknown(schema, references,
|
|
2497
|
+
function* TUnknown(schema, references, path4, value) {
|
|
2498
2498
|
}
|
|
2499
|
-
function* TVoid(schema, references,
|
|
2499
|
+
function* TVoid(schema, references, path4, value) {
|
|
2500
2500
|
if (!system_1.TypeSystemPolicy.IsVoidLike(value))
|
|
2501
|
-
yield Create(ValueErrorType2.Void, schema,
|
|
2501
|
+
yield Create(ValueErrorType2.Void, schema, path4, value);
|
|
2502
2502
|
}
|
|
2503
|
-
function* TKind(schema, references,
|
|
2503
|
+
function* TKind(schema, references, path4, value) {
|
|
2504
2504
|
const check = Types.TypeRegistry.Get(schema[Types.Kind]);
|
|
2505
2505
|
if (!check(schema, value))
|
|
2506
|
-
yield Create(ValueErrorType2.Kind, schema,
|
|
2506
|
+
yield Create(ValueErrorType2.Kind, schema, path4, value);
|
|
2507
2507
|
}
|
|
2508
|
-
function* Visit(schema, references,
|
|
2508
|
+
function* Visit(schema, references, path4, value) {
|
|
2509
2509
|
const references_ = IsDefined(schema.$id) ? [...references, schema] : references;
|
|
2510
2510
|
const schema_ = schema;
|
|
2511
2511
|
switch (schema_[Types.Kind]) {
|
|
2512
2512
|
case "Any":
|
|
2513
|
-
return yield* TAny(schema_, references_,
|
|
2513
|
+
return yield* TAny(schema_, references_, path4, value);
|
|
2514
2514
|
case "Array":
|
|
2515
|
-
return yield* TArray(schema_, references_,
|
|
2515
|
+
return yield* TArray(schema_, references_, path4, value);
|
|
2516
2516
|
case "AsyncIterator":
|
|
2517
|
-
return yield* TAsyncIterator(schema_, references_,
|
|
2517
|
+
return yield* TAsyncIterator(schema_, references_, path4, value);
|
|
2518
2518
|
case "BigInt":
|
|
2519
|
-
return yield* TBigInt(schema_, references_,
|
|
2519
|
+
return yield* TBigInt(schema_, references_, path4, value);
|
|
2520
2520
|
case "Boolean":
|
|
2521
|
-
return yield* TBoolean(schema_, references_,
|
|
2521
|
+
return yield* TBoolean(schema_, references_, path4, value);
|
|
2522
2522
|
case "Constructor":
|
|
2523
|
-
return yield* TConstructor(schema_, references_,
|
|
2523
|
+
return yield* TConstructor(schema_, references_, path4, value);
|
|
2524
2524
|
case "Date":
|
|
2525
|
-
return yield* TDate(schema_, references_,
|
|
2525
|
+
return yield* TDate(schema_, references_, path4, value);
|
|
2526
2526
|
case "Function":
|
|
2527
|
-
return yield* TFunction(schema_, references_,
|
|
2527
|
+
return yield* TFunction(schema_, references_, path4, value);
|
|
2528
2528
|
case "Integer":
|
|
2529
|
-
return yield* TInteger(schema_, references_,
|
|
2529
|
+
return yield* TInteger(schema_, references_, path4, value);
|
|
2530
2530
|
case "Intersect":
|
|
2531
|
-
return yield* TIntersect(schema_, references_,
|
|
2531
|
+
return yield* TIntersect(schema_, references_, path4, value);
|
|
2532
2532
|
case "Iterator":
|
|
2533
|
-
return yield* TIterator(schema_, references_,
|
|
2533
|
+
return yield* TIterator(schema_, references_, path4, value);
|
|
2534
2534
|
case "Literal":
|
|
2535
|
-
return yield* TLiteral(schema_, references_,
|
|
2535
|
+
return yield* TLiteral(schema_, references_, path4, value);
|
|
2536
2536
|
case "Never":
|
|
2537
|
-
return yield* TNever(schema_, references_,
|
|
2537
|
+
return yield* TNever(schema_, references_, path4, value);
|
|
2538
2538
|
case "Not":
|
|
2539
|
-
return yield* TNot(schema_, references_,
|
|
2539
|
+
return yield* TNot(schema_, references_, path4, value);
|
|
2540
2540
|
case "Null":
|
|
2541
|
-
return yield* TNull(schema_, references_,
|
|
2541
|
+
return yield* TNull(schema_, references_, path4, value);
|
|
2542
2542
|
case "Number":
|
|
2543
|
-
return yield* TNumber(schema_, references_,
|
|
2543
|
+
return yield* TNumber(schema_, references_, path4, value);
|
|
2544
2544
|
case "Object":
|
|
2545
|
-
return yield* TObject(schema_, references_,
|
|
2545
|
+
return yield* TObject(schema_, references_, path4, value);
|
|
2546
2546
|
case "Promise":
|
|
2547
|
-
return yield* TPromise(schema_, references_,
|
|
2547
|
+
return yield* TPromise(schema_, references_, path4, value);
|
|
2548
2548
|
case "Record":
|
|
2549
|
-
return yield* TRecord(schema_, references_,
|
|
2549
|
+
return yield* TRecord(schema_, references_, path4, value);
|
|
2550
2550
|
case "Ref":
|
|
2551
|
-
return yield* TRef(schema_, references_,
|
|
2551
|
+
return yield* TRef(schema_, references_, path4, value);
|
|
2552
2552
|
case "String":
|
|
2553
|
-
return yield* TString(schema_, references_,
|
|
2553
|
+
return yield* TString(schema_, references_, path4, value);
|
|
2554
2554
|
case "Symbol":
|
|
2555
|
-
return yield* TSymbol(schema_, references_,
|
|
2555
|
+
return yield* TSymbol(schema_, references_, path4, value);
|
|
2556
2556
|
case "TemplateLiteral":
|
|
2557
|
-
return yield* TTemplateLiteral(schema_, references_,
|
|
2557
|
+
return yield* TTemplateLiteral(schema_, references_, path4, value);
|
|
2558
2558
|
case "This":
|
|
2559
|
-
return yield* TThis(schema_, references_,
|
|
2559
|
+
return yield* TThis(schema_, references_, path4, value);
|
|
2560
2560
|
case "Tuple":
|
|
2561
|
-
return yield* TTuple(schema_, references_,
|
|
2561
|
+
return yield* TTuple(schema_, references_, path4, value);
|
|
2562
2562
|
case "Undefined":
|
|
2563
|
-
return yield* TUndefined(schema_, references_,
|
|
2563
|
+
return yield* TUndefined(schema_, references_, path4, value);
|
|
2564
2564
|
case "Union":
|
|
2565
|
-
return yield* TUnion(schema_, references_,
|
|
2565
|
+
return yield* TUnion(schema_, references_, path4, value);
|
|
2566
2566
|
case "Uint8Array":
|
|
2567
|
-
return yield* TUint8Array(schema_, references_,
|
|
2567
|
+
return yield* TUint8Array(schema_, references_, path4, value);
|
|
2568
2568
|
case "Unknown":
|
|
2569
|
-
return yield* TUnknown(schema_, references_,
|
|
2569
|
+
return yield* TUnknown(schema_, references_, path4, value);
|
|
2570
2570
|
case "Void":
|
|
2571
|
-
return yield* TVoid(schema_, references_,
|
|
2571
|
+
return yield* TVoid(schema_, references_, path4, value);
|
|
2572
2572
|
default:
|
|
2573
2573
|
if (!Types.TypeRegistry.Has(schema_[Types.Kind]))
|
|
2574
2574
|
throw new ValueErrorsUnknownTypeError(schema);
|
|
2575
|
-
return yield* TKind(schema_, references_,
|
|
2575
|
+
return yield* TKind(schema_, references_, path4, value);
|
|
2576
2576
|
}
|
|
2577
2577
|
}
|
|
2578
2578
|
function Errors(...args) {
|
|
@@ -2621,19 +2621,19 @@ var require_pointer = __commonJS({
|
|
|
2621
2621
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2622
2622
|
exports.ValuePointer = exports.ValuePointerRootDeleteError = exports.ValuePointerRootSetError = void 0;
|
|
2623
2623
|
var ValuePointerRootSetError = class extends Error {
|
|
2624
|
-
constructor(value,
|
|
2624
|
+
constructor(value, path4, update) {
|
|
2625
2625
|
super("Cannot set root value");
|
|
2626
2626
|
this.value = value;
|
|
2627
|
-
this.path =
|
|
2627
|
+
this.path = path4;
|
|
2628
2628
|
this.update = update;
|
|
2629
2629
|
}
|
|
2630
2630
|
};
|
|
2631
2631
|
exports.ValuePointerRootSetError = ValuePointerRootSetError;
|
|
2632
2632
|
var ValuePointerRootDeleteError = class extends Error {
|
|
2633
|
-
constructor(value,
|
|
2633
|
+
constructor(value, path4) {
|
|
2634
2634
|
super("Cannot delete root value");
|
|
2635
2635
|
this.value = value;
|
|
2636
|
-
this.path =
|
|
2636
|
+
this.path = path4;
|
|
2637
2637
|
}
|
|
2638
2638
|
};
|
|
2639
2639
|
exports.ValuePointerRootDeleteError = ValuePointerRootDeleteError;
|
|
@@ -2807,84 +2807,84 @@ var require_delta = __commonJS({
|
|
|
2807
2807
|
}
|
|
2808
2808
|
};
|
|
2809
2809
|
exports.ValueDeltaUnableToDiffUnknownValue = ValueDeltaUnableToDiffUnknownValue;
|
|
2810
|
-
function CreateUpdate(
|
|
2811
|
-
return { type: "update", path:
|
|
2810
|
+
function CreateUpdate(path4, value) {
|
|
2811
|
+
return { type: "update", path: path4, value };
|
|
2812
2812
|
}
|
|
2813
|
-
function CreateInsert(
|
|
2814
|
-
return { type: "insert", path:
|
|
2813
|
+
function CreateInsert(path4, value) {
|
|
2814
|
+
return { type: "insert", path: path4, value };
|
|
2815
2815
|
}
|
|
2816
|
-
function CreateDelete(
|
|
2817
|
-
return { type: "delete", path:
|
|
2816
|
+
function CreateDelete(path4) {
|
|
2817
|
+
return { type: "delete", path: path4 };
|
|
2818
2818
|
}
|
|
2819
|
-
function* ObjectType(
|
|
2819
|
+
function* ObjectType(path4, current, next) {
|
|
2820
2820
|
if (!(0, guard_1.IsPlainObject)(next))
|
|
2821
|
-
return yield CreateUpdate(
|
|
2821
|
+
return yield CreateUpdate(path4, next);
|
|
2822
2822
|
const currentKeys = [...Object.keys(current), ...Object.getOwnPropertySymbols(current)];
|
|
2823
2823
|
const nextKeys = [...Object.keys(next), ...Object.getOwnPropertySymbols(next)];
|
|
2824
2824
|
for (const key of currentKeys) {
|
|
2825
2825
|
if ((0, guard_1.IsSymbol)(key))
|
|
2826
2826
|
throw new ValueDeltaObjectWithSymbolKeyError(key);
|
|
2827
2827
|
if ((0, guard_1.IsUndefined)(next[key]) && nextKeys.includes(key))
|
|
2828
|
-
yield CreateUpdate(`${
|
|
2828
|
+
yield CreateUpdate(`${path4}/${String(key)}`, void 0);
|
|
2829
2829
|
}
|
|
2830
2830
|
for (const key of nextKeys) {
|
|
2831
2831
|
if ((0, guard_1.IsUndefined)(current[key]) || (0, guard_1.IsUndefined)(next[key]))
|
|
2832
2832
|
continue;
|
|
2833
2833
|
if ((0, guard_1.IsSymbol)(key))
|
|
2834
2834
|
throw new ValueDeltaObjectWithSymbolKeyError(key);
|
|
2835
|
-
yield* Visit(`${
|
|
2835
|
+
yield* Visit(`${path4}/${String(key)}`, current[key], next[key]);
|
|
2836
2836
|
}
|
|
2837
2837
|
for (const key of nextKeys) {
|
|
2838
2838
|
if ((0, guard_1.IsSymbol)(key))
|
|
2839
2839
|
throw new ValueDeltaObjectWithSymbolKeyError(key);
|
|
2840
2840
|
if ((0, guard_1.IsUndefined)(current[key]))
|
|
2841
|
-
yield CreateInsert(`${
|
|
2841
|
+
yield CreateInsert(`${path4}/${String(key)}`, next[key]);
|
|
2842
2842
|
}
|
|
2843
2843
|
for (const key of currentKeys.reverse()) {
|
|
2844
2844
|
if ((0, guard_1.IsSymbol)(key))
|
|
2845
2845
|
throw new ValueDeltaObjectWithSymbolKeyError(key);
|
|
2846
2846
|
if ((0, guard_1.IsUndefined)(next[key]) && !nextKeys.includes(key))
|
|
2847
|
-
yield CreateDelete(`${
|
|
2847
|
+
yield CreateDelete(`${path4}/${String(key)}`);
|
|
2848
2848
|
}
|
|
2849
2849
|
}
|
|
2850
|
-
function* ArrayType(
|
|
2850
|
+
function* ArrayType(path4, current, next) {
|
|
2851
2851
|
if (!(0, guard_1.IsArray)(next))
|
|
2852
|
-
return yield CreateUpdate(
|
|
2852
|
+
return yield CreateUpdate(path4, next);
|
|
2853
2853
|
for (let i2 = 0; i2 < Math.min(current.length, next.length); i2++) {
|
|
2854
|
-
yield* Visit(`${
|
|
2854
|
+
yield* Visit(`${path4}/${i2}`, current[i2], next[i2]);
|
|
2855
2855
|
}
|
|
2856
2856
|
for (let i2 = 0; i2 < next.length; i2++) {
|
|
2857
2857
|
if (i2 < current.length)
|
|
2858
2858
|
continue;
|
|
2859
|
-
yield CreateInsert(`${
|
|
2859
|
+
yield CreateInsert(`${path4}/${i2}`, next[i2]);
|
|
2860
2860
|
}
|
|
2861
2861
|
for (let i2 = current.length - 1; i2 >= 0; i2--) {
|
|
2862
2862
|
if (i2 < next.length)
|
|
2863
2863
|
continue;
|
|
2864
|
-
yield CreateDelete(`${
|
|
2864
|
+
yield CreateDelete(`${path4}/${i2}`);
|
|
2865
2865
|
}
|
|
2866
2866
|
}
|
|
2867
|
-
function* TypedArrayType(
|
|
2867
|
+
function* TypedArrayType(path4, current, next) {
|
|
2868
2868
|
if (!(0, guard_1.IsTypedArray)(next) || current.length !== next.length || Object.getPrototypeOf(current).constructor.name !== Object.getPrototypeOf(next).constructor.name)
|
|
2869
|
-
return yield CreateUpdate(
|
|
2869
|
+
return yield CreateUpdate(path4, next);
|
|
2870
2870
|
for (let i2 = 0; i2 < Math.min(current.length, next.length); i2++) {
|
|
2871
|
-
yield* Visit(`${
|
|
2871
|
+
yield* Visit(`${path4}/${i2}`, current[i2], next[i2]);
|
|
2872
2872
|
}
|
|
2873
2873
|
}
|
|
2874
|
-
function* ValueType(
|
|
2874
|
+
function* ValueType(path4, current, next) {
|
|
2875
2875
|
if (current === next)
|
|
2876
2876
|
return;
|
|
2877
|
-
yield CreateUpdate(
|
|
2877
|
+
yield CreateUpdate(path4, next);
|
|
2878
2878
|
}
|
|
2879
|
-
function* Visit(
|
|
2879
|
+
function* Visit(path4, current, next) {
|
|
2880
2880
|
if ((0, guard_1.IsPlainObject)(current))
|
|
2881
|
-
return yield* ObjectType(
|
|
2881
|
+
return yield* ObjectType(path4, current, next);
|
|
2882
2882
|
if ((0, guard_1.IsArray)(current))
|
|
2883
|
-
return yield* ArrayType(
|
|
2883
|
+
return yield* ArrayType(path4, current, next);
|
|
2884
2884
|
if ((0, guard_1.IsTypedArray)(current))
|
|
2885
|
-
return yield* TypedArrayType(
|
|
2885
|
+
return yield* TypedArrayType(path4, current, next);
|
|
2886
2886
|
if ((0, guard_1.IsValueType)(current))
|
|
2887
|
-
return yield* ValueType(
|
|
2887
|
+
return yield* ValueType(path4, current, next);
|
|
2888
2888
|
throw new ValueDeltaUnableToDiffUnknownValue(current);
|
|
2889
2889
|
}
|
|
2890
2890
|
function Diff(current, next) {
|
|
@@ -2949,9 +2949,9 @@ var require_mutate = __commonJS({
|
|
|
2949
2949
|
}
|
|
2950
2950
|
};
|
|
2951
2951
|
exports.ValueMutateInvalidRootMutationError = ValueMutateInvalidRootMutationError;
|
|
2952
|
-
function ObjectType(root,
|
|
2952
|
+
function ObjectType(root, path4, current, next) {
|
|
2953
2953
|
if (!(0, guard_1.IsPlainObject)(current)) {
|
|
2954
|
-
pointer_1.ValuePointer.Set(root,
|
|
2954
|
+
pointer_1.ValuePointer.Set(root, path4, (0, clone_1.Clone)(next));
|
|
2955
2955
|
} else {
|
|
2956
2956
|
const currentKeys = Object.keys(current);
|
|
2957
2957
|
const nextKeys = Object.keys(next);
|
|
@@ -2966,43 +2966,43 @@ var require_mutate = __commonJS({
|
|
|
2966
2966
|
}
|
|
2967
2967
|
}
|
|
2968
2968
|
for (const nextKey of nextKeys) {
|
|
2969
|
-
Visit(root, `${
|
|
2969
|
+
Visit(root, `${path4}/${nextKey}`, current[nextKey], next[nextKey]);
|
|
2970
2970
|
}
|
|
2971
2971
|
}
|
|
2972
2972
|
}
|
|
2973
|
-
function ArrayType(root,
|
|
2973
|
+
function ArrayType(root, path4, current, next) {
|
|
2974
2974
|
if (!(0, guard_1.IsArray)(current)) {
|
|
2975
|
-
pointer_1.ValuePointer.Set(root,
|
|
2975
|
+
pointer_1.ValuePointer.Set(root, path4, (0, clone_1.Clone)(next));
|
|
2976
2976
|
} else {
|
|
2977
2977
|
for (let index = 0; index < next.length; index++) {
|
|
2978
|
-
Visit(root, `${
|
|
2978
|
+
Visit(root, `${path4}/${index}`, current[index], next[index]);
|
|
2979
2979
|
}
|
|
2980
2980
|
current.splice(next.length);
|
|
2981
2981
|
}
|
|
2982
2982
|
}
|
|
2983
|
-
function TypedArrayType(root,
|
|
2983
|
+
function TypedArrayType(root, path4, current, next) {
|
|
2984
2984
|
if ((0, guard_1.IsTypedArray)(current) && current.length === next.length) {
|
|
2985
2985
|
for (let i2 = 0; i2 < current.length; i2++) {
|
|
2986
2986
|
current[i2] = next[i2];
|
|
2987
2987
|
}
|
|
2988
2988
|
} else {
|
|
2989
|
-
pointer_1.ValuePointer.Set(root,
|
|
2989
|
+
pointer_1.ValuePointer.Set(root, path4, (0, clone_1.Clone)(next));
|
|
2990
2990
|
}
|
|
2991
2991
|
}
|
|
2992
|
-
function ValueType(root,
|
|
2992
|
+
function ValueType(root, path4, current, next) {
|
|
2993
2993
|
if (current === next)
|
|
2994
2994
|
return;
|
|
2995
|
-
pointer_1.ValuePointer.Set(root,
|
|
2995
|
+
pointer_1.ValuePointer.Set(root, path4, next);
|
|
2996
2996
|
}
|
|
2997
|
-
function Visit(root,
|
|
2997
|
+
function Visit(root, path4, current, next) {
|
|
2998
2998
|
if ((0, guard_1.IsArray)(next))
|
|
2999
|
-
return ArrayType(root,
|
|
2999
|
+
return ArrayType(root, path4, current, next);
|
|
3000
3000
|
if ((0, guard_1.IsTypedArray)(next))
|
|
3001
|
-
return TypedArrayType(root,
|
|
3001
|
+
return TypedArrayType(root, path4, current, next);
|
|
3002
3002
|
if ((0, guard_1.IsPlainObject)(next))
|
|
3003
|
-
return ObjectType(root,
|
|
3003
|
+
return ObjectType(root, path4, current, next);
|
|
3004
3004
|
if ((0, guard_1.IsValueType)(next))
|
|
3005
|
-
return ValueType(root,
|
|
3005
|
+
return ValueType(root, path4, current, next);
|
|
3006
3006
|
}
|
|
3007
3007
|
function IsNonMutableValue(value) {
|
|
3008
3008
|
return (0, guard_1.IsTypedArray)(value) || (0, guard_1.IsValueType)(value);
|
|
@@ -7225,7 +7225,7 @@ var require_dist_node10 = __commonJS({
|
|
|
7225
7225
|
});
|
|
7226
7226
|
module.exports = __toCommonJS(dist_src_exports);
|
|
7227
7227
|
var import_core3 = require_dist_node8();
|
|
7228
|
-
var generateMessage = (
|
|
7228
|
+
var generateMessage = (path4, cursorValue) => `The cursor at "${path4.join(
|
|
7229
7229
|
","
|
|
7230
7230
|
)}" did not change its value "${cursorValue}" after a page transition. Please make sure your that your query is set up correctly.`;
|
|
7231
7231
|
var MissingCursorChange = class extends Error {
|
|
@@ -7266,9 +7266,9 @@ var require_dist_node10 = __commonJS({
|
|
|
7266
7266
|
}
|
|
7267
7267
|
return paginatedResourcePath;
|
|
7268
7268
|
}
|
|
7269
|
-
var deepFindPathToProperty = (object, searchProp,
|
|
7269
|
+
var deepFindPathToProperty = (object, searchProp, path4 = []) => {
|
|
7270
7270
|
for (const key of Object.keys(object)) {
|
|
7271
|
-
const currentPath = [...
|
|
7271
|
+
const currentPath = [...path4, key];
|
|
7272
7272
|
const currentValue = object[key];
|
|
7273
7273
|
if (currentValue.hasOwnProperty(searchProp)) {
|
|
7274
7274
|
return currentPath;
|
|
@@ -7286,12 +7286,12 @@ var require_dist_node10 = __commonJS({
|
|
|
7286
7286
|
}
|
|
7287
7287
|
return [];
|
|
7288
7288
|
};
|
|
7289
|
-
var get = (object,
|
|
7290
|
-
return
|
|
7289
|
+
var get = (object, path4) => {
|
|
7290
|
+
return path4.reduce((current, nextProperty) => current[nextProperty], object);
|
|
7291
7291
|
};
|
|
7292
|
-
var set = (object,
|
|
7293
|
-
const lastProperty =
|
|
7294
|
-
const parentPath = [...
|
|
7292
|
+
var set = (object, path4, mutator) => {
|
|
7293
|
+
const lastProperty = path4[path4.length - 1];
|
|
7294
|
+
const parentPath = [...path4].slice(0, -1);
|
|
7295
7295
|
const parent = get(object, parentPath);
|
|
7296
7296
|
if (typeof mutator === "function") {
|
|
7297
7297
|
parent[lastProperty] = mutator(parent[lastProperty]);
|
|
@@ -7346,22 +7346,22 @@ var require_dist_node10 = __commonJS({
|
|
|
7346
7346
|
if (Object.keys(response1).length === 0) {
|
|
7347
7347
|
return Object.assign(response1, response2);
|
|
7348
7348
|
}
|
|
7349
|
-
const
|
|
7350
|
-
const nodesPath = [...
|
|
7349
|
+
const path4 = findPaginatedResourcePath(response1);
|
|
7350
|
+
const nodesPath = [...path4, "nodes"];
|
|
7351
7351
|
const newNodes = get(response2, nodesPath);
|
|
7352
7352
|
if (newNodes) {
|
|
7353
7353
|
set(response1, nodesPath, (values) => {
|
|
7354
7354
|
return [...values, ...newNodes];
|
|
7355
7355
|
});
|
|
7356
7356
|
}
|
|
7357
|
-
const edgesPath = [...
|
|
7357
|
+
const edgesPath = [...path4, "edges"];
|
|
7358
7358
|
const newEdges = get(response2, edgesPath);
|
|
7359
7359
|
if (newEdges) {
|
|
7360
7360
|
set(response1, edgesPath, (values) => {
|
|
7361
7361
|
return [...values, ...newEdges];
|
|
7362
7362
|
});
|
|
7363
7363
|
}
|
|
7364
|
-
const pageInfoPath = [...
|
|
7364
|
+
const pageInfoPath = [...path4, "pageInfo"];
|
|
7365
7365
|
set(response1, pageInfoPath, get(response2, pageInfoPath));
|
|
7366
7366
|
return response1;
|
|
7367
7367
|
};
|
|
@@ -11021,7 +11021,7 @@ var require_dist_node13 = __commonJS({
|
|
|
11021
11021
|
];
|
|
11022
11022
|
function routeMatcher(paths) {
|
|
11023
11023
|
const regexes = paths.map(
|
|
11024
|
-
(
|
|
11024
|
+
(path4) => path4.split("/").map((c) => c.startsWith("{") ? "(?:.+?)" : c).join("/")
|
|
11025
11025
|
);
|
|
11026
11026
|
const regex2 = `^(?:${regexes.map((r) => `(?:${r})`).join("|")})[^/]*$`;
|
|
11027
11027
|
return new RegExp(regex2, "i");
|
|
@@ -19935,11 +19935,11 @@ var require_dist_node24 = __commonJS({
|
|
|
19935
19935
|
}
|
|
19936
19936
|
}
|
|
19937
19937
|
function createNodeMiddleware2(webhooks, {
|
|
19938
|
-
path:
|
|
19938
|
+
path: path4 = "/api/github/webhooks",
|
|
19939
19939
|
log: log2 = createLogger()
|
|
19940
19940
|
} = {}) {
|
|
19941
19941
|
return middleware.bind(null, webhooks, {
|
|
19942
|
-
path:
|
|
19942
|
+
path: path4,
|
|
19943
19943
|
log: log2
|
|
19944
19944
|
});
|
|
19945
19945
|
}
|
|
@@ -20428,8 +20428,8 @@ var require_package = __commonJS({
|
|
|
20428
20428
|
var require_main = __commonJS({
|
|
20429
20429
|
"../../../../node_modules/.pnpm/dotenv@16.3.1/node_modules/dotenv/lib/main.js"(exports, module) {
|
|
20430
20430
|
init_define_ENV_DEFINED_IN_BUILD_STEP();
|
|
20431
|
-
var
|
|
20432
|
-
var
|
|
20431
|
+
var fs3 = __require("fs");
|
|
20432
|
+
var path4 = __require("path");
|
|
20433
20433
|
var os = __require("os");
|
|
20434
20434
|
var crypto3 = __require("crypto");
|
|
20435
20435
|
var packageJson = require_package();
|
|
@@ -20521,14 +20521,14 @@ var require_main = __commonJS({
|
|
|
20521
20521
|
return { ciphertext, key };
|
|
20522
20522
|
}
|
|
20523
20523
|
function _vaultPath(options) {
|
|
20524
|
-
let dotenvPath =
|
|
20524
|
+
let dotenvPath = path4.resolve(process.cwd(), ".env");
|
|
20525
20525
|
if (options && options.path && options.path.length > 0) {
|
|
20526
20526
|
dotenvPath = options.path;
|
|
20527
20527
|
}
|
|
20528
20528
|
return dotenvPath.endsWith(".vault") ? dotenvPath : `${dotenvPath}.vault`;
|
|
20529
20529
|
}
|
|
20530
20530
|
function _resolveHome(envPath) {
|
|
20531
|
-
return envPath[0] === "~" ?
|
|
20531
|
+
return envPath[0] === "~" ? path4.join(os.homedir(), envPath.slice(1)) : envPath;
|
|
20532
20532
|
}
|
|
20533
20533
|
function _configVault(options) {
|
|
20534
20534
|
_log("Loading env from encrypted .env.vault");
|
|
@@ -20541,7 +20541,7 @@ var require_main = __commonJS({
|
|
|
20541
20541
|
return { parsed };
|
|
20542
20542
|
}
|
|
20543
20543
|
function configDotenv(options) {
|
|
20544
|
-
let dotenvPath =
|
|
20544
|
+
let dotenvPath = path4.resolve(process.cwd(), ".env");
|
|
20545
20545
|
let encoding = "utf8";
|
|
20546
20546
|
const debug = Boolean(options && options.debug);
|
|
20547
20547
|
if (options) {
|
|
@@ -20553,7 +20553,7 @@ var require_main = __commonJS({
|
|
|
20553
20553
|
}
|
|
20554
20554
|
}
|
|
20555
20555
|
try {
|
|
20556
|
-
const parsed = DotenvModule.parse(
|
|
20556
|
+
const parsed = DotenvModule.parse(fs3.readFileSync(dotenvPath, { encoding }));
|
|
20557
20557
|
let processEnv = process.env;
|
|
20558
20558
|
if (options && options.processEnv != null) {
|
|
20559
20559
|
processEnv = options.processEnv;
|
|
@@ -20572,7 +20572,7 @@ var require_main = __commonJS({
|
|
|
20572
20572
|
if (_dotenvKey(options).length === 0) {
|
|
20573
20573
|
return DotenvModule.configDotenv(options);
|
|
20574
20574
|
}
|
|
20575
|
-
if (!
|
|
20575
|
+
if (!fs3.existsSync(vaultPath)) {
|
|
20576
20576
|
_warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
|
|
20577
20577
|
return DotenvModule.configDotenv(options);
|
|
20578
20578
|
}
|
|
@@ -22709,21 +22709,21 @@ init_define_ENV_DEFINED_IN_BUILD_STEP();
|
|
|
22709
22709
|
|
|
22710
22710
|
// ../../../../lix/source-code/fs/dist/utilities/helpers.js
|
|
22711
22711
|
init_define_ENV_DEFINED_IN_BUILD_STEP();
|
|
22712
|
-
function normalizePath(
|
|
22713
|
-
if (
|
|
22712
|
+
function normalizePath(path4, stripTrailing) {
|
|
22713
|
+
if (path4 === "\\" || path4 === "/")
|
|
22714
22714
|
return "/";
|
|
22715
|
-
const len =
|
|
22715
|
+
const len = path4.length;
|
|
22716
22716
|
if (len <= 1)
|
|
22717
|
-
return
|
|
22717
|
+
return path4;
|
|
22718
22718
|
let prefix = "";
|
|
22719
|
-
if (len > 4 &&
|
|
22720
|
-
const ch =
|
|
22721
|
-
if ((ch === "?" || ch === ".") &&
|
|
22722
|
-
|
|
22719
|
+
if (len > 4 && path4[3] === "\\") {
|
|
22720
|
+
const ch = path4[2];
|
|
22721
|
+
if ((ch === "?" || ch === ".") && path4.slice(0, 2) === "\\\\") {
|
|
22722
|
+
path4 = path4.slice(2);
|
|
22723
22723
|
prefix = "//";
|
|
22724
22724
|
}
|
|
22725
22725
|
}
|
|
22726
|
-
const segs =
|
|
22726
|
+
const segs = path4.split(/[/\\]+/);
|
|
22727
22727
|
const stack = [];
|
|
22728
22728
|
for (const seg of segs) {
|
|
22729
22729
|
if (seg === "..") {
|
|
@@ -22737,32 +22737,32 @@ function normalizePath(path3, stripTrailing) {
|
|
|
22737
22737
|
}
|
|
22738
22738
|
return prefix + stack.join("/");
|
|
22739
22739
|
}
|
|
22740
|
-
function normalPath(
|
|
22740
|
+
function normalPath(path4) {
|
|
22741
22741
|
var _a;
|
|
22742
22742
|
const dots = /(\/|^)(\.\/)+/g;
|
|
22743
22743
|
const slashes = /\/+/g;
|
|
22744
22744
|
const upreference = /(?<!\.\.)[^/]+\/\.\.\//;
|
|
22745
|
-
|
|
22746
|
-
|
|
22747
|
-
|
|
22745
|
+
path4 = `/${path4}/`;
|
|
22746
|
+
path4 = path4.replace(/^\/\.\./, "");
|
|
22747
|
+
path4 = path4.replace(dots, "/").replace(slashes, "/");
|
|
22748
22748
|
let match;
|
|
22749
|
-
while (match = (_a =
|
|
22750
|
-
|
|
22749
|
+
while (match = (_a = path4.match(upreference)) == null ? void 0 : _a[0]) {
|
|
22750
|
+
path4 = path4.replace(match, "");
|
|
22751
22751
|
}
|
|
22752
|
-
return
|
|
22752
|
+
return path4;
|
|
22753
22753
|
}
|
|
22754
|
-
function getDirname(
|
|
22755
|
-
return normalPath(
|
|
22754
|
+
function getDirname(path4) {
|
|
22755
|
+
return normalPath(path4.split("/").filter((x) => x).slice(0, -1).join("/") ?? path4);
|
|
22756
22756
|
}
|
|
22757
|
-
function getBasename(
|
|
22758
|
-
return
|
|
22757
|
+
function getBasename(path4) {
|
|
22758
|
+
return path4.split("/").filter((x) => x).at(-1) ?? path4;
|
|
22759
22759
|
}
|
|
22760
22760
|
|
|
22761
22761
|
// ../../sdk/dist/isAbsolutePath.js
|
|
22762
22762
|
init_define_ENV_DEFINED_IN_BUILD_STEP();
|
|
22763
|
-
var isAbsolutePath = (
|
|
22763
|
+
var isAbsolutePath = (path4) => {
|
|
22764
22764
|
const matchPosixAndWindowsAbsolutePaths = /^(?:[A-Za-z]:\\(?:[^\\]+\\)*[^\\]+|[A-Za-z]:\/(?:[^/]+\/)*[^/]+|\/(?:[^/]+\/)*[^/]+)$/;
|
|
22765
|
-
return matchPosixAndWindowsAbsolutePaths.test(
|
|
22765
|
+
return matchPosixAndWindowsAbsolutePaths.test(path4);
|
|
22766
22766
|
};
|
|
22767
22767
|
|
|
22768
22768
|
// ../../sdk/dist/createNodeishFsWithAbsolutePaths.js
|
|
@@ -22771,19 +22771,19 @@ var createNodeishFsWithAbsolutePaths = (args) => {
|
|
|
22771
22771
|
throw new Error(`Expected an absolute path but received "${args.projectPath}".`);
|
|
22772
22772
|
}
|
|
22773
22773
|
const basePath = normalizePath(args.projectPath).split("/").slice(0, -1).join("/");
|
|
22774
|
-
const makeAbsolute = (
|
|
22775
|
-
if (isAbsolutePath(
|
|
22776
|
-
return normalizePath(
|
|
22774
|
+
const makeAbsolute = (path4) => {
|
|
22775
|
+
if (isAbsolutePath(path4)) {
|
|
22776
|
+
return normalizePath(path4);
|
|
22777
22777
|
}
|
|
22778
|
-
return normalizePath(basePath + "/" +
|
|
22778
|
+
return normalizePath(basePath + "/" + path4);
|
|
22779
22779
|
};
|
|
22780
22780
|
return {
|
|
22781
22781
|
// @ts-expect-error
|
|
22782
|
-
readFile: (
|
|
22783
|
-
readdir: (
|
|
22784
|
-
mkdir: (
|
|
22785
|
-
writeFile: (
|
|
22786
|
-
watch: (
|
|
22782
|
+
readFile: (path4, options) => args.nodeishFs.readFile(makeAbsolute(path4), options),
|
|
22783
|
+
readdir: (path4) => args.nodeishFs.readdir(makeAbsolute(path4)),
|
|
22784
|
+
mkdir: (path4) => args.nodeishFs.mkdir(makeAbsolute(path4)),
|
|
22785
|
+
writeFile: (path4, data) => args.nodeishFs.writeFile(makeAbsolute(path4), data),
|
|
22786
|
+
watch: (path4, options) => args.nodeishFs.watch(makeAbsolute(path4), options)
|
|
22787
22787
|
};
|
|
22788
22788
|
};
|
|
22789
22789
|
|
|
@@ -22791,11 +22791,11 @@ var createNodeishFsWithAbsolutePaths = (args) => {
|
|
|
22791
22791
|
init_define_ENV_DEFINED_IN_BUILD_STEP();
|
|
22792
22792
|
var createNodeishFsWithWatcher = (args) => {
|
|
22793
22793
|
const pathList = [];
|
|
22794
|
-
const makeWatcher = (
|
|
22794
|
+
const makeWatcher = (path4) => {
|
|
22795
22795
|
const abortController = new AbortController();
|
|
22796
22796
|
(async () => {
|
|
22797
22797
|
try {
|
|
22798
|
-
const watcher = args.nodeishFs.watch(
|
|
22798
|
+
const watcher = args.nodeishFs.watch(path4, {
|
|
22799
22799
|
signal: abortController.signal,
|
|
22800
22800
|
persistent: false
|
|
22801
22801
|
});
|
|
@@ -22813,16 +22813,16 @@ var createNodeishFsWithWatcher = (args) => {
|
|
|
22813
22813
|
}
|
|
22814
22814
|
})();
|
|
22815
22815
|
};
|
|
22816
|
-
const readFileAndExtractPath = (
|
|
22817
|
-
if (!pathList.includes(
|
|
22818
|
-
makeWatcher(
|
|
22819
|
-
pathList.push(
|
|
22816
|
+
const readFileAndExtractPath = (path4, options) => {
|
|
22817
|
+
if (!pathList.includes(path4)) {
|
|
22818
|
+
makeWatcher(path4);
|
|
22819
|
+
pathList.push(path4);
|
|
22820
22820
|
}
|
|
22821
|
-
return args.nodeishFs.readFile(
|
|
22821
|
+
return args.nodeishFs.readFile(path4, options);
|
|
22822
22822
|
};
|
|
22823
22823
|
return {
|
|
22824
22824
|
// @ts-expect-error
|
|
22825
|
-
readFile: (
|
|
22825
|
+
readFile: (path4, options) => readFileAndExtractPath(path4, options),
|
|
22826
22826
|
readdir: args.nodeishFs.readdir,
|
|
22827
22827
|
mkdir: args.nodeishFs.mkdir,
|
|
22828
22828
|
writeFile: args.nodeishFs.writeFile,
|
|
@@ -23847,7 +23847,7 @@ var createEffect4 = createEffect3;
|
|
|
23847
23847
|
// ../../../../lix/source-code/client/dist/git/commit.js
|
|
23848
23848
|
init_define_ENV_DEFINED_IN_BUILD_STEP();
|
|
23849
23849
|
import { walk, TREE, STAGE, writeTree, commit as doCommit } from "isomorphic-git";
|
|
23850
|
-
async function commit({ fs:
|
|
23850
|
+
async function commit({ fs: fs3, dir, ref, author, message }) {
|
|
23851
23851
|
const fileStates = {};
|
|
23852
23852
|
async function createTree(currentFolder, fileStates2) {
|
|
23853
23853
|
const entries = [];
|
|
@@ -23875,10 +23875,10 @@ async function commit({ fs: fs2, dir, ref, author, message }) {
|
|
|
23875
23875
|
});
|
|
23876
23876
|
}
|
|
23877
23877
|
}
|
|
23878
|
-
return await writeTree({ fs:
|
|
23878
|
+
return await writeTree({ fs: fs3, dir, tree: entries });
|
|
23879
23879
|
}
|
|
23880
23880
|
await walk({
|
|
23881
|
-
fs:
|
|
23881
|
+
fs: fs3,
|
|
23882
23882
|
dir,
|
|
23883
23883
|
// cache, gitdir,
|
|
23884
23884
|
trees: [TREE({ ref }), STAGE()],
|
|
@@ -23938,7 +23938,7 @@ async function commit({ fs: fs2, dir, ref, author, message }) {
|
|
|
23938
23938
|
});
|
|
23939
23939
|
const tree = await createTree("/", fileStates);
|
|
23940
23940
|
return doCommit({
|
|
23941
|
-
fs:
|
|
23941
|
+
fs: fs3,
|
|
23942
23942
|
dir,
|
|
23943
23943
|
author,
|
|
23944
23944
|
message,
|
|
@@ -24608,15 +24608,15 @@ Valid examples:
|
|
|
24608
24608
|
- "/path/to/green-elephant.inlang
|
|
24609
24609
|
`, { argument: "projectPath" });
|
|
24610
24610
|
}
|
|
24611
|
-
const
|
|
24611
|
+
const fs3 = args.repo.nodeishFs;
|
|
24612
24612
|
const nodeishFs = createNodeishFsWithAbsolutePaths({
|
|
24613
24613
|
projectPath,
|
|
24614
|
-
nodeishFs:
|
|
24614
|
+
nodeishFs: fs3
|
|
24615
24615
|
});
|
|
24616
|
-
await maybeMigrateToDirectory({ nodeishFs:
|
|
24616
|
+
await maybeMigrateToDirectory({ nodeishFs: fs3, projectPath });
|
|
24617
24617
|
await maybeCreateFirstProjectId({ projectPath, repo: args.repo });
|
|
24618
24618
|
return await createRoot2(async () => {
|
|
24619
|
-
const { data: projectId } = await tryCatch(() =>
|
|
24619
|
+
const { data: projectId } = await tryCatch(() => fs3.readFile(args.projectPath + "/project_id", { encoding: "utf-8" }));
|
|
24620
24620
|
const [initialized, markInitAsComplete, markInitAsFailed] = createAwaitable();
|
|
24621
24621
|
const [settings, _setSettings] = createSignal2();
|
|
24622
24622
|
createEffect2(() => {
|
|
@@ -24658,10 +24658,10 @@ Valid examples:
|
|
|
24658
24658
|
markInitAsFailed(void 0);
|
|
24659
24659
|
return;
|
|
24660
24660
|
}
|
|
24661
|
-
const loadAndSetMessages = async (
|
|
24661
|
+
const loadAndSetMessages = async (fs4) => {
|
|
24662
24662
|
makeTrulyAsync(_resolvedModules.resolvedPluginApi.loadMessages({
|
|
24663
24663
|
settings: settingsValue,
|
|
24664
|
-
nodeishFs:
|
|
24664
|
+
nodeishFs: fs4
|
|
24665
24665
|
})).then((messages2) => {
|
|
24666
24666
|
setMessages(messages2);
|
|
24667
24667
|
markInitAsComplete();
|
|
@@ -24864,13 +24864,13 @@ init_define_ENV_DEFINED_IN_BUILD_STEP();
|
|
|
24864
24864
|
var listProjects = async (nodeishFs, from3) => {
|
|
24865
24865
|
const recursionLimit = 5;
|
|
24866
24866
|
const projects = [];
|
|
24867
|
-
async function searchDir(
|
|
24867
|
+
async function searchDir(path4, depth) {
|
|
24868
24868
|
if (depth > recursionLimit) {
|
|
24869
24869
|
return;
|
|
24870
24870
|
}
|
|
24871
|
-
const files = await nodeishFs.readdir(
|
|
24871
|
+
const files = await nodeishFs.readdir(path4);
|
|
24872
24872
|
for (const file of files) {
|
|
24873
|
-
const filePath = `${
|
|
24873
|
+
const filePath = `${path4}/${file}`;
|
|
24874
24874
|
try {
|
|
24875
24875
|
const stats = await nodeishFs.stat(filePath);
|
|
24876
24876
|
if (stats.isDirectory()) {
|
|
@@ -25752,8 +25752,8 @@ function getErrorMap() {
|
|
|
25752
25752
|
return overrideErrorMap;
|
|
25753
25753
|
}
|
|
25754
25754
|
var makeIssue = (params) => {
|
|
25755
|
-
const { data, path:
|
|
25756
|
-
const fullPath = [...
|
|
25755
|
+
const { data, path: path4, errorMaps, issueData } = params;
|
|
25756
|
+
const fullPath = [...path4, ...issueData.path || []];
|
|
25757
25757
|
const fullIssue = {
|
|
25758
25758
|
...issueData,
|
|
25759
25759
|
path: fullPath
|
|
@@ -25852,11 +25852,11 @@ var errorUtil;
|
|
|
25852
25852
|
errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
|
|
25853
25853
|
})(errorUtil || (errorUtil = {}));
|
|
25854
25854
|
var ParseInputLazyPath = class {
|
|
25855
|
-
constructor(parent, value,
|
|
25855
|
+
constructor(parent, value, path4, key) {
|
|
25856
25856
|
this._cachedPath = [];
|
|
25857
25857
|
this.parent = parent;
|
|
25858
25858
|
this.data = value;
|
|
25859
|
-
this._path =
|
|
25859
|
+
this._path = path4;
|
|
25860
25860
|
this._key = key;
|
|
25861
25861
|
}
|
|
25862
25862
|
get path() {
|
|
@@ -29183,18 +29183,115 @@ var telemetry = new Proxy(posthog, {
|
|
|
29183
29183
|
return target[prop];
|
|
29184
29184
|
}
|
|
29185
29185
|
});
|
|
29186
|
-
function capture2(args) {
|
|
29186
|
+
function capture2(args, projectId) {
|
|
29187
29187
|
if (!publicEnv.PUBLIC_POSTHOG_TOKEN) {
|
|
29188
29188
|
return;
|
|
29189
29189
|
}
|
|
29190
|
-
|
|
29190
|
+
const data = {
|
|
29191
29191
|
...args,
|
|
29192
29192
|
distinctId: "unknown"
|
|
29193
|
-
|
|
29194
|
-
|
|
29195
|
-
|
|
29196
|
-
|
|
29197
|
-
|
|
29193
|
+
};
|
|
29194
|
+
if (projectId) {
|
|
29195
|
+
data.groups = {
|
|
29196
|
+
project: projectId
|
|
29197
|
+
};
|
|
29198
|
+
}
|
|
29199
|
+
return posthog.capture(data);
|
|
29200
|
+
}
|
|
29201
|
+
|
|
29202
|
+
// src/services/telemetry/stack-detection.ts
|
|
29203
|
+
init_define_ENV_DEFINED_IN_BUILD_STEP();
|
|
29204
|
+
var RelevantPackages = [
|
|
29205
|
+
"next",
|
|
29206
|
+
"solid",
|
|
29207
|
+
"solid-start",
|
|
29208
|
+
"svelte",
|
|
29209
|
+
"@sveltejs/kit",
|
|
29210
|
+
"@sveltejs/adaper-static",
|
|
29211
|
+
"@sveltejs/adapter-node",
|
|
29212
|
+
"@sveltejs/adapter-netlify",
|
|
29213
|
+
"@sveltejs/adapter-vercel",
|
|
29214
|
+
"@sveltejs/adapter-cloudflare-workers",
|
|
29215
|
+
"@sveltejs/adapter-auto",
|
|
29216
|
+
"vue",
|
|
29217
|
+
"nuxt",
|
|
29218
|
+
"react",
|
|
29219
|
+
"react-native",
|
|
29220
|
+
"remix",
|
|
29221
|
+
"astro",
|
|
29222
|
+
"flutter",
|
|
29223
|
+
"vite",
|
|
29224
|
+
"webpack",
|
|
29225
|
+
"rollup",
|
|
29226
|
+
"esbuild",
|
|
29227
|
+
"qwick",
|
|
29228
|
+
"parcel",
|
|
29229
|
+
"lit",
|
|
29230
|
+
"lit-html",
|
|
29231
|
+
"@angular/core"
|
|
29232
|
+
];
|
|
29233
|
+
function getStackInfo(packageJson) {
|
|
29234
|
+
const packages = {};
|
|
29235
|
+
try {
|
|
29236
|
+
const pkg = packageJson;
|
|
29237
|
+
const dependencies = (pkg == null ? void 0 : pkg.dependencies) ?? {};
|
|
29238
|
+
const devDependencies = (pkg == null ? void 0 : pkg.devDependencies) ?? {};
|
|
29239
|
+
const peerDependencies = (pkg == null ? void 0 : pkg.peerDependencies) ?? {};
|
|
29240
|
+
const allDependencies = { ...dependencies, ...devDependencies, ...peerDependencies };
|
|
29241
|
+
for (const dependencyName of RelevantPackages) {
|
|
29242
|
+
if (dependencyName in allDependencies) {
|
|
29243
|
+
const dependencyVersion = allDependencies[dependencyName];
|
|
29244
|
+
if (typeof dependencyVersion !== "string")
|
|
29245
|
+
continue;
|
|
29246
|
+
packages[dependencyName] = dependencyVersion;
|
|
29247
|
+
}
|
|
29248
|
+
}
|
|
29249
|
+
return { packages };
|
|
29250
|
+
} catch (error) {
|
|
29251
|
+
return { packages };
|
|
29252
|
+
}
|
|
29253
|
+
}
|
|
29254
|
+
|
|
29255
|
+
// src/compiler/compile.ts
|
|
29256
|
+
import fs from "node:fs/promises";
|
|
29257
|
+
|
|
29258
|
+
// src/services/environment/package.ts
|
|
29259
|
+
init_define_ENV_DEFINED_IN_BUILD_STEP();
|
|
29260
|
+
import path from "node:path";
|
|
29261
|
+
|
|
29262
|
+
// src/services/file-handling/exists.ts
|
|
29263
|
+
init_define_ENV_DEFINED_IN_BUILD_STEP();
|
|
29264
|
+
async function pathExists(filePath, nodeishFs) {
|
|
29265
|
+
try {
|
|
29266
|
+
await nodeishFs.stat(filePath);
|
|
29267
|
+
return true;
|
|
29268
|
+
} catch (error) {
|
|
29269
|
+
if (error.code === "ENOENT") {
|
|
29270
|
+
return false;
|
|
29271
|
+
} else {
|
|
29272
|
+
throw new Error(`Failed to check if path exists: ${error}`, { cause: error });
|
|
29273
|
+
}
|
|
29274
|
+
}
|
|
29275
|
+
}
|
|
29276
|
+
|
|
29277
|
+
// src/services/environment/package.ts
|
|
29278
|
+
async function findPackageJson(fs3, cwd) {
|
|
29279
|
+
const potentialPackageJsonPath = path.resolve(cwd, "package.json");
|
|
29280
|
+
const packageJsonExists = await pathExists(potentialPackageJsonPath, fs3);
|
|
29281
|
+
if (packageJsonExists)
|
|
29282
|
+
return potentialPackageJsonPath;
|
|
29283
|
+
return void 0;
|
|
29284
|
+
}
|
|
29285
|
+
async function getPackageJson(fs3, cwd) {
|
|
29286
|
+
const packageJsonPath = await findPackageJson(fs3, cwd);
|
|
29287
|
+
if (!packageJsonPath)
|
|
29288
|
+
return void 0;
|
|
29289
|
+
try {
|
|
29290
|
+
const packageJsonContents = await fs3.readFile(packageJsonPath, { encoding: "utf-8" });
|
|
29291
|
+
return JSON.parse(packageJsonContents);
|
|
29292
|
+
} catch {
|
|
29293
|
+
return void 0;
|
|
29294
|
+
}
|
|
29198
29295
|
}
|
|
29199
29296
|
|
|
29200
29297
|
// src/compiler/compile.ts
|
|
@@ -29202,13 +29299,21 @@ var ignoreDirectory = `# ignore everything because the directory is auto-generat
|
|
|
29202
29299
|
# for more info visit https://inlang.com/m/gerre34r/paraglide-js
|
|
29203
29300
|
*
|
|
29204
29301
|
`;
|
|
29205
|
-
var compile = (args) => {
|
|
29302
|
+
var compile = async (args) => {
|
|
29206
29303
|
const compiledMessages = args.messages.map(
|
|
29207
29304
|
(message) => compileMessage(message, args.settings.languageTags, args.settings.sourceLanguageTag)
|
|
29208
29305
|
);
|
|
29209
|
-
|
|
29210
|
-
|
|
29211
|
-
|
|
29306
|
+
const pkgJson = await getPackageJson(fs, process.cwd());
|
|
29307
|
+
const stack = getStackInfo(pkgJson);
|
|
29308
|
+
telemetry.capture(
|
|
29309
|
+
{
|
|
29310
|
+
event: "PARAGLIDE-JS compile executed",
|
|
29311
|
+
properties: {
|
|
29312
|
+
stack
|
|
29313
|
+
}
|
|
29314
|
+
},
|
|
29315
|
+
args.projectId
|
|
29316
|
+
);
|
|
29212
29317
|
const resources = {};
|
|
29213
29318
|
for (const compiledMessage of compiledMessages) {
|
|
29214
29319
|
for (const languageTag of Object.keys(compiledMessage)) {
|
|
@@ -29403,33 +29508,33 @@ import { Command } from "commander";
|
|
|
29403
29508
|
|
|
29404
29509
|
// src/services/file-handling/write-output.ts
|
|
29405
29510
|
init_define_ENV_DEFINED_IN_BUILD_STEP();
|
|
29406
|
-
import
|
|
29511
|
+
import path2 from "node:path";
|
|
29407
29512
|
import crypto2 from "node:crypto";
|
|
29408
29513
|
var previousOutputHash;
|
|
29409
|
-
async function writeOutput(outputDirectory, output,
|
|
29514
|
+
async function writeOutput(outputDirectory, output, fs3) {
|
|
29410
29515
|
const currentOutputHash = hashOutput(output, outputDirectory);
|
|
29411
29516
|
if (currentOutputHash === previousOutputHash)
|
|
29412
29517
|
return;
|
|
29413
|
-
await
|
|
29414
|
-
await
|
|
29518
|
+
await fs3.access(outputDirectory).catch(async () => {
|
|
29519
|
+
await fs3.mkdir(outputDirectory, { recursive: true });
|
|
29415
29520
|
});
|
|
29416
|
-
const files = await
|
|
29521
|
+
const files = await fs3.readdir(outputDirectory);
|
|
29417
29522
|
await Promise.allSettled(
|
|
29418
29523
|
files.map(async (file) => {
|
|
29419
|
-
await
|
|
29524
|
+
await fs3.unlink(outputDirectory + "/" + file);
|
|
29420
29525
|
})
|
|
29421
29526
|
);
|
|
29422
29527
|
await Promise.allSettled(
|
|
29423
29528
|
Object.keys(output).map(async (filePath) => {
|
|
29424
|
-
const fullPath =
|
|
29425
|
-
const directory =
|
|
29426
|
-
await
|
|
29529
|
+
const fullPath = path2.resolve(outputDirectory, filePath);
|
|
29530
|
+
const directory = path2.dirname(fullPath);
|
|
29531
|
+
await fs3.mkdir(directory, { recursive: true });
|
|
29427
29532
|
})
|
|
29428
29533
|
);
|
|
29429
29534
|
await Promise.allSettled(
|
|
29430
29535
|
Object.entries(output).map(async ([filePath, fileContent]) => {
|
|
29431
|
-
const fullPath =
|
|
29432
|
-
await
|
|
29536
|
+
const fullPath = path2.resolve(outputDirectory, filePath);
|
|
29537
|
+
await fs3.writeFile(fullPath, fileContent);
|
|
29433
29538
|
})
|
|
29434
29539
|
);
|
|
29435
29540
|
previousOutputHash = currentOutputHash;
|
|
@@ -29506,19 +29611,19 @@ var compileCommand = new Command().name("compile").summary("Compiles inlang Para
|
|
|
29506
29611
|
"./src/paraglide"
|
|
29507
29612
|
).requiredOption("--watch", "Watch for changes and recompile.", false).action(async (options) => {
|
|
29508
29613
|
const logger = new Logger({ silent: false, prefix: true });
|
|
29509
|
-
const
|
|
29614
|
+
const path4 = resolve(process.cwd(), options.project);
|
|
29510
29615
|
const outputDirectory = resolve(process.cwd(), options.outdir);
|
|
29511
29616
|
logger.info(`Compiling inlang project at "${options.project}".`);
|
|
29512
|
-
const repoRoot = await findRepoRoot({ nodeishFs: nodeFsPromises, path:
|
|
29617
|
+
const repoRoot = await findRepoRoot({ nodeishFs: nodeFsPromises, path: path4 });
|
|
29513
29618
|
const repo = await openRepository(repoRoot || process.cwd(), {
|
|
29514
29619
|
nodeishFs: nodeFsPromises
|
|
29515
29620
|
});
|
|
29516
29621
|
if (!repoRoot) {
|
|
29517
|
-
logger.warn(`Could not find repository root for path ${
|
|
29622
|
+
logger.warn(`Could not find repository root for path ${path4}`);
|
|
29518
29623
|
}
|
|
29519
29624
|
const project = exitIfErrors(
|
|
29520
29625
|
await loadProject({
|
|
29521
|
-
projectPath:
|
|
29626
|
+
projectPath: path4,
|
|
29522
29627
|
repo,
|
|
29523
29628
|
appId: "library.inlang.paraglideJs"
|
|
29524
29629
|
}),
|
|
@@ -29544,14 +29649,15 @@ var compileCommand = new Command().name("compile").summary("Compiles inlang Para
|
|
|
29544
29649
|
await new Promise((resolve3) => setTimeout(resolve3, 1e4));
|
|
29545
29650
|
}
|
|
29546
29651
|
}
|
|
29547
|
-
logger.info("
|
|
29652
|
+
logger.info("Successfully compiled the project.");
|
|
29548
29653
|
});
|
|
29549
|
-
async function executeCompilation(project, outputDirectory,
|
|
29550
|
-
const output = compile({
|
|
29654
|
+
async function executeCompilation(project, outputDirectory, fs3) {
|
|
29655
|
+
const output = await compile({
|
|
29551
29656
|
messages: project.query.messages.getAll(),
|
|
29552
|
-
settings: project.settings()
|
|
29657
|
+
settings: project.settings(),
|
|
29658
|
+
projectId: project.id
|
|
29553
29659
|
});
|
|
29554
|
-
await writeOutput(outputDirectory, output,
|
|
29660
|
+
await writeOutput(outputDirectory, output, fs3);
|
|
29555
29661
|
}
|
|
29556
29662
|
var exitIfErrors = (project, logger) => {
|
|
29557
29663
|
if (project.errors().length > 0) {
|
|
@@ -29575,16 +29681,16 @@ import childProcess from "node:child_process";
|
|
|
29575
29681
|
|
|
29576
29682
|
// src/cli/state.ts
|
|
29577
29683
|
init_define_ENV_DEFINED_IN_BUILD_STEP();
|
|
29578
|
-
import
|
|
29579
|
-
import
|
|
29684
|
+
import path3 from "node:path";
|
|
29685
|
+
import fs2 from "node:fs";
|
|
29580
29686
|
import { fileURLToPath } from "node:url";
|
|
29581
29687
|
var version = (() => {
|
|
29582
|
-
const currentFilePath = fileURLToPath(import.meta.url).split(
|
|
29688
|
+
const currentFilePath = fileURLToPath(import.meta.url).split(path3.sep).join(path3.posix.sep);
|
|
29583
29689
|
const paraglideDirectory = currentFilePath.slice(
|
|
29584
29690
|
0,
|
|
29585
29691
|
currentFilePath.indexOf("/paraglide-js/") + "/paraglide-js".length
|
|
29586
29692
|
);
|
|
29587
|
-
return JSON.parse(
|
|
29693
|
+
return JSON.parse(fs2.readFileSync(`${paraglideDirectory}/package.json`, "utf-8")).version;
|
|
29588
29694
|
})();
|
|
29589
29695
|
|
|
29590
29696
|
// src/cli/commands/init.ts
|
|
@@ -29676,7 +29782,7 @@ var maybeAddVsCodeExtension = async (args, ctx) => {
|
|
|
29676
29782
|
}
|
|
29677
29783
|
if (extensions.recommendations.includes("inlang.vs-code-extension") === false) {
|
|
29678
29784
|
extensions.recommendations.push("inlang.vs-code-extension");
|
|
29679
|
-
if (await
|
|
29785
|
+
if (await pathExists("./.vscode", ctx.repo.nodeishFs) === false) {
|
|
29680
29786
|
await ctx.repo.nodeishFs.mkdir("./.vscode");
|
|
29681
29787
|
}
|
|
29682
29788
|
await ctx.repo.nodeishFs.writeFile(
|
|
@@ -29706,9 +29812,9 @@ var addParaglideJsToDevDependencies = async (ctx) => {
|
|
|
29706
29812
|
ctx.logger.success("Added @inlang/paraglide-js to the devDependencies in package.json.");
|
|
29707
29813
|
};
|
|
29708
29814
|
var findExistingInlangProjectPath = async (ctx) => {
|
|
29709
|
-
for (const
|
|
29710
|
-
if (await
|
|
29711
|
-
return
|
|
29815
|
+
for (const path4 of ["./project.inlang", "../project.inlang", "../../project.inlang"]) {
|
|
29816
|
+
if (await pathExists(path4, ctx.repo.nodeishFs)) {
|
|
29817
|
+
return path4;
|
|
29712
29818
|
}
|
|
29713
29819
|
continue;
|
|
29714
29820
|
}
|
|
@@ -29788,8 +29894,8 @@ var newProjectTemplate = {
|
|
|
29788
29894
|
}
|
|
29789
29895
|
};
|
|
29790
29896
|
var checkIfPackageJsonExists = async (ctx) => {
|
|
29791
|
-
const
|
|
29792
|
-
if (
|
|
29897
|
+
const packageJsonPath = await findPackageJson(ctx.repo.nodeishFs, process.cwd());
|
|
29898
|
+
if (!packageJsonPath) {
|
|
29793
29899
|
ctx.logger.warn(
|
|
29794
29900
|
"No package.json found in the current working directory. Please change the working directory to the directory with a package.json file."
|
|
29795
29901
|
);
|
|
@@ -29864,7 +29970,7 @@ Please add the following command to your build script manually:
|
|
|
29864
29970
|
};
|
|
29865
29971
|
var maybeChangeTsConfigModuleResolution = async (ctx) => {
|
|
29866
29972
|
var _a, _b, _c;
|
|
29867
|
-
if (await
|
|
29973
|
+
if (await pathExists("./tsconfig.json", ctx.repo.nodeishFs) === false) {
|
|
29868
29974
|
return;
|
|
29869
29975
|
}
|
|
29870
29976
|
const file = await ctx.repo.nodeishFs.readFile("./tsconfig.json", { encoding: "utf-8" });
|
|
@@ -29926,7 +30032,7 @@ var maybeChangeTsConfigModuleResolution = async (ctx) => {
|
|
|
29926
30032
|
};
|
|
29927
30033
|
var maybeChangeTsConfigAllowJs = async (ctx) => {
|
|
29928
30034
|
var _a, _b;
|
|
29929
|
-
if (await
|
|
30035
|
+
if (await pathExists("./tsconfig.json", ctx.repo.nodeishFs) === false) {
|
|
29930
30036
|
return;
|
|
29931
30037
|
}
|
|
29932
30038
|
const file = await ctx.repo.nodeishFs.readFile("./tsconfig.json", { encoding: "utf-8" });
|
|
@@ -29974,18 +30080,6 @@ var prompt = async (message, options) => {
|
|
|
29974
30080
|
}
|
|
29975
30081
|
return response;
|
|
29976
30082
|
};
|
|
29977
|
-
async function fileExists(filePath, nodeishFs) {
|
|
29978
|
-
try {
|
|
29979
|
-
await nodeishFs.stat(filePath);
|
|
29980
|
-
return true;
|
|
29981
|
-
} catch (error) {
|
|
29982
|
-
if (error.code === "ENOENT") {
|
|
29983
|
-
return false;
|
|
29984
|
-
} else {
|
|
29985
|
-
throw new Error(`Failed to check if file exists: ${error}`, { cause: error });
|
|
29986
|
-
}
|
|
29987
|
-
}
|
|
29988
|
-
}
|
|
29989
30083
|
function execAsync(command) {
|
|
29990
30084
|
return new Promise((resolve3, reject) => {
|
|
29991
30085
|
childProcess.exec(command, (error, stdout) => {
|