Skip to content

Commit f99082a

Browse files
committed
Revert "Merge pull request #18 from alexrecuenco/esm"
This reverts commit d7d3eb8, reversing changes made to c741d7e.
1 parent d7d3eb8 commit f99082a

24 files changed

+54
-930
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v4
16-
- uses: actions/setup-python@v5
16+
- uses: actions/setup-python@v4
1717
with:
18-
# python-version: '3.12'
1918
cache: 'pip'
2019
- uses: pre-commit/action@v3.0.1
2120

@@ -24,7 +23,7 @@ jobs:
2423

2524
strategy:
2625
matrix:
27-
node-version: [20.x, 22.x]
26+
node-version: [18.x, 20.x]
2827

2928
steps:
3029
- uses: actions/checkout@v4
@@ -39,5 +38,3 @@ jobs:
3938
- run: npm run format
4039
- run: npm run build:debug
4140
- run: npm run build:prod
42-
- run: npm run check:esmloads
43-
- run: npm run check:cjsloads

.npmignore

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

.pre-commit-config.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repos: #The order matters, we want prospector to run after all the sorting was d
88
- id: check-json
99
# JSON that are not json
1010
# (?x) means verbose (we can add spaces for better readibility, but they are ignored)
11-
exclude: (?x) /?(tsconfig(\.\w+)? | \.vscode/.*) \.json$
11+
exclude: (?x) ^(tsconfig(\.\w+)? | \.vscode/.*) \.json$
1212
- id: check-merge-conflict
1313
- id: check-symlinks
1414
- id: check-toml
@@ -19,10 +19,10 @@ repos: #The order matters, we want prospector to run after all the sorting was d
1919
# File normalization
2020
- id: end-of-file-fixer
2121
- id: trailing-whitespace
22-
# - repo: https://github.com/pre-commit/mirrors-prettier
23-
# rev: 'v3.1.0'
24-
# hooks:
25-
# - id: prettier
26-
# additional_dependencies:
27-
# - prettier@3.2.5
28-
# - prettier-plugin-jsdoc@1.3.0
22+
- repo: https://github.com/pre-commit/mirrors-prettier
23+
rev: 'v3.1.0'
24+
hooks:
25+
- id: prettier
26+
additional_dependencies:
27+
- prettier@3.2.5
28+
- prettier-plugin-jsdoc@1.3.0

.vscode/settings.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@
77
},
88
"editor.formatOnSaveMode": "modificationsIfAvailable",
99
"[javascript,typescript,jsonc,json]": {
10-
"editor.indentSize": "tabSize",
11-
"editor.tabSize": 2,
1210
"editor.defaultFormatter": "esbenp.prettier-vscode",
1311
"editor.formatOnSaveMode": "modificationsIfAvailable",
1412
},
15-
"eslint.useFlatConfig": true,
13+
"eslint.experimental.useFlatConfig": true,
1614
"jest.jestCommandLine": "npm test -- ",
1715
"jest.runMode": {
1816
"type": "on-demand",

__tests__/replace.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import fc, { Arbitrary } from 'fast-check';
2-
import { replace } from '../src/replacer.js';
2+
import { replace } from '../src';
33

44
const EachSimpleType = [
55
['string', fc.string()],

__tests__/server.test.ts

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

__tests__/tsconfig.json

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

eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export default [
7474
project: [
7575
'./tsconfig.eslint.json',
7676
'./tsconfig.json',
77-
'./tsconfig.node.json',
77+
'./tsconfig.prod.json',
7878
],
7979
},
8080
},

jest.config.ts

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,15 @@
1-
import {
2-
createDefaultEsmPreset,
3-
pathsToModuleNameMapper,
4-
type JestConfigWithTsJest,
5-
} from 'ts-jest';
6-
7-
import { compilerOptions } from './tsconfig.aliases.json';
8-
import packageJson from './package.json';
9-
10-
const pathAliases = {
11-
...compilerOptions.paths,
12-
// Jest wants to know the folder to do the transformation, not the `src/index.js`. 🤷
13-
[packageJson.name]: ['src'],
14-
};
15-
16-
// See here for more info https://kulshekhar.github.io/ts-jest/docs/getting-started/presets/#advanced
17-
const preset = createDefaultEsmPreset({
18-
tsconfig: './__tests__/tsconfig.json',
19-
});
1+
import type { JestConfigWithTsJest } from 'ts-jest';
202

213
const config: JestConfigWithTsJest = {
22-
...preset,
23-
roots: ['<rootDir>'],
24-
modulePaths: [compilerOptions.baseUrl],
25-
moduleNameMapper: pathsToModuleNameMapper(pathAliases, {
26-
useESM: true,
27-
}),
28-
modulePathIgnorePatterns: ['<rootDir>/dist/', '<rootDir>/build/'],
4+
preset: 'ts-jest',
295
testRegex: [
306
'/tests/.*tests?.[jt]sx?',
317
'/__tests__/.*tests?.[jt]sx?',
328
'.*.(spec|test).[jt]sx?',
339
],
3410
// I dono't think we need to run the spec multiple times.. the functional test on tests/ maybe.
35-
// We can change this back if we consider it useful to run the spec tests when the code is transpiled to javascript
36-
testPathIgnorePatterns: [
37-
'node_modules',
38-
'<rootDir>/build/',
39-
'<rootDir>/dist/',
40-
],
11+
// We can change this if we consider it useful to run the spec tests when the code is transpiled to javascript
12+
testPathIgnorePatterns: ['node_modules', 'build/'],
4113
testEnvironment: 'node',
4214
collectCoverageFrom: ['src/**/*.{js,ts,jsx,tsx}'],
4315
verbose: true,

0 commit comments

Comments
 (0)