refactor: reorganize specs and adapter extensions (#10359)

### TL;DR
Refactored `SpecProvider` singleton access pattern and reorganized adapter/extension code structure.

### What changed?
- Changed `SpecProvider.getInstance()` to `SpecProvider._` for cleaner singleton access
- Moved adapter/extension code from `_common` directory to dedicated `adapters` and `extensions` folders
- Consolidated adapter extensions into a single file
- Removed unused dependencies from package.json
- Deleted unnecessary schema files
- Extracted `MobileSpecsPatches` class into the mobile patching code
- Updated all references to use the new `SpecProvider._` accessor

### How to test?
- Verify all specs are properly registered and accessible via `SpecProvider._`
- Test adapter functionality for HTML, Markdown, Notion HTML and plain text
- Check mobile-specific features and patches work correctly
- Ensure preview functionality works in both page and edgeless modes

### Why make this change?
- Improves code organization by properly separating adapters and extensions
- Simplifies singleton access pattern
- Removes unnecessary dependencies and files
- Makes the codebase more maintainable by consolidating related functionality
This commit is contained in:
Saul-Mirone
2025-02-21 14:25:35 +00:00
parent 72b751943c
commit 2cf9a8f286
49 changed files with 224 additions and 320 deletions
@@ -26,7 +26,7 @@ type ImportHTMLZipOptions = {
function getProvider() {
const container = new Container();
const exts = SpecProvider.getInstance().getSpec('store').value;
const exts = SpecProvider._.getSpec('store').value;
exts.forEach(ext => {
ext.setup(container);
});
@@ -16,7 +16,7 @@ import { createAssetsArchive, download, Unzip } from './utils.js';
function getProvider() {
const container = new Container();
const exts = SpecProvider.getInstance().getSpec('store').value;
const exts = SpecProvider._.getSpec('store').value;
exts.forEach(ext => {
ext.setup(container);
});
@@ -14,7 +14,7 @@ type ImportNotionZipOptions = {
function getProvider() {
const container = new Container();
const exts = SpecProvider.getInstance().getSpec('store').value;
const exts = SpecProvider._.getSpec('store').value;
exts.forEach(ext => {
ext.setup(container);
});