Skip to content

Commit

Permalink
feat: ESM migration of got-scraping (#109)
Browse files Browse the repository at this point in the history
Closes #90 
Closes #106 
Closes #108 
Closes #105 

BREAKING CHANGE
This package is now ESM only, as such, it cannot be required from inside
a CJS project, use dynamic import instead.
  • Loading branch information
vladfrangu authored Oct 2, 2023
1 parent 464632e commit 35f1920
Show file tree
Hide file tree
Showing 35 changed files with 9,554 additions and 192 deletions.
19 changes: 12 additions & 7 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
{
"extends": [
"@apify/ts"
],
"parserOptions": {
"project": "tsconfig.eslint.json"
}
}
"extends": [
"@apify/ts"
],
"parserOptions": {
"project": "tsconfig.eslint.json",
"ecmaVersion": 2022
},
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"no-void": "off"
}
}
6 changes: 3 additions & 3 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [15, 16, 18, 20]
node-version: [18, 20]

steps:
-
Expand All @@ -42,10 +42,10 @@ jobs:
-
uses: actions/checkout@v3
-
name: Use Node.js 16
name: Use Node.js 20
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
-
run: npm install
-
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [15, 16, 18, 20]
node-version: [18, 20]

steps:
-
Expand All @@ -45,10 +45,10 @@ jobs:
-
uses: actions/checkout@v3
-
name: Use Node.js 16
name: Use Node.js 20
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
-
run: npm install
-
Expand All @@ -67,7 +67,7 @@ jobs:
-
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
registry-url: https://registry.npmjs.org/
-
# Determine if this is a beta or latest release
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ dist
.idea
node_modules
coverage
package-lock.json
31 changes: 31 additions & 0 deletions jest.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
const jestConfig = {
verbose: true,
preset: 'ts-jest/presets/default-esm',
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
transform: {
// '^.+\\.[tj]sx?$' to process js/ts with `ts-jest`
// '^.+\\.m?[tj]sx?$' to process js/ts/mjs/mts with `ts-jest`
'^.+\\.tsx?$': [
'ts-jest',
{
useESM: true,
tsconfig: '<rootDir>/test/tsconfig.json',
},
],
},
testEnvironment: 'node',
testRunner: 'jest-circus/runner',
testTimeout: 40_000,
collectCoverage: true,
collectCoverageFrom: [
'**/src/**/*.ts',
'**/src/**/*.js',
'!**/node_modules/**',
],
maxWorkers: 3,
};

export default jestConfig;
21 changes: 0 additions & 21 deletions jest.config.ts

This file was deleted.

Loading

0 comments on commit 35f1920

Please sign in to comment.