@dbml/parse 10.4.0-alpha.2 → 11.0.0-alpha.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.
Files changed (36) hide show
  1. package/LICENSE +0 -0
  2. package/dist/dbml-parse.js +38 -28
  3. package/dist/dbml-parse.mjs +5991 -4945
  4. package/dist/src/compiler/index.d.ts +40 -8
  5. package/dist/src/compiler/projectLayout/layout.d.ts +0 -7
  6. package/dist/src/compiler/queries/files/fileKind.d.ts +18 -0
  7. package/dist/src/compiler/queries/transform/index.d.ts +2 -1
  8. package/dist/src/compiler/queries/transform/renameElement.d.ts +13 -0
  9. package/dist/src/compiler/queries/transform/types.d.ts +10 -1
  10. package/dist/src/compiler/queries/transform/utils/arch.d.ts +6 -0
  11. package/dist/src/core/arch/icons.d.ts +5 -0
  12. package/dist/src/core/arch/read.d.ts +51 -0
  13. package/dist/src/core/arch/vocabulary.d.ts +11 -0
  14. package/dist/src/core/global_modules/arch/index.d.ts +2 -0
  15. package/dist/src/core/global_modules/arch/interpret.d.ts +11 -0
  16. package/dist/src/core/global_modules/arch/utils.d.ts +7 -0
  17. package/dist/src/core/global_modules/index.d.ts +15 -1
  18. package/dist/src/core/global_modules/metadata/utils.d.ts +3 -1
  19. package/dist/src/core/global_modules/program/bind.d.ts +1 -0
  20. package/dist/src/core/global_modules/program/interpret.d.ts +2 -0
  21. package/dist/src/core/lexer/lexer.d.ts +23 -1
  22. package/dist/src/core/local_modules/arch/index.d.ts +2 -0
  23. package/dist/src/core/local_modules/index.d.ts +1 -0
  24. package/dist/src/core/parser/parser.d.ts +18 -1
  25. package/dist/src/core/types/errors.d.ts +17 -1
  26. package/dist/src/core/types/filepath.d.ts +1 -3
  27. package/dist/src/core/types/nodes.d.ts +1 -0
  28. package/dist/src/core/types/schemaJson/types.d.ts +63 -1
  29. package/dist/src/core/types/symbol/metadata.d.ts +12 -1
  30. package/dist/src/core/types/symbol/symbols.d.ts +18 -0
  31. package/dist/src/core/types/tokens.d.ts +2 -0
  32. package/dist/src/index.d.ts +19 -4
  33. package/dist/src/services/definition/provider.d.ts +0 -1
  34. package/dist/src/services/suggestions/provider.d.ts +1 -3
  35. package/dist/src/services/suggestions/use.d.ts +1 -4
  36. package/package.json +3 -3
@@ -8,17 +8,32 @@ export { MetadataKind } from './core/types/symbol/metadata';
8
8
  export * from './core/global_modules/records/utils';
9
9
  export * from './core/types/nodes';
10
10
  export { SyntaxToken, SyntaxTokenKind, isTriviaToken, isOp, isOpToken, } from './core/types/tokens';
11
- export { CompileError, CompileErrorCode, CompileWarning, CompileInfo, } from './core/types/errors';
12
- export type { Diagnostic, DiagnosticQuickFix } from './services/diagnostics/provider';
11
+ export { CompileError, CompileErrorCode, } from './core/types/errors';
13
12
  export type { Position, } from './core/types';
14
13
  export { ScopeKind, splitQualifiedIdentifier, unescapeString, escapeString, formatRecordValue, isValidIdentifier, addDoubleQuoteIfNeeded, normalizeQualifiedName, } from './compiler/index';
15
- export { type Database, type MasterDatabase, type Table, type Note, type Column, type ColumnType, type Index, type Check, type InlineRef, type Ref, type RefEndpointPair, type RefEndpoint, type Enum, type EnumField, type TableGroup, type TableGroupField, type Alias, type AliasKind, type TablePartial, type TablePartialInjection, type RecordValue, type RecordValueType, type TableRecord, type Project, type SchemaElement, type TokenPosition, type ElementRef, type FilterConfig, type DiagramView, type CustomMetadata, } from './core/types/schemaJson';
14
+ export { type Database, type MasterDatabase, type Table, type Note, type Column, type ColumnType, type Index, type Check, type InlineRef, type Ref, type RefEndpointPair, type RefEndpoint, type Enum, type EnumField, type TableGroup, type TableGroupField, type Alias, type AliasKind, type TablePartial, type TablePartialInjection, type RecordValue, type RecordValueType, type TableRecord, type Project, type SchemaElement, type TokenPosition, type ElementRef, type FilterConfig, type DiagramView, type CustomMetadata, type Node, type Group, type NoteBox, type Link, type LinkOp, type Kind, type KindCategory, type ArchSettings, type ArchSettingValue, } from './core/types/schemaJson';
15
+ export { type FileKind, ARCH_DIAGRAM_TYPES, isArchDiagramType } from './compiler/queries/files/fileKind';
16
+ export { BUILTIN_KINDS, RESERVED, isReserved, suggestKind, suggestIcon, type KindSpec, } from './core/arch/vocabulary';
17
+ export { ICON_ALIAS, ICON_NAMES, isIconName, resolveIcon, } from './core/arch/icons';
16
18
  export { type RelationCardinality, type RelationshipOp, getRelationshipOp, getMultiplicities, parseCardinality, makeCardinalityRequired, makeCardinalityOptional, makeRelationshipRequired, isEndpointOneSide, isEndpointManySide, isEndpointOptional, isEndpointRequired, CARDINALITY_ONE, CARDINALITY_MAYBE, CARDINALITY_SOME, CARDINALITY_MANY, } from './core/types/relation';
