Skip to content

Commit

Permalink
Support absolute import usage from core-indexers
Browse files Browse the repository at this point in the history
  • Loading branch information
darunrs committed Aug 8, 2024
1 parent dbc3246 commit b4c0000
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
6 changes: 5 additions & 1 deletion core-indexers/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@ module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/*.test.ts'],
testTimeout: 10000
testTimeout: 10000,
moduleNameMapper: {
'^runner/(.*)$': '<rootDir>/../runner/$1', // Ensure tests can find runner imports
'^src/(.*)$': '<rootDir>/../runner/src/$1' // Ensure tests can find runner absolute imports
}
};
3 changes: 0 additions & 3 deletions core-indexers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
},
"author": "",
"license": "ISC",
"dependencies": {
"queryapi-runner": "file:../runner"
},
"devDependencies": {
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.7.0",
Expand Down
6 changes: 5 additions & 1 deletion core-indexers/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
"target": "es2018", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
"lib": ["es2021"], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
"module": "commonjs", /* Specify what module code is generated. */
"rootDir": "..",
"rootDir": "../",
"paths": {
"@queryapi-runner/*": ["../runner/*"], /* Allow imports from runner using queryapi-runner alias */
"src/*": ["../runner/src/*"] /* Allow absolute imports in runner */
},
"moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
"resolveJsonModule": true, /* Enable importing .json files. */
"allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
Expand Down
1 change: 1 addition & 0 deletions runner/src/indexer-config/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { default } from './indexer-config';
export { ProvisioningConfig, LocalIndexerConfig } from './indexer-config';
10 changes: 5 additions & 5 deletions runner/src/indexer/local-indexer/local-indexer.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import ContextBuilder, { type ContextObject } from '../context-builder';
import InMemoryDmlHandler from '../context-builder/dml-handler/in-memory-dml-handler';
import IndexerConfig from '../../indexer-config';
import { type LocalIndexerConfig } from '../../indexer-config/indexer-config';
import NoOpIndexerMeta from '../../indexer-meta/no-op-indexer-meta';
import Indexer from '../../indexer/indexer';
import LakeClient from '../../lake-client/lake-client';
import IndexerConfig from 'src/indexer-config';
import { type LocalIndexerConfig } from 'src/indexer-config';
import NoOpIndexerMeta from 'src/indexer-meta/no-op-indexer-meta';
import Indexer from 'src/indexer';
import LakeClient from 'src/lake-client/lake-client';

export default class LocalIndexer {
public readonly indexer: Indexer;
Expand Down

0 comments on commit b4c0000

Please sign in to comment.