From bc2fe19ca36bdb47f4aac5a7f80d666b35bb4f80 Mon Sep 17 00:00:00 2001 From: dineug Date: Sun, 3 Dec 2023 05:16:17 +0900 Subject: [PATCH] fix: refactoring folder --- erd-editor.code-workspace | 4 ++-- packages/erd-editor-schema/package.json | 10 +++++++- .../LICENSE | 0 .../package.json | 20 +++++++++++----- .../src/index.ts | 0 .../src/shiki.worker.ts | 0 .../src/vite-env.d.ts | 0 .../tsconfig.json | 0 .../vite.config.ts | 2 +- packages/erd-editor/package.json | 4 ++-- .../erd-editor/useErdEditorAttachElement.ts | 2 +- .../src/components/erd/canvas/table/Table.ts | 2 +- .../erd/canvas/table/column/Column.ts | 2 +- .../column/column-data-type/ColumnDataType.ts | 2 +- .../erd/erd-context-menu/ErdContextMenu.ts | 2 +- .../erd/erd-context-menu/menus/exportMenus.ts | 2 +- .../src/components/erd/useErdShortcut.ts | 2 +- .../src/components/schema-sql/SchemaSQL.ts | 2 +- packages/erd-editor/src/engine/actions.ts | 10 ++++---- .../erd-editor/src/engine/history.actions.ts | 2 +- .../modules/editor/generator.actions.ts | 4 ++-- .../atom.actions.ts | 0 .../generator.actions.ts | 0 .../{indexColumn => index-column}/history.ts | 0 .../src/engine/modules/relationship/hooks.ts | 2 +- .../{tableColumn => table-column}/actions.ts | 0 .../atom.actions.ts | 0 .../generator.actions.ts | 0 .../{tableColumn => table-column}/history.ts | 0 .../{tableColumn => table-column}/hooks.ts | 2 +- .../utils/dataType.ts | 2 +- .../engine/modules/table/generator.actions.ts | 2 +- packages/erd-editor/src/engine/store.hooks.ts | 2 +- packages/erd-editor/src/engine/store.ts | 2 +- packages/erd-editor/src/index.dev.ts | 2 +- .../src/utils/generator-code/index.ts | 0 .../utils/{schemaSQL => schema-sql}/MSSQL.ts | 0 .../{schemaSQL => schema-sql}/MariaDB.ts | 0 .../utils/{schemaSQL => schema-sql}/MySQL.ts | 0 .../utils/{schemaSQL => schema-sql}/Oracle.ts | 0 .../{schemaSQL => schema-sql}/PostgreSQL.ts | 0 .../utils/{schemaSQL => schema-sql}/SQLite.ts | 0 .../utils/{schemaSQL => schema-sql}/index.ts | 0 .../utils/{schemaSQL => schema-sql}/utils.ts | 0 pnpm-lock.yaml | 24 +++++++++---------- 45 files changed, 63 insertions(+), 47 deletions(-) rename packages/{shiki-worker => erd-editor-shiki-worker}/LICENSE (100%) rename packages/{shiki-worker => erd-editor-shiki-worker}/package.json (55%) rename packages/{shiki-worker => erd-editor-shiki-worker}/src/index.ts (100%) rename packages/{shiki-worker => erd-editor-shiki-worker}/src/shiki.worker.ts (100%) rename packages/{shiki-worker => erd-editor-shiki-worker}/src/vite-env.d.ts (100%) rename packages/{shiki-worker => erd-editor-shiki-worker}/tsconfig.json (100%) rename packages/{shiki-worker => erd-editor-shiki-worker}/vite.config.ts (96%) rename packages/erd-editor/src/engine/modules/{indexColumn => index-column}/atom.actions.ts (100%) rename packages/erd-editor/src/engine/modules/{indexColumn => index-column}/generator.actions.ts (100%) rename packages/erd-editor/src/engine/modules/{indexColumn => index-column}/history.ts (100%) rename packages/erd-editor/src/engine/modules/{tableColumn => table-column}/actions.ts (100%) rename packages/erd-editor/src/engine/modules/{tableColumn => table-column}/atom.actions.ts (100%) rename packages/erd-editor/src/engine/modules/{tableColumn => table-column}/generator.actions.ts (100%) rename packages/erd-editor/src/engine/modules/{tableColumn => table-column}/history.ts (100%) rename packages/erd-editor/src/engine/modules/{tableColumn => table-column}/hooks.ts (98%) rename packages/erd-editor/src/engine/modules/{tableColumn => table-column}/utils/dataType.ts (98%) create mode 100644 packages/erd-editor/src/utils/generator-code/index.ts rename packages/erd-editor/src/utils/{schemaSQL => schema-sql}/MSSQL.ts (100%) rename packages/erd-editor/src/utils/{schemaSQL => schema-sql}/MariaDB.ts (100%) rename packages/erd-editor/src/utils/{schemaSQL => schema-sql}/MySQL.ts (100%) rename packages/erd-editor/src/utils/{schemaSQL => schema-sql}/Oracle.ts (100%) rename packages/erd-editor/src/utils/{schemaSQL => schema-sql}/PostgreSQL.ts (100%) rename packages/erd-editor/src/utils/{schemaSQL => schema-sql}/SQLite.ts (100%) rename packages/erd-editor/src/utils/{schemaSQL => schema-sql}/index.ts (100%) rename packages/erd-editor/src/utils/{schemaSQL => schema-sql}/utils.ts (100%) diff --git a/erd-editor.code-workspace b/erd-editor.code-workspace index 74dba2b6..c047960e 100644 --- a/erd-editor.code-workspace +++ b/erd-editor.code-workspace @@ -9,8 +9,8 @@ "path": "packages/erd-editor-schema" }, { - "name": "shiki-worker", - "path": "packages/shiki-worker" + "name": "erd-editor-shiki-worker", + "path": "packages/erd-editor-shiki-worker" }, { "name": "shared", diff --git a/packages/erd-editor-schema/package.json b/packages/erd-editor-schema/package.json index 498e8784..2d1775e7 100644 --- a/packages/erd-editor-schema/package.json +++ b/packages/erd-editor-schema/package.json @@ -2,7 +2,7 @@ "name": "@dineug/erd-editor-schema", "version": "0.1.0", "private": true, - "description": "ERD editor schema", + "description": "Entity-Relationship Diagram Editor Schema", "type": "module", "main": "./dist/erd-editor-schema.umd.cjs", "module": "./dist/erd-editor-schema.js", @@ -20,6 +20,14 @@ "dist/*.js", "dist/**/*.ts" ], + "repository": { + "type": "git", + "url": "https://github.com/dineug/erd-editor.git" + }, + "bugs": { + "url": "https://github.com/dineug/erd-editor/issues" + }, + "homepage": "https://github.com/dineug/erd-editor#readme", "author": "SeungHwan-Lee ", "license": "MIT", "scripts": { diff --git a/packages/shiki-worker/LICENSE b/packages/erd-editor-shiki-worker/LICENSE similarity index 100% rename from packages/shiki-worker/LICENSE rename to packages/erd-editor-shiki-worker/LICENSE diff --git a/packages/shiki-worker/package.json b/packages/erd-editor-shiki-worker/package.json similarity index 55% rename from packages/shiki-worker/package.json rename to packages/erd-editor-shiki-worker/package.json index f8d90e80..341be485 100644 --- a/packages/shiki-worker/package.json +++ b/packages/erd-editor-shiki-worker/package.json @@ -1,25 +1,33 @@ { - "name": "@dineug/shiki-worker", + "name": "@dineug/erd-editor-shiki-worker", "version": "0.1.0", "private": true, - "description": "shiki-worker", + "description": "Entity-Relationship Diagram Editor shiki-worker", "type": "module", - "main": "./dist/shiki-worker.umd.cjs", - "module": "./dist/shiki-worker.js", + "main": "./dist/erd-editor-shiki-worker.umd.cjs", + "module": "./dist/erd-editor-shiki-worker.js", "types": "./dist/index.d.ts", "exports": { ".": { "import": { "types": "./dist/index.d.ts", - "default": "./dist/shiki-worker.js" + "default": "./dist/erd-editor-shiki-worker.js" }, - "require": "./dist/shiki-worker.umd.cjs" + "require": "./dist/erd-editor-shiki-worker.umd.cjs" } }, "files": [ "dist/*.js", "dist/**/*.ts" ], + "repository": { + "type": "git", + "url": "https://github.com/dineug/erd-editor.git" + }, + "bugs": { + "url": "https://github.com/dineug/erd-editor/issues" + }, + "homepage": "https://github.com/dineug/erd-editor#readme", "author": "SeungHwan-Lee ", "license": "MIT", "scripts": { diff --git a/packages/shiki-worker/src/index.ts b/packages/erd-editor-shiki-worker/src/index.ts similarity index 100% rename from packages/shiki-worker/src/index.ts rename to packages/erd-editor-shiki-worker/src/index.ts diff --git a/packages/shiki-worker/src/shiki.worker.ts b/packages/erd-editor-shiki-worker/src/shiki.worker.ts similarity index 100% rename from packages/shiki-worker/src/shiki.worker.ts rename to packages/erd-editor-shiki-worker/src/shiki.worker.ts diff --git a/packages/shiki-worker/src/vite-env.d.ts b/packages/erd-editor-shiki-worker/src/vite-env.d.ts similarity index 100% rename from packages/shiki-worker/src/vite-env.d.ts rename to packages/erd-editor-shiki-worker/src/vite-env.d.ts diff --git a/packages/shiki-worker/tsconfig.json b/packages/erd-editor-shiki-worker/tsconfig.json similarity index 100% rename from packages/shiki-worker/tsconfig.json rename to packages/erd-editor-shiki-worker/tsconfig.json diff --git a/packages/shiki-worker/vite.config.ts b/packages/erd-editor-shiki-worker/vite.config.ts similarity index 96% rename from packages/shiki-worker/vite.config.ts rename to packages/erd-editor-shiki-worker/vite.config.ts index cd106f56..762e6411 100644 --- a/packages/shiki-worker/vite.config.ts +++ b/packages/erd-editor-shiki-worker/vite.config.ts @@ -22,7 +22,7 @@ export default defineConfig({ lib: { entry: './src/index.ts', name: pkg.name, - fileName: 'shiki-worker', + fileName: 'erd-editor-shiki-worker', formats: ['es', 'umd'], }, rollupOptions: { diff --git a/packages/erd-editor/package.json b/packages/erd-editor/package.json index c6e7cd06..80d1ceb6 100644 --- a/packages/erd-editor/package.json +++ b/packages/erd-editor/package.json @@ -2,7 +2,7 @@ "name": "@dineug/erd-editor", "version": "3.0.0", "private": true, - "description": "ERD editor", + "description": "Entity-Relationship Diagram Editor", "type": "module", "main": "./dist/erd-editor.umd.cjs", "module": "./dist/erd-editor.js", @@ -46,10 +46,10 @@ }, "devDependencies": { "@dineug/erd-editor-schema": "workspace:*", + "@dineug/erd-editor-shiki-worker": "workspace:*", "@dineug/go": "^0.1.7", "@dineug/r-html": "workspace:*", "@dineug/shared": "workspace:*", - "@dineug/shiki-worker": "workspace:*", "@dineug/vite-plugin-r-html": "workspace:*", "@easylogic/colorpicker": "1.10.11", "@floating-ui/dom": "1.5.3", diff --git a/packages/erd-editor/src/components/erd-editor/useErdEditorAttachElement.ts b/packages/erd-editor/src/components/erd-editor/useErdEditorAttachElement.ts index 261a63de..180ac8d5 100644 --- a/packages/erd-editor/src/components/erd-editor/useErdEditorAttachElement.ts +++ b/packages/erd-editor/src/components/erd-editor/useErdEditorAttachElement.ts @@ -21,7 +21,7 @@ import { } from '@/themes/radix-ui-theme'; import { Theme, ThemeTokens } from '@/themes/tokens'; import { KeyBindingName, KeyBindingNameList } from '@/utils/keyboard-shortcut'; -import { createSchemaSQL } from '@/utils/schemaSQL'; +import { createSchemaSQL } from '@/utils/schema-sql'; import { hasDatabaseVendor, toSafeString } from '@/utils/validation'; import { ErdEditorElement, ErdEditorProps } from './ErdEditor'; diff --git a/packages/erd-editor/src/components/erd/canvas/table/Table.ts b/packages/erd-editor/src/components/erd/canvas/table/Table.ts index 0f6f2d14..286066cc 100644 --- a/packages/erd-editor/src/components/erd/canvas/table/Table.ts +++ b/packages/erd-editor/src/components/erd/canvas/table/Table.ts @@ -16,7 +16,7 @@ import { changeTableNameAction, } from '@/engine/modules/table/atom.actions'; import { removeTableAction$ } from '@/engine/modules/table/generator.actions'; -import { addColumnAction$ } from '@/engine/modules/tableColumn/generator.actions'; +import { addColumnAction$ } from '@/engine/modules/table-column/generator.actions'; import { Table } from '@/internal-types'; import { bHas } from '@/utils/bit'; import { calcTableHeight, calcTableWidths } from '@/utils/calcTable'; diff --git a/packages/erd-editor/src/components/erd/canvas/table/column/Column.ts b/packages/erd-editor/src/components/erd/canvas/table/column/Column.ts index cce8c2c0..498b2573 100644 --- a/packages/erd-editor/src/components/erd/canvas/table/column/Column.ts +++ b/packages/erd-editor/src/components/erd/canvas/table/column/Column.ts @@ -27,7 +27,7 @@ import { isToggleColumnTypes, removeColumnAction$, toggleColumnValueAction$, -} from '@/engine/modules/tableColumn/generator.actions'; +} from '@/engine/modules/table-column/generator.actions'; import { Column } from '@/internal-types'; import { bHas } from '@/utils/bit'; import { isMod, simpleShortcutToString } from '@/utils/keyboard-shortcut'; diff --git a/packages/erd-editor/src/components/erd/canvas/table/column/column-data-type/ColumnDataType.ts b/packages/erd-editor/src/components/erd/canvas/table/column/column-data-type/ColumnDataType.ts index 783b869c..ceceee2e 100644 --- a/packages/erd-editor/src/components/erd/canvas/table/column/column-data-type/ColumnDataType.ts +++ b/packages/erd-editor/src/components/erd/canvas/table/column/column-data-type/ColumnDataType.ts @@ -16,7 +16,7 @@ import EditInput from '@/components/primitives/edit-input/EditInput'; import HighlightedText from '@/components/primitives/highlighted-text/HighlightedText'; import Kbd from '@/components/primitives/kbd/Kbd'; import { DatabaseHintMap, DataTypeHint } from '@/constants/sql/dataType'; -import { changeColumnDataTypeAction$ } from '@/engine/modules/tableColumn/generator.actions'; +import { changeColumnDataTypeAction$ } from '@/engine/modules/table-column/generator.actions'; import { useUnmounted } from '@/hooks/useUnmounted'; import { lastCursorFocus } from '@/utils/focus'; diff --git a/packages/erd-editor/src/components/erd/erd-context-menu/ErdContextMenu.ts b/packages/erd-editor/src/components/erd/erd-context-menu/ErdContextMenu.ts index c0ebb476..f8ba4a73 100644 --- a/packages/erd-editor/src/components/erd/erd-context-menu/ErdContextMenu.ts +++ b/packages/erd-editor/src/components/erd/erd-context-menu/ErdContextMenu.ts @@ -8,7 +8,7 @@ import { startAutomaticTablePlacementAction } from '@/engine/modules/editor/atom import { addMemoAction$ } from '@/engine/modules/memo/generator.actions'; import { removeRelationshipAction } from '@/engine/modules/relationship/atom.actions'; import { addTableAction$ } from '@/engine/modules/table/generator.actions'; -import { changeColumnPrimaryKeyAction$ } from '@/engine/modules/tableColumn/generator.actions'; +import { changeColumnPrimaryKeyAction$ } from '@/engine/modules/table-column/generator.actions'; import { ValuesType } from '@/internal-types'; import { query } from '@/utils/collection/query'; import { openColorPickerAction } from '@/utils/emitter'; diff --git a/packages/erd-editor/src/components/erd/erd-context-menu/menus/exportMenus.ts b/packages/erd-editor/src/components/erd/erd-context-menu/menus/exportMenus.ts index dfcb5763..15285faa 100644 --- a/packages/erd-editor/src/components/erd/erd-context-menu/menus/exportMenus.ts +++ b/packages/erd-editor/src/components/erd/erd-context-menu/menus/exportMenus.ts @@ -8,7 +8,7 @@ import { exportPNG, exportSchemaSQL, } from '@/utils/file/exportFile'; -import { createSchemaSQL } from '@/utils/schemaSQL'; +import { createSchemaSQL } from '@/utils/schema-sql'; export function createExportMenus( app: AppContext, diff --git a/packages/erd-editor/src/components/erd/useErdShortcut.ts b/packages/erd-editor/src/components/erd/useErdShortcut.ts index f167ee2a..86a8be2c 100644 --- a/packages/erd-editor/src/components/erd/useErdShortcut.ts +++ b/packages/erd-editor/src/components/erd/useErdShortcut.ts @@ -27,7 +27,7 @@ import { isToggleColumnTypes, removeColumnAction$, toggleColumnValueAction$, -} from '@/engine/modules/tableColumn/generator.actions'; +} from '@/engine/modules/table-column/generator.actions'; import { useUnmounted } from '@/hooks/useUnmounted'; import { Ctx } from '@/internal-types'; import { focusEvent, forceFocusEvent } from '@/utils/internalEvents'; diff --git a/packages/erd-editor/src/components/schema-sql/SchemaSQL.ts b/packages/erd-editor/src/components/schema-sql/SchemaSQL.ts index 197d6cd3..9de77d84 100644 --- a/packages/erd-editor/src/components/schema-sql/SchemaSQL.ts +++ b/packages/erd-editor/src/components/schema-sql/SchemaSQL.ts @@ -9,7 +9,7 @@ import SchemaSQLContextMenu from '@/components/schema-sql/schema-sql-context-men import { useUnmounted } from '@/hooks/useUnmounted'; import { copyToClipboard } from '@/utils/clipboard'; import { openToastAction } from '@/utils/emitter'; -import { createSchemaSQL } from '@/utils/schemaSQL'; +import { createSchemaSQL } from '@/utils/schema-sql'; import * as styles from './SchemaSQL.styles'; diff --git a/packages/erd-editor/src/engine/actions.ts b/packages/erd-editor/src/engine/actions.ts index 15804e21..55526661 100644 --- a/packages/erd-editor/src/engine/actions.ts +++ b/packages/erd-editor/src/engine/actions.ts @@ -7,8 +7,8 @@ import { actions as editorActions } from '@/engine/modules/editor/atom.actions'; import { actions$ as editorActions$ } from '@/engine/modules/editor/generator.actions'; import { actions as indexActions } from '@/engine/modules/index/atom.actions'; import { actions$ as indexActions$ } from '@/engine/modules/index/generator.actions'; -import { actions as indexColumnActions } from '@/engine/modules/indexColumn/atom.actions'; -import { actions$ as indexColumnActions$ } from '@/engine/modules/indexColumn/generator.actions'; +import { actions as indexColumnActions } from '@/engine/modules/index-column/atom.actions'; +import { actions$ as indexColumnActions$ } from '@/engine/modules/index-column/generator.actions'; import { ActionMap as MemoActionMap } from '@/engine/modules/memo/actions'; import { actions as memoActions } from '@/engine/modules/memo/atom.actions'; import { actions$ as memoActions$ } from '@/engine/modules/memo/generator.actions'; @@ -21,9 +21,9 @@ import { actions$ as settingsActions$ } from '@/engine/modules/settings/generato import { ActionMap as TableActionMap } from '@/engine/modules/table/actions'; import { actions as tableActions } from '@/engine/modules/table/atom.actions'; import { actions$ as tableActions$ } from '@/engine/modules/table/generator.actions'; -import { ActionMap as TableColumnActionMap } from '@/engine/modules/tableColumn/actions'; -import { actions as tableColumnActions } from '@/engine/modules/tableColumn/atom.actions'; -import { actions$ as tableColumnActions$ } from '@/engine/modules/tableColumn/generator.actions'; +import { ActionMap as TableColumnActionMap } from '@/engine/modules/table-column/actions'; +import { actions as tableColumnActions } from '@/engine/modules/table-column/atom.actions'; +import { actions$ as tableColumnActions$ } from '@/engine/modules/table-column/generator.actions'; export type Actions = typeof editorActions & typeof editorActions$ & diff --git a/packages/erd-editor/src/engine/history.actions.ts b/packages/erd-editor/src/engine/history.actions.ts index 606d35db..ecfdd8cf 100644 --- a/packages/erd-editor/src/engine/history.actions.ts +++ b/packages/erd-editor/src/engine/history.actions.ts @@ -17,7 +17,7 @@ import { tablePushStreamHistoryMap, tablePushUndoHistoryMap, } from '@/engine/modules/table/history'; -import { tableColumnPushUndoHistoryMap } from '@/engine/modules/tableColumn/history'; +import { tableColumnPushUndoHistoryMap } from '@/engine/modules/table-column/history'; import { RootState } from '@/engine/state'; import { Store } from '@/engine/store'; diff --git a/packages/erd-editor/src/engine/modules/editor/generator.actions.ts b/packages/erd-editor/src/engine/modules/editor/generator.actions.ts index 10fa3bce..f919374f 100644 --- a/packages/erd-editor/src/engine/modules/editor/generator.actions.ts +++ b/packages/erd-editor/src/engine/modules/editor/generator.actions.ts @@ -16,8 +16,8 @@ import { removeTableAction$ } from '@/engine/modules/table/generator.actions'; import { addColumnAction, changeColumnPrimaryKeyAction, -} from '@/engine/modules/tableColumn/atom.actions'; -import { addColumnAction$ } from '@/engine/modules/tableColumn/generator.actions'; +} from '@/engine/modules/table-column/atom.actions'; +import { addColumnAction$ } from '@/engine/modules/table-column/generator.actions'; import { Point } from '@/internal-types'; import { bHas } from '@/utils/bit'; import { calcMemoHeight, calcMemoWidth } from '@/utils/calcMemo'; diff --git a/packages/erd-editor/src/engine/modules/indexColumn/atom.actions.ts b/packages/erd-editor/src/engine/modules/index-column/atom.actions.ts similarity index 100% rename from packages/erd-editor/src/engine/modules/indexColumn/atom.actions.ts rename to packages/erd-editor/src/engine/modules/index-column/atom.actions.ts diff --git a/packages/erd-editor/src/engine/modules/indexColumn/generator.actions.ts b/packages/erd-editor/src/engine/modules/index-column/generator.actions.ts similarity index 100% rename from packages/erd-editor/src/engine/modules/indexColumn/generator.actions.ts rename to packages/erd-editor/src/engine/modules/index-column/generator.actions.ts diff --git a/packages/erd-editor/src/engine/modules/indexColumn/history.ts b/packages/erd-editor/src/engine/modules/index-column/history.ts similarity index 100% rename from packages/erd-editor/src/engine/modules/indexColumn/history.ts rename to packages/erd-editor/src/engine/modules/index-column/history.ts diff --git a/packages/erd-editor/src/engine/modules/relationship/hooks.ts b/packages/erd-editor/src/engine/modules/relationship/hooks.ts index 7573afc9..023841dc 100644 --- a/packages/erd-editor/src/engine/modules/relationship/hooks.ts +++ b/packages/erd-editor/src/engine/modules/relationship/hooks.ts @@ -21,7 +21,7 @@ import { changeColumnNotNullAction, changeColumnPrimaryKeyAction, removeColumnAction, -} from '@/engine/modules/tableColumn/atom.actions'; +} from '@/engine/modules/table-column/atom.actions'; import { bHas } from '@/utils/bit'; import { query } from '@/utils/collection/query'; import { relationshipSort } from '@/utils/draw-relationship/sort'; diff --git a/packages/erd-editor/src/engine/modules/tableColumn/actions.ts b/packages/erd-editor/src/engine/modules/table-column/actions.ts similarity index 100% rename from packages/erd-editor/src/engine/modules/tableColumn/actions.ts rename to packages/erd-editor/src/engine/modules/table-column/actions.ts diff --git a/packages/erd-editor/src/engine/modules/tableColumn/atom.actions.ts b/packages/erd-editor/src/engine/modules/table-column/atom.actions.ts similarity index 100% rename from packages/erd-editor/src/engine/modules/tableColumn/atom.actions.ts rename to packages/erd-editor/src/engine/modules/table-column/atom.actions.ts diff --git a/packages/erd-editor/src/engine/modules/tableColumn/generator.actions.ts b/packages/erd-editor/src/engine/modules/table-column/generator.actions.ts similarity index 100% rename from packages/erd-editor/src/engine/modules/tableColumn/generator.actions.ts rename to packages/erd-editor/src/engine/modules/table-column/generator.actions.ts diff --git a/packages/erd-editor/src/engine/modules/tableColumn/history.ts b/packages/erd-editor/src/engine/modules/table-column/history.ts similarity index 100% rename from packages/erd-editor/src/engine/modules/tableColumn/history.ts rename to packages/erd-editor/src/engine/modules/table-column/history.ts diff --git a/packages/erd-editor/src/engine/modules/tableColumn/hooks.ts b/packages/erd-editor/src/engine/modules/table-column/hooks.ts similarity index 98% rename from packages/erd-editor/src/engine/modules/tableColumn/hooks.ts rename to packages/erd-editor/src/engine/modules/table-column/hooks.ts index c0cbc876..9c8bc9f8 100644 --- a/packages/erd-editor/src/engine/modules/tableColumn/hooks.ts +++ b/packages/erd-editor/src/engine/modules/table-column/hooks.ts @@ -6,7 +6,7 @@ import { addRelationshipAction, removeRelationshipAction, } from '@/engine/modules/relationship/atom.actions'; -import { changeColumnPrimaryKeyAction } from '@/engine/modules/tableColumn/atom.actions'; +import { changeColumnPrimaryKeyAction } from '@/engine/modules/table-column/atom.actions'; import { bHas } from '@/utils/bit'; import { query } from '@/utils/collection/query'; diff --git a/packages/erd-editor/src/engine/modules/tableColumn/utils/dataType.ts b/packages/erd-editor/src/engine/modules/table-column/utils/dataType.ts similarity index 98% rename from packages/erd-editor/src/engine/modules/tableColumn/utils/dataType.ts rename to packages/erd-editor/src/engine/modules/table-column/utils/dataType.ts index 58524b40..c61ffe68 100644 --- a/packages/erd-editor/src/engine/modules/tableColumn/utils/dataType.ts +++ b/packages/erd-editor/src/engine/modules/table-column/utils/dataType.ts @@ -1,4 +1,4 @@ -import { ChangeColumnValuePayload } from '@/engine/modules/tableColumn/actions'; +import { ChangeColumnValuePayload } from '@/engine/modules/table-column/actions'; import { RootState } from '@/engine/state'; import { query } from '@/utils/collection/query'; diff --git a/packages/erd-editor/src/engine/modules/table/generator.actions.ts b/packages/erd-editor/src/engine/modules/table/generator.actions.ts index c21968a8..c94b5f91 100644 --- a/packages/erd-editor/src/engine/modules/table/generator.actions.ts +++ b/packages/erd-editor/src/engine/modules/table/generator.actions.ts @@ -22,7 +22,7 @@ import { changeColumnDefaultAction, changeColumnNameAction, changeColumnNotNullAction, -} from '@/engine/modules/tableColumn/atom.actions'; +} from '@/engine/modules/table-column/atom.actions'; import { nextPoint, nextZIndex } from '@/utils'; import { bHas } from '@/utils/bit'; import { query } from '@/utils/collection/query'; diff --git a/packages/erd-editor/src/engine/store.hooks.ts b/packages/erd-editor/src/engine/store.hooks.ts index 96a646ad..3caec89a 100644 --- a/packages/erd-editor/src/engine/store.hooks.ts +++ b/packages/erd-editor/src/engine/store.hooks.ts @@ -4,7 +4,7 @@ import { arrayHas } from '@dineug/shared'; import { hooks as relationshipHooks } from '@/engine/modules/relationship/hooks'; import { hooks as tableHooks } from '@/engine/modules/table/hooks'; -import { hooks as tableColumnHooks } from '@/engine/modules/tableColumn/hooks'; +import { hooks as tableColumnHooks } from '@/engine/modules/table-column/hooks'; import type { Store } from '@/engine/store'; type Task = { diff --git a/packages/erd-editor/src/engine/store.ts b/packages/erd-editor/src/engine/store.ts index 9c328d38..75f9bacd 100644 --- a/packages/erd-editor/src/engine/store.ts +++ b/packages/erd-editor/src/engine/store.ts @@ -9,7 +9,7 @@ import { memoReducers } from '@/engine/modules/memo/atom.actions'; import { relationshipReducers } from '@/engine/modules/relationship/atom.actions'; import { settingsReducers } from '@/engine/modules/settings/atom.actions'; import { tableReducers } from '@/engine/modules/table/atom.actions'; -import { tableColumnReducers } from '@/engine/modules/tableColumn/atom.actions'; +import { tableColumnReducers } from '@/engine/modules/table-column/atom.actions'; import { RootState } from '@/engine/state'; export type Store = StoreType; diff --git a/packages/erd-editor/src/index.dev.ts b/packages/erd-editor/src/index.dev.ts index f7b165aa..aed1a362 100644 --- a/packages/erd-editor/src/index.dev.ts +++ b/packages/erd-editor/src/index.dev.ts @@ -1,5 +1,5 @@ +import { ShikiService } from '@dineug/erd-editor-shiki-worker'; import { cssUnwrap, hmr } from '@dineug/r-html'; -import { ShikiService } from '@dineug/shiki-worker'; // @ts-ignore import Stats from 'stats.js'; diff --git a/packages/erd-editor/src/utils/generator-code/index.ts b/packages/erd-editor/src/utils/generator-code/index.ts new file mode 100644 index 00000000..e69de29b diff --git a/packages/erd-editor/src/utils/schemaSQL/MSSQL.ts b/packages/erd-editor/src/utils/schema-sql/MSSQL.ts similarity index 100% rename from packages/erd-editor/src/utils/schemaSQL/MSSQL.ts rename to packages/erd-editor/src/utils/schema-sql/MSSQL.ts diff --git a/packages/erd-editor/src/utils/schemaSQL/MariaDB.ts b/packages/erd-editor/src/utils/schema-sql/MariaDB.ts similarity index 100% rename from packages/erd-editor/src/utils/schemaSQL/MariaDB.ts rename to packages/erd-editor/src/utils/schema-sql/MariaDB.ts diff --git a/packages/erd-editor/src/utils/schemaSQL/MySQL.ts b/packages/erd-editor/src/utils/schema-sql/MySQL.ts similarity index 100% rename from packages/erd-editor/src/utils/schemaSQL/MySQL.ts rename to packages/erd-editor/src/utils/schema-sql/MySQL.ts diff --git a/packages/erd-editor/src/utils/schemaSQL/Oracle.ts b/packages/erd-editor/src/utils/schema-sql/Oracle.ts similarity index 100% rename from packages/erd-editor/src/utils/schemaSQL/Oracle.ts rename to packages/erd-editor/src/utils/schema-sql/Oracle.ts diff --git a/packages/erd-editor/src/utils/schemaSQL/PostgreSQL.ts b/packages/erd-editor/src/utils/schema-sql/PostgreSQL.ts similarity index 100% rename from packages/erd-editor/src/utils/schemaSQL/PostgreSQL.ts rename to packages/erd-editor/src/utils/schema-sql/PostgreSQL.ts diff --git a/packages/erd-editor/src/utils/schemaSQL/SQLite.ts b/packages/erd-editor/src/utils/schema-sql/SQLite.ts similarity index 100% rename from packages/erd-editor/src/utils/schemaSQL/SQLite.ts rename to packages/erd-editor/src/utils/schema-sql/SQLite.ts diff --git a/packages/erd-editor/src/utils/schemaSQL/index.ts b/packages/erd-editor/src/utils/schema-sql/index.ts similarity index 100% rename from packages/erd-editor/src/utils/schemaSQL/index.ts rename to packages/erd-editor/src/utils/schema-sql/index.ts diff --git a/packages/erd-editor/src/utils/schemaSQL/utils.ts b/packages/erd-editor/src/utils/schema-sql/utils.ts similarity index 100% rename from packages/erd-editor/src/utils/schemaSQL/utils.ts rename to packages/erd-editor/src/utils/schema-sql/utils.ts diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d3a6caec..80086a55 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -59,6 +59,9 @@ importers: '@dineug/erd-editor-schema': specifier: workspace:* version: link:../erd-editor-schema + '@dineug/erd-editor-shiki-worker': + specifier: workspace:* + version: link:../erd-editor-shiki-worker '@dineug/go': specifier: ^0.1.7 version: 0.1.7 @@ -68,9 +71,6 @@ importers: '@dineug/shared': specifier: workspace:* version: link:../shared - '@dineug/shiki-worker': - specifier: workspace:* - version: link:../shiki-worker '@dineug/vite-plugin-r-html': specifier: workspace:* version: link:../vite-plugin-r-html @@ -237,14 +237,20 @@ importers: specifier: ^4.2.0 version: 4.2.0(typescript@5.1.6)(vite@4.4.9) - packages/r-html: + packages/erd-editor-shiki-worker: devDependencies: '@rollup/plugin-typescript': specifier: ^11.1.2 version: 11.1.2(tslib@2.6.1)(typescript@5.1.6) + comlink: + specifier: 4.4.1 + version: 4.4.1 rollup-plugin-visualizer: specifier: ^5.9.2 version: 5.9.2 + shiki: + specifier: 0.14.5 + version: 0.14.5 ts-patch: specifier: ^3.0.2 version: 3.0.2 @@ -264,7 +270,7 @@ importers: specifier: ^4.2.0 version: 4.2.0(typescript@5.1.6)(vite@4.4.9) - packages/shared: + packages/r-html: devDependencies: '@rollup/plugin-typescript': specifier: ^11.1.2 @@ -291,20 +297,14 @@ importers: specifier: ^4.2.0 version: 4.2.0(typescript@5.1.6)(vite@4.4.9) - packages/shiki-worker: + packages/shared: devDependencies: '@rollup/plugin-typescript': specifier: ^11.1.2 version: 11.1.2(tslib@2.6.1)(typescript@5.1.6) - comlink: - specifier: 4.4.1 - version: 4.4.1 rollup-plugin-visualizer: specifier: ^5.9.2 version: 5.9.2 - shiki: - specifier: 0.14.5 - version: 0.14.5 ts-patch: specifier: ^3.0.2 version: 3.0.2