17
19
  export type { DiagramViewSyncOperation, DiagramViewBlock, TextEdit, } from './compiler/queries/transform';
18
20
  export { findDiagramViewBlocks } from './compiler/queries/transform';
19
21
  export type { DepSyncOperation, DepSyncEdge, DepEndpointRef } from './compiler/queries/transform';
20
- export type { ElementIdentifier, SchemaIdentifier, TableIdentifier, ColumnIdentifier, EnumIdentifier, EndpointRef, RefIdentifier, DepIdentifier, NoteIdentifier, TableGroupIdentifier, } from './compiler/queries/transform';
22
+ export type { ElementIdentifier, SchemaIdentifier, TableIdentifier, ColumnIdentifier, EnumIdentifier, EndpointRef, RefIdentifier, DepIdentifier, NoteIdentifier, TableGroupIdentifier, ArchElementIdentifier, ArchLinkIdentifier, } from './compiler/queries/transform';
21
23
  export { dbmlLanguageConfig, dbmlMonarchTokensProvider, } from './services/monarch';
22
24
  export * from './compiler/projectLayout/layout';
25
+ /**
26
+ * The dialect seam.
27
+ *
28
+ * A Compiler takes the element vocabulary and the grammar switches it should run with. Pass a
29
+ * different module list and the same lexer, parser, file graph, caching and diagnostics bind a
30
+ * different language. Nothing below this line changes DBML: `dbmlModules` is what a Compiler
31
+ * uses when nobody says otherwise, and every switch in `ParserOptions` is off by default.
32
+ */
33
+ export { dbmlModules } from './core/global_modules';
34
+ export type { GlobalModule } from './core/global_modules/types';
35
+ export type { ParserOptions } from './core/parser/parser';
36
+ export type { LexerOptions } from './core/lexer/lexer';
37
+ export type { DialectOptions } from './compiler/index';
23
38
  export { Compiler };
24
39
  export * from './services';
@@ -4,5 +4,4 @@ export default class DBMLDefinitionProvider implements DefinitionProvider {
4
4
  private compiler;
5
5
  constructor(compiler: Compiler);
6
6
  provideDefinition(model: TextModel, position: Position): Definition;
7
- private resolveImportPath;
8
7
  }
@@ -20,13 +20,11 @@ export declare const TABLE_BODY_SUGGESTION_LABELS: ("indexes" | "checks" | "Note
20
20
  export declare const PROJECT_FIELD_SUGGESTION_LABELS: ("Table" | "Enum" | "TableGroup" | "TablePartial" | "Note" | "Ref" | "Dep")[];
21
21
  export interface DBMLCompletionItemProviderOptions {
22
22
  triggerCharacters?: string[];
23
- fileListDepth?: number;
24
23
  }
25
24
  export default class DBMLCompletionItemProvider implements CompletionItemProvider {
26
25
  private compiler;
27
26
  triggerCharacters: string[];
28
- fileListDepth: number;
29
27
  constructor(compiler: Compiler, options?: DBMLCompletionItemProviderOptions);
30
28
  provideCompletionItems(model: TextModel, position: Position): CompletionList;
31
29
  }
32
- export declare const TOP_LEVEL_SUGGESTION_LABELS: ("Table" | "Enum" | "TableGroup" | "TablePartial" | "Note" | "DiagramView" | "Metadata" | "Ref" | "Dep" | "Project" | "Records")[];
30
+ export declare const TOP_LEVEL_SUGGESTION_LABELS: ("Table" | "Enum" | "TableGroup" | "TablePartial" | "Note" | "Metadata" | "Ref" | "Project" | "DiagramView" | "Dep" | "Records")[];
@@ -2,7 +2,4 @@ import { default as Compiler } from '../../compiler';
2
2
  import { Filepath } from '../../core/types/filepath';
3
3
  import { SyntaxToken } from '../../core/types/tokens';
4
4
  import { CompletionList, TextModel } from '../types';
5
- export interface SuggestUseCompletionOptions {
6
- fileListDepth?: number;
7
- }
8
- export declare function suggestUseCompletion(compiler: Compiler, filepath: Filepath, offset: number, bOcToken: SyntaxToken | undefined, model: TextModel, options?: SuggestUseCompletionOptions): CompletionList | null;
5
+ export declare function suggestUseCompletion(compiler: Compiler, filepath: Filepath, offset: number, bOcToken: SyntaxToken | undefined, model: TextModel): CompletionList | null;
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": "10.4.0-alpha.2",
4
+ "version": "11.0.0-alpha.2",
5
5
  "description": "DBML parser v2",
6
6
  "author": "Holistics <dev@holistics.io>",
7
7
  "license": "Apache-2.0",
@@ -25,7 +25,7 @@
25
25
  "dist"
26
26
  ],
27
27
  "scripts": {
28
- "build": "rimraf ./dist && tsc --noEmit && vite build",
28
+ "build": "rm -rf ./dist && tsc --noEmit && vite build",
29
29
  "dev": "vite build --watch",
30
30
  "test": "vitest run",
31
31
  "test:watch": "vitest watch",
@@ -51,5 +51,5 @@
51
51
  "engines": {
52
52
  "node": ">=18"
53
53
  },
54
- "gitHead": "cdf36a18c335cfea80135fabab1b8f80c7466cfd"
54
+ "gitHead": "75a0e5bf55149fef937ec7d02e48c170421229ff"
55
55
  }