Skip to content

Commit

Permalink
Migrate to esm (#1195)
Browse files Browse the repository at this point in the history
- migrate to use new esm job-components
- migrate exported code to be esm
- remove vestiges of legacy elasticsearch client testing code
- remove legacy processor `elasticsearch-data-generator`. closes: #1034
- remove deprecated `data_generator` processor
- update got to v13
  • Loading branch information
jsnoble authored Jun 25, 2024
1 parent 9898598 commit 9791099
Show file tree
Hide file tree
Showing 99 changed files with 676 additions and 1,520 deletions.
12 changes: 10 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
{
"extends": "@terascope",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"@typescript-eslint/naming-convention": "off"
}
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-duplicate-enum-values": "warn",
"import/extensions": "off",
"import/no-import-module-exports": "off"
},
"ignorePatterns":[]
}
28 changes: 0 additions & 28 deletions .github/workflows/test-asset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,6 @@ on:
branches: [ master ]

jobs:
test-es6-legacy-linux:
runs-on: ubuntu-latest
env:
NODE_OPTIONS: "--max-old-space-size=4096"
strategy:
matrix:
# NOTE: Hard Coded Node Version array, should match array in build-and-publish-asset.yml
node-version: [18.19.1, 20.11.1, 22.2.0]
steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
# we login to docker to avoid docker pull limit rates

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- run: yarn setup
- run: yarn lint
- run: yarn --silent test:legacy

test-elasticsearch-assets:
runs-on: ubuntu-latest
env:
Expand Down
2 changes: 1 addition & 1 deletion asset/asset.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "elasticsearch",
"version": "3.7.2"
"version": "4.0.0"
}
18 changes: 9 additions & 9 deletions asset/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "asset",
"displayName": "Asset",
"version": "3.7.2",
"version": "4.0.0",
"private": true,
"description": "",
"license": "MIT",
"author": "",
"type": "module",
"workspaces": {
"nohoist": [
"**"
Expand All @@ -17,15 +18,14 @@
"test": "yarn --cwd ../ test"
},
"dependencies": {
"@terascope/data-mate": "^0.56.2",
"@terascope/elasticsearch-api": "^3.20.2",
"@terascope/elasticsearch-asset-apis": "^0.12.1",
"@terascope/job-components": "^0.75.1",
"@terascope/teraslice-state-storage": "^0.53.2",
"@terascope/utils": "^0.59.1",
"@terascope/data-mate": "^0.56.3",
"@terascope/elasticsearch-api": "^3.20.3",
"@terascope/elasticsearch-asset-apis": "^1.0.0",
"@terascope/job-components": "^1.0.1",
"@terascope/teraslice-state-storage": "^0.53.3",
"@terascope/utils": "^0.59.3",
"datemath-parser": "^1.0.6",
"got": "^11.8.3",
"mocker-data-generator": "^2.12.0",
"got": "^13.0.0",
"moment": "^2.30.1"
},
"devDependencies": {},
Expand Down
4 changes: 2 additions & 2 deletions asset/src/__lib/DateReaderAPISlicer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import moment from 'moment';
import {
ElasticsearchReaderAPI, DateSlicerRanges
} from '@terascope/elasticsearch-asset-apis';
import { ESDateConfig } from '../elasticsearch_reader/interfaces';
import { ElasticReaderFactoryAPI } from '../elasticsearch_reader_api/interfaces';
import { ESDateConfig } from '../elasticsearch_reader/interfaces.js';
import { ElasticReaderFactoryAPI } from '../elasticsearch_reader_api/interfaces.js';

export class DateReaderAPISlicer extends ParallelSlicer<ESDateConfig> {
protected api!: ElasticsearchReaderAPI;
Expand Down
4 changes: 2 additions & 2 deletions asset/src/__lib/ReaderAPIFetcher.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Fetcher, DataEntity, isPromAvailable } from '@terascope/job-components';
import { DataFrame } from '@terascope/data-mate';
import { ElasticsearchReaderAPI, ReaderSlice } from '@terascope/elasticsearch-asset-apis';
import { ESDateConfig } from '../elasticsearch_reader/interfaces';
import { ElasticReaderFactoryAPI } from '../elasticsearch_reader_api/interfaces';
import { ESDateConfig } from '../elasticsearch_reader/interfaces.js';
import { ElasticReaderFactoryAPI } from '../elasticsearch_reader_api/interfaces.js';

export class ReaderAPIFetcher extends Fetcher<ESDateConfig> {
api!: ElasticsearchReaderAPI;
Expand Down
2 changes: 1 addition & 1 deletion asset/src/elasticsearch_bulk/interfaces.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OpConfig } from '@terascope/job-components';
import { ElasticsearchAPISenderConfig } from '../elasticsearch_sender_api/interfaces';
import { ElasticsearchAPISenderConfig } from '../elasticsearch_sender_api/interfaces.js';

export interface ElasticsearchBulkConfig extends ElasticsearchAPISenderConfig, OpConfig {
api_name: string;
Expand Down
4 changes: 2 additions & 2 deletions asset/src/elasticsearch_bulk/processor.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { BatchProcessor, isPromAvailable } from '@terascope/job-components';
import { DataEntity } from '@terascope/utils';
import { ElasticsearchBulkSender } from '@terascope/elasticsearch-asset-apis';
import { ElasticSenderAPI } from '../elasticsearch_sender_api/interfaces';
import { ElasticsearchBulkConfig } from './interfaces';
import { ElasticSenderAPI } from '../elasticsearch_sender_api/interfaces.js';
import { ElasticsearchBulkConfig } from './interfaces.js';

export default class ElasticsearchBulk extends BatchProcessor<ElasticsearchBulkConfig> {
client!: ElasticsearchBulkSender;
Expand Down
4 changes: 2 additions & 2 deletions asset/src/elasticsearch_bulk/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import {
AnyObject, isString, getTypeOf, cloneDeep,
isNumber, isNotNil
} from '@terascope/job-components';
import { ElasticsearchBulkConfig } from './interfaces';
import { DEFAULT_API_NAME } from '../elasticsearch_sender_api/interfaces';
import { ElasticsearchBulkConfig } from './interfaces.js';
import { DEFAULT_API_NAME } from '../elasticsearch_sender_api/interfaces.js';

export const schema: AnyObject = {
size: {
Expand Down
34 changes: 0 additions & 34 deletions asset/src/elasticsearch_data_generator/counter.ts

This file was deleted.

113 changes: 0 additions & 113 deletions asset/src/elasticsearch_data_generator/data-schema.ts

This file was deleted.

68 changes: 0 additions & 68 deletions asset/src/elasticsearch_data_generator/fetcher.ts

This file was deleted.

28 changes: 0 additions & 28 deletions asset/src/elasticsearch_data_generator/interfaces.ts

This file was deleted.

Loading

0 comments on commit 9791099

Please sign in to comment.