@akanjs/language 3.1.2-rc.4 → 3.2.0-rc.0
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 +2 -1
- package/frameworkChannelReader.d.ts +16 -0
- package/frameworkMapBuilder.d.ts +20 -0
- package/frameworkMapDoc.d.ts +10 -0
- package/index.cjs +2012 -310
- package/index.d.ts +4 -0
- package/index.js +2010 -308
- package/moduleFacts.d.ts +46 -0
- package/package.json +1 -1
- package/routeFacts.d.ts +48 -0
- package/server.js +1110 -270
package/moduleFacts.d.ts
CHANGED
|
@@ -56,16 +56,56 @@ export interface SliceClassFact extends ModuleClassFact {
|
|
|
56
56
|
export interface EndpointClassFact extends ModuleClassFact {
|
|
57
57
|
keys: EndpointKeyFact[];
|
|
58
58
|
}
|
|
59
|
+
export interface PlugFact extends NamedFact {
|
|
60
|
+
target: string;
|
|
61
|
+
}
|
|
59
62
|
export interface ServiceClassFact extends ModuleClassFact {
|
|
60
63
|
methods: MemberFact[];
|
|
64
|
+
plugs: PlugFact[];
|
|
65
|
+
}
|
|
66
|
+
export interface InternalKeyFact extends MemberFact {
|
|
67
|
+
type: string | null;
|
|
68
|
+
schedule: string | null;
|
|
69
|
+
modes: string[];
|
|
70
|
+
}
|
|
71
|
+
export interface InternalClassFact extends ModuleClassFact {
|
|
72
|
+
keys: InternalKeyFact[];
|
|
73
|
+
}
|
|
74
|
+
export interface AdaptorFact extends MemberFact {
|
|
75
|
+
refName: string | null;
|
|
76
|
+
plugs: PlugFact[];
|
|
77
|
+
doc: string | null;
|
|
61
78
|
}
|
|
62
79
|
export interface StoreClassFact extends ModuleClassFact {
|
|
63
80
|
stateKeys: NamedFact[];
|
|
64
81
|
actions: MemberFact[];
|
|
65
82
|
}
|
|
83
|
+
export interface GuardFact extends MemberFact {
|
|
84
|
+
scope: string | null;
|
|
85
|
+
doc: string | null;
|
|
86
|
+
factory: string | null;
|
|
87
|
+
}
|
|
88
|
+
export interface GuardFactoryFact extends MemberFact {
|
|
89
|
+
scope: string | null;
|
|
90
|
+
doc: string | null;
|
|
91
|
+
via: string | null;
|
|
92
|
+
}
|
|
93
|
+
export interface GuardCallFact extends MemberFact {
|
|
94
|
+
callee: string;
|
|
95
|
+
doc: string | null;
|
|
96
|
+
}
|
|
97
|
+
export interface ImportFact {
|
|
98
|
+
name: string;
|
|
99
|
+
imported: string;
|
|
100
|
+
from: string;
|
|
101
|
+
}
|
|
66
102
|
export interface FileFacts {
|
|
67
103
|
fileName: string;
|
|
68
104
|
owner: string | null;
|
|
105
|
+
imports: ImportFact[];
|
|
106
|
+
guards: GuardFact[];
|
|
107
|
+
guardFactories: GuardFactoryFact[];
|
|
108
|
+
guardCalls: GuardCallFact[];
|
|
69
109
|
constants: ConstantClassFact[];
|
|
70
110
|
enums: EnumClassFact[];
|
|
71
111
|
filters: FilterClassFact[];
|
|
@@ -73,12 +113,18 @@ export interface FileFacts {
|
|
|
73
113
|
services: ServiceClassFact[];
|
|
74
114
|
slices: SliceClassFact[];
|
|
75
115
|
endpoints: EndpointClassFact[];
|
|
116
|
+
internals: InternalClassFact[];
|
|
117
|
+
adaptors: AdaptorFact[];
|
|
76
118
|
stores: StoreClassFact[];
|
|
77
119
|
}
|
|
120
|
+
export declare const testFilePattern: RegExp;
|
|
78
121
|
export declare const ownerOf: (relativePath: string) => string | null;
|
|
79
122
|
export declare const createFactReader: (ts: Ts, ast: AkanAst) => {
|
|
80
123
|
read: (source: TS.SourceFile, owner: string | null) => FileFacts;
|
|
81
124
|
spanOf: (source: TS.SourceFile, node: TS.Node) => AkanSpan;
|
|
125
|
+
extentOf: (source: TS.SourceFile, node: TS.Node) => Extent;
|
|
126
|
+
docOf: (source: TS.SourceFile, node: TS.Node) => string | null;
|
|
127
|
+
importsIn: (source: TS.SourceFile) => ImportFact[];
|
|
82
128
|
moduleRefOf: (expression: TS.Expression | undefined, holder: string) => string | null;
|
|
83
129
|
chainOf: (initializer: TS.Expression) => {
|
|
84
130
|
root: TS.CallExpression | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akanjs/language",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0-rc.0",
|
|
4
4
|
"description": "Editor-independent Akan.js language core: resolves derived names (slices, queries, CRUD, form setters) back to the source key that produced them.",
|
|
5
5
|
"sourceType": "module",
|
|
6
6
|
"type": "module",
|
package/routeFacts.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type * as TS from "typescript";
|
|
2
|
+
import type { Ts } from "./ast";
|
|
3
|
+
import type { AkanFactReader, AkanSpan, Extent, ImportFact } from "./moduleFacts";
|
|
4
|
+
export interface RouteGuardCall {
|
|
5
|
+
name: string;
|
|
6
|
+
local: {
|
|
7
|
+
span: AkanSpan;
|
|
8
|
+
extent: Extent;
|
|
9
|
+
doc: string | null;
|
|
10
|
+
} | null;
|
|
11
|
+
}
|
|
12
|
+
export interface RouteGuardFact {
|
|
13
|
+
calls: RouteGuardCall[];
|
|
14
|
+
span: AkanSpan;
|
|
15
|
+
}
|
|
16
|
+
export interface RouteFact {
|
|
17
|
+
fileName: string;
|
|
18
|
+
owner: string;
|
|
19
|
+
kind: "page" | "layout";
|
|
20
|
+
pattern: string;
|
|
21
|
+
dir: string[];
|
|
22
|
+
isRoot: boolean;
|
|
23
|
+
line: number;
|
|
24
|
+
character: number;
|
|
25
|
+
guard: RouteGuardFact | null;
|
|
26
|
+
imports: ImportFact[];
|
|
27
|
+
alias: string | null;
|
|
28
|
+
}
|
|
29
|
+
interface RouteFileInfo {
|
|
30
|
+
owner: string;
|
|
31
|
+
key: string;
|
|
32
|
+
}
|
|
33
|
+
export declare class RouteFactReader {
|
|
34
|
+
#private;
|
|
35
|
+
constructor(ts: Ts, reader: AkanFactReader, parse: (fileName: string, text: string) => TS.SourceFile);
|
|
36
|
+
static fileOf(relative: string): RouteFileInfo | null;
|
|
37
|
+
read(fileName: string, info: RouteFileInfo, text: string, words: string): RouteFact | null;
|
|
38
|
+
declarationIn(source: TS.SourceFile, name: string): {
|
|
39
|
+
statement: TS.FunctionDeclaration;
|
|
40
|
+
declared: TS.Identifier;
|
|
41
|
+
initializer: null;
|
|
42
|
+
} | {
|
|
43
|
+
statement: TS.VariableStatement;
|
|
44
|
+
declared: TS.BindingName;
|
|
45
|
+
initializer: TS.Expression | null;
|
|
46
|
+
} | null;
|
|
47
|
+
}
|
|
48
|
+
export {};
|