From c3f626720da82931ff286cb2b55b0c60f9742332 Mon Sep 17 00:00:00 2001 From: anpigon Date: Mon, 15 Aug 2022 13:23:19 +0900 Subject: [PATCH] refactor: move modal in folder --- src/main.ts | 4 ++-- src/{ => views}/book_search_modal.ts | 4 ++-- src/{ => views}/book_suggest_modal.ts | 2 +- tsconfig.json | 16 +++++----------- 4 files changed, 10 insertions(+), 16 deletions(-) rename src/{ => views}/book_search_modal.ts (95%) rename src/{ => views}/book_suggest_modal.ts (96%) diff --git a/src/main.ts b/src/main.ts index 8411542..75db2e1 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,7 +1,7 @@ import { MarkdownView, Notice, Plugin } from 'obsidian'; -import { BookSearchModal } from './book_search_modal'; -import { BookSuggestModal } from './book_suggest_modal'; +import { BookSearchModal } from '@views/book_search_modal'; +import { BookSuggestModal } from '@views/book_suggest_modal'; import { CursorJumper } from '@editor/cursor_jumper'; import { Book } from '@models/book.model'; import { BookSearchSettingTab, BookSearchPluginSettings, DEFAULT_SETTINGS } from '@settings/settings'; diff --git a/src/book_search_modal.ts b/src/views/book_search_modal.ts similarity index 95% rename from src/book_search_modal.ts rename to src/views/book_search_modal.ts index 727a192..e343732 100644 --- a/src/book_search_modal.ts +++ b/src/views/book_search_modal.ts @@ -1,6 +1,6 @@ import { App, ButtonComponent, Modal, Setting, TextComponent } from 'obsidian'; -import { getByQuery } from './apis/google_books_api'; -import { Book } from './models/book.model'; +import { getByQuery } from '@apis/google_books_api'; +import { Book } from '@models/book.model'; export class BookSearchModal extends Modal { query: string; diff --git a/src/book_suggest_modal.ts b/src/views/book_suggest_modal.ts similarity index 96% rename from src/book_suggest_modal.ts rename to src/views/book_suggest_modal.ts index 45133e5..6006c31 100644 --- a/src/book_suggest_modal.ts +++ b/src/views/book_suggest_modal.ts @@ -1,5 +1,5 @@ import { App, SuggestModal } from 'obsidian'; -import { Book } from './models/book.model'; +import { Book } from '@models/book.model'; export class BookSuggestModal extends SuggestModal { suggestion: Book[]; diff --git a/tsconfig.json b/tsconfig.json index d29af92..05b4ec5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,22 +10,16 @@ "moduleResolution": "node", "importHelpers": true, "isolatedModules": true, - "lib": [ - "DOM", - "ES5", - "ES6", - "ES7" - ], + "lib": ["DOM", "ES5", "ES6", "ES7"], "paths": { "@settings/*": ["src/settings/*"], "@models/*": ["src/models/*"], "@editor/*": ["src/editor/*"], "@utils/*": ["src/utils/*"], "@apis/*": ["src/apis/*"], - "@src/*": ["src/*"], - } + "@views/*": ["src/views/*"], + "@src/*": ["src/*"] + } }, - "include": [ - "**/*.ts" - ] + "include": ["**/*.ts"] }