@strav/search 0.1.0 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,20 +1,20 @@
1
- # @stravigor/search
1
+ # @strav/search
2
2
 
3
- Full-text search for the [Strav](https://www.npmjs.com/package/@stravigor/core) framework. Unified API for Meilisearch, Typesense, and Algolia with automatic indexing via model events.
3
+ Full-text search for the [Strav](https://www.npmjs.com/package/@strav/core) framework. Unified API for Meilisearch, Typesense, and Algolia with automatic indexing via model events.
4
4
 
5
5
  ## Install
6
6
 
7
7
  ```bash
8
- bun add @stravigor/search
8
+ bun add @strav/search
9
9
  bun strav install search
10
10
  ```
11
11
 
12
- Requires `@stravigor/core` as a peer dependency.
12
+ Requires `@strav/core` as a peer dependency.
13
13
 
14
14
  ## Setup
15
15
 
16
16
  ```ts
17
- import { SearchProvider } from '@stravigor/search'
17
+ import { SearchProvider } from '@strav/search'
18
18
 
19
19
  app.use(new SearchProvider())
20
20
  ```
@@ -22,7 +22,7 @@ app.use(new SearchProvider())
22
22
  ## Searchable Models
23
23
 
24
24
  ```ts
25
- import { searchable } from '@stravigor/search'
25
+ import { searchable } from '@strav/search'
26
26
 
27
27
  class Post extends searchable(BaseModel) {
28
28
  static searchableAs = 'posts'
@@ -36,7 +36,7 @@ class Post extends searchable(BaseModel) {
36
36
  ## Usage
37
37
 
38
38
  ```ts
39
- import { search } from '@stravigor/search'
39
+ import { search } from '@strav/search'
40
40
 
41
41
  // Search
42
42
  const results = await search.query('posts', 'hello world', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strav/search",
3
- "version": "0.1.0",
3
+ "version": "0.1.5",
4
4
  "type": "module",
5
5
  "description": "Full-text search for the Strav framework",
6
6
  "license": "MIT",
@@ -18,9 +18,9 @@
18
18
  "tsconfig.json"
19
19
  ],
20
20
  "peerDependencies": {
21
- "@strav/kernel": "0.1.0",
22
- "@strav/database": "0.1.0",
23
- "@strav/cli": "0.1.0"
21
+ "@strav/kernel": "0.1.4",
22
+ "@strav/database": "0.1.4",
23
+ "@strav/cli": "0.1.4"
24
24
  },
25
25
  "scripts": {
26
26
  "test": "bun test tests/",
@@ -1,7 +1,7 @@
1
1
  import type { Command } from 'commander'
2
2
  import chalk from 'chalk'
3
- import { bootstrap, shutdown } from '@stravigor/cli'
4
- import { BaseModel } from '@stravigor/database'
3
+ import { bootstrap, shutdown } from '@strav/cli'
4
+ import { BaseModel } from '@strav/database'
5
5
  import SearchManager from '../search_manager.ts'
6
6
 
7
7
  export function register(program: Command): void {
@@ -1,7 +1,7 @@
1
1
  import type { Command } from 'commander'
2
2
  import chalk from 'chalk'
3
- import { bootstrap, shutdown } from '@stravigor/cli'
4
- import { BaseModel } from '@stravigor/database'
3
+ import { bootstrap, shutdown } from '@strav/cli'
4
+ import { BaseModel } from '@strav/database'
5
5
  import SearchManager from '../search_manager.ts'
6
6
 
7
7
  export function register(program: Command): void {
@@ -1,4 +1,4 @@
1
- import { ExternalServiceError } from '@stravigor/kernel'
1
+ import { ExternalServiceError } from '@strav/kernel'
2
2
  import type { SearchEngine } from '../search_engine.ts'
3
3
  import type {
4
4
  SearchDocument,
@@ -1,4 +1,4 @@
1
- import { ExternalServiceError } from '@stravigor/kernel'
1
+ import { ExternalServiceError } from '@strav/kernel'
2
2
  import type { SearchEngine } from '../search_engine.ts'
3
3
  import type {
4
4
  SearchDocument,
@@ -1,4 +1,4 @@
1
- import { ExternalServiceError } from '@stravigor/kernel'
1
+ import { ExternalServiceError } from '@strav/kernel'
2
2
  import type { SearchEngine } from '../search_engine.ts'
3
3
  import type {
4
4
  SearchDocument,
package/src/errors.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { StravError } from '@stravigor/kernel'
1
+ import { StravError } from '@strav/kernel'
2
2
 
3
3
  /** Base error class for all search errors. */
4
4
  export class SearchError extends StravError {}
package/src/helpers.ts CHANGED
@@ -12,7 +12,7 @@ import type {
12
12
  * Search helper — the primary convenience API.
13
13
  *
14
14
  * @example
15
- * import { search } from '@stravigor/search'
15
+ * import { search } from '@strav/search'
16
16
  *
17
17
  * const results = await search.query('articles', 'typescript generics')
18
18
  * await search.upsert('articles', 1, { title: 'Guide', body: '...' })
@@ -1,4 +1,4 @@
1
- import { inject, Configuration, ConfigurationError } from '@stravigor/kernel'
1
+ import { inject, Configuration, ConfigurationError } from '@strav/kernel'
2
2
  import type { SearchEngine } from './search_engine.ts'
3
3
  import type { SearchConfig, DriverConfig } from './types.ts'
4
4
  import { MeilisearchDriver } from './drivers/meilisearch_driver.ts'
@@ -1,5 +1,5 @@
1
- import { ServiceProvider } from '@stravigor/kernel'
2
- import type { Application } from '@stravigor/kernel'
1
+ import { ServiceProvider } from '@strav/kernel'
2
+ import type { Application } from '@strav/kernel'
3
3
  import SearchManager from './search_manager.ts'
4
4
 
5
5
  export default class SearchProvider extends ServiceProvider {
package/src/searchable.ts CHANGED
@@ -1,6 +1,6 @@
1
- import type { BaseModel } from '@stravigor/database'
2
- import type { NormalizeConstructor } from '@stravigor/kernel'
3
- import { Emitter } from '@stravigor/kernel'
1
+ import type { BaseModel } from '@strav/database'
2
+ import type { NormalizeConstructor } from '@strav/kernel'
3
+ import { Emitter } from '@strav/kernel'
4
4
  import SearchManager from './search_manager.ts'
5
5
  import type { SearchOptions, SearchResult, SearchDocument, IndexSettings } from './types.ts'
6
6
 
@@ -8,8 +8,8 @@ import type { SearchOptions, SearchResult, SearchDocument, IndexSettings } from
8
8
  * Mixin that adds full-text search capabilities to a BaseModel subclass.
9
9
  *
10
10
  * @example
11
- * import { BaseModel } from '@stravigor/database'
12
- * import { searchable } from '@stravigor/search'
11
+ * import { BaseModel } from '@strav/database'
12
+ * import { searchable } from '@strav/search'
13
13
  *
14
14
  * class Article extends searchable(BaseModel) {
15
15
  * declare id: number
@@ -24,7 +24,7 @@ import type { SearchOptions, SearchResult, SearchDocument, IndexSettings } from
24
24
  * }
25
25
  *
26
26
  * // Composable with other mixins:
27
- * import { compose } from '@stravigor/kernel'
27
+ * import { compose } from '@strav/kernel'
28
28
  * class Article extends compose(BaseModel, softDeletes, searchable) { }
29
29
  *
30
30
  * // Boot auto-indexing (in app bootstrap):
@@ -1,4 +1,4 @@
1
- import { env } from '@stravigor/kernel'
1
+ import { env } from '@strav/kernel'
2
2
 
3
3
  export default {
4
4
  /** The default search driver to use. */