@akanjs/language 3.2.0-rc.1 → 3.2.0-rc.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/akanGraph.d.ts +1 -1
- package/akanGraphDiff.d.ts +1 -1
- package/escapeRegExp.d.ts +1 -0
- package/guardFacts.d.ts +43 -0
- package/guardResolver.d.ts +56 -0
- package/index.cjs +1000 -409
- package/index.js +1000 -409
- package/moduleFacts.d.ts +9 -14
- package/package.json +1 -1
- package/routeFacts.d.ts +5 -2
- package/server.js +961 -408
package/akanGraph.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AkanGraph } from "akanjs/common/akanGraph.ts";
|
|
2
2
|
import type * as TS from "typescript";
|
|
3
3
|
import type { Ts } from "./ast";
|
|
4
|
-
import {
|
|
4
|
+
import type { AkanFactReader, FileFacts } from "./moduleFacts";
|
|
5
5
|
import type { AkanTarget } from "./nameTable";
|
|
6
6
|
export interface AkanGraphSource {
|
|
7
7
|
ts: Ts;
|
package/akanGraphDiff.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const escapeRegExp: (text: string) => string;
|
package/guardFacts.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type * as TS from "typescript";
|
|
2
|
+
import type { AkanAst, Ts } from "./ast";
|
|
3
|
+
import type { AkanSpan, Extent, ImportFact, MemberFact } from "./moduleFacts";
|
|
4
|
+
export interface GuardFact extends MemberFact {
|
|
5
|
+
scope: string | null;
|
|
6
|
+
doc: string | null;
|
|
7
|
+
factory: string | null;
|
|
8
|
+
}
|
|
9
|
+
export interface GuardFactoryFact extends MemberFact {
|
|
10
|
+
scope: string | null;
|
|
11
|
+
doc: string | null;
|
|
12
|
+
direct: boolean;
|
|
13
|
+
via: string[];
|
|
14
|
+
}
|
|
15
|
+
export interface GuardCallFact extends MemberFact {
|
|
16
|
+
callee: string;
|
|
17
|
+
kind: "call" | "extends";
|
|
18
|
+
scope: string | null;
|
|
19
|
+
doc: string | null;
|
|
20
|
+
}
|
|
21
|
+
export interface InPlaceGuard {
|
|
22
|
+
call: TS.CallExpression;
|
|
23
|
+
name: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const guardLabelOf: (guard: string, labels: Record<string, string>) => string;
|
|
26
|
+
interface GuardReaderBase {
|
|
27
|
+
spanOf: (source: TS.SourceFile, node: TS.Node) => AkanSpan;
|
|
28
|
+
extentOf: (source: TS.SourceFile, node: TS.Node) => Extent;
|
|
29
|
+
unwrap: (expression: TS.Expression) => TS.Expression;
|
|
30
|
+
docOf: (source: TS.SourceFile, node: TS.Node) => string | null;
|
|
31
|
+
}
|
|
32
|
+
export declare const createGuardFactReader: (ts: Ts, ast: AkanAst, base: GuardReaderBase) => {
|
|
33
|
+
guardsIn: (source: TS.SourceFile, object: TS.ObjectLiteralExpression | undefined, made: InPlaceGuard[], member: string) => string[];
|
|
34
|
+
guardsOf: (source: TS.SourceFile, imports: ImportFact[], madeInPlace: InPlaceGuard[]) => {
|
|
35
|
+
guards: GuardFact[];
|
|
36
|
+
guardFactories: GuardFactoryFact[];
|
|
37
|
+
guardCalls: GuardCallFact[];
|
|
38
|
+
guardLabels: {
|
|
39
|
+
[k: string]: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type * as TS from "typescript";
|
|
2
|
+
import type { AkanGraphSource } from "./akanGraph";
|
|
3
|
+
import { type AkanSpan, type Extent, type FileFacts } from "./moduleFacts";
|
|
4
|
+
import type { RouteFactReader } from "./routeFacts";
|
|
5
|
+
export type GuardSite = Pick<FileFacts, "fileName" | "owner" | "imports">;
|
|
6
|
+
interface GuardPart {
|
|
7
|
+
fileName: string;
|
|
8
|
+
extent: Extent;
|
|
9
|
+
}
|
|
10
|
+
export interface DeclaredGuard {
|
|
11
|
+
name: string;
|
|
12
|
+
owner: string | null;
|
|
13
|
+
span: AkanSpan;
|
|
14
|
+
scope: string | null;
|
|
15
|
+
doc: string | null;
|
|
16
|
+
parts: GuardPart[];
|
|
17
|
+
file: string | null;
|
|
18
|
+
label?: string;
|
|
19
|
+
}
|
|
20
|
+
type GuardLookup = {
|
|
21
|
+
guard: DeclaredGuard;
|
|
22
|
+
} | {
|
|
23
|
+
name: string;
|
|
24
|
+
from: string | undefined;
|
|
25
|
+
} | {
|
|
26
|
+
external: true;
|
|
27
|
+
};
|
|
28
|
+
interface Declaration {
|
|
29
|
+
source: TS.SourceFile;
|
|
30
|
+
statement: TS.Statement;
|
|
31
|
+
declared: TS.Node;
|
|
32
|
+
extent: Extent;
|
|
33
|
+
name: string;
|
|
34
|
+
}
|
|
35
|
+
export declare const frameworkOwner = "akanjs";
|
|
36
|
+
export declare const frameworkPattern: RegExp;
|
|
37
|
+
export declare const starExportPattern: RegExp;
|
|
38
|
+
export declare class GuardResolver {
|
|
39
|
+
#private;
|
|
40
|
+
constructor(source: AkanGraphSource, routes: RouteFactReader);
|
|
41
|
+
find(local: string, site: GuardSite): GuardLookup;
|
|
42
|
+
madeInPlace(fileName: string, name: string): DeclaredGuard | undefined;
|
|
43
|
+
declare(facts: FileFacts[]): DeclaredGuard[];
|
|
44
|
+
reexportOf(owner: string, name: string, near: string | null): {
|
|
45
|
+
local: string;
|
|
46
|
+
site: GuardSite;
|
|
47
|
+
} | null;
|
|
48
|
+
declarationOf(owner: string, name: string, near: string | null, depth?: number): Declaration | null;
|
|
49
|
+
declares(owner: string, name: string): boolean;
|
|
50
|
+
filesIn(owner: string): [fileName: string, words: string][];
|
|
51
|
+
inOwner(fileName: string, owner: string | null): string;
|
|
52
|
+
ownerOfSpecifier(fileName: string, specifier: string): string | undefined;
|
|
53
|
+
pathOfSpecifier(fileName: string, specifier: string): string | null;
|
|
54
|
+
visible(target: string | null, from: string | null): boolean;
|
|
55
|
+
}
|
|
56
|
+
export {};
|