Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
c20885f
test: make the snapshot more robust
huydo862003 Apr 6, 2026
701c763
fix: type issues in tests
huydo862003 Apr 7, 2026
9eb87a7
test: remove parent from snapshot
huydo862003 Apr 7, 2026
7121f8c
test: move context to the top
huydo862003 Apr 7, 2026
0078110
test: strip unnecessary fields in snapshot
huydo862003 Apr 7, 2026
32d9afb
test: type error
huydo862003 Apr 7, 2026
784eb75
chore: split unit and coverage
huydo862003 Apr 7, 2026
7fe57bd
chore: rename misleading ci step
huydo862003 Apr 7, 2026
4b2791a
chore: temporarily remove coverage.yml
huydo862003 Apr 9, 2026
53edc3b
chore: add coverage as a separate job
huydo862003 Apr 9, 2026
6d0b5a0
chore: reformat test.yml to the original format
huydo862003 Apr 9, 2026
1837a8c
chore: mark coverage as continue-on-error
huydo862003 Apr 9, 2026
7908588
fix: rename coverage to comment-coverage
huydo862003 Apr 9, 2026
3db4fc3
fix: move continue-on-error to the job-level
huydo862003 Apr 9, 2026
01d4392
fix: reduce timeout for comment-coverage
huydo862003 Apr 9, 2026
ebb4f00
fix: improve snapshot format
huydo862003 Apr 9, 2026
9c95483
fix: make the snapshot more compact
huydo862003 Apr 9, 2026
d8f18b0
fix: make the snapshot more compact
huydo862003 Apr 9, 2026
31063f4
fix: make the snapshot more consistent
huydo862003 Apr 9, 2026
158bfea
refactor: reorganize types
huydo862003 Apr 10, 2026
7bb3bb9
refactor: reorganize types
huydo862003 Apr 10, 2026
9f6cff4
Merge master into test/make-snapshot-more-robust
huydo862003 Apr 10, 2026
50cdd1d
fix: reorganize types
huydo862003 Apr 10, 2026
80cd9fe
Merge branch 'master' into test/make-snapshot-more-robust
huydo862003 Apr 11, 2026
da865f4
fix: align snapshot serialization format with feat/module-system-3
huydo862003 Apr 11, 2026
c66f533
feat: add kind to NodeSymbol base class
huydo862003 Apr 11, 2026
58d27c9
test: remove nested_duplicate_names test
huydo862003 Apr 11, 2026
24ec187
refactor: add isKind() to ElementDeclarationNode and NodeSymbol, repl…
huydo862003 Apr 11, 2026
230aae2
feat: add lookupEnumValue utility for case-insensitive enum value lookup
huydo862003 Apr 11, 2026
4a07d96
refactor: split core/utils.ts into utils/chars, utils/span, utils/exp…
huydo862003 Apr 11, 2026
9751162
rename: lookupEnumValue -> convertStringToEnum
huydo862003 Apr 11, 2026
5a59cb0
perf: cache enum lookup map in convertStringToEnum to avoid repeated …
huydo862003 Apr 11, 2026
a36e07d
revert: simplify convertStringToEnum back to plain iteration
huydo862003 Apr 11, 2026
65c791c
refactor: use convertStringToEnum and isKind to replace toLowerCase c…
huydo862003 Apr 11, 2026
c67e50c
refactor: replace Option monad with plain T | undefined
huydo862003 Apr 11, 2026
e929c51
refactor: reorganize utils, extend isKind with rest params, remove is…
huydo862003 Apr 11, 2026
ccf5024
style: enforce multiline formatting for objects, arrays, imports, and…
huydo862003 Apr 11, 2026
b13e461
feat: convert @dbml/core and @dbml/cli trivial files to TypeScript, e…
huydo862003 Apr 11, 2026
449dc5d
feat: convert model_structure to TypeScript
huydo862003 Apr 11, 2026
23fc8e5
chore: regenerate gitnexus
huydo862003 Apr 11, 2026
719f861
fix: strip empty fields in object snapshots
huydo862003 Apr 12, 2026
d8196d3
fix: lint issues
huydo862003 Apr 12, 2026
cba970d
fix: default to a stable ordering when generate snapshots of unknown …
huydo862003 Apr 12, 2026
d30a00b
fix: include more names inside snapshot
huydo862003 Apr 12, 2026
88324ab
fix: wrong usage of isEmpty
huydo862003 Apr 12, 2026
c93d6d7
fix: unused imports
huydo862003 Apr 12, 2026
41f710e
feat: restructure binder snapshot to show program/publicSchema hierarchy
huydo862003 Apr 12, 2026
d9fc843
test: use source position order in snapshots for stability
huydo862003 Apr 12, 2026
c13896c
test: sort plain objects with token position by source offset
huydo862003 Apr 12, 2026
da4204a
fix: set object-curly-newline minProperties to 1 in dbml-playground e…
huydo862003 Apr 13, 2026
2b0e0f4
fix: lint issues
huydo862003 Apr 13, 2026
2900efc
fix: include schema name in alias duplicate error; drop node symbols …
huydo862003 Apr 13, 2026
b674cf3
test: suppress database in interpreter snapshots when errors present
huydo862003 Apr 13, 2026
56f22a0
fix: respect includeSymbols flag in testHelpers; regenerate validator…
huydo862003 Apr 13, 2026
d552714
fix: align duplicate error messages with schema label (tableGroup, ta…
huydo862003 Apr 13, 2026
3da0928
fix: set partialInjection symbol on FunctionApplicationNode; fix tabl…
huydo862003 Apr 13, 2026
70b0b23
fix: regenerate interpreter snapshots (schemaName empty string)
huydo862003 Apr 13, 2026
e7a170d
fix: add elementName to Alias value; regenerate interpreter snapshots
huydo862003 Apr 13, 2026
5ae90b3
fix: add name to SchemaSymbol; resolve unnamed schema in binder snaps…
huydo862003 Apr 13, 2026
16f9431
fix: lint config
huydo862003 Apr 13, 2026
4222c0c
fix: lint issues
huydo862003 Apr 13, 2026
09eece7
feat: add filepath to compile error and compile warning
huydo862003 Apr 13, 2026
c1bade1
feat: add more methods to report.ts
huydo862003 Apr 13, 2026
f3af867
fix: resolve pre-existing TS build errors in snapshot tests
huydo862003 Apr 13, 2026
1917b6d
feat: support window in filepath.ts
huydo862003 Apr 13, 2026
59e43a9
fix: improve types in @dbml/cli
huydo862003 Apr 13, 2026
a059d50
fix: consistent formatting
huydo862003 Apr 13, 2026
bb89fcd
test: replace module-system-3 simulation comment with FIXME
huydo862003 Apr 13, 2026
425106c
test: drop validator snapshot duplicates, relocate distinct ones to b…
huydo862003 Apr 13, 2026
1210e7b
chore(dbml-parse): ignore __tests__ in eslint and dts emit
huydo862003 Apr 13, 2026
117f1e1
test: relocate duplicate-only validator tests to binder, normalize du…
huydo862003 Apr 13, 2026
2a3b9e6
chore(dbml-parse): enforce import ordering via eslint-plugin-import
huydo862003 Apr 13, 2026
98c1932
chore: enforce import ordering via eslint-plugin-import on all packages
huydo862003 Apr 14, 2026
fe6fa28
chore: sync constants.ts and core/types/module.ts with feat branch
huydo862003 Apr 14, 2026
867abe8
chore: sync package.json files with feat branch
huydo862003 Apr 14, 2026
b1ece34
refactor: move legacy query files into queries/legacy/
huydo862003 Apr 14, 2026
c11076f
chore: sync testHelpers.ts and fix legacy query import paths
huydo862003 Apr 14, 2026
4a2758d
chore: regenerate yarn.lock
huydo862003 Apr 14, 2026
ac79b80
chore: regenerate yarn.lock
huydo862003 Apr 14, 2026
5fb8b60
fix: type definition
huydo862003 Apr 14, 2026
468e9c2
fix: remove as string
huydo862003 Apr 14, 2026
109c30c
v7.1.0-alpha.0
huydo862003 Apr 14, 2026
be478a9
Revert "v7.1.0-alpha.0"
huydo862003 Apr 14, 2026
3c13735
fix: revert turning @dbml/core model structure to ts
huydo862003 Apr 14, 2026
5e8bec6
fix: lint issues
huydo862003 Apr 14, 2026
645f36d
fix: lint issues
huydo862003 Apr 14, 2026
9ce6a81
fix: revert changes of @dbml/parse peerDep
huydo862003 Apr 14, 2026
c3ba691
chore: remove unneeded deps
huydo862003 Apr 14, 2026
fd2a0dd
fix: lint issues
huydo862003 Apr 14, 2026
8a329e8
fix: lint issues
huydo862003 Apr 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
31 changes: 25 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Run unit test and collect coverage
name: Run unit test & coverage
on:
push:
branches: [master]
paths-ignore:
- 'dbml-homepage/**'
- "dbml-homepage/**"
pull_request:
branches: [master]
types: [opened, synchronize]
paths-ignore:
- 'dbml-homepage/**'
- "dbml-homepage/**"
jobs:
build:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -92,19 +92,38 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
cache: "yarn"
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build packages
run: yarn build
- name: Run unit test and coverage
- name: Run coverage test
run: yarn coverage
- name: Generate coverage report
id: coverage
run: node .github/workflows/scripts/collect-coverage.js
- name: Upload coverage test
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-report.md
path: ./coverage-report.md
include-hidden-files: true

comment-coverage:
runs-on: ubuntu-22.04
timeout-minutes: 5
continue-on-error: true
needs: build
steps:
- name: Download test coverage
uses: actions/download-artifact@v4
with:
name: coverage-report.md
path: ./coverage-report.md
- name: Comment PR with coverage report
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: coverage-report.md
path: ./coverage-report.md
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- gitnexus:start -->
# GitNexus — Code Intelligence

This project is indexed by GitNexus as **dbml** (7344 symbols, 18714 relationships, 300 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
This project is indexed by GitNexus as **dbml** (7937 symbols, 20808 relationships, 300 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.

> If any GitNexus tool warns the index is stale, run `npx gitnexus analyze` in terminal first.

Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- gitnexus:start -->
# GitNexus — Code Intelligence

This project is indexed by GitNexus as **dbml** (7344 symbols, 18714 relationships, 300 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
This project is indexed by GitNexus as **dbml** (7937 symbols, 20808 relationships, 300 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.

> If any GitNexus tool warns the index is stale, run `npx gitnexus analyze` in terminal first.

Expand Down
8 changes: 6 additions & 2 deletions dbml-playground/env.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/// <reference types="vite/client" />

declare module '*.vue' {
import type { DefineComponent } from 'vue';
import type {
DefineComponent,
} from 'vue';
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
const component: DefineComponent<{}, {}, any>;
export default component;
Expand All @@ -12,7 +14,9 @@ declare module 'monaco-editor' {
}

declare module 'vue-json-viewer' {
import type { DefineComponent } from 'vue';
import type {
DefineComponent,
} from 'vue';
const component: DefineComponent<any, any, any>;
export default component;
}
Expand Down
8 changes: 8 additions & 0 deletions dbml-playground/eslint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ export default defineConfig(
rules: {
...js.configs.recommended.rules,
...tseslint.configs.recommended.rules,
'@stylistic/object-curly-newline': ['error', {
ObjectExpression: { multiline: true, minProperties: 1 },
ObjectPattern: { multiline: true, minProperties: 1 },
ImportDeclaration: { multiline: true, minProperties: 1 },
ExportDeclaration: { multiline: true, minProperties: 1 },
}],
'@stylistic/object-property-newline': ['error', { allowAllPropertiesOnSameLine: false }],

'@stylistic/space-before-function-paren': ['error', 'always'],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
Expand Down
73 changes: 58 additions & 15 deletions dbml-playground/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -267,24 +267,38 @@
* - Information Hiding: Business logic hidden in composables and services
* - Shallow Module: Simple interface that coordinates deeper modules
*/
import { ref, provide, watch, onMounted } from 'vue';
import { useParser } from '@/composables/useParser';
import { useUserData } from '@/composables/useUserData';
import {
ref, provide, watch, onMounted,
} from 'vue';
import {
useParser,
} from '@/composables/useParser';
import {
useUserData,
} from '@/composables/useUserData';
import MonacoEditor from '@/components/editors/MonacoEditor.vue';
import ParserOutputViewer from '@/components/outputs/ParserOutputViewer.vue';
import JsonOutputViewer from '@/components/outputs/JsonOutputViewer.vue';
import * as monaco from 'monaco-editor';
import { TokenMappingService } from '@/core/token-mapping';
import { TokenNavigationCoordinator } from '@/core/token-navigation';
import {
TokenMappingService,
} from '@/core/token-mapping';
import {
TokenNavigationCoordinator,
} from '@/core/token-navigation';
import packageJson from '../package.json';
import type { PipelineStage } from '@/types';
import type {
PipelineStage,
} from '@/types';
import consoleLogger from './utils/logger';

// Initialize parser with clean interface
const parser = useParser();

// Initialize user data management
const { userData, updateUserData, saveDbml } = useUserData();
const {
userData, updateUserData, saveDbml,
} = useUserData();

// Reactive state derived from user data
const vimModeEnabled = ref(userData.value.isVim);
Expand Down Expand Up @@ -371,7 +385,9 @@ onMounted(() => {
const initialViewMode = userData.value.isRawJson ? 'json' : 'cards';
newViewer.setViewMode?.(initialViewMode);
}
}, { immediate: true });
}, {
immediate: true,
});
});

/**
Expand All @@ -396,7 +412,9 @@ watch(() => parser.tokens.value, (newTokens) => {
if (newTokens && Array.isArray(newTokens)) {
tokenNavigationCoordinator.updateTokenMapping(newTokens);
}
}, { immediate: true });
}, {
immediate: true,
});

/**
* Provide services to child components
Expand All @@ -421,11 +439,31 @@ const isMainResizing = ref(false);
* Available pipeline stages for visualization
*/
const PIPELINE_STAGES = [
{ id: 'lexer' as const, name: 'Lexer', description: 'Tokenization stage' },
{ id: 'parser' as const, name: 'Parser', description: 'Syntax analysis stage' },
{ id: 'analyzer' as const, name: 'Analyzer', description: 'Semantic analysis stage' },
{ id: 'interpreter' as const, name: 'Interpreter', description: 'Code generation stage' },
{ id: 'errors' as const, name: 'Errors', description: 'Error reports' },
{
id: 'lexer' as const,
name: 'Lexer',
description: 'Tokenization stage',
},
{
id: 'parser' as const,
name: 'Parser',
description: 'Syntax analysis stage',
},
{
id: 'analyzer' as const,
name: 'Analyzer',
description: 'Semantic analysis stage',
},
{
id: 'interpreter' as const,
name: 'Interpreter',
description: 'Code generation stage',
},
{
id: 'errors' as const,
name: 'Errors',
description: 'Error reports',
},
] as const;

/**
Expand Down Expand Up @@ -491,7 +529,12 @@ const startMainResize = (event: MouseEvent) => {
* Handle navigate to source event from AST viewer
* Highlights the corresponding DBML source code
*/
const handleNavigateToSource = (position: { start: { line: number; column: number; offset: number }; end: { line: number; column: number; offset: number } }) => {
const handleNavigateToSource = (position: { start: { line: number;
column: number;
offset: number; };
end: { line: number;
column: number;
offset: number; }; }) => {
// Get reference to the DBML editor (MonacoEditor)
const dbmlEditor = document.querySelector('.dbml-editor');
if (dbmlEditor) {
Expand Down
34 changes: 26 additions & 8 deletions dbml-playground/src/components/editors/MonacoEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,13 @@
* - Information Hiding: Language setup complexity is hidden in services
* - Shallow Module: Simple interface that delegates to deep modules
*/
import { ref, onMounted, onBeforeUnmount, watch, nextTick } from 'vue';
import {
ref, onMounted, onBeforeUnmount, watch, nextTick,
} from 'vue';
import * as monaco from 'monaco-editor';
import { DBMLLanguageService } from '@/components/monaco/dbml-language';
import {
DBMLLanguageService,
} from '@/components/monaco/dbml-language';
import consoleLogger from '@/utils/logger';

interface Props {
Expand Down Expand Up @@ -72,7 +76,10 @@ let editor: monaco.editor.IStandaloneCodeEditor | null = null;
/**
* Reactive cursor position tracking
*/
const cursorPosition = ref({ line: 1, column: 1 });
const cursorPosition = ref({
line: 1,
column: 1,
});

/**
* Reactive selection info tracking
Expand Down Expand Up @@ -105,7 +112,9 @@ const createEditorConfig = (): monaco.editor.IStandaloneEditorConstructionOption
language: props.language,
theme: getThemeForLanguage(props.language),
readOnly: props.readOnly,
minimap: { enabled: props.minimap },
minimap: {
enabled: props.minimap,
},
wordWrap: props.wordWrap,
scrollBeyondLastLine: false,
fontSize: 14,
Expand All @@ -114,7 +123,10 @@ const createEditorConfig = (): monaco.editor.IStandaloneEditorConstructionOption
lineNumbersMinChars: 3,
lineDecorationsWidth: 10,
columnSelection: false,
padding: { top: 10, bottom: 10 },
padding: {
top: 10,
bottom: 10,
},
renderWhitespace: 'boundary',
renderControlCharacters: true,
smoothScrolling: true,
Expand All @@ -139,7 +151,9 @@ const createEditorConfig = (): monaco.editor.IStandaloneEditorConstructionOption
selectOnLineNumbers: false, // Disable line number selection for vim compatibility
cursorWidth: props.vimMode ? 2 : 1, // Slightly wider cursor for vim visibility
quickSuggestions: false, // Disable auto-suggestions for vim mode compatibility
parameterHints: { enabled: false }, // Disable parameter hints for cleaner vim experience
parameterHints: {
enabled: false,
}, // Disable parameter hints for cleaner vim experience
suggestOnTriggerCharacters: false, // Disable suggestion popup on typing
acceptSuggestionOnEnter: 'off', // Prevent Enter from accepting suggestions
tabCompletion: 'off', // Disable tab completion to avoid conflicts with vim
Expand All @@ -157,7 +171,9 @@ const setupVimMode = async (): Promise<void> => {

try {
// Dynamically import monaco-vim
const { initVimMode } = await import('monaco-vim' as any);
const {
initVimMode,
} = await import('monaco-vim' as any);

// Initialize vim mode with status tracking
vimMode = initVimMode(editor);
Expand Down Expand Up @@ -309,7 +325,9 @@ watch(() => props.modelValue, (newValue) => {

watch(() => props.readOnly, (newReadOnly) => {
if (editor) {
editor.updateOptions({ readOnly: newReadOnly });
editor.updateOptions({
readOnly: newReadOnly,
});
}
});

Expand Down
Loading
Loading