Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ insert_final_newline = true
max_line_length = 150
trim_trailing_whitespace = true

[*.{sh,podspec,yml,yaml}]
[*.{sh,podspec,yml,yaml,json}]
indent_style = space
indent_size = 2

Expand Down
52 changes: 26 additions & 26 deletions .github/actions/setup/action.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
name: Setup
description: Setup Node.js and install dependencies
runs:
using: composite
steps:
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version-file: .nvmrc
- name: Cache dependencies
id: yarn-cache
uses: actions/[email protected]
with:
path: |
**/node_modules
.yarn/install-state.gz
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --immutable
shell: bash
name: Setup
description: Setup Node.js and install dependencies

runs:
using: composite
steps:
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version-file: .nvmrc

- name: Cache dependencies
id: yarn-cache
uses: actions/[email protected]
with:
path: |
**/node_modules
.yarn/install-state.gz
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}

- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --immutable
shell: bash
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20.12.2
v22.13.1
4 changes: 1 addition & 3 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
"trailingComma": "none",
"semi": false,
"singleQuote": true,
"jsxSingleQuote": false,
"bracketSpacing": true,
"bracketSameLine": false,
"arrowParens": "avoid",
"printWidth": 150
"arrowParens": "avoid"
}
28 changes: 14 additions & 14 deletions .swcrc
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"$schema": "https://json.schemastore.org/swcrc",
"sourceMaps": true,
"jsc": {
"parser": {
"syntax": "typescript",
"decorators": true,
"dynamicImport": true
},
"transform": {
"legacyDecorator": true,
"decoratorMetadata": true
},
"baseUrl": "./"
"$schema": "https://json.schemastore.org/swcrc",
"sourceMaps": true,
"jsc": {
"parser": {
"syntax": "typescript",
"decorators": true,
"dynamicImport": true
},
"minify": false
"transform": {
"legacyDecorator": true,
"decoratorMetadata": true
},
"baseUrl": "./"
},
"minify": false
}
38 changes: 19 additions & 19 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
version: '3.7'
services:
elasticsearch:
container_name: es-container
image: docker.elastic.co/elasticsearch/elasticsearch:8.14.0
environment:
- discovery.type=single-node
- xpack.security.enabled=false
# Limit use of memory https://github.com/zammad/zammad-docker-compose/issues/256#issuecomment-1105241970
- ES_JAVA_OPTS=-Xmx4096m
ports:
- 9200:9200
elasticsearch:
container_name: es-container
image: docker.elastic.co/elasticsearch/elasticsearch:8.14.0
environment:
- discovery.type=single-node
- xpack.security.enabled=false
# Limit use of memory https://github.com/zammad/zammad-docker-compose/issues/256#issuecomment-1105241970
- ES_JAVA_OPTS=-Xmx4096m
ports:
- 9200:9200

kibana:
container_name: kb-container
image: docker.elastic.co/kibana/kibana:8.14.0
environment:
- ELASTICSEARCH_HOSTS=http://es-container:9200
depends_on:
- elasticsearch
ports:
- 5601:5601
kibana:
container_name: kb-container
image: docker.elastic.co/kibana/kibana:8.14.0
environment:
- ELASTICSEARCH_HOSTS=http://es-container:9200
depends_on:
- elasticsearch
ports:
- 5601:5601
20 changes: 10 additions & 10 deletions docs/decorating-document-catalog.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
```typescript
import { IsString } from 'class-validator'
import { RegisterIndex } from '@codemaskjs/nestjs-elasticsearch'
@RegisterIndex('examples')
export class ExampleDocument {
@IsString()
readonly field: string
}
```
```typescript
import { IsString } from 'class-validator'
import { RegisterIndex } from '@codemaskjs/nestjs-elasticsearch'

@RegisterIndex('examples')
export class ExampleDocument {
@IsString()
readonly field: string
}
```
47 changes: 22 additions & 25 deletions docs/registering-elasticsearch-module.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@

```typescript
import { Module } from '@nestjs/common'
import { ElasticsearchModule } from '../src/nestjs'
import { ExampleDocument } from './document'

@Module({
imports: [
ElasticsearchModule.register({
node: 'http://localhost:9200',
auth: {
username: 'admin',
password: 'password'
},
headers: {
'Content-Type': 'application/json'
}
}),
ElasticsearchModule.forFeature([
ExampleDocument
])
]
})
export class AppModule {}
```
```typescript
import { Module } from '@nestjs/common'
import { ElasticsearchModule } from '../src/nestjs'
import { ExampleDocument } from './document'

@Module({
imports: [
ElasticsearchModule.register({
node: 'http://localhost:9200',
auth: {
username: 'admin',
password: 'password'
},
headers: {
'Content-Type': 'application/json'
}
}),
ElasticsearchModule.forFeature([ExampleDocument])
]
})
export class AppModule {}
```
18 changes: 9 additions & 9 deletions jest.config.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"moduleFileExtensions": ["js", "ts"],
"modulePaths": ["<rootDir>", "src"],
"coverageDirectory": "../unit-test/coverage",
"rootDir": "./src",
"setupFilesAfterEnv": ["<rootDir>/test/jest.setup.ts"],
"testRegex": ".spec.ts$",
"transform": {
"^.+\\.(t|j)s$": "@swc/jest"
}
"moduleFileExtensions": ["js", "ts"],
"modulePaths": ["<rootDir>", "src"],
"coverageDirectory": "../unit-test/coverage",
"rootDir": "./src",
"setupFilesAfterEnv": ["<rootDir>/test/jest.setup.ts"],
"testRegex": ".spec.ts$",
"transform": {
"^.+\\.(t|j)s$": "@swc/jest"
}
}
Loading
Loading