Skip to content

Commit

Permalink
adapter pattern cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Joseph Petro committed Dec 20, 2024
1 parent 7cbabcd commit 8fb9208
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 17 deletions.
8 changes: 4 additions & 4 deletions smart-environment/default.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { SmartSources, SmartBlocks, SmartSource, SmartBlock } from 'smart-sources';
import { AjsonMultiFileCollectionDataAdapter } from "smart-collections/adapters/ajson_multi_file";
import { SourceAdapter } from "smart-sources/adapters/_adapter.js";
import { MarkdownSourceAdapter } from "smart-sources/adapters/markdown.js";
import { SourceContentAdapter } from "smart-sources/adapters/_adapter.js";
import { MarkdownSourceContentAdapter } from "smart-sources/adapters/markdown_source.js";
import { SmartEmbedModel } from 'smart-embed-model';
export const smart_env_config = {
env_data_dir: '.smart-env',
Expand All @@ -11,8 +11,8 @@ export const smart_env_config = {
class: SmartSources,
data_adapter: AjsonMultiFileCollectionDataAdapter,
source_adapters: {
"md": MarkdownSourceAdapter,
"default": SourceAdapter,
"md": MarkdownSourceContentAdapter,
"default": SourceContentAdapter,
}
},
smart_blocks: SmartBlocks,
Expand Down
6 changes: 3 additions & 3 deletions smart-sources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ The `SmartBlock` class extends `SmartEntity` and represents an individual block

Smart Sources uses adapters to handle different types of content. The main adapters are:

- `SourceAdapter`: Base adapter class for handling source operations.
- `MarkdownSourceAdapter`: Specializes in handling Markdown files.
- `PDFSourceAdapter`: Handles PDF files, extracting content into well-formed markdown.
- `SourceContentAdapter`: Base adapter class for handling source operations.
- `MarkdownSourceContentAdapter`: Specializes in handling Markdown files.
- `PDFSourceContentAdapter`: Handles PDF files, extracting content into well-formed markdown.

Adapters provide a consistent interface for various operations on different content types.

Expand Down
6 changes: 3 additions & 3 deletions smart-sources/test/ajson_multi_file.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { SmartEnv } from '../../smart-environment/smart_env.js';
import { SmartFs } from '../../smart-fs/smart_fs.js';
import { NodeFsSmartFsAdapter } from '../../smart-fs/adapters/node_fs.js';
import { SmartSettings } from '../../smart-settings/smart_settings.js';
import { MarkdownSourceAdapter } from '../adapters/markdown.js';
import { MarkdownSourceContentAdapter } from '../adapters/markdown_source.js';
import { SmartSources } from '../smart_sources.js';
import { SmartSource } from '../smart_source.js';
import { SmartBlocks } from '../smart_blocks.js';
Expand Down Expand Up @@ -33,8 +33,8 @@ class TestMultiFileSourceMain {
class: SmartSources,
data_adapter: AjsonMultiFileSourceDataAdapter,
source_adapters: {
default: MarkdownSourceAdapter,
md: MarkdownSourceAdapter,
default: MarkdownSourceContentAdapter,
md: MarkdownSourceContentAdapter,
}
},
smart_blocks: {
Expand Down
6 changes: 3 additions & 3 deletions smart-sources/test/old-tests (needs review)/_env.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { JsonSingleFileCollectionDataAdapter } from '../../smart-collections/adapters/json_single_file.js';
import { SmartFsTestAdapter } from '../../smart-fs/adapters/_test.js';
import { SourceTestAdapter } from '../adapters/_test.js';
import { MarkdownSourceAdapter } from '../adapters/markdown.js';
import { MarkdownSourceContentAdapter } from '../adapters/markdown_source.js';
import { SmartSource } from '../smart_source.js';
import { SmartSources } from '../smart_sources.js';
import { SmartBlock } from '../smart_block.js';
Expand Down Expand Up @@ -46,8 +46,8 @@ class TestMain {
data_adapter: JsonSingleFileCollectionDataAdapter,
source_adapters: {
test: SourceTestAdapter,
md: MarkdownSourceAdapter,
default: MarkdownSourceAdapter
md: MarkdownSourceContentAdapter,
default: MarkdownSourceContentAdapter
},
},
smart_blocks: SmartBlocks,
Expand Down
6 changes: 3 additions & 3 deletions smart-sources/test/sqlite.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { SmartEnv } from '../../smart-environment/smart_env.js';
import { SmartFs } from '../../smart-fs/smart_fs.js';
import { NodeFsSmartFsAdapter } from '../../smart-fs/adapters/node_fs.js';
import { SmartSettings } from '../../smart-settings/smart_settings.js';
import { MarkdownSourceAdapter } from '../adapters/markdown.js';
import { MarkdownSourceContentAdapter } from '../adapters/markdown_source.js';
import { SmartSources } from '../smart_sources.js';
import { SmartSource } from '../smart_source.js';
import { SmartBlocks } from '../smart_blocks.js';
Expand Down Expand Up @@ -33,8 +33,8 @@ class TestMultiFileSourceMain {
class: SmartSources,
data_adapter: SqliteSourceDataAdapter,
source_adapters: {
default: MarkdownSourceAdapter,
md: MarkdownSourceAdapter,
default: MarkdownSourceContentAdapter,
md: MarkdownSourceContentAdapter,
}
},
smart_blocks: {
Expand Down
1 change: 0 additions & 1 deletion smart-templates/test/_env.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { JsonSingleFileCollectionDataAdapter } from '../../smart-collections/adapters/json_single_file.js';
import { SourceTestAdapter } from 'smart-sources/adapters/_test.js';
import { MarkdownSourceAdapter } from 'smart-sources/adapters/markdown.js';
import { SmartSources, SmartSource, SmartBlocks, SmartBlock } from 'smart-sources';
import { SmartEnv } from '../../smart-environment/smart_env.js';
import { SmartEmbedModel } from '../../smart-embed-model-v1/smart_embed_model.js';
Expand Down

0 comments on commit 8fb9208

Please sign in to comment.