mirror of
https://github.com/mnaoumov/obsidian-advanced-debug-mode.git
synced 2026-07-22 05:44:00 +00:00
refactor: rename files and directories to kebab-case
This commit is contained in:
parent
6e6b816677
commit
25aab892a3
20 changed files with 119 additions and 48 deletions
71
CONTRIBUTING.md
Normal file
71
CONTRIBUTING.md
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
# Contributing
|
||||
|
||||
Contributions are welcome! Here's how to get started.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- [Node.js](https://nodejs.org/) (latest LTS recommended)
|
||||
- npm (comes with Node.js)
|
||||
|
||||
## Setup
|
||||
|
||||
```bash
|
||||
git clone https://github.com/mnaoumov/obsidian-advanced-debug-mode.git
|
||||
cd obsidian-advanced-debug-mode
|
||||
npm install
|
||||
```
|
||||
|
||||
## Development Workflow
|
||||
|
||||
### Build
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
### Dev Mode
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
```
|
||||
|
||||
### Commit
|
||||
|
||||
This project uses [Conventional Commits](https://www.conventionalcommits.org/). Use the interactive commit prompt:
|
||||
|
||||
```bash
|
||||
npm run commit
|
||||
```
|
||||
|
||||
### Lint
|
||||
|
||||
```bash
|
||||
npm run lint
|
||||
npm run lint:fix
|
||||
```
|
||||
|
||||
### Format
|
||||
|
||||
```bash
|
||||
npm run format:check
|
||||
npm run format
|
||||
```
|
||||
|
||||
### Spellcheck
|
||||
|
||||
```bash
|
||||
npm run spellcheck
|
||||
```
|
||||
|
||||
### Test
|
||||
|
||||
```bash
|
||||
npm run test
|
||||
npm run test:coverage
|
||||
```
|
||||
|
||||
## Pull Requests
|
||||
|
||||
- Base your PR on the `master` branch.
|
||||
- Ensure all checks pass (`lint`, `format:check`, `spellcheck`, `test`).
|
||||
- Use [Conventional Commits](https://www.conventionalcommits.org/) for your commit messages.
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
import type { PlatformDependencies } from '../PlatformDependencies.ts';
|
||||
|
||||
import { LongStackTracesComponentConstructor } from './LongStackTracesComponent.ts';
|
||||
|
||||
export const platformDependencies: PlatformDependencies = {
|
||||
LongStackTracesComponentConstructor
|
||||
};
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
import type { PlatformDependencies } from '../PlatformDependencies.ts';
|
||||
|
||||
import { LongStackTracesComponentConstructor } from './LongStackTracesComponent.ts';
|
||||
|
||||
export const platformDependencies: PlatformDependencies = {
|
||||
LongStackTracesComponentConstructor
|
||||
};
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
import { CommandInvocationBase } from 'obsidian-dev-utils/obsidian/commands/command-base';
|
||||
import { NonEditorCommandBase } from 'obsidian-dev-utils/obsidian/commands/non-editor-command-base';
|
||||
|
||||
import type { DevToolsComponent } from '../Components/DevToolsComponent.ts';
|
||||
import type { Plugin } from '../Plugin.ts';
|
||||
import type { DevToolsComponent } from '../components/dev-tools-component.ts';
|
||||
import type { Plugin } from '../plugin.ts';
|
||||
|
||||
class ToggleDevToolsButtonCommandInvocation extends CommandInvocationBase<Plugin> {
|
||||
public constructor(plugin: Plugin, private readonly devToolsComponent: DevToolsComponent) {
|
||||
|
|
@ -5,9 +5,9 @@ import {
|
|||
} from 'obsidian';
|
||||
import { throwExpression } from 'obsidian-dev-utils/error';
|
||||
|
||||
import type { Plugin } from '../Plugin.ts';
|
||||
import type { Plugin } from '../plugin.ts';
|
||||
|
||||
import { ToggleDevToolsButtonCommand } from '../Commands/ToggleDevToolsButtonCommand.ts';
|
||||
import { ToggleDevToolsButtonCommand } from '../commands/toggle-dev-tools-button-command.ts';
|
||||
|
||||
export class DevToolsComponent extends Component {
|
||||
private erudaButton?: HTMLDivElement;
|
||||
|
|
@ -7,7 +7,7 @@ import {
|
|||
} from 'obsidian';
|
||||
import { registerPatch } from 'obsidian-dev-utils/obsidian/monkey-around';
|
||||
|
||||
import type { Plugin } from '../Plugin.ts';
|
||||
import type { Plugin } from '../plugin.ts';
|
||||
|
||||
const THINGS_HAPPENING_DEBOUNCE_TIMEOUT_IN_MS = 60_000;
|
||||
type QueueFn = FileSystemAdapter['queue'];
|
||||
|
|
@ -11,9 +11,9 @@ import {
|
|||
import { AllWindowsEventHandler } from 'obsidian-dev-utils/obsidian/components/all-windows-event-handler';
|
||||
import { registerPatch } from 'obsidian-dev-utils/obsidian/monkey-around';
|
||||
|
||||
import type { Plugin } from '../Plugin.ts';
|
||||
import type { Plugin } from '../plugin.ts';
|
||||
|
||||
import { MultiWeakMap } from '../MultiWeakMap.ts';
|
||||
import { MultiWeakMap } from '../multi-weak-map.ts';
|
||||
|
||||
export type GenericFunction = ((this: unknown, ...args: unknown[]) => unknown) & { originalFn?: GenericFunction };
|
||||
|
||||
|
|
@ -8,8 +8,8 @@ import { Component } from 'obsidian';
|
|||
import type {
|
||||
LongStackTracesComponent,
|
||||
StackFrame
|
||||
} from '../Components/LongStackTracesComponent.ts';
|
||||
import type { Plugin } from '../Plugin.ts';
|
||||
} from '../components/long-stack-traces-component.ts';
|
||||
import type { Plugin } from '../plugin.ts';
|
||||
|
||||
interface AsyncStackFrame {
|
||||
currentError: Error;
|
||||
7
src/desktop/dependencies.ts
Normal file
7
src/desktop/dependencies.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import type { PlatformDependencies } from '../platform-dependencies.ts';
|
||||
|
||||
import { LongStackTracesComponentConstructor } from './long-stack-traces-component.ts';
|
||||
|
||||
export const platformDependencies: PlatformDependencies = {
|
||||
LongStackTracesComponentConstructor
|
||||
};
|
||||
|
|
@ -5,11 +5,11 @@ import { AllWindowsEventHandler } from 'obsidian-dev-utils/obsidian/components/a
|
|||
import type {
|
||||
StackFrame,
|
||||
WindowEx
|
||||
} from '../Components/LongStackTracesComponent.ts';
|
||||
import type { Plugin } from '../Plugin.ts';
|
||||
} from '../components/long-stack-traces-component.ts';
|
||||
import type { Plugin } from '../plugin.ts';
|
||||
|
||||
import { LongStackTracesComponent } from '../Components/LongStackTracesComponent.ts';
|
||||
import { AsyncLongStackTracesComponent } from './AsyncLongStackTracesComponent.ts';
|
||||
import { LongStackTracesComponent } from '../components/long-stack-traces-component.ts';
|
||||
import { AsyncLongStackTracesComponent } from './async-long-stack-traces-component.ts';
|
||||
|
||||
class LongStackTracesComponentImpl extends LongStackTracesComponent {
|
||||
private asyncLongStackTracesHandler?: AsyncLongStackTracesComponent;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import './styles/main.scss';
|
||||
import { Plugin } from './Plugin.ts';
|
||||
import { Plugin } from './plugin.ts';
|
||||
|
||||
export default Plugin;
|
||||
|
|
|
|||
7
src/mobile/dependencies.ts
Normal file
7
src/mobile/dependencies.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import type { PlatformDependencies } from '../platform-dependencies.ts';
|
||||
|
||||
import { LongStackTracesComponentConstructor } from './long-stack-traces-component.ts';
|
||||
|
||||
export const platformDependencies: PlatformDependencies = {
|
||||
LongStackTracesComponentConstructor
|
||||
};
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { LongStackTracesComponent } from '../Components/LongStackTracesComponent.ts';
|
||||
import { LongStackTracesComponent } from '../components/long-stack-traces-component.ts';
|
||||
|
||||
class LongStackTracesComponentImpl extends LongStackTracesComponent {
|
||||
}
|
||||
|
|
@ -2,8 +2,8 @@ import type { Constructor } from 'type-fest';
|
|||
|
||||
import { Platform } from 'obsidian';
|
||||
|
||||
import type { LongStackTracesComponent } from './Components/LongStackTracesComponent.ts';
|
||||
import type { Plugin } from './Plugin.ts';
|
||||
import type { LongStackTracesComponent } from './components/long-stack-traces-component.ts';
|
||||
import type { Plugin } from './plugin.ts';
|
||||
|
||||
export interface PlatformDependencies {
|
||||
LongStackTracesComponentConstructor: Constructor<LongStackTracesComponent, [Plugin]>;
|
||||
|
|
@ -12,8 +12,8 @@ export interface PlatformDependencies {
|
|||
export async function getPlatformDependencies(): Promise<PlatformDependencies> {
|
||||
const module = Platform.isMobile
|
||||
// eslint-disable-next-line no-restricted-syntax -- Deliberate, platform-specific code.
|
||||
? await import('./Mobile/Dependencies.ts')
|
||||
? await import('./mobile/dependencies.ts')
|
||||
// eslint-disable-next-line no-restricted-syntax -- Deliberate, platform-specific code.
|
||||
: await import('./Desktop/Dependencies.ts');
|
||||
: await import('./desktop/dependencies.ts');
|
||||
return module.platformDependencies;
|
||||
}
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
import { PluginSettingsManagerBase } from 'obsidian-dev-utils/obsidian/plugin/plugin-settings-manager-base';
|
||||
|
||||
import type { PluginTypes } from './PluginTypes.ts';
|
||||
import type { PluginTypes } from './plugin-types.ts';
|
||||
|
||||
import { PluginSettings } from './PluginSettings.ts';
|
||||
import { PluginSettings } from './plugin-settings.ts';
|
||||
|
||||
export class PluginSettingsManager extends PluginSettingsManagerBase<PluginTypes> {
|
||||
protected override createDefaultSettings(): PluginSettings {
|
||||
|
|
@ -10,8 +10,8 @@ import { appendCodeBlock } from 'obsidian-dev-utils/html-element';
|
|||
import { PluginSettingsTabBase } from 'obsidian-dev-utils/obsidian/plugin/plugin-settings-tab-base';
|
||||
import { SettingEx } from 'obsidian-dev-utils/obsidian/setting-ex';
|
||||
|
||||
import type { Plugin } from './Plugin.ts';
|
||||
import type { PluginTypes } from './PluginTypes.ts';
|
||||
import type { Plugin } from './plugin.ts';
|
||||
import type { PluginTypes } from './plugin-types.ts';
|
||||
|
||||
export class PluginSettingsTab extends PluginSettingsTabBase<PluginTypes> {
|
||||
public constructor(plugin: Plugin) {
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
import type { PluginTypesBase } from 'obsidian-dev-utils/obsidian/plugin/plugin-types-base';
|
||||
|
||||
import type { Plugin } from './Plugin.ts';
|
||||
import type { PluginSettings } from './PluginSettings.ts';
|
||||
import type { PluginSettingsManager } from './PluginSettingsManager.ts';
|
||||
import type { PluginSettingsTab } from './PluginSettingsTab.ts';
|
||||
import type { Plugin } from './plugin.ts';
|
||||
import type { PluginSettings } from './plugin-settings.ts';
|
||||
import type { PluginSettingsManager } from './plugin-settings-manager.ts';
|
||||
import type { PluginSettingsTab } from './plugin-settings-tab.ts';
|
||||
|
||||
export interface PluginTypes extends PluginTypesBase {
|
||||
plugin: Plugin;
|
||||
|
|
@ -3,14 +3,14 @@ import type { ReadonlyDeep } from 'type-fest';
|
|||
|
||||
import { PluginBase } from 'obsidian-dev-utils/obsidian/plugin/plugin-base';
|
||||
|
||||
import type { PluginTypes } from './PluginTypes.ts';
|
||||
import type { PluginTypes } from './plugin-types.ts';
|
||||
|
||||
import { DevToolsComponent } from './Components/DevToolsComponent.ts';
|
||||
import { LongRunningTasksComponent } from './Components/LongRunningTasksComponent.ts';
|
||||
import { LongStackTracesComponent } from './Components/LongStackTracesComponent.ts';
|
||||
import { getPlatformDependencies } from './PlatformDependencies.ts';
|
||||
import { PluginSettingsManager } from './PluginSettingsManager.ts';
|
||||
import { PluginSettingsTab } from './PluginSettingsTab.ts';
|
||||
import { DevToolsComponent } from './components/dev-tools-component.ts';
|
||||
import { LongRunningTasksComponent } from './components/long-running-tasks-component.ts';
|
||||
import { LongStackTracesComponent } from './components/long-stack-traces-component.ts';
|
||||
import { getPlatformDependencies } from './platform-dependencies.ts';
|
||||
import { PluginSettingsManager } from './plugin-settings-manager.ts';
|
||||
import { PluginSettingsTab } from './plugin-settings-tab.ts';
|
||||
|
||||
export class Plugin extends PluginBase<PluginTypes> {
|
||||
private longRunningTasksComponent?: LongRunningTasksComponent;
|
||||
Loading…
Reference in a new issue