@soda-gql/builder 0.11.10 → 0.11.12
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/index.cjs +1 -1
- package/dist/index.d.cts +7 -4
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +7 -4
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/plugin-support.cjs +13 -2
- package/dist/plugin-support.cjs.map +1 -1
- package/dist/plugin-support.d.cts +18 -3
- package/dist/plugin-support.d.cts.map +1 -1
- package/dist/plugin-support.d.mts +18 -3
- package/dist/plugin-support.d.mts.map +1 -1
- package/dist/plugin-support.mjs +13 -2
- package/dist/plugin-support.mjs.map +1 -1
- package/dist/{service-CKlB44r5.cjs → service-ByiDYWPX.cjs} +147 -51
- package/dist/service-ByiDYWPX.cjs.map +1 -0
- package/dist/{service-DWqMy_bx.d.cts → service-Do9da7Cm.d.mts} +20 -5
- package/dist/service-Do9da7Cm.d.mts.map +1 -0
- package/dist/{service-BsLt3K-6.mjs → service-Xz1_XYDb.mjs} +149 -53
- package/dist/service-Xz1_XYDb.mjs.map +1 -0
- package/dist/{service-iZxJaL2x.d.mts → service-vzMbq7Pe.d.cts} +20 -5
- package/dist/service-vzMbq7Pe.d.cts.map +1 -0
- package/package.json +4 -4
- package/dist/service-BsLt3K-6.mjs.map +0 -1
- package/dist/service-CKlB44r5.cjs.map +0 -1
- package/dist/service-DWqMy_bx.d.cts.map +0 -1
- package/dist/service-iZxJaL2x.d.mts.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Result } from "neverthrow";
|
|
2
|
+
import { Script } from "node:vm";
|
|
2
3
|
import { CanonicalId, EffectGenerator } from "@soda-gql/common";
|
|
4
|
+
import { AnyFragment, AnyGqlDefine, AnyOperation } from "@soda-gql/core";
|
|
3
5
|
import { RuntimeFragmentInput, RuntimeOperationInput } from "@soda-gql/core/runtime";
|
|
4
6
|
import { ResolvedSodaGqlConfig } from "@soda-gql/config";
|
|
5
|
-
import { Script } from "node:vm";
|
|
6
|
-
import { AnyFragment, AnyOperation } from "@soda-gql/core";
|
|
7
7
|
|
|
8
8
|
//#region packages/builder/src/internal/graphql-system.d.ts
|
|
9
9
|
type GraphqlSystemIdentifyHelper = {
|
|
@@ -258,18 +258,30 @@ type ModuleAnalysis = {
|
|
|
258
258
|
type AnalyzeModuleInput = {
|
|
259
259
|
readonly filePath: string;
|
|
260
260
|
readonly source: string;
|
|
261
|
+
/**
|
|
262
|
+
* Base directory for relative path computation in canonical IDs.
|
|
263
|
+
* When provided, canonical IDs will use relative paths from baseDir.
|
|
264
|
+
*/
|
|
265
|
+
readonly baseDir?: string;
|
|
261
266
|
};
|
|
262
267
|
//#endregion
|
|
263
268
|
//#region packages/builder/src/ast/index.d.ts
|
|
264
269
|
declare const createAstAnalyzer: ({
|
|
265
270
|
analyzer,
|
|
266
|
-
graphqlHelper
|
|
271
|
+
graphqlHelper,
|
|
272
|
+
baseDir
|
|
267
273
|
}: {
|
|
268
274
|
readonly analyzer: BuilderAnalyzer;
|
|
269
275
|
readonly graphqlHelper: GraphqlSystemIdentifyHelper;
|
|
276
|
+
/**
|
|
277
|
+
* Base directory for relative path computation in canonical IDs.
|
|
278
|
+
* When provided, all canonical IDs generated during analysis will use
|
|
279
|
+
* relative paths from baseDir, enabling portable artifacts.
|
|
280
|
+
*/
|
|
281
|
+
readonly baseDir?: string;
|
|
270
282
|
}) => {
|
|
271
283
|
type: BuilderAnalyzer;
|
|
272
|
-
analyze: (input: AnalyzeModuleInput) => ModuleAnalysis;
|
|
284
|
+
analyze: (input: Omit<AnalyzeModuleInput, "baseDir">) => ModuleAnalysis;
|
|
273
285
|
};
|
|
274
286
|
//#endregion
|
|
275
287
|
//#region packages/builder/src/intermediate-module/types.d.ts
|
|
@@ -294,6 +306,9 @@ type IntermediateArtifactElement = {
|
|
|
294
306
|
} | {
|
|
295
307
|
readonly type: "operation";
|
|
296
308
|
readonly element: AnyOperation;
|
|
309
|
+
} | {
|
|
310
|
+
readonly type: "define";
|
|
311
|
+
readonly element: AnyGqlDefine;
|
|
297
312
|
};
|
|
298
313
|
//#endregion
|
|
299
314
|
//#region packages/builder/src/intermediate-module/evaluation.d.ts
|
|
@@ -475,4 +490,4 @@ declare const createBuilderService: ({
|
|
|
475
490
|
}: BuilderServiceConfig) => BuilderService;
|
|
476
491
|
//#endregion
|
|
477
492
|
export { BuilderOptions as C, builderErrors as D, BuilderResult as E, GraphqlSystemIdentifyHelper as O, BuilderMode as S, BuilderErrorCode as T, ModuleAnalysis as _, BuilderArtifactElement as a, BuilderFormat as b, BuilderArtifactMeta as c, __clearGqlCache as d, IntermediateArtifactElement as f, DiagnosticSeverity as g, DiagnosticLocation as h, BuilderArtifact as i, createGraphqlSystemIdentifyHelper as k, BuilderArtifactOperation as l, DiagnosticCode as m, BuilderServiceConfig as n, BuilderArtifactElementMetadata as o, createAstAnalyzer as p, createBuilderService as r, BuilderArtifactFragment as s, BuilderService as t, IntermediateElements as u, ModuleDiagnostic as v, BuilderError as w, BuilderInput as x, BuilderAnalyzer as y };
|
|
478
|
-
//# sourceMappingURL=service-
|
|
493
|
+
//# sourceMappingURL=service-Do9da7Cm.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-Do9da7Cm.d.mts","names":[],"sources":["../src/internal/graphql-system.ts","../src/errors.ts","../src/types.ts","../src/ast/types.ts","../src/ast/index.ts","../src/intermediate-module/types.ts","../src/intermediate-module/evaluation.ts","../src/artifact/types.ts","../src/service.ts"],"sourcesContent":[],"mappings":";;;;;;;;KAUY,2BAAA;;;EAAA,CAAA,EAAA,GAAA,OAAA;EA+BC,SAAA,8BA4DZ,EAAA,CAAA,KAAA,EA5DyD;;;;ECpC9C;AA+BZ;AAwHA;;EAAyC,SAAA,oBAAA,EAAA,CAAA,KAAA,EAAA;IAAV,QAAA,EAAA,MAAA;EAAM,CAAA,EAAA,GAAA,OAAA;AAK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AA;AAAA,CAAA,EIgFoC,oBJhFpC,EAAA,GIgF2D,cJhF3D"}
|
|
@@ -5,10 +5,10 @@ import { z } from "zod";
|
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
import { extname, join, normalize, resolve } from "node:path";
|
|
7
7
|
import { Script, createContext } from "node:vm";
|
|
8
|
-
import { CanonicalIdSchema, Effect, Effects, ParallelEffect, cachedFn, createAsyncScheduler, createCanonicalId, createCanonicalTracker, createSyncScheduler, getPortableFS, getPortableHasher, isExternalSpecifier, isRelativeSpecifier, normalizePath, parseCanonicalId, resolveRelativeImportWithExistenceCheck, resolveRelativeImportWithReferences } from "@soda-gql/common";
|
|
8
|
+
import { CanonicalIdSchema, Effect, Effects, ParallelEffect, cachedFn, createAliasResolver, createAsyncScheduler, createCanonicalId, createCanonicalTracker, createSyncScheduler, getPortableFS, getPortableHasher, isExternalSpecifier, isRelativeSpecifier, normalizePath, parseCanonicalId, resolveRelativeImportWithExistenceCheck, resolveRelativeImportWithReferences, validateCanonicalId } from "@soda-gql/common";
|
|
9
9
|
import { parseSync, transformSync } from "@swc/core";
|
|
10
10
|
import * as sandboxCore from "@soda-gql/core";
|
|
11
|
-
import { Fragment, GqlElement, Operation } from "@soda-gql/core";
|
|
11
|
+
import { Fragment, GqlDefine, GqlElement, Operation } from "@soda-gql/core";
|
|
12
12
|
import * as sandboxCoreAdapter from "@soda-gql/core/adapter";
|
|
13
13
|
import * as sandboxCoreRuntime from "@soda-gql/core/runtime";
|
|
14
14
|
import * as sandboxRuntime from "@soda-gql/runtime";
|
|
@@ -1122,6 +1122,11 @@ const createIntermediateRegistry = ({ analyses } = {}) => {
|
|
|
1122
1122
|
type: "operation",
|
|
1123
1123
|
element
|
|
1124
1124
|
};
|
|
1125
|
+
} else if (element instanceof GqlDefine) {
|
|
1126
|
+
artifacts[canonicalId] = {
|
|
1127
|
+
type: "define",
|
|
1128
|
+
element
|
|
1129
|
+
};
|
|
1125
1130
|
}
|
|
1126
1131
|
}
|
|
1127
1132
|
return artifacts;
|
|
@@ -1477,35 +1482,69 @@ const createGraphqlSystemIdentifyHelper = (config) => {
|
|
|
1477
1482
|
};
|
|
1478
1483
|
};
|
|
1479
1484
|
|
|
1485
|
+
//#endregion
|
|
1486
|
+
//#region packages/builder/src/artifact/canonical-id-utils.ts
|
|
1487
|
+
/**
|
|
1488
|
+
* Parse a canonical ID with validation.
|
|
1489
|
+
* Returns a Result with parsed components or a BuilderError.
|
|
1490
|
+
*
|
|
1491
|
+
* @param canonicalId - The canonical ID to parse
|
|
1492
|
+
* @returns Result with {filePath, astPath} or BuilderError
|
|
1493
|
+
*/
|
|
1494
|
+
const parseCanonicalIdSafe = (canonicalId) => {
|
|
1495
|
+
const validation = validateCanonicalId(canonicalId);
|
|
1496
|
+
if (!validation.isValid) {
|
|
1497
|
+
return err(builderErrors.canonicalPathInvalid(canonicalId, validation.reason));
|
|
1498
|
+
}
|
|
1499
|
+
return ok(parseCanonicalId(canonicalId));
|
|
1500
|
+
};
|
|
1501
|
+
/**
|
|
1502
|
+
* Extract file path from canonical ID with validation.
|
|
1503
|
+
* Returns a Result with the file path or a BuilderError.
|
|
1504
|
+
*
|
|
1505
|
+
* @param canonicalId - The canonical ID to extract from
|
|
1506
|
+
* @returns Result with filePath or BuilderError
|
|
1507
|
+
*/
|
|
1508
|
+
const extractFilePathSafe = (canonicalId) => {
|
|
1509
|
+
return parseCanonicalIdSafe(canonicalId).map(({ filePath }) => filePath);
|
|
1510
|
+
};
|
|
1511
|
+
|
|
1480
1512
|
//#endregion
|
|
1481
1513
|
//#region packages/builder/src/artifact/aggregate.ts
|
|
1482
|
-
const canonicalToFilePath$1 = (canonicalId) => canonicalId.split("::")[0] ?? canonicalId;
|
|
1483
1514
|
const computeContentHash = (prebuild) => {
|
|
1484
1515
|
const hash = createHash("sha1");
|
|
1485
1516
|
hash.update(JSON.stringify(prebuild));
|
|
1486
1517
|
return hash.digest("hex");
|
|
1487
1518
|
};
|
|
1488
|
-
const emitRegistrationError = (
|
|
1519
|
+
const emitRegistrationError = (filePath, astPath, message) => ({
|
|
1489
1520
|
code: "RUNTIME_MODULE_LOAD_FAILED",
|
|
1490
|
-
filePath
|
|
1491
|
-
astPath
|
|
1521
|
+
filePath,
|
|
1522
|
+
astPath,
|
|
1492
1523
|
message
|
|
1493
1524
|
});
|
|
1494
1525
|
const aggregate = ({ analyses, elements }) => {
|
|
1495
1526
|
const registry = new Map();
|
|
1496
1527
|
for (const analysis of analyses.values()) {
|
|
1497
1528
|
for (const definition of analysis.definitions) {
|
|
1529
|
+
const parsedResult = parseCanonicalIdSafe(definition.canonicalId);
|
|
1530
|
+
if (parsedResult.isErr()) {
|
|
1531
|
+
return err(parsedResult.error);
|
|
1532
|
+
}
|
|
1533
|
+
const { filePath, astPath } = parsedResult.value;
|
|
1498
1534
|
const element = elements[definition.canonicalId];
|
|
1499
1535
|
if (!element) {
|
|
1500
1536
|
const availableIds = Object.keys(elements).join(", ");
|
|
1501
1537
|
const message = `ARTIFACT_NOT_FOUND_IN_RUNTIME_MODULE: ${definition.canonicalId}\nAvailable: ${availableIds}`;
|
|
1502
|
-
return err(emitRegistrationError(
|
|
1538
|
+
return err(emitRegistrationError(filePath, astPath, message));
|
|
1539
|
+
}
|
|
1540
|
+
if (element.type === "define") {
|
|
1541
|
+
continue;
|
|
1503
1542
|
}
|
|
1504
1543
|
if (registry.has(definition.canonicalId)) {
|
|
1505
|
-
return err(emitRegistrationError(
|
|
1544
|
+
return err(emitRegistrationError(filePath, astPath, `ARTIFACT_ALREADY_REGISTERED`));
|
|
1506
1545
|
}
|
|
1507
1546
|
const metadata = {
|
|
1508
|
-
sourcePath:
|
|
1547
|
+
sourcePath: filePath,
|
|
1509
1548
|
contentHash: ""
|
|
1510
1549
|
};
|
|
1511
1550
|
if (element.type === "fragment") {
|
|
@@ -1545,7 +1584,7 @@ const aggregate = ({ analyses, elements }) => {
|
|
|
1545
1584
|
});
|
|
1546
1585
|
continue;
|
|
1547
1586
|
}
|
|
1548
|
-
return err(emitRegistrationError(
|
|
1587
|
+
return err(emitRegistrationError(filePath, astPath, "UNKNOWN_ARTIFACT_KIND"));
|
|
1549
1588
|
}
|
|
1550
1589
|
}
|
|
1551
1590
|
return ok(registry);
|
|
@@ -1553,7 +1592,6 @@ const aggregate = ({ analyses, elements }) => {
|
|
|
1553
1592
|
|
|
1554
1593
|
//#endregion
|
|
1555
1594
|
//#region packages/builder/src/artifact/issue-handler.ts
|
|
1556
|
-
const canonicalToFilePath = (canonicalId) => canonicalId.split("::")[0] ?? canonicalId;
|
|
1557
1595
|
const checkIssues = ({ elements }) => {
|
|
1558
1596
|
const operationNames = new Set();
|
|
1559
1597
|
for (const [canonicalId, { type, element }] of Object.entries(elements)) {
|
|
@@ -1561,7 +1599,11 @@ const checkIssues = ({ elements }) => {
|
|
|
1561
1599
|
continue;
|
|
1562
1600
|
}
|
|
1563
1601
|
if (operationNames.has(element.operationName)) {
|
|
1564
|
-
const
|
|
1602
|
+
const filePathResult = extractFilePathSafe(canonicalId);
|
|
1603
|
+
if (filePathResult.isErr()) {
|
|
1604
|
+
return err(filePathResult.error);
|
|
1605
|
+
}
|
|
1606
|
+
const sources = [filePathResult.value];
|
|
1565
1607
|
return err({
|
|
1566
1608
|
code: "DOC_DUPLICATE",
|
|
1567
1609
|
message: `Duplicate document name: ${element.operationName}`,
|
|
@@ -1847,7 +1889,7 @@ const unwrapMethodChains$1 = (identifiers, node) => {
|
|
|
1847
1889
|
}
|
|
1848
1890
|
return unwrapMethodChains$1(identifiers, callee.object);
|
|
1849
1891
|
};
|
|
1850
|
-
const collectAllDefinitions$1 = ({ module, gqlIdentifiers, imports: _imports, exports, source }) => {
|
|
1892
|
+
const collectAllDefinitions$1 = ({ module, gqlIdentifiers, imports: _imports, exports, source, baseDir }) => {
|
|
1851
1893
|
const getPropertyName$1 = (property) => {
|
|
1852
1894
|
if (!property) {
|
|
1853
1895
|
return null;
|
|
@@ -1865,6 +1907,7 @@ const collectAllDefinitions$1 = ({ module, gqlIdentifiers, imports: _imports, ex
|
|
|
1865
1907
|
const exportBindings = createExportBindingsMap(exports);
|
|
1866
1908
|
const tracker = createCanonicalTracker({
|
|
1867
1909
|
filePath: module.__filePath,
|
|
1910
|
+
baseDir,
|
|
1868
1911
|
getExportName: (localName) => exportBindings.get(localName)
|
|
1869
1912
|
});
|
|
1870
1913
|
const anonymousCounters = new Map();
|
|
@@ -2039,7 +2082,7 @@ const collectAllDefinitions$1 = ({ module, gqlIdentifiers, imports: _imports, ex
|
|
|
2039
2082
|
visit(statement, []);
|
|
2040
2083
|
});
|
|
2041
2084
|
const definitions = pending.map((item) => ({
|
|
2042
|
-
canonicalId: createCanonicalId(module.__filePath, item.astPath),
|
|
2085
|
+
canonicalId: createCanonicalId(module.__filePath, item.astPath, { baseDir }),
|
|
2043
2086
|
astPath: item.astPath,
|
|
2044
2087
|
isTopLevel: item.isTopLevel,
|
|
2045
2088
|
isExported: item.isExported,
|
|
@@ -2301,7 +2344,8 @@ const swcAdapter = { analyze(input, helper) {
|
|
|
2301
2344
|
gqlIdentifiers,
|
|
2302
2345
|
imports,
|
|
2303
2346
|
exports,
|
|
2304
|
-
source: input.source
|
|
2347
|
+
source: input.source,
|
|
2348
|
+
baseDir: input.baseDir
|
|
2305
2349
|
});
|
|
2306
2350
|
const diagnostics = [
|
|
2307
2351
|
...collectImportDiagnostics$1(swcModule, helper),
|
|
@@ -2514,12 +2558,13 @@ const getPropertyName = (name) => {
|
|
|
2514
2558
|
/**
|
|
2515
2559
|
* Collect all gql definitions (exported, non-exported, top-level, nested)
|
|
2516
2560
|
*/
|
|
2517
|
-
const collectAllDefinitions = ({ sourceFile, identifiers, exports }) => {
|
|
2561
|
+
const collectAllDefinitions = ({ sourceFile, identifiers, exports, baseDir }) => {
|
|
2518
2562
|
const pending = [];
|
|
2519
2563
|
const handledCalls = [];
|
|
2520
2564
|
const exportBindings = createExportBindingsMap(exports);
|
|
2521
2565
|
const tracker = createCanonicalTracker({
|
|
2522
2566
|
filePath: sourceFile.fileName,
|
|
2567
|
+
baseDir,
|
|
2523
2568
|
getExportName: (localName) => exportBindings.get(localName)
|
|
2524
2569
|
});
|
|
2525
2570
|
const anonymousCounters = new Map();
|
|
@@ -2663,7 +2708,7 @@ const collectAllDefinitions = ({ sourceFile, identifiers, exports }) => {
|
|
|
2663
2708
|
visit(statement, []);
|
|
2664
2709
|
});
|
|
2665
2710
|
const definitions = pending.map((item) => ({
|
|
2666
|
-
canonicalId: createCanonicalId(sourceFile.fileName, item.astPath),
|
|
2711
|
+
canonicalId: createCanonicalId(sourceFile.fileName, item.astPath, { baseDir }),
|
|
2667
2712
|
astPath: item.astPath,
|
|
2668
2713
|
isTopLevel: item.isTopLevel,
|
|
2669
2714
|
isExported: item.isExported,
|
|
@@ -2867,7 +2912,8 @@ const typescriptAdapter = { analyze(input, helper) {
|
|
|
2867
2912
|
const { definitions } = collectAllDefinitions({
|
|
2868
2913
|
sourceFile,
|
|
2869
2914
|
identifiers: gqlIdentifiers,
|
|
2870
|
-
exports
|
|
2915
|
+
exports,
|
|
2916
|
+
baseDir: input.baseDir
|
|
2871
2917
|
});
|
|
2872
2918
|
const diagnostics = [
|
|
2873
2919
|
...collectImportDiagnostics(sourceFile, helper),
|
|
@@ -2918,13 +2964,17 @@ const analyzeModuleCore = (input, adapter, graphqlHelper) => {
|
|
|
2918
2964
|
|
|
2919
2965
|
//#endregion
|
|
2920
2966
|
//#region packages/builder/src/ast/index.ts
|
|
2921
|
-
const createAstAnalyzer = ({ analyzer, graphqlHelper }) => {
|
|
2967
|
+
const createAstAnalyzer = ({ analyzer, graphqlHelper, baseDir }) => {
|
|
2922
2968
|
const analyze = (input) => {
|
|
2969
|
+
const inputWithBaseDir = {
|
|
2970
|
+
...input,
|
|
2971
|
+
baseDir
|
|
2972
|
+
};
|
|
2923
2973
|
if (analyzer === "ts") {
|
|
2924
|
-
return analyzeModuleCore(
|
|
2974
|
+
return analyzeModuleCore(inputWithBaseDir, typescriptAdapter, graphqlHelper);
|
|
2925
2975
|
}
|
|
2926
2976
|
if (analyzer === "swc") {
|
|
2927
|
-
return analyzeModuleCore(
|
|
2977
|
+
return analyzeModuleCore(inputWithBaseDir, swcAdapter, graphqlHelper);
|
|
2928
2978
|
}
|
|
2929
2979
|
return assertUnreachable(analyzer, "createAstAnalyzer");
|
|
2930
2980
|
};
|
|
@@ -3329,22 +3379,45 @@ const createDiscoveryCache = (options) => new JsonDiscoveryCache(options);
|
|
|
3329
3379
|
/**
|
|
3330
3380
|
* Extract all unique dependencies (relative + external) from the analysis.
|
|
3331
3381
|
* Resolves local specifiers immediately so discovery only traverses once.
|
|
3382
|
+
*
|
|
3383
|
+
* Resolution order:
|
|
3384
|
+
* 1. Relative imports → resolveRelativeImportWithExistenceCheck
|
|
3385
|
+
* 2. Alias imports (if aliasResolver provided) → aliasResolver.resolve
|
|
3386
|
+
* 3. Otherwise → mark as external
|
|
3332
3387
|
*/
|
|
3333
|
-
const extractModuleDependencies = (analysis) => {
|
|
3388
|
+
const extractModuleDependencies = ({ analysis, aliasResolver }) => {
|
|
3334
3389
|
const dependencies = new Map();
|
|
3335
3390
|
const addDependency = (specifier) => {
|
|
3336
3391
|
if (dependencies.has(specifier)) {
|
|
3337
3392
|
return;
|
|
3338
3393
|
}
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3394
|
+
if (!isExternalSpecifier(specifier)) {
|
|
3395
|
+
const resolvedPath = resolveRelativeImportWithExistenceCheck({
|
|
3396
|
+
filePath: analysis.filePath,
|
|
3397
|
+
specifier
|
|
3398
|
+
});
|
|
3399
|
+
dependencies.set(specifier, {
|
|
3400
|
+
specifier,
|
|
3401
|
+
resolvedPath,
|
|
3402
|
+
isExternal: false
|
|
3403
|
+
});
|
|
3404
|
+
return;
|
|
3405
|
+
}
|
|
3406
|
+
if (aliasResolver) {
|
|
3407
|
+
const resolvedPath = aliasResolver.resolve(specifier);
|
|
3408
|
+
if (resolvedPath) {
|
|
3409
|
+
dependencies.set(specifier, {
|
|
3410
|
+
specifier,
|
|
3411
|
+
resolvedPath,
|
|
3412
|
+
isExternal: false
|
|
3413
|
+
});
|
|
3414
|
+
return;
|
|
3415
|
+
}
|
|
3416
|
+
}
|
|
3344
3417
|
dependencies.set(specifier, {
|
|
3345
3418
|
specifier,
|
|
3346
|
-
resolvedPath,
|
|
3347
|
-
isExternal
|
|
3419
|
+
resolvedPath: null,
|
|
3420
|
+
isExternal: true
|
|
3348
3421
|
});
|
|
3349
3422
|
};
|
|
3350
3423
|
for (const imp of analysis.imports) {
|
|
@@ -3498,10 +3571,28 @@ function clearFingerprintCache() {
|
|
|
3498
3571
|
//#endregion
|
|
3499
3572
|
//#region packages/builder/src/discovery/discoverer.ts
|
|
3500
3573
|
/**
|
|
3574
|
+
* JavaScript file extensions that should be treated as empty modules.
|
|
3575
|
+
* These files are included in the dependency graph but not parsed for definitions.
|
|
3576
|
+
*/
|
|
3577
|
+
const JS_FILE_EXTENSIONS = [
|
|
3578
|
+
".js",
|
|
3579
|
+
".mjs",
|
|
3580
|
+
".cjs",
|
|
3581
|
+
".jsx"
|
|
3582
|
+
];
|
|
3583
|
+
/**
|
|
3584
|
+
* Check if a file path is a JavaScript file (not TypeScript).
|
|
3585
|
+
* Used to skip AST analysis for JS files that are resolved as fallbacks.
|
|
3586
|
+
*/
|
|
3587
|
+
const isJsFile = (filePath) => {
|
|
3588
|
+
const ext = extname(filePath).toLowerCase();
|
|
3589
|
+
return JS_FILE_EXTENSIONS.includes(ext);
|
|
3590
|
+
};
|
|
3591
|
+
/**
|
|
3501
3592
|
* Generator-based module discovery that yields effects for file I/O.
|
|
3502
3593
|
* This allows the discovery process to be executed with either sync or async schedulers.
|
|
3503
3594
|
*/
|
|
3504
|
-
function* discoverModulesGen({ entryPaths, astAnalyzer, incremental }) {
|
|
3595
|
+
function* discoverModulesGen({ entryPaths, astAnalyzer, aliasResolver, incremental }) {
|
|
3505
3596
|
const snapshots = new Map();
|
|
3506
3597
|
const stack = [...entryPaths];
|
|
3507
3598
|
const changedFiles = incremental?.changedFiles ?? new Set();
|
|
@@ -3564,12 +3655,27 @@ function* discoverModulesGen({ entryPaths, astAnalyzer, incremental }) {
|
|
|
3564
3655
|
continue;
|
|
3565
3656
|
}
|
|
3566
3657
|
const signature = createSourceHash(source);
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3658
|
+
let analysis;
|
|
3659
|
+
if (isJsFile(filePath)) {
|
|
3660
|
+
analysis = {
|
|
3661
|
+
filePath,
|
|
3662
|
+
signature,
|
|
3663
|
+
definitions: [],
|
|
3664
|
+
imports: [],
|
|
3665
|
+
exports: [],
|
|
3666
|
+
diagnostics: []
|
|
3667
|
+
};
|
|
3668
|
+
} else {
|
|
3669
|
+
analysis = astAnalyzer.analyze({
|
|
3670
|
+
filePath,
|
|
3671
|
+
source
|
|
3672
|
+
});
|
|
3673
|
+
}
|
|
3571
3674
|
cacheMisses++;
|
|
3572
|
-
const dependencies = extractModuleDependencies(
|
|
3675
|
+
const dependencies = extractModuleDependencies({
|
|
3676
|
+
analysis,
|
|
3677
|
+
aliasResolver
|
|
3678
|
+
});
|
|
3573
3679
|
for (const dep of dependencies) {
|
|
3574
3680
|
if (!dep.isExternal && dep.resolvedPath && !snapshots.has(dep.resolvedPath)) {
|
|
3575
3681
|
stack.push(dep.resolvedPath);
|
|
@@ -3635,12 +3741,11 @@ const discoverModulesAsync = async (options) => {
|
|
|
3635
3741
|
//#endregion
|
|
3636
3742
|
//#region packages/builder/src/utils/glob.ts
|
|
3637
3743
|
/**
|
|
3638
|
-
*
|
|
3639
|
-
* Provides a unified interface for glob operations across Bun and Node.js
|
|
3744
|
+
* Glob pattern matching using fast-glob
|
|
3640
3745
|
*/
|
|
3641
3746
|
/**
|
|
3642
3747
|
* Scan files matching glob patterns from the given directory.
|
|
3643
|
-
* Supports negation patterns (e.g., "!**\/excluded.ts")
|
|
3748
|
+
* Supports negation patterns (e.g., "!**\/excluded.ts").
|
|
3644
3749
|
*
|
|
3645
3750
|
* @param patterns - Glob pattern(s). Can be a single pattern or array of patterns.
|
|
3646
3751
|
* @param cwd - Working directory (defaults to process.cwd())
|
|
@@ -3648,18 +3753,6 @@ const discoverModulesAsync = async (options) => {
|
|
|
3648
3753
|
*/
|
|
3649
3754
|
const scanGlob = (patterns, cwd = process.cwd()) => {
|
|
3650
3755
|
const patternArray = Array.isArray(patterns) ? patterns : [patterns];
|
|
3651
|
-
const hasNegation = patternArray.some((p) => p.startsWith("!"));
|
|
3652
|
-
if (typeof Bun !== "undefined" && Bun.Glob && !hasNegation) {
|
|
3653
|
-
const { Glob } = Bun;
|
|
3654
|
-
const results = new Set();
|
|
3655
|
-
for (const pattern of patternArray) {
|
|
3656
|
-
const glob = new Glob(pattern);
|
|
3657
|
-
for (const match of glob.scanSync(cwd)) {
|
|
3658
|
-
results.add(match);
|
|
3659
|
-
}
|
|
3660
|
-
}
|
|
3661
|
-
return Array.from(results);
|
|
3662
|
-
}
|
|
3663
3756
|
return fg.sync(patternArray, {
|
|
3664
3757
|
cwd,
|
|
3665
3758
|
dot: true,
|
|
@@ -3954,7 +4047,8 @@ const createBuilderSession = (options) => {
|
|
|
3954
4047
|
const graphqlHelper = createGraphqlSystemIdentifyHelper(config);
|
|
3955
4048
|
const ensureAstAnalyzer = cachedFn(() => createAstAnalyzer({
|
|
3956
4049
|
analyzer: config.analyzer,
|
|
3957
|
-
graphqlHelper
|
|
4050
|
+
graphqlHelper,
|
|
4051
|
+
baseDir: config.baseDir
|
|
3958
4052
|
}));
|
|
3959
4053
|
const ensureDiscoveryCache = cachedFn(() => createDiscoveryCache({
|
|
3960
4054
|
factory: cacheFactory,
|
|
@@ -4001,6 +4095,7 @@ const createBuilderSession = (options) => {
|
|
|
4001
4095
|
input: {
|
|
4002
4096
|
entryPaths,
|
|
4003
4097
|
astAnalyzer: ensureAstAnalyzer(),
|
|
4098
|
+
aliasResolver: config.tsconfigPaths ? createAliasResolver(config.tsconfigPaths) : undefined,
|
|
4004
4099
|
discoveryCache: ensureDiscoveryCache(),
|
|
4005
4100
|
changedFiles,
|
|
4006
4101
|
removedFiles,
|
|
@@ -4123,7 +4218,7 @@ const prepare = (input) => {
|
|
|
4123
4218
|
* This enables single scheduler control at the root level for both sync and async execution.
|
|
4124
4219
|
*/
|
|
4125
4220
|
function* buildGen(input) {
|
|
4126
|
-
const { entryPaths, astAnalyzer, discoveryCache, changedFiles, removedFiles, previousModuleAdjacency, previousIntermediateModules, graphqlSystemPath, graphqlHelper } = input;
|
|
4221
|
+
const { entryPaths, astAnalyzer, aliasResolver, discoveryCache, changedFiles, removedFiles, previousModuleAdjacency, previousIntermediateModules, graphqlSystemPath, graphqlHelper } = input;
|
|
4127
4222
|
const affectedFiles = collectAffectedFiles({
|
|
4128
4223
|
changedFiles,
|
|
4129
4224
|
removedFiles,
|
|
@@ -4132,6 +4227,7 @@ function* buildGen(input) {
|
|
|
4132
4227
|
const discoveryResult = yield* discoverModulesGen({
|
|
4133
4228
|
entryPaths,
|
|
4134
4229
|
astAnalyzer,
|
|
4230
|
+
aliasResolver,
|
|
4135
4231
|
incremental: {
|
|
4136
4232
|
cache: discoveryCache,
|
|
4137
4233
|
changedFiles,
|
|
@@ -4235,4 +4331,4 @@ const createBuilderService = ({ config, entrypointsOverride }) => {
|
|
|
4235
4331
|
|
|
4236
4332
|
//#endregion
|
|
4237
4333
|
export { getSeverity as _, createGraphqlSystemIdentifyHelper as a, BuilderArtifactSchema as b, BuilderEffects as c, formatBuilderErrorForCLI as d, formatBuilderErrorStructured as f, diagnosticMessages as g, createStandardDiagnostic as h, extractModuleAdjacency as i, FileReadEffect as l, createDiagnostic as m, createBuilderSession as n, __clearGqlCache as o, builderErrors as p, collectAffectedFiles as r, executeSandbox as s, createBuilderService as t, FileStatEffect as u, loadArtifact as v, loadArtifactSync as y };
|
|
4238
|
-
//# sourceMappingURL=service-
|
|
4334
|
+
//# sourceMappingURL=service-Xz1_XYDb.mjs.map
|