Skip to content

Commit

Permalink
Revert "Merge pull request #18 from alexrecuenco/esm"
Browse files Browse the repository at this point in the history
This reverts commit d7d3eb8, reversing
changes made to c741d7e.
  • Loading branch information
alexrecuenco committed Sep 22, 2024
1 parent d7d3eb8 commit f99082a
Show file tree
Hide file tree
Showing 24 changed files with 54 additions and 930 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/setup-python@v4
with:
# python-version: '3.12'
cache: 'pip'
- uses: pre-commit/[email protected]

Expand All @@ -24,7 +23,7 @@ jobs:

strategy:
matrix:
node-version: [20.x, 22.x]
node-version: [18.x, 20.x]

steps:
- uses: actions/checkout@v4
Expand All @@ -39,5 +38,3 @@ jobs:
- run: npm run format
- run: npm run build:debug
- run: npm run build:prod
- run: npm run check:esmloads
- run: npm run check:cjsloads
7 changes: 0 additions & 7 deletions .npmignore

This file was deleted.

16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repos: #The order matters, we want prospector to run after all the sorting was d
- id: check-json
# JSON that are not json
# (?x) means verbose (we can add spaces for better readibility, but they are ignored)
exclude: (?x) /?(tsconfig(\.\w+)? | \.vscode/.*) \.json$
exclude: (?x) ^(tsconfig(\.\w+)? | \.vscode/.*) \.json$
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
Expand All @@ -19,10 +19,10 @@ repos: #The order matters, we want prospector to run after all the sorting was d
# File normalization
- id: end-of-file-fixer
- id: trailing-whitespace
# - repo: https://github.com/pre-commit/mirrors-prettier
# rev: 'v3.1.0'
# hooks:
# - id: prettier
# additional_dependencies:
# - [email protected]
# - [email protected]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: 'v3.1.0'
hooks:
- id: prettier
additional_dependencies:
- [email protected]
- [email protected]
4 changes: 1 addition & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@
},
"editor.formatOnSaveMode": "modificationsIfAvailable",
"[javascript,typescript,jsonc,json]": {
"editor.indentSize": "tabSize",
"editor.tabSize": 2,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSaveMode": "modificationsIfAvailable",
},
"eslint.useFlatConfig": true,
"eslint.experimental.useFlatConfig": true,
"jest.jestCommandLine": "npm test -- ",
"jest.runMode": {
"type": "on-demand",
Expand Down
2 changes: 1 addition & 1 deletion __tests__/replace.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fc, { Arbitrary } from 'fast-check';
import { replace } from '../src/replacer.js';
import { replace } from '../src';

const EachSimpleType = [
['string', fc.string()],
Expand Down
21 changes: 0 additions & 21 deletions __tests__/server.test.ts

This file was deleted.

19 changes: 0 additions & 19 deletions __tests__/tsconfig.json

This file was deleted.

2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default [
project: [
'./tsconfig.eslint.json',
'./tsconfig.json',
'./tsconfig.node.json',
'./tsconfig.prod.json',
],
},
},
Expand Down
36 changes: 4 additions & 32 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,43 +1,15 @@
import {
createDefaultEsmPreset,
pathsToModuleNameMapper,
type JestConfigWithTsJest,
} from 'ts-jest';

import { compilerOptions } from './tsconfig.aliases.json';
import packageJson from './package.json';

const pathAliases = {
...compilerOptions.paths,
// Jest wants to know the folder to do the transformation, not the `src/index.js`. 🤷
[packageJson.name]: ['src'],
};

// See here for more info https://kulshekhar.github.io/ts-jest/docs/getting-started/presets/#advanced
const preset = createDefaultEsmPreset({
tsconfig: './__tests__/tsconfig.json',
});
import type { JestConfigWithTsJest } from 'ts-jest';

const config: JestConfigWithTsJest = {
...preset,
roots: ['<rootDir>'],
modulePaths: [compilerOptions.baseUrl],
moduleNameMapper: pathsToModuleNameMapper(pathAliases, {
useESM: true,
}),
modulePathIgnorePatterns: ['<rootDir>/dist/', '<rootDir>/build/'],
preset: 'ts-jest',
testRegex: [
'/tests/.*tests?.[jt]sx?',
'/__tests__/.*tests?.[jt]sx?',
'.*.(spec|test).[jt]sx?',
],
// I dono't think we need to run the spec multiple times.. the functional test on tests/ maybe.
// We can change this back if we consider it useful to run the spec tests when the code is transpiled to javascript
testPathIgnorePatterns: [
'node_modules',
'<rootDir>/build/',
'<rootDir>/dist/',
],
// We can change this if we consider it useful to run the spec tests when the code is transpiled to javascript
testPathIgnorePatterns: ['node_modules', 'build/'],
testEnvironment: 'node',
collectCoverageFrom: ['src/**/*.{js,ts,jsx,tsx}'],
verbose: true,
Expand Down
Loading

0 comments on commit f99082a

Please sign in to comment.