Skip to content

Commit ab0ac09

Browse files
authored
Merge pull request #247 from Roaders/main
update hygiene / move to ESM
2 parents 0e5aa73 + b8d75a4 commit ab0ac09

39 files changed

+13636
-8414
lines changed

.eslintrc.js

Lines changed: 0 additions & 37 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ jobs:
2626
with:
2727
node-version: ${{ matrix.node-version }}
2828
- run: npm ci
29-
- run: npm run build-release
29+
- run: npm run build:release

.github/workflows/create-release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
registry-url: https://registry.npmjs.org/
2525

2626
- name: Install node modules and verify build
27-
run: npm ci && npm run build-release
27+
run: npm ci && npm run build:release
2828

2929
- name: Publish
3030
run: npm publish --provenance --access public

.github/workflows/test-jasmine.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
strategy:
1919
matrix:
20-
jasmine-version: [2.x, 3.x, 4.x, 5.x]
20+
jasmine-version: [2.x, 3.x, 4.x, 5.x, 6.x]
2121

2222
steps:
2323
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

.github/workflows/test-jest.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,18 @@ jobs:
1717

1818
strategy:
1919
matrix:
20-
jest-version: [26.x, 27.x, 28.x, 29.x]
20+
jest-version: [26.x, 27.x, 28.x, 29.x, 30.x]
21+
include:
22+
- jest-version: 26.x
23+
ts-jest-version: 26.x
24+
- jest-version: 27.x
25+
ts-jest-version: 27.x
26+
- jest-version: 28.x
27+
ts-jest-version: 28.x
28+
- jest-version: 29.x
29+
ts-jest-version: 29.x
30+
- jest-version: 30.x
31+
ts-jest-version: 29.x
2132

2233
steps:
2334
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -26,5 +37,5 @@ jobs:
2637
with:
2738
node-version: 22.x
2839
- run: npm ci
29-
- run: npm install jest@${{ matrix.jest-version }} ts-jest@${{ matrix.jest-version }} @types/jest@${{ matrix.jest-version }} --legacy-peer-deps
40+
- run: npm install jest@${{ matrix.jest-version }} ts-jest@${{ matrix.ts-jest-version }} @types/jest@${{ matrix.jest-version }} --legacy-peer-deps
3041
- run: npm run test:jest

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Changelog
2+
3+
## [2.0.0]
4+
5+
### Breaking Changes
6+
7+
- **Removed module replacement functionality** — The following exports have been removed:
8+
- `proxyModule`, `registerMock`, `reset`, `isWrappedModule`, `WrappedModule`
9+
- `proxyJestModule`
10+
- `replaceProperties`, `replacePropertiesBeforeEach`, `mockImports`, `mockImportsBeforeEach`, `IImportReplacement`
11+
- Framework specific module replacement functionality should be used instead such as `vi.mock`
12+
- **Removed `uuid` dependency** — No longer a runtime dependency.
13+
- **Package is now ESM** — Added `"type": "module"` to package.json. TypeScript `module` changed from `commonjs` to `nodenext`.
14+
15+
### Changed
16+
17+
- Migrated to ESM — all internal imports now use `.js` extensions, `moduleResolution` set to `nodenext`.
18+
19+
### Dependencies
20+
21+
- Removed `uuid` from production dependencies.

eslint.config.mjs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import eslint from '@eslint/js';
2+
import tseslint from 'typescript-eslint';
3+
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
4+
5+
export default tseslint.config(
6+
{
7+
ignores: ['dist/', 'reports/', 'docs/'],
8+
},
9+
eslint.configs.recommended,
10+
...tseslint.configs.recommended,
11+
eslintPluginPrettierRecommended,
12+
{
13+
rules: {
14+
'prettier/prettier': [
15+
'error',
16+
{ trailingComma: 'all', tabWidth: 4, singleQuote: true, printWidth: 120, endOfLine: 'auto' },
17+
],
18+
'@typescript-eslint/explicit-module-boundary-types': 'off',
19+
'@typescript-eslint/no-explicit-any': 'off',
20+
'@typescript-eslint/no-unused-vars': 'off',
21+
'@typescript-eslint/no-this-alias': 'off',
22+
'@typescript-eslint/no-unsafe-function-type': 'off',
23+
'@typescript-eslint/no-empty-object-type': 'off',
24+
},
25+
},
26+
{
27+
files: ['**/*.cjs'],
28+
languageOptions: {
29+
sourceType: 'commonjs',
30+
globals: {
31+
require: 'readonly',
32+
module: 'readonly',
33+
process: 'readonly',
34+
console: 'readonly',
35+
__dirname: 'readonly',
36+
},
37+
},
38+
rules: {
39+
'@typescript-eslint/no-require-imports': 'off',
40+
},
41+
},
42+
);
File renamed without changes.

karma.conf.js renamed to karma.conf.cjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const path = require('path');
22
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
3-
const baseConfig = require('./karma.base.conf.js');
3+
const baseConfig = require('./karma.base.conf.cjs');
44
const CircularDependencyPlugin = require('circular-dependency-plugin');
55

66
const testEntryFile = 'spec/test.ts';
@@ -68,6 +68,9 @@ module.exports = function (config) {
6868
module: { rules },
6969
resolve: {
7070
extensions: ['.ts', '.js'],
71+
extensionAlias: {
72+
'.js': ['.ts', '.js'],
73+
},
7174
plugins: [new TsconfigPathsPlugin({ configFile })], // Supports non standard base url for absolute imports
7275
},
7376
mode: 'development',

main/helper/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
export * from './property-replacement-helper';
2-
export * from './module-helper';
3-
export * from './jest-helper';
4-
export * from './lookup-helper';
1+
export * from './jest-helper.js';
2+
export * from './lookup-helper.js';

0 commit comments

Comments
 (0)