@suss/adapter-ruby 0.22.1 → 0.22.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/dist/index.cjs +2703 -18061
- package/dist/index.d.cts +33 -1
- package/dist/index.d.ts +33 -1
- package/dist/index.js +2766 -18106
- package/package.json +7 -5
package/dist/index.d.cts
CHANGED
|
@@ -4,6 +4,7 @@ import { Database } from '@suss/datalog';
|
|
|
4
4
|
import { TypeShape, BehavioralSummary } from '@suss/behavioral-ir';
|
|
5
5
|
import { RawCodeStructure, TimingReport, ExtractionReport, CacheDiagnostic } from '@suss/extractor';
|
|
6
6
|
import { WhyExplained } from '@suss/resolution';
|
|
7
|
+
import { Value } from '@suss/values';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* A new `Parser` for every call, so that parses running at the same time do
|
|
@@ -563,6 +564,37 @@ interface TypeReadContext {
|
|
|
563
564
|
*/
|
|
564
565
|
declare function typeShapeFromNode(node: Node, ctx: TypeReadContext): TypeShape | null;
|
|
565
566
|
|
|
567
|
+
/**
|
|
568
|
+
* One evaluator per project, over the parsed files and the resolution
|
|
569
|
+
* facts. A reader hands in a node and gets back the abstract value it
|
|
570
|
+
* comes down to; a route path or a prefix is then spelled from that
|
|
571
|
+
* value rather than read off one syntax shape.
|
|
572
|
+
*
|
|
573
|
+
* The facts key a node by file and span, so the evaluator keeps every
|
|
574
|
+
* file's root to find the node a fact refers to. Without facts,
|
|
575
|
+
* which is how a unit test or a routes file on its own runs, the
|
|
576
|
+
* evaluator still follows names within the file through the engine's
|
|
577
|
+
* own scope walk.
|
|
578
|
+
*/
|
|
579
|
+
|
|
580
|
+
interface EvaluatedFile {
|
|
581
|
+
readonly file: string;
|
|
582
|
+
readonly root: Node;
|
|
583
|
+
}
|
|
584
|
+
interface ProjectNodes {
|
|
585
|
+
readonly files: readonly EvaluatedFile[];
|
|
586
|
+
/** Every method definition by its node key, for a resolved callee. */
|
|
587
|
+
readonly definitions: ReadonlyMap<string, Node>;
|
|
588
|
+
}
|
|
589
|
+
/** Register the parsed project, so reads through `db` can follow the facts back to nodes. */
|
|
590
|
+
declare function bindEvaluator(db: Database, nodes: ProjectNodes): void;
|
|
591
|
+
/** The abstract value `node` comes down to, through the facts when `db` was bound. */
|
|
592
|
+
declare function evaluatedValue(node: Node, db?: Database): Value;
|
|
593
|
+
/** The one string `node` comes down to, or null when it does not settle on one. */
|
|
594
|
+
declare function stringValueOf(node: Node, db?: Database): string | null;
|
|
595
|
+
/** Every method a file defines, keyed the way the facts key it, for `bindEvaluator`. */
|
|
596
|
+
declare function methodDefinitionsIn(file: string, root: Node): Map<string, Node>;
|
|
597
|
+
|
|
566
598
|
/**
|
|
567
599
|
* version.ts: this adapter's own half of the cache key.
|
|
568
600
|
*
|
|
@@ -573,4 +605,4 @@ declare function typeShapeFromNode(node: Node, ctx: TypeReadContext): TypeShape
|
|
|
573
605
|
*/
|
|
574
606
|
declare const ADAPTER_VERSION = "0.1.0";
|
|
575
607
|
|
|
576
|
-
export { ADAPTER_VERSION, type AncestorEntry, type AncestorLookup, type Ancestry, type CallArgs, type ClassInfo, type ConstantPathConvention, type ControllerActions, type DiscoveryOptions, type ExtractRubyOptions, type ExtractRubyResult, type FileCache, type FileConstants, type GraphqlObjectFields, type GraphqlTypeNameConvention, type MethodLookup, type Range, type RbStoragePattern, type ReachedBody, type RubyDiscoveryPattern, type RubyExtendsSite, type RubyPack, type RubyRequireSite, type RubyStubEvidence, type RubyStubEvidenceOptions, type RubyValueHandle, RubyWhySession, type RubyWhySessionOptions, type TypeReadContext, ancestryOf, bodyStatements, booleanLiteralValue, collectFileConstants, createFileCache, discoverUnits, emitConstantBindings, emitEntryFact, emitValueFacts, extractRubyProject, field, findRubyFiles, graphqlTypeNameFromQualified, hashKeySymbolName, inheritedStatements, methodInAncestry, nodeId, parseRuby, parseRubySync, preloadRubyGrammar, qualifyConstantRef, reachDefinition, readCallArgs, readKey, resolveConstantFile, rubyStubEvidence, runStatements, stringLiteralValue, symbolValue, typeShapeFromNode, underscoreConstantPath, unitKey, walkClasses, walkDefinitions };
|
|
608
|
+
export { ADAPTER_VERSION, type AncestorEntry, type AncestorLookup, type Ancestry, type CallArgs, type ClassInfo, type ConstantPathConvention, type ControllerActions, type DiscoveryOptions, type EvaluatedFile, type ExtractRubyOptions, type ExtractRubyResult, type FileCache, type FileConstants, type GraphqlObjectFields, type GraphqlTypeNameConvention, type MethodLookup, type ProjectNodes, type Range, type RbStoragePattern, type ReachedBody, type RubyDiscoveryPattern, type RubyExtendsSite, type RubyPack, type RubyRequireSite, type RubyStubEvidence, type RubyStubEvidenceOptions, type RubyValueHandle, RubyWhySession, type RubyWhySessionOptions, type TypeReadContext, ancestryOf, bindEvaluator, bodyStatements, booleanLiteralValue, collectFileConstants, createFileCache, discoverUnits, emitConstantBindings, emitEntryFact, emitValueFacts, evaluatedValue, extractRubyProject, field, findRubyFiles, graphqlTypeNameFromQualified, hashKeySymbolName, inheritedStatements, methodDefinitionsIn, methodInAncestry, nodeId, parseRuby, parseRubySync, preloadRubyGrammar, qualifyConstantRef, reachDefinition, readCallArgs, readKey, resolveConstantFile, rubyStubEvidence, runStatements, stringLiteralValue, stringValueOf, symbolValue, typeShapeFromNode, underscoreConstantPath, unitKey, walkClasses, walkDefinitions };
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { Database } from '@suss/datalog';
|
|
|
4
4
|
import { TypeShape, BehavioralSummary } from '@suss/behavioral-ir';
|
|
5
5
|
import { RawCodeStructure, TimingReport, ExtractionReport, CacheDiagnostic } from '@suss/extractor';
|
|
6
6
|
import { WhyExplained } from '@suss/resolution';
|
|
7
|
+
import { Value } from '@suss/values';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* A new `Parser` for every call, so that parses running at the same time do
|
|
@@ -563,6 +564,37 @@ interface TypeReadContext {
|
|
|
563
564
|
*/
|
|
564
565
|
declare function typeShapeFromNode(node: Node, ctx: TypeReadContext): TypeShape | null;
|
|
565
566
|
|
|
567
|
+
/**
|
|
568
|
+
* One evaluator per project, over the parsed files and the resolution
|
|
569
|
+
* facts. A reader hands in a node and gets back the abstract value it
|
|
570
|
+
* comes down to; a route path or a prefix is then spelled from that
|
|
571
|
+
* value rather than read off one syntax shape.
|
|
572
|
+
*
|
|
573
|
+
* The facts key a node by file and span, so the evaluator keeps every
|
|
574
|
+
* file's root to find the node a fact refers to. Without facts,
|
|
575
|
+
* which is how a unit test or a routes file on its own runs, the
|
|
576
|
+
* evaluator still follows names within the file through the engine's
|
|
577
|
+
* own scope walk.
|
|
578
|
+
*/
|
|
579
|
+
|
|
580
|
+
interface EvaluatedFile {
|
|
581
|
+
readonly file: string;
|
|
582
|
+
readonly root: Node;
|
|
583
|
+
}
|
|
584
|
+
interface ProjectNodes {
|
|
585
|
+
readonly files: readonly EvaluatedFile[];
|
|
586
|
+
/** Every method definition by its node key, for a resolved callee. */
|
|
587
|
+
readonly definitions: ReadonlyMap<string, Node>;
|
|
588
|
+
}
|
|
589
|
+
/** Register the parsed project, so reads through `db` can follow the facts back to nodes. */
|
|
590
|
+
declare function bindEvaluator(db: Database, nodes: ProjectNodes): void;
|
|
591
|
+
/** The abstract value `node` comes down to, through the facts when `db` was bound. */
|
|
592
|
+
declare function evaluatedValue(node: Node, db?: Database): Value;
|
|
593
|
+
/** The one string `node` comes down to, or null when it does not settle on one. */
|
|
594
|
+
declare function stringValueOf(node: Node, db?: Database): string | null;
|
|
595
|
+
/** Every method a file defines, keyed the way the facts key it, for `bindEvaluator`. */
|
|
596
|
+
declare function methodDefinitionsIn(file: string, root: Node): Map<string, Node>;
|
|
597
|
+
|
|
566
598
|
/**
|
|
567
599
|
* version.ts: this adapter's own half of the cache key.
|
|
568
600
|
*
|
|
@@ -573,4 +605,4 @@ declare function typeShapeFromNode(node: Node, ctx: TypeReadContext): TypeShape
|
|
|
573
605
|
*/
|
|
574
606
|
declare const ADAPTER_VERSION = "0.1.0";
|
|
575
607
|
|
|
576
|
-
export { ADAPTER_VERSION, type AncestorEntry, type AncestorLookup, type Ancestry, type CallArgs, type ClassInfo, type ConstantPathConvention, type ControllerActions, type DiscoveryOptions, type ExtractRubyOptions, type ExtractRubyResult, type FileCache, type FileConstants, type GraphqlObjectFields, type GraphqlTypeNameConvention, type MethodLookup, type Range, type RbStoragePattern, type ReachedBody, type RubyDiscoveryPattern, type RubyExtendsSite, type RubyPack, type RubyRequireSite, type RubyStubEvidence, type RubyStubEvidenceOptions, type RubyValueHandle, RubyWhySession, type RubyWhySessionOptions, type TypeReadContext, ancestryOf, bodyStatements, booleanLiteralValue, collectFileConstants, createFileCache, discoverUnits, emitConstantBindings, emitEntryFact, emitValueFacts, extractRubyProject, field, findRubyFiles, graphqlTypeNameFromQualified, hashKeySymbolName, inheritedStatements, methodInAncestry, nodeId, parseRuby, parseRubySync, preloadRubyGrammar, qualifyConstantRef, reachDefinition, readCallArgs, readKey, resolveConstantFile, rubyStubEvidence, runStatements, stringLiteralValue, symbolValue, typeShapeFromNode, underscoreConstantPath, unitKey, walkClasses, walkDefinitions };
|
|
608
|
+
export { ADAPTER_VERSION, type AncestorEntry, type AncestorLookup, type Ancestry, type CallArgs, type ClassInfo, type ConstantPathConvention, type ControllerActions, type DiscoveryOptions, type EvaluatedFile, type ExtractRubyOptions, type ExtractRubyResult, type FileCache, type FileConstants, type GraphqlObjectFields, type GraphqlTypeNameConvention, type MethodLookup, type ProjectNodes, type Range, type RbStoragePattern, type ReachedBody, type RubyDiscoveryPattern, type RubyExtendsSite, type RubyPack, type RubyRequireSite, type RubyStubEvidence, type RubyStubEvidenceOptions, type RubyValueHandle, RubyWhySession, type RubyWhySessionOptions, type TypeReadContext, ancestryOf, bindEvaluator, bodyStatements, booleanLiteralValue, collectFileConstants, createFileCache, discoverUnits, emitConstantBindings, emitEntryFact, emitValueFacts, evaluatedValue, extractRubyProject, field, findRubyFiles, graphqlTypeNameFromQualified, hashKeySymbolName, inheritedStatements, methodDefinitionsIn, methodInAncestry, nodeId, parseRuby, parseRubySync, preloadRubyGrammar, qualifyConstantRef, reachDefinition, readCallArgs, readKey, resolveConstantFile, rubyStubEvidence, runStatements, stringLiteralValue, stringValueOf, symbolValue, typeShapeFromNode, underscoreConstantPath, unitKey, walkClasses, walkDefinitions };
|