@c4a/extract-ts 0.5.33-alpha.4 → 0.5.35-alpha.3
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/index.js +2 -46
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -13744,10 +13744,6 @@ var symbolParamSchema = exports_external.object({
|
|
|
13744
13744
|
name: exports_external.string().min(1),
|
|
13745
13745
|
type: exports_external.string().min(1).nullable()
|
|
13746
13746
|
});
|
|
13747
|
-
var symbolRenameEvidenceSchema = exports_external.object({
|
|
13748
|
-
previous_identity_key: exports_external.string().min(1),
|
|
13749
|
-
reason: exports_external.string().min(1)
|
|
13750
|
-
});
|
|
13751
13747
|
var symbolInfoSchema = exports_external.lazy(() => exports_external.object({
|
|
13752
13748
|
name: exports_external.string().min(1),
|
|
13753
13749
|
kind: symbolKindSchema2,
|
|
@@ -13755,14 +13751,6 @@ var symbolInfoSchema = exports_external.lazy(() => exports_external.object({
|
|
|
13755
13751
|
file: exports_external.string().min(1),
|
|
13756
13752
|
line: exports_external.number().int().positive(),
|
|
13757
13753
|
endLine: exports_external.number().int().positive(),
|
|
13758
|
-
symbol_id: exports_external.string().min(1).optional(),
|
|
13759
|
-
identity_key: exports_external.string().min(1).optional(),
|
|
13760
|
-
display_name: exports_external.string().min(1).optional(),
|
|
13761
|
-
member_path: exports_external.array(exports_external.string().min(1)).optional(),
|
|
13762
|
-
root_symbol_id: exports_external.string().min(1).optional(),
|
|
13763
|
-
parent_symbol_id: exports_external.string().min(1).optional(),
|
|
13764
|
-
symbol_locator: exports_external.string().min(1).optional(),
|
|
13765
|
-
rename_evidence: exports_external.array(symbolRenameEvidenceSchema).optional(),
|
|
13766
13754
|
members: exports_external.array(symbolInfoSchema).optional(),
|
|
13767
13755
|
params: exports_external.array(symbolParamSchema).optional(),
|
|
13768
13756
|
returnType: exports_external.string().min(1).nullable().optional(),
|
|
@@ -13943,37 +13931,6 @@ var MANIFEST_FILES = [
|
|
|
13943
13931
|
"build.gradle"
|
|
13944
13932
|
];
|
|
13945
13933
|
var MANIFEST_NAMES = new Set(MANIFEST_FILES.map((f) => f.toLowerCase()));
|
|
13946
|
-
// ../extract/src/codeSnapshot.ts
|
|
13947
|
-
var buildCodeSymbolLocator = (packageName, symbolId, symbol) => `${packageName}:${symbolId}:${symbol.kind}:${symbol.file}:${symbol.line}-${symbol.endLine}`;
|
|
13948
|
-
var buildCodeSymbolIdentityKey = (packageName, rootSymbolId, symbolId, kind, hasParent) => hasParent ? `${packageName}|root:${rootSymbolId}|owned:${symbolId}|${kind}` : `${packageName}|root:${symbolId}|${kind}`;
|
|
13949
|
-
function applyCodeSymbolIdentity(symbol, context) {
|
|
13950
|
-
const segment = symbol.name;
|
|
13951
|
-
const symbolId = symbol.symbol_id ?? (context.parentSymbolId ? `${context.parentSymbolId}.${segment}` : segment);
|
|
13952
|
-
const rootSymbolId = symbol.root_symbol_id ?? context.rootSymbolId ?? symbolId;
|
|
13953
|
-
const memberPath = symbol.member_path ?? [...context.parentPath ?? [], segment];
|
|
13954
|
-
const hasParent = context.parentSymbolId !== undefined || symbol.parent_symbol_id !== undefined;
|
|
13955
|
-
const parentSymbolId = symbol.parent_symbol_id ?? context.parentSymbolId;
|
|
13956
|
-
const members = symbol.members?.map((member) => applyCodeSymbolIdentity(member, {
|
|
13957
|
-
packageName: context.packageName,
|
|
13958
|
-
parentSymbolId: symbolId,
|
|
13959
|
-
rootSymbolId,
|
|
13960
|
-
parentPath: memberPath
|
|
13961
|
-
}));
|
|
13962
|
-
return {
|
|
13963
|
-
...symbol,
|
|
13964
|
-
symbol_id: symbolId,
|
|
13965
|
-
identity_key: symbol.identity_key ?? buildCodeSymbolIdentityKey(context.packageName, rootSymbolId, symbolId, symbol.kind, hasParent),
|
|
13966
|
-
display_name: symbol.display_name ?? symbol.name,
|
|
13967
|
-
member_path: memberPath,
|
|
13968
|
-
root_symbol_id: rootSymbolId,
|
|
13969
|
-
...parentSymbolId !== undefined ? { parent_symbol_id: parentSymbolId } : {},
|
|
13970
|
-
symbol_locator: symbol.symbol_locator ?? buildCodeSymbolLocator(context.packageName, symbolId, symbol),
|
|
13971
|
-
...members && members.length > 0 ? { members } : {}
|
|
13972
|
-
};
|
|
13973
|
-
}
|
|
13974
|
-
function applySymbolIdentities(symbols, packageName) {
|
|
13975
|
-
return symbols.map((symbol) => applyCodeSymbolIdentity(symbol, { packageName }));
|
|
13976
|
-
}
|
|
13977
13934
|
// ../extract/src/runner.ts
|
|
13978
13935
|
var pluginSpecSchema = exports_external.object({
|
|
13979
13936
|
package: exports_external.string().min(1),
|
|
@@ -14711,7 +14668,7 @@ var extractSymbols = async (entries, fs2, options) => {
|
|
|
14711
14668
|
});
|
|
14712
14669
|
}
|
|
14713
14670
|
}
|
|
14714
|
-
const
|
|
14671
|
+
const symbols = [...exportedSymbols, ...internalSymbols];
|
|
14715
14672
|
const typeDeclarations = new Map;
|
|
14716
14673
|
for (const analysis of analyses.values()) {
|
|
14717
14674
|
for (const [name, decl] of analysis.declarations) {
|
|
@@ -14720,7 +14677,7 @@ var extractSymbols = async (entries, fs2, options) => {
|
|
|
14720
14677
|
}
|
|
14721
14678
|
}
|
|
14722
14679
|
}
|
|
14723
|
-
for (const sym of
|
|
14680
|
+
for (const sym of symbols) {
|
|
14724
14681
|
if (sym.kind !== "component")
|
|
14725
14682
|
continue;
|
|
14726
14683
|
let propsTypeName;
|
|
@@ -14741,7 +14698,6 @@ var extractSymbols = async (entries, fs2, options) => {
|
|
|
14741
14698
|
relations.push(createRelation("of_type" /* OfType */, sym.name, propsTypeName, false, sym.line));
|
|
14742
14699
|
}
|
|
14743
14700
|
}
|
|
14744
|
-
const symbols = applySymbolIdentities(rawSymbols, options.packageInfo.name);
|
|
14745
14701
|
const files = [...filePaths].sort().map((filePath) => ({
|
|
14746
14702
|
path: filePath,
|
|
14747
14703
|
language: filePath.endsWith(".tsx") ? "tsx" : "typescript",
|