diff --git a/apps/playground/src/pages/index.astro b/apps/playground/src/pages/index.astro index b9f680c..abd5bcd 100644 --- a/apps/playground/src/pages/index.astro +++ b/apps/playground/src/pages/index.astro @@ -14,13 +14,12 @@ import "../assets/global.css"; -
+
diff --git a/apps/playground/tsconfig.json b/apps/playground/tsconfig.json index 8c6147d..3e78bc8 100644 --- a/apps/playground/tsconfig.json +++ b/apps/playground/tsconfig.json @@ -2,8 +2,7 @@ "extends": "astro/tsconfigs/strict", "compilerOptions": { "paths": { - "@inkwell/core": ["../../packages/core/src/index.ts"], - "@inkwell/core/*": ["../../packages/core/src/*"] + "@inkwell/*": ["../../packages/*/src"] } }, "include": [".astro/types.d.ts", "**/*"], diff --git a/packages/core/src/CommandChain.ts b/packages/core/src/CommandChain.ts index b7b276f..8f3fe41 100644 --- a/packages/core/src/CommandChain.ts +++ b/packages/core/src/CommandChain.ts @@ -1,6 +1,6 @@ import type { EditorState, TransactionSpec } from "@codemirror/state"; -import type { ChainedCommands, Command, CommandContext } from "~/types/commands.ts"; -import type { Editor } from "~/Editor.ts"; +import type { ChainedCommands, Command, CommandContext } from "./types/commands.ts"; +import type { Editor } from "./Editor.ts"; /** One collected chain step: a command impl and the args to call it with. */ type CommandStep = { diff --git a/packages/core/src/Editor.spec.ts b/packages/core/src/Editor.spec.ts index 6155614..96db589 100644 --- a/packages/core/src/Editor.spec.ts +++ b/packages/core/src/Editor.spec.ts @@ -1,5 +1,5 @@ import { afterEach, beforeEach, describe, expect, it } from "vite-plus/test"; -import { Editor } from "~/Editor.ts"; +import { Editor } from "./Editor.ts"; import { EditorState } from "@codemirror/state"; import { EditorView } from "@codemirror/view"; diff --git a/packages/core/src/Editor.ts b/packages/core/src/Editor.ts index 89b6aed..c0faf5e 100644 --- a/packages/core/src/Editor.ts +++ b/packages/core/src/Editor.ts @@ -1,11 +1,11 @@ import { EditorState, Text } from "@codemirror/state"; import { EditorView } from "@codemirror/view"; import { EventEmitter } from "./EventEmitter.ts"; -import type { EditorEvents, EditorOptions } from "~/types/editor.ts"; +import type { EditorEvents, EditorOptions } from "./types/editor.ts"; import { ExtensionManager } from "./ExtensionManager.ts"; -import type { ChainedCommands, SingleCommands } from "~/types/commands.ts"; +import type { ChainedCommands, SingleCommands } from "./types/commands.ts"; import { CommandChain } from "./CommandChain.ts"; -import { CommandsExtension } from "~/extensions/commands.ts"; +import { CommandsExtension } from "./extensions/commands.ts"; export class Editor extends EventEmitter { private _te: TextEncoder = new TextEncoder(); diff --git a/packages/core/src/EventEmitter.spec.ts b/packages/core/src/EventEmitter.spec.ts index 94f41fd..77e5aaf 100644 --- a/packages/core/src/EventEmitter.spec.ts +++ b/packages/core/src/EventEmitter.spec.ts @@ -1,5 +1,5 @@ import { describe, it, vi, expect } from "vite-plus/test"; -import { EventEmitter } from "~/EventEmitter.ts"; +import { EventEmitter } from "./EventEmitter.ts"; describe("EventEmitter", () => { it("creates listeners and triggers callbacks", () => { diff --git a/packages/core/src/ExtensionManager.spec.ts b/packages/core/src/ExtensionManager.spec.ts index 4dfe8ed..63ce813 100644 --- a/packages/core/src/ExtensionManager.spec.ts +++ b/packages/core/src/ExtensionManager.spec.ts @@ -2,8 +2,8 @@ import { EditorState, StateField } from "@codemirror/state"; import { keymap } from "@codemirror/view"; import { describe, expect, it } from "vite-plus/test"; import { ExtensionManager } from "./ExtensionManager.ts"; -import type { InkwellExtension } from "~/types/extensions.ts"; -import type { Editor } from "~/Editor.ts"; +import type { InkwellExtension } from "./types/extensions.ts"; +import type { Editor } from "./Editor.ts"; describe("ExtensionManager", () => { const editor = {} as Editor; diff --git a/packages/core/src/ExtensionManager.ts b/packages/core/src/ExtensionManager.ts index 4fdc5c7..82af491 100644 --- a/packages/core/src/ExtensionManager.ts +++ b/packages/core/src/ExtensionManager.ts @@ -1,9 +1,9 @@ import type { Extension as CMExtension } from "@codemirror/state"; import { type KeyBinding, keymap } from "@codemirror/view"; -import type { Editor } from "~/Editor.ts"; -import type { InkwellExtension } from "~/types/extensions.ts"; -import type { CommandRegistry } from "~/CommandChain.ts"; -import { resolveExtensionsOnEditor } from "~/helpers/resolveExtensionsOnEditor.ts"; +import type { Editor } from "./Editor.ts"; +import type { InkwellExtension } from "./types/extensions.ts"; +import type { CommandRegistry } from "./CommandChain.ts"; +import { resolveExtensionsOnEditor } from "./helpers/resolveExtensionsOnEditor.ts"; /** * Manages and resolves extensions so the editor receives one complete CodeMirror setup. diff --git a/packages/core/src/commands/clearContent.ts b/packages/core/src/commands/clearContent.ts index f7d89da..03fdb6f 100644 --- a/packages/core/src/commands/clearContent.ts +++ b/packages/core/src/commands/clearContent.ts @@ -1,4 +1,4 @@ -import type { NamedCommand } from "~/types/commands.ts"; +import type { NamedCommand } from "../types/commands.ts"; import { deleteContent } from "./deleteContent.ts"; declare module "@inkwell/core" { diff --git a/packages/core/src/commands/cutContent.ts b/packages/core/src/commands/cutContent.ts index 44cc9eb..53b6c35 100644 --- a/packages/core/src/commands/cutContent.ts +++ b/packages/core/src/commands/cutContent.ts @@ -1,4 +1,4 @@ -import type { NamedCommand } from "~/types/commands.ts"; +import type { NamedCommand } from "../types/commands.ts"; declare module "@inkwell/core" { interface Commands { diff --git a/packages/core/src/commands/deleteContent.ts b/packages/core/src/commands/deleteContent.ts index 368b7cd..86a3f43 100644 --- a/packages/core/src/commands/deleteContent.ts +++ b/packages/core/src/commands/deleteContent.ts @@ -1,4 +1,4 @@ -import type { NamedCommand } from "~/types/commands.ts"; +import type { NamedCommand } from "../types/commands.ts"; declare module "@inkwell/core" { interface Commands { diff --git a/packages/core/src/commands/insertContent.ts b/packages/core/src/commands/insertContent.ts index 9bb5a6d..36bca01 100644 --- a/packages/core/src/commands/insertContent.ts +++ b/packages/core/src/commands/insertContent.ts @@ -1,4 +1,4 @@ -import type { NamedCommand } from "~/types/commands.ts"; +import type { NamedCommand } from "../types/commands.ts"; declare module "@inkwell/core" { interface Commands { diff --git a/packages/core/src/commands/setContent.ts b/packages/core/src/commands/setContent.ts index f9c5af3..5323cc6 100644 --- a/packages/core/src/commands/setContent.ts +++ b/packages/core/src/commands/setContent.ts @@ -1,4 +1,4 @@ -import type { NamedCommand } from "~/types/commands.ts"; +import type { NamedCommand } from "../types/commands.ts"; import { insertContent } from "./insertContent.ts"; declare module "@inkwell/core" { diff --git a/packages/core/src/extensions/commands.ts b/packages/core/src/extensions/commands.ts index 1334775..dc7f0db 100644 --- a/packages/core/src/extensions/commands.ts +++ b/packages/core/src/extensions/commands.ts @@ -1,5 +1,5 @@ -import * as commands from "~/commands/index.ts"; -import type { InkwellExtension } from "~/types/extensions.ts"; +import * as commands from "../commands/index.ts"; +import type { InkwellExtension } from "../types/extensions.ts"; /** Built-in commands shipped with core. Registered by default. */ export const CommandsExtension: InkwellExtension = { diff --git a/packages/core/src/helpers/resolveExtensionsOnEditor.spec.ts b/packages/core/src/helpers/resolveExtensionsOnEditor.spec.ts index aca1eab..8d8d0b4 100644 --- a/packages/core/src/helpers/resolveExtensionsOnEditor.spec.ts +++ b/packages/core/src/helpers/resolveExtensionsOnEditor.spec.ts @@ -1,7 +1,7 @@ import { describe, expect, it, vi } from "vite-plus/test"; import { resolveExtensionsOnEditor } from "./resolveExtensionsOnEditor.ts"; -import type { Editor } from "~/Editor.ts"; -import type { InkwellExtension } from "~/types/extensions.ts"; +import type { Editor } from "../Editor.ts"; +import type { InkwellExtension } from "../types/extensions.ts"; describe("resolveExtensionsOnEditor", () => { const editor = {} as Editor; diff --git a/packages/core/src/helpers/resolveExtensionsOnEditor.ts b/packages/core/src/helpers/resolveExtensionsOnEditor.ts index a93bc89..06d3df5 100644 --- a/packages/core/src/helpers/resolveExtensionsOnEditor.ts +++ b/packages/core/src/helpers/resolveExtensionsOnEditor.ts @@ -1,5 +1,5 @@ -import type { Editor } from "~/Editor.ts"; -import type { InkwellExtension } from "~/types/extensions.ts"; +import type { Editor } from "../Editor.ts"; +import type { InkwellExtension } from "../types/extensions.ts"; /** * Resolves the extensions by resolving child extensions and returning a flat list of all extensions + deduplicating by name. diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 10bbb1e..6e699a3 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -1,9 +1,9 @@ -export * from "~/commands/index.ts"; -export * from "~/types/index.ts"; +export * from "./commands/index.ts"; +export * from "./types/index.ts"; -export * from "~/CommandChain.ts"; -export * from "~/EventEmitter.ts"; -export * from "~/ExtensionManager.ts"; -export * from "~/Editor.ts"; +export * from "./CommandChain.ts"; +export * from "./EventEmitter.ts"; +export * from "./ExtensionManager.ts"; +export * from "./Editor.ts"; -export { Editor as default } from "~/Editor.ts"; +export { Editor as default } from "./Editor.ts"; diff --git a/packages/core/src/types/commands.ts b/packages/core/src/types/commands.ts index 8715909..74604d0 100644 --- a/packages/core/src/types/commands.ts +++ b/packages/core/src/types/commands.ts @@ -1,5 +1,5 @@ import type { EditorState, TransactionSpec } from "@codemirror/state"; -import type { Editor } from "~/Editor.ts"; +import type { Editor } from "../Editor.ts"; import type { EditorView } from "@codemirror/view"; /** diff --git a/packages/core/src/types/editor.ts b/packages/core/src/types/editor.ts index 6bc5600..c7dfd46 100644 --- a/packages/core/src/types/editor.ts +++ b/packages/core/src/types/editor.ts @@ -1,6 +1,6 @@ import type { EditorSelection, Transaction } from "@codemirror/state"; import type { InkwellExtension } from "./extensions.ts"; -import type { Editor } from "~/Editor.ts"; +import type { Editor } from "../Editor.ts"; export type EditorOptions = { element: HTMLElement; diff --git a/packages/core/src/types/extensions.ts b/packages/core/src/types/extensions.ts index 22991b3..3abf159 100644 --- a/packages/core/src/types/extensions.ts +++ b/packages/core/src/types/extensions.ts @@ -1,6 +1,6 @@ import type { Extension as CMExtension } from "@codemirror/state"; import type { KeyBinding } from "@codemirror/view"; -import type { Editor } from "~/Editor.ts"; +import type { Editor } from "../Editor.ts"; import type { EditorEvents } from "./editor.ts"; import type { Command } from "./commands.ts"; diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index b47621d..b01e22f 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -17,7 +17,6 @@ "verbatimModuleSyntax": true, "skipLibCheck": true, "paths": { - "~/*": ["./src/*"], "@inkwell/core": ["./src/index.ts"] } } diff --git a/packages/core/vite.config.ts b/packages/core/vite.config.ts index 6da9e55..4c7b197 100644 --- a/packages/core/vite.config.ts +++ b/packages/core/vite.config.ts @@ -1,9 +1,6 @@ import { defineConfig } from "vite-plus"; export default defineConfig({ - resolve: { - alias: { "~": "/src" }, - }, pack: { dts: { tsgo: true,