@dbml/parse 8.3.0-alpha.0 → 8.3.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/dist/__benchmarks__/compiler.benchmark.d.ts +1 -0
- package/dist/__benchmarks__/compiler.profile.d.ts +1 -0
- package/dist/dbml-parse.js +19 -19
- package/dist/dbml-parse.mjs +10466 -10117
- package/dist/src/compiler/index.d.ts +2 -0
- package/dist/src/compiler/queries/symbol/lookupMembers.d.ts +1 -0
- package/dist/src/core/types/report.d.ts +3 -3
- package/package.json +8 -4
|
@@ -20,6 +20,7 @@ export default class Compiler {
|
|
|
20
20
|
private entrypointsSnapshot;
|
|
21
21
|
private cleanStaleGlobalCache;
|
|
22
22
|
private globalCache;
|
|
23
|
+
private globallyQuerying;
|
|
23
24
|
private globalQuery;
|
|
24
25
|
private localCache;
|
|
25
26
|
private localQuery;
|
|
@@ -41,6 +42,7 @@ export default class Compiler {
|
|
|
41
42
|
nodeSymbol: (node: SyntaxNode) => import('../core/types/report').default<typeof import('..').UNHANDLED> | import('../core/types/report').default<import('../core/types/symbol').NodeSymbol>;
|
|
42
43
|
nodeMetadata: (node: SyntaxNode) => import('../core/types/report').default<typeof import('..').UNHANDLED> | import('../core/types/report').default<import('../core/types/symbol').NodeMetadata>;
|
|
43
44
|
symbolMembers: (symbol: import('../core/types/symbol').NodeSymbol) => import('../core/types/report').default<typeof import('..').UNHANDLED> | import('../core/types/report').default<import('../core/types/symbol').NodeSymbol[]>;
|
|
45
|
+
symbolMembersLookupMap: (symbol: import('../core/types/symbol').NodeSymbol) => Map<string, import('../core/types/symbol').NodeSymbol[]>;
|
|
44
46
|
lookupMembers: (symbolOrNode: import('../core/types/symbol').NodeSymbol | SyntaxNode, targetKinds: import('../core/types/symbol').SymbolKind | import('../core/types/symbol').SymbolKind[], targetName: string) => import('../core/types/symbol').NodeSymbol | undefined;
|
|
45
47
|
nodeReferee: (node: SyntaxNode) => import('../core/types/report').default<typeof import('..').UNHANDLED> | import('../core/types/report').default<import('../core/types/symbol').NodeSymbol | undefined>;
|
|
46
48
|
resolutionIndex: () => import('./queries/resolutionIndex').ResolutionIndex;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SyntaxNode } from '../../../core/types/nodes';
|
|
2
2
|
import { NodeSymbol, SymbolKind } from '../../../core/types/symbol';
|
|
3
3
|
import { default as Compiler } from '../../index';
|
|
4
|
+
export declare function symbolMembersLookupMap(this: Compiler, symbol: NodeSymbol): Map<string, NodeSymbol[]>;
|
|
4
5
|
export declare function lookupMembers(this: Compiler, symbolOrNode: NodeSymbol | SyntaxNode, targetKinds: SymbolKind | SymbolKind[], targetName: string): NodeSymbol | undefined;
|
|
@@ -7,12 +7,12 @@ export default class Report<T> {
|
|
|
7
7
|
constructor(value: T, errors?: CompileError[], warnings?: CompileWarning[]);
|
|
8
8
|
filter<S extends symbol>(filteredValue: S): Report<undefined | Exclude<T, S>>;
|
|
9
9
|
hasValue<S>(value: S): this is Report<S>;
|
|
10
|
-
getFiltered<S extends symbol | undefined | null>(
|
|
10
|
+
getFiltered<S extends symbol | undefined | null>(filteredValue: S): Exclude<T, S> | undefined;
|
|
11
11
|
getValue(): T;
|
|
12
12
|
getErrors(): CompileError[];
|
|
13
13
|
getWarnings(): CompileWarning[];
|
|
14
|
-
chainFiltered<S extends symbol | undefined | null, U>(fn: (_: Exclude<T, S>) => Report<U>,
|
|
14
|
+
chainFiltered<S extends symbol | undefined | null, U>(fn: (_: Exclude<T, S>) => Report<U>, filteredValue: S): Report<U | undefined>;
|
|
15
15
|
chain<U>(fn: (_: T) => Report<U>): Report<U>;
|
|
16
|
-
mapFiltered<S extends symbol | undefined | null, U>(fn: (_: Exclude<T, S>) => U,
|
|
16
|
+
mapFiltered<S extends symbol | undefined | null, U>(fn: (_: Exclude<T, S>) => U, filteredValue: S): Report<U | undefined>;
|
|
17
17
|
map<U>(fn: (_: T) => U): Report<U>;
|
|
18
18
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "@dbml/parse",
|
|
4
|
-
"version": "8.3.0
|
|
4
|
+
"version": "8.3.0",
|
|
5
5
|
"description": "DBML parser v2",
|
|
6
6
|
"author": "Holistics <dev@holistics.io>",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -32,11 +32,15 @@
|
|
|
32
32
|
"coverage": "vitest run --coverage",
|
|
33
33
|
"prepare": "npm run build",
|
|
34
34
|
"lint": "eslint .",
|
|
35
|
-
"lint:fix": "eslint --fix ."
|
|
35
|
+
"lint:fix": "eslint --fix .",
|
|
36
|
+
"bench": "npx tsx __benchmarks__/compiler.benchmark.ts",
|
|
37
|
+
"profile:build": "vite build --config vite.profile.config.mts && cp -r __benchmarks__/input dist-profile/input",
|
|
38
|
+
"profile": "yarn profile:build && node --cpu-prof --cpu-prof-dir __benchmarks__/output/ dist-profile/__benchmarks__/compiler.profile.mjs"
|
|
36
39
|
},
|
|
37
40
|
"devDependencies": {
|
|
38
41
|
"@types/luxon": "^3.7.1",
|
|
39
|
-
"monaco-editor-core": "^0.44.0"
|
|
42
|
+
"monaco-editor-core": "^0.44.0",
|
|
43
|
+
"vite-plugin-no-bundle": "^4.0.0"
|
|
40
44
|
},
|
|
41
45
|
"dependencies": {
|
|
42
46
|
"lodash-es": "^4.18.1",
|
|
@@ -46,5 +50,5 @@
|
|
|
46
50
|
"engines": {
|
|
47
51
|
"node": ">=18"
|
|
48
52
|
},
|
|
49
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "d1c00c334882b0221bd3966a17e098d86611bec2"
|
|
50
54
|
}
|