@dbml/parse 9.0.0-optional-ref.6 → 10.0.0-optional-ref.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.
@@ -77,9 +77,6 @@ export default class Compiler {
77
77
  newDbml: string;
78
78
  edits: import('.').TextEdit[];
79
79
  };
80
- addSetting: (filepath: Filepath, declaration: SyntaxNode, setting: string) => string | undefined;
81
- updateSetting: (filepath: Filepath, declaration: SyntaxNode, settingName: string, newValue: string) => string | undefined;
82
- removeSetting: (filepath: Filepath, declaration: SyntaxNode, settingName: string) => string | undefined;
83
80
  findDiagramViewBlocks(filepath: Filepath): DiagramViewBlock[];
84
81
  readonly token: {
85
82
  invalidStream: (filepath: Filepath) => readonly import('..').SyntaxToken[];
@@ -1,6 +1,4 @@
1
1
  export { renameTable } from './renameTable';
2
2
  export { syncDiagramView, findDiagramViewBlocks, type DiagramViewSyncOperation, type DiagramViewBlock, } from './syncDiagramView';
3
3
  export { applyTextEdits, type TextEdit } from './applyTextEdits';
4
- export { addSetting, addSettingEdit } from './addSetting';
5
- export { updateSetting, updateSettingEdit, removeSetting, removeSettingEdit, } from './updateSetting';
6
4
  export { type TableNameInput } from './utils';
@@ -1,7 +1,8 @@
1
1
  import { default as Compiler } from '../../../compiler';
2
2
  import { CompileInfo } from '../../types/errors';
3
3
  import { RefMetadata, PartialRefMetadata } from '../../types/symbol/metadata';
4
- export declare function validateCardinality(compiler: Compiler, meta: RefMetadata | PartialRefMetadata, side: 'left' | 'right', options?: {
4
+ export declare function validateCardinality(compiler: Compiler, meta: RefMetadata | PartialRefMetadata, side: 'left' | 'right', // Whether we're validating the left side or the right side
5
+ options?: {
5
6
  allowOtherColFix?: boolean;
6
7
  allowOwnColFix?: boolean;
7
8
  }): CompileInfo[];
@@ -0,0 +1,17 @@
1
+ import { SyntaxNode } from '../types/nodes';
2
+ import { TextEdit } from '../../compiler/queries/transform/applyTextEdits';
3
+ /**
4
+ * Produces a TextEdit that adds a setting to a field/element declaration.
5
+ * If the declaration already has a settings block [...], inserts before the closing ].
6
+ * Otherwise, appends a new [setting] block.
7
+ */
8
+ export declare function addSettingEdit(declaration: SyntaxNode, setting: string): TextEdit | undefined;
9
+ /**
10
+ * Produces a TextEdit that updates an existing setting's value in a declaration.
11
+ */
12
+ export declare function updateSettingEdit(declaration: SyntaxNode, settingName: string, newValue: string, source: string): TextEdit | undefined;
13
+ /**
14
+ * Produces a TextEdit that removes a setting from a declaration.
15
+ * If it's the only setting, removes the entire settings block [...].
16
+ */
17
+ export declare function removeSettingEdit(declaration: SyntaxNode, settingName: string, source: string): TextEdit | undefined;
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": "9.0.0-optional-ref.6",
4
+ "version": "10.0.0-optional-ref.0",
5
5
  "description": "DBML parser v2",
6
6
  "author": "Holistics <dev@holistics.io>",
7
7
  "license": "Apache-2.0",
@@ -50,5 +50,5 @@
50
50
  "engines": {
51
51
  "node": ">=18"
52
52
  },
53
- "gitHead": "9d8aa4b58c6ceae262252ea590e05e3e966c10e6"
53
+ "gitHead": "b8daf0503d91ec322d427ab1f5e71a8a7f2ca12f"
54
54
  }
@@ -1,14 +0,0 @@
1
- import { SyntaxNode } from '../../../core/types/nodes';
2
- import { Filepath } from '../../../core/types/filepath';
3
- import { default as Compiler } from '../../index';
4
- import { TextEdit } from './applyTextEdits';
5
- /**
6
- * Produces a TextEdit that adds a setting to a field/element declaration.
7
- * If the declaration already has a settings block [...], inserts before the closing ].
8
- * Otherwise, appends a new [setting] block.
9
- */
10
- export declare function addSettingEdit(declaration: SyntaxNode, setting: string): TextEdit | undefined;
11
- /**
12
- * Adds a setting to a field/element declaration and returns the updated source.
13
- */
14
- export declare function addSetting(this: Compiler, filepath: Filepath, declaration: SyntaxNode, setting: string): string | undefined;
@@ -1,8 +0,0 @@
1
- import { SyntaxNode } from '../../../core/types/nodes';
2
- import { Filepath } from '../../../core/types/filepath';
3
- import { default as Compiler } from '../../index';
4
- import { TextEdit } from './applyTextEdits';
5
- export declare function updateSettingEdit(declaration: SyntaxNode, settingName: string, newValue: string, source: string): TextEdit | undefined;
6
- export declare function removeSettingEdit(declaration: SyntaxNode, settingName: string, source: string): TextEdit | undefined;
7
- export declare function updateSetting(this: Compiler, filepath: Filepath, declaration: SyntaxNode, settingName: string, newValue: string): string | undefined;
8
- export declare function removeSetting(this: Compiler, filepath: Filepath, declaration: SyntaxNode, settingName: string): string | undefined;