@gravity-ui/data-source 0.10.0-alpha.1 → 0.10.0-alpha.2
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/build/plugin/esbuild.cjs +1 -1
- package/build/plugin/esbuild.mjs +1 -1
- package/build/plugin/{factory-2tSt4Rte.mjs → factory-Bjj8NXy2.mjs} +21 -1
- package/build/plugin/{factory-Cdmba_F_.cjs → factory-D7zGeCrN.cjs} +21 -1
- package/build/plugin/index.cjs +1 -1
- package/build/plugin/index.mjs +1 -1
- package/build/plugin/rollup.cjs +1 -1
- package/build/plugin/rollup.mjs +1 -1
- package/build/plugin/rspack.cjs +1 -1
- package/build/plugin/rspack.mjs +1 -1
- package/build/plugin/vite.cjs +1 -1
- package/build/plugin/vite.mjs +1 -1
- package/build/plugin/webpack.cjs +1 -1
- package/build/plugin/webpack.mjs +1 -1
- package/package.json +1 -4
package/build/plugin/esbuild.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_factory = require("./factory-
|
|
1
|
+
const require_factory = require("./factory-D7zGeCrN.cjs");
|
|
2
2
|
//#region src/plugin/esbuild.ts
|
|
3
3
|
var esbuild_default = (0, require("unplugin").createEsbuildPlugin)(require_factory.dataSourceLazyUnpluginFactory);
|
|
4
4
|
//#endregion
|
package/build/plugin/esbuild.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as dataSourceLazyUnpluginFactory } from "./factory-
|
|
1
|
+
import { n as dataSourceLazyUnpluginFactory } from "./factory-Bjj8NXy2.mjs";
|
|
2
2
|
import { createEsbuildPlugin } from "unplugin";
|
|
3
3
|
//#region src/plugin/esbuild.ts
|
|
4
4
|
var esbuild_default = createEsbuildPlugin(dataSourceLazyUnpluginFactory);
|
|
@@ -483,7 +483,8 @@ const dataSourceLazyUnpluginFactory = (options = {}) => {
|
|
|
483
483
|
const info = getHocInfo(id, code);
|
|
484
484
|
const usages = extractUsages(id, code);
|
|
485
485
|
if (!info && usages.length === 0) return null;
|
|
486
|
-
const
|
|
486
|
+
const filteredUsages = info ? dropAccessesInsideHocArgs(info, usages) : usages;
|
|
487
|
+
const verifiedUsages = (await Promise.all(filteredUsages.map(async (usage) => {
|
|
487
488
|
const resolvedSourceFile = await resolveSourceFile(this, usage.decl.source, id);
|
|
488
489
|
if (!resolvedSourceFile) return null;
|
|
489
490
|
const usageInfo = getHocInfo(resolvedSourceFile);
|
|
@@ -509,5 +510,24 @@ const dataSourceLazyUnpluginFactory = (options = {}) => {
|
|
|
509
510
|
}
|
|
510
511
|
};
|
|
511
512
|
};
|
|
513
|
+
function isInside(info, access) {
|
|
514
|
+
return info.argStart <= access.start && access.end <= info.argEnd;
|
|
515
|
+
}
|
|
516
|
+
function dropAccessesInsideHocArgs(info, usages) {
|
|
517
|
+
const result = [];
|
|
518
|
+
for (const usage of usages) {
|
|
519
|
+
const accesses = usage.accesses.filter((access) => !isInside(info.loading, access) && !isInside(info.error, access) && !(info.content.kind === "inline" && isInside(info.content, access)));
|
|
520
|
+
if (accesses.length === 0) continue;
|
|
521
|
+
if (accesses.length === usage.accesses.length) {
|
|
522
|
+
result.push(usage);
|
|
523
|
+
continue;
|
|
524
|
+
}
|
|
525
|
+
result.push({
|
|
526
|
+
...usage,
|
|
527
|
+
accesses
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
return result;
|
|
531
|
+
}
|
|
512
532
|
//#endregion
|
|
513
533
|
export { dataSourceLazyUnpluginFactory as n, DEFAULT_HOCS as t };
|
|
@@ -508,7 +508,8 @@ const dataSourceLazyUnpluginFactory = (options = {}) => {
|
|
|
508
508
|
const info = getHocInfo(id, code);
|
|
509
509
|
const usages = extractUsages(id, code);
|
|
510
510
|
if (!info && usages.length === 0) return null;
|
|
511
|
-
const
|
|
511
|
+
const filteredUsages = info ? dropAccessesInsideHocArgs(info, usages) : usages;
|
|
512
|
+
const verifiedUsages = (await Promise.all(filteredUsages.map(async (usage) => {
|
|
512
513
|
const resolvedSourceFile = await resolveSourceFile(this, usage.decl.source, id);
|
|
513
514
|
if (!resolvedSourceFile) return null;
|
|
514
515
|
const usageInfo = getHocInfo(resolvedSourceFile);
|
|
@@ -534,6 +535,25 @@ const dataSourceLazyUnpluginFactory = (options = {}) => {
|
|
|
534
535
|
}
|
|
535
536
|
};
|
|
536
537
|
};
|
|
538
|
+
function isInside(info, access) {
|
|
539
|
+
return info.argStart <= access.start && access.end <= info.argEnd;
|
|
540
|
+
}
|
|
541
|
+
function dropAccessesInsideHocArgs(info, usages) {
|
|
542
|
+
const result = [];
|
|
543
|
+
for (const usage of usages) {
|
|
544
|
+
const accesses = usage.accesses.filter((access) => !isInside(info.loading, access) && !isInside(info.error, access) && !(info.content.kind === "inline" && isInside(info.content, access)));
|
|
545
|
+
if (accesses.length === 0) continue;
|
|
546
|
+
if (accesses.length === usage.accesses.length) {
|
|
547
|
+
result.push(usage);
|
|
548
|
+
continue;
|
|
549
|
+
}
|
|
550
|
+
result.push({
|
|
551
|
+
...usage,
|
|
552
|
+
accesses
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
return result;
|
|
556
|
+
}
|
|
537
557
|
//#endregion
|
|
538
558
|
Object.defineProperty(exports, "DEFAULT_HOCS", {
|
|
539
559
|
enumerable: true,
|
package/build/plugin/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_factory = require("./factory-
|
|
5
|
+
const require_factory = require("./factory-D7zGeCrN.cjs");
|
|
6
6
|
//#region src/plugin/index.ts
|
|
7
7
|
const DataSourceLazyPlugin = /* @__PURE__ */ (0, require("unplugin").createUnplugin)(require_factory.dataSourceLazyUnpluginFactory);
|
|
8
8
|
//#endregion
|
package/build/plugin/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as dataSourceLazyUnpluginFactory, t as DEFAULT_HOCS } from "./factory-
|
|
1
|
+
import { n as dataSourceLazyUnpluginFactory, t as DEFAULT_HOCS } from "./factory-Bjj8NXy2.mjs";
|
|
2
2
|
import { createUnplugin } from "unplugin";
|
|
3
3
|
//#region src/plugin/index.ts
|
|
4
4
|
const DataSourceLazyPlugin = /* @__PURE__ */ createUnplugin(dataSourceLazyUnpluginFactory);
|
package/build/plugin/rollup.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_factory = require("./factory-
|
|
1
|
+
const require_factory = require("./factory-D7zGeCrN.cjs");
|
|
2
2
|
//#region src/plugin/rollup.ts
|
|
3
3
|
var rollup_default = (0, require("unplugin").createRollupPlugin)(require_factory.dataSourceLazyUnpluginFactory);
|
|
4
4
|
//#endregion
|
package/build/plugin/rollup.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as dataSourceLazyUnpluginFactory } from "./factory-
|
|
1
|
+
import { n as dataSourceLazyUnpluginFactory } from "./factory-Bjj8NXy2.mjs";
|
|
2
2
|
import { createRollupPlugin } from "unplugin";
|
|
3
3
|
//#region src/plugin/rollup.ts
|
|
4
4
|
var rollup_default = createRollupPlugin(dataSourceLazyUnpluginFactory);
|
package/build/plugin/rspack.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_factory = require("./factory-
|
|
1
|
+
const require_factory = require("./factory-D7zGeCrN.cjs");
|
|
2
2
|
//#region src/plugin/rspack.ts
|
|
3
3
|
var rspack_default = (0, require("unplugin").createRspackPlugin)(require_factory.dataSourceLazyUnpluginFactory);
|
|
4
4
|
//#endregion
|
package/build/plugin/rspack.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as dataSourceLazyUnpluginFactory } from "./factory-
|
|
1
|
+
import { n as dataSourceLazyUnpluginFactory } from "./factory-Bjj8NXy2.mjs";
|
|
2
2
|
import { createRspackPlugin } from "unplugin";
|
|
3
3
|
//#region src/plugin/rspack.ts
|
|
4
4
|
var rspack_default = createRspackPlugin(dataSourceLazyUnpluginFactory);
|
package/build/plugin/vite.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_factory = require("./factory-
|
|
1
|
+
const require_factory = require("./factory-D7zGeCrN.cjs");
|
|
2
2
|
//#region src/plugin/vite.ts
|
|
3
3
|
var vite_default = (0, require("unplugin").createVitePlugin)(require_factory.dataSourceLazyUnpluginFactory);
|
|
4
4
|
//#endregion
|
package/build/plugin/vite.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as dataSourceLazyUnpluginFactory } from "./factory-
|
|
1
|
+
import { n as dataSourceLazyUnpluginFactory } from "./factory-Bjj8NXy2.mjs";
|
|
2
2
|
import { createVitePlugin } from "unplugin";
|
|
3
3
|
//#region src/plugin/vite.ts
|
|
4
4
|
var vite_default = createVitePlugin(dataSourceLazyUnpluginFactory);
|
package/build/plugin/webpack.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_factory = require("./factory-
|
|
1
|
+
const require_factory = require("./factory-D7zGeCrN.cjs");
|
|
2
2
|
//#region src/plugin/webpack.ts
|
|
3
3
|
var webpack_default = (0, require("unplugin").createWebpackPlugin)(require_factory.dataSourceLazyUnpluginFactory);
|
|
4
4
|
//#endregion
|
package/build/plugin/webpack.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as dataSourceLazyUnpluginFactory } from "./factory-
|
|
1
|
+
import { n as dataSourceLazyUnpluginFactory } from "./factory-Bjj8NXy2.mjs";
|
|
2
2
|
import { createWebpackPlugin } from "unplugin";
|
|
3
3
|
//#region src/plugin/webpack.ts
|
|
4
4
|
var webpack_default = createWebpackPlugin(dataSourceLazyUnpluginFactory);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ui/data-source",
|
|
3
|
-
"version": "0.10.0-alpha.
|
|
3
|
+
"version": "0.10.0-alpha.2",
|
|
4
4
|
"description": "A wrapper around data fetching",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data-fetching",
|
|
@@ -24,9 +24,6 @@
|
|
|
24
24
|
"yarn": "Please use npm instead of yarn to install dependencies",
|
|
25
25
|
"pnpm": "Please use npm instead of pnpm to install dependencies"
|
|
26
26
|
},
|
|
27
|
-
"main": "build/cjs/index.js",
|
|
28
|
-
"module": "build/esm/index.js",
|
|
29
|
-
"types": "build/esm/index.d.ts",
|
|
30
27
|
"exports": {
|
|
31
28
|
".": {
|
|
32
29
|
"types": "./build/esm/index.d.ts",
|