Skip to content

Commit

Permalink
teraslice esm migration (#3511)
Browse files Browse the repository at this point in the history
- Migrate Teraslice to use ESM modules natively
- Remove built in processors, these are moved to Standard Assets

Issues:

- eslint needs to be updated to be able to correctly parse typescripte
>5.2. It throws warning
- eslint is having a problem linting an esm module based package. The
primary issue is that this is a monorepo with several packages and we
are slowly converting code over. For now I am ignoring linting on
teraslice until I can figure out a way to do it independently for each
package, assuming its worth the dev effort.
- using `@swc/jest` for typescript compiling for jest testing is causing
errors with class decorators, so I am keeping ts-jest for the rest of
the tests and using the new one until it can be properly configured
  • Loading branch information
jsnoble authored Jan 23, 2024
1 parent 537a65b commit c1358e8
Show file tree
Hide file tree
Showing 100 changed files with 1,034 additions and 1,591 deletions.
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"extends": "@terascope",
"rules": {
"@typescript-eslint/naming-convention": "off"
}
},
"ignorePatterns":["packages/teraslice"]
}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ COPY service.js /app/source/
RUN node -e "require('node-rdkafka')"

# verify teraslice is installed right
RUN node -e "require('teraslice')"
RUN node -e "import('teraslice')"

EXPOSE 5678

Expand Down
26 changes: 26 additions & 0 deletions e2e/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,30 @@ const config = require('../jest.config.base')(__dirname);
config.testPathIgnorePatterns = process.env.TEST_PLATFORM === 'kubernetes' ? ['data/recovery-spec', 'cluster/worker-allocation-spec', 'cluster/state-spec'] : [];
config.collectCoverage = false;
delete config.transform;
// config.moduleNameMapper = {
// '^(\\.{1,2}/.*)\\.js$': '$1',
// };
config.transform = {};
// config.transformIgnorePatterns = [];
// config.transform['^.+\\.(t|j)sx?$'] = ['@swc/jest', {
// jsc: {
// loose: true,
// parser: {
// syntax: 'typescript',
// tsx: false,
// decorators: true
// },
// transform: {
// legacyDecorator: true,
// decoratorMetadata: true
// },
// target: 'es2022'
// },
// module: {
// type: 'commonjs',
// strictMode: false,
// noInterop: false
// }
// }];

module.exports = config;
Loading

0 comments on commit c1358e8

Please sign in to comment.