@power-plant/schema 0.0.54 → 0.0.55
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.
|
@@ -3,6 +3,7 @@ let typescript = require("typescript");
|
|
|
3
3
|
typescript = require_rolldown_runtime.__toESM(typescript, 1);
|
|
4
4
|
let _deepkit_type_spec = require("@deepkit/type-spec");
|
|
5
5
|
let path = require("path");
|
|
6
|
+
let _typescript_vfs = require("@typescript/vfs");
|
|
6
7
|
|
|
7
8
|
//#region ../../../node_modules/.pnpm/compatfactory@2.0.9_typescript@6.0.3/node_modules/compatfactory/dist/esm/index.js
|
|
8
9
|
function ensureNodeFactory(factoryLike) {
|
|
@@ -7200,960 +7201,8 @@ var Resolver = class {
|
|
|
7200
7201
|
}
|
|
7201
7202
|
};
|
|
7202
7203
|
|
|
7203
|
-
//#endregion
|
|
7204
|
-
//#region ../../../node_modules/.pnpm/@typescript+vfs@1.5.0/node_modules/@typescript/vfs/dist/vfs.cjs.production.min.js
|
|
7205
|
-
var require_vfs_cjs_production_min = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((exports) => {
|
|
7206
|
-
function e() {
|
|
7207
|
-
return (e = Object.assign || function(e) {
|
|
7208
|
-
for (var t = 1; t < arguments.length; t++) {
|
|
7209
|
-
var r = arguments[t];
|
|
7210
|
-
for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && (e[i] = r[i]);
|
|
7211
|
-
}
|
|
7212
|
-
return e;
|
|
7213
|
-
}).apply(this, arguments);
|
|
7214
|
-
}
|
|
7215
|
-
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
7216
|
-
var t = !1;
|
|
7217
|
-
try {
|
|
7218
|
-
t = "undefined" != typeof localStorage;
|
|
7219
|
-
} catch (e) {}
|
|
7220
|
-
var r = "undefined" != typeof process;
|
|
7221
|
-
var i = t && localStorage.getItem("DEBUG") || r && process.env.DEBUG ? console.log : function(e) {
|
|
7222
|
-
return "";
|
|
7223
|
-
};
|
|
7224
|
-
var n = function(e, t) {
|
|
7225
|
-
var r, i = e.lib || [], n = [
|
|
7226
|
-
"lib.d.ts",
|
|
7227
|
-
"lib.decorators.d.ts",
|
|
7228
|
-
"lib.decorators.legacy.d.ts",
|
|
7229
|
-
"lib.dom.d.ts",
|
|
7230
|
-
"lib.dom.iterable.d.ts",
|
|
7231
|
-
"lib.webworker.d.ts",
|
|
7232
|
-
"lib.webworker.importscripts.d.ts",
|
|
7233
|
-
"lib.webworker.iterable.d.ts",
|
|
7234
|
-
"lib.scripthost.d.ts",
|
|
7235
|
-
"lib.es5.d.ts",
|
|
7236
|
-
"lib.es6.d.ts",
|
|
7237
|
-
"lib.es2015.collection.d.ts",
|
|
7238
|
-
"lib.es2015.core.d.ts",
|
|
7239
|
-
"lib.es2015.d.ts",
|
|
7240
|
-
"lib.es2015.generator.d.ts",
|
|
7241
|
-
"lib.es2015.iterable.d.ts",
|
|
7242
|
-
"lib.es2015.promise.d.ts",
|
|
7243
|
-
"lib.es2015.proxy.d.ts",
|
|
7244
|
-
"lib.es2015.reflect.d.ts",
|
|
7245
|
-
"lib.es2015.symbol.d.ts",
|
|
7246
|
-
"lib.es2015.symbol.wellknown.d.ts",
|
|
7247
|
-
"lib.es2016.array.include.d.ts",
|
|
7248
|
-
"lib.es2016.d.ts",
|
|
7249
|
-
"lib.es2016.full.d.ts",
|
|
7250
|
-
"lib.es2017.d.ts",
|
|
7251
|
-
"lib.es2017.date.d.ts",
|
|
7252
|
-
"lib.es2017.full.d.ts",
|
|
7253
|
-
"lib.es2017.intl.d.ts",
|
|
7254
|
-
"lib.es2017.object.d.ts",
|
|
7255
|
-
"lib.es2017.sharedmemory.d.ts",
|
|
7256
|
-
"lib.es2017.string.d.ts",
|
|
7257
|
-
"lib.es2017.typedarrays.d.ts",
|
|
7258
|
-
"lib.es2018.asyncgenerator.d.ts",
|
|
7259
|
-
"lib.es2018.asynciterable.d.ts",
|
|
7260
|
-
"lib.es2018.d.ts",
|
|
7261
|
-
"lib.es2018.full.d.ts",
|
|
7262
|
-
"lib.es2018.intl.d.ts",
|
|
7263
|
-
"lib.es2018.promise.d.ts",
|
|
7264
|
-
"lib.es2018.regexp.d.ts",
|
|
7265
|
-
"lib.es2019.array.d.ts",
|
|
7266
|
-
"lib.es2019.d.ts",
|
|
7267
|
-
"lib.es2019.full.d.ts",
|
|
7268
|
-
"lib.es2019.intl.d.ts",
|
|
7269
|
-
"lib.es2019.object.d.ts",
|
|
7270
|
-
"lib.es2019.string.d.ts",
|
|
7271
|
-
"lib.es2019.symbol.d.ts",
|
|
7272
|
-
"lib.es2020.bigint.d.ts",
|
|
7273
|
-
"lib.es2020.d.ts",
|
|
7274
|
-
"lib.es2020.date.d.ts",
|
|
7275
|
-
"lib.es2020.full.d.ts",
|
|
7276
|
-
"lib.es2020.intl.d.ts",
|
|
7277
|
-
"lib.es2020.number.d.ts",
|
|
7278
|
-
"lib.es2020.promise.d.ts",
|
|
7279
|
-
"lib.es2020.sharedmemory.d.ts",
|
|
7280
|
-
"lib.es2020.string.d.ts",
|
|
7281
|
-
"lib.es2020.symbol.wellknown.d.ts",
|
|
7282
|
-
"lib.es2021.d.ts",
|
|
7283
|
-
"lib.es2021.full.d.ts",
|
|
7284
|
-
"lib.es2021.intl.d.ts",
|
|
7285
|
-
"lib.es2021.promise.d.ts",
|
|
7286
|
-
"lib.es2021.string.d.ts",
|
|
7287
|
-
"lib.es2021.weakref.d.ts",
|
|
7288
|
-
"lib.es2022.array.d.ts",
|
|
7289
|
-
"lib.es2022.d.ts",
|
|
7290
|
-
"lib.es2022.error.d.ts",
|
|
7291
|
-
"lib.es2022.full.d.ts",
|
|
7292
|
-
"lib.es2022.intl.d.ts",
|
|
7293
|
-
"lib.es2022.object.d.ts",
|
|
7294
|
-
"lib.es2022.regexp.d.ts",
|
|
7295
|
-
"lib.es2022.sharedmemory.d.ts",
|
|
7296
|
-
"lib.es2022.string.d.ts",
|
|
7297
|
-
"lib.es2023.array.d.ts",
|
|
7298
|
-
"lib.es2023.collection.d.ts",
|
|
7299
|
-
"lib.es2023.d.ts",
|
|
7300
|
-
"lib.es2023.full.d.ts",
|
|
7301
|
-
"lib.esnext.array.d.ts",
|
|
7302
|
-
"lib.esnext.asynciterable.d.ts",
|
|
7303
|
-
"lib.esnext.bigint.d.ts",
|
|
7304
|
-
"lib.esnext.d.ts",
|
|
7305
|
-
"lib.esnext.decorators.d.ts",
|
|
7306
|
-
"lib.esnext.disposable.d.ts",
|
|
7307
|
-
"lib.esnext.full.d.ts",
|
|
7308
|
-
"lib.esnext.intl.d.ts",
|
|
7309
|
-
"lib.esnext.promise.d.ts",
|
|
7310
|
-
"lib.esnext.string.d.ts",
|
|
7311
|
-
"lib.esnext.symbol.d.ts",
|
|
7312
|
-
"lib.esnext.weakref.d.ts"
|
|
7313
|
-
], s = t.ScriptTarget[e.target || t.ScriptTarget.ES5], o = n.filter((function(e) {
|
|
7314
|
-
return e.startsWith("lib." + s.toLowerCase());
|
|
7315
|
-
})), l = n.indexOf(o.pop()), a = ((r = i.map((function(e) {
|
|
7316
|
-
var t = n.filter((function(t) {
|
|
7317
|
-
return t.startsWith("lib." + e.toLowerCase());
|
|
7318
|
-
}));
|
|
7319
|
-
return 0 === t.length ? 0 : n.indexOf(t.pop());
|
|
7320
|
-
}))) && r.length ? r.reduce((function(e, t) {
|
|
7321
|
-
return t > e ? t : e;
|
|
7322
|
-
})) : void 0) || 0, u = Math.max(l, a);
|
|
7323
|
-
return n.slice(0, u + 1);
|
|
7324
|
-
};
|
|
7325
|
-
var s = function(e, t) {
|
|
7326
|
-
var r = f(), i = b();
|
|
7327
|
-
(function e(t) {
|
|
7328
|
-
var n = [];
|
|
7329
|
-
return i.readdirSync(t).forEach((function(s) {
|
|
7330
|
-
s = r.join(t, s);
|
|
7331
|
-
var o = i.statSync(s);
|
|
7332
|
-
o && o.isDirectory() ? n = n.concat(e(s)) : n.push(s);
|
|
7333
|
-
})), n;
|
|
7334
|
-
})(t).forEach((function(n) {
|
|
7335
|
-
var s = "/node_modules/@types" + n.replace(t, ""), o = i.readFileSync(n, "utf8");
|
|
7336
|
-
[".ts", ".tsx"].includes(r.extname(s)) && e.set(s, o);
|
|
7337
|
-
}));
|
|
7338
|
-
};
|
|
7339
|
-
function o(e) {
|
|
7340
|
-
throw new Error("Method '" + e + "' is not implemented.");
|
|
7341
|
-
}
|
|
7342
|
-
function l(e, t) {
|
|
7343
|
-
return function() {
|
|
7344
|
-
for (var r = arguments.length, n = new Array(r), s = 0; s < r; s++) n[s] = arguments[s];
|
|
7345
|
-
var o = t.apply(void 0, n), l = "string" == typeof o ? o.slice(0, 80) + "..." : o;
|
|
7346
|
-
return i.apply(void 0, ["> " + e].concat(n)), i("< " + l), o;
|
|
7347
|
-
};
|
|
7348
|
-
}
|
|
7349
|
-
var a = function(t) {
|
|
7350
|
-
return e({}, t.getDefaultCompilerOptions(), {
|
|
7351
|
-
jsx: t.JsxEmit.React,
|
|
7352
|
-
strict: !0,
|
|
7353
|
-
esModuleInterop: !0,
|
|
7354
|
-
module: t.ModuleKind.ESNext,
|
|
7355
|
-
suppressOutputPathCheck: !0,
|
|
7356
|
-
skipLibCheck: !0,
|
|
7357
|
-
skipDefaultLibCheck: !0,
|
|
7358
|
-
moduleResolution: t.ModuleResolutionKind.NodeJs
|
|
7359
|
-
});
|
|
7360
|
-
};
|
|
7361
|
-
var u = function(e) {
|
|
7362
|
-
return e.replace("/", "/lib.").toLowerCase();
|
|
7363
|
-
};
|
|
7364
|
-
function c(t, r, i) {
|
|
7365
|
-
var n = /* @__PURE__ */ new Map();
|
|
7366
|
-
return {
|
|
7367
|
-
compilerHost: e({}, t, {
|
|
7368
|
-
getCanonicalFileName: function(e) {
|
|
7369
|
-
return e;
|
|
7370
|
-
},
|
|
7371
|
-
getDefaultLibFileName: function() {
|
|
7372
|
-
return "/" + i.getDefaultLibFileName(r);
|
|
7373
|
-
},
|
|
7374
|
-
getDirectories: function() {
|
|
7375
|
-
return [];
|
|
7376
|
-
},
|
|
7377
|
-
getNewLine: function() {
|
|
7378
|
-
return t.newLine;
|
|
7379
|
-
},
|
|
7380
|
-
getSourceFile: function(e) {
|
|
7381
|
-
return n.get(e) || (s = i.createSourceFile(e, t.readFile(e), r.target || a(i).target, !1), n.set(s.fileName, s), s);
|
|
7382
|
-
var s;
|
|
7383
|
-
},
|
|
7384
|
-
useCaseSensitiveFileNames: function() {
|
|
7385
|
-
return t.useCaseSensitiveFileNames;
|
|
7386
|
-
}
|
|
7387
|
-
}),
|
|
7388
|
-
updateFile: function(e) {
|
|
7389
|
-
var r = n.has(e.fileName);
|
|
7390
|
-
return t.writeFile(e.fileName, e.text), n.set(e.fileName, e), r;
|
|
7391
|
-
}
|
|
7392
|
-
};
|
|
7393
|
-
}
|
|
7394
|
-
function d(t, r, i, n, s) {
|
|
7395
|
-
var o = [].concat(r), l = c(t, i, n), a = l.compilerHost, u = l.updateFile, d = /* @__PURE__ */ new Map(), f = 0;
|
|
7396
|
-
return {
|
|
7397
|
-
languageServiceHost: e({}, a, {
|
|
7398
|
-
getProjectVersion: function() {
|
|
7399
|
-
return f.toString();
|
|
7400
|
-
},
|
|
7401
|
-
getCompilationSettings: function() {
|
|
7402
|
-
return i;
|
|
7403
|
-
},
|
|
7404
|
-
getCustomTransformers: function() {
|
|
7405
|
-
return s;
|
|
7406
|
-
},
|
|
7407
|
-
getScriptFileNames: function() {
|
|
7408
|
-
return o.slice();
|
|
7409
|
-
},
|
|
7410
|
-
getScriptSnapshot: function(e) {
|
|
7411
|
-
var r = t.readFile(e);
|
|
7412
|
-
if (r) return n.ScriptSnapshot.fromString(r);
|
|
7413
|
-
},
|
|
7414
|
-
getScriptVersion: function(e) {
|
|
7415
|
-
return d.get(e) || "0";
|
|
7416
|
-
},
|
|
7417
|
-
writeFile: t.writeFile
|
|
7418
|
-
}),
|
|
7419
|
-
updateFile: function(e) {
|
|
7420
|
-
f++, d.set(e.fileName, f.toString()), o.includes(e.fileName) || o.push(e.fileName), u(e);
|
|
7421
|
-
}
|
|
7422
|
-
};
|
|
7423
|
-
}
|
|
7424
|
-
var f = function() {
|
|
7425
|
-
return require(String.fromCharCode(112, 97, 116, 104));
|
|
7426
|
-
};
|
|
7427
|
-
var b = function() {
|
|
7428
|
-
return require(String.fromCharCode(102, 115));
|
|
7429
|
-
};
|
|
7430
|
-
exports.addAllFilesFromFolder = s, exports.addFilesForTypesIntoFolder = function(e) {
|
|
7431
|
-
return s(e, "node_modules/@types");
|
|
7432
|
-
}, exports.createDefaultMapFromCDN = function(e, t, r, i, s, o, l) {
|
|
7433
|
-
var a = o || fetch, u = /* @__PURE__ */ new Map(), c = n(e, i), d = "https://typescript.azureedge.net/cdn/" + t + "/typescript/lib/";
|
|
7434
|
-
return (r ? function() {
|
|
7435
|
-
var e = l || localStorage;
|
|
7436
|
-
return Object.keys(e).forEach((function(r) {
|
|
7437
|
-
r.startsWith("ts-lib-") && !r.startsWith("ts-lib-" + t) && e.removeItem(r);
|
|
7438
|
-
})), Promise.all(c.map((function(r) {
|
|
7439
|
-
var i, n = "ts-lib-" + t + "-" + r, o = e.getItem(n);
|
|
7440
|
-
return o ? Promise.resolve((i = o, s ? s.decompressFromUTF16(i) : i)) : a(d + r).then((function(e) {
|
|
7441
|
-
return e.text();
|
|
7442
|
-
})).then((function(t) {
|
|
7443
|
-
var r;
|
|
7444
|
-
return e.setItem(n, (r = t, s ? s.compressToUTF16(r) : r)), t;
|
|
7445
|
-
})).catch((function() {}));
|
|
7446
|
-
}))).then((function(e) {
|
|
7447
|
-
e.forEach((function(e, t) {
|
|
7448
|
-
e && u.set("/" + c[t], e);
|
|
7449
|
-
}));
|
|
7450
|
-
}));
|
|
7451
|
-
} : function() {
|
|
7452
|
-
return Promise.all(c.map((function(e) {
|
|
7453
|
-
return a(d + e).then((function(e) {
|
|
7454
|
-
return e.text();
|
|
7455
|
-
}));
|
|
7456
|
-
}))).then((function(e) {
|
|
7457
|
-
e.forEach((function(e, t) {
|
|
7458
|
-
return u.set("/" + c[t], e);
|
|
7459
|
-
}));
|
|
7460
|
-
})).catch((function() {}));
|
|
7461
|
-
})().then((function() {
|
|
7462
|
-
return u;
|
|
7463
|
-
}));
|
|
7464
|
-
}, exports.createDefaultMapFromNodeModules = function(e, t, r) {
|
|
7465
|
-
var i = f(), n = b(), s = n.readdirSync(r || i.dirname(require.resolve("typescript"))).filter((function(e) {
|
|
7466
|
-
return e.startsWith("lib.") && e.endsWith(".d.ts");
|
|
7467
|
-
})), o = /* @__PURE__ */ new Map();
|
|
7468
|
-
return s.forEach((function(e) {
|
|
7469
|
-
o.set("/" + e, function(e) {
|
|
7470
|
-
var t = r || i.dirname(require.resolve("typescript"));
|
|
7471
|
-
return n.readFileSync(i.join(t, e), "utf8");
|
|
7472
|
-
}(e));
|
|
7473
|
-
})), o;
|
|
7474
|
-
}, exports.createFSBackedSystem = function(e, t, r, i) {
|
|
7475
|
-
var n = t + "/vfs", s = f(), a = r.sys, u = null != i ? i : s.dirname(require.resolve("typescript"));
|
|
7476
|
-
return {
|
|
7477
|
-
name: "fs-vfs",
|
|
7478
|
-
root: n,
|
|
7479
|
-
args: [],
|
|
7480
|
-
createDirectory: function() {
|
|
7481
|
-
return o("createDirectory");
|
|
7482
|
-
},
|
|
7483
|
-
directoryExists: l("directoryExists", (function(t) {
|
|
7484
|
-
return Array.from(e.keys()).some((function(e) {
|
|
7485
|
-
return e.startsWith(t);
|
|
7486
|
-
})) || a.directoryExists(t);
|
|
7487
|
-
})),
|
|
7488
|
-
exit: a.exit,
|
|
7489
|
-
fileExists: l("fileExists", (function(t) {
|
|
7490
|
-
if (e.has(t)) return !0;
|
|
7491
|
-
if (t.includes("tsconfig.json") || t.includes("tsconfig.json")) return !1;
|
|
7492
|
-
if (t.startsWith("/lib")) {
|
|
7493
|
-
var r = u + "/" + t.replace("/", "");
|
|
7494
|
-
return a.fileExists(r);
|
|
7495
|
-
}
|
|
7496
|
-
return a.fileExists(t);
|
|
7497
|
-
})),
|
|
7498
|
-
getCurrentDirectory: function() {
|
|
7499
|
-
return n;
|
|
7500
|
-
},
|
|
7501
|
-
getDirectories: a.getDirectories,
|
|
7502
|
-
getExecutingFilePath: function() {
|
|
7503
|
-
return o("getExecutingFilePath");
|
|
7504
|
-
},
|
|
7505
|
-
readDirectory: l("readDirectory", (function() {
|
|
7506
|
-
return "/" === (arguments.length <= 0 ? void 0 : arguments[0]) ? Array.from(e.keys()) : a.readDirectory.apply(a, arguments);
|
|
7507
|
-
})),
|
|
7508
|
-
readFile: l("readFile", (function(t) {
|
|
7509
|
-
if (e.has(t)) return e.get(t);
|
|
7510
|
-
if (t.startsWith("/lib")) {
|
|
7511
|
-
var r = u + "/" + t.replace("/", ""), i = a.readFile(r);
|
|
7512
|
-
if (!i) {
|
|
7513
|
-
var n = a.readDirectory(u);
|
|
7514
|
-
throw new Error("TSVFS: A request was made for " + r + " but there wasn't a file found in the file map. You likely have a mismatch in the compiler options for the CDN download vs the compiler program. Existing Libs: " + n + ".");
|
|
7515
|
-
}
|
|
7516
|
-
return i;
|
|
7517
|
-
}
|
|
7518
|
-
return a.readFile(t);
|
|
7519
|
-
})),
|
|
7520
|
-
resolvePath: function(t) {
|
|
7521
|
-
return e.has(t) ? t : a.resolvePath(t);
|
|
7522
|
-
},
|
|
7523
|
-
newLine: "\n",
|
|
7524
|
-
useCaseSensitiveFileNames: !0,
|
|
7525
|
-
write: function() {
|
|
7526
|
-
return o("write");
|
|
7527
|
-
},
|
|
7528
|
-
writeFile: function(t, r) {
|
|
7529
|
-
e.set(t, r);
|
|
7530
|
-
}
|
|
7531
|
-
};
|
|
7532
|
-
}, exports.createSystem = function(e) {
|
|
7533
|
-
return {
|
|
7534
|
-
args: [],
|
|
7535
|
-
createDirectory: function() {
|
|
7536
|
-
return o("createDirectory");
|
|
7537
|
-
},
|
|
7538
|
-
directoryExists: l("directoryExists", (function(t) {
|
|
7539
|
-
return Array.from(e.keys()).some((function(e) {
|
|
7540
|
-
return e.startsWith(t);
|
|
7541
|
-
}));
|
|
7542
|
-
})),
|
|
7543
|
-
exit: function() {
|
|
7544
|
-
return o("exit");
|
|
7545
|
-
},
|
|
7546
|
-
fileExists: l("fileExists", (function(t) {
|
|
7547
|
-
return e.has(t) || e.has(u(t));
|
|
7548
|
-
})),
|
|
7549
|
-
getCurrentDirectory: function() {
|
|
7550
|
-
return "/";
|
|
7551
|
-
},
|
|
7552
|
-
getDirectories: function() {
|
|
7553
|
-
return [];
|
|
7554
|
-
},
|
|
7555
|
-
getExecutingFilePath: function() {
|
|
7556
|
-
return o("getExecutingFilePath");
|
|
7557
|
-
},
|
|
7558
|
-
readDirectory: l("readDirectory", (function(t) {
|
|
7559
|
-
return "/" === t ? Array.from(e.keys()) : [];
|
|
7560
|
-
})),
|
|
7561
|
-
readFile: l("readFile", (function(t) {
|
|
7562
|
-
return e.get(t) || e.get(u(t));
|
|
7563
|
-
})),
|
|
7564
|
-
resolvePath: function(e) {
|
|
7565
|
-
return e;
|
|
7566
|
-
},
|
|
7567
|
-
newLine: "\n",
|
|
7568
|
-
useCaseSensitiveFileNames: !0,
|
|
7569
|
-
write: function() {
|
|
7570
|
-
return o("write");
|
|
7571
|
-
},
|
|
7572
|
-
writeFile: function(t, r) {
|
|
7573
|
-
e.set(t, r);
|
|
7574
|
-
}
|
|
7575
|
-
};
|
|
7576
|
-
}, exports.createVirtualCompilerHost = c, exports.createVirtualLanguageServiceHost = d, exports.createVirtualTypeScriptEnvironment = function(t, r, i, n, s) {
|
|
7577
|
-
void 0 === n && (n = {});
|
|
7578
|
-
var o = e({}, a(i), n), l = d(t, r, o, i, s), u = l.updateFile, f = i.createLanguageService(l.languageServiceHost), b = f.getCompilerOptionsDiagnostics();
|
|
7579
|
-
if (b.length) {
|
|
7580
|
-
var p = c(t, n, i);
|
|
7581
|
-
throw new Error(i.formatDiagnostics(b, p.compilerHost));
|
|
7582
|
-
}
|
|
7583
|
-
return {
|
|
7584
|
-
name: "vfs",
|
|
7585
|
-
sys: t,
|
|
7586
|
-
languageService: f,
|
|
7587
|
-
getSourceFile: function(e) {
|
|
7588
|
-
var t;
|
|
7589
|
-
return null == (t = f.getProgram()) ? void 0 : t.getSourceFile(e);
|
|
7590
|
-
},
|
|
7591
|
-
createFile: function(e, t) {
|
|
7592
|
-
u(i.createSourceFile(e, t, o.target, !1));
|
|
7593
|
-
},
|
|
7594
|
-
updateFile: function(e, t, r) {
|
|
7595
|
-
var n = f.getProgram().getSourceFile(e);
|
|
7596
|
-
if (!n) throw new Error("Did not find a source file for " + e);
|
|
7597
|
-
var s = n.text, o = null != r ? r : i.createTextSpan(0, s.length), l = s.slice(0, o.start) + t + s.slice(o.start + o.length);
|
|
7598
|
-
u(i.updateSourceFile(n, l, {
|
|
7599
|
-
span: o,
|
|
7600
|
-
newLength: t.length
|
|
7601
|
-
}));
|
|
7602
|
-
}
|
|
7603
|
-
};
|
|
7604
|
-
}, exports.knownLibFilesForCompilerOptions = n;
|
|
7605
|
-
}));
|
|
7606
|
-
|
|
7607
|
-
//#endregion
|
|
7608
|
-
//#region ../../../node_modules/.pnpm/@typescript+vfs@1.5.0/node_modules/@typescript/vfs/dist/vfs.cjs.development.js
|
|
7609
|
-
var require_vfs_cjs_development = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((exports) => {
|
|
7610
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7611
|
-
function _extends() {
|
|
7612
|
-
_extends = Object.assign || function(target) {
|
|
7613
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
7614
|
-
var source = arguments[i];
|
|
7615
|
-
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
7616
|
-
}
|
|
7617
|
-
return target;
|
|
7618
|
-
};
|
|
7619
|
-
return _extends.apply(this, arguments);
|
|
7620
|
-
}
|
|
7621
|
-
var hasLocalStorage = false;
|
|
7622
|
-
try {
|
|
7623
|
-
hasLocalStorage = typeof localStorage !== "undefined";
|
|
7624
|
-
} catch (error) {}
|
|
7625
|
-
var hasProcess = typeof process !== "undefined";
|
|
7626
|
-
var debugLog = hasLocalStorage && /*#__PURE__*/ localStorage.getItem("DEBUG") || hasProcess && process.env.DEBUG ? console.log : function(_message) {
|
|
7627
|
-
return "";
|
|
7628
|
-
};
|
|
7629
|
-
/**
|
|
7630
|
-
* Makes a virtual copy of the TypeScript environment. This is the main API you want to be using with
|
|
7631
|
-
* @typescript/vfs. A lot of the other exposed functions are used by this function to get set up.
|
|
7632
|
-
*
|
|
7633
|
-
* @param sys an object which conforms to the TS Sys (a shim over read/write access to the fs)
|
|
7634
|
-
* @param rootFiles a list of files which are considered inside the project
|
|
7635
|
-
* @param ts a copy pf the TypeScript module
|
|
7636
|
-
* @param compilerOptions the options for this compiler run
|
|
7637
|
-
* @param customTransformers custom transformers for this compiler run
|
|
7638
|
-
*/
|
|
7639
|
-
function createVirtualTypeScriptEnvironment(sys, rootFiles, ts, compilerOptions, customTransformers) {
|
|
7640
|
-
if (compilerOptions === void 0) compilerOptions = {};
|
|
7641
|
-
var mergedCompilerOpts = _extends({}, defaultCompilerOptions(ts), compilerOptions);
|
|
7642
|
-
var _createVirtualLanguag = createVirtualLanguageServiceHost(sys, rootFiles, mergedCompilerOpts, ts, customTransformers), languageServiceHost = _createVirtualLanguag.languageServiceHost, _updateFile = _createVirtualLanguag.updateFile;
|
|
7643
|
-
var languageService = ts.createLanguageService(languageServiceHost);
|
|
7644
|
-
var diagnostics = languageService.getCompilerOptionsDiagnostics();
|
|
7645
|
-
if (diagnostics.length) {
|
|
7646
|
-
var compilerHost = createVirtualCompilerHost(sys, compilerOptions, ts);
|
|
7647
|
-
throw new Error(ts.formatDiagnostics(diagnostics, compilerHost.compilerHost));
|
|
7648
|
-
}
|
|
7649
|
-
return {
|
|
7650
|
-
name: "vfs",
|
|
7651
|
-
sys,
|
|
7652
|
-
languageService,
|
|
7653
|
-
getSourceFile: function getSourceFile(fileName) {
|
|
7654
|
-
var _languageService$getP;
|
|
7655
|
-
return (_languageService$getP = languageService.getProgram()) == null ? void 0 : _languageService$getP.getSourceFile(fileName);
|
|
7656
|
-
},
|
|
7657
|
-
createFile: function createFile(fileName, content) {
|
|
7658
|
-
_updateFile(ts.createSourceFile(fileName, content, mergedCompilerOpts.target, false));
|
|
7659
|
-
},
|
|
7660
|
-
updateFile: function updateFile(fileName, content, optPrevTextSpan) {
|
|
7661
|
-
var prevSourceFile = languageService.getProgram().getSourceFile(fileName);
|
|
7662
|
-
if (!prevSourceFile) throw new Error("Did not find a source file for " + fileName);
|
|
7663
|
-
var prevFullContents = prevSourceFile.text;
|
|
7664
|
-
var prevTextSpan = optPrevTextSpan != null ? optPrevTextSpan : ts.createTextSpan(0, prevFullContents.length);
|
|
7665
|
-
var newText = prevFullContents.slice(0, prevTextSpan.start) + content + prevFullContents.slice(prevTextSpan.start + prevTextSpan.length);
|
|
7666
|
-
_updateFile(ts.updateSourceFile(prevSourceFile, newText, {
|
|
7667
|
-
span: prevTextSpan,
|
|
7668
|
-
newLength: content.length
|
|
7669
|
-
}));
|
|
7670
|
-
}
|
|
7671
|
-
};
|
|
7672
|
-
}
|
|
7673
|
-
/**
|
|
7674
|
-
* Grab the list of lib files for a particular target, will return a bit more than necessary (by including
|
|
7675
|
-
* the dom) but that's OK, we're really working with the constraint that you can't get a list of files
|
|
7676
|
-
* when running in a browser.
|
|
7677
|
-
*
|
|
7678
|
-
* @param target The compiler settings target baseline
|
|
7679
|
-
* @param ts A copy of the TypeScript module
|
|
7680
|
-
*/
|
|
7681
|
-
var knownLibFilesForCompilerOptions = function knownLibFilesForCompilerOptions(compilerOptions, ts) {
|
|
7682
|
-
var target = compilerOptions.target || ts.ScriptTarget.ES5;
|
|
7683
|
-
var lib = compilerOptions.lib || [];
|
|
7684
|
-
var files = [
|
|
7685
|
-
"lib.d.ts",
|
|
7686
|
-
"lib.decorators.d.ts",
|
|
7687
|
-
"lib.decorators.legacy.d.ts",
|
|
7688
|
-
"lib.dom.d.ts",
|
|
7689
|
-
"lib.dom.iterable.d.ts",
|
|
7690
|
-
"lib.webworker.d.ts",
|
|
7691
|
-
"lib.webworker.importscripts.d.ts",
|
|
7692
|
-
"lib.webworker.iterable.d.ts",
|
|
7693
|
-
"lib.scripthost.d.ts",
|
|
7694
|
-
"lib.es5.d.ts",
|
|
7695
|
-
"lib.es6.d.ts",
|
|
7696
|
-
"lib.es2015.collection.d.ts",
|
|
7697
|
-
"lib.es2015.core.d.ts",
|
|
7698
|
-
"lib.es2015.d.ts",
|
|
7699
|
-
"lib.es2015.generator.d.ts",
|
|
7700
|
-
"lib.es2015.iterable.d.ts",
|
|
7701
|
-
"lib.es2015.promise.d.ts",
|
|
7702
|
-
"lib.es2015.proxy.d.ts",
|
|
7703
|
-
"lib.es2015.reflect.d.ts",
|
|
7704
|
-
"lib.es2015.symbol.d.ts",
|
|
7705
|
-
"lib.es2015.symbol.wellknown.d.ts",
|
|
7706
|
-
"lib.es2016.array.include.d.ts",
|
|
7707
|
-
"lib.es2016.d.ts",
|
|
7708
|
-
"lib.es2016.full.d.ts",
|
|
7709
|
-
"lib.es2017.d.ts",
|
|
7710
|
-
"lib.es2017.date.d.ts",
|
|
7711
|
-
"lib.es2017.full.d.ts",
|
|
7712
|
-
"lib.es2017.intl.d.ts",
|
|
7713
|
-
"lib.es2017.object.d.ts",
|
|
7714
|
-
"lib.es2017.sharedmemory.d.ts",
|
|
7715
|
-
"lib.es2017.string.d.ts",
|
|
7716
|
-
"lib.es2017.typedarrays.d.ts",
|
|
7717
|
-
"lib.es2018.asyncgenerator.d.ts",
|
|
7718
|
-
"lib.es2018.asynciterable.d.ts",
|
|
7719
|
-
"lib.es2018.d.ts",
|
|
7720
|
-
"lib.es2018.full.d.ts",
|
|
7721
|
-
"lib.es2018.intl.d.ts",
|
|
7722
|
-
"lib.es2018.promise.d.ts",
|
|
7723
|
-
"lib.es2018.regexp.d.ts",
|
|
7724
|
-
"lib.es2019.array.d.ts",
|
|
7725
|
-
"lib.es2019.d.ts",
|
|
7726
|
-
"lib.es2019.full.d.ts",
|
|
7727
|
-
"lib.es2019.intl.d.ts",
|
|
7728
|
-
"lib.es2019.object.d.ts",
|
|
7729
|
-
"lib.es2019.string.d.ts",
|
|
7730
|
-
"lib.es2019.symbol.d.ts",
|
|
7731
|
-
"lib.es2020.bigint.d.ts",
|
|
7732
|
-
"lib.es2020.d.ts",
|
|
7733
|
-
"lib.es2020.date.d.ts",
|
|
7734
|
-
"lib.es2020.full.d.ts",
|
|
7735
|
-
"lib.es2020.intl.d.ts",
|
|
7736
|
-
"lib.es2020.number.d.ts",
|
|
7737
|
-
"lib.es2020.promise.d.ts",
|
|
7738
|
-
"lib.es2020.sharedmemory.d.ts",
|
|
7739
|
-
"lib.es2020.string.d.ts",
|
|
7740
|
-
"lib.es2020.symbol.wellknown.d.ts",
|
|
7741
|
-
"lib.es2021.d.ts",
|
|
7742
|
-
"lib.es2021.full.d.ts",
|
|
7743
|
-
"lib.es2021.intl.d.ts",
|
|
7744
|
-
"lib.es2021.promise.d.ts",
|
|
7745
|
-
"lib.es2021.string.d.ts",
|
|
7746
|
-
"lib.es2021.weakref.d.ts",
|
|
7747
|
-
"lib.es2022.array.d.ts",
|
|
7748
|
-
"lib.es2022.d.ts",
|
|
7749
|
-
"lib.es2022.error.d.ts",
|
|
7750
|
-
"lib.es2022.full.d.ts",
|
|
7751
|
-
"lib.es2022.intl.d.ts",
|
|
7752
|
-
"lib.es2022.object.d.ts",
|
|
7753
|
-
"lib.es2022.regexp.d.ts",
|
|
7754
|
-
"lib.es2022.sharedmemory.d.ts",
|
|
7755
|
-
"lib.es2022.string.d.ts",
|
|
7756
|
-
"lib.es2023.array.d.ts",
|
|
7757
|
-
"lib.es2023.collection.d.ts",
|
|
7758
|
-
"lib.es2023.d.ts",
|
|
7759
|
-
"lib.es2023.full.d.ts",
|
|
7760
|
-
"lib.esnext.array.d.ts",
|
|
7761
|
-
"lib.esnext.asynciterable.d.ts",
|
|
7762
|
-
"lib.esnext.bigint.d.ts",
|
|
7763
|
-
"lib.esnext.d.ts",
|
|
7764
|
-
"lib.esnext.decorators.d.ts",
|
|
7765
|
-
"lib.esnext.disposable.d.ts",
|
|
7766
|
-
"lib.esnext.full.d.ts",
|
|
7767
|
-
"lib.esnext.intl.d.ts",
|
|
7768
|
-
"lib.esnext.promise.d.ts",
|
|
7769
|
-
"lib.esnext.string.d.ts",
|
|
7770
|
-
"lib.esnext.symbol.d.ts",
|
|
7771
|
-
"lib.esnext.weakref.d.ts"
|
|
7772
|
-
];
|
|
7773
|
-
var targetToCut = ts.ScriptTarget[target];
|
|
7774
|
-
var matches = files.filter(function(f) {
|
|
7775
|
-
return f.startsWith("lib." + targetToCut.toLowerCase());
|
|
7776
|
-
});
|
|
7777
|
-
var targetCutIndex = files.indexOf(matches.pop());
|
|
7778
|
-
var libCutIndex = function getMax(array) {
|
|
7779
|
-
return array && array.length ? array.reduce(function(max, current) {
|
|
7780
|
-
return current > max ? current : max;
|
|
7781
|
-
}) : void 0;
|
|
7782
|
-
}(lib.map(function(lib) {
|
|
7783
|
-
var matches = files.filter(function(f) {
|
|
7784
|
-
return f.startsWith("lib." + lib.toLowerCase());
|
|
7785
|
-
});
|
|
7786
|
-
if (matches.length === 0) return 0;
|
|
7787
|
-
return files.indexOf(matches.pop());
|
|
7788
|
-
})) || 0;
|
|
7789
|
-
var finalCutIndex = Math.max(targetCutIndex, libCutIndex);
|
|
7790
|
-
return files.slice(0, finalCutIndex + 1);
|
|
7791
|
-
};
|
|
7792
|
-
/**
|
|
7793
|
-
* Sets up a Map with lib contents by grabbing the necessary files from
|
|
7794
|
-
* the local copy of typescript via the file system.
|
|
7795
|
-
*
|
|
7796
|
-
* The first two args are un-used, but kept around so as to not cause a
|
|
7797
|
-
* semver major bump for no gain to module users.
|
|
7798
|
-
*/
|
|
7799
|
-
var createDefaultMapFromNodeModules = function createDefaultMapFromNodeModules(_compilerOptions, _ts, tsLibDirectory) {
|
|
7800
|
-
var path = requirePath();
|
|
7801
|
-
var fs = requireFS();
|
|
7802
|
-
var getLib = function getLib(name) {
|
|
7803
|
-
var lib = tsLibDirectory || path.dirname(require.resolve("typescript"));
|
|
7804
|
-
return fs.readFileSync(path.join(lib, name), "utf8");
|
|
7805
|
-
};
|
|
7806
|
-
var knownLibFiles = fs.readdirSync(tsLibDirectory || path.dirname(require.resolve("typescript"))).filter(function(f) {
|
|
7807
|
-
return f.startsWith("lib.") && f.endsWith(".d.ts");
|
|
7808
|
-
});
|
|
7809
|
-
var fsMap = /* @__PURE__ */ new Map();
|
|
7810
|
-
knownLibFiles.forEach(function(lib) {
|
|
7811
|
-
fsMap.set("/" + lib, getLib(lib));
|
|
7812
|
-
});
|
|
7813
|
-
return fsMap;
|
|
7814
|
-
};
|
|
7815
|
-
/**
|
|
7816
|
-
* Adds recursively files from the FS into the map based on the folder
|
|
7817
|
-
*/
|
|
7818
|
-
var addAllFilesFromFolder = function addAllFilesFromFolder(map, workingDir) {
|
|
7819
|
-
var path = requirePath();
|
|
7820
|
-
var fs = requireFS();
|
|
7821
|
-
(function walk(dir) {
|
|
7822
|
-
var results = [];
|
|
7823
|
-
fs.readdirSync(dir).forEach(function(file) {
|
|
7824
|
-
file = path.join(dir, file);
|
|
7825
|
-
var stat = fs.statSync(file);
|
|
7826
|
-
if (stat && stat.isDirectory()) results = results.concat(walk(file));
|
|
7827
|
-
else results.push(file);
|
|
7828
|
-
});
|
|
7829
|
-
return results;
|
|
7830
|
-
})(workingDir).forEach(function(lib) {
|
|
7831
|
-
var fsPath = "/node_modules/@types" + lib.replace(workingDir, "");
|
|
7832
|
-
var content = fs.readFileSync(lib, "utf8");
|
|
7833
|
-
if ([".ts", ".tsx"].includes(path.extname(fsPath))) map.set(fsPath, content);
|
|
7834
|
-
});
|
|
7835
|
-
};
|
|
7836
|
-
/** Adds all files from node_modules/@types into the FS Map */
|
|
7837
|
-
var addFilesForTypesIntoFolder = function addFilesForTypesIntoFolder(map) {
|
|
7838
|
-
return addAllFilesFromFolder(map, "node_modules/@types");
|
|
7839
|
-
};
|
|
7840
|
-
/**
|
|
7841
|
-
* Create a virtual FS Map with the lib files from a particular TypeScript
|
|
7842
|
-
* version based on the target, Always includes dom ATM.
|
|
7843
|
-
*
|
|
7844
|
-
* @param options The compiler target, which dictates the libs to set up
|
|
7845
|
-
* @param version the versions of TypeScript which are supported
|
|
7846
|
-
* @param cache should the values be stored in local storage
|
|
7847
|
-
* @param ts a copy of the typescript import
|
|
7848
|
-
* @param lzstring an optional copy of the lz-string import
|
|
7849
|
-
* @param fetcher an optional replacement for the global fetch function (tests mainly)
|
|
7850
|
-
* @param storer an optional replacement for the localStorage global (tests mainly)
|
|
7851
|
-
*/
|
|
7852
|
-
var createDefaultMapFromCDN = function createDefaultMapFromCDN(options, version, cache, ts, lzstring, fetcher, storer) {
|
|
7853
|
-
var fetchlike = fetcher || fetch;
|
|
7854
|
-
var fsMap = /* @__PURE__ */ new Map();
|
|
7855
|
-
var files = knownLibFilesForCompilerOptions(options, ts);
|
|
7856
|
-
var prefix = "https://typescript.azureedge.net/cdn/" + version + "/typescript/lib/";
|
|
7857
|
-
function zip(str) {
|
|
7858
|
-
return lzstring ? lzstring.compressToUTF16(str) : str;
|
|
7859
|
-
}
|
|
7860
|
-
function unzip(str) {
|
|
7861
|
-
return lzstring ? lzstring.decompressFromUTF16(str) : str;
|
|
7862
|
-
}
|
|
7863
|
-
function uncached() {
|
|
7864
|
-
return Promise.all(files.map(function(lib) {
|
|
7865
|
-
return fetchlike(prefix + lib).then(function(resp) {
|
|
7866
|
-
return resp.text();
|
|
7867
|
-
});
|
|
7868
|
-
})).then(function(contents) {
|
|
7869
|
-
contents.forEach(function(text, index) {
|
|
7870
|
-
return fsMap.set("/" + files[index], text);
|
|
7871
|
-
});
|
|
7872
|
-
})["catch"](function() {});
|
|
7873
|
-
}
|
|
7874
|
-
function cached() {
|
|
7875
|
-
var storelike = storer || localStorage;
|
|
7876
|
-
Object.keys(storelike).forEach(function(key) {
|
|
7877
|
-
if (key.startsWith("ts-lib-") && !key.startsWith("ts-lib-" + version)) storelike.removeItem(key);
|
|
7878
|
-
});
|
|
7879
|
-
return Promise.all(files.map(function(lib) {
|
|
7880
|
-
var cacheKey = "ts-lib-" + version + "-" + lib;
|
|
7881
|
-
var content = storelike.getItem(cacheKey);
|
|
7882
|
-
if (!content) return fetchlike(prefix + lib).then(function(resp) {
|
|
7883
|
-
return resp.text();
|
|
7884
|
-
}).then(function(t) {
|
|
7885
|
-
storelike.setItem(cacheKey, zip(t));
|
|
7886
|
-
return t;
|
|
7887
|
-
})["catch"](function() {});
|
|
7888
|
-
else return Promise.resolve(unzip(content));
|
|
7889
|
-
})).then(function(contents) {
|
|
7890
|
-
contents.forEach(function(text, index) {
|
|
7891
|
-
if (text) {
|
|
7892
|
-
var name = "/" + files[index];
|
|
7893
|
-
fsMap.set(name, text);
|
|
7894
|
-
}
|
|
7895
|
-
});
|
|
7896
|
-
});
|
|
7897
|
-
}
|
|
7898
|
-
return (cache ? cached : uncached)().then(function() {
|
|
7899
|
-
return fsMap;
|
|
7900
|
-
});
|
|
7901
|
-
};
|
|
7902
|
-
function notImplemented(methodName) {
|
|
7903
|
-
throw new Error("Method '" + methodName + "' is not implemented.");
|
|
7904
|
-
}
|
|
7905
|
-
function audit(name, fn) {
|
|
7906
|
-
return function() {
|
|
7907
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
|
|
7908
|
-
var res = fn.apply(void 0, args);
|
|
7909
|
-
var smallres = typeof res === "string" ? res.slice(0, 80) + "..." : res;
|
|
7910
|
-
debugLog.apply(void 0, ["> " + name].concat(args));
|
|
7911
|
-
debugLog("< " + smallres);
|
|
7912
|
-
return res;
|
|
7913
|
-
};
|
|
7914
|
-
}
|
|
7915
|
-
/** The default compiler options if TypeScript could ever change the compiler options */
|
|
7916
|
-
var defaultCompilerOptions = function defaultCompilerOptions(ts) {
|
|
7917
|
-
return _extends({}, ts.getDefaultCompilerOptions(), {
|
|
7918
|
-
jsx: ts.JsxEmit.React,
|
|
7919
|
-
strict: true,
|
|
7920
|
-
esModuleInterop: true,
|
|
7921
|
-
module: ts.ModuleKind.ESNext,
|
|
7922
|
-
suppressOutputPathCheck: true,
|
|
7923
|
-
skipLibCheck: true,
|
|
7924
|
-
skipDefaultLibCheck: true,
|
|
7925
|
-
moduleResolution: ts.ModuleResolutionKind.NodeJs
|
|
7926
|
-
});
|
|
7927
|
-
};
|
|
7928
|
-
var libize = function libize(path) {
|
|
7929
|
-
return path.replace("/", "/lib.").toLowerCase();
|
|
7930
|
-
};
|
|
7931
|
-
/**
|
|
7932
|
-
* Creates an in-memory System object which can be used in a TypeScript program, this
|
|
7933
|
-
* is what provides read/write aspects of the virtual fs
|
|
7934
|
-
*/
|
|
7935
|
-
function createSystem(files) {
|
|
7936
|
-
return {
|
|
7937
|
-
args: [],
|
|
7938
|
-
createDirectory: function createDirectory() {
|
|
7939
|
-
return notImplemented("createDirectory");
|
|
7940
|
-
},
|
|
7941
|
-
directoryExists: audit("directoryExists", function(directory) {
|
|
7942
|
-
return Array.from(files.keys()).some(function(path) {
|
|
7943
|
-
return path.startsWith(directory);
|
|
7944
|
-
});
|
|
7945
|
-
}),
|
|
7946
|
-
exit: function exit() {
|
|
7947
|
-
return notImplemented("exit");
|
|
7948
|
-
},
|
|
7949
|
-
fileExists: audit("fileExists", function(fileName) {
|
|
7950
|
-
return files.has(fileName) || files.has(libize(fileName));
|
|
7951
|
-
}),
|
|
7952
|
-
getCurrentDirectory: function getCurrentDirectory() {
|
|
7953
|
-
return "/";
|
|
7954
|
-
},
|
|
7955
|
-
getDirectories: function getDirectories() {
|
|
7956
|
-
return [];
|
|
7957
|
-
},
|
|
7958
|
-
getExecutingFilePath: function getExecutingFilePath() {
|
|
7959
|
-
return notImplemented("getExecutingFilePath");
|
|
7960
|
-
},
|
|
7961
|
-
readDirectory: audit("readDirectory", function(directory) {
|
|
7962
|
-
return directory === "/" ? Array.from(files.keys()) : [];
|
|
7963
|
-
}),
|
|
7964
|
-
readFile: audit("readFile", function(fileName) {
|
|
7965
|
-
return files.get(fileName) || files.get(libize(fileName));
|
|
7966
|
-
}),
|
|
7967
|
-
resolvePath: function resolvePath(path) {
|
|
7968
|
-
return path;
|
|
7969
|
-
},
|
|
7970
|
-
newLine: "\n",
|
|
7971
|
-
useCaseSensitiveFileNames: true,
|
|
7972
|
-
write: function write() {
|
|
7973
|
-
return notImplemented("write");
|
|
7974
|
-
},
|
|
7975
|
-
writeFile: function writeFile(fileName, contents) {
|
|
7976
|
-
files.set(fileName, contents);
|
|
7977
|
-
}
|
|
7978
|
-
};
|
|
7979
|
-
}
|
|
7980
|
-
/**
|
|
7981
|
-
* Creates a file-system backed System object which can be used in a TypeScript program, you provide
|
|
7982
|
-
* a set of virtual files which are prioritised over the FS versions, then a path to the root of your
|
|
7983
|
-
* project (basically the folder your node_modules lives)
|
|
7984
|
-
*/
|
|
7985
|
-
function createFSBackedSystem(files, _projectRoot, ts, tsLibDirectory) {
|
|
7986
|
-
var root = _projectRoot + "/vfs";
|
|
7987
|
-
var path = requirePath();
|
|
7988
|
-
var nodeSys = ts.sys;
|
|
7989
|
-
var tsLib = tsLibDirectory != null ? tsLibDirectory : path.dirname(require.resolve("typescript"));
|
|
7990
|
-
return {
|
|
7991
|
-
name: "fs-vfs",
|
|
7992
|
-
root,
|
|
7993
|
-
args: [],
|
|
7994
|
-
createDirectory: function createDirectory() {
|
|
7995
|
-
return notImplemented("createDirectory");
|
|
7996
|
-
},
|
|
7997
|
-
directoryExists: audit("directoryExists", function(directory) {
|
|
7998
|
-
return Array.from(files.keys()).some(function(path) {
|
|
7999
|
-
return path.startsWith(directory);
|
|
8000
|
-
}) || nodeSys.directoryExists(directory);
|
|
8001
|
-
}),
|
|
8002
|
-
exit: nodeSys.exit,
|
|
8003
|
-
fileExists: audit("fileExists", function(fileName) {
|
|
8004
|
-
if (files.has(fileName)) return true;
|
|
8005
|
-
if (fileName.includes("tsconfig.json") || fileName.includes("tsconfig.json")) return false;
|
|
8006
|
-
if (fileName.startsWith("/lib")) {
|
|
8007
|
-
var tsLibName = tsLib + "/" + fileName.replace("/", "");
|
|
8008
|
-
return nodeSys.fileExists(tsLibName);
|
|
8009
|
-
}
|
|
8010
|
-
return nodeSys.fileExists(fileName);
|
|
8011
|
-
}),
|
|
8012
|
-
getCurrentDirectory: function getCurrentDirectory() {
|
|
8013
|
-
return root;
|
|
8014
|
-
},
|
|
8015
|
-
getDirectories: nodeSys.getDirectories,
|
|
8016
|
-
getExecutingFilePath: function getExecutingFilePath() {
|
|
8017
|
-
return notImplemented("getExecutingFilePath");
|
|
8018
|
-
},
|
|
8019
|
-
readDirectory: audit("readDirectory", function() {
|
|
8020
|
-
if ((arguments.length <= 0 ? void 0 : arguments[0]) === "/") return Array.from(files.keys());
|
|
8021
|
-
else return nodeSys.readDirectory.apply(nodeSys, arguments);
|
|
8022
|
-
}),
|
|
8023
|
-
readFile: audit("readFile", function(fileName) {
|
|
8024
|
-
if (files.has(fileName)) return files.get(fileName);
|
|
8025
|
-
if (fileName.startsWith("/lib")) {
|
|
8026
|
-
var tsLibName = tsLib + "/" + fileName.replace("/", "");
|
|
8027
|
-
var result = nodeSys.readFile(tsLibName);
|
|
8028
|
-
if (!result) {
|
|
8029
|
-
var libs = nodeSys.readDirectory(tsLib);
|
|
8030
|
-
throw new Error("TSVFS: A request was made for " + tsLibName + " but there wasn't a file found in the file map. You likely have a mismatch in the compiler options for the CDN download vs the compiler program. Existing Libs: " + libs + ".");
|
|
8031
|
-
}
|
|
8032
|
-
return result;
|
|
8033
|
-
}
|
|
8034
|
-
return nodeSys.readFile(fileName);
|
|
8035
|
-
}),
|
|
8036
|
-
resolvePath: function resolvePath(path) {
|
|
8037
|
-
if (files.has(path)) return path;
|
|
8038
|
-
return nodeSys.resolvePath(path);
|
|
8039
|
-
},
|
|
8040
|
-
newLine: "\n",
|
|
8041
|
-
useCaseSensitiveFileNames: true,
|
|
8042
|
-
write: function write() {
|
|
8043
|
-
return notImplemented("write");
|
|
8044
|
-
},
|
|
8045
|
-
writeFile: function writeFile(fileName, contents) {
|
|
8046
|
-
files.set(fileName, contents);
|
|
8047
|
-
}
|
|
8048
|
-
};
|
|
8049
|
-
}
|
|
8050
|
-
/**
|
|
8051
|
-
* Creates an in-memory CompilerHost -which is essentially an extra wrapper to System
|
|
8052
|
-
* which works with TypeScript objects - returns both a compiler host, and a way to add new SourceFile
|
|
8053
|
-
* instances to the in-memory file system.
|
|
8054
|
-
*/
|
|
8055
|
-
function createVirtualCompilerHost(sys, compilerOptions, ts) {
|
|
8056
|
-
var sourceFiles = /* @__PURE__ */ new Map();
|
|
8057
|
-
var save = function save(sourceFile) {
|
|
8058
|
-
sourceFiles.set(sourceFile.fileName, sourceFile);
|
|
8059
|
-
return sourceFile;
|
|
8060
|
-
};
|
|
8061
|
-
return {
|
|
8062
|
-
compilerHost: _extends({}, sys, {
|
|
8063
|
-
getCanonicalFileName: function getCanonicalFileName(fileName) {
|
|
8064
|
-
return fileName;
|
|
8065
|
-
},
|
|
8066
|
-
getDefaultLibFileName: function getDefaultLibFileName() {
|
|
8067
|
-
return "/" + ts.getDefaultLibFileName(compilerOptions);
|
|
8068
|
-
},
|
|
8069
|
-
getDirectories: function getDirectories() {
|
|
8070
|
-
return [];
|
|
8071
|
-
},
|
|
8072
|
-
getNewLine: function getNewLine() {
|
|
8073
|
-
return sys.newLine;
|
|
8074
|
-
},
|
|
8075
|
-
getSourceFile: function getSourceFile(fileName) {
|
|
8076
|
-
return sourceFiles.get(fileName) || save(ts.createSourceFile(fileName, sys.readFile(fileName), compilerOptions.target || defaultCompilerOptions(ts).target, false));
|
|
8077
|
-
},
|
|
8078
|
-
useCaseSensitiveFileNames: function useCaseSensitiveFileNames() {
|
|
8079
|
-
return sys.useCaseSensitiveFileNames;
|
|
8080
|
-
}
|
|
8081
|
-
}),
|
|
8082
|
-
updateFile: function updateFile(sourceFile) {
|
|
8083
|
-
var alreadyExists = sourceFiles.has(sourceFile.fileName);
|
|
8084
|
-
sys.writeFile(sourceFile.fileName, sourceFile.text);
|
|
8085
|
-
sourceFiles.set(sourceFile.fileName, sourceFile);
|
|
8086
|
-
return alreadyExists;
|
|
8087
|
-
}
|
|
8088
|
-
};
|
|
8089
|
-
}
|
|
8090
|
-
/**
|
|
8091
|
-
* Creates an object which can host a language service against the virtual file-system
|
|
8092
|
-
*/
|
|
8093
|
-
function createVirtualLanguageServiceHost(sys, rootFiles, compilerOptions, ts, customTransformers) {
|
|
8094
|
-
var fileNames = [].concat(rootFiles);
|
|
8095
|
-
var _createVirtualCompile = createVirtualCompilerHost(sys, compilerOptions, ts), compilerHost = _createVirtualCompile.compilerHost, _updateFile2 = _createVirtualCompile.updateFile;
|
|
8096
|
-
var fileVersions = /* @__PURE__ */ new Map();
|
|
8097
|
-
var projectVersion = 0;
|
|
8098
|
-
return {
|
|
8099
|
-
languageServiceHost: _extends({}, compilerHost, {
|
|
8100
|
-
getProjectVersion: function getProjectVersion() {
|
|
8101
|
-
return projectVersion.toString();
|
|
8102
|
-
},
|
|
8103
|
-
getCompilationSettings: function getCompilationSettings() {
|
|
8104
|
-
return compilerOptions;
|
|
8105
|
-
},
|
|
8106
|
-
getCustomTransformers: function getCustomTransformers() {
|
|
8107
|
-
return customTransformers;
|
|
8108
|
-
},
|
|
8109
|
-
getScriptFileNames: function getScriptFileNames() {
|
|
8110
|
-
return fileNames.slice();
|
|
8111
|
-
},
|
|
8112
|
-
getScriptSnapshot: function getScriptSnapshot(fileName) {
|
|
8113
|
-
var contents = sys.readFile(fileName);
|
|
8114
|
-
if (contents) return ts.ScriptSnapshot.fromString(contents);
|
|
8115
|
-
},
|
|
8116
|
-
getScriptVersion: function getScriptVersion(fileName) {
|
|
8117
|
-
return fileVersions.get(fileName) || "0";
|
|
8118
|
-
},
|
|
8119
|
-
writeFile: sys.writeFile
|
|
8120
|
-
}),
|
|
8121
|
-
updateFile: function updateFile(sourceFile) {
|
|
8122
|
-
projectVersion++;
|
|
8123
|
-
fileVersions.set(sourceFile.fileName, projectVersion.toString());
|
|
8124
|
-
if (!fileNames.includes(sourceFile.fileName)) fileNames.push(sourceFile.fileName);
|
|
8125
|
-
_updateFile2(sourceFile);
|
|
8126
|
-
}
|
|
8127
|
-
};
|
|
8128
|
-
}
|
|
8129
|
-
var requirePath = function requirePath() {
|
|
8130
|
-
return require(String.fromCharCode(112, 97, 116, 104));
|
|
8131
|
-
};
|
|
8132
|
-
var requireFS = function requireFS() {
|
|
8133
|
-
return require(String.fromCharCode(102, 115));
|
|
8134
|
-
};
|
|
8135
|
-
exports.addAllFilesFromFolder = addAllFilesFromFolder;
|
|
8136
|
-
exports.addFilesForTypesIntoFolder = addFilesForTypesIntoFolder;
|
|
8137
|
-
exports.createDefaultMapFromCDN = createDefaultMapFromCDN;
|
|
8138
|
-
exports.createDefaultMapFromNodeModules = createDefaultMapFromNodeModules;
|
|
8139
|
-
exports.createFSBackedSystem = createFSBackedSystem;
|
|
8140
|
-
exports.createSystem = createSystem;
|
|
8141
|
-
exports.createVirtualCompilerHost = createVirtualCompilerHost;
|
|
8142
|
-
exports.createVirtualLanguageServiceHost = createVirtualLanguageServiceHost;
|
|
8143
|
-
exports.createVirtualTypeScriptEnvironment = createVirtualTypeScriptEnvironment;
|
|
8144
|
-
exports.knownLibFilesForCompilerOptions = knownLibFilesForCompilerOptions;
|
|
8145
|
-
}));
|
|
8146
|
-
|
|
8147
|
-
//#endregion
|
|
8148
|
-
//#region ../../../node_modules/.pnpm/@typescript+vfs@1.5.0/node_modules/@typescript/vfs/dist/index.js
|
|
8149
|
-
var require_dist = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((exports, module) => {
|
|
8150
|
-
if (process.env.NODE_ENV === "production") module.exports = require_vfs_cjs_production_min();
|
|
8151
|
-
else module.exports = require_vfs_cjs_development();
|
|
8152
|
-
}));
|
|
8153
|
-
|
|
8154
7204
|
//#endregion
|
|
8155
7205
|
//#region ../../../node_modules/.pnpm/@deepkit+type-compiler@1.0.19_patch_hash=bd438188cbc12e606ed4d519c25ab921a833fbc2d92357_eb3d1bbe57b0b2f8921a5c1688746a82/node_modules/@deepkit/type-compiler/dist/esm/src/debug.js
|
|
8156
|
-
var import_dist = require_dist();
|
|
8157
7206
|
function isDebug(level = 1) {
|
|
8158
7207
|
const expected = "deepkit" + (level > 1 ? "+".repeat(level - 1) : "");
|
|
8159
7208
|
return "undefined" !== typeof process && "string" === typeof process.env.DEBUG && process.env.DEBUG.includes(expected);
|
|
@@ -9418,7 +8467,7 @@ var ReflectionTransformer = class {
|
|
|
9418
8467
|
this.cache.globalSourceFiles = [];
|
|
9419
8468
|
const options = { ...this.compilerOptions };
|
|
9420
8469
|
if (options.target && options.target === ScriptTarget.ESNext) options.target = ScriptTarget.ES2022;
|
|
9421
|
-
const libs = (0,
|
|
8470
|
+
const libs = (0, _typescript_vfs.knownLibFilesForCompilerOptions)(options, typescript.default);
|
|
9422
8471
|
for (const lib of libs) {
|
|
9423
8472
|
if (this.isExcluded(lib)) continue;
|
|
9424
8473
|
const sourceFile = this.resolver.resolveSourceFile(this.sourceFile, this.f.createStringLiteral("typescript/lib/" + lib.replace(".d.ts", "")));
|
package/dist/deepkit.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_deepkit = require('./deepkit-
|
|
2
|
+
const require_deepkit = require('./deepkit-DdL6PozG.cjs');
|
|
3
3
|
|
|
4
4
|
exports.Cache = require_deepkit.Cache;
|
|
5
5
|
exports.DeclarationTransformer = require_deepkit.DeclarationTransformer;
|
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
const require_rolldown_runtime = require('./rolldown-runtime-7nYvXII6.cjs');
|
|
3
3
|
const require_constants = require('./constants-CPMTQEYP.cjs');
|
|
4
4
|
const require_helpers = require('./helpers-LhLPb88g.cjs');
|
|
5
|
-
const require_deepkit = require('./deepkit-
|
|
5
|
+
const require_deepkit = require('./deepkit-DdL6PozG.cjs');
|
|
6
6
|
const require_codegen = require('./codegen.cjs');
|
|
7
7
|
const require_storage = require('./storage-BTI2epDz.cjs');
|
|
8
8
|
let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@power-plant/schema",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.55",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A Power Plant utility package to help managing schemas.",
|
|
6
6
|
"keywords": [
|
|
@@ -150,6 +150,7 @@
|
|
|
150
150
|
"@stryke/unique-id": "^0.3.110",
|
|
151
151
|
"@stryke/url": "^0.4.49",
|
|
152
152
|
"@stryke/zod": "^0.3.44",
|
|
153
|
+
"@typescript/vfs": "^1.6.4",
|
|
153
154
|
"@valibot/to-json-schema": "^1.7.1",
|
|
154
155
|
"defu": "^6.1.7",
|
|
155
156
|
"esbuild": "^0.28.1",
|
|
@@ -160,9 +161,9 @@
|
|
|
160
161
|
},
|
|
161
162
|
"devDependencies": {
|
|
162
163
|
"@deepkit/type-compiler": "1.0.19",
|
|
163
|
-
"@powerlines/plugin-tsdown": "^0.1.
|
|
164
|
+
"@powerlines/plugin-tsdown": "^0.1.578",
|
|
164
165
|
"@types/node": "^25.9.5",
|
|
165
|
-
"powerlines": "^0.47.
|
|
166
|
+
"powerlines": "^0.47.177",
|
|
166
167
|
"valibot": "^1.4.2",
|
|
167
168
|
"zod": "^4.4.3"
|
|
168
169
|
},
|
|
@@ -178,7 +179,6 @@
|
|
|
178
179
|
"inlinedDependencies": {
|
|
179
180
|
"@deepkit/type-compiler": "1.0.19",
|
|
180
181
|
"@marcj/ts-clone-node": "2.2.0",
|
|
181
|
-
"@typescript/vfs": "1.5.0",
|
|
182
182
|
"braces": "3.0.3",
|
|
183
183
|
"compatfactory": "2.0.9",
|
|
184
184
|
"fill-range": "7.1.1",
|
|
@@ -187,5 +187,5 @@
|
|
|
187
187
|
"picomatch": "2.3.2",
|
|
188
188
|
"to-regex-range": "5.0.1"
|
|
189
189
|
},
|
|
190
|
-
"gitHead": "
|
|
190
|
+
"gitHead": "d487a5e6a1eb5586a3f537d3d81ac7e2107454af"
|
|
191
191
|
}
|