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
7 changes: 0 additions & 7 deletions .eslintignore

This file was deleted.

31 changes: 0 additions & 31 deletions .eslintrc.js

This file was deleted.

2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
cache: 'yarn'
- name: 🚚 Install dependencies
run: yarn install
env:
YARN_ENABLE_SCRIPTS: true
# Build must run before tests: @mifiel/api-client resolves @mifiel/api-client-auth types from dist.
- name: 👷 Build packages
run: yarn build
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
scope: '@mifiel'
- name: 🚚 Install dependencies
run: yarn install
env:
YARN_ENABLE_SCRIPTS: true
- name: 👷 Build packages
run: yarn build
- name: 🔖 Release New Version
Expand Down
3 changes: 0 additions & 3 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commitlint --edit $1
5 changes: 1 addition & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged $1
yarn lint-staged
7 changes: 7 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
approvedGitRepositories: []

enableScripts: false

nodeLinker: node-modules

npmMinimalAgeGate: 7
4 changes: 2 additions & 2 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const {
utils: { getPackages },
} = require('@commitlint/config-lerna-scopes');
} = require('@commitlint/config-workspace-scopes').default;

module.exports = {
extends: [
'@commitlint/config-conventional',
'@commitlint/config-lerna-scopes',
'@commitlint/config-workspace-scopes',
],
rules: {
'scope-enum': async (ctx) => [
Expand Down
124 changes: 124 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
const globals = require('globals');
const eslintPluginImport = require('eslint-plugin-import');
const eslintPluginPrettier = require('eslint-plugin-prettier');
const eslintConfigPrettier = require('eslint-config-prettier');
const tseslint = require('typescript-eslint');

const typeCheckedParserOptions = {
projectService: true,
tsconfigRootDir: __dirname,
};

const widgetReactRules = {
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/dot-notation': 'error',
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
'@typescript-eslint/no-useless-constructor': 'off',
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: true,
},
],
'@typescript-eslint/no-use-before-define': 'off',
'no-param-reassign': 'off',
'default-case': 'off',
'no-underscore-dangle': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'prefer-rest-params': 'off',
'no-plusplus': 'off',
'@typescript-eslint/no-shadow': 'off',
'no-restricted-syntax': 'off',
'guard-for-in': 'off',
'no-prototype-builtins': 'off',
'symbol-description': 'off',
};

const sharedRules = {
'no-console': 'warn',
'import/prefer-default-export': 'off',
'no-underscore-dangle': ['error', { allowAfterThis: true }],
'prettier/prettier': 'error',
'no-await-in-loop': 'off',
'class-methods-use-this': 'off',
};

const sharedLanguageOptions = {
ecmaVersion: 2021,
sourceType: 'module',
globals: {
...globals.browser,
...globals.node,
...globals.jest,
},
};

module.exports = tseslint.config(
{
ignores: [
'**/node_modules/**',
'**/dist/**',
'**/coverage/**',
'**/*.config.js',
'packages/widget-angular/src/lib/stencil-generated/**',
'packages/widget-react/lib/components/stencil-generated/react-component-lib/**',
],
},
eslintConfigPrettier,
...tseslint.configs.recommendedTypeChecked,
{
files: ['**/*.{ts,tsx,js,jsx}'],
plugins: {
import: eslintPluginImport,
prettier: eslintPluginPrettier,
},
languageOptions: {
...sharedLanguageOptions,
parserOptions: typeCheckedParserOptions,
},
rules: {
...sharedRules,
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-wrapper-object-types': 'off',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/only-throw-error': 'off',
'@typescript-eslint/no-base-to-string': 'off',
},
},
{
files: [
'packages/widget-react/**/*.{ts,tsx,js,jsx}',
'packages/widget-vue/**/*.{ts,tsx,js,jsx}',
'packages/widget-stencil/**/*.{ts,tsx,js,jsx}',
],
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
rules: widgetReactRules,
},
{
files: ['packages/widget-angular/**/*.{ts,tsx,js,jsx}'],
rules: {
'no-underscore-dangle': 'off',
},
},
);
3 changes: 3 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[tools]
node = "22"
yarn = "4"
41 changes: 21 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"packages/*"
],
"scripts": {
"build": "lerna run build --scope=@mifiel/{api-client,api-client-auth} && yarn build:widget",
"build:widget": "lerna run build --scope=@mifiel/widget && lerna run build --scope=@mifiel/{widget-react,widget-vue,widget-angular}",
"build": "lerna run build --scope=@mifiel/api-client --scope=@mifiel/api-client-auth && yarn build:widget",
"build:widget": "lerna run build --scope=@mifiel/widget && lerna run build --scope=@mifiel/widget-react --scope=@mifiel/widget-vue --scope=@mifiel/widget-angular",
"husky": "husky",
"lint": "lerna run lint",
"postpublish": "pinst --enable",
Expand All @@ -28,28 +28,29 @@
"test": "lerna run test"
},
"devDependencies": {
"@angular/compiler": "^19.2.22",
"@angular/core": "^19.2.22",
"@commitlint/cli": "13.1.0",
"@commitlint/config-conventional": "13.1.0",
"@commitlint/config-lerna-scopes": "13.1.0",
"@types/jest": "^29.5.14",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"esbuild": "0.25.0",
"eslint": "^8.57.0",
"eslint-config-airbnb-typescript": "18.0.0",
"eslint-config-prettier": "^9.1.0",
"@angular/compiler": "^21.2.15",
"@angular/core": "^21.2.15",
"@commitlint/cli": "21.0.2",
"@commitlint/config-conventional": "21.0.2",
"@commitlint/config-workspace-scopes": "21.0.2",
"@types/jest": "^30.0.0",
"esbuild": "0.28.0",
"eslint": "^10.4.1",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.2.1",
"format-package": "6.1.0",
"husky": "7.0.1",
"jest": "^29.7.0",
"format-package": "7.0.0",
"globals": "^17.6.0",
"husky": "9.1.7",
"jest": "^30.4.2",
"lerna": "9.0.7",
"lint-staged": "11.1.2",
"pinst": "2.1.6",
"lint-staged": "17.0.7",
"pinst": "3.0.0",
"prettier": "^3.3.3",
"rimraf": "^6.0.1",
"rxjs": "~7.8.1",
"ts-jest": "^29.2.5",
"typescript": "~5.7.3"
"typescript": "~6.0.3",
"typescript-eslint": "^8.60.1"
Comment on lines +45 to +54

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

For ts-jest 29.2.5, what Jest major versions and TypeScript versions are officially supported? Does it support Jest 30.x and TypeScript 6.0.x?

💡 Result:

For ts-jest version 29.2.5, the supported versions are as follows: Jest: Officially, ts-jest 29.2.5 requires Jest 29 [1]. It does not officially support Jest 30.x. Support for Jest 30 was introduced in later versions of ts-jest (starting with version 29.4.0) [2][3]. TypeScript: The ts-jest 29.x line generally supports TypeScript versions >=4.3 and <7 [2]. Specifically, version 29.2.5 was tested against various 5.x releases, including 5.4 and 5.5 [4][5]. It does not have explicit official support for TypeScript 6.0.x, as that version was not available at the time of its release. In summary, ts-jest 29.2.5 is designed for the Jest 29 ecosystem and does not officially support Jest 30.x or TypeScript 6.0.x [1][2]. Users requiring support for newer major versions should upgrade to a later version of ts-jest [2][3].

Citations:


🌐 Web query:

ts-jest 29.2.5 TypeScript 6.0 compatibility officially supported

💡 Result:

As of June 3, 2026, ts-jest version 29.2.5 does not officially support TypeScript 6.0. While ts-jest has added support for TypeScript 6.0 in its repository [1][2], this support is not included in version 29.2.5, which was published on August 23, 2024 [3][4], well before the release of TypeScript 6.0 in March 2026 [5][6]. The official peer dependency requirement for ts-jest version 29.2.5 specifies typescript as >=4.3 <6 [7]. To gain support for TypeScript 6.0, you must update to a later version of ts-jest that includes the necessary compatibility changes (e.g., commit eda517d [1] and subsequent patches [2]).

Citations:


🌐 Web query:

ts-jest Jest 30 support introduced in which version (e.g., 29.4.0) and official statement

💡 Result:

Support for Jest 30 was introduced in ts-jest version 29.4.0, which was released on June 11, 2025 [1]. The official statement and technical details regarding this support were documented in the project's CHANGELOG [1] and accompanying pull request [2]. The release updated peer dependencies to allow compatibility with Jest 30 while maintaining support for Jest 29 [1][2][3]. The project maintainers noted that because Jest 30 did not fundamentally impact the existing ts-jest codebase, they were able to support both major versions of Jest within the 29.x release line [2].

Citations:


Bump ts-jest—ts-jest@29.2.5 isn’t officially compatible with Jest 30 + TypeScript 6
ts-jest 29.2.5 requires typescript >=4.3 <6 and Jest 30 support was added later (starting in ts-jest@29.4.0). With jest@^30.4.2 and typescript@~6.0.3, this combo is outside official support and can break test transforms in CI. Update ts-jest to a version that supports both (or pin Jest/TypeScript to supported ranges).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@package.json` around lines 45 - 54, The ts-jest devDependency is pinned to
29.2.5 which does not support Jest 30 + TypeScript 6; update the ts-jest entry
in package.json (the "ts-jest" dependency) to a version that officially supports
Jest 30 and TS6 (e.g., bump to >=29.4.0) or alternatively align Jest/TypeScript
to a supported range; then run install and verify tests/CI transforms to ensure
the new ts-jest version works with the existing jest and typescript versions.

}
}
1 change: 0 additions & 1 deletion packages/api-client-auth/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ const packageJson = require('./package.json');

module.exports = {
...base,
name: packageJson.name,
displayName: packageJson.name,
};
7 changes: 3 additions & 4 deletions packages/api-client-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@
"build:cjs": "tsc -p ./tsconfig.prod.json",
"build:esm": "node esbuild.config",
"check-types": "tsc --noemit",
"eslint": "eslint src --ext .ts",
"eslint": "eslint src",
"lint": "yarn eslint && yarn check-types",
"test": "jest"
},
"types": "dist/types/src/main.d.ts",
"dependencies": {
"axios": "1.16.0",
"os-name": "4.0.1",
"zod": "^3.24.2"
"axios": "1.16.1",
"zod": "^4.4.3"
},
"devDependencies": {
"axios-mock-adapter": "2.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/api-client-auth/src/Config/Config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('Config', () => {
];

wrongParams.forEach((params: any) => {
expect(() => Config.setTokens(params)).toThrowError();
expect(() => Config.setTokens(params)).toThrow();
});
});
});
9 changes: 3 additions & 6 deletions packages/api-client-auth/src/Service/Service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import MockAdapter from 'axios-mock-adapter';

import { Config } from '../Config';
import * as pckg from '../../package.json';

import { Service } from './Service';

Expand Down Expand Up @@ -52,12 +53,8 @@ describe('Service', () => {
const [nodeVersion, vendorVersion, axiosVersion] = versions;

expect(nodeVersion).toBe(`NODE/${process.versions.node}`);
expect(vendorVersion).toBe(
`@mifiel/api-client-auth/${process.env.npm_package_version}`
);
expect(axiosVersion).toBe(
`axios/${process.env.npm_package_dependencies_axios}`
);
expect(vendorVersion).toBe(`@mifiel/api-client-auth/${pckg.version}`);
expect(axiosVersion).toBe(`axios/${pckg.dependencies.axios}`);
});
});
});
Expand Down
1 change: 0 additions & 1 deletion packages/api-client-auth/src/Service/Service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export class Service {
const dataObject =
data !== null && typeof data === 'object' ? data : {};
// API consumers expect a plain error-shaped object (legacy contract).
// eslint-disable-next-line @typescript-eslint/no-throw-literal -- preserve thrown payload shape
throw {
status_code: status,
status_message: statusText,
Expand Down
9 changes: 7 additions & 2 deletions packages/api-client-auth/src/headers/headers.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import os from 'os';
import osName from 'os-name';
import * as pckg from '../../package.json';

const platformNames: Record<string, string> = {
darwin: 'macOS',
win32: 'Windows',
linux: 'Linux',
};

const nodeVersion = `NODE/${process.versions.node}`;
const libraryVersion = `${pckg.name}/${pckg.version}`;
const axiosVersion = `axios/${pckg.dependencies.axios}`;
const osVersion = `(${osName()}/${os.release()})`;
const osVersion = `(${platformNames[os.platform()] ?? os.platform()}/${os.release()})`;

export const headers = {
'MI-ERROR-FORMAT': 'verbose',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('HMAC Authentication Interceptor', () => {
it('throws error if tokens were not setted', async () => {
Config.setTokens({ appId: '', appSecret: '' });

await expect(doEndpoint()).rejects.toThrowError();
await expect(doEndpoint()).rejects.toThrow();
});

it('sends custom headers', async () => {
Expand Down
1 change: 0 additions & 1 deletion packages/api-client-auth/tsconfig.prod.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"baseUrl": "src",
"rootDir": ".",
"outDir": "dist/cjs",
"declarationDir": "dist/types"
Expand Down
1 change: 0 additions & 1 deletion packages/api-client/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ const packageJson = require('./package.json');

module.exports = {
...base,
name: packageJson.name,
displayName: packageJson.name,
};
Loading