Skip to content

Commit

Permalink
Migrate to ESM
Browse files Browse the repository at this point in the history
  • Loading branch information
msudgh committed Mar 2, 2024
1 parent cbe7f71 commit 12cd861
Show file tree
Hide file tree
Showing 5 changed files with 806 additions and 390 deletions.
23 changes: 16 additions & 7 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
// jest.config.js
export default {
testEnvironment: 'node',
roots: ['<rootDir>/test'],
transform: {
'^.+\\.ts$': 'ts-jest',
},
testRegex: '(/test/.*\\.test\\.ts)$',
moduleFileExtensions: ['ts', 'js', 'json'],
maxConcurrency: 20,
testTimeout: 600000,
coverageReporters: ['lcov', 'cobertura', 'html', 'text', 'text-summary'],
coveragePathIgnorePatterns: [
'/node_modules/',
'./test/setupEnvs.ts',
'./test/mocks',
],
maxConcurrency: 20,
testTimeout: 600000,
transform: {
'^.+\\.ts$': [
'ts-jest',
{ tsconfig: '<rootDir>/tsconfig.test.json', useESM: true },
],
},
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
extensionsToTreatAsEsm: ['.ts'],
transformIgnorePatterns: ['node_modules/(?!(globby)/)'],
setupFiles: ['<rootDir>/test-setup.js'],
}
18 changes: 11 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
"name": "sync-cloud-storage",
"version": "1.0.0-rc.3",
"license": "MIT",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"type": "module",
"main": "dist/esm/index.js",
"types": "dist/esm/index.d.ts",
"author": {
"name": "Masoud Ghorbani <contact@mgh.space>",
"url": "https://mgh.space"
Expand All @@ -25,9 +26,9 @@
"build": "rm -rf ./dist && tsc -p tsconfig.build.json",
"build:watch": "tsc -p tsconfig.build.json -w",
"build:type-check": "tsc -p tsconfig.build.json --noEmit",
"test": "jest . --verbose",
"test:watch": "jest . --watch",
"test:coverage": "jest . --no-cache --coverage",
"test": "node --trace-warnings --experimental-vm-modules 'node_modules/jest/bin/jest.js' .",
"test:watch": "node --trace-warnings --experimental-vm-modules 'node_modules/jest/bin/jest.js' . --watch",
"test:coverage": "node --trace-warnings --experimental-vm-modules 'node_modules/jest/bin/jest.js' . --no-cache --coverage",
"format": "prettier --write \"**/*.{ts,js,md,json,yaml,yml}\"",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
Expand All @@ -37,9 +38,10 @@
},
"devDependencies": {
"@faker-js/faker": "8.4.1",
"@jest/globals": "^29.7.0",
"@smithy/shared-ini-file-loader": "2.3.1",
"@types/jest": "^29.5.12",
"@types/node": "20.11.17",
"@types/node": "20.11.20",
"@types/serverless": "3.12.22",
"@typescript-eslint/eslint-plugin": "6.21.0",
"@typescript-eslint/parser": "6.21.0",
Expand All @@ -51,7 +53,7 @@
"http-server": "14.1.1",
"husky": "9.0.10",
"is-ci": "3.0.1",
"jest": "29.7.0",
"jest": "v30.0.0-alpha.3",
"jest-mock-extended": "3.0.5",
"jsdoc": "4.0.2",
"prettier": "3.2.5",
Expand All @@ -62,6 +64,8 @@
"dependencies": {
"@aws-sdk/client-s3": "3.511.0",
"@aws-sdk/lib-storage": "3.511.0",
"fast-glob": "^3.3.2",
"globby": "^14.0.1",
"mrmime": "2.0.0",
"winston": "^3.11.0",
"zod": "3.22.4"
Expand Down
Loading

0 comments on commit 12cd861

Please sign in to comment.