powerlines 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/astro.cjs +7 -7
- package/dist/astro.js +4 -4
- package/dist/{chunk-C3I5QEF5.js → chunk-4R6CQNB2.js} +3 -3
- package/dist/{chunk-RGJMMCOR.js → chunk-54SOH6E5.js} +3 -3
- package/dist/{chunk-ZQZ5ZUGG.cjs → chunk-5ST7UKJF.cjs} +27 -7
- package/dist/chunk-6FRFYMLC.cjs +12 -0
- package/dist/chunk-6M3HIMSG.cjs +12 -0
- package/dist/chunk-6ODSQSQL.cjs +34 -0
- package/dist/{chunk-FOLQTZUP.cjs → chunk-6X6QQH33.cjs} +4 -4
- package/dist/{chunk-VQ5O5N7V.js → chunk-75B5EPR4.js} +3 -3
- package/dist/{chunk-OKC6TA7P.js → chunk-BWZCYCIF.js} +3 -3
- package/dist/{chunk-OEL3BTQP.js → chunk-D55IOUF3.js} +27 -7
- package/dist/{chunk-BY4UTCHZ.cjs → chunk-DOBCIS3U.cjs} +4 -4
- package/dist/{chunk-MKZOY5EV.js → chunk-FBBWXUGK.js} +3 -3
- package/dist/{chunk-BDTLKRKQ.js → chunk-GI35XXXH.js} +3 -3
- package/dist/{chunk-WM76YQJH.cjs → chunk-H2SX5ZYF.cjs} +4 -4
- package/dist/chunk-HPXUAQCU.cjs +12 -0
- package/dist/{chunk-KC4VY5X4.cjs → chunk-I5D3SVUH.cjs} +4 -4
- package/dist/{chunk-IOBFVFH2.js → chunk-KCDZ3LCF.js} +3 -3
- package/dist/chunk-KJHDE76P.cjs +24 -0
- package/dist/{chunk-W3NQCDUN.js → chunk-MXYZKFOD.js} +3 -3
- package/dist/{chunk-V4TNA6HX.js → chunk-PFCQFK7H.js} +3 -3
- package/dist/chunk-R5CZG7XN.js +31 -0
- package/dist/chunk-RGMGFYXY.cjs +12 -0
- package/dist/{chunk-QK36ULYT.cjs → chunk-RRGXS7GZ.cjs} +4 -4
- package/dist/chunk-TZ4Y7R4G.cjs +12 -0
- package/dist/{chunk-3L4KRPXQ.cjs → chunk-UESICHEO.cjs} +8 -8
- package/dist/{chunk-GHW2FUF5.js → chunk-V56DIXOO.js} +3 -3
- package/dist/{chunk-UYS3BU6I.js → chunk-WAWIGYB4.js} +4 -4
- package/dist/{chunk-65PSZQFC.js → chunk-YOHDGH77.js} +3 -3
- package/dist/esbuild.cjs +6 -6
- package/dist/esbuild.js +3 -3
- package/dist/farm.cjs +3 -3
- package/dist/farm.js +2 -2
- package/dist/index.cjs +17 -17
- package/dist/index.js +15 -15
- package/dist/internal/api.cjs +2 -2
- package/dist/internal/api.js +1 -1
- package/dist/lib/{chunk-YQG6JE5R.cjs → chunk-2D74QBNW.cjs} +27 -7
- package/dist/lib/chunk-2D74QBNW.cjs.map +1 -0
- package/dist/lib/{chunk-6IEUZ5DZ.js → chunk-WDNYOFEH.js} +27 -7
- package/dist/lib/chunk-WDNYOFEH.js.map +1 -0
- package/dist/lib/index.cjs +2 -2
- package/dist/lib/index.js +1 -1
- package/dist/lib/unplugin/factory.cjs +2 -2
- package/dist/lib/unplugin/factory.js +1 -1
- package/dist/lib/unplugin/index.cjs +2 -2
- package/dist/lib/unplugin/index.js +1 -1
- package/dist/next.cjs +7 -7
- package/dist/next.js +4 -4
- package/dist/nuxt.cjs +8 -8
- package/dist/nuxt.js +5 -5
- package/dist/rolldown.cjs +6 -6
- package/dist/rolldown.js +3 -3
- package/dist/rollup.cjs +6 -6
- package/dist/rollup.js +3 -3
- package/dist/rspack.cjs +6 -6
- package/dist/rspack.js +3 -3
- package/dist/tsup.cjs +7 -7
- package/dist/tsup.js +4 -4
- package/dist/unloader.cjs +6 -6
- package/dist/unloader.js +3 -3
- package/dist/unplugin.cjs +17 -17
- package/dist/unplugin.js +14 -14
- package/dist/vite.cjs +6 -6
- package/dist/vite.js +3 -3
- package/dist/webpack.cjs +6 -6
- package/dist/webpack.js +3 -3
- package/package.json +2 -2
- package/dist/chunk-4JUWHOFJ.cjs +0 -12
- package/dist/chunk-ARHKVB3S.cjs +0 -12
- package/dist/chunk-JCXSBKRJ.js +0 -31
- package/dist/chunk-NRMXL6VA.cjs +0 -34
- package/dist/chunk-QKXJRYA5.cjs +0 -12
- package/dist/chunk-STLRGAW6.cjs +0 -24
- package/dist/chunk-TJIHTRP5.cjs +0 -12
- package/dist/chunk-VES34CLG.cjs +0 -12
- package/dist/lib/chunk-6IEUZ5DZ.js.map +0 -1
- package/dist/lib/chunk-YQG6JE5R.cjs.map +0 -1
|
@@ -1234,7 +1234,8 @@ function createVfs(context) {
|
|
|
1234
1234
|
__name(createVfs, "createVfs");
|
|
1235
1235
|
|
|
1236
1236
|
// src/internal/contexts/context.ts
|
|
1237
|
-
var
|
|
1237
|
+
var configCache = /* @__PURE__ */ new WeakMap();
|
|
1238
|
+
var parseCache = /* @__PURE__ */ new WeakMap();
|
|
1238
1239
|
var PowerlinesContext = class _PowerlinesContext {
|
|
1239
1240
|
static {
|
|
1240
1241
|
__name(this, "PowerlinesContext");
|
|
@@ -1469,12 +1470,31 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
1469
1470
|
* @returns The parsed {@link ParseResult} object.
|
|
1470
1471
|
*/
|
|
1471
1472
|
async parse(code, id, options = {}) {
|
|
1472
|
-
|
|
1473
|
+
if (parseCache.has({
|
|
1474
|
+
code,
|
|
1475
|
+
options
|
|
1476
|
+
})) {
|
|
1477
|
+
return parseCache.get({
|
|
1478
|
+
code,
|
|
1479
|
+
options
|
|
1480
|
+
});
|
|
1481
|
+
}
|
|
1482
|
+
const result = await parseAsync(id, code, defu3(options ?? {}, {
|
|
1473
1483
|
lang: hasFileExtension(id) ? void 0 : "ts",
|
|
1474
1484
|
astType: hasFileExtension(id) ? void 0 : "ts",
|
|
1475
1485
|
sourceType: "module",
|
|
1476
1486
|
showSemanticErrors: false
|
|
1477
1487
|
}));
|
|
1488
|
+
if (result.errors && result.errors.length > 0) {
|
|
1489
|
+
throw new Error(`Powerlines parsing errors in file: ${id}
|
|
1490
|
+
${result.errors.map((error) => ` [${error.severity}] ${error.message}${error.codeframe ? ` (${error.codeframe})` : ""}${error.helpMessage ? `
|
|
1491
|
+
Help: ${error.helpMessage}` : ""}`).join("\n")}`);
|
|
1492
|
+
}
|
|
1493
|
+
parseCache.set({
|
|
1494
|
+
code,
|
|
1495
|
+
options
|
|
1496
|
+
}, result);
|
|
1497
|
+
return result;
|
|
1478
1498
|
}
|
|
1479
1499
|
/**
|
|
1480
1500
|
* Update the context using a new user configuration options
|
|
@@ -1563,8 +1583,8 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
1563
1583
|
configFile: config.configFile ?? this.config.configFile,
|
|
1564
1584
|
command: this.config.inlineConfig?.command
|
|
1565
1585
|
};
|
|
1566
|
-
if (
|
|
1567
|
-
const result =
|
|
1586
|
+
if (configCache.has(cacheKey)) {
|
|
1587
|
+
const result = configCache.get(cacheKey);
|
|
1568
1588
|
this.projectJson = result.projectJson;
|
|
1569
1589
|
this.packageJson = result.packageJson;
|
|
1570
1590
|
this.#checksum = result.checksum;
|
|
@@ -1589,7 +1609,7 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
1589
1609
|
});
|
|
1590
1610
|
const userConfig = await loadUserConfigFile(cacheKey.projectRoot, this.resolver, cacheKey.command, cacheKey.mode, cacheKey.configFile);
|
|
1591
1611
|
this.mergeUserConfig(userConfig.config);
|
|
1592
|
-
|
|
1612
|
+
configCache.set(cacheKey, {
|
|
1593
1613
|
projectJson: this.projectJson,
|
|
1594
1614
|
packageJson: this.packageJson,
|
|
1595
1615
|
checksum: this.#checksum,
|
|
@@ -3118,5 +3138,5 @@ function createUnpluginFactory(variant, decorate) {
|
|
|
3118
3138
|
__name(createUnpluginFactory, "createUnpluginFactory");
|
|
3119
3139
|
|
|
3120
3140
|
export { createUnpluginFactory };
|
|
3121
|
-
//# sourceMappingURL=chunk-
|
|
3122
|
-
//# sourceMappingURL=chunk-
|
|
3141
|
+
//# sourceMappingURL=chunk-WDNYOFEH.js.map
|
|
3142
|
+
//# sourceMappingURL=chunk-WDNYOFEH.js.map
|