Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If core plugin types #843

Merged
merged 14 commits into from
Jun 18, 2024
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
1 change: 0 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ module.exports = {
},
modulePathIgnorePatterns: [
'./build',
'./src/__tests__/unit/lib/manifest',
'./src/__tests__/integration/helpers',
'./src/__tests__/integration/test-data',
],
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"dependencies": {
"@commitlint/cli": "^18.6.0",
"@commitlint/config-conventional": "^18.6.0",
"@grnsft/if-core": "^0.0.3",
"@grnsft/if-core": "^0.0.7",
"axios": "^1.7.2",
"csv-parse": "^5.5.6",
"csv-stringify": "^6.4.6",
Expand Down
2 changes: 1 addition & 1 deletion src/__mocks__/plugin/lib/mockavizta/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {PluginParams} from '../../../../types/interface';
import {PluginParams} from '@grnsft/if-core/types';

/**
* Mock model for testing.
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/unit/builtins/CommonGenerator.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ERRORS} from '@grnsft/if-core';
import {ERRORS} from '@grnsft/if-core/utils';

import {CommonGenerator} from '../../../builtins/mock-observations/helpers/common-generator';

Expand Down
6 changes: 2 additions & 4 deletions src/__tests__/unit/builtins/RandIntGenerator.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import {ERRORS} from '@grnsft/if-core';
import {ERRORS} from '@grnsft/if-core/utils';

import {RandIntGenerator} from '../../../builtins/mock-observations/helpers/rand-int-generator';

import {STRINGS} from '../../../config';

import {KeyValuePair} from '../../../types/common';

const {GlobalConfigError} = ERRORS;
const {INVALID_NAME, MISSING_MIN_MAX, MISSING_GLOBAL_CONFIG} = STRINGS;

Expand Down Expand Up @@ -44,7 +42,7 @@ describe('builtins/mock-observations/RandIntGenerator: ', () => {

describe('next(): ', () => {
it('returns a result with valid data.', async () => {
const config: KeyValuePair = {
const config: Record<string, any> = {
min: 10,
max: 90,
};
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/unit/builtins/coefficient.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ERRORS} from '@grnsft/if-core';
import {ERRORS} from '@grnsft/if-core/utils';

import {Coefficient} from '../../../builtins/coefficient';

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/unit/builtins/csv-lookup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ jest.mock('fs/promises', () => require('../../../__mocks__/fs'));

import axios from 'axios';
import AxiosMockAdapter from 'axios-mock-adapter';
import {ERRORS} from '@grnsft/if-core';
import {ERRORS} from '@grnsft/if-core/utils';

import {CSVLookup} from '../../../builtins';

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/unit/builtins/divide.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ERRORS} from '@grnsft/if-core';
import {ERRORS} from '@grnsft/if-core/utils';

import {Divide} from '../../../builtins';

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/unit/builtins/exponent.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ERRORS} from '@grnsft/if-core';
import {ERRORS} from '@grnsft/if-core/utils';

import {Exponent} from '../../../builtins/exponent';

Expand Down
3 changes: 2 additions & 1 deletion src/__tests__/unit/builtins/export-csv-raw.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as fs from 'fs/promises';

import {jest} from '@jest/globals';
import {ERRORS} from '@grnsft/if-core';
import {ERRORS} from '@grnsft/if-core/utils';

import {ExportCSVRaw} from '../../../builtins/export-csv-raw';

Expand Down
3 changes: 2 additions & 1 deletion src/__tests__/unit/builtins/export-csv.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import * as fs from 'fs/promises';

import {stringify} from 'csv-stringify/sync';
import {jest} from '@jest/globals';
import {ERRORS} from '@grnsft/if-core';
import {ERRORS} from '@grnsft/if-core/utils';

import {ExportCSV} from '../../../builtins/export-csv';

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/unit/builtins/export-yaml.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ERRORS} from '@grnsft/if-core';
import {ERRORS} from '@grnsft/if-core/utils';

import {ExportYaml} from '../../../builtins/export-yaml';
import {saveYamlFileAs} from '../../../util/yaml';
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/unit/builtins/group-by.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ERRORS} from '@grnsft/if-core';
import {ERRORS} from '@grnsft/if-core/utils';

import {GroupBy} from '../../../builtins/group-by';

Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/unit/builtins/interpolation.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {ERRORS} from '@grnsft/if-core';
import {ERRORS} from '@grnsft/if-core/utils';
import {Method} from '@grnsft/if-core/types';

import {Interpolation} from '../../../builtins';

import {Method} from '../../../builtins/interpolation/types';
import {STRINGS} from '../../../config';

const {InputValidationError, GlobalConfigError} = ERRORS;
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/unit/builtins/mock-observations.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ERRORS} from '@grnsft/if-core';
import {ERRORS} from '@grnsft/if-core/utils';

import {MockObservations} from '../../../builtins/mock-observations';

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/unit/builtins/multiply.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ERRORS} from '@grnsft/if-core';
import {ERRORS} from '@grnsft/if-core/utils';

import {Multiply} from '../../../builtins/multiply';

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/unit/builtins/regex.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ERRORS} from '@grnsft/if-core';
import {ERRORS} from '@grnsft/if-core/utils';

import {Regex} from '../../../builtins/regex';

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/unit/builtins/sci-embodied.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ERRORS} from '@grnsft/if-core';
import {ERRORS} from '@grnsft/if-core/utils';

import {SciEmbodied} from '../../../builtins/sci-embodied';

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/unit/builtins/sci.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ERRORS} from '@grnsft/if-core';
import {ERRORS} from '@grnsft/if-core/utils';

import {Sci} from '../../../builtins/sci';

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/unit/builtins/shell.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {spawnSync} from 'child_process';
import {loadAll} from 'js-yaml';
import {ERRORS} from '@grnsft/if-core';
import {ERRORS} from '@grnsft/if-core/utils';

import {Shell} from '../../../builtins/shell';

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/unit/builtins/subtract.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ERRORS} from '@grnsft/if-core';
import {ERRORS} from '@grnsft/if-core/utils';

import {Subtract} from '../../../builtins/subtract';

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/unit/builtins/sum.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ERRORS} from '@grnsft/if-core';
import {ERRORS} from '@grnsft/if-core/utils';

import {Sum} from '../../../builtins/sum';

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/unit/builtins/time-sync.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ERRORS} from '@grnsft/if-core';
import {ERRORS} from '@grnsft/if-core/utils';
import {Settings, DateTime} from 'luxon';

import {TimeSync} from '../../../builtins/time-sync';
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/unit/lib/exhaust.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
jest.mock('fs', () => require('../../../__mocks__/fs'));

import {ERRORS} from '@grnsft/if-core';
import {ERRORS} from '@grnsft/if-core/utils';

import {exhaust} from '../../../lib/exhaust';

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/unit/lib/initialize.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jest.mock('../../../util/log-memoize', () => ({
memoizedLog: mockLog,
}));

import {ERRORS} from '@grnsft/if-core';
import {ERRORS} from '@grnsft/if-core/utils';

import {initialize} from '../../../lib/initialize';

Expand Down
8 changes: 4 additions & 4 deletions src/__tests__/unit/lib/load.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ jest.mock('../../../util/yaml', () => ({
},
}));

import {load, loadIfDiffFiles} from '../../../lib/load';
import {PluginParams} from '@grnsft/if-core/types';

import {PARAMETERS} from '../../../config';
import {load, loadIfDiffFiles} from '../../../lib/load';

import {PluginParams} from '../../../types/interface';
import {PARAMETERS, STRINGS} from '../../../config';

import {STRINGS} from '../../../config';
import {parseManifestFromStdin} from '../../../util/helpers';

import {LoadDiffParams} from '../../../types/util/args';

const {INVALID_SOURCE} = STRINGS;
Expand Down
48 changes: 0 additions & 48 deletions src/__tests__/unit/lib/manifest/basic.ts

This file was deleted.

Loading